@font-face {
    font-family: 'ChineseFont';
    src: url('../fonts/luoliti.ttf') format('truetype');
    font-weight: normal; font-style: normal; font-display: swap;
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+3000-303F, U+FF00-FFEF, U+2E80-2EFF, U+31C0-31EF, U+FE10-FE1F, U+FE30-FE4F;
}
@font-face {
    font-family: 'EnglishFont';
    src: url('../fonts/roundfont.ttf') format('truetype');
    font-weight: normal; font-style: normal; font-display: swap;
    unicode-range: U+0020-007E, U+00A0-00FF, U+0100-017F, U+0180-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F, U+2200-22FF;
}
:root {
    --accent-hue: 220;
    --accent-sat: 60%;
    --accent-lightness: 50%;
    --accent: hsl(var(--accent-hue), var(--accent-sat), var(--accent-lightness));
    --accent-hover: hsl(var(--accent-hue), calc(var(--accent-sat) + 10%), calc(var(--accent-lightness) - 10%));
    --accent-light: hsl(var(--accent-hue), var(--accent-sat), 90%);
    --code-bg: hsl(var(--accent-hue), var(--accent-sat), 96%);
    --bg: hsl(var(--accent-hue), 60%, 96%);
    --surface: #ffffff;
    --border: #dce7f5;
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
    --radius: 14px;
    --radius-sm: 10px;
    --header-height: 56px;
    --fixed-icon-bg: #f0f4ff;
    --fixed-icon-color: #6b7a99;
    --base-font-size: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'EnglishFont', 'ChineseFont', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: var(--base-font-size);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    transition: font-size 0.2s;
}
code, pre, .markdown-body code, .markdown-body pre {
    font-family: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}
.top-bar {
    position: sticky; top: 0; z-index: 100;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; height: var(--header-height);
    transition: transform 0.3s;
}
.reading-progress {
    position: fixed; top: 0; left: 0; z-index: 200;
    width: 0%; height: 3px;
    background: var(--accent);
    transition: width 0.1s linear;
    pointer-events: none;
    opacity: 0;
}
.reading-progress.active { opacity: 1; }
.top-bar.hidden { transform: translateY(-100%); }
.header-left { display: flex; align-items: center; }
.brand { font-size: 14px; font-weight: 650; color: var(--text-secondary); letter-spacing: 0.01em; }
.header-right { display: flex; align-items: center; gap: 6px; }
.icon-btn {
    width: 36px; height: 36px; border-radius: 8px;
    background: transparent; border: none; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.icon-btn:hover { color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dropdown-panel {
    position: fixed; top: var(--header-height); left: 50%;
    transform: translateX(-50%) translateY(-12px);
    width: 90%; max-width: 540px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
    z-index: 200; opacity: 0; pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    overflow: hidden; max-height: 70vh;
    display: flex; flex-direction: column;
}
.dropdown-panel.active { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.dropdown-search { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dropdown-search input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--bg); color: var(--text); outline: none; }
.dropdown-list { flex: 1; overflow-y: auto; padding: 8px; }
.font-panel-inner { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.font-type-buttons { display: flex; gap: 8px; }
.font-type-btn {
    flex: 1; padding: 10px 16px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text);
    font-size: 14px; cursor: pointer; text-align: center; transition: all 0.2s;
}
.font-type-btn:hover { border-color: var(--accent); color: var(--accent); }
.font-type-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.font-size-slider { display: flex; align-items: center; gap: 12px; }
.font-size-slider input[type="range"] {
    flex: 1; -webkit-appearance: none;
    height: 6px; border-radius: 3px; background: var(--border); outline: none;
}
.font-size-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px;
    border-radius: 50%; background: var(--accent); cursor: pointer;
}
.font-size-value { min-width: 40px; text-align: center; font-size: 14px; color: var(--text-secondary); }
.color-panel-content { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.color-panel-header { display: flex; align-items: center; justify-content: space-between; }
.color-panel-title { font-size: 14px; font-weight: 600; color: var(--text); }
.color-reset-btn {
    padding: 4px 14px; border: 1px solid var(--border);
    border-radius: 20px; background: transparent;
    color: var(--text-secondary); font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.color-reset-btn:hover { border-color: var(--accent); color: var(--accent); }
.hue-track {
    position: relative; width: 100%; height: 24px; border-radius: 12px;
    background: linear-gradient(to right,
        hsl(0,80%,60%), hsl(30,80%,60%), hsl(60,80%,55%),
        hsl(90,70%,50%), hsl(120,60%,50%), hsl(150,60%,50%),
        hsl(180,65%,50%), hsl(210,75%,55%), hsl(240,70%,60%),
        hsl(270,65%,60%), hsl(300,60%,60%), hsl(330,70%,60%),
        hsl(360,80%,60%)
    );
    cursor: pointer; user-select: none;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.hue-thumb {
    position: absolute; top: 50%; left: 61.1%;
    transform: translate(-50%, -50%);
    width: 28px; height: 28px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08),
                0 0 0 2px rgba(255,255,255,0.9);
    pointer-events: none; transition: box-shadow 0.15s;
}
.hue-track:active .hue-thumb {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.1),
                0 0 0 3px rgba(255,255,255,0.95), 0 0 0 5px var(--accent);
}
.color-preview-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    background: var(--bg); border: 1px solid var(--border);
}
.color-preview-swatch {
    width: 32px; height: 32px; border-radius: 10px;
    background: var(--accent); flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
    transition: background 0.2s;
}
.color-preview-label {
    font-size: 13px; color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.color-reset-btn {
    padding: 6px 16px; border: 1px solid var(--border);
    border-radius: 8px; background: var(--surface);
    color: var(--text-secondary); font-size: 13px;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.color-reset-btn:hover { border-color: var(--accent); color: var(--accent); }
.main-container { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.sidebar {
    display: none;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px;
    background: var(--surface); border-right: 1px solid var(--border);
    z-index: 120; overflow: hidden;
    flex-direction: column;
}
.sidebar-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.sidebar-brand { font-size: 15px; font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sidebar-brand svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 2; }
.sidebar-search {
    padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-search input {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text);
    font-size: 13px; font-family: inherit; outline: none;
    transition: border-color 0.2s;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-list {
    flex: 1; overflow-y: auto; padding: 8px;
}
.sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; cursor: pointer;
    transition: background 0.15s; margin-bottom: 2px;
    text-decoration: none; color: var(--text);
}
.sidebar-item:hover { background: var(--bg); }
.sidebar-item.active { background: var(--accent); color: #fff; }
.sidebar-item-icon {
    width: 32px; height: 32px; border-radius: 6px;
    background: var(--accent-light); color: var(--accent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-item.active .sidebar-item-icon { background: rgba(255,255,255,0.2); color: #fff; }
.sidebar-item-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.sidebar-item-text {
    flex: 1; min-width: 0;
    font-size: 14px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-pin-icon { display: inline-flex; align-items: center; justify-content: center; margin-right: 3px; color: var(--accent); vertical-align: middle; position: relative; top: -1px; }
.sidebar-lock-icon { display: inline-flex; align-items: center; justify-content: center; margin-right: 3px; color: var(--accent); vertical-align: middle; position: relative; top: -1px; }
.sidebar-count {
    font-size: 12px; color: var(--text-muted); background: var(--bg);
    padding: 2px 8px; border-radius: 10px;
}
.sidebar-item.active .sidebar-count { background: rgba(255,255,255,0.2); color: #fff; }
.sidebar-toc-header {
    padding: 14px 16px 8px; font-size: 13px; font-weight: 600;
    color: var(--text-muted); display: none; flex-shrink: 0;
}
.sidebar-toc-list { display: none; flex: 1; overflow-y: auto; }
.sidebar-toc-list .toc-item {
    padding: 5px 12px 5px 12px; margin-bottom: 1px;
    border-radius: 6px; transition: all 0.15s;
    border-left: 2px solid transparent;
}
.sidebar-toc-list .toc-item:hover { background: var(--bg); }
.sidebar-toc-list .toc-item.active {
    background: var(--accent-light); color: var(--accent);
    border-left-color: var(--accent); font-weight: 600;
}
.sidebar-toc-list .toc-text { font-size: 0.85em; line-height: 1.5; }
.sidebar-toc-list .toc-block { width: 18px; height: 18px; border-radius: 4px; }
.sidebar-toc-list .toc-block svg { width: 11px; height: 11px; }
.sidebar-toc-list .toc-dot-circle { width: 5px; height: 5px; }
.sidebar-toc-list .toc-item[data-level="2"] .toc-text { font-size: 0.82em; }
.sidebar-toc-list .toc-item[data-level="3"] .toc-text { font-size: 0.78em; color: var(--text-muted); }
.sidebar-article-title {
    padding: 14px 16px 10px; font-size: 14px; font-weight: 600;
    color: var(--text); border-bottom: 1px solid var(--border);
    display: none; flex-shrink: 0;
    line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-back-btn {
    display: none; align-items: center; gap: 6px;
    padding: 8px 16px; font-size: 13px; color: var(--text-muted);
    cursor: pointer; transition: all 0.15s; flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.sidebar-back-btn:hover { color: var(--accent); background: var(--bg); }
.sidebar-back-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.sidebar-resize {
    position: absolute; top: 0; right: -3px; bottom: 0;
    width: 6px; cursor: col-resize; z-index: 121;
    transition: background 0.2s;
}
.sidebar-resize:hover { background: var(--accent); opacity: 0.5; }
@media (min-width: 1025px) {
    .sidebar { display: flex; }
    body { padding-left: 280px; }
    .top-bar { left: 0; width: 100%; }
    .reading-progress { left: 280px; }
    .main-container { max-width: 860px; padding: 24px 40px 60px; }
    .floating-buttons .float-btn:not(#scrollToTopBtn):not(#floatHomeBtn) { display: none; }
    .floating-buttons { right: 24px; bottom: 24px; }
    .toc-popup { display: none !important; }
    .top-bar .icon-btn[id="btnSearch"],
    .top-bar .icon-btn[id="btnToc"] { display: none; }
    .markdown-body { padding: 36px 40px; }
    .markdown-body h1 { font-size: 2.2em; }
    .markdown-body h2 { font-size: 1.6em; }
    .markdown-body h3 { font-size: 1.3em; }
    .markdown-body p { font-size: 1.02em; line-height: 1.65; }
    .markdown-body pre { margin: 2em 0; }
    .prev-next-nav { margin-top: 24px; }
    .prev-next-btn { padding: 20px 24px; }
}
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.doc-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
    cursor: pointer; display: flex; flex-direction: column; gap: 10px;
    width: 100%; min-width: 0;
    animation: fadeSlideUp 0.4s ease both;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.card-title { font-size: 1.15em; font-weight: 650; color: var(--text); }
.card-pin-icon { display: inline-flex; align-items: center; justify-content: center; margin-right: 4px; color: var(--accent); vertical-align: middle; position: relative; top: -1px; }
.card-lock-icon { display: inline-flex; align-items: center; justify-content: center; margin-right: 4px; color: var(--accent); vertical-align: middle; position: relative; top: -1px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.82em; color: var(--text-muted); }
.card-meta span { display: inline-flex; align-items: center; }
.meta-icon {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-light); border-radius: 6px; padding: 3px; margin-right: 4px;
    color: var(--accent);
}
.meta-icon svg { width: 14px; height: 14px; stroke: var(--accent); fill: none; }
.card-excerpt { font-size: 0.9em; color: var(--text-secondary); overflow-wrap: break-word; word-break: break-word; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.card-author { font-size: 0.82em; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.card-author .meta-icon { background: var(--accent-light); margin-right: 4px; }
/* Card cover image with feathering */
.doc-card.has-cover { flex-direction: row; align-items: stretch; gap: 0; overflow: hidden; }
.doc-card.has-cover .card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-right: 20px; }
.card-cover { flex: 0 0 50%; position: relative; overflow: hidden; border-radius: 0 var(--radius) var(--radius) 0; margin: -20px -20px -20px 0; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, var(--surface) 0%, var(--surface) 20%, transparent 80%); pointer-events: none; }
@media (max-width: 600px) { .card-cover { flex: 0 0 45%; } }
.tag { background: var(--accent-light); color: var(--accent); padding: 2px 8px; border-radius: 4px; font-size: 0.75em; font-weight: 500; }
.category-bar {
    display: none;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    gap: 6px;
}
.category-bar.has-categories { display: flex; }
.category-bar-left {
    display: flex; align-items: center; flex-shrink: 0;
}
.category-bar-right {
    display: flex; align-items: center; flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 6px;
}
.category-bar-right::-webkit-scrollbar { display: none; }
.category-bar-divider {
    width: 1px; height: 18px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 4px;
}
.category-bar-item {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.82em;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.category-bar-item:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.category-bar-item.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}
.category-bar-item.active .category-bar-count {
    color: rgba(255,255,255,0.75);
}
.category-bar-count {
    font-size: 0.78em;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0.7;
}



/* === Widget Glassmorphism === */
body.widget-glass .top-bar {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
body.widget-glass .float-btn {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
body.widget-glass .float-btn:hover {
    background: rgba(255, 255, 255, 0.75) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
body.widget-glass .dropdown-panel,
body.widget-glass .toc-popup,
body.widget-glass .music-popup {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
body.widget-glass .icon-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Dark theme */
[data-theme="dark"] body.widget-glass .top-bar {
    background: rgba(30, 40, 55, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] body.widget-glass .float-btn {
    background: rgba(30, 40, 55, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] body.widget-glass .float-btn:hover {
    background: rgba(40, 50, 70, 0.7) !important;
}
[data-theme="dark"] body.widget-glass .dropdown-panel,
[data-theme="dark"] body.widget-glass .toc-popup,
[data-theme="dark"] body.widget-glass .music-popup {
    background: rgba(22, 27, 34, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] body.widget-glass .icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* === Card Glassmorphism === */
body.card-glass .doc-card,
body.card-glass .category-bar,
body.card-glass .top-bar,
body.card-glass .markdown-body,
body.card-glass .comment-section,
body.card-glass .cmt-input-box,
body.card-glass .cmt-user-bar,
body.card-glass .prev-next-nav,
body.card-glass .share-card,
body.card-glass .article-info-card {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(var(--card-glass-blur, 16px)) saturate(1.8);
    -webkit-backdrop-filter: blur(var(--card-glass-blur, 16px)) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
body.card-glass .doc-card:hover {
    background: rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
body.card-glass .category-bar {
    box-shadow: none;
}
body.card-glass .top-bar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

/* Dark theme */
[data-theme="dark"] body.card-glass .doc-card,
[data-theme="dark"] body.card-glass .category-bar,
[data-theme="dark"] body.card-glass .top-bar,
[data-theme="dark"] body.card-glass .markdown-body,
[data-theme="dark"] body.card-glass .comment-section,
[data-theme="dark"] body.card-glass .cmt-input-box,
[data-theme="dark"] body.card-glass .cmt-user-bar,
[data-theme="dark"] body.card-glass .prev-next-nav,
[data-theme="dark"] body.card-glass .share-card,
[data-theme="dark"] body.card-glass .article-info-card {
    background: rgba(30, 40, 55, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] body.card-glass .doc-card:hover {
    background: rgba(35, 45, 65, 0.65) !important;
}
[data-theme="dark"] body.card-glass .top-bar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.doc-card:focus-visible, .sidebar-item:focus-visible, .icon-btn:focus-visible, .float-btn:focus-visible, .prev-next-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.reading-view { display: none; animation: fadeIn 0.3s ease; }
.reading-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.markdown-body {
    word-wrap: break-word; padding: 40px 36px;
    background: var(--surface); line-height: 1.6;
    border-radius: 16px; box-shadow: var(--shadow);
}
.doc-header { margin-bottom: 24px; }
.doc-header .doc-stats { display: flex; align-items: center; gap: 16px; color: var(--fixed-icon-color); font-size: 0.85em; margin-bottom: 12px; }
.doc-stats .stat-item { display: flex; align-items: center; gap: 6px; }
.doc-stats .stat-item .meta-icon { background: var(--fixed-icon-bg) !important; color: var(--fixed-icon-color) !important; }
.doc-stats .stat-item .meta-icon svg { stroke: var(--fixed-icon-color) !important; }
.doc-header .doc-title { font-size: 2em; font-weight: 700; color: var(--text); line-height: 1.3; margin-bottom: 12px; }
.doc-header .doc-info { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-muted); align-items: center; }
.doc-info .info-item { display: flex; align-items: center; gap: 4px; }
.doc-info .tag-list { display: inline-flex; align-items: center; gap: 6px; }
.doc-info .tag-list .meta-icon {
    font-size: 14px; font-weight: 600;
    line-height: 1; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; background: var(--accent-light); color: var(--accent); margin-right: 0;
    padding: 2px 4px;
}
.doc-info .tag-list .tag-text { color: var(--text-muted); font-size: 0.85em; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    margin-top: 2em; margin-bottom: 0.8em; font-weight: 700; letter-spacing: -0.01em;
    position: relative; scroll-margin-top: 80px;
}
.markdown-body h1 { font-size: 2em; border-bottom: 2px solid var(--border); padding-bottom: 0.4em; margin-top: 0; }
.markdown-body h2 { font-size: 1.5em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1.1em; color: var(--text-secondary); }
.markdown-body h1 .heading-anchor, .markdown-body h2 .heading-anchor,
.markdown-body h3 .heading-anchor, .markdown-body h4 .heading-anchor {
    position: absolute; left: -1.5em; top: 50%; transform: translateY(-50%);
    font-size: 0.8em; color: var(--text-muted); cursor: pointer;
    opacity: 0; transition: opacity 0.2s; text-decoration: none;
    border-bottom: none !important;
}
.markdown-body h1:hover .heading-anchor, .markdown-body h2:hover .heading-anchor,
.markdown-body h3:hover .heading-anchor, .markdown-body h4:hover .heading-anchor {
    opacity: 0.6;
}
.markdown-body .heading-anchor:hover { opacity: 1 !important; color: var(--accent); }
.markdown-body p { margin-bottom: 0.8em; color: var(--text-secondary); font-size: 1em; }
.markdown-body p.toc-link { margin-bottom: 0.35em; padding-left: 16px; position: relative; }
.markdown-body p.toc-link::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.markdown-body p.toc-link a { font-weight: 500; }
.markdown-body ul, .markdown-body ol { list-style: none; padding-left: 0; margin: 1em 0; }
.markdown-body li { margin-bottom: 0.4em; color: var(--text-secondary); }
.markdown-body li::before { content: '\2022'; color: var(--accent); font-weight: 700; margin-right: 8px; }
.markdown-body blockquote {
    margin: 1.5em 0; padding: 16px 20px;
    border-left: 4px solid var(--accent);
    background: var(--accent-light); border-radius: 0 12px 12px 0;
    color: var(--text-secondary); font-style: italic;
}
.markdown-body hr { border: none; height: 1px; background: var(--border); margin: 2em 0; }
.markdown-body strong { color: var(--text); font-weight: 650; }
.markdown-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.markdown-body a:hover { border-bottom-color: var(--accent); }
.markdown-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 1em 0; }
.markdown-body code {
    background: #f0f0f0; padding: 2px 6px; border-radius: 6px;
    font-size: 0.85em; font-weight: 500;
    color: #e45649; border: 1px solid #e8e8e8;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}
.markdown-body a code {
    color: var(--accent); border-color: var(--accent-light);
    background: var(--accent-light);
}
.markdown-body pre {
    position: relative;
    background: #fafafa; border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
    margin: 1.8em 0;
}
.markdown-body pre::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 1px; background: #d0d0d0;
    z-index: 3; pointer-events: none;
}
.markdown-body pre code {
    display: block;
    background: none;
    font-size: 0.88em; line-height: 1.7;
    overflow-x: auto; white-space: pre;
    tab-size: 4;
    counter-reset: line;
}
.markdown-body pre code.hljs {
    padding: 16px;
    color: #383a42;
    white-space: pre;
    word-wrap: normal;
    overflow-x: auto;
}
.markdown-body pre code .line {
    display: block;
}
.markdown-body pre code .line::before {
    content: none;
}
.markdown-body pre.collapsible {
    transition: background-color 0.2s ease;
}
.markdown-body pre.collapsible code {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.markdown-body pre.collapsed code {
    max-height: 5.5rem;
    overflow: hidden;
}
.markdown-body pre.collapsed code::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 2.5rem;
    background: linear-gradient(to bottom, transparent 0%, #fafafa 90%);
    pointer-events: none;
}
[data-theme="dark"] .markdown-body pre.collapsed code::after {
    background: linear-gradient(to bottom, transparent 0%, #1e1e2e 90%);
}
.collapse-btn {
    position: absolute; top: 6px; right: 46px;
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.85);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted);
    opacity: 0; transition: all 0.2s; z-index: 5;
}
.markdown-body pre:hover .collapse-btn { opacity: 1; }
.collapse-btn:hover { color: var(--accent); background: #fff; }
.collapse-btn:active { transform: scale(0.9); }
.collapse-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform 0.3s; }
.markdown-body pre.collapsed .collapse-btn svg { transform: rotate(180deg); }
[data-theme="dark"] .collapse-btn { background: rgba(30,30,46,0.85); border-color: #313244; color: #6c7086; }
[data-theme="dark"] .collapse-btn:hover { color: #cdd6f4; background: #313244; }
.code-lang-tag { display: none; }
.copy-btn {
    position: absolute; top: 6px; right: 6px;
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.85);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted);
    opacity: 0; transition: all 0.2s; z-index: 5;
}
.markdown-body pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); background: #fff; }
.copy-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.copy-btn.copied { background: var(--accent); color: #fff; border-color: var(--accent); opacity: 1; }
.markdown-body table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; margin: 1.8em 0; table-layout: auto;
}
.markdown-body th, .markdown-body td {
    white-space: nowrap; border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border); padding: 10px 14px;
    text-align: left; background: var(--surface);
}
.markdown-body th { background: var(--accent-light); font-weight: 600; border-bottom: 2px solid var(--border); }
.markdown-body tr:last-child td { border-bottom: none; }
.markdown-body td:last-child, .markdown-body th:last-child { border-right: none; }
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.8em 0; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 8px; }
.prev-next-nav {
    display: flex; align-items: stretch; margin-top: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.prev-next-btn {
    flex: 1; padding: 16px 20px; cursor: pointer;
    display: flex; align-items: center; gap: 12px;
    background: transparent; border: none; color: var(--text);
    font-family: inherit; font-size: 0.95em;
}
.prev-next-btn:hover { background: var(--bg); }
.prev-next-btn.disabled { opacity: 0.4; pointer-events: none; }
.nav-arrow { font-size: 2em; flex-shrink: 0; font-weight: 700; color: var(--accent); }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.next-btn-wrap .nav-text { text-align: right; }
.prev-divider { width: 1px; background: var(--border); margin: 12px 0; }
.article-bottom-cards {
    display: flex; flex-direction: column; gap: 16px;
    margin-top: 32px; padding-top: 24px;
    border-top: 1px solid var(--border);
}
.markdown-body .article-bottom-cards p { margin-bottom: 0; color: inherit; }
.share-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px 24px;
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px;
}
.share-card-top { display: flex; align-items: flex-start; gap: 10px; }
.share-card-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--accent-light); color: var(--accent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.share-card-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.share-card-title { font-size: 1.05em; font-weight: 650; color: var(--text); }
.share-card-desc { font-size: 0.88em; color: var(--text-secondary); margin-top: 2px; }
.share-card-btn {
    align-self: center; padding: 10px 32px; border-radius: 8px;
    background: var(--accent); color: #fff; border: none;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s; margin-top: 4px;
}
.share-card-btn:hover { opacity: 0.9; }
.share-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 300; display: none; align-items: center; justify-content: center;
}
.share-modal-overlay.active { display: flex; animation: modalFadeIn 0.25s ease; }
.share-modal-overlay.closing { animation: modalFadeOut 0.2s ease forwards; }
.share-modal-overlay.active .share-modal { animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.share-modal-overlay.closing .share-modal { animation: modalSlideOut 0.2s ease forwards; }
.share-modal {
    background: var(--surface); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    max-width: 320px; width: 90%;
}
.share-modal-title { font-weight: 650; font-size: 1.1em; color: var(--text); }
#shareQrcode canvas { border-radius: 8px; }
[data-theme="dark"] #shareQrcode { padding: 12px; background: #fff; border-radius: 12px; display: inline-block; }
.share-modal-close {
    padding: 8px 24px; border-radius: 8px;
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer; font-size: 14px;
    transition: all 0.2s;
}
.share-modal-close:hover { border-color: var(--accent); color: var(--accent); }
.article-info-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px 24px;
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px;
}
.info-card-title { font-size: 1.05em; font-weight: 650; color: var(--text); margin-bottom: 2px; }
.info-card-url {
    font-size: 0.82em; color: var(--accent); word-break: break-all;
    display: inline-block;
}
.info-card-license a {
    color: var(--accent); text-decoration: none;
}
.info-card-license a:hover { text-decoration: underline; }
.info-card-meta {
    display: flex; gap: 24px; font-size: 0.85em; color: var(--text-secondary);
    margin-top: 4px;
}
.info-card-meta-item { display: flex; flex-direction: column; gap: 2px; }
.info-card-meta-label { font-size: 0.78em; color: var(--text-muted); }
.floating-buttons { position: fixed; right: 20px; bottom: 56px; z-index: 150; display: flex; flex-direction: column; gap: 8px; }
.float-btn {
    width: 35px; height: 35px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--accent); transition: all 0.2s;
}
.float-btn:hover { background: var(--accent-light); box-shadow: var(--shadow-md); }
.float-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.toc-popup {
    position: fixed; right: 20px; bottom: 228px; width: 320px; max-height: 55vh;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); z-index: 155; display: flex; flex-direction: column;
    opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 0.2s, transform 0.2s;
}
.toc-popup.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--text); color: var(--surface); padding: 10px 24px;
    border-radius: 10px; font-size: 0.88em; font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 500;
    opacity: 0; transition: all 0.3s ease; pointer-events: none;
    white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toc-popup-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.toc-popup-title { font-weight: 650; font-size: 15px; color: var(--text); }
.toc-popup-list { flex: 1; overflow-y: auto; padding: 8px; }
.music-popup {
    position: fixed; right: 20px; bottom: 228px; width: 300px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); z-index: 155; display: flex; flex-direction: column;
    opacity: 0; pointer-events: none; transform: translateY(10px) scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
    overflow: hidden;
}
.music-lyric-toggle {
    position: absolute; top: 6px; right: 8px; z-index: 10;
    background: none; border: none; cursor: pointer;
    font-size: 12px; color: var(--text-muted); padding: 2px 6px;
    border-radius: 4px; line-height: 1; font-weight: 500;
    transition: color 0.2s, background 0.2s;
}
.music-lyric-toggle:hover { color: var(--accent); background: var(--accent-light); }
.music-lyric-panel { display: none; padding: 0; }
.music-lyric-panel.active { display: block; }
.music-lyric-scroll {
    height: 200px; overflow: hidden; padding: 0 16px;
    text-align: center; line-height: 1.6; font-size: 13px;
    color: var(--text-muted); box-sizing: border-box;
    position: relative;
}
.music-lyric-scroll::-webkit-scrollbar { width: 0; }
.music-lyric-inner {
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
    padding-top: 80px; padding-bottom: 80px;
}
.music-lyric-line {
    transition: color 0.35s ease, font-size 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
    padding: 6px 0; cursor: pointer;
    opacity: 0.3; transform: scale(0.93);
    transform-origin: center center;
}
.music-lyric-line:hover { color: var(--text-secondary); opacity: 0.5; }
.music-lyric-line.active {
    color: var(--accent); font-size: 16px; font-weight: 700;
    padding: 10px 0; opacity: 1; transform: scale(1);
}
.music-lyric-line.near-active {
    opacity: 0.55; transform: scale(0.96);
    color: var(--text-secondary);
}
.lyr-trans { font-size: 11px; color: var(--text-muted); line-height: 1.4; font-weight: 400; margin-top: 2px; }
.music-lyric-line.active .lyr-trans { color: var(--text-secondary); font-size: 12px; }
.lyr-word {
    display: inline;
}
.music-lyric-line .lyr-word { color: var(--text-muted); }
.music-lyric-line.active .lyr-word { color: #b0b8c4; }
.music-lyric-line.active .lyr-word.sung { color: var(--accent); }
.music-lyric-line.active .lyr-word.filling {
    background: linear-gradient(90deg, var(--accent) var(--fill-pct, 0%), #b0b8c4 var(--fill-pct, 0%));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
/* 翻译不加光晕、不参与卡拉OK */
.music-lyric-line .lyr-trans { color: var(--text-muted); }
    filter: drop-shadow(0 0 3px hsla(var(--accent-hue), var(--accent-sat), var(--accent-lightness), 0.5));
}
.music-lyric-hint { padding: 80px 0; color: var(--text-muted); font-size: 13px; }
.music-popup.active { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.music-player-main { display: flex; gap: 12px; padding: 14px 14px 0; align-items: center; }
.music-disc { flex-shrink: 0; position: relative; width: 64px; height: 64px; }
.disc-ring {
    width: 64px; height: 64px; border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent-light), var(--bg), var(--accent-light));
    display: flex; align-items: center; justify-content: center;
    position: relative; animation: discSpin 8s linear infinite; animation-play-state: paused;
}
.disc-ring.spinning { animation-play-state: running; }
@keyframes discSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.disc-cover {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--surface);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.disc-note {
    position: absolute; font-size: 12px; color: var(--accent);
    opacity: 0; animation: noteFloat 2s ease-out infinite;
}
.disc-note:nth-child(2) { color: var(--accent-hover); animation-delay: 0.4s; }
.disc-note:nth-child(3) { color: var(--text-muted); animation-delay: 0.8s; }
@keyframes noteFloat {
    0% { top: 30%; left: 70%; opacity: 0; transform: scale(0.5); }
    30% { opacity: 1; }
    100% { top: -20%; left: 100%; opacity: 0; transform: scale(1.2) rotate(20deg); }
}
.disc-note.paused { animation-play-state: paused; display: none; }
.music-meta { flex: 1; min-width: 0; }
.music-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-artist { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-progress-wrap { padding: 10px 14px 0; }
.music-progress-bar {
    width: 100%; height: 3px; background: var(--border); border-radius: 2px;
    cursor: pointer; position: relative; touch-action: none;
}
.music-progress-bar:hover { height: 4px; }
.music-progress-bar:hover .music-progress-dot { opacity: 1; }
.music-progress-bar.dragging { height: 5px; }
.music-progress-bar.dragging .music-progress-dot { opacity: 1; transform: translateY(-50%) scale(1.6); }
.music-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; }
.music-progress-bar:not(:active) .music-progress-fill { transition: width 0.1s; }
.music-progress-dot {
    position: absolute; top: 50%; right: -4px; transform: translateY(-50%);
    width: 8px; height: 8px; border-radius: 50%; background: var(--surface);
    border: 2px solid var(--accent); box-shadow: var(--shadow-sm);
    opacity: 0; transition: opacity 0.2s, transform 0.15s; pointer-events: none;
}
.music-progress-time { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.music-controls {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; padding: 10px 14px 14px;
}
.music-ctrl-btn {
    width: 30px; height: 30px; border-radius: 50%; border: none;
    background: transparent; color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.music-ctrl-btn:hover { color: var(--accent); }
.music-ctrl-btn svg { width: 16px; height: 16px; }
.music-play-btn { width: 36px; height: 36px; background: var(--accent); color: #fff; }
.music-play-btn:hover { background: var(--accent-hover); color: #fff; }
.music-play-btn svg { width: 18px; height: 18px; }
.music-mode-btn { color: var(--text-muted); }
.music-mode-btn.active { color: var(--accent); }
.music-list-btn { color: var(--text-muted); }
.music-list-btn.active { color: var(--accent); }
.music-list { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; border-top: 1px solid transparent; }
.music-list.open { max-height: 168px; overflow-y: auto; border-top-color: var(--border); }
.music-loading { text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; }
.music-loading a { color: var(--accent); text-decoration: none; }
.music-loading a:hover { text-decoration: underline; }
.music-list-header { padding: 6px 12px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); display: none; }
.music-list.open .music-list-header { display: block; }
.music-popup-count { font-weight: 600; }
.music-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; cursor: pointer; transition: background 0.15s;
}
.music-item:hover { background: var(--bg); }
.music-item.active { background: var(--accent-light); }
.music-item.active .mi-name { color: var(--accent); font-weight: 600; }
.mi-idx { width: 20px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.music-item.active .mi-idx { color: var(--accent); }
.mi-cover { width: 34px; height: 34px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--bg); }
.mi-cover img { width: 100%; height: 100%; object-fit: cover; }
.mi-info { flex: 1; min-width: 0; }
.mi-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-artist { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-dur { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.toc-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: background 0.15s; margin-bottom: 2px; }
.toc-item:hover { background: var(--bg); }
.toc-item.active { background: var(--accent); color: #fff; }
.toc-block { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toc-block svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
.toc-item.active .toc-block { background: rgba(255,255,255,0.3); color: #fff; }
.toc-dot-circle { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.toc-item.active .toc-dot-circle { background: #fff; }
.toc-text { flex: 1; font-size: 0.95em; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-item.active .toc-text { color: #fff; }
.dropdown-item {
    display: flex; flex-direction: row !important; align-items: center;
    gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
    font-size: 14px; transition: background 0.15s; margin-bottom: 2px;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item .file-icon {
    width: 32px; height: 32px; border-radius: 6px;
    background: var(--accent-light); color: var(--accent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dropdown-item .file-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.dropdown-item .file-info { flex: 1; min-width: 0; }
.dropdown-item .file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 641px) {
    .doc-card { transition: all 0.25s ease, border-color 0.2s; }
    .doc-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
    .icon-btn:hover { background: var(--accent-light); }
    .float-btn:hover { transform: scale(1.08); }
    .markdown-body a { transition: color 0.2s, border-color 0.2s; }
    .prev-next-btn:hover .nav-arrow { transform: scale(1.15); }
    .nav-arrow { transition: transform 0.2s; }
    .markdown-body pre { transition: box-shadow 0.2s; }
    .markdown-body pre:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
    .copy-btn { transition: opacity 0.2s, transform 0.15s; }
    .copy-btn:active { transform: scale(0.9); }
    .markdown-body img { cursor: zoom-in; transition: transform 0.3s ease; }
    .markdown-body img:hover { transform: scale(1.02); }
    .top-bar { transition: transform 0.3s, box-shadow 0.3s; }
    .top-bar.hidden { box-shadow: none; }
}
.img-lightbox {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(0,0,0,0.85); display: none;
    align-items: center; justify-content: center;
    cursor: zoom-out; padding: 40px;
    animation: fadeIn 0.2s ease;
}
.img-lightbox.active { display: flex; animation: modalFadeIn 0.2s ease; }
.img-lightbox.closing { animation: modalFadeOut 0.2s ease forwards; }
.img-lightbox img {
    max-width: 95%; max-height: 95%; border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    cursor: default;
}
.img-lightbox-close {
    position: absolute; top: 20px; right: 20px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: none;
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; z-index: 401;
}
.img-lightbox-close svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.img-lightbox-close:hover { background: rgba(255,255,255,0.3); }
@media (max-width: 640px) {
    .cards-grid { grid-template-columns: 1fr; gap: 14px; }
    .main-container { padding: 10px 6px 50px; }
    .category-bar { padding: 6px 8px; border-radius: 14px; gap: 4px; }
    .category-bar-item { padding: 4px 9px; font-size: 0.78em; }
    .category-bar-divider { height: 14px; margin: 0 3px; }
    .top-bar { padding: 0 12px; }
    .markdown-body { padding: 16px 10px; }
    .markdown-body pre code.hljs { padding: 12px 10px 12px 0; }
    .markdown-body pre code.hljs { padding: 12px 10px; }
    .collapse-btn { width: 26px; height: 26px; right: 34px; }
    .collapse-btn svg { width: 13px; height: 13px; }
    .floating-buttons { right: 12px; bottom: 48px; }
    .toc-popup { right: 12px; bottom: 220px; width: 280px; }
    .music-popup { right: 12px; bottom: 220px; width: 280px; }
    .prev-next-nav { flex-direction: column; }
    .prev-divider { width: 100%; height: 1px; margin: 0; }
}
[data-theme="dark"] {
    --bg: hsl(var(--accent-hue), 40%, 8%);
    --surface: #161b22;
    --card-bg: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --text-secondary: #b1bac4;
    --text-muted: #8b949e;
    --accent-light: hsl(var(--accent-hue), var(--accent-sat), 18%);
    --code-bg: #0d1117;
    --fixed-icon-bg: #1c2333;
    --fixed-icon-color: #8b949e;
}
[data-theme="dark"] .markdown-body pre {
    background: #1e1e2e; border-color: #313244;
}
[data-theme="dark"] .markdown-body pre::before {
    background: #484f58;
}
[data-theme="dark"] .markdown-body pre code,
[data-theme="dark"] .markdown-body pre code.hljs {
    color: #cdd6f4;
}
[data-theme="dark"] .code-lang-tag {
    background: #313244; color: #6c7086;
}
[data-theme="dark"] .copy-btn {
    background: rgba(30,30,46,0.85); border-color: #313244; color: #6c7086;
}
[data-theme="dark"] .copy-btn:hover { color: #cdd6f4; background: #313244; }
[data-theme="dark"] .markdown-body pre code .hljs-keyword { color: #cba6f7; font-weight: 500; }
[data-theme="dark"] .markdown-body pre code .hljs-built_in { color: #f9e2af; }
[data-theme="dark"] .markdown-body pre code .hljs-type { color: #f9e2af; font-weight: 500; }
[data-theme="dark"] .markdown-body pre code .hljs-literal { color: #89dceb; }
[data-theme="dark"] .markdown-body pre code .hljs-number { color: #fab387; }
[data-theme="dark"] .markdown-body pre code .hljs-string { color: #a6e3a1; }
[data-theme="dark"] .markdown-body pre code .hljs-template-string { color: #a6e3a1; }
[data-theme="dark"] .markdown-body pre code .hljs-char.escape_ { color: #89dceb; }
[data-theme="dark"] .markdown-body pre code .hljs-comment { color: #6c7086; font-style: italic; }
[data-theme="dark"] .markdown-body pre code .hljs-doctag { color: #cba6f7; }
[data-theme="dark"] .markdown-body pre code .hljs-function { color: #89b4fa; }
[data-theme="dark"] .markdown-body pre code .hljs-title { color: #89b4fa; }
[data-theme="dark"] .markdown-body pre code .hljs-title.class_ { color: #f9e2af; }
[data-theme="dark"] .markdown-body pre code .hljs-title.function_ { color: #89b4fa; }
[data-theme="dark"] .markdown-body pre code .hljs-params { color: #cdd6f4; }
[data-theme="dark"] .markdown-body pre code .hljs-variable { color: #f38ba8; }
[data-theme="dark"] .markdown-body pre code .hljs-template_variable { color: #f38ba8; }
[data-theme="dark"] .markdown-body pre code .hljs-attr { color: #fab387; }
[data-theme="dark"] .markdown-body pre code .hljs-attribute { color: #a6e3a1; }
[data-theme="dark"] .markdown-body pre code .hljs-symbol { color: #89dceb; }
[data-theme="dark"] .markdown-body pre code .hljs-meta { color: #89dceb; }
[data-theme="dark"] .markdown-body pre code .hljs-selector-tag { color: #f38ba8; }
[data-theme="dark"] .markdown-body pre code .hljs-selector-class { color: #f9e2af; }
[data-theme="dark"] .markdown-body pre code .hljs-selector-id { color: #89b4fa; }
[data-theme="dark"] .markdown-body pre code .hljs-tag { color: #a6e3a1; }
[data-theme="dark"] .markdown-body pre code .hljs-name { color: #a6e3a1; }
[data-theme="dark"] .markdown-body pre code .hljs-addition { color: #a6e3a1; background: #1e3a1e; }
[data-theme="dark"] .markdown-body pre code .hljs-deletion { color: #f38ba8; background: #3a1e1e; }
[data-theme="dark"] .markdown-body pre code .hljs-emphasis { font-style: italic; }
[data-theme="dark"] .markdown-body pre code .hljs-strong { font-weight: 700; }
[data-theme="dark"] .markdown-body pre code .hljs-link { color: #89dceb; text-decoration: underline; }
[data-theme="dark"] .markdown-body pre code .hljs-regexp { color: #fab387; }
[data-theme="dark"] .markdown-body pre code .hljs-property { color: #f38ba8; }
[data-theme="dark"] .markdown-body pre code .hljs-operator { color: #cba6f7; }
[data-theme="dark"] .markdown-body pre code .hljs-punctuation { color: #cdd6f4; }
[data-theme="dark"] .markdown-body code {
    background: #313244; border-color: #45475a;
    color: #f38ba8;
}
[data-theme="dark"] .markdown-body a code {
    color: #89b4fa; border-color: #45475a; background: #1e1e2e;
}
[data-theme="dark"] .doc-card:hover { border-color: hsl(var(--accent-hue), var(--accent-sat), 40%); }
[data-theme="dark"] .float-btn:hover { background: #161b22; }
[data-theme="dark"] .share-card,
[data-theme="dark"] .article-info-card { background: #0d1117; }
[data-theme="dark"] .prev-next-nav { background: #161b22; }
[data-theme="dark"] .markdown-body blockquote { background: #1e1e2e; }
[data-theme="dark"] .hue-track { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
[data-theme="dark"] .hue-thumb { background: #1e1e2e; box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2), 0 0 0 2px rgba(30,30,46,0.9); }
[data-theme="dark"] .hue-track:active .hue-thumb { box-shadow: 0 2px 6px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2), 0 0 0 3px rgba(30,30,46,0.95), 0 0 0 5px var(--accent); }
[data-theme="dark"] .color-preview-row { background: #1e1e2e; border-color: #313244; }
[data-theme="dark"] .sidebar { background: #0d1117; border-right-color: #21262d; }
[data-theme="dark"] .sidebar-item:hover { background: #161b22; }
[data-theme="dark"] .sidebar-back-btn:hover { background: #161b22; }
[data-theme="dark"] .sidebar-toc-list .toc-item:hover { background: #161b22; }
[data-theme="dark"] .sidebar-toc-list .toc-item.active { background: rgba(var(--accent-hue), var(--accent-sat), 20%); border-left-color: var(--accent); }
[data-theme="dark"] .heading-anchor { color: #484f58; }
[data-theme="dark"] .heading-anchor:hover { color: var(--accent); }
[data-theme="dark"] body.bg-active::before {
    filter: brightness(0.55) saturate(0.8);
    -webkit-filter: brightness(0.55) saturate(0.8);
}
.doc-card,
.markdown-body,
.comment-section,
.cmt-input-box,
.prev-next-nav,
.share-card,
.article-info-card,
.cmt-capsule-btn,
.cmt-user-inner {
    transition: background 0.3s;
}
body.bg-active { background: none; }
body.bg-active::before {
    content: '';
    position: fixed;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    z-index: -1;
    background-image: var(--bg-url);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
body.bg-blur::before {
    filter: blur(var(--bg-blur-level, 0px));
    -webkit-filter: blur(var(--bg-blur-level, 0px));
}
body:not(.bg-blur) .doc-card,
body:not(.bg-blur) .markdown-body,
body:not(.bg-blur) .comment-section,
body:not(.bg-blur) .cmt-input-box,
body:not(.bg-blur) .prev-next-nav,
body:not(.bg-blur) .share-card,
body:not(.bg-blur) .article-info-card,
body:not(.bg-blur) .cmt-capsule-btn,
body:not(.bg-blur) .cmt-user-inner {
    background: rgba(255, 255, 255, var(--bg-card-opacity, 1));
}
[data-theme="dark"] body:not(.bg-blur) .doc-card,
[data-theme="dark"] body:not(.bg-blur) .markdown-body,
[data-theme="dark"] body:not(.bg-blur) .comment-section,
[data-theme="dark"] body:not(.bg-blur) .cmt-input-box,
[data-theme="dark"] body:not(.bg-blur) .prev-next-nav,
[data-theme="dark"] body:not(.bg-blur) .share-card,
[data-theme="dark"] body:not(.bg-blur) .article-info-card,
[data-theme="dark"] body:not(.bg-blur) .cmt-capsule-btn,
[data-theme="dark"] body:not(.bg-blur) .cmt-user-inner {
    background: rgba(22, 27, 34, var(--bg-card-opacity, 1));
}
body.bg-blur .doc-card,
body.bg-blur .markdown-body,
body.bg-blur .comment-section,
body.bg-blur .cmt-input-box,
body.bg-blur .prev-next-nav,
body.bg-blur .share-card,
body.bg-blur .article-info-card,
body.bg-blur .cmt-capsule-btn,
body.bg-blur .cmt-user-inner {
    background: rgba(255, 255, 255, var(--bg-card-opacity, 0.8));
}
body.bg-blur .doc-card:hover {
    background: rgba(255, 255, 255, calc(var(--bg-card-opacity, 0.8) + 0.05));
}
[data-theme="dark"] body.bg-blur .doc-card,
[data-theme="dark"] body.bg-blur .markdown-body,
[data-theme="dark"] body.bg-blur .comment-section,
[data-theme="dark"] body.bg-blur .cmt-input-box,
[data-theme="dark"] body.bg-blur .prev-next-nav,
[data-theme="dark"] body.bg-blur .share-card,
[data-theme="dark"] body.bg-blur .article-info-card,
[data-theme="dark"] body.bg-blur .cmt-capsule-btn,
[data-theme="dark"] body.bg-blur .cmt-user-inner {
    background: rgba(22, 27, 34, var(--bg-card-opacity, 0.8));
}
[data-theme="dark"] body.bg-blur .doc-card:hover {
    background: rgba(22, 27, 34, calc(var(--bg-card-opacity, 0.8) + 0.05));
}
body.bg-blur .top-bar {
    backdrop-filter: blur(var(--bg-blur-level, 0px));
    -webkit-backdrop-filter: blur(var(--bg-blur-level, 0px));
    background: rgba(255, 255, 255, 0.9);
}
[data-theme="dark"] body.bg-blur .top-bar {
    background: rgba(22, 27, 34, 0.92);
}
body.bg-blur .category-bar {
    backdrop-filter: blur(var(--bg-blur-level, 0px));
    -webkit-backdrop-filter: blur(var(--bg-blur-level, 0px));
    background: rgba(255, 255, 255, var(--bg-card-opacity, 0.8));
}
[data-theme="dark"] body.bg-blur .category-bar {
    background: rgba(22, 27, 34, var(--bg-card-opacity, 0.8));
}
body.bg-blur .sidebar {
    backdrop-filter: blur(var(--bg-blur-level, 0px));
    -webkit-backdrop-filter: blur(var(--bg-blur-level, 0px));
    background: rgba(255, 255, 255, 0.9);
}
[data-theme="dark"] body.bg-blur .sidebar {
    background: rgba(13, 17, 23, 0.92);
}
.comment-section {
    margin-top: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.cmt-input-section {
    margin-top: 16px;
}
.cmt-capsule-section {
    margin-top: 24px;
}
.cmt-capsule-bar { margin-bottom: 16px; }
.cmt-capsule-btn, .cmt-user-inner {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 16px;
    border: 1px solid var(--border); border-radius: 50px;
    background: var(--surface); color: var(--text);
    font-size: 14px; cursor: pointer; font-family: inherit;
    transition: all 0.2s; box-shadow: var(--shadow);
}
.cmt-capsule-btn:hover, .cmt-user-inner:hover { border-color: var(--accent); }
.cmt-capsule-icon {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-light); color: var(--accent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cmt-capsule-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.cmt-capsule-text { color: var(--text-muted); font-size: 13px; }
.cmt-user-bar { margin-bottom: 16px; }
.cmt-user-inner { cursor: pointer; overflow: hidden; }
.cmt-user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; background: #8b95a5;
    overflow: hidden;
}
[data-theme="dark"] .cmt-user-avatar { background: #6b7280; }
.cmt-user-greeting { font-size: 13px; color: var(--text); flex: 1; }
.cmt-logout-btn {
    width: 28px; height: 28px; border-radius: 50%;
    border: none; background: rgba(0,0,0,0.05); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
[data-theme="dark"] .cmt-logout-btn { background: rgba(255,255,255,0.08); }
.cmt-logout-btn:hover { background: #fef2f2; color: #ef4444; }
[data-theme="dark"] .cmt-logout-btn:hover { background: #3a1e1e; }
.cmt-logout-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.cmt-input-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow);
}
.cmt-input-box textarea {
    width: 100%; min-height: 72px; padding: 12px 16px 8px;
    border: none; background: transparent; color: var(--text);
    font-size: 14px; font-family: inherit; line-height: 1.6; resize: none; outline: none;
}
.cmt-input-box textarea::placeholder { color: var(--text-muted); }
.cmt-input-box textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.cmt-input-divider { height: 1px; background: var(--border); margin: 0 16px; }
.cmt-input-bottom { display: flex; align-items: center; justify-content: flex-end; padding: 8px 12px; }
.cmt-send-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 16px; border: none; border-radius: 50px;
    background: var(--text-muted); color: #fff; font-size: 12px;
    font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.cmt-send-btn.has-content { background: var(--accent); }
.cmt-send-btn.has-content:hover { opacity: 0.85; }
.cmt-send-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.cmt-list { display: flex; flex-direction: column; }
.cmt-item { padding: 14px 0; }
.cmt-item + .cmt-item { border-top: 1px solid var(--border); }
.cmt-item:first-child { padding-top: 0; }
.cmt-top { display: flex; gap: 8px; }
.cmt-top.cmt-no-sign { align-items: center; }
.cmt-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden; position: relative;
}
.cmt-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cmt-avatar-text {
    width: 100%; height: 100%; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700; background: #8b95a5;
}
[data-theme="dark"] .cmt-avatar-text { background: #6b7280; }
.cmt-info { flex: 1; min-width: 0; margin-top: -4px; }
.cmt-name-row { display: flex; align-items: center; gap: 6px; }
.cmt-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cmt-time { font-size: 11px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.cmt-sign { font-size: 11px; color: var(--text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt-text { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.cmt-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.cmt-act {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--text-muted); cursor: pointer;
    background: none; border: none; font-family: inherit; transition: color 0.15s; padding: 2px 0;
}
.cmt-act:hover { color: var(--accent); }
.cmt-act.liked { color: #ef4444; }
.cmt-act svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.cmt-act.liked svg { fill: #ef4444; stroke: #ef4444; }
.cmt-reply-expand {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--accent); cursor: pointer;
    background: none; border: none; font-family: inherit;
    margin-left: auto; transition: color 0.15s;
}
.cmt-reply-expand svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform 0.2s; }
.cmt-reply-expand.open svg { transform: rotate(180deg); }
.cmt-reply-list { margin: 8px 0 0; display: none; padding: 4px 0; background: var(--surface); border-radius: 0 0 14px 14px; }
.cmt-reply-list.show { display: block; }
.cmt-reply-item { padding: 10px 0; }
.cmt-reply-item + .cmt-reply-item { border-top: 1px solid var(--border); }
.cmt-reply-top { display: flex; gap: 8px; margin-bottom: 4px; }
.cmt-reply-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden; position: relative;
}
.cmt-reply-avatar .cmt-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cmt-reply-avatar .cmt-avatar-text {
    width: 100%; height: 100%; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700; background: #8b95a5;
}
[data-theme="dark"] .cmt-reply-avatar .cmt-avatar-text { background: #6b7280; }
.cmt-reply-info { flex: 1; min-width: 0; }
.cmt-reply-name-row { display: flex; align-items: center; gap: 8px; }
.cmt-reply-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cmt-reply-time { font-size: 11px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.cmt-reply-text { font-size: 14px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; word-break: break-word; padding-left: 33px; }
.cmt-reply-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; padding-left: 33px; }
.cmt-reply-act {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--text-muted); cursor: pointer;
    background: none; border: none; font-family: inherit; transition: color 0.15s; padding: 1px 0;
}
.cmt-reply-act:hover { color: var(--accent); }
.cmt-reply-act.liked { color: #ef4444; }
.cmt-reply-act svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.cmt-reply-act.liked svg { fill: #ef4444; stroke: #ef4444; }
.cmt-del-btn { color: #ef4444; }
.cmt-del-btn svg { stroke: #ef4444; }
.cmt-del-btn:hover { opacity: 0.7; }
.cmt-reply-nested { margin: 0; padding-left: 12px; }
.cmt-reply-nested .cmt-reply-item { padding-left: 0; }
.cmt-reply-nested .cmt-reply-nested { padding-left: 0; }
.cmt-reply-arrow { font-size: 10px; color: var(--text-muted); margin: 0 4px; }
.cmt-reply-to { font-size: 12px; color: #60a5fa; }
.cmt-reply-input-wrap {
    display: none; margin: 8px 0 0; border: 1px solid var(--border); border-radius: 10px;
    overflow: hidden; background: var(--surface);
}
.cmt-reply-input-wrap.show { display: block; }
.cmt-reply-input-wrap textarea {
    width: 100%; min-height: 50px; padding: 10px 14px;
    border: none; background: transparent; color: var(--text);
    font-size: 13px; font-family: inherit; resize: none; outline: none;
}
.cmt-reply-input-wrap textarea::placeholder { color: var(--text-muted); }
.cmt-reply-input-bottom {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 6px 10px; border-top: 1px solid var(--border);
}
.cmt-reply-send-btn {
    padding: 5px 14px; border: none; border-radius: 50px;
    background: var(--text-muted); color: #fff; font-size: 12px;
    font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.cmt-reply-send-btn.has-content { background: var(--accent); }
.cmt-empty { text-align: center; padding: 24px 0; color: var(--text-muted); font-size: 13px; }
.cmt-empty svg { width: 32px; height: 32px; stroke: var(--border); fill: none; stroke-width: 1.5; margin: 0 auto 8px; display: block; }
.cmt-modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    z-index: 500; display: none; align-items: center; justify-content: center;
    padding: 16px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cmt-modal-mask.show { display: flex; animation: modalFadeIn 0.25s ease; }
.cmt-modal-mask.closing { animation: modalFadeOut 0.2s ease forwards; }
.cmt-modal-mask.show .cmt-modal-box { animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cmt-modal-mask.closing .cmt-modal-box { animation: modalSlideOut 0.2s ease forwards; }
.cmt-modal-box {
    background: var(--surface); border-radius: 20px;
    width: 380px; max-width: 100%; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    animation: cmtModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .cmt-modal-box { background: #1a1a1a; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
/* modal background uses var(--surface) which adapts to dark mode */
@keyframes cmtModalIn { from { opacity: 0; transform: scale(0.92) translateY(12px); } to { opacity: 1; transform: none; } }
.cmt-modal-head { padding: 28px 28px 0; }
.cmt-modal-title { font-size: 22px; font-weight: 700; color: var(--text); }
.cmt-modal-body { padding: 20px 28px 48px; }
.cmt-modal-switch { display: flex; align-items: center; gap: 6px; padding: 0 28px 24px; font-size: 13px; color: var(--text-muted); }
.cmt-modal-switch-link { color: var(--accent); cursor: pointer; font-weight: 500; background: none; border: none; font-family: inherit; font-size: 13px; }
.cmt-modal-switch-link:hover { opacity: 0.8; }
.cmt-modal-form { display: flex; flex-direction: column; gap: 14px; }
.cmt-modal-input {
    width: 100%; padding: 13px 14px; border: 1.5px solid var(--border); border-radius: 12px;
    background: var(--surface); color: var(--text); font-size: 15px;
    font-family: inherit; outline: none; transition: all 0.2s;
}
[data-theme="dark"] .cmt-modal-input { background: #141414; }
.cmt-modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px hsla(var(--accent-hue), var(--accent-sat), 50%, 0.15); }
.cmt-modal-input::placeholder { color: var(--text-muted); font-size: 14px; }
.cmt-modal-err { font-size: 12px; color: #ef4444; min-height: 16px; padding: 0 2px; }
.cmt-modal-submit {
    width: 100%; padding: 13px; border: none; border-radius: 12px;
    background: var(--accent-light); color: var(--accent); font-size: 15px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.cmt-modal-submit:hover { background: var(--accent); color: #fff; }
.cmt-back-link { display:inline-flex; align-items:center; gap:4px; margin-top:12px; font-size:14px; color:var(--accent,#666); cursor:pointer; background:none; border:none; padding:0; font-family:inherit; }
.cmt-back-link svg { width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:2; }

/* Profile Center Navigation */
.profile-center-nav { margin-top:16px; padding-top:16px; border-top:1px solid var(--border,#e0e0e0); }
.profile-level-bar { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.profile-level-badge { display:inline-flex; align-items:center; justify-content:center; min-width:42px; height:26px; padding:0 8px; background:linear-gradient(135deg,#E8A838,#C28520); color:#fff; font-size:13px; font-weight:700; border-radius:13px; }
.profile-exp-track { flex:1; height:6px; background:var(--border,#e0e0e0); border-radius:3px; overflow:hidden; }
.profile-exp-fill { height:100%; background:linear-gradient(90deg,#F5D08A,#E8A838); border-radius:3px; transition:width .5s ease; width:0; }
.profile-exp-text { font-size:12px; color:var(--text-muted,#888); white-space:nowrap; }
.profile-nav-btns { display:flex; gap:10px; }
.profile-nav-btn { flex:1; display:flex; align-items:center; justify-content:center; gap:6px; padding:10px 12px; border:1px solid var(--border,#e0e0e0); border-radius:10px; background:var(--card-bg,#fff); color:var(--text,#333); font-size:13px; font-weight:500; cursor:pointer; transition:all .2s; font-family:inherit; }
.profile-nav-btn:hover { border-color:#E8A838; color:#E8A838; background:rgba(232,168,56,.05); }
.profile-nav-btn svg { stroke:currentColor; fill:none; stroke-width:2; }

/* Member benefits in comments */
.cmt-name-member { color:#E8A838 !important; }
.cmt-content-member { color:#E8A838 !important; }
.cmt-sign-member { color:#E8A838 !important; }

/* === Profile Center Modal === */
.cmt-profile-box { max-width:480px; max-height:85vh; display:flex; flex-direction:column; }
.cmt-profile-box .cmt-modal-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px 0; }
.cmt-modal-close { background:none; border:none; cursor:pointer; padding:4px; color:var(--text-muted,#888); transition:color .2s; }
.cmt-modal-close:hover { color:var(--text,#333); }
.cmt-modal-close svg { stroke:currentColor; fill:none; }
.profile-tabs { display:flex; gap:0; padding:0 20px; border-bottom:1px solid var(--border,#e0e0e0); }
.profile-tab { flex:1; padding:10px 0; background:none; border:none; border-bottom:2px solid transparent; font-size:13px; font-weight:500; color:var(--text-muted,#888); cursor:pointer; transition:all .2s; font-family:inherit; }
.profile-tab.active { color:#E8A838; border-bottom-color:#E8A838; }
.profile-body { overflow-y:auto; flex:1; padding:16px 20px 20px; }
.profile-tab-content { display:none; }
.profile-tab-content.active { display:block; }
.cmt-modal-submit-alt { background:var(--card-bg,#fff) !important; color:var(--text,#333) !important; border:1px solid var(--border,#e0e0e0) !important; margin-top:8px; }
.cmt-modal-submit-alt:hover { border-color:#E8A838 !important; color:#E8A838 !important; }


/* === Dark Mode: Modal Adaptation === */
[data-theme="dark"] .cmt-modal-mask { background: rgba(0,0,0,0.6); }
[data-theme="dark"] .cmt-modal-title { color: #e6edf3; }
[data-theme="dark"] .cmt-modal-switch { color: #8b949e; }
[data-theme="dark"] .cmt-modal-err { color: #f87171; }
[data-theme="dark"] .cmt-modal-submit { background: #1e1e2e; color: #818cf8; border: 1px solid #313244; }
[data-theme="dark"] .cmt-modal-submit:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="dark"] .cmt-modal-submit-alt { background: #21262d !important; color: #e6edf3 !important; border-color: #30363d !important; }
[data-theme="dark"] .cmt-modal-submit-alt:hover { border-color: #E8A838 !important; color: #E8A838 !important; }
[data-theme="dark"] .profile-nav-btn { background: #21262d; border-color: #30363d; color: #e6edf3; }
[data-theme="dark"] .profile-nav-btn:hover { border-color: #E8A838; color: #E8A838; background: rgba(232,168,56,0.08); }
[data-theme="dark"] .profile-tabs { border-bottom-color: #30363d; }
[data-theme="dark"] .profile-tab { color: #8b949e; }
[data-theme="dark"] .profile-tab.active { color: #E8A838; border-bottom-color: #E8A838; }
[data-theme="dark"] .profile-center-nav { border-top-color: #30363d; }
[data-theme="dark"] .profile-exp-track { background: #30363d; }
[data-theme="dark"] .profile-activate input { background: #141414; border-color: #30363d; color: #e6edf3; }
[data-theme="dark"] .cmt-logout-btn:hover { background: #3a1e1e; }

/* Level Tab */
.profile-level-card { text-align:center; }
.profile-level-big { margin-bottom:16px; }
.profile-level-circle { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; width:100px; height:100px; border-radius:50%; background:linear-gradient(135deg,#E8A838,#C28520); box-shadow:0 4px 16px rgba(232,168,56,.3); }
.profile-level-num { font-size:32px; font-weight:800; color:#fff; line-height:1; }
.profile-level-label { font-size:10px; color:rgba(255,255,255,.7); letter-spacing:2px; margin-top:2px; }
.profile-exp-bar-wrap { margin-bottom:16px; }
.profile-exp-bar { height:8px; background:var(--border,#e0e0e0); border-radius:4px; overflow:hidden; margin-bottom:6px; }
.profile-exp-bar-fill { height:100%; background:linear-gradient(90deg,#F5D08A,#E8A838); border-radius:4px; transition:width .5s; width:0; }
.profile-exp-info { display:flex; justify-content:space-between; font-size:12px; color:var(--text-muted,#888); }
.profile-level-table { text-align:left; max-height:200px; overflow-y:auto; }
.profile-level-row { display:flex; align-items:center; padding:8px 12px; border-bottom:1px solid var(--border,#e0e0e0); font-size:13px; }
.profile-level-row:last-child { border-bottom:none; }
.profile-level-row.current { background:rgba(232,168,56,.08); }
.profile-level-row span:first-child { width:50px; font-weight:700; }
.profile-level-row span:nth-child(2) { flex:1; color:var(--text-muted,#888); }
.profile-level-cur { padding:2px 8px; background:#E8A838; color:#fff; font-size:11px; font-weight:600; border-radius:6px; }

/* Member Tab */
.profile-member-status { margin-bottom:16px; text-align:center; }
.profile-member-badge { display:inline-block; padding:6px 20px; border-radius:20px; font-size:14px; font-weight:600; background:var(--border,#e0e0e0); color:var(--text-muted,#888); }
.profile-member-badge.active { background:linear-gradient(135deg,#E8A838,#C28520); color:#fff; }
.profile-member-expire { font-size:12px; color:var(--text-muted,#888); margin-top:6px; }
.profile-section-title { font-size:14px; font-weight:700; margin:16px 0 10px; }
.profile-benefits { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.profile-benefit-item { padding:12px; border:1px solid var(--border,#e0e0e0); border-radius:10px; transition:all .2s; }
.profile-benefit-item.active { border-color:#E8A838; box-shadow:0 0 0 1px #E8A838; }
.profile-benefit-name { font-size:13px; font-weight:600; margin-bottom:2px; }
.profile-benefit-desc { font-size:11px; color:var(--text-muted,#888); }
.profile-plans { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.profile-plan { padding:12px 8px; text-align:center; border:2px solid var(--border,#e0e0e0); border-radius:10px; transition:all .2s; }
.profile-plan:hover { border-color:#E8A838; }
.profile-plan-name { font-size:14px; font-weight:700; margin-bottom:4px; }
.profile-plan-price { font-size:12px; color:#E8A838; font-weight:600; margin-bottom:8px; }
.profile-plan-buy { width:100%; padding:6px 0; border:none; border-radius:6px; background:#E8A838; color:#fff; font-size:12px; font-weight:600; cursor:pointer; font-family:inherit; }
.profile-plan-buy:hover { opacity:.85; }
.profile-activate { display:flex; gap:8px; }
.profile-activate input { flex:1; padding:8px 12px; border:1px solid var(--border,#e0e0e0); border-radius:8px; font-size:13px; background:var(--card-bg,#fff); color:var(--text,#333); outline:none; }
.profile-activate input:focus { border-color:#E8A838; }
.profile-activate button { padding:8px 16px; border:none; border-radius:8px; background:#E8A838; color:#fff; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; }
.profile-activate-msg { font-size:12px; margin-top:6px; display:none; }
.profile-activate-msg.success { display:block; color:#4CAF50; }
.profile-activate-msg.error { display:block; color:#f44336; }

/* Task Tab */
.profile-checkin-card { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border:1px solid var(--border,#e0e0e0); border-radius:12px; margin-bottom:16px; }
.profile-checkin-card.checked { opacity:.6; background:rgba(232,168,56,.05); }
.profile-checkin-left { display:flex; align-items:center; gap:12px; }
.profile-checkin-left svg { stroke:#E8A838; fill:none; }
.profile-checkin-title { font-size:14px; font-weight:600; }
.profile-checkin-reward { font-size:12px; color:#E8A838; }
.profile-checkin-btn { padding:8px 20px; border:none; border-radius:8px; background:#E8A838; color:#fff; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; }
.profile-checkin-btn.done { background:#ccc; cursor:default; }
.profile-task-list { display:flex; flex-direction:column; gap:8px; }
.profile-task-item { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--border,#e0e0e0); border-radius:10px; }
.profile-task-item.done { opacity:.5; }
.profile-task-icon { font-size:20px; width:32px; text-align:center; }
.profile-task-info { flex:1; }
.profile-task-name { font-size:13px; font-weight:600; }
.profile-task-reward { font-size:11px; color:#E8A838; }
.profile-task-count { font-size:12px; font-weight:600; color:var(--text-muted,#888); }
.profile-points-display { display:flex; align-items:center; gap:6px; justify-content:center; margin-top:16px; font-size:14px; font-weight:600; color:#E8A838; }

/* Exp Popup */
.svip-badge { display:inline-flex; align-items:center; padding:0px 4px; border-radius:2px; background:linear-gradient(135deg,#f59e0b,#d97706); color:#fff; font-size:8px; font-weight:700; letter-spacing:.5px; margin-left:2px; vertical-align:middle; line-height:1.4; position:relative; top:1px; }
.verified-badge { display:inline-flex; align-items:center; justify-content:center; width:14px; height:14px; border-radius:50%; background:#2563eb; margin-left:2px; vertical-align:middle; transform:translateY(1px); cursor:pointer; flex-shrink:0; }
.verified-badge:hover { background:#1d4ed8; }
.verified-badge svg { width:9px; height:9px; stroke:#fff; fill:none; stroke-width:2.5; }
.verify-popup { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:600; display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity .2s; }
.verify-popup.show { opacity:1; pointer-events:auto; }
.verify-popup-box { background:var(--surface,#fff); border-radius:14px; padding:28px; max-width:320px; width:90%; text-align:center; box-shadow:0 8px 32px rgba(0,0,0,.12); }
.verify-popup-icon { width:48px; height:48px; border-radius:50%; background:#dbeafe; display:flex; align-items:center; justify-content:center; margin:0 auto 12px; }
.verify-popup-icon svg { width:24px; height:24px; stroke:#2563eb; fill:none; stroke-width:2; }
.verify-popup-title { font-size:16px; font-weight:700; color:var(--text,#1e293b); margin-bottom:4px; }
.verify-popup-desc { font-size:13px; color:var(--text-muted,#64748b); }
.exp-popup { position:fixed; bottom:80px; left:50%; transform:translateX(-50%) translateY(20px); background:rgba(30,41,59,0.92); backdrop-filter:blur(8px); border-radius:10px; padding:10px 20px; display:flex; align-items:center; gap:10px; color:#fbbf24; font-size:13px; font-weight:600; opacity:0; transition:all 0.3s ease; z-index:9999; box-shadow:0 4px 16px rgba(0,0,0,0.15); }
.exp-popup.show { opacity:1; transform:translateX(-50%) translateY(0); }
.exp-popup span { white-space:nowrap; }
.cmt-auth-slide { position: relative; }
.cmt-auth-slide > .cmt-modal-form { transition: opacity 0.2s ease, transform 0.2s ease; }
.cmt-auth-slide.slide-out > .cmt-modal-form { opacity: 0; transform: translateX(-20px); }
.cmt-auth-slide.slide-in > .cmt-modal-form { animation: cmtSlideIn 0.25s ease forwards; }
@keyframes cmtSlideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.cmt-confirm-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 700; display: none; align-items: center; justify-content: center; padding: 16px;
}
.cmt-confirm-overlay.show { display: flex; animation: modalFadeIn 0.25s ease; }
.cmt-confirm-overlay.closing { animation: modalFadeOut 0.2s ease forwards; }
.cmt-confirm-overlay.show .cmt-confirm-box { animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cmt-confirm-overlay.closing .cmt-confirm-box { animation: modalSlideOut 0.2s ease forwards; }
.cmt-confirm-box {
    background: var(--surface); border-radius: 16px; padding: 28px;
    max-width: 320px; width: 100%; text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
[data-theme="dark"] .cmt-confirm-box { background: #1a1a1a; }
.cmt-confirm-box h3 { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.cmt-confirm-box p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.cmt-confirm-actions { display: flex; gap: 10px; justify-content: center; }
.cmt-confirm-cancel {
    padding: 10px 24px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text-secondary); font-size: 14px;
    cursor: pointer; font-family: inherit;
}
.cmt-confirm-cancel:hover { border-color: var(--accent); color: var(--accent); }
.cmt-confirm-ok {
    padding: 10px 24px; border: none; border-radius: 10px;
    background: #ef4444; color: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit;
}
.cmt-confirm-ok:hover { opacity: 0.85; }
@media (max-width: 640px) {
    .comment-section { padding: 14px; }
    .cmt-sign { max-width: 200px; }
    .cmt-reply-sign { max-width: 200px; }
    .img-lightbox-prev, .img-lightbox-next { width: 40px; height: 40px; }
    .img-lightbox-prev svg, .img-lightbox-next svg { width: 20px; height: 20px; }
    .img-lightbox-close { width: 36px; height: 36px; top: 12px; right: 12px; }
    .img-lightbox-close svg { width: 20px; height: 20px; }
}
@media (max-width: 1024px) {
    #btnKbdHelp { display: none !important; }
    .reading-progress-text { display: none !important; }
    .kbd-help-overlay { display: none !important; }
    .sidebar-header .icon-btn { display: none !important; }
}
@media print {
    .top-bar, .sidebar, .floating-buttons, .toc-popup, .music-popup, .reading-progress,
    .share-modal-overlay, .img-lightbox, .cmt-capsule-section, .cmt-input-section,
    .comment-section, .prev-next-nav, .article-bottom-cards, .toast,
    .sidebar-resize, .kbd-help-overlay { display: none !important; }
    body { padding-left: 0 !important; background: #fff !important; }
    .main-container { max-width: 100% !important; padding: 0 !important; }
    .markdown-body { box-shadow: none !important; border-radius: 0 !important; padding: 20px 0 !important; }
    .markdown-body pre { break-inside: avoid; }
    .markdown-body img { max-width: 100% !important; }
}
.kbd-help-overlay {
    position: fixed; inset: 0; z-index: 600;
    background: rgba(0,0,0,0.5); display: none;
    align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(4px);
}
.kbd-help-overlay.show { display: flex; }
.kbd-help-box {
    background: var(--surface); border-radius: 16px;
    padding: 32px; max-width: 520px; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: 80vh; overflow-y: auto;
}
.kbd-help-title { font-size: 1.2em; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.kbd-help-title svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 2; }
.kbd-help-section { margin-bottom: 16px; }
.kbd-help-section h4 { font-size: 0.85em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.kbd-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.kbd-label { font-size: 0.9em; color: var(--text-secondary); }
.kbd-keys { display: flex; gap: 4px; }
kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 26px; padding: 0 8px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); font-family: inherit;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
[data-theme="dark"] kbd { background: #21262d; border-color: #30363d; }
.img-lightbox-prev, .img-lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: none;
    color: #fff; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background 0.2s; z-index: 402;
}
.img-lightbox-prev { left: 20px; }
.img-lightbox-next { right: 80px; }
.img-lightbox-prev:hover, .img-lightbox-next:hover { background: rgba(255,255,255,0.3); }
.img-lightbox-prev svg, .img-lightbox-next svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.doc-card.preloading { opacity: 0.7; }
.doc-card .preload-indicator {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
.doc-card { position: relative; }
.reading-progress-text {
    position: fixed; top: 4px; right: 12px;
    font-size: 11px; font-weight: 500; color: var(--text-muted);
    z-index: 201; pointer-events: none; opacity: 0;
    transition: opacity 0.2s; background: var(--surface);
    padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border);
}
.reading-progress-text.active { opacity: 1; }
@media (min-width: 1025px) {
    .reading-progress-text { right: 292px; }
}
.cmt-form-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; min-height: 20px;
}
.cmt-form-row .cmt-modal-err { flex: 1; min-width: 0; }
.cmt-switch-inline {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--text-muted); white-space: nowrap;
    flex-shrink: 0;
}
.cmt-youyun-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 4px 28px 0; padding: 16px 0 12px;
    color: var(--text-muted); font-size: 12px;
}
.cmt-youyun-divider::before, .cmt-youyun-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.cmt-youyun-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 0 28px 24px; padding: 9px 16px; border-radius: 12px;
    width: calc(100% - 56px); box-sizing: border-box;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); cursor: pointer;
    font-size: 13px; font-weight: 500; font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.cmt-youyun-btn:hover {
    border-color: var(--accent); color: var(--accent);
    background: var(--accent-light);
}
.cmt-youyun-btn:active { transform: scale(0.98); }

/* Hidden Article Password UI */
.hidden-article-container {
    display: flex; align-items: center; justify-content: center;
    min-height: 60vh; padding: 40px 20px;
}
.hidden-article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px 40px;
    max-width: 400px; width: 100%;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: hiddenCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes hiddenCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
.hidden-lock-ring {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light), var(--bg));
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    color: var(--accent);
    animation: lockPulse 2.5s ease-in-out infinite;
}
@keyframes lockPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--accent), 0.1); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 8px transparent; }
}
.hidden-lock-icon { display: block; }
.hidden-article-title {
    font-size: 1.25em; font-weight: 700;
    color: var(--text); margin-bottom: 8px;
    line-height: 1.4;
}
.hidden-article-subtitle {
    font-size: 0.88em; color: var(--text-muted);
    margin-bottom: 32px;
}
.hidden-pw-form { text-align: left; }
.hidden-pw-input-wrap {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.hidden-pw-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.hidden-pw-key-icon {
    flex-shrink: 0; color: var(--text-muted);
    transition: color 0.2s;
}
.hidden-pw-input-wrap:focus-within .hidden-pw-key-icon {
    color: var(--accent);
}
.hidden-pw-input {
    flex: 1; border: none; background: transparent;
    padding: 14px 0; font-size: 15px;
    color: var(--text); font-family: inherit;
    outline: none; letter-spacing: 1px;
}
.hidden-pw-input::placeholder {
    color: var(--text-muted); letter-spacing: 0;
}
.hidden-pw-error {
    color: #ef4444; font-size: 0.82em;
    margin-top: 8px; display: none;
    animation: shake 0.4s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
.hidden-pw-error.show { display: block; }
.hidden-pw-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: 16px; padding: 14px;
    border: none; border-radius: 12px;
    background: var(--accent); color: #fff;
    font-size: 15px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
}
.hidden-pw-btn:hover {
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}
.hidden-pw-btn:active {
    transform: scale(0.98);
}
.hidden-pw-btn:disabled {
    opacity: 0.6; cursor: not-allowed;
    transform: none; box-shadow: none;
}
.hidden-pw-spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Announcement Modal */
.ann-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: annFadeIn 0.3s ease;
}
.ann-overlay.active { display: flex; }
@keyframes annFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.ann-card {
    background: var(--surface);
    border-radius: 20px;
    width: 420px;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: annSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
@keyframes annSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: none; }
}
.ann-header {
    padding: 24px 24px 0;
}
.ann-title {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}
.ann-body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.92em;
    color: var(--text-secondary);
    line-height: 1.7;
}
.ann-body h1, .ann-body h2, .ann-body h3 {
    color: var(--text);
    margin: 12px 0 6px;
    font-size: 1.05em;
}
.ann-body p { margin: 6px 0; }
.ann-body code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.ann-body pre {
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
}
.ann-body pre code {
    background: none;
    padding: 0;
}
.ann-body ul, .ann-body ol {
    padding-left: 20px;
    margin: 6px 0;
}
.ann-body a {
    color: var(--accent);
    text-decoration: none;
}
.ann-body a:hover {
    text-decoration: underline;
}
.ann-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--text-muted);
}
.ann-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
}
.ann-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
}
.ann-btn:hover:not(:disabled) {
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}
.ann-btn:active:not(:disabled) {
    transform: scale(0.98);
}
.ann-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal animations */
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalSlideIn { from { opacity: 0; transform: scale(0.9) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes modalSlideOut { from { opacity: 1; transform: scale(1) translateY(0); } to { opacity: 0; transform: scale(0.95) translateY(8px); } }
@keyframes modalBottomSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes modalBottomSlideDown { from { transform: translateY(0); } to { transform: translateY(100%); } }



/* 歌词滑动 */
.music-lyric-scroll { cursor: grab; user-select: none; -webkit-user-select: none; }
.music-lyric-scroll:active { cursor: grabbing; }
.lyr-back-btn {
    display: block; margin: 4px auto 0; padding: 3px 14px;
    background: var(--accent-light, rgba(255,255,255,0.08)); color: var(--accent, #6c8cff);
    border: 1px solid var(--accent, #6c8cff); border-radius: 20px;
    font-size: 11px; cursor: pointer; opacity: 0.85;
    transition: opacity 0.2s, background 0.2s;
}
.lyr-back-btn:hover { opacity: 1; background: var(--accent, #6c8cff); color: #fff; }


/* === User Center (Profile Modal Redesign) === */
.cmt-profile-box { max-width: 420px; width: 92vw; }
.uc-user-card {
    background: linear-gradient(135deg, hsl(var(--accent-hue), var(--accent-sat), 50%) 0%, hsl(var(--accent-hue), var(--accent-sat), 35%) 100%);
    border-radius: 16px; padding: 24px 20px; margin-bottom: 20px; color: #fff;
    position: relative; overflow: hidden;
}
.uc-user-card::before {
    content: ''; position: absolute; top: -40%; right: -20%; width: 180px; height: 180px;
    background: rgba(255,255,255,0.08); border-radius: 50%;
}
.uc-user-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; position: relative; }
.uc-avatar {
    width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.15); font-size: 20px; font-weight: 700;
}
.uc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.uc-user-info { flex: 1; min-width: 0; }
.uc-nickname { font-size: 17px; font-weight: 700; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-sign { font-size: 12px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-stats-row { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 14px; position: relative; }
.uc-stat-item { flex: 1; text-align: center; }
.uc-stat-val { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.uc-stat-label { display: block; font-size: 11px; opacity: 0.7; margin-top: 2px; }
.uc-stat-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.2); }
.uc-exp-bar-wrap { position: relative; margin-bottom: 10px; }
.uc-exp-bar { height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; overflow: hidden; }
.uc-exp-bar-fill { height: 100%; background: #fff; border-radius: 3px; transition: width 0.6s ease; width: 0; }
.uc-exp-text { font-size: 11px; opacity: 0.7; text-align: center; margin-top: 4px; }
.uc-member-tag { text-align: center; }
.uc-member-badge {
    display: inline-block; padding: 3px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    background: rgba(255,255,255,0.2); color: #fff;
}
.uc-member-badge.free { background: rgba(255,255,255,0.1); opacity: 0.7; }
/* Member card dark luxury variant */
.uc-user-card.member {
    background: linear-gradient(145deg, #1a1d26 0%, #2d2f3a 40%, #1f1c1a 100%) !important;
    border: 1px solid rgba(232,168,56,0.3) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.uc-user-card.member::before {
    background: radial-gradient(circle, rgba(232,168,56,0.18) 0%, rgba(232,168,56,0.04) 50%, transparent 70%) !important;
    width: 280px; height: 280px; top: -80px; right: -60px;
}
.uc-user-card.member::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -40px; width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(232,168,56,0.08) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none;
}
.uc-user-card.member .uc-sign { color: rgba(255,255,255,0.5) !important; }
.uc-user-card.member .uc-member-badge {
    background: rgba(232,168,56,0.2) !important;
    color: #f2c76b !important;
    border: 1px solid rgba(232,168,56,0.2);
}


/* Nav Grid */
.uc-nav-grid { display: flex; flex-direction: column; gap: 8px; }
.uc-nav-btn {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 14px 16px; border: 1px solid var(--border, #e8e8e8); border-radius: 12px;
    background: var(--surface, #fff); color: var(--text, #333);
    font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.2s;
    text-align: left; font-family: inherit;
}
.uc-nav-btn:hover { border-color: var(--accent, #666); background: var(--bg, #f5f5f5); }
.uc-nav-btn svg:first-child { width: 20px; height: 20px; stroke: var(--accent, #666); fill: none; stroke-width: 2; flex-shrink: 0; }
.uc-nav-btn span { flex: 1; }
.uc-nav-arrow { width: 16px; height: 16px; stroke: var(--text-muted, #999); fill: none; stroke-width: 2; flex-shrink: 0; }

/* Back button */
.uc-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; color: var(--text-muted, #888);
    font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; transition: color 0.2s;
}
.uc-back-btn:hover { color: var(--accent, #666); }
.uc-back-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Edit profile sub-page */
.uc-sub-page { animation: ucSlideIn 0.25s ease; }
@keyframes ucSlideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Dark theme */
[data-theme="dark"] .uc-nav-btn { background: var(--surface, #222); border-color: var(--border, #333); }
[data-theme="dark"] .uc-nav-btn:hover { background: var(--bg, #2a2a2a); border-color: var(--accent, #666); }
