/*
Theme Name: DeepTime
Theme URI: https://july.rsnocsi.cn
Author: July
Description: DeepTime 主题 - Ethereal Glass 设计语言
Version: 2.0.0
Text Domain: deeptime
*/

:root {
    --bg-void: #08080c;
    --bg-base: #0c0c12;
    --bg-surface: #111118;
    --bg-elevated: #16161f;
    --bg-hover: #1e1e28;
    --bg-glass: rgba(16, 16, 22, 0.65);
    --sidebar-bg: rgba(14, 14, 20, 0.82);
    --header-bg: rgba(12, 12, 18, 0.72);
    --gold: #d4a84b;
    --gold-bright: #e8c060;
    --gold-soft: #b8943f;
    --gold-glow: rgba(212, 168, 75, 0.05);
    --gold-glow-mid: rgba(212, 168, 75, 0.10);
    --gold-glow-strong: rgba(212, 168, 75, 0.18);
    --gold-gradient: linear-gradient(135deg, #e8c060, #c49a38, #a07830);
    --gold-border: rgba(212, 168, 75, 0.18);
    --ink-1: #eeecea;
    --ink-2: #9a98a8;
    --ink-3: #5a5868;
    --ink-inv: #050508;
    --line: rgba(255, 255, 255, 0.04);
    --line-hover: rgba(255, 255, 255, 0.08);
    --line-gold: rgba(212, 168, 75, 0.12);
    --ok: #5cb888;
    --warn: #d4a84b;
    --err: #c85858;
    --info: #6898d8;
    --neon: #00f0a8;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'DM Serif Display', 'Noto Serif SC', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    /* 文章内容专用字体 */
    --font-article: 'Noto Sans SC', 'Noto Sans TC', 'Noto Sans', 'JetBrains Mono', -apple-system, BlinkMacSystemFont, sans-serif;
    --fs-hero: clamp(2.8rem, 8vw, 5rem);
    --fs-h1: 2.4rem;
    --fs-h2: 1.6rem;
    --fs-h3: 1.2rem;
    --fs-body: 0.88rem;
    --fs-sm: 0.82rem;
    --fs-xs: 0.75rem;
    --fs-xxs: 0.68rem;
    --r: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-sm: 6px;
    --r-md: 8px;
    --sidebar-w: 250px;
    --header-h: 56px;
    --content-w: 1200px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-ethereal: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-1: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-2: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-3: 0 16px 48px rgba(0,0,0,0.4);
}

[data-theme="light"] {
    --bg-void: #f7f5f0;
    --bg-base: #faf8f4;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #f0ede6;
    --bg-glass: rgba(250, 248, 244, 0.8);
    --sidebar-bg: rgba(250, 248, 244, 0.92);
    --header-bg: rgba(250, 248, 244, 0.85);
    --gold: #a07830;
    --gold-bright: #c49a38;
    --gold-soft: #8a6828;
    --gold-glow: rgba(160, 120, 48, 0.05);
    --gold-glow-mid: rgba(160, 120, 48, 0.10);
    --gold-glow-strong: rgba(160, 120, 48, 0.15);
    --gold-border: rgba(160, 120, 48, 0.2);
    --ink-1: #1a1820;
    --ink-2: #555568;
    --ink-3: #8a8a98;
    --ink-inv: #ffffff;
    --line: rgba(0, 0, 0, 0.06);
    --line-hover: rgba(0, 0, 0, 0.1);
    --line-gold: rgba(160, 120, 48, 0.15);
    --ok: #3a9a68;
    --err: #b84040;
    --info: #4878b8;
    --neon: #00c48a;
    --shadow-3: 0 16px 48px rgba(0,0,0,0.15);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    background: var(--bg-void);
    color: var(--ink-1);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: var(--fs-body);
}

/* 字体加载状态 - 减少 FOUT 闪烁 */
html:not(.fonts-loaded) body {
    opacity: 0;
    transition: opacity 0.3s ease;
}
html.fonts-loaded body {
    opacity: 1;
}
/* 首页标题特殊处理 - 立即显示但使用备用字体 */
.hero-title {
    font-family: var(--font-display);
    font-display: swap;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--gold-bright); }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }

/* Starfield */
.starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.starfield::before {
    content: '';
    position: absolute;
    inset: -50%;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(212, 168, 75, 0.04), transparent),
        radial-gradient(ellipse 500px 500px at 80% 20%, rgba(120, 80, 200, 0.03), transparent),
        radial-gradient(ellipse 400px 300px at 60% 80%, rgba(60, 120, 200, 0.02), transparent),
        radial-gradient(ellipse 300px 300px at 30% 70%, rgba(212, 168, 75, 0.03), transparent);
    animation: aurora 50s linear infinite;
}
.starfield::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E");
    opacity: 0.5;
}
@keyframes aurora { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
[data-theme="light"] .starfield::before {
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(120, 90, 30, 0.12), transparent),
        radial-gradient(ellipse 500px 500px at 80% 20%, rgba(80, 50, 160, 0.08), transparent),
        radial-gradient(ellipse 400px 300px at 60% 80%, rgba(40, 80, 160, 0.06), transparent);
}

/* Particle Canvas */
#particle-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* App Layout */
#app { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* Sidebar */
#sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); height: 100dvh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(40px) saturate(1.4);
    -webkit-backdrop-filter: blur(40px) saturate(1.4);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
    overflow-y: auto; overflow-x: hidden;
}
#sidebar.open { transform: translateX(0); }
#sidebar::after {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, rgba(212, 168, 75, 0.08), transparent 30%, transparent 70%, rgba(212, 168, 75, 0.04));
    pointer-events: none;
}

.sidebar-header {
    height: var(--header-h);
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 12px;
    position: relative; flex-shrink: 0;
}
.sidebar-header::after {
    content: '';
    position: absolute; bottom: -1px; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, rgba(212, 168, 75, 0.1), transparent);
}

.sidebar-toggle-btn {
    background: none; border: none;
    color: var(--ink-2); cursor: pointer;
    padding: 4px; border-radius: var(--r-sm);
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-toggle-btn:hover { color: var(--ink-1); background: var(--bg-hover); }

.sidebar-brand-text {
    font-size: 1rem; font-weight: 400;
    color: var(--ink-1);
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 10px;
    display: flex; flex-direction: column; gap: 2px;
}

.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 14px;
    border-radius: var(--r);
    color: var(--ink-2);
    font-size: var(--fs-sm); font-weight: 400;
    transition: all 0.2s var(--ease-out);
    cursor: pointer;
    border: none; background: none;
    width: 100%; text-align: left;
    letter-spacing: 0.01em;
    position: relative;
    text-decoration: none;
}
.nav-item { position: relative; overflow: hidden; }
.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2px;
    background: var(--gold-gradient);
    transition: width 0.3s ease, left 0.3s ease;
}
.nav-item:hover { background: var(--bg-hover); color: var(--ink-1); }
.nav-item:hover::after { width: 80%; left: 10%; }
.nav-item.active { color: var(--gold); background: rgba(212, 168, 75, 0.06); }
.nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 6px; bottom: 6px;
    width: 3px;
    background: var(--gold-gradient);
    border-radius: 0 3px 3px 0;
}
.nav-icon { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; font-size: 14px; }
.nav-item.active .nav-icon { opacity: 1; }

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 999;
}

/* Header */
#main-content { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }

#header {
    position: sticky; top: 0;
    height: var(--header-h);
    background: var(--header-bg);
    backdrop-filter: blur(32px) saturate(1.2);
    -webkit-backdrop-filter: blur(32px) saturate(1.2);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    z-index: 900;
}
#header::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 75, 0.06), transparent);
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 8px; }

.hamburger {
    display: none;
    background: none; border: none;
    color: var(--ink-2); cursor: pointer;
    padding: 4px; width: 24px; height: 24px;
}
.hamburger svg { width: 18px; height: 18px; }

.header-brand {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--ink-1);
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}
.header-brand:hover {
    color: var(--gold);
}

/* Header User Menu */
.header-user-menu { position: relative; }
.header-avatar-btn {
    display: flex; align-items: center; gap: 8px;
    background: none; border: none;
    cursor: pointer; padding: 4px 8px;
    border-radius: var(--r);
    transition: background 0.2s;
    color: var(--ink-1);
}
.header-avatar-btn:hover { background: var(--bg-hover); }
.header-username {
    font-size: var(--fs-xs);
    color: var(--ink-2);
    max-width: 120px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.header-avatar, .header-avatar-lg {
    border-radius: 50%;
    background: var(--gold-glow-mid);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; color: var(--gold);
}
.header-avatar { width: 26px; height: 26px; font-size: 11px; }
.header-avatar-lg { width: 44px; height: 44px; font-size: 18px; }

/* Header Dropdown */
.header-dropdown {
    position: absolute;
    top: calc(100% + 8px); right: 0;
    width: 260px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    padding: 8px;
    opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s var(--ease-out);
    z-index: 1100;
}
.header-dropdown.show {
    opacity: 1; visibility: visible;
    transform: translateY(0);
}
.header-dropdown-user {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    text-decoration: none; color: inherit;
    transition: background 0.2s;
}
.header-dropdown-user:hover { background: var(--bg-hover); color: inherit; }
.header-dropdown-user-info { overflow: hidden; }
.header-dropdown-name {
    font-size: var(--fs-sm); font-weight: 500;
    color: var(--ink-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-dropdown-role {
    font-size: 0.65rem;
    color: var(--gold-soft);
    text-transform: uppercase; letter-spacing: 0.1em;
}
.header-dropdown-divider { height: 1px; background: var(--line); margin: 6px 8px; }
.header-dropdown-section { padding: 4px 8px; }
.header-dropdown-label {
    font-size: var(--fs-xxs);
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--ink-3);
    margin-bottom: 6px;
}
.header-dropdown-row { display: flex; gap: 4px; }
.header-dropdown-btn {
    flex: 1; padding: 6px 10px;
    font-size: var(--fs-xs);
    background: var(--bg-hover);
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    cursor: pointer; transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.header-dropdown-btn:hover { background: var(--bg-surface); color: var(--ink-1); }
.header-dropdown-btn.active {
    border-color: var(--gold-soft);
    color: var(--gold);
    background: rgba(212, 168, 75, 0.08);
}
.header-dropdown-logout {
    display: block; width: 100%;
    padding: 8px 12px;
    font-size: var(--fs-xs);
    background: none; border: none;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    cursor: pointer; transition: all 0.2s;
    text-align: left; font-family: inherit;
}
.header-dropdown-logout:hover { background: rgba(255,80,80,0.08); color: #ff6b6b; }

/* Page Content */
#page-content {
    flex: 1;
    padding: 60px 44px;
    max-width: var(--content-w);
    width: 100%;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 8px 20px;
    font-family: var(--font-body);
    font-size: var(--fs-sm); font-weight: 500;
    border-radius: var(--r); border: none;
    cursor: pointer; transition: all 0.2s ease;
    position: relative; overflow: hidden;
    text-decoration: none;
}
.btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0; transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn-primary {
    background: var(--gold-gradient);
    color: var(--ink-inv);
    box-shadow: 0 2px 8px rgba(212, 168, 75, 0.2);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212, 168, 75, 0.3);
    color: var(--ink-inv);
}
.btn-secondary { background: transparent; color: var(--gold); border: 1px solid var(--gold-border); }
.btn-secondary:hover { background: var(--gold-glow-mid); border-color: var(--gold); }
.btn-ghost { background: transparent; color: var(--ink-2); border: none; }
.btn-ghost:hover { color: var(--ink-1); background: var(--bg-hover); }
.btn-danger { background: var(--err); color: #fff; border: 1px solid var(--err); }
.btn-danger:hover { background: #d32f2f; border-color: #d32f2f; }
.btn-sm { padding: 5px 14px; font-size: var(--fs-xs); }
.btn-lg { padding: 10px 24px; font-size: var(--fs-body); }
.btn-block { width: 100%; }

/* Cards */
.glass-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 22px;
    transition: all 0.25s ease;
}
.glass-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-hover);
    box-shadow: var(--shadow-2);
}

.article-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}
.article-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.article-cover {
    width: 100%; height: 170px;
    object-fit: cover;
    background: var(--bg-surface);
    transition: transform 0.4s ease;
}
.article-card:hover .article-cover { transform: scale(1.05); }
.article-card .article-body { padding: 16px 18px; }
.article-card .article-title {
    font-family: var(--font-display);
    font-size: 1.05rem; color: var(--ink-1);
    margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .article-title a { color: inherit; }
.article-card .article-title a:hover { color: var(--gold); }
.article-card .article-summary {
    font-size: var(--fs-xs); color: var(--ink-2);
    line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 12px;
}
.article-meta {
    display: flex; align-items: center; gap: 12px;
    font-size: var(--fs-xxs); color: var(--ink-3);
}
.article-meta span { display: flex; align-items: center; gap: 4px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.form-input, .form-textarea, .form-select {
    width: 100%; padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: var(--ink-1);
    font-family: var(--font-body); font-size: var(--fs-body);
    transition: all 0.2s; outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow-mid);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--ink-3); opacity: 0.6; }
.form-textarea { min-height: 100px; resize: vertical; }

/* === Custom Select Dropdown === */
.custom-select {
    position: relative;
    width: 100%;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: var(--ink-1);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    min-height: 40px;
}
.custom-select-trigger:hover {
    border-color: var(--line-hover);
}
.custom-select.open .custom-select-trigger {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow-mid);
}
.custom-select-arrow {
    width: 12px;
    height: 12px;
    opacity: 0.4;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}
.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
    opacity: 0.8;
}
.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    padding: 4px;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s var(--ease-out);
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.custom-select.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.custom-select-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 8px;
}
.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink-1);
}
.custom-select-option.selected {
    color: var(--gold);
    background: rgba(212, 168, 75, 0.06);
}
.custom-select-option.selected::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--gold-gradient);
    border-radius: 2px;
    flex-shrink: 0;
    margin-right: 4px;
}
.custom-select-placeholder {
    color: var(--ink-3);
    opacity: 0.6;
}
/* 滚动条 */
.custom-select-dropdown::-webkit-scrollbar { width: 4px; }
.custom-select-dropdown::-webkit-scrollbar-track { background: transparent; }
.custom-select-dropdown::-webkit-scrollbar-thumb { background: var(--line-hover); border-radius: 4px; }

/* 隐藏原生 select */
.custom-select + select,
select.custom-select-hidden {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Article Detail */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}
.article-detail .article-cover-full,
.single-cover {
    width: 100%; height: 320px;
    object-fit: cover;
    border-radius: var(--r-lg);
    margin-bottom: 28px;
}
.article-detail .article-title {
    font-family: var(--font-display);
    font-size: var(--fs-h1); color: var(--ink-1);
    margin-bottom: 12px;
}
.article-detail .article-content {
    font-family: 'Noto Sans SC', 'Noto Sans', 'Noto Sans Mono', sans-serif;
    font-size: 1.05rem; line-height: 2; color: var(--ink-1);
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}
/* 代码块保持等宽字体 */
.article-detail .article-content code,
.article-detail .article-content pre {
    font-family: var(--font-mono);
}
.article-detail .article-content pre {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono); font-size: 0.85rem;
    margin: 20px 0;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
    box-sizing: border-box;
}
.article-detail .article-content code {
    background: var(--bg-surface);
    padding: 2px 6px; border-radius: 4px;
    font-family: var(--font-mono); font-size: 0.9em;
}
.article-detail .article-content pre code { background: none; padding: 0; }

/* DeepTime Comments - Elegant Dark Theme */
.comments-area {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

#comments-title {
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    color: var(--ink-1);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.commentlist {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.commentlist .comment-item {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.commentlist .comment-item:hover {
    border-color: var(--gold-border);
    box-shadow: var(--shadow-2);
}

.comment-body {
    margin: 0;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author img {
    border-radius: 50%;
    border: 2px solid var(--gold-border);
    transition: transform 0.2s ease;
}

.comment-author img:hover {
    transform: scale(1.1);
}

.comment-author-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.comment-author b.fn {
    font-weight: 600;
    color: var(--ink-1);
    font-size: var(--fs-sm);
}

.comment-author .says {
    color: var(--ink-3);
    font-size: var(--fs-xs);
}

.comment-metadata {
    font-size: var(--fs-xxs);
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-metadata time {
    color: var(--ink-3);
}

.edit-link a {
    color: var(--gold);
    text-decoration: none;
    font-size: var(--fs-xxs);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.comment-item:hover .edit-link a {
    opacity: 1;
}

.comment-awaiting-moderation {
    color: var(--gold);
    font-size: var(--fs-xs);
    font-style: italic;
    margin-bottom: 12px;
}

.comment-content {
    color: var(--ink-2);
    font-size: var(--fs-sm);
    line-height: 1.7;
    margin-bottom: 8px;
}

.comment-content p {
    margin-bottom: 6px;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}

.reply-link a,
.delete-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: var(--fs-xs);
    border-radius: var(--r);
    text-decoration: none;
    transition: all 0.2s ease;
}

.reply-link a {
    color: var(--gold);
    background: rgba(212, 168, 75, 0.08);
    border: 1px solid var(--gold-border);
}

.reply-link a:hover {
    background: rgba(212, 168, 75, 0.15);
    transform: translateY(-1px);
}

.delete-link {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.delete-link:hover {
    background: rgba(255, 107, 107, 0.15);
    transform: translateY(-1px);
}

/* Comment Navigation */
.comment-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.comment-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: var(--fs-sm);
    color: var(--gold);
    background: rgba(212, 168, 75, 0.08);
    border: 1px solid var(--gold-border);
    border-radius: var(--r);
    text-decoration: none;
    transition: all 0.2s ease;
}

.comment-navigation a:hover {
    background: rgba(212, 168, 75, 0.15);
    transform: translateY(-1px);
}

.no-comments,
.be-first {
    text-align: center;
    color: var(--ink-3);
    font-size: var(--fs-sm);
    padding: 20px 0;
}

.comments-closed {
    text-align: center;
    color: var(--ink-3);
    font-size: var(--fs-sm);
    padding: 20px 0;
    font-style: italic;
}

/* Threaded Comments */
.commentlist .children {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 28px;
}

.commentlist .children .comment-item {
    border-left: 3px solid var(--gold-border);
    background: rgba(212, 168, 75, 0.03);
}

.commentlist .children .children .comment-item {
    border-left-color: var(--ink-3);
}

.commentlist .children .children .children .comment-item {
    border-left-color: var(--line);
}

/* Comment Depth Collapse */
.commentlist .children .deeptime-collapsed {
    display: none;
}
.deeptime-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin: 8px 0;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: var(--gold);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.deeptime-expand-btn:hover {
    background: var(--bg-hover);
    border-color: var(--gold-border);
}

/* Comment Form */
#respond {
    scroll-margin-top: 80px;
}
.comment-form {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px;
    margin-top: 24px;
}

.comment-form #reply-title {
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    color: var(--ink-1);
    margin-bottom: 20px;
}

.comment-form #reply-title small {
    font-size: var(--fs-xs);
    color: var(--ink-3);
    margin-left: 8px;
}

.comment-form #reply-title small a {
    color: var(--gold);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.comment-form #reply-title small a:hover {
    opacity: 0.8;
}

.comment-form .form-group {
    margin-bottom: 16px;
}

.comment-form label {
    display: block;
    font-size: var(--fs-sm);
    color: var(--ink-2);
    margin-bottom: 8px;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--fs-sm);
    color: var(--ink-1);
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--gold-border);
    box-shadow: 0 0 0 3px var(--gold-glow-mid);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.comment-form .submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-inv);
    background: var(--gold-gradient);
    border: 1px solid var(--gold-border);
    border-radius: var(--r);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.comment-form .submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 168, 75, 0.3);
}

.must-log-in {
    color: var(--ink-2);
    font-size: var(--fs-sm);
    text-align: center;
    padding: 20px 0;
}

.must-log-in a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    margin: 0 8px;
    font-size: var(--fs-sm);
    font-weight: 500;
    border-radius: var(--r);
    text-decoration: none;
    transition: all 0.2s ease;
}

.must-log-in a[href*="login"] {
    background: var(--gold-gradient);
    color: var(--ink-inv);
    border: 1px solid var(--gold-border);
}

.must-log-in a[href*="login"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 168, 75, 0.3);
}

.logged-in-as {
    color: var(--ink-2);
    font-size: var(--fs-sm);
    margin-bottom: 16px;
}

.logged-in-as a {
    color: var(--gold);
    text-decoration: none;
}

.logged-in-as a:hover {
    text-decoration: underline;
}

/* Comment Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.navigation .alignleft,
.navigation .alignright {
    flex: 1;
}

.navigation .alignleft {
    text-align: left;
}

.navigation .alignright {
    text-align: right;
}

.navigation a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: var(--fs-sm);
    color: var(--gold);
    background: rgba(212, 168, 75, 0.08);
    border: 1px solid var(--gold-border);
    border-radius: var(--r);
    text-decoration: none;
    transition: all 0.2s ease;
}

.navigation a:hover {
    background: rgba(212, 168, 75, 0.15);
    transform: translateY(-1px);
}

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 32px; }
.pagination a, .pagination span {
    padding: 8px 14px; border-radius: var(--r-sm);
    font-size: var(--fs-sm); color: var(--ink-2);
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    transition: all 0.2s;
}
.pagination a:hover { border-color: var(--gold-border); color: var(--gold); }
.pagination .current {
    background: var(--gold-gradient);
    color: var(--ink-inv); border-color: transparent;
}

/* Toast */
.toast-container {
    position: fixed; top: 18px; right: 18px;
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 12px 18px; min-width: 280px;
    box-shadow: var(--shadow-3);
    animation: slide-in-right 0.3s ease;
}
.toast-success { border-left: 2px solid var(--ok); }
.toast-error { border-left: 2px solid var(--err); }

/* Badge */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 100px;
    font-size: var(--fs-xxs); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-admin { background: var(--gold-glow-mid); color: var(--gold); }
.badge-published { background: rgba(92, 184, 136, 0.15); color: var(--ok); }

/* Grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto-fill { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes slide-in-right { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.animate-fadeInUp { animation: fadeInUp 0.4s ease; }
.animate-fadeIn { animation: fadeIn 0.3s ease; }

.stagger-in > * { opacity: 0; animation: fadeIn 0.4s ease forwards; }
.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 50ms; }
.stagger-in > *:nth-child(3) { animation-delay: 100ms; }
.stagger-in > *:nth-child(4) { animation-delay: 150ms; }
.stagger-in > *:nth-child(5) { animation-delay: 200ms; }
.stagger-in > *:nth-child(6) { animation-delay: 250ms; }

.gradient-text {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive - 桌面端：侧边栏覆盖模式 */
@media (min-width: 769px) {
    /* 侧边栏覆盖在主界面上，不挤压 */
    #main-content { margin-left: 0; }
    /* 桌面端默认显示汉堡按钮 */
    .hamburger { display: flex !important; }
}

@media (max-width: 768px) {
    .hamburger { display: block; }
    #page-content { padding: 20px 14px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .article-detail .article-cover-full { height: 180px; }
    .article-detail .article-title { font-size: var(--fs-h2); }
    .btn, .form-input, .form-textarea { min-height: 44px; }
    .commentlist .children { margin-left: 14px; }
    .commentlist .children .children { margin-left: 10px; }
    .commentlist .comment-item { padding: 10px 12px; }
    .comment-meta { flex-direction: column; gap: 3px; }
    .deeptime-expand-btn { padding: 6px 12px; font-size: 12px; }

    /* 移动端导航优化 */
    .hamburger {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin-left: -8px;
    }

    /* 移动端侧边栏优化 */
    #sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #sidebar.open {
        transform: translateX(0);
    }

    /* 移动端表单优化 */
    .form-input, .form-textarea, .form-select {
        font-size: 16px; /* 防止 iOS 自动缩放 */
        padding: 12px 14px;
    }

    /* 移动端按钮优化 */
    .btn {
        padding: 12px 20px;
        font-size: var(--fs-sm);
    }
    .btn-sm {
        padding: 8px 14px;
        font-size: var(--fs-xs);
    }

    /* 移动端卡片优化 */
    .glass-card {
        padding: 18px;
    }
    .article-card .article-body {
        padding: 14px 16px;
    }

    /* 移动端表格优化 */
    .wp-table th, .wp-table td {
        padding: 10px 12px;
        font-size: var(--fs-xs);
    }

    /* 移动端模态框优化 */
    .modal-content {
        padding: 20px;
        margin: 10px;
        max-height: 90vh;
    }

    /* 移动端 Toast 优化 */
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 14px;
        left: 14px;
    }
    .toast {
        min-width: auto;
        width: 100%;
    }

    /* 移动端用户菜单优化 */
    .header-dropdown {
        width: 240px;
        right: -10px;
    }
    .header-username {
        display: none;
    }

    /* 移动端分页优化 */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    .pagination a, .pagination span {
        padding: 8px 12px;
        font-size: var(--fs-xs);
    }
}

@media (hover: none) {
    .article-card:hover, .glass-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    #particle-canvas { display: none; }
    .starfield::before { animation: none; }
}

/* ============================================
   统一组件样式
   ============================================ */

/* === Toggle 开关 === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--err);
    border-radius: 24px;
    transition: background 0.3s ease;
    pointer-events: none;
}
.toggle-dot {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    pointer-events: none;
}
.toggle-switch input:checked ~ .toggle-slider {
    background: var(--ok);
}
.toggle-switch input:checked ~ .toggle-dot {
    transform: translateX(20px);
}

/* 移动端 Toggle 开关优化 */
@media (max-width: 768px) {
    .toggle-switch {
        width: 48px;
        height: 28px;
    }
    .toggle-dot {
        width: 22px;
        height: 22px;
    }
    .toggle-switch input:checked ~ .toggle-dot {
        transform: translateX(20px);
    }
}

/* === 表格 === */
.wp-table {
    width: 100%;
    border-collapse: collapse;
}
.wp-table th {
    text-align: left;
    font-size: var(--fs-xxs);
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--line);
    font-weight: 500;
    padding: 14px 16px;
}
.wp-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-1);
    font-size: var(--fs-sm);
    vertical-align: middle;
}
.wp-table tr:last-child td {
    border-bottom: none;
}
.wp-table tr:hover td {
    background: var(--bg-hover);
}

/* === Badge 徽章扩展 === */
.badge-administrator { background: rgba(212, 168, 75, 0.15); color: var(--gold); }
.badge-user, .badge-subscriber { background: rgba(99, 179, 237, 0.15); color: #63b3ed; }
.badge-editor { background: rgba(99, 179, 237, 0.15); color: #63b3ed; }
.badge-deeptime_pending { background: rgba(255, 107, 107, 0.15); color: #ff6b6b; }
.badge-draft { background: rgba(255, 255, 255, 0.06); color: var(--ink-3); }

/* === Stat Card === */
.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 22px;
    text-align: center;
    transition: all 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-hover);
    box-shadow: var(--shadow-2);
}
.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 4px;
}
.stat-label {
    font-size: var(--fs-xxs);
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* === 模态框 === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-3);
    animation: scaleIn 0.25s var(--ease-out);
}
.modal-title {
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    color: var(--ink-1);
    margin-bottom: 16px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* === 分类标签 === */
.category-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 6px 14px;
    font-size: var(--fs-xs);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 100px;
    color: var(--ink-2);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tab-btn:hover {
    border-color: var(--gold-border);
    color: var(--gold);
}
.tab-btn.active {
    background: var(--gold-glow-mid);
    border-color: var(--gold-border);
    color: var(--gold);
}

/* === 文件卡片 === */
.file-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.file-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-hover);
    box-shadow: var(--shadow-2);
}
.file-card-icon { font-size: 2rem; }
.file-card-title {
    font-weight: 500;
    color: var(--ink-1);
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}
.file-card-desc {
    font-size: var(--fs-xs);
    color: var(--ink-3);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.file-card-meta {
    display: flex;
    gap: 10px;
    font-size: var(--fs-xxs);
    color: var(--ink-3);
    flex-wrap: wrap;
}
.file-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

/* === 用户操作按钮 === */
.user-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}
.user-actions .btn {
    padding: 4px 10px;
    font-size: var(--fs-xxs);
}

/* === 拖拽上传区域 === */
.upload-zone {
    border: 2px dashed var(--line);
    border-radius: var(--r-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--gold);
    background: var(--gold-glow);
}

/* === 搜索栏 === */
.search-bar {
    position: relative;
}
.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-3);
    pointer-events: none;
}
.search-bar .form-input {
    padding-left: 44px;
}

/* === 认证页面（登录/注册） === */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 40px 44px;
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.6s var(--ease-out);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}
.auth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse 300px 300px at 50% 0%, rgba(212, 168, 75, 0.04), transparent);
    pointer-events: none;
}
.auth-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, rgba(212, 168, 75, 0.20) 50%, transparent 90%);
}
.auth-title {
    text-align: center;
    margin-bottom: 28px;
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    position: relative;
    font-family: var(--font-display);
    color: var(--ink-1);
}
.auth-form .form-group {
    margin-bottom: 16px;
}
.auth-form .form-group label {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 400;
    color: var(--ink-2);
    margin-bottom: 6px;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: var(--fs-xs);
    color: var(--ink-3);
    position: relative;
}
.auth-footer a {
    color: var(--gold);
    text-decoration: none;
}
.auth-footer a:hover {
    color: var(--gold-bright);
}
[data-theme="light"] .auth-card {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .auth-card::before {
    background: radial-gradient(ellipse 300px 300px at 50% 0%, rgba(160, 120, 48, 0.06), transparent);
}
[data-theme="light"] .auth-card::after {
    background: linear-gradient(90deg, transparent 10%, rgba(160, 120, 48, 0.15) 50%, transparent 90%);
}
