/* ============================================================
   词汇检测 - 现代深色主题 UI
   兼容 /api/theme.css 动态变量，在此基础上增强视觉层次
   ============================================================ */

/* ── 设计系统增强变量 ── */
:root {
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Fira Code', monospace;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
    --shadow: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px rgba(97,175,239,0.15);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

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

/* 防止 Vue 未挂载时显示原始模板 */
[v-cloak] { display: none !important; }

html, body {
    overflow-x: hidden;
    position: relative;
    touch-action: pan-y;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

/* ── 顶部导航栏（玻璃拟态） ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    max-width: 640px;
    margin: 0 auto;
    background: rgba(var(--bg-secondary-rgb, 30, 34, 45), 0.75);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--accent) 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 10px;
    background: rgba(97,175,239,0.1);
    border-radius: 20px;
    border: 1px solid rgba(97,175,239,0.15);
}

/* ── 容器 ── */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 16px 48px;
}

/* ── 卡片（现代层级） ── */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
.card:hover {
    border-color: rgba(255,255,255,0.08);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}
.card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

/* ── 按钮（现代光晕） ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
    min-width: 44px;
    white-space: nowrap;
    letter-spacing: -0.2px;
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: scale(0.96) translateY(1px); }
.btn:disabled { opacity: 0.4; pointer-events: none; filter: grayscale(0.5); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #4a90d9 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(97,175,239,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 20px rgba(97,175,239,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.96) translateY(1px); }

.btn-quick-start {
    background: linear-gradient(135deg, var(--orange) 0%, #e8913a 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(209,154,102,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-quick-start:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 20px rgba(209,154,102,0.45);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--green) 0%, #7bc47b 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(152,195,121,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-success:hover { filter: brightness(1.15); transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, var(--red) 0%, #e85d6a 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(224,108,117,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-danger:hover { filter: brightness(1.15); transform: translateY(-1px); }

.btn-warning {
    background: linear-gradient(135deg, var(--orange) 0%, #e8913a 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(209,154,102,0.35);
}
.btn-warning:hover { filter: brightness(1.15); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border-color: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    box-shadow: none;
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.18);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 36px; border-radius: var(--radius-xs); }
.btn-lg {
    padding: 18px 32px;
    font-size: 18px;
    min-height: 60px;
    font-weight: 700;
    border-radius: var(--radius);
    letter-spacing: -0.3px;
}
.btn-block { width: 100%; }

/* ── 输入框（聚焦发光） ── */
.input, select.input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}
.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(97,175,239,0.15), inset 0 1px 2px rgba(0,0,0,0.2);
}
.input::placeholder { color: var(--text-muted); font-weight: 400; }
select.input {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239da5b4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── 词书搜索框 ── */
.book-search-box {
    position: relative;
    margin-bottom: 14px;
}
.book-search-box .input {
    margin-bottom: 0;
    border-radius: var(--radius);
    padding-left: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239da5b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
}
.book-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}
.book-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: var(--transition-fast);
}
.book-search-item:last-child { border-bottom: none; }
.book-search-item:hover { background: rgba(97,175,239,0.08); }
.book-search-item:active { background: rgba(97,175,239,0.12); }
.book-search-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.book-search-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.book-search-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* 弹窗内搜索框 */
.bp-search-box {
    padding: 0 18px 14px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bp-search-box .input {
    border-radius: var(--radius-sm);
}

/* ── 词书选择大框 ── */
.book-picker-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 20px;
    border: 2px dashed rgba(97,175,239,0.35);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(97,175,239,0.06) 0%, rgba(192,132,252,0.04) 100%);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.book-picker-box::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(97,175,239,0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.book-picker-box:hover {
    border-color: rgba(97,175,239,0.6);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.book-picker-box:hover::after { opacity: 1; }
.book-picker-box:active { transform: scale(0.98) translateY(0); }
.book-picker-icon { font-size: 36px; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.book-picker-text { flex: 1; min-width: 0; overflow-wrap: break-word; }
.book-picker-prompt {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.3px;
    overflow-wrap: break-word;
}
.book-picker-selected {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-display, var(--text-primary));
    letter-spacing: -0.3px;
    overflow-wrap: break-word;
}
.book-picker-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
    overflow-wrap: break-word;
}
.book-picker-path {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
    overflow-wrap: break-word;
}
.book-picker-arrow {
    font-size: 28px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.book-picker-box:hover .book-picker-arrow { transform: translateX(3px); color: var(--accent); }

/* ── 词书选择器全屏弹窗 ── */
.book-picker-overlay {
    z-index: 250;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
}
.book-picker-modal {
    width: 100%;
    max-width: 460px;
    max-height: 85vh;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.book-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.book-picker-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.bp-level {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}
.bp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.bp-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 14px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.bp-card:hover {
    border-color: rgba(97,175,239,0.3);
    background: linear-gradient(135deg, rgba(97,175,239,0.08) 0%, transparent 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.bp-card:active { transform: scale(0.96); }
.bp-card-icon { font-size: 40px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.bp-card-name { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.bp-back-btn {
    margin-bottom: 14px;
}
.bp-back-btn:hover { transform: translateX(-2px); }
.bp-book-list { display: flex; flex-direction: column; gap: 10px; }
.bp-book-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.bp-book-item:hover {
    border-color: rgba(97,175,239,0.25);
    background: linear-gradient(90deg, rgba(97,175,239,0.06) 0%, transparent 100%);
    transform: translateX(3px);
}
.bp-book-item:active { transform: scale(0.98); }
.bp-book-name { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.bp-book-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.bp-empty { padding: 28px; text-align: center; color: var(--text-muted); font-size: 15px; }

/* ── 词书分类编辑器 ── */
.category-editor-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; font-weight: 500; }
.cat1-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cat1-item { display: flex; align-items: center; gap: 10px; }
.cat1-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.cat1-icon { font-size: 22px; }
.cat-input { font-size: 14px !important; padding: 8px 12px !important; border-radius: var(--radius-xs) !important; }
.cat2-section { margin-bottom: 10px; }
.cat2-header {
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 0;
    color: var(--accent);
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cat2-header:hover { opacity: 0.8; }
.cat2-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px 18px; }
.cat2-item { display: flex; align-items: center; gap: 10px; }

/* ── 数据库网格 ── */
.db-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.db-card {
    padding: 14px;
    background: var(--bg-secondary);
    border: 2px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.db-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.db-card.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(97,175,239,0.12) 0%, rgba(97,175,239,0.04) 100%);
    box-shadow: 0 4px 16px rgba(97,175,239,0.2);
}
.db-card.active .db-name { color: var(--accent); }
.db-card.active .db-meta { color: #8fc8ff; }
.db-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--text-display, var(--text-primary)); letter-spacing: -0.2px; }
.db-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ── 筛选 ── */
.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}
.filter-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.page-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-range-sep {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
    font-weight: 700;
}
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.05);
}
.option-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* 方向选择按钮组 */
.btn-direction-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius-xs);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow-sm);
}
.btn-direction {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    user-select: none;
}
.btn-direction:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.08); }
.btn-direction.active {
    background: linear-gradient(135deg, var(--accent) 0%, #4a90d9 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-direction input { display: none; }

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}
.radio-label:hover, .checkbox-label:hover { color: var(--text-primary); }
.radio-label input, .checkbox-label input {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.word-count-bar {
    text-align: center;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(97,175,239,0.08) 0%, rgba(192,132,252,0.04) 100%);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(97,175,239,0.15);
}
.word-count-bar strong { font-size: 22px; font-weight: 800; }

/* 互斥分组方式 */
.group-mode-section {
    margin: 10px 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.05);
}
.group-mode-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-xs);
    transition: background 0.2s;
    border: 1px solid transparent;
}
.group-mode-row:hover { background: rgba(255,255,255,0.03); }
.group-mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    user-select: none;
    min-width: 90px;
}
.group-mode-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}
.group-mode-checked {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px var(--bg-card), 0 0 0 2px rgba(97,175,239,0.3);
}
.group-mode-active { font-weight: 700; color: var(--accent); }
.group-mode-params { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.group-num-input {
    width: 70px;
    text-align: center;
    padding: 6px 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 0 !important;
    border-radius: var(--radius-xs) !important;
}
.group-num-input::-webkit-inner-spin-button { opacity: 1; }

/* ── 新版分组方式按钮组 ── */
.group-mode-bar {
    display: flex;
    gap: 10px;
    margin: 10px 0 16px 0;
}
.btn-group-mode {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    min-height: 52px;
}
.btn-group-mode::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}
.btn-group-mode:hover {
    border-color: rgba(97,175,239,0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.btn-group-mode.active {
    background: linear-gradient(135deg, rgba(97,175,239,0.15) 0%, rgba(97,175,239,0.05) 100%);
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(97,175,239,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-group-mode.active .group-mode-label { color: var(--accent); font-weight: 800; }
.btn-group-mode.active .group-mode-icon { filter: drop-shadow(0 0 6px rgba(97,175,239,0.4)); }
.group-mode-icon { font-size: 22px; line-height: 1; transition: var(--transition-fast); flex-shrink: 0; }
.group-mode-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}
.group-mode-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); transition: var(--transition-fast); letter-spacing: -0.2px; }
.group-mode-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(97,175,239,0.15);
    color: var(--accent);
    border: 1px solid rgba(97,175,239,0.2);
}

/* 预设数量网格（两列四行） */
.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.preset-btn {
    padding: 14px 8px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    min-height: 52px;
    transition: var(--transition);
}
.preset-btn.btn-primary {
    box-shadow: 0 4px 14px rgba(97,175,239,0.35);
    transform: scale(1.02);
}
.preset-btn.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(97,175,239,0.2);
    transform: translateY(-1px);
}

.resume-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(229,192,123,0.1) 0%, rgba(229,192,123,0.04) 100%);
    border: 1px solid rgba(229,192,123,0.2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-top: 14px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(229,192,123,0.1);
}
.resume-bar div { display: flex; gap: 10px; }

/* ── 检测页面（沉浸式） ── */
.test-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
    padding-top: 8px;
}

/* 第一行：倒计时 + 进度条 + 进度文字 */
.test-header-row1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 0 4px;
}
.countdown-area {
    width: 44px;
    flex-shrink: 0;
    text-align: center;
}
.quick-countdown-inline {
    font-size: 24px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    display: inline-block;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}
.quick-countdown-inline.quick-countdown-urgent {
    color: var(--red);
    animation: pulse 0.5s ease-in-out infinite alternate;
    text-shadow: 0 0 12px rgba(224,108,117,0.4);
}

/* 第二行：按钮 + 图例居中 */
.test-header-row2 {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 0 4px;
}
.test-actions-center {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    min-width: 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #7eb8f7 100%);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    box-shadow: 0 0 8px rgba(97,175,239,0.4);
}
.progress-segments {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    z-index: 2;
}
.progress-seg {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-seg-known { background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%); }
.progress-seg-fuzzy { background: linear-gradient(90deg, var(--orange) 0%, #e8a87c 100%); }
.progress-seg-unknown { background: linear-gradient(90deg, #f44336 0%, #ef5350 100%); }
.progress-legend {
    display: flex;
    gap: 18px;
    font-size: 17px;
    font-weight: 800;
    flex-shrink: 0;
    padding: 0 8px;
}
.legend-dot { white-space: nowrap; }
.legend-known { color: #66bb6a; }
.legend-fuzzy { color: #e8a87c; }
.legend-unknown { color: #ef5350; }
.progress-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.word-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 24px 0;
}
.word-main {
    font-size: 80px;
    font-weight: 900;
    text-align: center;
    color: var(--text-display, var(--text-primary));
    white-space: nowrap;
    line-height: 1.2;
    letter-spacing: -1px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
    animation: wordEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 100%;
}
.clickable-word {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.clickable-word:hover {
    color: var(--accent);
    text-shadow: 0 0 30px rgba(97,175,239,0.3);
}
.clickable-word:active { transform: scale(0.97); }
.word-sub {
    font-size: 20px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.answer-reveal {
    font-size: 20px;
    color: var(--green);
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(76,175,80,0.12) 0%, rgba(76,175,80,0.04) 100%);
    border: 1px solid rgba(76,175,80,0.25);
    border-radius: var(--radius);
    width: 100%;
    max-width: 440px;
    line-height: 1.6;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(76,175,80,0.1);
}
.answer-original-label {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.2px;
}
.answer-text {
    color: var(--green);
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}
.answer-cn2en-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.answer-word-inline {
    font-size: 40px;
    font-weight: 900;
    color: var(--green);
    letter-spacing: -1px;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
}
.answer-word-inline:hover { color: var(--accent); }
.answer-pronunciation-inline {
    font-size: 18px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
}
.answer-cn2en {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.answer-word {
    font-size: 40px;
    font-weight: 900;
    color: var(--text-display, var(--text-primary));
    letter-spacing: -1px;
}
.answer-word:hover { color: var(--accent); }
.answer-pronunciation {
    font-size: 18px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: 500;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes wordEnter { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.4; } }

.btn-row-test {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 0 12px;
    max-width: 520px;
    flex-wrap: wrap;
}
.btn-test {
    flex: 1;
    padding: 20px 10px;
    font-size: 18px;
    font-weight: 800;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-align: center;
    min-height: 72px;
    color: #fff;
    letter-spacing: -0.2px;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.btn-test::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
    pointer-events: none;
}
.btn-test:active { transform: scale(0.96); }
.btn-test-known {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
    box-shadow: 0 4px 16px rgba(76,175,80,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-test-known:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(76,175,80,0.45); }
.btn-test-unknown-red {
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
    box-shadow: 0 4px 16px rgba(244,67,54,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-test-unknown-red:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(244,67,54,0.45); }
.btn-test-fuzzy-orange {
    background: linear-gradient(135deg, var(--orange) 0%, #d4936a 100%);
    box-shadow: 0 4px 16px rgba(209,154,102,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-test-fuzzy-orange:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(209,154,102,0.45); }
.btn-test-next {
    background: linear-gradient(135deg, #2196f3 0%, #1e88e5 100%);
    box-shadow: 0 4px 16px rgba(33,150,243,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-test-next:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(33,150,243,0.45); }

.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}
.btn-row .btn { flex: 1; }

/* ── 历史 ── */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.history-item:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateX(3px);
    box-shadow: var(--shadow);
}
.history-mode-icon {
    font-size: 18px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}
.history-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.history-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.history-left strong { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.history-title-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.history-title-row .history-meta { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.history-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.history-scores {
    display: flex;
    gap: 12px;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.score-known { color: var(--green); }
.score-fuzzy { color: var(--yellow); }
.score-unknown { color: var(--red); }

.history-detail {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    animation: fadeIn 0.3s ease;
}
.detail-numbers {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.review-list { margin-top: 10px; width: 100%; }
.review-word {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-xs);
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.04);
    transition: var(--transition-fast);
}
.review-word:hover { border-color: rgba(255,255,255,0.1); }
.review-pos { color: var(--text-secondary); font-size: 12px; flex: 1; font-weight: 500; }
.tag-fuzzy {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(229,192,123,0.15);
    color: var(--yellow);
    font-weight: 700;
    border: 1px solid rgba(229,192,123,0.2);
}
.tag-unknown {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(224,108,117,0.15);
    color: var(--red);
    font-weight: 700;
    border: 1px solid rgba(224,108,117,0.2);
}

/* ── 弹窗（现代模态） ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal {
    width: 100%;
    max-width: 400px;
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: modalEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal h3 { margin-bottom: 20px; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; overflow-wrap: break-word; }
.modal .input { margin-bottom: 12px; }
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    justify-content: space-between;
    width: 100%;
}
.modal-actions .btn { flex: 1; }

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.password-input-wrap .input {
    width: 100%;
    margin-bottom: 0;
    padding-right: 44px;
}
.password-eye-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.password-eye-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

@keyframes modalEnter { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* 弹窗内的日期选择器 */
.modal input[type="date"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 15px;
}

/* ── 编辑词汇弹窗 ── */
.edit-word-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.edit-field { display: flex; flex-direction: column; gap: 4px; }
.edit-field label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.edit-field textarea.input { resize: vertical; min-height: 56px; }
.edit-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-group { display: flex; gap: 14px; justify-content: center; align-items: center; height: 100%; padding: 4px 0; }
.radio-label { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-xs); font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid rgba(255,255,255,0.1); background: var(--bg-primary); color: var(--text-secondary); transition: var(--transition-fast); }
.radio-label.active { background: linear-gradient(135deg, var(--accent) 0%, #4a90d9 100%); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(97,175,239,0.3); }
.radio-label input { display: none; }
.pos-segment-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.pos-segment-item { display: flex; align-items: center; gap: 8px; }
.pos-segment-input { flex: 1; font-size: 14px; padding: 8px 10px; margin-bottom: 0 !important; }
.pos-segment-del { flex-shrink: 0; font-size: 14px; padding: 4px 8px; line-height: 1; }
.vocab-book-header { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 10px; }
.vocab-book-header .vocab-book-info { flex: 1; cursor: pointer; }
.vocab-book-header .expand-icon { display: inline-block; width: 20px; font-size: 11px; color: var(--text-muted); font-weight: 700; }
.vocab-book-item.expanded { border-color: var(--accent); }
.vocab-book-expand { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); }

/* 词书展开动画 */
.expand-enter-active { overflow: hidden; transition: max-height 1s ease-out, opacity 0.8s ease-out, margin-top 1s ease-out, padding-top 1s ease-out, border-top-width 1s ease-out; }
.expand-leave-active { overflow: hidden; transition: max-height 0.2s ease-in, opacity 0.15s ease-in, margin-top 0.2s ease-in, padding-top 0.2s ease-in, border-top-width 0.2s ease-in; }
.expand-enter-from,
.expand-leave-to { max-height: 0 !important; opacity: 0; margin-top: 0 !important; padding-top: 0 !important; border-top-width: 0; overflow: hidden; }
.expand-enter-to,
.expand-leave-from { max-height: 2000px; opacity: 1; margin-top: 12px; padding-top: 12px; }
.expand-leave-active .vocab-table-wrap,
.expand-enter-active .vocab-table-wrap { overflow: hidden; }

/* ── 网站设置 ── */
.site-settings-form { display: flex; flex-direction: column; gap: 14px; }
.site-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.site-setting-item {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: var(--transition-fast);
}
.site-setting-item:hover { border-color: rgba(255,255,255,0.1); }
.site-setting-item:has(.site-settings-html-editor),
.site-setting-item:has(.site-settings-preview),
.site-setting-item:has(textarea) {
    grid-column: 1 / -1;
}
.setting-desc { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 3px; }
.site-settings-html-editor { font-family: 'Fira Code', 'Cascadia Code', monospace; font-size: 13px; line-height: 1.6; min-height: 200px; }
.site-settings-preview { background: var(--bg-primary); padding: 18px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.06); margin-top: 10px; }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 28px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    z-index: 300;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
}
.toast.success { border-color: rgba(152,195,121,0.4); box-shadow: 0 4px 20px rgba(152,195,121,0.2), var(--shadow-lg); }
.toast.error { border-color: rgba(224,108,117,0.4); box-shadow: 0 4px 20px rgba(224,108,117,0.2), var(--shadow-lg); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.95); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* ── 提示 ── */
.hint { color: var(--text-muted); font-size: 14px; text-align: center; padding: 24px 0; font-weight: 500; }
.error-msg { color: var(--red); font-size: 13px; margin-top: 10px; text-align: center; font-weight: 600; }

/* ── 响应式 ── */
@media (max-width: 480px) {
    .container { padding: 16px 22px 36px; }
    .card { padding: 14px; }
    .topbar { padding: 12px 22px; }
    .brand { font-size: 17px; }
    .word-main { font-size: 52px; }
    .word-sub { font-size: 17px; }
    .btn-lg { padding: 16px 24px; font-size: 16px; min-height: 54px; }
    .btn-sm { padding: 5px 10px; font-size: 12px; min-height: 32px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filter-grid { gap: 10px; }
    .modal { padding: 20px; }
    .test-actions-center { gap: 10px; padding: 6px 12px; }
    .progress-legend { font-size: 15px; gap: 12px; }
    .btn-test { min-height: 64px; font-size: 16px; }
    .options-row { padding: 10px; }
    .group-mode-bar { gap: 8px; }
    .btn-group-mode { padding: 10px 12px; min-height: 48px; }
    .book-picker-box { padding: 18px 16px; }
}

/* ── 结果页面 ── */
.results-header { text-align: center; margin-bottom: 24px; }
.results-header h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.results-subtitle { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.result-row { display: flex; gap: 10px; margin-bottom: 20px; }
.result-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    min-height: 0;
}
.result-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.result-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}
.result-emoji { font-size: 22px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); line-height: 1; }
.result-num { font-size: 28px; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.result-bottom-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}
.result-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; line-height: 1; }
.result-pct { font-size: 12px; color: var(--text-muted); font-weight: 700; font-family: var(--font-mono); line-height: 1; }
.result-known { border-color: rgba(76,175,80,0.3); background: linear-gradient(180deg, rgba(76,175,80,0.08) 0%, transparent 100%); }
.result-fuzzy { border-color: rgba(229,192,123,0.3); background: linear-gradient(180deg, rgba(229,192,123,0.08) 0%, transparent 100%); }
.result-unknown { border-color: rgba(244,67,54,0.3); background: linear-gradient(180deg, rgba(244,67,54,0.08) 0%, transparent 100%); }

.word-main-cn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.meaning-line {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-display, var(--text-primary));
    text-align: center;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 440px;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    animation: wordEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.history-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.weak-words-section {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.weak-words-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
}

.btn-export {
    background: linear-gradient(135deg, rgba(97,175,239,0.15) 0%, rgba(97,175,239,0.08) 100%);
    border-color: rgba(97,175,239,0.3);
    color: var(--accent);
    font-weight: 600;
}
.btn-export:hover { background: linear-gradient(135deg, rgba(97,175,239,0.25) 0%, rgba(97,175,239,0.12) 100%); transform: translateY(-1px); }
.btn-review {
    background: linear-gradient(135deg, rgba(229,192,123,0.15) 0%, rgba(229,192,123,0.08) 100%);
    border-color: rgba(229,192,123,0.3);
    color: var(--yellow);
    font-weight: 600;
}
.btn-review:hover { background: linear-gradient(135deg, rgba(229,192,123,0.25) 0%, rgba(229,192,123,0.12) 100%); transform: translateY(-1px); }

.chart-container {
    max-width: 280px;
    margin: 0 auto 24px;
}
.mini-chart { max-width: 200px; max-height: 200px; }

.btn-delete {
    background: linear-gradient(135deg, rgba(224,108,117,0.12) 0%, rgba(224,108,117,0.06) 100%);
    border-color: rgba(224,108,117,0.25);
    color: var(--red);
    font-weight: 600;
}
.btn-delete:hover { background: linear-gradient(135deg, rgba(224,108,117,0.22) 0%, rgba(224,108,117,0.12) 100%); transform: translateY(-1px); }

/* ── 管理页面 ── */
.btn-admin {
    background: linear-gradient(135deg, rgba(152,195,121,0.15) 0%, rgba(152,195,121,0.08) 100%);
    border-color: rgba(152,195,121,0.3);
    color: var(--green);
    font-weight: 600;
}
.btn-admin:hover { background: linear-gradient(135deg, rgba(152,195,121,0.25) 0%, rgba(152,195,121,0.12) 100%); transform: translateY(-1px); }
.admin-user-list { display: flex; flex-direction: column; gap: 10px; }
.admin-user-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px; background: var(--bg-secondary); border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm); flex-wrap: wrap; gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}
.admin-user-item:hover { border-color: rgba(255,255,255,0.12); transform: translateX(2px); }
.admin-user-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.admin-user-info strong { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.admin-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(152,195,121,0.15);
    color: var(--green);
    display: inline-block;
    width: fit-content;
    font-weight: 700;
    border: 1px solid rgba(152,195,121,0.2);
}
.admin-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.admin-user-actions { display: flex; gap: 6px; flex-shrink: 0; }
.admin-user-item.expanded {
    border-color: rgba(97,175,239,0.3);
    background: linear-gradient(135deg, rgba(97,175,239,0.05) 0%, transparent 100%);
}
.admin-user-info { cursor: pointer; flex: 1; min-width: 0; }
.admin-user-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-edit-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
    font-weight: 500;
}
.admin-user-edit {
    width: 100%;
    margin-top: 8px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    animation: fadeInDown 0.25s ease;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.admin-edit-profile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-edit-password-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.admin-user-edit h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 纯图标按钮 */
.btn-icon {
    min-width: 36px;
    width: 36px;
    padding: 6px 0;
    font-size: 16px;
    line-height: 1;
    border-radius: var(--radius-xs);
}

.welcome-modal h3 { text-align: center; }
.welcome-info { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.welcome-col { padding: 14px; background: var(--bg-secondary); border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.06); }
.welcome-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.welcome-col p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.welcome-note { font-size: 12px !important; margin-top: 6px; color: var(--text-muted); }

.modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    line-height: 1;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(224,108,117,0.15); border-color: rgba(224,108,117,0.3); color: var(--red); }

.tag-recommend {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, #7eb8f7 100%);
    color: #fff;
    margin-left: 4px;
    vertical-align: middle;
    font-weight: 700;
}

.guest-note { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 6px; font-weight: 500; }

.welcome-bar-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 10px;
}
.welcome-bar-top .btn-sm { padding: 5px 14px; font-size: 12px; min-height: 30px; border-radius: 6px; }

/* ── 管理页面 Tabs ── */
.admin-tabs { display: flex; gap: 10px; margin-bottom: 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 12px; flex-wrap: wrap; }
.admin-tabs .btn { border-radius: var(--radius-xs) var(--radius-xs) 0 0; border-bottom: none; font-weight: 600; }

/* ── 词汇管理 ── */
.vocab-import-bar { background: var(--bg-secondary); padding: 18px; border-radius: var(--radius); margin-bottom: 1.2rem; border: 1px solid rgba(255,255,255,0.06); }
.vocab-import-bar h4 { margin: 0 0 12px 0; font-weight: 700; }
.admin-global-word-search { padding: 18px; }
.admin-global-word-search h4 { margin: 0 0 12px 0; font-weight: 700; }
.admin-global-search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-global-search-bar .input { flex: 1; min-width: 200px; }
.admin-global-search-results { margin-top: 14px; }
.admin-global-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.admin-global-search-pager { display: flex; align-items: center; gap: 8px; }
.vocab-book-list { display: flex; flex-direction: column; gap: 10px; }
.vocab-book-item { display: flex; flex-direction: column; padding: 12px 14px; background: var(--bg-secondary); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.06); box-shadow: var(--shadow-sm); transition: var(--transition-fast); }
.vocab-book-item:hover { border-color: rgba(255,255,255,0.12); }
.vocab-book-item.expanded { border-color: var(--accent); box-shadow: 0 4px 16px rgba(97,175,239,0.15); }
.vocab-book-header:hover { border-radius: 4px; background: rgba(128,128,128,0.06); }
.vocab-book-info { flex:1; display: flex; flex-direction: column; gap: 3px; }
.vocab-book-info span { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.vocab-book-actions { display: flex; gap: 6px; flex-shrink: 0; }
.vocab-table-wrap { overflow-x: auto; max-height: 500px; overflow-y: auto; border-radius: var(--radius-xs); border: 1px solid rgba(255,255,255,0.06); }
.vocab-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vocab-table th, .vocab-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: left; white-space: nowrap; }
.vocab-table th { position: sticky; top:0; background: var(--bg-card); color: var(--text-secondary); font-weight: 700; z-index: 1; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.vocab-table td[contenteditable] { background: var(--bg-hover); outline: 1px solid var(--accent); outline-offset: -1px; border-radius: 2px; min-width: 60px; }
.vocab-table td[contenteditable]:focus { background: #1a1d23; }
.vocab-table td input { background: var(--bg-hover); border: 1px solid var(--accent); color: var(--text-primary); padding: 3px 6px; border-radius: 3px; }
.vocab-table td input:focus { outline: none; border-color: var(--accent); background: #1a1d23; }

/* ── 分页导航 ── */
.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── 主题管理 ── */
.theme-list { display: flex; flex-direction: column; gap: 10px; }
.theme-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; background: var(--bg-secondary); border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm); gap: 12px; flex-wrap: wrap; cursor: default;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.theme-item:hover { border-color: rgba(97,175,239,0.25); transform: translateX(2px); }
.theme-item.theme-active { border-color: var(--green); box-shadow: 0 4px 16px rgba(152,195,121,0.15); }
.theme-info { flex: 1; min-width: 0; cursor: pointer; }
.theme-name-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.theme-name-row strong { font-size: 14px; font-weight: 700; }
.theme-swatches { display: flex; gap: 5px; }
.theme-swatch {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15); display: inline-block; flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.theme-item-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

/* ── 急速测试 ── */
.test-buttons-row {
    display: flex;
    gap: 12px;
}
.quick-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 12px;
}
.btn-quick-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 14px 16px;
    min-height: 58px;
    background: var(--bg-secondary);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-display, var(--text-primary));
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.btn-quick-option::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none;
}
.btn-quick-option:hover {
    border-color: rgba(97,175,239,0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.btn-quick-option:active { transform: scale(0.97); }
.btn-quick-option.quick-correct {
    border-color: var(--green);
    background: linear-gradient(135deg, rgba(76,175,80,0.15) 0%, rgba(76,175,80,0.06) 100%);
    color: var(--green);
    box-shadow: 0 4px 16px rgba(76,175,80,0.2);
}
.btn-quick-option.quick-wrong {
    border-color: var(--red);
    background: linear-gradient(135deg, rgba(244,67,54,0.15) 0%, rgba(244,67,54,0.06) 100%);
    color: var(--red);
    box-shadow: 0 4px 16px rgba(244,67,54,0.2);
    animation: shake 0.4s ease;
}
.btn-quick-option.quick-disabled-dim {
    opacity: 0.35;
    filter: grayscale(0.6);
}
.quick-opt-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.quick-opt-content {
    font-size: 16px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    font-weight: 700;
}
.quick-timer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}
.quick-timer-bar .timer-digit {
    font-size: 24px;
    font-weight: 900;
    font-family: var(--font-mono);
    min-width: 36px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}
.quick-timer-bar .timer-urgent {
    color: var(--red);
    animation: pulse 0.6s ease-in-out infinite alternate;
    text-shadow: 0 0 12px rgba(224,108,117,0.4);
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.quick-feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 440px;
    margin-top: -120px;
}
@media (max-width: 480px) {
    .quick-feedback {
        margin-top: -80px;
    }
}
.quick-fb-correct { background: linear-gradient(135deg, rgba(76,175,80,0.12) 0%, rgba(76,175,80,0.04) 100%); border: 1px solid rgba(76,175,80,0.25); box-shadow: 0 4px 16px rgba(76,175,80,0.1); }
.quick-fb-wrong { background: linear-gradient(135deg, rgba(244,67,54,0.12) 0%, rgba(244,67,54,0.04) 100%); border: 1px solid rgba(244,67,54,0.25); box-shadow: 0 4px 16px rgba(244,67,54,0.1); }
.quick-fb-timeout { background: linear-gradient(135deg, rgba(229,192,123,0.12) 0%, rgba(229,192,123,0.04) 100%); border: 1px solid rgba(229,192,123,0.25); box-shadow: 0 4px 16px rgba(229,192,123,0.1); }
.quick-fb-emoji { font-size: 52px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }
.quick-fb-text { font-size: 18px; font-weight: 800; color: var(--text-display, var(--text-primary)); letter-spacing: -0.2px; }
.quick-fb-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-secondary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.quick-fb-answer {
    border: 2px solid var(--green);
    background: linear-gradient(135deg, rgba(76,175,80,0.1) 0%, rgba(76,175,80,0.04) 100%);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(76,175,80,0.1);
}
.quick-fb-original {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}
.quick-fb-correct-answer {
    font-size: 22px;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -0.3px;
    overflow-wrap: break-word;
}

/* 倒计时显示 */
.quick-countdown {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    z-index: 10;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}
.quick-countdown.quick-countdown-urgent { color: var(--red); animation: pulse 0.5s ease-in-out infinite alternate; text-shadow: 0 0 12px rgba(224,108,117,0.4); }

/* 结果页面操作区 */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 测试按钮行 */
.test-buttons-row {
    margin-top: 24px;
}

/* 弹窗变体 */
.modal-wide {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.modal-header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}
.modal-close-static {
    position: static;
    font-size: 20px;
}

/* 搜索栏行 */
.search-bar-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.search-bar-input {
    flex: 1;
}

/* 管理页面返回按钮 */
.admin-back-btn {
    margin-bottom: 1.2rem;
}

/* 站点设置分区 */
.db-backup-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* 清除历史弹窗 */
.clear-range-dates {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.clear-range-dates label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 额外动画 */
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

/* 弹窗尺寸变体 */
.modal-medium { max-width: 480px; max-height: 80vh; overflow-y: auto; }
.modal-narrow { max-width: 360px; }

/* 弹窗头部 */
.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.modal-header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.modal-close-static {
    position: static;
    font-size: 20px;
}

/* 弹窗操作间距 */
.modal-actions-spaced {
    margin-top: 14px;
}

/* 卡片分区 */
.card-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* 分区标题 */
.section-title {
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

/* 分区头部行 */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}
.section-header-actions {
    display: flex;
    gap: 10px;
}

/* 隐藏输入 */
.hidden-input {
    display: none;
}

/* 备份恢复行 */
.backup-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.backup-label {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 120px;
    font-weight: 500;
}
.restore-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.file-input-inline {
    font-size: 14px;
}

/* 警告文本 */
.warning-text {
    font-size: 12px;
    color: var(--red);
    margin: 0;
    font-weight: 600;
}

/* 弹窗用户信息 */
.modal-user-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-weight: 500;
}
.modal-user-name {
    color: var(--text-primary);
    font-weight: 800;
}
.modal-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 500;
    line-height: 1.6;
}

/* 导入状态 */
.import-error {
    color: var(--red);
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}
.import-ok {
    color: var(--green);
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.profile-form { display: flex; flex-direction: column; gap: 10px; }
.profile-form .edit-field { display: flex; flex-direction: column; gap: 4px; }
.profile-form .edit-field label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.profile-form .edit-field .input { margin-bottom: 0; }
.profile-form .modal-actions { margin-top: 16px; }

/* 用户资料字段可视化编辑器 */
.profile-field-list { display: flex; flex-direction: column; gap: 8px; }
.profile-field-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; background: var(--bg-secondary); border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm); transition: var(--transition-fast); gap: 10px; flex-wrap: wrap;
}
.profile-field-item:hover { border-color: rgba(97,175,239,0.25); transform: translateX(2px); }
.profile-field-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.profile-field-key { font-size: 13px; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.profile-field-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.profile-field-type { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,0.08); color: var(--text-muted); font-weight: 500; }
.profile-field-required { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: rgba(224,108,117,0.15); color: var(--red); font-weight: 700; }
.profile-field-actions { display: flex; gap: 6px; flex-shrink: 0; }
.profile-field-form .edit-field { margin-bottom: 8px; }
.profile-field-form .edit-field:last-child { margin-bottom: 0; }

/* 用户资料字段可视化编辑器 - 折叠动画 */
.profile-editor.card {
    padding: 0;
    overflow: hidden;
}
.profile-editor-header {
    cursor: pointer;
    padding: 16px 14px;
    border-radius: var(--radius);
    transition: background 0.2s ease;
    user-select: none;
}
.profile-editor-header:hover {
    background: rgba(255,255,255,0.04);
}
.profile-editor-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile-editor-body.expanded {
    max-height: 2000px;
}
.profile-editor-inner {
    padding: 0 14px 14px;
}
.profile-editor-subtitle {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-top: 4px;
}
.profile-editor-subtitle p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}
.profile-editor-subtitle .expand-hint {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
@media (max-width: 480px) {
    .profile-editor-header {
        padding: 14px 12px;
    }
    .profile-editor-inner {
        padding: 0 12px 12px;
    }
}

/* ── 词书封面卡片（三级列表） ── */
.bp-book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.bp-book-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.bp-book-card:hover {
    border-color: rgba(97,175,239,0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.bp-book-card:active { transform: scale(0.98); }
.bp-book-cover {
    width: 100%;
    /* A4 纸比例 210:297 ≈ 1:1.414 */
    aspect-ratio: 1 / 1.414;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(97,175,239,0.1) 0%, rgba(192,132,252,0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.bp-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bp-book-cover-placeholder {
    font-size: 48px;
    opacity: 0.7;
}
.bp-book-card-info {
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bp-book-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-display, var(--text-primary));
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.bp-book-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── 管理后台封面缩略图 ── */
.vocab-book-cover-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .bp-book-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .bp-book-card-info {
        padding: 8px;
    }
    .bp-book-card-name {
        font-size: 12px;
    }
    .bp-book-card-meta {
        font-size: 11px;
    }
}

/* ── 词汇管理页三级导航 ── */
.admin-vocab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.admin-vocab-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}
.admin-vocab-back-btn {
    margin-bottom: 12px;
}
.admin-vocab-back-btn:hover { transform: translateX(-2px); }

/* 分类卡片网格 */
.admin-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.admin-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 12px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
}
.admin-category-card:hover {
    border-color: rgba(97,175,239,0.3);
    background: linear-gradient(135deg, rgba(97,175,239,0.08) 0%, transparent 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.admin-category-card.drag-over {
    border-color: var(--accent);
    background: rgba(97,175,239,0.12);
    transform: scale(1.02);
}
.admin-category-card[draggable="true"] { cursor: grab; }
.admin-category-card[draggable="true"]:active { cursor: grabbing; }
.admin-category-icon { font-size: 36px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.admin-category-name {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.2px;
}
.admin-category-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* 管理端词书卡片网格 */
.admin-book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.admin-book-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.admin-book-card:hover {
    border-color: rgba(97,175,239,0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.admin-book-card.drag-over {
    border-color: var(--accent);
    background: rgba(97,175,239,0.12);
    transform: scale(1.02);
}
.admin-book-card[draggable="true"] { cursor: grab; }
.admin-book-card[draggable="true"]:active { cursor: grabbing; }
.admin-book-cover {
    width: 100%;
    aspect-ratio: 1 / 1.414;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(97,175,239,0.1) 0%, rgba(192,132,252,0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.admin-book-cover-placeholder {
    font-size: 48px;
    opacity: 0.7;
}
.admin-book-card-info {
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-book-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-display, var(--text-primary));
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.admin-book-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 词书编辑子页面 */
.admin-book-edit-page {
    padding: 16px 0;
}
.admin-book-edit-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.admin-book-edit-page-header h3 {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
}
.admin-book-edit-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.admin-book-edit-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.admin-book-edit-cover {
    width: 160px;
    max-width: 60%;
    aspect-ratio: 1 / 1.414;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(97,175,239,0.1) 0%, rgba(192,132,252,0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.06);
}
.admin-book-edit-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.admin-book-edit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
}
.admin-book-edit-actions .btn {
    min-width: 120px;
    flex: 1;
    max-width: 200px;
}
.admin-book-edit-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-book-words-section {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.admin-book-words-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.admin-book-words-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .admin-book-edit-page {
        padding: 8px 0;
    }
    .admin-book-edit-page-header {
        gap: 8px;
    }
    .admin-book-edit-cover {
        width: 140px;
    }
    .admin-book-edit-actions .btn {
        min-width: 100px;
        max-width: none;
    }
    .admin-category-grid,
    .admin-book-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .admin-category-card {
        padding: 16px 8px;
    }
    .admin-category-icon { font-size: 28px; }
    .admin-category-name { font-size: 13px; }
    .admin-category-actions { margin-top: 6px; }
    .admin-book-card-info { padding: 8px; }
    .admin-book-card-name { font-size: 12px; }
    .admin-book-card-meta { font-size: 11px; }
}

/* 词书名称两排显示 */
.book-name-line1 {
    font-weight: inherit;
    color: inherit;
    line-height: 1.35;
}
.book-name-line2 {
    font-size: 0.85em;
    font-weight: 500;
    color: inherit;
    line-height: 1.35;
    margin-top: 2px;
}
.book-search-name .book-name-line2 { font-size: 12px; }

/* 全屏倒计时 */
.countdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: radial-gradient(circle at center, rgba(10,12,18,0.96) 0%, rgba(0,0,0,0.98) 100%);
    backdrop-filter: blur(8px);
    animation: countdownFadeIn 0.4s ease;
}
@keyframes countdownFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.countdown-ring {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.countdown-ring-spin {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(var(--accent) 0%, transparent 60%);
    box-shadow: 0 0 40px rgba(97,175,239,0.25), inset 0 0 30px rgba(97,175,239,0.1);
    animation: countdownRingSpin 2.8s linear infinite;
}
.countdown-ring-spin::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(10,12,18,0.95) 0%, rgba(0,0,0,0.98) 100%);
}
@keyframes countdownRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.countdown-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
    border-radius: 50%;
    border: 3px solid rgba(97,175,239,0.6);
    opacity: 0;
    transform: scale(0.6);
    pointer-events: none;
}
.countdown-ripple.active {
    animation: countdownRipple 0.85s ease-out forwards;
}
.countdown-ripple.countdown-go {
    border-color: rgba(152,195,121,0.6);
}
@keyframes countdownRipple {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}
.countdown-number {
    position: relative;
    z-index: 2;
    font-size: 96px;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 30px rgba(97,175,239,0.6), 0 0 60px rgba(97,175,239,0.3);
    animation: countdownPop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes countdownPop {
    0% { transform: scale(0.2); opacity: 0; }
    40% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.countdown-number.countdown-go {
    font-size: 72px;
    color: #98c379;
    text-shadow: 0 0 30px rgba(152,195,121,0.6), 0 0 60px rgba(152,195,121,0.3);
}
.countdown-label {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.countdown-hint {
    font-size: 14px;
    color: var(--text-muted);
}
@media (max-width: 640px) {
    .countdown-ring {
        width: 160px;
        height: 160px;
    }
    .countdown-number {
        font-size: 72px;
    }
    .countdown-number.countdown-go {
        font-size: 54px;
    }
    .countdown-label {
        font-size: 18px;
    }
}
