/* ========== 小伟工作室知识库 - 前台样式 v4 ========== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --bg-sidebar: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --card-bg: #ffffff;
    --card-bg-hover: #fafbff;

    --radius: 8px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

    --sidebar-width: 250px;
    --toc-width: 220px;
    --max-width: 1280px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    --font-mono: "SF Mono", "Cascadia Code", "Consolas", "Fira Code", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px;
}

/* ========== Layout: Sidebar + Main ========== */
.app-layout {
    display: flex;
    min-height: calc(100vh - 60px);
    max-width: var(--max-width);
    margin: 24px auto 0;
    gap: 0;
    padding: 0 28px;
}

/* Sidebar Navigation */
.kb-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 20px;
    padding-bottom: 40px;
}

.kb-sidebar::-webkit-scrollbar { width: 4px; }
.kb-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 10px 8px;
    margin-bottom: 4px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav li { margin-bottom: 1px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 450;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-color: #ddd6fe;
}

.sidebar-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
    border-color: #c7d2fe;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.sidebar-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-alt);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 26px;
    text-align: center;
}

.sidebar-nav a.active .sidebar-badge {
    background: var(--primary);
    color: #fff;
}

/* Sidebar Quick Tips */
.sidebar-tips {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 8px;
}

.sidebar-tips h4 {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-tips ul {
    list-style: none;
    font-size: 12px;
    color: #a16207;
    line-height: 2;
    padding-left: 4px;
}

.sidebar-tips code {
    background: #fde68a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: #92400e;
    font-weight: 600;
}

/* Main Content Area */
.kb-main {
    flex: 1;
    min-width: 0;
    padding-bottom: 60px;
}

/* ========== Header ========== */
.site-header {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
}

.site-header.scrolled { box-shadow: 0 1px 8px rgba(0,0,0,0.06); }

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 20px;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text) !important;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.logo-icon {
    width: 34px; height: 34px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.logo-suffix {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
}

/* Header Search */
.header-search {
    position: relative;
    width: 280px;
}

.header-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
    background: #fff;
}

.header-search input::placeholder { color: var(--text-muted); }

.header-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.header-btn {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 1px solid transparent;
}

.header-btn:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.menu-toggle span {
    display: block;
    width: 20px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 150;
}

/* ========== Hero (Knowledge Base Style) ========== */
.hero-kb {
    padding: 48px 0 36px;
    position: relative;
}

.hero-kb-inner {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.hero-kb-text { flex: 1; }

.hero-kb-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid #ddd6fe;
}

.hero-kb-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.25;
    margin-bottom: 12px;
    color: var(--text);
}

.hero-kb-title span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-kb-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 520px;
    margin-bottom: 24px;
}

.hero-search-box {
    display: flex;
    max-width: 540px;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    background: #fff;
}

.hero-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.08);
}

.hero-search-box input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    font-size: 15px;
    outline: none;
    background: transparent;
    color: var(--text);
}

.hero-search-box input::placeholder { color: var(--text-muted); }

.hero-search-box button {
    padding: 14px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.hero-search-box button:hover { background: var(--primary-dark); }

/* Hero Stats */
.hero-stats-row {
    display: flex;
    gap: 16px;
    margin-top: 28px;
}

.hero-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: var(--transition);
}

.hero-stat-item:hover { border-color: #c7d2fe; box-shadow: var(--shadow-sm); }

.hero-stat-icon {
    width: 38px; height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.hero-stat-icon.blue { background: #dbeafe; color: #2563eb; }
.hero-stat-icon.green { background: #d1fae5; color: #059669; }
.hero-stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.hero-stat-icon.amber { background: #fef3c7; color: #d97706; }

.hero-stat-info { display: flex; flex-direction: column; }

.hero-stat-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.hero-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== Knowledge Category Cards ========== */
.section-kb { padding: 36px 0; }

.section-kb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-kb-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-kb-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

.section-kb-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.section-kb-more:hover { background: var(--primary-light); }

/* Knowledge Grid */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Knowledge Card (Document style) */
.kb-card {
    display: flex;
    gap: 16px;
    padding: 20px 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    color: var(--text) !important;
    cursor: pointer;
    position: relative;
}

.kb-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kb-card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    font-weight: 700;
}

.kb-card-icon.office { background: #dbeafe; color: #2563eb; }
.kb-card-icon.adobe { background: #fee2e2; color: #dc2626; }
.kb-card-icon.cad { background: #d1fae5; color: #059669; }
.kb-card-icon.d3d { background: #ede9fe; color: #7c3aed; }
.kb-card-icon.default { background: var(--bg-alt); color: var(--text-secondary); }

.kb-card-body { flex: 1; min-width: 0; }

.kb-card-name {
    font-size: 15px;
    font-weight: 650;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.kb-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.kb-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.kb-card-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-alt);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 550;
    color: var(--text-muted);
}

.kb-card-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.kb-card-badge.new { background: var(--success-light); color: var(--success); }
.kb-card-badge.hot { background: var(--danger-light); color: var(--danger); }

/* ========== Category Header ========== */
.cat-header {
    padding: 28px 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-muted); margin: 0 2px; }

.cat-header-content { display: flex; align-items: center; gap: 18px; }

.cat-icon-large {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cat-header-text h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.cat-header-text p { font-size: 14px; color: var(--text-secondary); }
.cat-header-count { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ========== Article List (for category/search) ========== */
.article-list { display: flex; flex-direction: column; gap: 10px; }

.article-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 18px 22px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    color: var(--text) !important;
}

.article-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.article-item-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}

.article-item-body { flex: 1; min-width: 0; }

.article-item-title {
    font-size: 16px;
    font-weight: 650;
    color: var(--text);
    margin-bottom: 4px;
    transition: var(--transition);
}

.article-item:hover .article-item-title { color: var(--primary); }

.article-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 6px;
}

.article-item-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.article-tag {
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 550;
}

.article-tag.version { background: var(--primary-light); color: var(--primary); }
.article-tag.cat { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }
.article-tag.featured { background: #fef3c7; color: #92400e; }

.article-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    justify-content: center;
}

.article-meta-text { font-size: 12px; color: var(--text-muted); }

.article-read-btn {
    padding: 6px 18px;
    background: var(--primary);
    color: #fff !important;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.article-read-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ========== Detail / Document Page ========== */
.doc-layout {
    display: flex;
    gap: 36px;
    padding: 28px 0;
}

.doc-main { flex: 1; min-width: 0; }

/* TOC Sidebar */
.doc-toc {
    width: var(--toc-width);
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-bottom: 40px;
}

.doc-toc::-webkit-scrollbar { width: 4px; }
.doc-toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.toc-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.toc-card h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.toc-list { list-style: none; }

.toc-list li { margin-bottom: 2px; }

.toc-list a {
    display: block;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 5px;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.toc-list a:hover, .toc-list a.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 60px;
    left: 0;
    height: 3px;
    background: var(--primary-gradient);
    z-index: 200;
    transition: width 0.1s linear;
}

/* Doc Header */
.doc-header {
    padding-bottom: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.doc-header h1 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.3;
    margin: 8px 0 14px;
}

.doc-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.doc-meta-tag {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.doc-meta-tag.version { background: var(--primary-light); color: var(--primary); }
.doc-meta-tag.category { background: var(--bg-alt); color: var(--text-secondary); border: 1px solid var(--border); }
.doc-meta-tag.views { background: #fff; color: var(--text-muted); border: 1px solid var(--border); }
.doc-meta-tag.featured { background: #fef3c7; color: #92400e; }
.doc-meta-tag.date { background: #fff; color: var(--text-muted); border: 1px solid var(--border); }

/* Doc Content Blocks */
.doc-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    margin-bottom: 18px;
}

.doc-block-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

/* Download section in doc style */
.download-box {
    background: linear-gradient(135deg, #faf5ff 0%, #eef2ff 100%);
    border: 1px solid #ddd6fe;
    border-radius: var(--radius-md);
    padding: 24px 28px;
    margin-bottom: 18px;
}

.download-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-box .hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

.password-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 14px;
    color: #92400e;
    font-weight: 500;
}

.password-bar .pwd-value {
    background: #fef3c7;
    padding: 3px 10px;
    border-radius: 5px;
    font-weight: 700;
    font-family: var(--font-mono);
    cursor: pointer;
    border: 1px dashed #d97706;
    transition: var(--transition);
}

.password-bar .pwd-value:hover { background: #fde68a; }

.download-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--primary);
    color: #fff !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}

.dl-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

/* Document Content (for article body) */
.doc-content { color: var(--text-secondary); }
.doc-content h2 { font-size: 20px; font-weight: 700; color: var(--text); margin: 24px 0 14px; }
.doc-content h3 { font-size: 17px; font-weight: 650; color: var(--text); margin: 20px 0 10px; }
.doc-content p { margin-bottom: 14px; font-size: 15px; line-height: 1.85; }
.doc-content ul, .doc-content ol { margin: 10px 0 14px 22px; }
.doc-content li { margin-bottom: 6px; font-size: 14px; line-height: 1.8; }
.doc-content img { max-width: 100%; border-radius: var(--radius); margin: 12px 0; border: 1px solid var(--border); }
.doc-content code { background: #f1f5f9; padding: 3px 7px; border-radius: 4px; font-size: 13px; color: #e11d48; font-family: var(--font-mono); }
.doc-content blockquote {
    background: #f8fafc;
    border-left: 4px solid #6366f1;
    padding: 12px 18px;
    margin: 14px 0;
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tips box in doc style */
.doc-tips {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin: 18px 0;
}

.doc-tips h4 { font-size: 14px; font-weight: 700; color: #92400e; margin-bottom: 10px; }
.doc-tips ul { list-style: none; }
.doc-tips li {
    font-size: 13px;
    color: #a16207;
    padding: 4px 0 4px 20px;
    position: relative;
    line-height: 1.8;
}
.doc-tips li::before {
    content: '';
    position: absolute;
    left: 0; top: 12px;
    width: 6px; height: 6px;
    background: #d97706;
    border-radius: 50%;
}
.doc-tips code { background: #fde68a; padding: 2px 6px; border-radius: 3px; font-size: 12px; color: #92400e; font-family: var(--font-mono); }

/* Related articles at bottom */
.related-section {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.related-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.related-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text) !important;
    transition: var(--transition);
}

.related-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.related-card-name { font-size: 14px; font-weight: 600; }
.related-card-version { font-size: 12px; color: var(--text-muted); }

/* Share bar */
.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.share-bar span { font-weight: 600; }
.share-btn-doc {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    background: #fff;
    font-family: inherit;
    transition: var(--transition);
}
.share-btn-doc:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Info card in TOC area */
.doc-info-card {
    margin-top: 14px;
}
.doc-info-card .info-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}
.doc-info-card .info-row:last-child { border-bottom: none; }
.doc-info-card .info-row .key { color: var(--text-muted); }
.doc-info-card .info-row .val { font-weight: 600; color: var(--text); }

/* ========== Search Result ========== */
.search-bar-page {
    padding: 20px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.search-bar-page form { display: flex; gap: 0; max-width: 600px; }

.search-bar-page input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--border);
    border-radius: 10px 0 0 10px;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}
.search-bar-page input:focus { border-color: var(--primary); }

.search-bar-page button {
    padding: 12px 24px;
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    border-radius: 0 10px 10px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.search-bar-page button:hover { background: var(--primary-dark); }

.result-summary { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; }

/* ========== Pagination ========== */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 32px; }

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px; height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.pagination a:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

/* ========== Sitemap / All Articles ========== */
.sitemap-block { margin-bottom: 32px; }

.sitemap-block-title {
    font-size: 18px;
    font-weight: 700;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--primary-light);
    display: flex; align-items: center; gap: 8px;
}

.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.sitemap-link {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text) !important;
    font-size: 14px;
    font-weight: 450;
    transition: var(--transition);
}
.sitemap-link:hover { border-color: var(--primary); background: var(--primary-light); }
.sitemap-link .ver { font-size: 12px; color: var(--text-muted); }

/* ========== 404 ========== */
.error-page { padding: 80px 20px; text-align: center; }
.error-code {
    font-size: 120px; line-height: 1;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.error-page h2 { font-size: 22px; margin: 10px 0; }
.error-page p { color: var(--text-secondary); margin-bottom: 24px; font-size: 15px; }
.error-actions { display: flex; justify-content: center; gap: 10px; }

/* ========== Empty State ========== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon {
    width: 72px; height: 72px;
    background: var(--bg-alt);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
}
.empty-state h2 { font-size: 20px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; }

/* ========== Buttons ========== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 20px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff !important; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.25); }
.btn-secondary { background: var(--bg-alt); color: var(--text) !important; border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-outline { background: transparent; color: var(--primary) !important; border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff !important; }

/* ========== Toast ========== */
.toast-container { position: fixed; top: 72px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3s forwards;
    max-width: 340px;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(80px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(80px); } }

/* ========== Footer ========== */
.site-footer {
    background: #f8fafc;
    border-top: 1px solid var(--border);
    padding: 40px 0 28px;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-brand { max-width: 280px; }
.footer-brand .logo { margin-bottom: 10px; font-size: 16px; }
.footer-brand p { font-size: 13px; color: var(--text-muted); line-height: 1.8; }

.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }

.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { font-size: 13px; color: var(--text-secondary); transition: var(--transition); }
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 28px;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== Back to Top ========== */
.back-to-top {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 40px; height: 40px;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    opacity: 0; visibility: hidden;
    z-index: 99;
    display: flex; align-items: center; justify-content: center;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .app-layout { padding: 0 20px; margin-top: 16px; }
    .doc-layout { flex-direction: column; }
    .doc-toc {
        display: none; /* hide TOC on tablet, show inside doc if needed */
    }
    .footer-links { gap: 24px; }
    .hero-kb-inner { flex-direction: column; gap: 24px; }
    .sitemap-grid { grid-template-columns: repeat(2, 1fr); }
    .kb-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .kb-sidebar {
        position: fixed;
        top: 0; left: 0;
        bottom: 0;
        width: 280px;
        background: #fff;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        max-height: 100vh;
        top: 0;
    }
    .kb-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

    .app-layout { padding: 0 16px; margin-top: 12px; flex-direction: column; }

    .menu-toggle { display: flex; }

    .header-search { display: none; }
    .header-search.mobile { display: block; width: 100%; margin-top: 8px; }

    .hero-kb { padding: 28px 0 20px; }
    .hero-kb-title { font-size: 24px; }
    .hero-stats-row { flex-wrap: wrap; gap: 8px; }
    .hero-stat-item { flex: 1; min-width: 140px; }

    .kb-grid { grid-template-columns: 1fr; }
    .sitemap-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr 1fr; }

    .cat-header-content { flex-wrap: wrap; }
    .article-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .article-item-meta { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }

    .doc-block { padding: 20px; }
    .download-btns { flex-direction: column; }
    .dl-btn { justify-content: center; }

    .footer-inner { flex-direction: column; gap: 24px; }
    .footer-links { flex-direction: column; gap: 20px; }

    .container { padding: 0 16px; }
    .search-bar-page { padding: 12px 0 16px; }
    .search-bar-page form { flex-direction: column; }
    .search-bar-page input { border-radius: 10px; margin-bottom: 8px; }
    .search-bar-page button { border-radius: 10px; width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
    .sitemap-grid { grid-template-columns: 1fr; }
    .hero-stat-item { min-width: 120px; padding: 8px 12px; }
}
