/* ===================================================================
 * app.css · 页面级样式
 * 补充 common 组件库之外的页面布局、导航、页脚、卡片网格等样式。
 * 所有颜色引用 common.css 的 --ys-color-* 变量，不硬编码色值。
 * =================================================================== */

/* ─── 基础布局（覆盖 common.css 的全屏滚动锁定） ─── */
* { box-sizing: border-box; }
html, body {
    height: auto !important;
    overflow: auto !important;
}
#app {
    height: auto !important;
}
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--ys-color-bg, #f4f6f9);
    color: var(--ys-color-text, #2c3e50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.site-main {
    min-height: calc(100vh - 200px);
}
.container {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 16px;
}
.content-editor-page {
    max-width: 1240px;
    padding: 20px 16px 40px;
}
.content-editor-head {
    margin-bottom: 14px;
}
.content-editor-head h1 {
    margin: 10px 0 0;
    font-size: 24px;
}
.content-editor-card {
    padding: 18px 20px;
}
.content-editor-card .form-group {
    margin-bottom: 12px;
}
.content-editor-card .form-row {
    flex-direction: row;
    gap: 12px;
}
.content-editor-card .EasyMDEContainer,
.content-editor-card .CodeMirror {
    width: 100%;
}
.content-editor-card .CodeMirror {
    min-height: 300px;
}
.content-editor-card .editor-toolbar {
    border-color: var(--ys-color-border);
    display: flex;
    flex-wrap: wrap;
    height: auto;
    min-height: 38px;
    overflow: hidden;
}
.content-editor-card .form-row + div {
    margin-top: 14px !important;
}
.content-editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: nowrap;
}
.content-editor-actions .btn {
    min-width: 92px;
    text-align: center;
}
.content-editor-card input,
.content-editor-card textarea,
.content-editor-card select,
.content-editor-card .search-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.content-editor-card textarea.search-input {
    min-height: 80px;
    resize: vertical;
}
.content-editor-card .form-row .form-group {
    flex: 1;
}
.content-editor-card .form-row > * {
    min-width: 0;
}
.content-editor-card .editor-toolbar button {
    flex: 0 0 auto;
}

/* ─── 导航栏 ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ys-color-surface, #fff);
    border-bottom: 1px solid var(--ys-color-border, #e2e8f0);
    backdrop-filter: blur(8px);
}
.nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ys-color-text);
    flex-shrink: 0;
}
.nav-avatar {
    border-radius: 50%;
    border: 2px solid var(--ys-color-border);
}
.nav-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
}
.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}
.nav-link {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--ys-color-text-muted, #64748b);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover {
    color: var(--ys-color-text);
    background: var(--ys-color-bg-soft, #eef3ff);
}
.nav-link.is-active {
    color: var(--ys-color-primary, #4a7dff);
    background: var(--ys-color-bg-soft, #eef3ff);
    font-weight: 600;
}
.shell-admin-link { color: var(--ys-color-text-muted); font-size: 13px; text-decoration: none; }
.shell-admin-link:hover { color: var(--ys-color-primary); }

.nav-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.cmdk-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--ys-color-border);
    border-radius: 6px;
    background: var(--ys-color-bg, #f4f6f9);
    color: var(--ys-color-text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.cmdk-btn:hover { border-color: var(--ys-color-primary); }
.cmdk-btn kbd {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
}
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--ys-color-border);
    border-radius: 6px;
    background: var(--ys-color-surface);
    color: var(--ys-color-text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--ys-color-primary); color: var(--ys-color-primary); }

/* ─── CmdK 面板 ─── */
.cmdk-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}
.cmdk-panel {
    width: 480px;
    max-width: 90vw;
    background: var(--ys-color-surface);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    overflow: hidden;
}
.cmdk-input {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid var(--ys-color-border);
    background: transparent;
    font-size: 15px;
    color: var(--ys-color-text);
    outline: none;
}
.cmdk-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmdk-item {
    display: block;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--ys-color-text);
    font-size: 14px;
    transition: background 0.1s;
}
.cmdk-item:hover { background: var(--ys-color-bg-soft); }
.cmdk-empty { padding: 20px; text-align: center; color: var(--ys-color-text-muted); font-size: 13px; }

/* ─── 页脚 ─── */
.site-footer {
    margin-top: 64px;
    border-top: 1px solid var(--ys-color-border);
    background: var(--ys-color-surface);
}
.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 24px;
    text-align: center;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}
.footer-links a {
    color: var(--ys-color-text-muted);
    text-decoration: none;
    font-size: 13px;
}
.footer-links a:hover { color: var(--ys-color-primary); }
.footer-records {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.footer-records .record {
    color: var(--ys-color-text-muted);
    text-decoration: none;
    font-size: 12px;
}
.footer-copy { font-size: 12px; color: var(--ys-color-text-muted); margin: 0; }

/* ─── Hero 区 ─── */
.hero {
    padding: 48px 0 32px;
}
.hero-compact { padding: 32px 0 20px; }
.hero h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: var(--ys-color-text);
}
.hero .lead {
    font-size: 15px;
    color: var(--ys-color-text-muted);
    margin: 0;
    max-width: 560px;
}

/* ─── 主区 + 侧栏布局 ─── */
.with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 860px) {
    .with-sidebar { grid-template-columns: 1fr; }
    .sidebar { order: -1; }
}
/* 空 sidebar：移动端隐藏避免占空隙。
   适用于 tools.js 等只渲染主区内容、侧栏无内容的页面。
   桌面端保留为 300px 占位，以保持主区宽度与首页/博客/资源一致。 */
@media (max-width: 860px) {
    .sidebar:empty { display: none; }
}

/* ─── 卡片网格 ─── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
@media (max-width: 640px) {
    .card-grid { grid-template-columns: 1fr; }
}

/* ─── 文章卡片 ─── */
.post-card {
    display: block;
    position: relative;
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: var(--ys-color-text);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.post-card-accent {
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 100%;
    border-radius: 3px 0 0 3px;
}
.post-card-accent[data-variant="1"] { background: #5b8def; }
.post-card-accent[data-variant="2"] { background: #e8734a; }
.post-card-accent[data-variant="3"] { background: #43a87f; }
.post-card-accent[data-variant="4"] { background: #9b6dd7; }
.post-card-accent[data-variant="5"] { background: #d4a843; }
.post-card-accent[data-variant="0"] { background: #6b7b8f; }
.post-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.post-card-type {
    font-size: 11px;
    font-weight: 600;
    color: var(--ys-color-primary);
    background: var(--ys-color-bg-soft);
    padding: 2px 8px;
    border-radius: 4px;
}
.post-card-meta { font-size: 12px; color: var(--ys-color-text-muted); }
.post-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-excerpt {
    font-size: 13px;
    color: var(--ys-color-text-muted);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── 资源卡片 ─── */
.app-card {
    display: block;
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
    border-radius: 10px;
    padding: 18px;
    text-decoration: none;
    color: var(--ys-color-text);
    transition: transform 0.15s, box-shadow 0.15s;
}
.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.app-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.app-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}
.app-card-icon[data-variant="1"] { background: #5b8def; }
.app-card-icon[data-variant="2"] { background: #e8734a; }
.app-card-icon[data-variant="3"] { background: #43a87f; }
.app-card-icon[data-variant="4"] { background: #9b6dd7; }
.app-card-icon[data-variant="5"] { background: #d4a843; }
.app-card-icon[data-variant="0"] { background: #6b7b8f; }
.app-card-name { font-weight: 600; font-size: 15px; }
.app-card-desc { font-size: 12px; color: var(--ys-color-text-muted); margin-top: 2px; }
.app-card-foot { display: flex; align-items: center; gap: 8px; }

/* ─── 标签/药丸 ─── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid var(--ys-color-border);
    background: var(--ys-color-surface);
    color: var(--ys-color-text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.pill:hover { border-color: var(--ys-color-primary); color: var(--ys-color-primary); }
.pill-accent {
    background: var(--ys-color-bg-soft);
    border-color: var(--ys-color-primary);
    color: var(--ys-color-primary);
    font-weight: 500;
}
.pill-like { cursor: pointer; user-select: none; }
.pill-like .heart {
    color: #fff;
    -webkit-text-stroke: 1px var(--ys-color-text-muted);
    text-shadow: 0 0 1px var(--ys-color-text-muted);
    transition: color 0.15s, -webkit-text-stroke-color 0.15s;
}
.pill-like:hover .heart,
.pill-like.is-liked .heart {
    color: #e25555;
    -webkit-text-stroke-color: #e25555;
    text-shadow: none;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ─── 侧栏卡片 ─── */
.sidebar .side-card {
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}
.side-card-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── 排行榜 ─── */
.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    text-decoration: none;
    color: var(--ys-color-text);
    border-bottom: 1px solid var(--ys-color-border-light, #f0f0f0);
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
    width: 22px; height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--ys-color-bg);
    color: var(--ys-color-text-muted);
    flex-shrink: 0;
}
.rank-num-top { background: var(--ys-color-primary); color: #fff; }
.rank-text { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-meta { font-size: 12px; color: var(--ys-color-text-muted); flex-shrink: 0; }

/* ─── 详情页 ─── */
.detail-hero { padding: 32px 0 24px; }
.detail-hero h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    margin: 12px 0 8px;
    letter-spacing: -0.02em;
}
.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--ys-color-text-muted);
}
.detail-meta-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ys-color-text-muted); }

/* ─── Markdown 正文 ─── */
.md { font-size: 15px; line-height: 1.8; }
.md h1, .md h2, .md h3 { margin-top: 1.5em; margin-bottom: 0.5em; font-weight: 700; }
.md h2 { font-size: 22px; padding-bottom: 6px; border-bottom: 1px solid var(--ys-color-border); }
.md h3 { font-size: 18px; }
.md p { margin: 0.8em 0; }
.md code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    background: var(--ys-color-bg);
    padding: 2px 5px;
    border-radius: 4px;
}
.md pre {
    background: var(--ys-color-bg);
    border: 1px solid var(--ys-color-border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}
.md pre code { background: none; padding: 0; }
.md img { max-width: 100%; border-radius: 8px; }
.md a { color: var(--ys-color-primary); }
.md blockquote {
    border-left: 3px solid var(--ys-color-primary);
    margin: 1em 0;
    padding: 8px 16px;
    background: var(--ys-color-bg-soft);
    border-radius: 0 6px 6px 0;
}
.md table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.md th, .md td { border: 1px solid var(--ys-color-border); padding: 8px 12px; font-size: 14px; }
.md th { background: var(--ys-color-bg); font-weight: 600; }

/* ─── TOC ─── */
.toc-link {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    color: var(--ys-color-text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 10px;
    transition: color 0.15s, border-color 0.15s;
}
.toc-link:hover { color: var(--ys-color-primary); border-left-color: var(--ys-color-primary); }
.toc-l3 { padding-left: 22px; font-size: 12px; }
.toc-empty { font-size: 13px; color: var(--ys-color-text-muted); }

/* ─── 搜索框 ─── */
.search-input {
    padding: 7px 14px;
    border: 1px solid var(--ys-color-border);
    border-radius: 6px;
    background: var(--ys-color-surface);
    color: var(--ys-color-text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--ys-color-primary); }
.search-input-w { width: 220px; }

/* ─── 列表页骨架（list-page.js 共用） ─── */
.list-loading { padding: 40px; text-align: center; color: var(--ys-color-text-muted); }
.pager-wrap { margin-top: 20px; }
.empty-state-action { margin-top: 12px; }
.date-picker-slot { display: inline-block; }
.home-top { padding-top: 60px; }

/* ─── 空状态 ─── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
    border-radius: 10px;
}
.empty-state-icon { font-size: 40px; opacity: 0.4; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state-desc { font-size: 13px; color: var(--ys-color-text-muted); }

/* ─── 工具栏 ─── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.toolbar-title { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.toolbar-sub { font-size: 13px; color: var(--ys-color-text-muted); margin-top: 2px; }

/* ─── 按钮补充 ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--ys-color-border);
    background: var(--ys-color-surface);
    color: var(--ys-color-text);
    transition: all 0.15s;
}
.btn:hover { border-color: var(--ys-color-primary); color: var(--ys-color-primary); }
.btn-primary {
    background: var(--ys-color-primary);
    border-color: var(--ys-color-primary);
    color: var(--ys-color-on-primary, #fff);
}
.btn-primary:hover { opacity: 0.9; color: var(--ys-color-on-primary, #fff); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ─── 统计面板 ─── */
.stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.stat-item {
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
    border-radius: 8px;
    padding: 14px 20px;
    min-width: 100px;
    text-align: center;
}
.stat-num { font-size: 22px; font-weight: 700; color: var(--ys-color-primary); }
.stat-label { font-size: 12px; color: var(--ys-color-text-muted); margin-top: 2px; }

/* ─── 关于卡片 ─── */
.about-row { display: flex; gap: 12px; align-items: flex-start; }
.about-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ys-color-border); }
.about-name { font-weight: 700; font-size: 15px; }
.about-bio { font-size: 13px; color: var(--ys-color-text-muted); margin-top: 2px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-item {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--ys-color-bg);
    color: var(--ys-color-text-muted);
    border: 1px solid var(--ys-color-border-light, #eee);
}

/* ─── 列表项 ─── */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    text-decoration: none;
    color: var(--ys-color-text);
    border-bottom: 1px solid var(--ys-color-border-light, #f0f0f0);
}
.list-item:last-child { border-bottom: none; }
.list-item-title { font-size: 14px; font-weight: 500; }
.list-item-sub { font-size: 12px; color: var(--ys-color-text-muted); }

/* ─── 产品详情（资源） ─── */
.product-icon-lg {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}
.product-icon-lg[data-variant="1"] { background: #5b8def; }
.product-icon-lg[data-variant="2"] { background: #e8734a; }
.product-icon-lg[data-variant="3"] { background: #43a87f; }
.product-icon-lg[data-variant="4"] { background: #9b6dd7; }
.product-icon-lg[data-variant="5"] { background: #d4a843; }
.product-icon-lg[data-variant="0"] { background: #6b7b8f; }

/* ─── 详情页共用（blog.js / hotspot.js / resource.js） ─── */
.detail-loading { padding: 60px 24px; text-align: center; color: var(--ys-color-text-muted); }
.lead-no-margin { margin-bottom: 0; }
.detail-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-footer { text-align: center; margin-top: 32px; }
.about-avatar-sm { width: 40px; height: 40px; }
.about-name-sm { font-size: 14px; }
.side-card-links { display: flex; flex-direction: column; gap: 8px; }
.detail-hero-app { display: flex; align-items: flex-start; gap: 16px; margin-top: 16px; }
.detail-hero-app h1 { margin: 0 0 8px; }
.app-card-icon-lg { width: 56px; height: 56px; font-size: 24px; }
.resource-info { padding: 24px; }

/* ─── 下载卡 ─── */
.download-card { margin-top: 24px; }
.download-card .btn { margin: 4px 0; }

/* ─── 管理页表单 ─── */
.admin-form { max-width: 800px; }
.admin-form .form-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-form .form-row > * { flex: 1; min-width: 150px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 768px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-preview {
    border: 1px solid var(--ys-color-border);
    border-radius: 8px;
    padding: 16px;
    overflow-y: auto;
    max-height: 500px;
    background: var(--ys-color-surface);
}

/* ─── 表单样式 ─── */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--ys-color-text);
}
.form-label .required {
    color: #e05252;
}
.form-row {
    display: flex;
    gap: 12px;
}
@media (max-width: 640px) {
    .form-row { flex-direction: column; }
}

/* ─── 信息表格 ─── */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.info-table tr {
    border-bottom: 1px solid var(--ys-color-border);
}
.info-table tr:last-child { border-bottom: none; }
.info-table td {
    padding: 10px 8px;
    vertical-align: top;
}
.info-label {
    width: 90px;
    color: var(--ys-color-text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

/* ─── 日期筛选 ─── */
.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--ys-color-text-muted);
    flex-wrap: wrap;
}

/* ─── 工具页通用（json/base64/time/image 共用） ─── */
.tk-page-pad { padding-top: 28px; padding-bottom: 48px; }
.text-ok { color: #43a87f; }
.text-err { color: #e05252; }
.chip-thumb { border-radius: 2px; object-fit: cover; }
.mt-18 { margin-top: 18px; }

/* ─── 404 错误页 ─── */
.error-page { padding: 120px 24px; text-align: center; }
.error-code { font-size: 96px; font-weight: 700; margin: 0; color: var(--ys-color-primary); font-family: 'JetBrains Mono', monospace; }
.error-title { font-size: 28px; margin: 16px 0 8px; }
.error-desc { font-size: 14px; color: var(--ys-color-text-muted); margin-bottom: 32px; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── 工具面板（通用） ─── */
.tk-panel {
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
    border-radius: 10px;
    overflow: hidden;
}
.tk-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 20px 16px 14px;
    border-bottom: 1px solid var(--ys-color-border);
}
.tk-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}
.tk-subtitle {
    font-size: 13px;
    color: var(--ys-color-text-muted);
}
.tk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ys-color-border);
    background: var(--ys-color-bg, #f8f9fb);
}
.tk-toolbar-left, .tk-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tk-divider {
    width: 1px;
    height: 18px;
    background: var(--ys-color-border);
    margin: 0 4px;
}
.tk-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--ys-color-border);
    font-size: 12px;
    color: var(--ys-color-text-muted);
    flex-wrap: wrap;
}
.tk-stats strong { color: var(--ys-color-text); }
.tk-stats-right { margin-left: auto; font-size: 11px; opacity: 0.7; }
.tk-status { font-weight: 600; }
.tk-arrow { opacity: 0.5; }

/* ─── 编辑器双栏 ─── */
.tk-editor {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    min-height: 60vh;
}
.tk-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.tk-pane-divider {
    background: var(--ys-color-border);
}
.tk-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--ys-color-border);
    min-height: 34px;
}
.tk-pane-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ys-color-text-muted);
}
.tk-area {
    flex: 1;
    width: 100%;
    min-height: 45vh;
    padding: 14px 16px;
    border: none;
    outline: none;
    resize: vertical;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.7;
    background: transparent;
    color: var(--ys-color-text);
}
.tk-area::placeholder { color: var(--ys-color-text-muted); opacity: 0.6; }
.tk-area[readonly] { background: var(--ys-color-bg, #f8f9fb); }
pre.tk-area {
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
pre.tk-area code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.7;
}
.tk-hl { background: var(--ys-color-bg, #f8f9fb); }

/* ─── 错误提示 ─── */
.tk-error {
    display: none;
    padding: 8px 16px;
    font-size: 12px;
    color: #e05252;
    background: rgba(224, 82, 82, 0.06);
    border-top: 1px solid rgba(224, 82, 82, 0.15);
    cursor: pointer;
}
.tk-error.is-show { display: block; }

/* ─── Tabs ─── */
.tk-tabs { display: flex; gap: 2px; }
.tk-tab {
    padding: 3px 10px;
    font-size: 12px;
    border: 1px solid var(--ys-color-border);
    border-radius: 4px;
    background: transparent;
    color: var(--ys-color-text-muted);
    cursor: pointer;
    transition: all 0.12s;
}
.tk-tab:hover { border-color: var(--ys-color-primary); color: var(--ys-color-primary); }
.tk-tab.is-active {
    background: var(--ys-color-primary);
    border-color: var(--ys-color-primary);
    color: #fff;
}

/* ─── 树视图 ─── */
.tk-tree {
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    overflow: auto;
    max-height: 400px;
    background: var(--ys-color-bg, #f8f9fb);
}
.t-key { color: var(--ys-color-primary); }
.t-str { color: #43a87f; }
.t-num { color: #e8734a; }
.t-bool { color: #9b6dd7; }
.t-null { color: var(--ys-color-text-muted); }
.t-toggle { cursor: pointer; user-select: none; opacity: 0.6; }
.t-toggle:hover { opacity: 1; }

/* ─── 替换栏 ─── */
.tk-replace {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ys-color-border);
    background: var(--ys-color-bg, #f8f9fb);
}
.tk-replace-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tk-replace-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ys-color-text-muted);
    margin-left: 8px;
}
.tk-replace-label:first-child { margin-left: 0; }
.tk-replace-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}
.tk-replace-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid var(--ys-color-border);
    border-radius: 4px;
    font-size: 12px;
    background: var(--ys-color-surface);
    color: var(--ys-color-text);
}

/* ─── 拖放区 ─── */
.tk-dropzone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px dashed var(--ys-color-border);
    font-size: 12px;
    color: var(--ys-color-text-muted);
    cursor: pointer;
    transition: all 0.12s;
}
.tk-dropzone:hover, .tk-dropzone.is-drag {
    color: var(--ys-color-primary);
    background: var(--ys-color-bg-soft, #eef3ff);
}

/* ─── 图片 chip ─── */
.tk-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--ys-color-bg);
    border: 1px solid var(--ys-color-border);
    font-size: 12px;
}
.tk-chip-x {
    background: none;
    border: none;
    color: var(--ys-color-text-muted);
    cursor: pointer;
    padding: 0 2px;
    font-size: 13px;
}

/* ─── 图片预览 ─── */
.tk-img-preview {
    padding: 12px 16px;
    border-top: 1px solid var(--ys-color-border);
}
.tk-img-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    object-fit: contain;
}
.tk-img-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.tk-meta-text { font-size: 12px; color: var(--ys-color-text-muted); font-family: monospace; }

/* ─── 历史记录 ─── */
.tk-history {
    border-top: 1px solid var(--ys-color-border);
}
.tk-history-toggle {
    display: block;
    width: 100%;
    padding: 8px 24px;
    border: none;
    background: var(--ys-color-bg, #f8f9fb);
    font-size: 12px;
    color: var(--ys-color-text-muted);
    cursor: pointer;
    text-align: left;
}
.tk-history-toggle:hover { color: var(--ys-color-primary); }
.tk-history-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 4px 12px;
}
.tk-history-empty {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--ys-color-text-muted);
}
.tk-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.1s;
}
.tk-history-item:hover { background: var(--ys-color-bg-soft, #eef3ff); }
.tk-history-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    color: var(--ys-color-text);
}
.tk-history-time { flex-shrink: 0; margin-left: 12px; color: var(--ys-color-text-muted); font-size: 11px; }

/* ─── Toggle 开关 ─── */
.tk-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--ys-color-text-muted);
}
.tk-toggle input { display: none; }
.tk-toggle-track {
    width: 32px;
    height: 18px;
    border-radius: 9px;
    background: var(--ys-color-border);
    position: relative;
    transition: background 0.15s;
}
.tk-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s;
}
.tk-toggle input:checked + .tk-toggle-track {
    background: var(--ys-color-primary);
}
.tk-toggle input:checked + .tk-toggle-track::after {
    transform: translateX(14px);
}

/* ─── 信息栏 + 其他工具 ─── */
.tk-info {
    margin-top: 20px;
    padding: 16px 16px;
    border: 1px solid var(--ys-color-border);
    border-radius: 8px;
    background: var(--ys-color-surface);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tk-info-item {
    display: flex;
    gap: 12px;
    align-items: baseline;
    font-size: 13px;
    color: var(--ys-color-text-muted);
}
.tk-info-label {
    flex-shrink: 0;
    width: 70px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ys-color-primary);
}
.tk-info-item code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: var(--ys-color-bg);
    padding: 1px 5px;
    border-radius: 3px;
}
.tk-others {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 14px 20px;
    border: 1px solid var(--ys-color-border);
    border-radius: 8px;
    background: var(--ys-color-surface);
    flex-wrap: wrap;
}
.tk-others-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ys-color-text-muted);
}
.tk-others-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--ys-color-border);
    text-decoration: none;
    color: var(--ys-color-text);
    font-size: 13px;
    transition: all 0.12s;
}
.tk-others-link:hover {
    border-color: var(--ys-color-primary);
    color: var(--ys-color-primary);
}
.tk-others-icon { font-size: 14px; }

/* ─── 图片压缩专用 ─── */
.img-compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    min-height: 60vh;
}
.img-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.img-pane-head {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ys-color-text-muted);
    border-bottom: 1px solid var(--ys-color-border);
}
.img-pane-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-height: 280px;
    position: relative;
    background: var(--ys-color-bg, #f8f9fb);
}
.img-pane-foot {
    padding: 8px 16px;
    border-top: 1px solid var(--ys-color-border);
    font-size: 12px;
    color: var(--ys-color-text-muted);
    font-family: monospace;
}
.img-divider {
    width: 1px;
    background: var(--ys-color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.img-ratio-badge {
    position: absolute;
    min-width: 60px;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--ys-color-surface);
    border: 2px solid var(--ys-color-border);
    font-size: 12px;
    font-weight: 700;
    font-family: monospace;
    color: var(--ys-color-text-muted);
    text-align: center;
    white-space: nowrap;
    z-index: 2;
}
.img-ratio-badge.is-success { color: #43a87f; border-color: #43a87f; background: rgba(67,168,127,0.06); }
.img-ratio-badge.is-warn { color: #e8734a; border-color: #e8734a; background: rgba(232,115,74,0.06); }
.img-ratio-badge.is-error { color: #e05252; border-color: #e05252; }
.img-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    min-height: 240px;
    border: 2px dashed var(--ys-color-border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s;
    padding: 20px;
}
.img-dropzone:hover, .img-dropzone.is-drag {
    border-color: var(--ys-color-primary);
    background: var(--ys-color-bg-soft, #eef3ff);
}
.img-dropzone-icon { font-size: 36px; opacity: 0.5; }
.img-dropzone-title { font-size: 14px; font-weight: 600; color: var(--ys-color-text); }
.img-dropzone-hint { font-size: 12px; color: var(--ys-color-text-muted); }
.img-dropzone-tip { font-size: 11px; color: var(--ys-color-text-muted); opacity: 0.7; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--ys-color-border); }
.img-preview-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
    background-image: linear-gradient(45deg, var(--ys-color-border) 25%, transparent 25%), linear-gradient(-45deg, var(--ys-color-border) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--ys-color-border) 75%), linear-gradient(-45deg, transparent 75%, var(--ys-color-border) 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    opacity: 0.95;
}
.img-preview { max-width: 100%; max-height: 50vh; object-fit: contain; display: block; }
.img-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--ys-color-text-muted);
    font-size: 13px;
}
.img-empty-icon { font-size: 32px; opacity: 0.4; }
.img-params {
    padding: 14px 16px;
    border-top: 1px solid var(--ys-color-border);
    background: var(--ys-color-bg, #f8f9fb);
}
.img-param-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.img-param-group { display: flex; flex-direction: column; gap: 4px; }
.img-param-label { font-size: 12px; font-weight: 600; color: var(--ys-color-text-muted); }
.img-select {
    padding: 6px 10px;
    border: 1px solid var(--ys-color-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--ys-color-surface);
    color: var(--ys-color-text);
}
.img-param-hint { font-size: 12px; color: var(--ys-color-text-muted); align-self: center; }
.img-download {
    padding: 14px 16px;
    border-top: 1px solid var(--ys-color-border);
}
.img-download .btn-block {
    width: 100%;
    height: 42px;
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
}
.img-download .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tk-mode-btn.is-active {
    background: var(--ys-color-primary);
    border-color: var(--ys-color-primary);
    color: #fff;
}

/* ─── 手绘成图 ─── */
.tk-page-switcher {
    border-top: 1px solid var(--ys-color-border);
}
.draw-view {
    display: none;
}
.draw-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ys-color-border);
    background: var(--ys-color-bg, #f8f9fb);
}
.draw-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ys-color-text-muted);
}
.draw-tool-group {
    display: flex;
    gap: 4px;
}
.draw-tool-btn.is-active {
    background: var(--ys-color-primary);
    border-color: var(--ys-color-primary);
    color: #fff;
}
.draw-toolbar .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.draw-control input[type="color"] {
    width: 36px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--ys-color-border);
    border-radius: 6px;
    background: var(--ys-color-surface);
    cursor: pointer;
}
.draw-format-control {
    margin-left: auto;
}
.draw-canvas-wrap {
    width: 100%;
    padding: 16px;
    background-color: var(--ys-color-bg, #f8f9fb);
    background-image: linear-gradient(45deg, var(--ys-color-border) 25%, transparent 25%), linear-gradient(-45deg, var(--ys-color-border) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--ys-color-border) 75%), linear-gradient(-45deg, transparent 75%, var(--ys-color-border) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.draw-svg {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
    min-height: 280px;
    margin: 0 auto;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}
.draw-svg.is-eraser {
    cursor: cell;
}
@media (max-width: 700px) {
    .draw-toolbar {
        align-items: center;
        padding: 12px;
        gap: 8px;
    }
    .draw-format-control {
        width: 100%;
        margin-left: 0;
    }
    .draw-format-control .img-select {
        flex: 1;
    }
    .draw-canvas-wrap {
        padding: 8px;
    }
}
.draw-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--ys-color-border);
    font-size: 12px;
    color: var(--ys-color-text-muted);
    font-family: monospace;
}

/* ─── 时间戳工具专用 ─── */
.tm-clock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    margin-bottom: 20px;
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
    border-radius: 10px;
}
.tm-clock-time {
    font-size: 28px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}
.tm-clock-date { font-size: 13px; color: var(--ys-color-text-muted); margin-top: 2px; }
.tm-clock-right { display: flex; gap: 10px; }
.tm-clock-ts {
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--ys-color-bg);
    border: 1px solid var(--ys-color-border);
    font-size: 12px;
    font-family: monospace;
    cursor: pointer;
    transition: border-color 0.12s;
}
.tm-clock-ts:hover { border-color: var(--ys-color-primary); }
.tm-section {
    border-bottom: 1px solid var(--ys-color-border);
}
.tm-section:last-child { border-bottom: none; }
.tm-section-title {
    padding: 12px 16px 0;
    font-size: 14px;
    font-weight: 700;
}
.tm-section-body { padding: 12px 16px 18px; }
.tm-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.tm-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--ys-color-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--ys-color-surface);
    color: var(--ys-color-text);
    outline: none;
    transition: border-color 0.12s;
}
.tm-input:focus { border-color: var(--ys-color-primary); }
.tm-select {
    padding: 8px 10px;
    border: 1px solid var(--ys-color-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--ys-color-surface);
    color: var(--ys-color-text);
}
.tm-hint { font-size: 11px; color: var(--ys-color-text-muted); margin-top: 6px; }
.tm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tm-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.tm-field-label { font-size: 12px; font-weight: 600; color: var(--ys-color-text-muted); }
.tm-result {
    display: none;
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    background: var(--ys-color-bg, #f8f9fb);
    border: 1px solid var(--ys-color-border);
}
.tm-result.is-show { display: block; }
.tm-result-big {
    font-size: 18px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 6px;
}
.tm-result-desc { font-size: 13px; color: var(--ys-color-text-muted); margin-bottom: 8px; }
.tm-result-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tm-chip {
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--ys-color-surface);
    border: 1px solid var(--ys-color-border);
    font-size: 12px;
    font-family: monospace;
    cursor: pointer;
    transition: border-color 0.12s;
}
.tm-chip:hover { border-color: var(--ys-color-primary); }
.tm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tm-table th, .tm-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--ys-color-border);
    text-align: left;
}
.tm-table th { font-size: 11px; font-weight: 600; color: var(--ys-color-text-muted); }
.tm-table .mono { font-family: monospace; }
.tm-clickable { cursor: pointer; }
.tm-clickable:hover { color: var(--ys-color-primary); }
.tm-muted { color: var(--ys-color-text-muted); font-size: 12px; }
.tm-qt-grid { display: flex; flex-direction: column; gap: 10px; }
.tm-qt-group-label { font-size: 11px; font-weight: 700; color: var(--ys-color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.tm-qt-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
}
.tm-qt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-radius: 6px;
    border: 1px solid var(--ys-color-border);
    background: var(--ys-color-surface);
    cursor: pointer;
    transition: all 0.12s;
    font-size: 12px;
}
.tm-qt-item:hover { border-color: var(--ys-color-primary); }
.tm-qt-item.copied { border-color: #43a87f; background: rgba(67,168,127,0.06); }
.tm-qt-label { color: var(--ys-color-text); }
.tm-qt-ts { font-family: monospace; color: var(--ys-color-text-muted); font-size: 11px; }

/* ─── 工具页响应式 ─── */
@media (max-width: 768px) {
    .tk-editor { grid-template-columns: 1fr; grid-template-rows: 1fr 1px 1fr; }
    .tk-pane-divider { height: 1px; width: 100%; }
    .img-compare { grid-template-columns: 1fr; grid-template-rows: 1fr auto 1fr; }
    .img-divider { width: 100%; height: 1px; }
    .tm-clock { flex-direction: column; gap: 12px; align-items: flex-start; }
    .tm-input-row { flex-direction: column; align-items: stretch; }
    .tm-qt-group { grid-template-columns: 1fr 1fr; }
}

/* ─── 响应式 ─── */
@media (max-width: 640px) {
    .nav { padding: 0 16px; gap: 12px; }
    .nav-name { display: none; }
    .cmdk-text { display: none; }
    .cmdk-btn kbd { display: none; }
    .container { padding: 0 16px; }
    .hero h1 { font-size: 24px; }
    .hero { padding: 32px 0 20px; }
    .stats-row { gap: 10px; }
    .stat-item { min-width: 70px; padding: 10px 14px; }
}

/* ============================================================
 * 业务卡片 / 列表 样式（由 blog-card / resource-card / tool-card 业务组件生成）
 *  - .biz-icon          头部图标槽位（icon 字段）
 *  - .post-foot         卡片底部 footer 布局（左侧 pill / 右侧 like）
 *  - .tool-tags         工具卡标签组
 *  - .tool-arrow        工具卡 → 箭头
 *  - .biz-summary       摘要文本
 *  - .rank-num-*        侧边栏 TOP5 排名数字（.rank-num 原有样式保留，这里补尺寸/颜色微调）
 * ============================================================ */

/* ─── 业务图标槽位 ─── */
.biz-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}
.biz-icon-letter {
    font-family: var(--ys-font-display, sans-serif);
    font-weight: 700;
    font-size: 15px;
}
.biz-icon[data-variant="0"] { background: #6b7b8f; }
.biz-icon[data-variant="1"] { background: #5b8def; }
.biz-icon[data-variant="2"] { background: #e8734a; }
.biz-icon[data-variant="3"] { background: #43a87f; }
.biz-icon[data-variant="4"] { background: #9b6dd7; }
.biz-icon[data-variant="5"] { background: #d4a843; }

/* ─── 卡片底部（分类 pill + like） ─── */
.ys-card-footer .post-foot,
.ys-card .post-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}
.biz-summary {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ys-color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── 工具卡底部 ─── */
.tool-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.tool-arrow {
    margin-left: auto;
    font-size: 16px;
    color: var(--ys-color-text-muted);
    transition: transform 0.15s;
}
.ys-card[data-clickable="true"]:hover .tool-arrow { transform: translateX(3px); }

/* ─── 侧边栏 TOP5 排名（renderListSidebar 生成的 rank-num 槽位） ─── */
.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--ys-color-bg);
    color: var(--ys-color-text-muted);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.rank-num-top {
    background: var(--ys-color-primary);
    color: #fff;
}
