/* ============================================================
   团队笔记 — Ember Theme System
   近黑画布 · 琥珀橙单色锚点 · 玻璃拟态 · 编辑级排版
   ============================================================ */

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;

    --radius: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* === Dark Theme (default) === */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #07090f;
    --bg-secondary: #0d111a;
    --card-bg: #121826;
    --card-bg-hover: #1a2234;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #ff7a1a;
    --primary-hover: #ff9340;
    --primary-ink: #1a0d00;
    --primary-bg: rgba(255, 122, 26, 0.12);
    --primary-soft: rgba(255, 122, 26, 0.32);
    --danger: #f05252;
    --danger-hover: #ff6b6b;
    --danger-bg: rgba(240, 82, 82, 0.12);
    --success: #10b981;
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.14);
    --glass: rgba(7, 9, 15, 0.8);
    --glass-secondary: rgba(13, 17, 26, 0.88);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.4);
    --glow: 0 0 0 1px rgba(255, 122, 26, 0.35), 0 0 28px rgba(255, 122, 26, 0.18);
    --code-bg: #0f1420;
    --card-glass: rgba(27, 27, 34, 0.56);
    --card-glass-hover: rgba(36, 36, 45, 0.7);
    --card-border: rgba(255, 190, 140, 0.13);
    --inset-highlight: rgba(255, 255, 255, 0.08);
    --title-grad-a: #f4f8ff;
    --title-grad-b: #ffd0a3;
    --title-grad-c: #ff7a1a;
}

/* === Light Theme (warm paper) === */
[data-theme="light"] {
    color-scheme: light;
    --bg: #f8fafc;
    --bg-secondary: #f1f5f9;
    --card-bg: #ffffff;
    --card-bg-hover: #fbfdff;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.16);
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #ea580c;
    --primary-hover: #c2410c;
    --primary-ink: #ffffff;
    --primary-bg: rgba(234, 88, 12, 0.08);
    --primary-soft: rgba(234, 88, 12, 0.25);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-bg: rgba(220, 38, 38, 0.08);
    --success: #059669;
    --warning: #b45309;
    --warning-bg: rgba(180, 83, 9, 0.08);
    --glass: rgba(248, 250, 252, 0.85);
    --glass-secondary: rgba(241, 245, 249, 0.92);
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.04);
    --glow: 0 0 0 1px rgba(234, 88, 12, 0.3), 0 0 24px rgba(234, 88, 12, 0.12);
    --code-bg: #f1f5f9;
    --card-glass: rgba(255, 253, 250, 0.58);
    --card-glass-hover: rgba(255, 251, 245, 0.76);
    --card-border: rgba(28, 25, 23, 0.08);
    --inset-highlight: rgba(255, 255, 255, 0.85);
    --title-grad-a: #0f172a;
    --title-grad-b: #9a3412;
    --title-grad-c: #ea580c;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
/* Vditor uses content-box internally — don't break its layout */
.vditor, .vditor *, .vditor *::before, .vditor *::after { box-sizing: content-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background 0.25s ease, color 0.25s ease;
}

::selection { background: var(--primary-soft); color: var(--text); }

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

h1, h2, h3, h4 { letter-spacing: -0.02em; }

button { font-family: inherit; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Thin styled scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    transition: background 0.2s var(--ease-out), border-color 0.2s,
                transform 0.15s var(--ease-out), box-shadow 0.2s;
    white-space: nowrap;
}
.btn:hover { background: var(--card-bg-hover); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary); color: var(--primary-ink); border-color: transparent;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255, 122, 26, 0.25);
}
[data-theme="light"] .btn-primary { box-shadow: 0 4px 14px rgba(234, 88, 12, 0.25); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); border-color: transparent; }

.btn-secondary {
    background: transparent; color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

.btn-sm { padding: 5px 13px; font-size: 12px; }
.btn-lg { padding: 11px 26px; font-size: 15px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.icon-btn, .btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-secondary);
    cursor: pointer; font-size: 15px;
    transition: background 0.2s, color 0.2s, transform 0.15s var(--ease-out);
}
.icon-btn:hover, .btn-icon:hover { background: var(--primary-bg); color: var(--primary); }
.icon-btn:active, .btn-icon:active { transform: scale(0.92); }

.mobile-menu-btn { display: none; }

/* ============================================================
   Navbar — 独立页面顶部导航（编辑 / 管理）
   ============================================================ */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px;
}
.nav-logo {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 17px; font-weight: 800; color: var(--text);
    letter-spacing: -0.02em; text-decoration: none;
}
.nav-logo i { color: var(--primary); }
a.nav-logo:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-secondary);
    cursor: pointer; font-size: 15px;
    transition: background 0.2s, color 0.2s, transform 0.15s var(--ease-out);
}
.theme-toggle:hover { background: var(--primary-bg); color: var(--primary); }
.theme-toggle:active { transform: scale(0.92); }

/* 背景光晕装饰 */
.bg-decoration {
    position: fixed; inset: 0; z-index: -1;
    pointer-events: none; overflow: hidden;
}
.glow { position: absolute; border-radius: 50%; filter: blur(90px); }
.glow-1 {
    width: 520px; height: 520px; top: -160px; right: -120px;
    background: radial-gradient(circle, rgba(255, 122, 26, 0.16), transparent 70%);
}
.glow-2 {
    width: 420px; height: 420px; bottom: -120px; left: -140px;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.10), transparent 70%);
}

/* ============================================================
   Layout
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    width: 264px; min-width: 264px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 18px 14px;
    position: fixed; top: 0; left: 0; bottom: 0;
    overflow-y: auto; z-index: 100;
    transition: transform 0.3s var(--ease-out);
}
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px; padding: 0 6px 14px;
    border-bottom: 1px solid var(--border);
}
.logo-text {
    font-size: 17px; font-weight: 800; color: var(--text);
    letter-spacing: -0.02em; display: inline-flex; align-items: baseline; gap: 2px;
}
.logo-text::after {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary); display: inline-block; margin-left: 4px;
}
a.logo-text:hover { color: var(--text); }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; margin-bottom: 18px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px;
    transition: background 0.2s, color 0.2s;
    position: relative;
}
.nav-item i { width: 16px; text-align: center; font-size: 13px; }
.nav-item:hover { background: var(--primary-bg); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-item.active::before {
    content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 0 2px 2px 0; background: var(--primary);
}
.nav-badge {
    margin-left: auto;
    background: var(--primary); color: var(--primary-ink);
    padding: 1px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
}
.memo-badge {
    margin-left: auto;
    background: var(--warning); color: #1a1200;
    padding: 1px 7px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
}

.sidebar-section { margin-top: 6px; }
.sidebar-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-right: 4px;
}
.sidebar-section-title {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 12px 6px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); cursor: pointer;
    transition: color 0.2s;
}
.sidebar-section-title:hover { color: var(--text-secondary); }

.folder-list { margin-top: 2px; }
.column-group { margin-bottom: 2px; }
.column-name {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 12px; font-size: 11px; font-weight: 700;
    color: var(--text-muted); cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.06em;
    border-radius: var(--radius-xs);
    transition: color 0.2s;
}
.column-name:hover { color: var(--text-secondary); }
.column-count { margin-left: auto; font-size: 10px; font-weight: 500; }
.column-folders { padding-left: 6px; }
.folder-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    font-size: 13px; cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
}
.folder-item i { font-size: 12px; opacity: 0.7; }
.folder-item:hover { background: var(--primary-bg); color: var(--text); }
.folder-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.folder-count { margin-left: auto; font-size: 10px; color: var(--text-muted); }

.collections-list { margin-top: 2px; }
.collection-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; color: var(--text-secondary);
    transition: background 0.2s, color 0.2s; position: relative;
}
.collection-item:hover { background: var(--primary-bg); color: var(--text); }
.collection-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.collection-info { display: flex; align-items: center; gap: 8px; }
.collection-info i { font-size: 12px; opacity: 0.7; }
.collection-note-count { font-size: 10px; color: var(--text-muted); }
.collection-menu-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 2px 6px; border-radius: 4px;
    font-size: 12px; opacity: 0; transition: opacity 0.2s, background 0.2s;
}
.collection-item:hover .collection-menu-btn { opacity: 1; }
.collection-menu-btn:hover { background: var(--border); color: var(--text); }
.collection-total { font-size: 10px; color: var(--text-muted); padding: 0 12px; }

/* === 迷你头像（列表/笔记卡片/排行榜/个人主页通用）=== */
.avatar-mini {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #ffb25e);
    color: #fff; font-weight: 700; font-size: 10px;
    flex-shrink: 0; overflow: hidden; line-height: 1;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content { flex: 1; margin-left: 264px; padding: 20px 32px 40px; min-height: 100vh; }

/* ============================================================
   Topbar — sticky glass
   ============================================================ */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 4px; gap: 12px;
    position: sticky; top: 0; z-index: 90;
    margin: -20px -32px 22px; padding: 12px 32px;
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.search-bar {
    display: flex; align-items: center; gap: 8px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 16px; width: 300px;
    color: var(--text-muted); font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s, width 0.3s var(--ease-out);
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
    width: 340px; color: var(--primary);
}
.search-bar input {
    flex: 1; background: none; border: none; color: var(--text);
    font-size: 13px; outline: none; font-family: inherit;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-clear {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border: none; border-radius: 50%;
    background: var(--border); color: var(--text-muted);
    cursor: pointer; font-size: 9px; transition: background 0.2s, color 0.2s;
}
.search-clear:hover { background: var(--danger); color: #fff; }

/* ============================================================
   User menu
   ============================================================ */
.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px 4px 4px; border: 1px solid var(--border);
    border-radius: 999px; background: var(--card-bg);
    color: var(--text); cursor: pointer;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.user-btn:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.user-btn .fa-chevron-down { font-size: 10px; color: var(--text-muted); }

/* === 顶栏贡献排名入口 === */
.ranking-entry {
    display: flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 12px; border-radius: 999px;
    background: var(--card-bg); border: 1px solid var(--border);
    cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.ranking-entry:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.ranking-entry > i { color: var(--primary); font-size: 13px; }
.ranking-avatars { display: flex; align-items: center; }
.ranking-avatars .avatar-mini { margin-left: -7px; border: 2px solid var(--bg); }
.ranking-avatars .avatar-mini:first-child { margin-left: 0; }
.ranking-more { font-size: 13px; color: var(--text-muted); font-weight: 700; letter-spacing: 1px; line-height: 1; }
.user-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #ffb25e);
    color: var(--primary-ink);
    font-weight: 700; font-size: 12px;
}
.user-dropdown {
    position: absolute; right: 0; top: 100%; margin-top: 6px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    min-width: 168px; z-index: 1000; padding: 5px;
    display: none;
}
.user-dropdown.show { display: block; animation: dropIn 0.18s var(--ease-out); }
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 12px; border: none; border-radius: var(--radius-xs);
    background: none; color: var(--text); font-size: 13px;
    cursor: pointer; transition: background 0.15s, color 0.15s;
    font-family: inherit; text-align: left; text-decoration: none;
}
.dropdown-item:hover { background: var(--primary-bg); color: var(--primary); }

/* === 公告通知 === */
.notif-wrap { position: relative; }
.notif-badge {
    position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
    padding: 0 5px; border-radius: 999px; background: var(--danger);
    color: #fff; font-size: 10px; font-weight: 700; line-height: 17px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--bg);
}
.notif-dropdown {
    position: absolute; right: 0; top: 100%; margin-top: 6px;
    width: 340px; max-width: 90vw; max-height: 72vh;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    z-index: 1000; overflow: hidden;
    animation: dropIn 0.18s var(--ease-out);
}
.notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 700;
}
.notif-header .icon-btn { width: 26px; height: 26px; font-size: 12px; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-item { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item-title { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.notif-item-content { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.notif-item-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; }
.notif-empty { text-align: center; color: var(--text-muted); padding: 32px 16px; font-size: 14px; }
.notif-empty i { font-size: 28px; display: block; margin-bottom: 10px; opacity: .5; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   Notes Grid
   ============================================================ */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}
.note-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
    position: relative;
    display: flex; flex-direction: column;
    animation: cardIn 0.4s var(--ease-out) backwards;
}
.note-card:nth-child(4n+2) { animation-delay: 0.05s; }
.note-card:nth-child(4n+3) { animation-delay: 0.1s; }
.note-card:nth-child(4n+4) { animation-delay: 0.15s; }
@keyframes cardIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.note-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover), transparent);
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0; transform: scaleX(0.5); transform-origin: left;
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
    pointer-events: none;
}
.note-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-soft);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--primary-soft);
}
.note-card:hover::before { opacity: 1; transform: scaleX(1); }
.note-card.is-draft { border-left: 3px solid var(--warning); }
.note-card.is-new { animation: newFlash 0.5s var(--ease-out); }
@keyframes newFlash {
    0% { box-shadow: var(--glow); border-color: var(--primary); }
    100% { box-shadow: none; }
}
.note-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 10px; gap: 6px;
}
.note-title {
    font-size: 15.5px; font-weight: 700; color: var(--text);
    line-height: 1.45; flex: 1; letter-spacing: -0.01em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color 0.2s;
}
.note-title:hover { color: var(--primary); }
.draft-badge {
    font-size: 10px; padding: 2px 7px; border-radius: 999px;
    background: var(--warning-bg); color: var(--warning); font-weight: 700;
    letter-spacing: 0.04em; vertical-align: middle; margin-left: 4px;
}
.note-menu-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px 6px; border-radius: var(--radius-xs);
    font-size: 11px; opacity: 0; transition: opacity 0.2s, background 0.2s;
}
.note-card:hover .note-menu-btn { opacity: 1; }
.note-menu-btn:hover { background: var(--border); color: var(--text); }
.note-meta {
    display: flex; flex-wrap: wrap; gap: 12px;
    font-size: 12px; color: var(--text-muted); margin-bottom: 10px;
}
.note-meta span { display: flex; align-items: center; gap: 4px; }
.note-meta i { font-size: 10px; opacity: 0.75; }
.note-preview {
    font-size: 13px; color: var(--text-secondary); line-height: 1.65;
    margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.note-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.note-tag {
    font-size: 11px; padding: 2px 10px; border-radius: 999px;
    background: var(--primary-bg); color: var(--primary); font-weight: 500;
}
.note-actions {
    display: flex; gap: 4px; opacity: 0;
    transition: opacity 0.2s; margin-top: auto; padding-top: 6px;
}
.note-card:hover .note-actions { opacity: 1; }
.note-act-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: none; border-radius: var(--radius-xs);
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 13px; text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.note-act-btn:hover { background: var(--primary-bg); color: var(--primary); }
.note-act-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   Batch selection (批量删除)
   ============================================================ */
.batch-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    margin-bottom: 16px; padding: 10px 16px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.batch-bar-info {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-secondary);
}
.batch-bar-info i { color: var(--primary); }
.batch-bar-info b { color: var(--text); font-size: 15px; }
.batch-bar-actions { display: flex; align-items: center; gap: 8px; }

.btn-batch-danger {
    background: var(--danger); color: #fff; border-color: transparent; font-weight: 600;
}
.btn-batch-danger:hover:not(:disabled) { background: var(--danger-hover); color: #fff; }
.btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

.note-card.batch-selectable { cursor: pointer; padding-left: 50px; }
.note-card.selected {
    border-color: var(--primary);
    box-shadow: var(--glow);
}
.note-card.batch-selectable .note-actions,
.note-card.batch-selectable .note-menu-btn { display: none; }
.note-card.batch-selectable .note-title { pointer-events: none; }

.batch-checkbox {
    position: absolute; top: 20px; left: 16px;
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--border-strong); background: var(--card-bg);
    display: flex; align-items: center; justify-content: center;
    color: transparent; font-size: 11px;
    transition: all 0.18s var(--ease-out);
}
.batch-checkbox.checked {
    background: var(--primary); border-color: var(--primary); color: var(--primary-ink);
}

/* Note & collection dropdown menus */
.note-dropdown, .collection-dropdown {
    position: absolute; right: 0; top: 100%; margin-top: 4px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    min-width: 140px; z-index: 1000; padding: 5px;
    animation: dropIn 0.18s var(--ease-out);
}

/* ============================================================
   Empty / Loading / Skeleton
   ============================================================ */
.empty-state {
    grid-column: 1 / -1; text-align: center;
    padding: 72px 20px; color: var(--text-muted);
}
.empty-state i {
    font-size: 44px; margin-bottom: 20px; display: inline-block;
    width: 96px; height: 96px; line-height: 96px; text-align: center;
    border-radius: 50%; color: var(--primary);
    background: var(--primary-bg); opacity: 1;
    box-shadow: inset 0 0 0 1px var(--primary-soft);
}
.empty-state p { font-size: 15px; margin: 6px 0; color: var(--text-secondary); }
.empty-state p:last-child { color: var(--text-muted); font-size: 13px; }
.loading-spinner {
    grid-column: 1 / -1; text-align: center;
    padding: 56px; color: var(--text-muted); font-size: 14px;
}
.loading-spinner i { color: var(--primary); margin-right: 6px; }

.skeleton-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
}
.sk-line {
    height: 12px; border-radius: 6px;
    background: linear-gradient(90deg, var(--border) 25%, var(--border-strong) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.sk-line:nth-child(1) { width: 60%; height: 16px; }
.sk-line:nth-child(2) { width: 90%; }
.sk-line:nth-child(3) { width: 75%; }
.sk-line:nth-child(4) { width: 40%; }
@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* Scroll reveal */
.scroll-reveal {
    opacity: 0; transform: translateY(20px); filter: blur(5px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out), filter 0.7s var(--ease-out);
}
.scroll-reveal.revealed { opacity: 1; transform: translateY(0); filter: blur(0); }

/* ============================================================
   Memo Panel — glass drawer
   ============================================================ */
.memo-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 199;
}
.memo-panel {
    position: fixed; top: 0; right: 0;
    width: 400px; max-width: 92vw; height: 100%;
    background: var(--glass-secondary);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-left: 1px solid var(--border);
    z-index: 200; transform: translateX(100%);
    transition: transform 0.35s var(--ease-out);
    display: flex; flex-direction: column;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.4);
}
.memo-panel.open { transform: translateX(0); }
.memo-overlay.show { display: block; }
.memo-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.memo-panel-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.memo-panel-header h3 i { color: var(--primary); margin-right: 4px; }
.memo-panel-actions { display: flex; gap: 4px; }
.memo-body { flex: 1; overflow-y: auto; padding: 18px; position: relative; }
.memo-fab {
    position: absolute; bottom: 24px; right: 24px;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary); color: var(--primary-ink); border: none;
    font-size: 18px; cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 122, 26, 0.4);
    transition: background 0.2s, transform 0.2s var(--ease-out);
    z-index: 5;
}
.memo-fab:hover { background: var(--primary-hover); transform: scale(1.06); }
.memo-list { display: flex; flex-direction: column; gap: 10px; }
.memo-item {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px;
    display: flex; justify-content: space-between; align-items: flex-start;
    transition: border-color 0.2s, transform 0.2s var(--ease-out);
    animation: cardIn 0.3s var(--ease-out) backwards;
}
.memo-item:hover { border-color: var(--border-strong); }
.memo-item.is-pinned { border-left: 3px solid var(--warning); }
.memo-item.is-done { opacity: 0.45; }
.memo-item.is-done .memo-title { text-decoration: line-through; }
.memo-content { flex: 1; min-width: 0; }
.memo-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.memo-text { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.memo-remind { font-size: 11px; color: var(--warning); margin-top: 6px; }
.memo-actions { display: flex; gap: 2px; flex-shrink: 0; margin-left: 8px; }
.memo-act-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border: none; border-radius: var(--radius-xs);
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 11px; transition: background 0.2s, color 0.2s;
}
.memo-act-btn:hover { background: var(--primary-bg); color: var(--primary); }
.memo-act-btn.is-pinned { color: var(--warning); }
.memo-act-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.memo-empty { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.memo-empty i { font-size: 34px; margin-bottom: 12px; opacity: 0.2; display: block; }
.memo-editor {
    display: none; border-top: 1px solid var(--border);
    padding: 18px 22px; background: var(--bg);
}
.memo-editor.show { display: block; }
.memo-editor-header { margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.memo-editor-body { display: flex; flex-direction: column; gap: 10px; }
.memo-input, .memo-textarea {
    width: 100%; padding: 9px 13px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--card-bg); color: var(--text);
    font-size: 13px; font-family: inherit; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.memo-input:focus, .memo-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.memo-textarea { resize: vertical; line-height: 1.6; }
.memo-editor-row { display: flex; align-items: center; gap: 8px; }
.memo-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.memo-input-sm { flex: 1; }
.memo-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ============================================================
   Landing Page
   ============================================================ */
.landing-page {
    min-height: 100vh; display: flex; flex-direction: column;
    position: relative; z-index: 1;
}
#particle-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}

/* Warm ambient glow behind hero */
.landing-page::before {
    content: ''; position: fixed; z-index: 0; pointer-events: none;
    top: -30vh; left: 50%; transform: translateX(-50%);
    width: 90vw; height: 70vh;
    background: radial-gradient(ellipse at center, rgba(255, 122, 26, 0.09) 0%, transparent 65%);
}
[data-theme="light"] .landing-page::before {
    background: radial-gradient(ellipse at center, rgba(234, 88, 12, 0.07) 0%, transparent 65%);
}

.landing-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 36px; position: sticky; top: 0; z-index: 50;
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.hero {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 72px 20px 56px; position: relative; z-index: 2;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
    color: var(--text-secondary);
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 16px; margin-bottom: 28px;
    animation: cardIn 0.5s var(--ease-out) backwards;
}
.hero-badge::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.hero-title {
    font-size: clamp(44px, 7vw, 72px); font-weight: 800; color: var(--text);
    letter-spacing: -0.04em; line-height: 1.1;
    margin: 0 0 16px;
    animation: cardIn 0.5s var(--ease-out) 0.05s backwards;
}
.hero-title .accent { color: var(--primary); }
.hero-subtitle {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-secondary); margin: 0 0 36px;
    max-width: 520px; line-height: 1.8;
    animation: cardIn 0.5s var(--ease-out) 0.1s backwards;
}
.hero-actions {
    display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
    animation: cardIn 0.5s var(--ease-out) 0.15s backwards;
}
.hero-stats {
    display: flex; gap: 48px; margin-top: 48px;
    animation: cardIn 0.5s var(--ease-out) 0.2s backwards;
}
.hero-stat { text-align: center; color: var(--text-muted); font-size: 13px; }
.hero-stat-num {
    display: block; font-size: 30px; font-weight: 800; color: var(--text);
    letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}

/* Public Notes */
.public-notes-section {
    max-width: 1060px; margin: 0 auto;
    padding: 56px 24px; position: relative; z-index: 2;
}
.section-header { text-align: center; margin-bottom: 36px; }
.section-label {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--primary); margin-bottom: 12px;
}
.section-label::before, .section-label::after {
    content: ''; width: 22px; height: 1.5px; background: var(--primary); opacity: 0.6;
}
.section-header h2 {
    font-size: 28px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.03em;
}
.public-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.public-note-card {
    display: block; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; color: var(--text); text-decoration: none;
    transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
}
.public-note-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}
.pn-folder {
    font-size: 11px; color: var(--primary); margin-bottom: 10px;
    font-weight: 700; letter-spacing: 0.04em;
}
.pn-title { font-size: 16.5px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.01em; }
.pn-preview {
    font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.65;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pn-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-muted); }
.pn-meta span { display: flex; align-items: center; gap: 4px; }
.pn-meta i { font-size: 10px; opacity: 0.75; }

/* Pagination */
.pagination {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 8px; margin-top: 34px;
}
.page-btn {
    min-width: 38px; height: 38px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}
.page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--border-strong); transform: translateY(-1px);
}
.page-btn.active {
    background: var(--primary); border-color: var(--primary); color: #fff; cursor: default;
}
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Feature Cards */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px; padding: 24px 36px 72px;
    max-width: 1060px; margin: 0 auto; position: relative; z-index: 2;
}
.feature-card {
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 22px 20px; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); text-decoration: none;
    transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
}
.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}
.feature-icon {
    width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); background: var(--primary-bg);
    margin-bottom: 14px; font-size: 18px; color: var(--primary);
    transition: transform 0.25s var(--ease-out);
}
.feature-card:hover .feature-icon { transform: scale(1.08) rotate(-4deg); }
.feature-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.feature-card p { font-size: 12.5px; color: var(--text-secondary); margin: 0; line-height: 1.6; }
.landing-footer {
    text-align: center; padding: 22px; color: var(--text-muted); font-size: 12px;
    position: relative; z-index: 2; border-top: 1px solid var(--border);
}

/* ============================================================
   Toast
   ============================================================ */
#toast {
    position: fixed; top: 24px; right: 24px; z-index: 99999;
    padding: 11px 20px; border-radius: var(--radius-sm);
    color: #fff; font-size: 13px; font-weight: 500;
    opacity: 0; transform: translateY(-10px);
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    pointer-events: none;
    box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   加载更多
   ============================================================ */
.load-more-wrap {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 8px 0 4px; margin-top: 4px;
}
.load-more-info { font-size: 12.5px; color: var(--text-muted); }

/* ============================================================
   登录/注册弹窗
   ============================================================ */
.auth-overlay {
    position: fixed; inset: 0; z-index: 100000;
    background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-modal {
    width: min(400px, 92vw);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: authPop 0.22s var(--ease-out);
}
@keyframes authPop {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-modal-header {
    padding: 18px 22px; font-size: 17px; font-weight: 700;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.auth-modal-header i { color: var(--primary); }
.auth-modal-body { padding: 20px 22px 8px; }
.auth-label {
    display: block; font-size: 12.5px; font-weight: 600;
    color: var(--text-secondary); margin: 0 0 6px;
}
.auth-input {
    width: 100%; padding: 11px 14px; margin-bottom: 14px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.15);
}
.auth-hint { font-size: 12px; color: var(--text-muted); min-height: 18px; margin-bottom: 6px; }
.auth-modal-actions {
    padding: 8px 22px 20px; display: flex; gap: 10px; align-items: center;
}
.auth-modal-actions .btn { flex: 1; }
#authGuest { flex: 0 0 auto; }

/* ============================================================
   Read Page — editorial serif reading experience
   ============================================================ */
.read-layout { max-width: 780px; margin: 0 auto; padding: 28px 20px 64px; }
.read-topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 32px; flex-wrap: wrap; gap: 8px;
}
.read-topbar a, .read-topbar button {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border: 1px solid var(--border);
    border-radius: 999px; background: var(--card-bg);
    color: var(--text-secondary); cursor: pointer; font-size: 13px;
    text-decoration: none; font-family: inherit;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.read-topbar a:hover, .read-topbar button:hover {
    border-color: var(--primary); color: var(--primary); background: var(--primary-bg);
}
.read-title {
    font-family: var(--font-serif);
    font-size: clamp(26px, 4vw, 34px); font-weight: 900;
    letter-spacing: -0.01em; line-height: 1.35;
    margin: 0 0 14px;
}
.read-meta {
    color: var(--text-muted); font-size: 13px; margin-bottom: 28px;
    display: flex; flex-wrap: wrap; gap: 14px;
    padding-bottom: 22px; border-bottom: 1px solid var(--border);
}
.read-meta span { display: inline-flex; align-items: center; gap: 5px; }
.read-meta i { font-size: 11px; opacity: 0.75; }

.read-content {
    font-family: var(--font-serif);
    font-size: 16px; line-height: 1.95;
    color: var(--text);
}
.read-content h1, .read-content h2, .read-content h3,
.read-content h4, .read-content h5, .read-content h6 {
    margin: 1.6em 0 0.7em; font-weight: 700; letter-spacing: -0.01em;
    font-family: var(--font-sans);
}
.read-content h1 { font-size: 1.6em; padding-bottom: 0.35em; border-bottom: 1px solid var(--border); }
.read-content h2 {
    font-size: 1.35em; padding-left: 12px;
    border-left: 3px solid var(--primary);
}
.read-content h3 { font-size: 1.18em; }
.read-content p { margin: 0.9em 0; }
.read-content ul, .read-content ol { padding-left: 1.8em; margin: 0.9em 0; }
.read-content li { margin: 0.3em 0; display: list-item; }
.read-content ul li { list-style: disc; }
.read-content ol li { list-style: decimal; }
.read-content blockquote {
    margin: 1em 0; padding: 12px 18px;
    border-left: 3px solid var(--primary);
    background: var(--primary-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}
.read-content blockquote p { margin: 0.3em 0; }
.read-content pre {
    margin: 1em 0; padding: 18px;
    background: var(--code-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow-x: auto;
    font-size: 0.85em; line-height: 1.7;
}
.read-content pre code {
    background: none; padding: 0; border: none;
    font-size: inherit; color: var(--text);
}
.read-content code {
    font-family: var(--font-mono); font-size: 0.85em;
    background: var(--primary-bg); padding: 2px 7px; border-radius: var(--radius-xs);
    color: var(--primary);
}
.read-content img {
    max-width: 100%; height: auto; border-radius: var(--radius-sm);
    margin: 0.8em 0; box-shadow: var(--shadow-sm);
}
.read-content table {
    border-collapse: collapse; width: 100%; margin: 1em 0;
    font-family: var(--font-sans); font-size: 0.9em;
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.read-content th, .read-content td {
    border: 1px solid var(--border); padding: 9px 14px; text-align: left;
}
.read-content th { background: var(--bg-secondary); font-weight: 700; }
.read-content tr:hover td { background: var(--card-bg-hover); }
.read-content hr { margin: 2em 0; border: none; border-top: 1px solid var(--border); }
.read-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.read-content strong { font-weight: 700; }

.read-error { text-align: center; padding: 90px 20px; color: var(--text-muted); }

/* Broken image placeholder */
.broken-img {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 28px 16px; margin: 12px 0;
    background: var(--bg-secondary); border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm); color: var(--text-muted);
    font-size: 12px; font-family: var(--font-sans);
}
.broken-img i { font-size: 26px; opacity: 0.3; }

/* Comments */
.comments-section { margin-top: 48px; border-top: 1px solid var(--border); padding-top: 28px; }
.comments-section h3 { font-size: 17px; margin: 0 0 18px; font-weight: 700; }
.comments-section h3 i { color: var(--primary); margin-right: 4px; }
.comment-item {
    padding: 14px 0; border-bottom: 1px solid var(--border);
    animation: cardIn 0.3s var(--ease-out) backwards;
}
.comment-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.comment-meta strong { color: var(--text-secondary); }
.comment-content { font-size: 14px; line-height: 1.7; }
.comment-input-wrap { display: flex; gap: 10px; margin-bottom: 22px; }
.comment-input-wrap textarea {
    flex: 1; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--card-bg); color: var(--text);
    font-family: inherit; font-size: 13px; resize: vertical; min-height: 42px; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.comment-input-wrap textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* ============================================================
   Edit Page
   ============================================================ */
.edit-layout { max-width: 1000px; margin: 0 auto; padding: 20px; }
.edit-topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px; flex-wrap: wrap; gap: 8px;
}
.edit-topbar a, .edit-topbar button {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border: 1px solid var(--border);
    border-radius: 999px; background: var(--card-bg);
    color: var(--text-secondary); cursor: pointer; font-size: 13px;
    text-decoration: none; font-family: inherit;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.edit-topbar a:hover, .edit-topbar button:hover {
    border-color: var(--primary); color: var(--primary); background: var(--primary-bg);
}
.edit-meta { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.edit-meta input, .edit-meta select {
    padding: 9px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--card-bg); color: var(--text);
    font-size: 13px; font-family: inherit; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.edit-meta input:focus, .edit-meta select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.edit-meta input#titleInput {
    flex: 1; min-width: 200px; font-size: 17px; font-weight: 700;
    letter-spacing: -0.01em;
}

/* ============================================================
   Vditor — container-level integration
   ============================================================ */
#vditor { min-height: 500px; }
.vditor {
    border-radius: var(--radius-sm); overflow: clip;
    border: 1px solid var(--border);
}
.vditor-reset { line-height: 1.7; font-size: 15px; }
.vditor-reset ul, .vditor-reset ol { padding-left: 2em; }
.vditor-reset li { display: list-item; }

/* ============================================================
   404 Page
   ============================================================ */
.error-page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 40px 20px; gap: 8px;
}
.error-code {
    font-size: clamp(90px, 18vw, 160px); font-weight: 800;
    letter-spacing: -0.05em; line-height: 1;
    background: linear-gradient(135deg, var(--primary) 0%, #ffb25e 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.error-message { font-size: 18px; color: var(--text-secondary); margin: 4px 0 24px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: 280px; box-shadow: var(--shadow); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: inline-flex; }
    .notes-grid { grid-template-columns: 1fr; }
    .search-bar { width: 160px; }
    .search-bar:focus-within { width: 200px; }
    .hero { padding: 56px 20px 44px; }
    .hero-stats { gap: 28px; }
    .feature-cards { padding: 16px 20px 56px; }
    .landing-nav { padding: 12px 20px; }
    .topbar { margin: -20px -20px 18px; padding: 10px 20px; }
}
@media (max-width: 480px) {
    .main-content { padding: 14px 14px 32px; }
    .topbar { margin: -14px -14px 14px; padding: 8px 14px; gap: 6px; flex-wrap: wrap; row-gap: 8px; }
    .topbar-left { flex-wrap: wrap; gap: 5px; }
    .topbar-left .btn { padding: 5px 10px; font-size: 12px; }
    .search-bar { width: 100px; padding: 5px 10px; }
    .notes-grid { gap: 12px; }
    .note-card { padding: 16px; }
    .user-name { display: none; }
    .user-btn { padding: 4px; }
    .user-btn .fa-chevron-down { display: none; }
    .landing-nav { padding: 10px 16px; }
    .memo-panel { width: 100vw; max-width: 100vw; }
    .hero-stats { gap: 20px; }
    .hero-stat-num { font-size: 24px; }
    .hero-actions .btn-lg { padding: 9px 18px; font-size: 14px; }
    .public-notes-section { padding: 40px 16px; }
    .section-header h2 { font-size: 22px; }
    .read-layout { padding: 20px 14px 48px; }
    .read-content { font-size: 15px; }
    .nav-container { padding: 10px 16px; }
    .nav-logo { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   Vocab Page — 记单词独立页面
   ============================================================ */
.vocab-page-body {
    min-height: 100vh;
    background:
        radial-gradient(1100px 520px at 88% -8%, rgba(255, 122, 26, 0.10), transparent 60%),
        radial-gradient(800px 460px at -6% 108%, rgba(79, 172, 254, 0.07), transparent 60%),
        var(--bg);
}

.vocab-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px 56px;
    display: flex; flex-direction: column; gap: 18px;
}

/* 顶栏 */
.vocab-topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    padding: 18px 0 14px;
    background: linear-gradient(var(--bg) 70%, transparent);
}
.vocab-back {
    flex: none; width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; color: var(--text-secondary);
    background: var(--card-bg); border: 1px solid var(--border);
    transition: all .16s var(--ease-out);
}
.vocab-back:hover { color: var(--text); border-color: var(--border-strong); transform: translateX(-2px); }
.vocab-title { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 19px; font-weight: 800; margin: 0; letter-spacing: .01em; }
.vocab-title i { font-size: 20px; color: var(--primary); }
.vocab-topbar-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.hint-key {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    font-size: 11px; font-weight: 700; color: var(--text-secondary);
    background: var(--card-bg); border: 1px solid var(--border);
    border-bottom-width: 2px; border-radius: 6px;
}

/* 词库 chips */
.vocab-books { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vocab-book {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 999px; cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    background: var(--card-bg); border: 1px solid var(--border);
    transition: all .16s var(--ease-out);
}
.vocab-book em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.vocab-book:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.vocab-book.on { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); box-shadow: 0 4px 16px rgba(255, 122, 26, 0.15); }
.vocab-book.on em { color: var(--primary); }

/* 舞台 */
.vocab-stage { display: flex; flex-direction: column; gap: 18px; }

/* 顶部细进度 */
.vocab-progress { display: flex; flex-direction: column; gap: 8px; }
.vocab-progress-text {
    text-align: center; font-size: 12px; font-weight: 700;
    color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: .05em;
}
.vocab-progress-bar { height: 4px; border-radius: 999px; background: var(--bg-secondary); overflow: hidden; }
.vocab-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #ffb25e); transition: width .35s var(--ease-out); }

/* 3D 卡片 */
.vocab-card-scene { perspective: 1600px; }
.vocab-card-inner {
    position: relative; width: 100%; height: 360px;
    transform-style: preserve-3d;
    transition: transform .6s var(--ease-out);
    cursor: pointer;
}
.vocab-card-inner.flipped { transform: rotateY(180deg); }
.vocab-face {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 34px 32px; text-align: center;
    background: linear-gradient(180deg, var(--card-bg-hover), var(--card-bg));
    border: 1px solid var(--border); border-radius: 20px;
    box-shadow: var(--shadow);
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    overflow: hidden;
    animation: cardIn .38s var(--ease-out) backwards;
}
.vocab-face::before {
    content: ''; position: absolute; top: -40%; left: 50%; transform: translateX(-50%);
    width: 260px; height: 260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 122, 26, 0.16), transparent 70%);
    pointer-events: none;
}
.vocab-face.vocab-back { transform: rotateY(180deg); border-color: var(--primary-soft); }

/* 正面 */
.vocab-face-tag {
    font-size: 11px; font-weight: 600; color: var(--primary);
    background: var(--primary-bg); padding: 4px 14px; border-radius: 999px;
    margin-bottom: 28px; letter-spacing: .04em;
}
.vocab-word {
    font-size: clamp(40px, 9vw, 60px); font-weight: 800;
    letter-spacing: .005em; line-height: 1.1; color: var(--text);
    word-break: break-word;
}
.vocab-phonetic { font-size: 16px; color: var(--text-secondary); margin-top: 18px; letter-spacing: .03em; }
.vocab-flip-hint {
    position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
    font-size: 12px; color: var(--text-muted);
    display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.vocab-flip-hint i { font-size: 11px; }

/* 背面 */
.vocab-back-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 24px;
}
.vocab-back-head .vocab-face-tag { margin-bottom: 0; }
.vocab-back-word { font-size: 22px; font-weight: 800; color: var(--text); }
.vocab-translation {
    width: 100%; text-align: left;
    font-size: 16px; color: var(--text); line-height: 1.7;
    max-height: 160px; overflow-y: auto;
}
.vocab-pos-item { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.vocab-pos-item:last-child { margin-bottom: 0; }
.vocab-pos {
    flex: none; display: inline-block; padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 800; line-height: 1.5; letter-spacing: .03em;
}
.vocab-pos-text { color: var(--text); word-break: break-word; }
.vocab-pos.noun   { color: #3b82f6; background: rgba(59, 130, 246, 0.14); }
.vocab-pos.verb   { color: #10b981; background: rgba(16, 185, 129, 0.14); }
.vocab-pos.adj    { color: #f97316; background: rgba(249, 115, 22, 0.14); }
.vocab-pos.adv    { color: #a855f7; background: rgba(168, 85, 247, 0.14); }
.vocab-pos.interj { color: #ec4899; background: rgba(236, 72, 153, 0.14); }
.vocab-pos.func   { color: var(--text-secondary); background: var(--bg-secondary); }
.vocab-definition {
    margin-top: 18px; padding: 14px 16px; width: 100%; text-align: left;
    background: var(--code-bg); border-left: 3px solid var(--primary-soft);
    border-radius: 10px;
    font-size: 13px; color: var(--text-secondary); font-style: italic; line-height: 1.7;
    max-height: 90px; overflow-y: auto;
}

/* 空状态 */
.vocab-empty {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 64px 20px; text-align: center;
    background: var(--card-bg); border: 1px dashed var(--border-strong);
    border-radius: 20px; color: var(--text-secondary);
}
.vocab-empty i { font-size: 42px; color: var(--text-muted); }
.vocab-empty p { margin: 0; font-size: 14px; }

/* 评分按钮 */
.vocab-actions { display: flex; gap: 12px; }
.vocab-btn {
    flex: 1; position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    min-height: 68px; padding: 16px 8px 14px; border: none; border-radius: 18px;
    font-size: 14px; font-weight: 700; color: #fff; cursor: pointer;
    transition: transform .18s var(--ease-out), filter .18s, box-shadow .18s;
}
.vocab-btn::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
    pointer-events: none;
}
.vocab-btn i { font-size: 21px; }
.vocab-btn span { letter-spacing: .02em; }
.vocab-btn em {
    position: absolute; top: 10px; right: 12px;
    width: 20px; height: 20px; line-height: 20px; border-radius: 50%;
    font-size: 11px; font-weight: 800; font-style: normal; text-align: center;
    background: rgba(255, 255, 255, 0.22); color: inherit;
}
.vocab-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.vocab-btn:active { transform: translateY(0) scale(.97); }
.vocab-again { background: var(--danger); box-shadow: 0 12px 30px rgba(240, 82, 82, 0.30); }
.vocab-hard { background: var(--warning); color: #1a1200; box-shadow: 0 12px 30px rgba(245, 184, 61, 0.26); }
.vocab-hard em { background: rgba(0, 0, 0, 0.14); }
.vocab-good { background: var(--success); box-shadow: 0 12px 30px rgba(52, 211, 153, 0.28); }

/* 统计 */
.vocab-stats { margin-top: 6px; }
.vocab-stat-tiles {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.vocab-stat-tile {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 14px 6px; border-radius: 14px;
    background: var(--card-bg); border: 1px solid var(--border);
}
.vocab-stat-tile .num { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.vocab-stat-tile .lbl { font-size: 11px; color: var(--text-muted); }
.vocab-stat-tile.highlight { border-color: var(--primary-soft); background: var(--primary-bg); }
.vocab-stat-tile.highlight .num { color: var(--primary); }
.vocab-bar { height: 5px; border-radius: 999px; background: var(--bg-secondary); overflow: hidden; margin-top: 12px; }
.vocab-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #ffb25e); transition: width .45s var(--ease-out); }

/* 模式切换 */
.vocab-tabs {
    display: flex; gap: 4px; padding: 4px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.vocab-tab {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 14px; border: none; border-radius: 999px;
    font-size: 13px; font-weight: 700; color: var(--text-muted);
    background: transparent; cursor: pointer; transition: all .18s var(--ease-out);
}
.vocab-tab i { font-size: 13px; opacity: .9; }
.vocab-tab:hover { color: var(--text); }
.vocab-tab.on { background: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 16px rgba(255, 122, 26, 0.30); }

/* 词库行 + 导入按钮 */
.vocab-books-row { display: flex; align-items: center; gap: 10px; }
.vocab-books-row .vocab-books { flex: 1; justify-content: center; }
.vocab-import-btn {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border: none; border-radius: 999px; cursor: pointer;
    font-size: 13px; font-weight: 700; color: var(--primary-ink);
    background: var(--primary);
    box-shadow: 0 6px 18px rgba(255, 122, 26, 0.28);
    transition: all .15s var(--ease-out);
}
.vocab-import-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

/* 拼写输入 */
.vocab-spell { display: flex; gap: 10px; }
.vocab-spell-input {
    flex: 1; padding: 14px 18px; border-radius: 14px;
    font-size: 18px; font-weight: 600; letter-spacing: .02em; color: var(--text);
    background: var(--card-bg); border: 1px solid var(--border);
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.vocab-spell-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.vocab-spell-submit {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 0 22px; border: none; border-radius: 14px; cursor: pointer;
    font-size: 14px; font-weight: 700; color: var(--primary-ink);
    background: var(--primary); transition: filter .15s, transform .15s;
}
.vocab-spell-submit:hover { filter: brightness(1.08); }

/* 拼写模式正面：显示中文释义 */
.vocab-card-inner.mode-spell .vocab-word {
    font-size: 24px; font-weight: 700; line-height: 1.6;
    max-height: 200px; overflow-y: auto;
}
.vocab-back-word.correct { color: var(--success); }
.vocab-back-word.wrong { color: var(--danger); }

/* 下一张按钮 */
.vocab-btn.vocab-next {
    background: var(--primary); color: var(--primary-ink);
    box-shadow: 0 10px 26px rgba(255, 122, 26, 0.28);
}
/* 再来一遍（拼错后重写当前词） */
.vocab-btn.vocab-retry {
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border); box-shadow: none;
}

/* 导入弹窗 */
.vocab-modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px);
    padding: 20px;
}
.vocab-modal {
    width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 20px; box-shadow: var(--shadow);
    animation: cardIn .3s var(--ease-out) backwards;
}
.vocab-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.vocab-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.vocab-modal-head h3 i { color: var(--primary); }
.vocab-modal-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.vocab-modal-tip { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.vocab-modal-tip code { background: var(--code-bg); padding: 2px 6px; border-radius: 5px; font-size: 11px; color: var(--text-secondary); }
.vocab-import-text {
    width: 100%; resize: vertical; padding: 12px 14px;
    font-size: 14px; line-height: 1.7; color: var(--text);
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 12px; outline: none; font-family: inherit;
}
.vocab-import-text:focus { border-color: var(--primary); }
.vocab-import-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.vocab-import-count {
    width: 90px; padding: 8px 12px; border-radius: 10px;
    font-size: 14px; color: var(--text);
    background: var(--bg-secondary); border: 1px solid var(--border); outline: none;
}
.vocab-import-count:focus { border-color: var(--primary); }
.vocab-import-hint { font-size: 12px; color: var(--text-muted); }
.vocab-import-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* 自选词库查看弹窗 */
.vocab-book-eye { font-size: 11px; opacity: .85; margin-left: 2px; color: var(--primary); }
.vocab-book-eye:hover { opacity: 1; }
.vocab-custom-modal { max-width: 520px; }
.vocab-custom-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; padding: 2px; }
.vocab-custom-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 12px;
    transition: border-color .2s;
}
.vocab-custom-item:hover { border-color: var(--border-strong); }
.vocab-custom-main { flex: 1; min-width: 0; }
.vocab-custom-word { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.vocab-custom-ph { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.vocab-custom-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.vocab-custom-badge.mastered { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.vocab-custom-trans { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }
.vocab-custom-del {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--card-bg); color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .18s;
}
.vocab-custom-del:hover { color: var(--danger); border-color: var(--danger); background: rgba(240, 82, 82, 0.08); }

/* ===== AI 学习助手 ===== */
.vocab-ai { display: flex; flex-direction: column; gap: 18px; }
.vocab-ai-progress { display: flex; flex-wrap: wrap; gap: 10px; }
.vocab-ai-progress .chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    background: var(--card-bg); border: 1px solid var(--border);
    font-size: 12px; color: var(--text-secondary);
}
.vocab-ai-progress .chip b { color: var(--text); font-size: 13px; }
.vocab-ai-progress .chip i { color: var(--primary); }
.vocab-ai-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
    display: flex; flex-direction: column; gap: 14px;
}
.vocab-ai-head { display: flex; align-items: center; justify-content: space-between; }
.vocab-ai-head h3 { margin: 0; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.vocab-ai-head h3 i { color: var(--primary); }
.vocab-ai-words { display: flex; flex-wrap: wrap; gap: 8px; }
.vocab-ai-word-chip {
    padding: 7px 13px; border-radius: 999px;
    background: var(--primary-bg); color: var(--primary);
    border: 1px solid var(--primary-soft); font-size: 13px; font-weight: 600;
    animation: cardIn .3s var(--ease-out) backwards;
}
.vocab-ai-word-chip .ph { color: var(--text-muted); font-weight: 400; margin-left: 5px; font-size: 11px; }
.vocab-ai-result { display: flex; flex-direction: column; gap: 12px; }
.vocab-ai-passage {
    font-size: 15px; line-height: 1.9; color: var(--text);
    padding: 14px 16px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 12px;
    white-space: pre-wrap; word-break: break-word;
}
.vocab-ai-translation {
    font-size: 13px; line-height: 1.8; color: var(--text-secondary);
    padding: 12px 16px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 12px;
    white-space: pre-wrap; word-break: break-word;
}
.vocab-ai-passage b, .vocab-ai-translation b { color: var(--text-muted); font-weight: 700; display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: .03em; }
.vocab-ai-loading {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-muted); font-size: 13px; padding: 8px 0;
}
.vocab-ai-loading i { color: var(--primary); }
.vocab-ai-error { color: var(--danger); font-size: 13px; padding: 8px 0; }
.vocab-ai-muted { color: var(--text-muted); font-size: 13px; line-height: 1.7; }

.vocab-ai-mastered-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 320px; overflow-y: auto; }
.vocab-ai-mastered-chip {
    padding: 7px 13px; border-radius: 999px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    font-size: 13px; color: var(--text-secondary); cursor: pointer;
    transition: all .2s;
}
.vocab-ai-mastered-chip:hover { border-color: var(--primary); color: var(--text); }
.vocab-ai-mastered-chip.on { background: var(--primary-bg); border-color: var(--primary-soft); color: var(--primary); font-weight: 600; }
.vocab-ai-mastered-chip .ph { color: var(--text-muted); font-size: 11px; margin-left: 4px; }

.vocab-ai-exercise { display: flex; flex-direction: column; gap: 12px; }
.vocab-ai-ex-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vocab-ai-dir-tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 999px;
    background: var(--primary-bg); color: var(--primary);
    font-size: 12px; font-weight: 700;
}
.vocab-ai-target { font-size: 15px; color: var(--text-muted); }
.vocab-ai-target b { color: var(--text); }
.vocab-ai-question {
    font-size: 16px; line-height: 1.9; color: var(--text);
    padding: 14px 16px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 12px;
    white-space: pre-wrap; word-break: break-word;
}
.vocab-ai-input {
    width: 100%; resize: vertical; min-height: 90px; padding: 12px 14px;
    font-size: 14px; line-height: 1.7; color: var(--text);
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 12px; outline: none; font-family: inherit;
}
.vocab-ai-input:focus { border-color: var(--primary); }
.vocab-ai-ex-actions { display: flex; gap: 10px; }
.vocab-ai-feedback { display: flex; flex-direction: column; gap: 10px; }
.vocab-ai-feedback-item {
    padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.8;
    white-space: pre-wrap; word-break: break-word;
}
.vocab-ai-feedback-item.correct { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3); color: var(--text); }
.vocab-ai-feedback-item.wrong { background: rgba(240, 82, 82, 0.1); border: 1px solid rgba(240, 82, 82, 0.3); color: var(--text); }
.vocab-ai-feedback-item b { display: block; margin-bottom: 4px; font-size: 12px; }
.vocab-ai-feedback-item.correct b { color: var(--success); }
.vocab-ai-feedback-item.wrong b { color: var(--danger); }
.vocab-ai-reference { font-size: 13px; color: var(--text-secondary); line-height: 1.8; white-space: pre-wrap; word-break: break-word; }

/* 串词成文 · 详细解析 */
.vocab-ai-analysis {
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px 16px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 12px;
}
.vocab-ai-analysis > b { color: var(--text-muted); font-weight: 700; font-size: 11px; letter-spacing: .03em; }
.vocab-ai-analysis-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 10px 12px; border-radius: 10px;
    background: var(--card-bg); border: 1px solid var(--border);
}
.vocab-ai-analysis-point {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: var(--text);
}
.vocab-ai-analysis-point .idx {
    flex-shrink: 0; width: 18px; height: 18px; line-height: 18px;
    border-radius: 6px; text-align: center;
    font-size: 11px; font-weight: 800; color: var(--primary-ink);
    background: var(--primary);
}
.vocab-ai-analysis-note { font-size: 13px; line-height: 1.75; color: var(--text-secondary); }

/* 手机端 */
@media (max-width: 640px) {
    .vocab-page { padding: 0 16px 32px; gap: 14px; }
    .vocab-topbar { padding: 14px 0 12px; gap: 10px; }
    .vocab-title { font-size: 17px; }
    .vocab-back { width: 36px; height: 36px; border-radius: 10px; }

    .vocab-card-inner { height: clamp(320px, 62vh, 420px); }
    .vocab-face { padding: 24px 20px; }
    .vocab-word { font-size: clamp(32px, 12vw, 44px); }
    .vocab-phonetic { font-size: 15px; margin-top: 14px; }
    .vocab-flip-hint { bottom: 20px; font-size: 11px; }

    .vocab-back-head { margin-bottom: 16px; }
    .vocab-back-word { font-size: 20px; }
    .vocab-translation { font-size: 15px; max-height: 32vh; }
    .vocab-pos-text { line-height: 1.6; }
    .vocab-definition { font-size: 12px; max-height: 14vh; padding: 12px 14px; }

    /* 评分按钮固定到底部，拇指够得着 */
    .vocab-actions {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        gap: 10px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--bg);
        border-top: 1px solid var(--border);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
    }
    .vocab-btn {
        flex-direction: row; align-items: center; gap: 8px;
        min-height: 56px; padding: 12px 10px; border-radius: 16px;
    }
    .vocab-btn i { font-size: 18px; }
    .vocab-btn em { display: none; }

    .vocab-card-inner.mode-spell .vocab-word { font-size: 19px; }
    .vocab-spell { gap: 8px; }
    .vocab-spell-input { font-size: 16px; padding: 12px 14px; }
    .vocab-spell-submit { padding: 0 18px; font-size: 14px; }

    .vocab-import-btn { padding: 8px 12px; font-size: 12px; }

    .vocab-stat-tile { padding: 12px 4px; }
    .vocab-stat-tile .num { font-size: 18px; }

    .vocab-modal-overlay { padding: 12px; }
    .vocab-modal { border-radius: 16px; }
    .vocab-modal-body { padding: 16px; }

    .vocab-ai-card { padding: 14px; }
    .vocab-ai-question { font-size: 15px; padding: 12px 14px; }
    .vocab-ai-ex-actions { flex-wrap: wrap; }
    .vocab-ai-ex-actions .btn { flex: 1; min-width: 90px; }
}

/* 超窄屏 */
@media (max-width: 380px) {
    .vocab-stat-tiles { grid-template-columns: repeat(2, 1fr); }
    .vocab-import-btn span { display: none; }
    .vocab-import-btn { padding: 8px 10px; }
}

/* ============================================================
   返回顶部按钮（全站）
   ============================================================ */
#backToTop {
    position: fixed; right: 24px; bottom: 24px; z-index: 80;
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-strong);
    background: var(--glass);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s var(--ease-out),
                visibility 0.25s, border-color 0.2s, color 0.2s;
}
#backToTop svg { display: block; }
#backToTop.show { opacity: 1; visibility: visible; transform: none; }
#backToTop:hover { border-color: var(--primary); color: var(--primary); }
#backToTop:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 640px) {
    #backToTop { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}

/* ============================================================
   跨页面转场（MPA View Transitions，Chromium 126+）
   旧页淡出 · 新页淡入；不支持的浏览器用 body 淡入兜底
   ============================================================ */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtFadeOut 0.26s cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vtFadeIn 0.38s var(--ease-out) both; }
@keyframes vtFadeOut {
    to { opacity: 0; transform: translateY(-10px) scale(0.992); filter: blur(2px); }
}
@keyframes vtFadeIn {
    from { opacity: 0; transform: translateY(14px) scale(0.996); filter: blur(2px); }
}

@supports not (view-transition-name: none) {
    body { animation: pageFadeIn 0.38s var(--ease-out); }
    @keyframes pageFadeIn { from { opacity: 0; } }
}

/* ============================================================
   全站视觉升级（借鉴美化建议，增量覆盖，不改 HTML 结构）
   环境光背景 + 玻璃拟态卡片；编辑页（.editor-shell）不参与
   ============================================================ */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(900px 480px at 82% -10%, rgba(255, 122, 26, 0.16), transparent 62%),
        radial-gradient(760px 440px at 104% 40%, rgba(56, 189, 248, 0.10), transparent 60%),
        radial-gradient(680px 500px at 12% 108%, rgba(139, 92, 246, 0.10), transparent 62%),
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: auto, auto, auto, 40px 40px, 40px 40px;
    background-position: center, center, center, -1px -1px, -1px -1px;
}
[data-theme="light"] body::before {
    background-image:
        radial-gradient(900px 480px at 82% -10%, rgba(234, 88, 12, 0.12), transparent 62%),
        radial-gradient(760px 440px at 104% 40%, rgba(59, 130, 246, 0.10), transparent 60%),
        radial-gradient(680px 500px at 12% 108%, rgba(99, 102, 241, 0.08), transparent 62%),
        linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
}
/* 编辑页只放开页面背景（环境光 + 网格）；编辑器内部变量仍由下方隔离块保持原样 */
body:has(.editor-shell)::before {
    background-image:
        radial-gradient(900px 480px at 82% -10%, rgba(255, 122, 26, 0.14), transparent 62%),
        radial-gradient(760px 440px at 104% 40%, rgba(56, 189, 248, 0.08), transparent 60%),
        radial-gradient(680px 500px at 12% 108%, rgba(139, 92, 246, 0.09), transparent 62%),
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: auto, auto, auto, 40px 40px, 40px 40px;
    background-position: center, center, center, -1px -1px, -1px -1px;
}
[data-theme="light"] body:has(.editor-shell)::before {
    background-image:
        radial-gradient(900px 480px at 82% -10%, rgba(234, 88, 12, 0.10), transparent 62%),
        radial-gradient(760px 440px at 104% 40%, rgba(59, 130, 246, 0.08), transparent 60%),
        radial-gradient(680px 500px at 12% 108%, rgba(99, 102, 241, 0.06), transparent 62%),
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
}


/* 卡片：玻璃拟态 + 顶部内高光 + 悬浮辉光 */
body .note-card,
body .public-note-card,
body .feature-card,
body .file-card,
body .video-card,
body .stat-card,
body .panel-card {
    background: var(--card-glass);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    backdrop-filter: blur(8px) saturate(130%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 var(--inset-highlight), var(--shadow-sm);
    transition: transform 0.25s var(--ease-out), border-color 0.25s,
                box-shadow 0.25s, background 0.25s;
}
body .note-card:hover,
body .public-note-card:hover,
body .feature-card:hover,
body .file-card:hover,
body .video-card:hover,
body .stat-card:hover,
body .panel-card:hover {
    background: var(--card-glass-hover);
    border-color: var(--primary-soft);
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 var(--inset-highlight), var(--shadow), var(--glow);
}

/* 文章标题：渐变字（悬停时缓慢流动） */
body .note-title,
body .pn-title,
body .read-title {
    background-image: linear-gradient(92deg, var(--title-grad-a) 0%, var(--title-grad-b) 56%, var(--title-grad-c) 100%);
    background-size: 180% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: background-position 0.45s var(--ease-out);
}
body .note-card:hover .note-title,
body .public-note-card:hover .pn-title { background-position: 100% 50%; }
body .note-title .draft-badge { -webkit-text-fill-color: var(--warning); color: var(--warning); }
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    body .note-title,
    body .pn-title,
    body .read-title { background: none; color: var(--text); -webkit-text-fill-color: currentColor; }
}

/* 侧边栏「我的」分组：可收起 */
.sidebar-nav .nav-group {
    margin-top: 4px; padding-top: 4px;
    border-top: 1px solid var(--border);
}
.nav-group-header {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 12px; border: 0; background: none;
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-muted); font-family: inherit; font-size: 11px;
    font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
}
.nav-group-header:hover { background: var(--primary-bg); color: var(--text-secondary); }
.nav-group-header i { width: 16px; text-align: center; font-size: 12px; }
.nav-group-header .nav-group-caret {
    margin-left: auto; width: auto; font-size: 10px;
    transition: transform 0.25s var(--ease-out);
}
.nav-group.collapsed .nav-group-caret { transform: rotate(-90deg); }
.nav-group-body {
    display: flex; flex-direction: column; gap: 3px;
    max-height: 420px; opacity: 1; overflow: hidden; margin-top: 2px;
    transition: max-height 0.3s var(--ease-out), opacity 0.22s ease, margin 0.3s;
}
.nav-group.collapsed .nav-group-body { max-height: 0; opacity: 0; margin-top: 0; }

/* 笔记页侧边栏：磨砂玻璃 */
.sidebar {
    background: var(--glass-secondary);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
}

/* 编辑页：写作区保留原来的纯色底，环境光与粒子只出现在四周留白 */
body:has(.editor-shell) .editor-layout {
    background: var(--bg);
    border-radius: var(--radius);
}

/* 编辑页：沿用升级前的原始主题变量与圆角，保持编辑器观感完全不变 */
[data-theme="dark"] body:has(.editor-shell) {
    --radius: 14px; --radius-md: 11px; --radius-sm: 9px; --radius-xs: 6px;
    --bg: #0b0b0d; --bg-secondary: #101013;
    --card-bg: #141417; --card-bg-hover: #1b1b20;
    --border: rgba(255, 255, 255, 0.08); --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f4f4f5; --text-secondary: #a7a7b0; --text-muted: #6e6e78;
    --primary-soft: rgba(255, 122, 26, 0.28);
    --success: #34d399; --warning: #f5b83d;
    --glass: rgba(13, 13, 16, 0.72); --glass-secondary: rgba(16, 16, 19, 0.82);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.5); --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
    --glow: 0 0 0 1px var(--primary-soft), 0 8px 30px rgba(255, 122, 26, 0.12);
    --code-bg: #17171b;
}
[data-theme="light"] body:has(.editor-shell) {
    --radius: 14px; --radius-md: 11px; --radius-sm: 9px; --radius-xs: 6px;
    --bg: #f7f5f1; --bg-secondary: #f0ede6;
    --card-bg: #ffffff; --card-bg-hover: #faf8f3;
    --border: rgba(28, 25, 23, 0.1); --border-strong: rgba(28, 25, 23, 0.2);
    --text: #1c1917; --text-secondary: #57534e; --text-muted: #a8a29e;
    --primary-soft: rgba(234, 88, 12, 0.3);
    --success: #059669; --warning: #b45309;
    --glass: rgba(247, 245, 241, 0.78); --glass-secondary: rgba(240, 237, 230, 0.85);
    --shadow: 0 12px 32px rgba(28, 25, 23, 0.1); --shadow-sm: 0 2px 10px rgba(28, 25, 23, 0.06);
    --glow: 0 0 0 1px var(--primary-soft), 0 8px 24px rgba(234, 88, 12, 0.1);
    --code-bg: #f0ede6;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none !important; }
    body { animation: none !important; }
    #backToTop { transition: none; }
}
