/* ============================================================
   考研英语真题单词本 - 样式表
   配色：暖米白底 + 深墨绿主色 + 琥珀金强调
   ============================================================ */

:root {
    --bg: #f7f5f0;
    --bg-elevated: #ffffff;
    --bg-soft: #f0ede5;
    --text: #2b2b2b;
    --text-soft: #6b6b6b;
    --text-muted: #9a9a9a;
    --primary: #1f5d4a;
    --primary-hover: #174a3b;
    --primary-soft: #e6f0eb;
    --accent: #c8893a;
    --accent-soft: #f5ead6;
    --danger: #c0392b;
    --danger-soft: #fbeae8;
    --border: #e5e0d5;
    --border-strong: #d4cdbd;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-sans: 'Inter', 'Noto Serif SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Noto Serif SC', Georgia, 'Times New Roman', serif;
}

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

html, body {
    height: 100%;
}

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

/* ==================== 顶部导航 ==================== */
.app-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, #2a7a63 100%);
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(31, 93, 74, 0.25);
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

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

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

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    background: transparent;
    color: var(--text);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(31, 93, 74, 0.25);
}

.btn-ghost {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--bg-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
}

.btn-icon:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-text-danger {
    background: transparent;
    border: none;
    color: var(--danger);
    padding: 6px 10px;
    font-size: 13px;
}

.btn-text-danger:hover {
    background: var(--danger-soft);
}

.word-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(200, 137, 58, 0.4);
}

/* ==================== 主体布局 ==================== */
.app-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 28px 60px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.exam-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exam-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.exam-item:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.exam-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.exam-item .exam-year {
    font-weight: 600;
}

.exam-item .exam-tag {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--bg-soft);
    border-radius: 4px;
    color: var(--text-muted);
}

.exam-item.active .exam-tag {
    background: rgba(31, 93, 74, 0.12);
    color: var(--primary);
}

.exam-item .exam-delete {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.exam-item:hover .exam-delete {
    opacity: 1;
}

.exam-item .exam-delete:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* 提示卡片 */
.tip-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tip-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tip-text strong {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 4px;
}

.tip-text p {
    font-size: 12px;
    color: var(--text-soft);
    line-height: 1.5;
}

/* ==================== 内容区 ==================== */
.content {
    min-height: 600px;
}

.exam-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 48px;
    box-shadow: var(--shadow-sm);
    min-height: 600px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-muted);
    gap: 16px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 真题标题 */
.exam-title-block {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.exam-title-block h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.exam-title-block .exam-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* Section 标题 */
.section-block {
    margin-bottom: 40px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
}

.directions {
    background: var(--bg-soft);
    border-left: 3px solid var(--accent);
    padding: 12px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-soft);
    font-style: italic;
}

.part-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 14px;
}

.text-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 22px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-strong);
}

/* 文章段落 */
.passage {
    margin-bottom: 18px;
}

.paragraph {
    font-family: var(--font-serif);
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--text);
    margin-bottom: 14px;
    text-align: justify;
    text-justify: inter-character;
}

/* 单词 - 核心交互元素 */
.word {
    display: inline;
    cursor: pointer;
    padding: 1px 2px;
    margin: 0;
    border-radius: 3px;
    transition: background 0.12s ease, color 0.12s ease;
    color: inherit;
}

.word:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.word.collected {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 500;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0;
}

.word.collected:hover {
    background: var(--primary);
    color: #fff;
}

/* 题目 */
.question-block {
    margin: 18px 0;
    padding: 14px 18px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
}

.question-num {
    font-weight: 700;
    color: var(--primary);
    margin-right: 6px;
}

.question-text {
    font-size: 14.5px;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.6;
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 24px;
    margin-top: 8px;
}

.option {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.6;
}

.option-letter {
    display: inline-block;
    font-weight: 700;
    color: var(--accent);
    margin-right: 6px;
    min-width: 22px;
}

/* 完形填空选项表 */
.cloze-options {
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin: 20px 0;
}

.cloze-options h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.cloze-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    padding: 4px 0;
}

.cloze-q-num {
    font-weight: 700;
    color: var(--primary);
    min-width: 24px;
}

.cloze-opts {
    color: var(--text-soft);
}

.cloze-opts .opt-letter {
    color: var(--accent);
    font-weight: 700;
    margin-right: 3px;
}

/* Part B 段落选项 */
.paragraph-option {
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 14px;
    padding-left: 8px;
}

.paragraph-option .opt-label {
    display: inline-block;
    font-weight: 700;
    color: var(--accent);
    margin-right: 8px;
    background: var(--accent-soft);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* ==================== 抽屉（单词本） ==================== */
.drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
    visibility: hidden;
    pointer-events: none;
}

.drawer.open {
    visibility: visible;
    pointer-events: auto;
}

.drawer-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.drawer.open .drawer-mask {
    opacity: 1;
}

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer.open .drawer-panel {
    transform: translateX(0);
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.drawer-close, .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.drawer-close:hover, .modal-close:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.drawer-toolbar {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-elevated);
    color: var(--text);
    transition: border-color 0.15s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 24px;
}

.word-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.12s;
    border-bottom: 1px solid var(--border);
}

.word-list-item:hover {
    background: var(--bg-soft);
}

.word-list-item .word-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    font-family: var(--font-serif);
}

.word-list-item .word-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.word-list-item .word-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.word-list-item:hover .word-remove {
    opacity: 1;
}

.word-list-item .word-remove:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin: 0 auto 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

.drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.drawer-stats {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ==================== 上传弹窗 ==================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.open {
    visibility: visible;
    pointer-events: auto;
}

.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal.open .modal-mask {
    opacity: 1;
}

.modal-panel {
    position: relative;
    width: 520px;
    max-width: 92vw;
    max-height: 90vh;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.open .modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-elevated);
}

.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s ease;
    background: var(--bg-soft);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.upload-zone .upload-icon {
    color: var(--primary);
    margin-bottom: 12px;
}

.upload-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

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

.upload-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.upload-status.success {
    background: var(--primary-soft);
    color: var(--primary);
}

.upload-status.error {
    background: var(--danger-soft);
    color: var(--danger);
}

.upload-status.processing {
    background: var(--accent-soft);
    color: var(--accent);
}

.upload-form {
    margin-top: 18px;
}

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.form-row input, .form-row select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-elevated);
    color: var(--text);
    transition: border-color 0.15s;
}

.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.upload-note {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-soft);
    line-height: 1.6;
}

.upload-note strong {
    color: var(--text);
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: #fff;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 400;
    max-width: 90vw;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--primary);
}

.toast.error {
    background: var(--danger);
}

.toast.warn {
    background: var(--accent);
}

/* ==================== 响应式 ==================== */
@media (max-width: 960px) {
    .app-main {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    .sidebar {
        position: static;
    }
    .exam-content {
        padding: 24px 20px;
    }
    .header-inner {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .brand-text h1 {
        font-size: 15px;
    }
    .brand-sub {
        display: none;
    }
    .header-actions .btn span {
        display: none;
    }
    .options {
        grid-template-columns: 1fr;
    }
}

/* 滚动条美化 */
::-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);
}

/* ===== 考研学习站统一导航 ===== */
.snav{position:sticky;top:0;z-index:1000;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 20px;background:rgba(255,255,255,.94);backdrop-filter:blur(8px);border-bottom:1px solid #e2e8f0;flex-wrap:wrap;font-family:"Segoe UI","Microsoft YaHei",system-ui,sans-serif}
.snav-brand{font-weight:700;font-size:15px;color:#0f172a;text-decoration:none;display:flex;align-items:center;gap:7px}
.snav-brand::before{content:"";width:10px;height:10px;border-radius:3px;background:linear-gradient(135deg,#2563eb,#7c3aed)}
.snav-links{display:flex;gap:6px;flex-wrap:wrap}
.snav-link{padding:6px 14px;border-radius:999px;font-size:13.5px;color:#475569;text-decoration:none;transition:all .15s;border:1px solid transparent}
.snav-link:hover{background:#f1f5f9;color:#0f172a}
.snav-link.active{background:#2563eb;border-color:#2563eb;color:#fff;font-weight:600}
