# -*- coding: utf-8 -*-
"""英语文章分析辅助学习工具 - 前端样式"""

/* ===== 全局样式 ===== */
:root {
    --primary: #4A90D9;
    --primary-dark: #3A7BC8;
    --primary-light: #E8F1FB;
    --accent: #FF6B6B;
    --success: #52C41A;
    --warning: #FAAD14;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #2C3E50;
    --text-secondary: #7F8C8D;
    --border: #E0E6ED;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ===== 顶部导航 ===== */
.navbar {
    background: var(--card-bg);
    padding: 16px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary);
}

.navbar-left {
    flex: 1;
}

.navbar-right {
    flex-shrink: 0;
}

.navbar h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1A1A2E;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .subtitle {
    font-size: 13px;
    color: #333333;
    margin-top: 2px;
}

.navbar .copyright {
    font-size: 11px;
    color: #888888;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* ===== 主题切换按钮 ===== */
.theme-toggle-btn {
    background: linear-gradient(135deg, #4A90D9, #3A7BC8);
    border: none;
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(74,144,217,0.25);
}

.theme-toggle-btn:hover {
    background: linear-gradient(135deg, #3A7BC8, #2E6AB5);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(74,144,217,0.4);
}

/* ===== 主题面板 ===== */
.theme-panel {
    display: none;
    position: fixed;
    top: 70px;
    right: 20px;
    width: 320px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 20px;
    z-index: 200;
    border: 1px solid var(--border);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.theme-panel.active {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.theme-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.theme-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.theme-panel-close {
    background: var(--border);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
}

.theme-panel-close:hover {
    background: var(--accent);
    color: white;
}

.theme-section {
    margin-bottom: 18px;
}

.theme-section:last-child {
    margin-bottom: 0;
}

.theme-section-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* 颜色色块 */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.color-swatch.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), 0 2px 6px rgba(0,0,0,0.15);
}

/* 自定义颜色 */
.custom-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

#custom-bg-color {
    width: 44px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

#custom-bg-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

#custom-bg-color::-webkit-color-swatch {
    border: 2px solid var(--border);
    border-radius: 6px;
}

.custom-color-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 图片背景 */
.image-bg-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.image-upload-label {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #9C27B0, #BA68C8);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.image-upload-label:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(156,39,176,0.3);
}

.reset-bg-btn {
    padding: 8px 16px;
    background: var(--border);
    color: var(--text);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-bg-btn:hover {
    background: #d0d6dd;
}

.bg-opacity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

#bg-opacity-slider {
    flex: 1;
    cursor: pointer;
    accent-color: var(--primary);
}

#bg-opacity-value {
    min-width: 36px;
    text-align: right;
    font-weight: 600;
}

.reset-all-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}

/* ===== 主容器 ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ===== 输入区域 ===== */
.input-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}

.input-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

textarea#article-input {
    width: 100%;
    min-height: 320px;
    max-height: 80vh;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.8;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea#article-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
}

.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #4A90D9, #3A7BC8);
    color: white;
    box-shadow: 0 2px 8px rgba(74,144,217,0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3A7BC8, #2E6AB5);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(74,144,217,0.4);
}

.btn-success {
    background: linear-gradient(135deg, #52C41A, #389E0D);
    color: white;
    box-shadow: 0 2px 8px rgba(82,196,26,0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #389E0D, #2D8C04);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(82,196,26,0.4);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #d0d6dd;
}

.btn-overall,
#overall-btn {
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
    color: white;
    box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}

.btn-overall:hover,
#overall-btn:hover {
    background: linear-gradient(135deg, #6D28D9, #4C1D95);
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.export-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    align-self: center;
}

.btn-warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    box-shadow: 0 2px 8px rgba(255,152,0,0.25);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #F57C00, #EF6C00);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255,152,0,0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #FF6B6B, #E53E3E);
    color: white;
    box-shadow: 0 2px 8px rgba(255,107,107,0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #E53E3E, #C53030);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255,107,107,0.4);
}

.btn-export {
    background: linear-gradient(135deg, #E879F9, #C026D3);
    color: white;
    box-shadow: 0 2px 8px rgba(232,121,249,0.25);
}

.btn-export:hover {
    background: linear-gradient(135deg, #C026D3, #A21CAF);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232,121,249,0.4);
}


.btn-exercise {
    background: linear-gradient(135deg, #34D399, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}

.btn-exercise:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16,185,129,0.4);
}

.export-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 13px;
    color: var(--text-secondary, #666);
    cursor: pointer;
    user-select: none;
}
/* 按钮点击高亮（按下时） */
.btn:active,
.btn.active {
    transform: translateY(1px) scale(0.97);
    filter: brightness(0.85);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== 加载动画 ===== */
.loading-overlay {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading-overlay.active {
    display: block;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ===== 结果区域 ===== */
.result-section {
    display: none;
}

.result-section.active {
    display: block;
}

/* ===== Tab 导航 ===== */
.tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: #1a1a1a;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===== 语法填空卡片 ===== */
.grammar-cloze-wrap { padding: 4px 2px; }
.gc-header { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px dashed var(--border-color, #d0d7de); }
.gc-title { font-size: 18px; font-weight: 700; color: var(--text-color, #1f2937); margin-bottom: 6px; }
.gc-source { font-size: 13px; color: var(--text-secondary, #6b7280); }
.gc-source-label { display: inline-block; padding: 3px 10px; margin-bottom: 8px; background: #e0e7ff; color: #4338ca; border-radius: 6px; font-size: 13px; font-weight: 600; }
.gc-toolbar { margin-bottom: 18px; display: flex; gap: 10px; align-items: center; }
.gc-sentences { display: flex; flex-direction: column; gap: 18px; }
.gc-sentence-card {
    background: var(--card-bg, #fff);
    border-radius: var(--radius, 12px);
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.08));
    padding: 18px 20px;
    border-left: 4px solid #10b981;
}
.gc-sentence-line { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.gc-sentence-num {
    flex: 0 0 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #10b981, #059669); color: #fff;
    border-radius: 50%; font-size: 13px; font-weight: 700;
}
.gc-sentence-text { flex: 1; font-size: 16px; line-height: 1.8; color: var(--text-color, #1f2937); word-break: break-word; }
.gc-options-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 0 40px; }
.gc-blank-label { font-size: 13px; color: var(--text-secondary, #6b7280); font-weight: 600; margin-right: 4px; }
.gc-option-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; border-radius: 8px; background: #f3f4f6;
    color: var(--text-color, #374151); font-size: 14px;
    border: 1px solid var(--border-color, #e5e7eb);
    transition: all .2s;
}
.gc-option-chip b { color: #2563eb; font-weight: 700; }
.gc-option-answer { background: #d1fae5; border-color: #10b981; color: #065f46; }
.gc-option-answer b { color: #047857; }
.gc-explanation {
    display: none; margin: 12px 0 0 40px; padding: 12px 14px;
    background: #f0fdf4; border-left: 3px solid #10b981; border-radius: 8px;
    font-size: 14px; line-height: 1.7; color: var(--text-color, #1f2937);
}
.gc-answer-summary { display: none; margin-top: 24px; padding: 18px 20px; background: var(--card-bg, #fff); border-radius: var(--radius, 12px); box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.08)); }
.gc-answer-summary h4 { margin: 0 0 12px 0; font-size: 16px; color: var(--text-color, #1f2937); }
.gc-answer-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.gc-answer-item { display: inline-flex; gap: 5px; padding: 5px 10px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 6px; font-size: 14px; color: #065f46; }
.gc-answer-item b { color: #047857; }
.gc-meta { margin-top: 10px; font-size: 14px; line-height: 1.7; color: var(--text-secondary, #4b5563); }
.gc-meta b { color: var(--text-color, #1f2937); }
#tab-grammar-cloze.show-answers .gc-explanation,
#tab-grammar-cloze.show-answers .gc-answer-summary { display: block; }
#tab-grammar-cloze.show-answers .gc-option-answer { box-shadow: 0 0 0 2px #10b981; }
/* 批量拆解视图复用同一套答案显隐规则 */
#tab-batch-cloze.show-answers .gc-explanation,
#tab-batch-cloze.show-answers .gc-answer-summary { display: block; }
#tab-batch-cloze.show-answers .gc-option-answer { box-shadow: 0 0 0 2px #10b981; }

/* ===== 句子合并复选框（语法填空/批量拆解/句子分析）===== */
.gc-merge-cb, .sentence-merge-cb {
    width: 18px; height: 18px; margin: 0; cursor: pointer; flex-shrink: 0;
}
.gc-merge-cb { margin-right: 10px; }
.gc-merge-bar {
    margin-bottom: 14px; padding: 10px 14px;
    background: var(--card-bg, #fff); border-radius: var(--radius, 12px);
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.06));
}
.gc-merge-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; color: var(--text-secondary, #6b7280); cursor: pointer;
}
.btn-merge {
    background: #f59e0b; color: #fff; border: 1px solid #d97706;
    padding: 6px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; transition: background .15s;
}
.btn-merge:hover { background: #d97706; }
.btn-merge:disabled { opacity: .5; cursor: not-allowed; }
.sentence-merge-cb { margin-right: 8px; }
.merged-badge {
    display: inline-block; padding: 2px 8px; margin-right: 6px;
    background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
    border-radius: 6px; font-size: 12px; font-weight: 600; vertical-align: middle;
}

/* ===== 短文填空 ===== */
.sp-word-bank {
    margin: 0 0 18px 0; padding: 12px 16px;
    background: #eff6ff; border-left: 3px solid #3b82f6; border-radius: 8px;
    font-size: 15px; line-height: 1.9; color: var(--text-color, #1f2937);
}
.sp-word-bank b { color: #1d4ed8; margin-right: 4px; }
.sp-word {
    display: inline-block; padding: 3px 12px; margin: 2px 6px 2px 0;
    background: #fff; border: 1px solid #bfdbfe; border-radius: 6px;
    font-weight: 600; color: #1e3a8a;
}
#tab-short-cloze.show-answers .gc-explanation { display: block; }
.sp-sentence-card { margin-bottom: 18px; }
.sp-blank-row {
    margin: 10px 0 4px 36px; padding: 10px 14px;
    background: #f8fafc; border-radius: 8px; border-left: 3px solid #94a3b8;
}
.sp-blank-label { font-size: 13px; color: #475569; font-weight: 600; margin-bottom: 6px; }
.sp-blank-words { line-height: 1.9; }
.sp-empty { color: #94a3b8; font-size: 14px; font-style: italic; }

/* 短文原文与逐空解析卡 */
.sp-passage-context {
    background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 10px;
    padding: 16px 18px; margin-bottom: 20px; box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.06));
}
.sp-section-title {
    font-size: 15px; font-weight: 700; color: #334155;
    margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #e2e8f0;
}
.sp-passage-text {
    font-size: 16px; line-height: 2; color: var(--text-color, #1f2937);
    white-space: pre-wrap; word-break: break-word;
}
.sp-blank-analysis-section { margin-bottom: 20px; }
/* 短文填空：保存结果就地提示（紧挨保存按钮，避免用户不知是否保存） */
.sp-save-status {
    display: inline-block; margin-left: 12px; padding: 5px 12px;
    font-size: 14px; font-weight: 600; border-radius: 6px; vertical-align: middle;
    opacity: 0; transition: opacity .15s ease; min-height: 1em;
}
.sp-save-status:not(:empty) { opacity: 1; }
.sp-save-status.ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.sp-save-status.err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
/* 多篇短文填空：每篇独立卡片 + 顶部全局工具栏 */
.sp-multi-toolbar {
    position: sticky; top: 0; z-index: 5;
    background: var(--card-bg, #fff); border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px; padding: 10px 14px; margin-bottom: 18px;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.06));
}
.sp-passage-card {
    background: var(--card-bg, #fff); border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px; padding: 18px 20px; margin-bottom: 22px;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.06));
}
.sp-passage-card-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px dashed #e2e8f0;
}
.sp-passage-no {
    font-size: 15px; font-weight: 800; color: #1d4ed8; margin-right: 4px;
}
.sp-blank-card {
    background: #fff; border-radius: 10px; border-left: 4px solid #3b82f6;
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.06));
    padding: 16px 18px; margin-bottom: 16px;
}
.sp-blank-title {
    font-size: 15px; font-weight: 700; color: #1d4ed8; margin-bottom: 10px;
}
.sp-blank-sentence {
    font-size: 16px; line-height: 1.9; color: var(--text-color, #1f2937);
    margin-bottom: 12px; padding: 10px 12px; background: #f8fafc; border-radius: 6px;
}
.sp-blank-words-row { margin-bottom: 10px; line-height: 1.9; }
.sp-blank-words-row b { color: #475569; margin-right: 6px; }

/* 练习页：短文填空选词 */
.cp-word-bank { margin: 6px 0 16px; }
.cp-pool-label { font-size: 13px; color: var(--text-secondary, #6b7280); margin-bottom: 8px; font-weight: 600; }
.cp-blanks { display: flex; flex-direction: column; gap: 18px; }
.cp-blank-card {
    background: var(--card-bg, #fff); border-radius: var(--radius, 12px);
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.08)); padding: 16px 18px;
    border-left: 4px solid #3b82f6;
}
.cp-sentence { font-size: 16px; line-height: 1.9; color: var(--text-color, #1f2937); word-break: break-word; }
.cp-blank {
    display: inline-block; min-width: 64px; text-align: center; padding: 2px 10px; margin: 0 4px;
    border-bottom: 2px dashed #3b82f6; cursor: pointer; font-weight: 600; color: #1d4ed8;
    background: #eff6ff; border-radius: 4px;
}
.cp-blank.cp-correct { background: #d1fae5; border-bottom-color: #10b981; color: #065f46; }
.cp-blank.cp-wrong { background: #fee2e2; border-bottom-color: #ef4444; color: #991b1b; }
.cp-answer-line { margin-top: 8px; font-size: 13px; color: var(--text-secondary, #4b5563); }
.cp-analysis-line { margin-top: 8px; padding: 10px 12px; background: rgba(59, 130, 246, .08); border-radius: 8px; font-size: 13.5px; line-height: 1.7; color: var(--text-color, #1f2937); }

/* ===== 批量拆解 ===== */
.batch-cloze-wrap { padding: 4px 2px; }
.bc-article {
    background: var(--card-bg, #fff);
    border-radius: var(--radius, 12px);
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.08));
    padding: 20px 22px;
    margin-bottom: 22px;
}
.bc-article-title {
    font-size: 17px; font-weight: 700; color: var(--text-color, #1f2937);
    margin: 0 0 14px 0; padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color, #d0d7de);
    display: flex; align-items: center; gap: 10px;
}
.bc-idx {
    flex: 0 0 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
    border-radius: 50%; font-size: 13px; font-weight: 700;
}
.bc-count { font-size: 13px; color: var(--text-secondary, #6b7280); margin-left: auto; }
.bc-bank-status { font-size: 13px; color: var(--text-secondary, #6b7280); margin-left: 8px; }
.gc-empty, .bc-empty {
    padding: 24px; text-align: center; color: var(--text-secondary, #6b7280);
    background: var(--card-bg, #fff); border-radius: var(--radius, 12px);
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.08));
}
.bc-errors {
    margin-top: 16px; padding: 14px 16px; background: #fff7ed;
    border-left: 3px solid #f59e0b; border-radius: 8px; font-size: 14px; color: #92400e;
}
.bc-errors ul { margin: 8px 0 0; padding-left: 20px; }
.bc-raw-section { margin-bottom: 18px; }
.bc-raw-label { display: block; font-size: 13px; color: var(--text-secondary, #6b7280); margin-bottom: 6px; }
.bc-raw-text {
    width: 100%; height: 180px; resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px; line-height: 1.6;
    padding: 10px 12px; border: 1px solid var(--border-color, #d0d7de); border-radius: 8px;
    background: var(--input-bg, #f8fafc); color: var(--text-color, #1f2937);
    overflow-y: auto; white-space: pre-wrap; word-break: break-word;
    box-sizing: border-box;
}

/* ===== 句子拆解导出弹窗 ===== */
.cloze-dialog-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
.cloze-dialog {
    background: var(--card-bg, #fff);
    color: var(--text-color, #1f2937);
    border-radius: var(--radius, 14px);
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 22px 24px 18px;
}
.cloze-dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cloze-dialog-title { margin: 0; font-size: 18px; font-weight: 700; }
.cloze-dialog-close {
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: transparent; color: var(--text-secondary, #6b7280);
    font-size: 22px; line-height: 1; cursor: pointer; transition: all .15s;
    display: flex; align-items: center; justify-content: center;
}
.cloze-dialog-close:hover { background: var(--input-bg, #f3f4f6); color: var(--text-color, #1f2937); }
.cloze-dialog-hint { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary, #6b7280); line-height: 1.6; }
.cloze-format-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px;
}
.cloze-format-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 14px 8px; border: 1px solid var(--border-color, #d0d7de);
    border-radius: 12px; background: var(--chip-bg, #f8fafc); color: var(--text-color, #1f2937);
    cursor: pointer; transition: all .15s;
}
.cloze-format-btn:hover { background: var(--primary-bg, #eef2ff); border-color: var(--primary, #6366f1); transform: translateY(-1px); }
.cf-icon { font-size: 22px; line-height: 1; }
.cf-label { font-size: 13px; font-weight: 600; }
.cloze-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 14px;
    padding: 10px 12px;
    background: var(--input-bg, #f8fafc);
    border: 1px solid var(--border-color, #d0d7de);
    border-radius: 10px;
}
.cloze-option-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #1f2937);
    cursor: pointer;
}
.cloze-option-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #6366f1);
    cursor: pointer;
}
.cloze-option-hint {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
}
.cloze-type-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 14px;
    padding: 10px 12px;
    background: var(--input-bg, #f8fafc);
    border: 1px solid var(--border-color, #d0d7de);
    border-radius: 10px;
}
.cloze-type-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #1f2937);
    white-space: nowrap;
}
.cloze-type-select {
    flex: 0 0 auto;
    min-width: 180px;
    padding: 7px 10px;
    font-size: 14px;
    color: var(--text-color, #1f2937);
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #d0d7de);
    border-radius: 8px;
    cursor: pointer;
    outline: none;
}
.cloze-type-select:focus {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.cloze-type-hint {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
    flex: 1 1 200px;
}
.cloze-bank-row { display: flex; justify-content: center; margin-bottom: 10px; }
.cloze-bank-btn { width: 100%; justify-content: center; }
.cloze-dialog-status {
    min-height: 22px; margin: 8px 0 4px; font-size: 13px; line-height: 1.5;
    color: var(--text-secondary, #6b7280); word-break: break-word;
}
.cloze-dialog-footer { display: flex; justify-content: flex-end; margin-top: 6px; gap: 10px; }
.cloze-dialog-footer .btn-secondary {
    background: var(--input-bg, #f3f4f6); color: var(--text-color, #374151);
    border: 1px solid var(--border-color, #d0d7de); font-weight: 600; padding: 8px 18px;
}
.cloze-dialog-footer .btn-secondary:hover { background: var(--border-color, #e5e7eb); }
.cloze-bank-row .cloze-bank-btn:disabled { opacity: .65; cursor: not-allowed; }
@media (max-width: 480px) {
    .cloze-format-grid { grid-template-columns: 1fr; }
}

/* ===== 句子分析卡片 ===== */
.sentence-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.sentence-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}
/* 朗读按钮（英音 / 美音） */
.tts-btns {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    margin: 4px 0 2px;
}
.tts-btn {
    border: 1px solid var(--border, #d0d7de);
    background: #f4f7fb;
    color: var(--text, #2b3a4a);
    border-radius: 16px;
    padding: 3px 10px;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.tts-btn:hover {
    background: var(--primary-light, #e8f0ff);
    border-color: var(--primary, #3a7afe);
}

/* ===== 文章输入框朗读按钮（右下角悬浮）===== */
.textarea-wrapper {
    position: relative;
    border-radius: 8px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.article-tts-btns {
    position: absolute;
    bottom: 8px;
    right: 10px;
    z-index: 5;
    display: flex;
    gap: 4px;
    pointer-events: auto;
}
.tts-btn-article {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border, #ccc);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.15s;
}
.tts-btn-article:hover {
    background: var(--primary, #3a7afe);
    color: #fff;
    border-color: var(--primary, #3a7afe);
}
.tts-btn-stop {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #ff4444;
    color: #fff;
    border: 1px solid #cc0000;
    cursor: pointer;
    animation: tts-pulse 1s ease-in-out infinite;
}
.tts-btn-stop:hover {
    background: #dd2222;
}
.tts-btn-pause {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #FAAD14;
    color: #fff;
    border: 1px solid #d99200;
    cursor: pointer;
    transition: all 0.15s;
}
.tts-btn-pause:hover {
    background: #e09c00;
}

@keyframes tts-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* ===== 文件拖拽上传遮罩 ===== */
.drop-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 20;
    background: rgba(74, 144, 217, 0.12);
    border: 3px dashed var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dropPulse 1.2s ease-in-out infinite;
}
.drop-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.drop-icon {
    font-size: 48px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}
.drop-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark, #3A7BC8);
    text-align: center;
    line-height: 1.5;
}
.drop-text small {
    font-weight: 400;
    color: var(--text-secondary);
}

@keyframes dropPulse {
    0%, 100% { background-color: rgba(74, 144, 217, 0.08); }
    50% { background-color: rgba(74, 144, 217, 0.18); }
}

/* ===== 上传按钮栏（textarea 底部）===== */
.upload-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px 2px;
}
.upload-label {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: linear-gradient(135deg, #4A90D9, #3A7BC8);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.upload-label:hover {
    background: linear-gradient(135deg, #3A7BC8, #2E6AB5);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(74,144,217,0.3);
}
.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
}
.upload-hint.loading { color: var(--warning, #FAAD14); }
.upload-hint.success { color: var(--success, #52C41A); }
.upload-hint.error { color: var(--accent, #FF6B6B); }

/* ===== 上传进度条 ===== */
.upload-progress-wrap {
    margin: 6px 4px 2px;
    position: relative;
    height: 22px;
    background: var(--bg-secondary, #f0f2f5);
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--border, #e2e8f0);
}
.upload-progress-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, #4A90D9, #52C41A);
    background-size: 200% 100%;
    border-radius: 11px 0 0 11px;
    transition: width 0.4s ease;
    animation: progress-stripes 1.2s linear infinite;
}
@keyframes progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 200% 0; }
}
.upload-progress-text {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #333);
    z-index: 1;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    pointer-events: none;
    white-space: nowrap;
}

/* 拖拽激活时 textarea-wrapper 边框高亮 */
.textarea-wrapper.drag-over {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.25) !important;
}

/* ===== 句子朗读高亮 ===== */
.sentence-highlight {
    transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
.sentence-highlight .sentence-header {
    background-color: #fff9e6 !important;
    border-left: 4px solid #ffaa00 !important;
    box-shadow: 0 2px 8px rgba(255, 170, 0, 0.18) !important;
    border-radius: 0 6px 6px 0 !important;
}

/* ===== 文本框内逐句高亮（朗读时用）===== */
.article-display {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg, #fff);
    color: var(--text, #333);
    font-family: inherit;
    font-size: inherit;
    line-height: 1.8;
    resize: vertical;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.article-display .sent-span {
    border-radius: 3px;
    transition: background-color 0.35s ease, box-shadow 0.35s ease;
    padding: 0 2px;
}
.article-display .sent-span.active-sent {
    background-color: #fff9e6;
    box-shadow: 0 0 0 2px rgba(255, 170, 0, 0.35);
}

/* ===== 首页阅读模式：纯英文 / 中英文 切换条 ===== */
.dm-bar{
    display:flex; align-items:center; gap:10px; margin:0 0 10px;
    padding:8px 10px; border:1px solid var(--border, #e3e3e8); border-radius:8px;
    background:var(--card, #fff);
}
.dm-label{ font-size:12px; color:var(--text-soft, #888); font-weight:600; }
.dm-toggle{ display:inline-flex; margin-left:auto; border:1px solid var(--border, #e3e3e8); border-radius:10px; overflow:hidden; }
.dm-btn{ border:none; background:transparent; color:var(--text-soft, #888); font-size:12px; font-weight:600; padding:5px 11px; cursor:pointer; transition:background .15s, color .15s; }
.dm-btn.on{ background:var(--primary, #ff8c42); color:#fff; }
.dm-btn:active{ background:var(--primary-light, #ffe6d2); }
.dm-btn.on:active{ background:var(--primary, #ff8c42); }

/* 纯英文：每句后「译」按钮 + 译文框 */
.article-display .trans-toggle{
    display:inline-flex; align-items:center; justify-content:center; vertical-align:middle;
    width:18px; height:18px; margin:0 2px; border-radius:5px; background:var(--primary-light, #ffe6d2);
    color:var(--primary, #ff8c42); font-size:11px; cursor:pointer; user-select:none; font-weight:700; line-height:1;
}
.article-display .trans-toggle.on{ background:var(--primary, #ff8c42); color:#fff; }
.article-display .sent-trans{
    display:none; margin:4px 0 10px; padding:8px 12px; font-size:14px; line-height:1.7;
    color:var(--text-soft, #666); background:var(--primary-light, #fff4ec); border-radius:8px; border-left:3px solid var(--primary, #ff8c42);
}
.article-display .sent-trans.show{ display:block; animation:homeFade .2s; }
@keyframes homeFade{ from{opacity:0; transform:translateY(-3px);} to{opacity:1; transform:none;} }

/* 中英文左右对照：左英文（可高亮跟随）右中文，按句一一对应，共用同一滚动 */
.article-display .bi-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0; white-space:normal; }
.article-display .bi-en{ white-space:normal; padding:10px 12px 14px 2px; border-bottom:1px solid var(--border, #e3e3e8); position:relative; }
.article-display .bi-zh{ white-space:normal; padding:10px 2px 14px 16px; border-bottom:1px solid var(--border, #e3e3e8); border-left:1px solid var(--border, #e3e3e8); color:var(--text-soft, #666); font-size:14px; line-height:1.9; text-align:justify; }
.article-display .bi-none{ color:var(--faint-text, #bbb); font-style:italic; }
/* 中英文对照：英文句尾「译」按钮（绝对定位在右上角） */
.article-display .bi-en .trans-toggle{ position:absolute; top:8px; right:4px; margin:0; }
@media (min-width:680px){
    .article-display .bi-en{ padding-right:22px; }
    .article-display .bi-zh{ padding-left:26px; }
}
.sentence-number {
    background: var(--primary);
    color: #1a1a1a;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.sentence-text {
    font-family: 'Georgia', serif;
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
    flex: 1;
}

.sentence-type-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.clause-type-inline {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    margin-right: 8px;
}

/* 整句成分总览（置顶：先整句标成分，再展开短语/从句拆解）*/
.component-overview {
    background: linear-gradient(90deg, rgba(99,102,241,0.07), rgba(99,102,241,0.02));
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 14px 0 18px;
    font-size: 14.5px;
    line-height: 2.1;
    color: var(--text);
    word-break: break-word;
}
.comp-ov-label {
    font-weight: 800;
    color: var(--primary-dark);
    margin-right: 2px;
}
.comp-overview-item {
    display: inline;
}
.comp-ov-role {
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 3px 0 0;
}

/* 成分标签 */
.components-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.component-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.component-tag .role-label {
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
    opacity: 0.8;
}

/* 成分颜色：沿用「长难句分析」配色，仅基本句型核心成分着色，
   文字白色、背景高饱和，其余成分不着色以突出核心句型 */
.comp-subject { background: #e74f40; color: #fff; border-color: #e74f40; }
.comp-predicate { background: #379bdb; color: #fff; border-color: #379bdb; }
.comp-object { background: #2db064; color: #fff; border-color: #2db064; }
.comp-iobj { background: #e84594; color: #fff; border-color: #e84594; }
.comp-predicative { background: #1aa188; color: #fff; border-color: #1aa188; }
.comp-complement { background: #8f46ad; color: #fff; border-color: #8f46ad; }
.comp-appositive { background: #7c3aed; color: #fff; border-color: #7c3aed; }

/* 成分表格 */
.components-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.components-table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
}

.components-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.components-table tr:hover td {
    background: #FAFBFC;
}

/* 句子结构图 */
.diagram-img {
    width: 100%;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.diagram-img:hover {
    transform: scale(1.005);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ===== Lightbox 悬浮图片查看器 ===== */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.80);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 82vh;
    border-radius: 10px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
    object-fit: contain;
    transform-origin: center center;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-img:active {
    cursor: grabbing;
}

.lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 30;
    background: rgba(255,255,255,0.92);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.lightbox-close:hover {
    background: white;
    transform: rotate(90deg);
}

.lightbox-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 10px;
    align-items: center;
}

.lightbox-btn {
    padding: 8px 18px;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.lightbox-btn:hover {
    background: white;
    box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}

.lightbox-zoom-label {
    font-size: 14px;
    font-weight: 700;
    color: white;
    min-width: 48px;
    text-align: center;
}

.lightbox-zoom-input {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.lightbox-zoom-input:focus {
    border-color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.4);
}

/* 隐藏 number input 的上下箭头 */
.lightbox-zoom-input::-webkit-inner-spin-button,
.lightbox-zoom-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 句子译文 */
.sentence-translation {
    background: #F0F7FF;
    border-left: 3px solid var(--primary);
    padding: 8px 16px;
    border-radius: 0 8px 8px 0;
    margin: 8px 0 12px 0;
    font-size: 15px;
    color: #333;
    line-height: 1.7;
}

/* 翻译提示 */
.translation-hint {
    background: #FFFDE7;
    border-left: 3px solid var(--warning);
    padding: 10px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 12px;
    font-size: 14px;
    color: #795548;
}

/* ===== 从句内部结构分析 ===== */
.clause-analysis-section {
    margin-top: 16px;
    padding: 14px 16px;
    background: #F3E8FF;
    border-radius: 8px;
    border-left: 3px solid #9C27B0;
}

.clause-analysis-title {
    font-size: 14px;
    font-weight: 700;
    color: #6A1B9A;
    margin-bottom: 10px;
}

.clause-detail-card {
    background: rgba(255,255,255,0.7);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid #E1BEE7;
}

.clause-detail-card:last-child {
    margin-bottom: 0;
}

.clause-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.clause-type-tag {
    background: #9C27B0;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.clause-text {
    font-family: 'Georgia', serif;
    font-size: 14px;
    color: var(--text);
    font-style: italic;
}

.clause-detail-row {
    display: flex;
    gap: 6px;
    font-size: 13px;
    line-height: 1.8;
    color: #444;
    flex-wrap: wrap;          /* 允许长内容换行 */
}

.clause-detail-label {
    font-weight: 700;
    color: #6A1B9A;
    white-space: nowrap;
    min-width: 70px;
}

.clause-detail-value {
    color: #333;
    word-break: break-word;   /* 长文本自动换行防重叠 */
    flex: 1;                  /* 占据剩余空间 */
    min-width: 0;             /* 允许flex子项收缩 */
}

.clause-sep-note {
    background: #FFF7E6;
    border-left: 3px solid #FA8C16;
    border-radius: 4px;
    padding: 6px 8px;
    margin: 4px 0;
}

.clause-sep-note .clause-detail-label {
    color: #D46B08;
    align-self: flex-start;
}

.clause-sep-note .clause-detail-value {
    color: #874D00;
    font-weight: 600;
}

.clause-omitted {
    color: #E65100;
    font-weight: 600;
}

/* ===== 名词短语结构分析 ===== */
.np-analysis-section {
    margin-top: 12px;
    padding: 14px 16px;
    background: #E0F2F1;
    border-radius: 8px;
    border-left: 3px solid #00897B;
}

.np-analysis-title {
    font-size: 14px;
    font-weight: 700;
    color: #00695C;
    margin-bottom: 10px;
}

.np-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed #B2DFDB;
    font-size: 13px;
}

.np-item:last-child {
    border-bottom: none;
}

.np-pattern {
    background: #00897B;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.np-breakdown {
    color: #444;
}

.np-text {
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== 短语结构分析 ===== */
.ps-analysis-section {
    margin-top: 12px;
    padding: 14px 16px;
    background: #FFF3E0;
    border-radius: 8px;
    border-left: 3px solid #FB8C00;
}

.ps-analysis-title {
    font-size: 14px;
    font-weight: 700;
    color: #E65100;
    margin-bottom: 10px;
}

.ps-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed #FFE0B2;
    font-size: 13px;
}

.ps-item:last-child {
    border-bottom: none;
}

/* ===== 中考核心动词短语（本地数据库） ===== */
.core-verb-phrases {
    margin-top: 12px;
    padding: 14px 16px;
    background: #EAF7EE;
    border-radius: 8px;
    border-left: 3px solid #2E9E5B;
}
.cvp-title {
    font-size: 14px;
    font-weight: 700;
    color: #1B7A3F;
    margin-bottom: 10px;
}
.cvp-item {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 6px 0;
    border-bottom: 1px dashed #BFE6CB;
    font-size: 13px;
    line-height: 1.5;
}
.cvp-item:last-child {
    border-bottom: none;
}
.cvp-cat {
    background: #D6F0DE;
    color: #1B7A3F;
    border: 1px solid #A9DCC0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
}
.cvp-matched {
    background: #FFF8E1;
    color: #8A5A00;
    border: 1px solid #F0DCA0;
    padding: 1px 7px;
    border-radius: 6px;
    font-weight: 600;
}
.cvp-phrase {
    color: #1565C0;
    font-weight: 600;
}
.cvp-equal {
    color: #666;
    margin: 0 2px;
}
.cvp-meaning {
    color: #333;
}
.cvp-detail {
    flex-basis: 100%;
    margin-top: 4px;
    padding-left: 2px;
}
.cvp-ex {
    font-size: 12px;
    line-height: 1.5;
    color: #555;
    margin: 2px 0;
}
.cvp-ex .cvp-equal, .cvp-detail .cvp-equal { color: #999; }
.cvp-analysis-section {
    margin-top: 12px;
    padding: 14px 16px;
    background: #EAF7EE;
    border-radius: 8px;
    border-left: 3px solid #2E9E5B;
}
.cvp-analysis-title {
    font-size: 14px;
    font-weight: 700;
    color: #1B7A3F;
    margin-bottom: 10px;
}

/* 思维导图中核心动词短语分支配色 */
.mm-color-cvp { background: #EAF7EE; border-color: #BFE6CB; }
.mm-color-cvp .mm-role { color: #1B7A3F; }

.ps-type {
    background: #E8F0FE;
    color: #1A73E8;
    border: 1px solid #C6DAFB;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ps-pattern {
    background: #FB8C00;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ps-breakdown {
    color: #444;
}

.ps-text {
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== 思维导图树 ===== */
.mindmap-container {
    margin: 16px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #eef2f7);
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.mindmap-root {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4A90D9, #3A7BC8);
    color: white;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(74,144,217,0.3);
    margin-bottom: 4px;
}

.mindmap-root .mm-badge {
    background: rgba(255,255,255,0.25);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.mm-branches {
    padding-left: 16px;
    border-left: 3px solid #CCD3DA;
    margin-left: 24px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.mm-branch {
    position: relative;
    padding: 4px 0 4px 20px;
}

.mm-branch::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 16px;
    width: 18px;
    height: 2px;
    background: #CCD3DA;
}

.mm-node {
    display: inline-flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: all 0.2s;
    max-width: 92%;
}

.mm-node:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transform: translateX(2px);
}

.mm-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #E0E6ED;
    color: #555;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-top: 2px;
    user-select: none;
}

.mm-toggle:hover {
    background: var(--primary);
    color: white;
}

.mm-icon {
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1.5;
}

.mm-role {
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1.5;
}

.mm-text {
    font-family: 'Georgia', serif;
    color: var(--text);
    word-break: break-word;
    line-height: 1.5;
}

.mm-detail {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
    line-height: 1.5;
}

.mm-children {
    padding-left: 16px;
    border-left: 2px dashed #CCD3DA;
    margin-left: 16px;
    margin-top: 4px;
    transition: all 0.3s;
}

.mm-children.collapsed {
    display: none;
}

/* 思维导图节点颜色 */
.mm-color-subject { background: #FFEBEE; border-color: #FFCDD2; }
.mm-color-subject .mm-role { color: #C62828; }

.mm-color-predicate { background: #E0F7FA; border-color: #B2EBF2; }
.mm-color-predicate .mm-role { color: #00838F; }

.mm-color-object { background: #E3F2FD; border-color: #BBDEFB; }
.mm-color-object .mm-role { color: #1565C0; }

.mm-color-predicative { background: #E8F5E9; border-color: #C8E6C9; }
.mm-color-predicative .mm-role { color: #2E7D32; }

.mm-color-attributive { background: #FFF8E1; border-color: #FFE082; }
.mm-color-attributive .mm-role { color: #F57F17; }

.mm-color-adverbial { background: #F3E5F5; border-color: #E1BEE7; }
.mm-color-adverbial .mm-role { color: #7B1FA2; }

.mm-color-complement { background: #FFFDE7; border-color: #FFF59D; }
.mm-color-complement .mm-role { color: #F9A825; }

.mm-color-appositive { background: #FFF3E0; border-color: #FFCC80; }
.mm-color-appositive .mm-role { color: #E65100; }

.mm-color-clause { background: #F3E8FF; border-color: #D1B3F0; }
.mm-color-clause .mm-role { color: #6A1B9A; }

.mm-color-clause-detail { background: #FAFAFA; border-color: #E8E8E8; }
.mm-color-clause-detail .mm-role { color: #666; }

.mm-color-np { background: #E0F2F1; border-color: #B2DFDB; }
.mm-color-np .mm-role { color: #00695C; }

.mm-color-ps { background: #FFF3E0; border-color: #FFE0B2; }
.mm-color-ps .mm-role { color: #E65100; }

.mm-color-info { background: #E3F2FD; border-color: #BBDEFB; }
.mm-color-info .mm-role { color: #1565C0; }

.mm-color-hint { background: #FFFDE7; border-color: #FFF59D; }
.mm-color-hint .mm-role { color: #F57F17; }

.mm-color-warning { background: #FFEBEE; border-color: #FFCDD2; }
.mm-color-warning .mm-role { color: #C62828; }

.mm-color-conjunction { background: #ECEFF1; border-color: #CFD8DC; }
.mm-color-conjunction .mm-role { color: #546E7A; }

.mm-color-other { background: #F5F5F5; border-color: #E0E0E0; }
.mm-color-other .mm-role { color: #757575; }

/* 视图切换按钮 */
.sentence-view-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.sentence-view-bar .view-toggle {
    margin-bottom: 0;
}

.btn-export-fourline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border: 1px solid var(--primary, #6366f1);
    background: var(--primary, #6366f1);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-export-fourline:hover {
    background: var(--primary-dark, #4f46e5);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.view-toggle {
    display: inline-flex;
    gap: 4px;
    background: var(--border);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 16px;
}

.view-toggle-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle-btn:hover {
    color: var(--primary);
}

.view-toggle-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== 四行分析法（原文 / 词性 / 句子成分 / 从句分析）===== */
/* 新版：每个词一个圆角色块（chip），整句流式排列、自动换行，效果同长难句分析。 */
.four-line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    margin: 10px 0 4px;
    padding: 14px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    line-height: 1.35;
    max-width: 100%;
}
.fl-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    max-width: 160px;
    padding: 5px 8px;
    border-radius: 8px;
    background: #eceff1;
    color: #334155;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    text-align: center;
    word-break: break-word;
    transition: transform 0.15s, box-shadow 0.15s;
}
.fl-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.flc-word { font-size: 14px; font-weight: 700; }
.flc-pos  { font-size: 10px; opacity: 0.85; margin-top: 1px; }
.flc-comp { font-size: 11px; font-weight: 700; margin-top: 2px; }
.flc-clause { font-size: 10px; opacity: 0.9; margin-top: 1px; }

/* 成分着色：沿用「长难句分析」高饱和配色（主语红/谓语蓝/宾语绿/间宾粉/
   表语青绿/宾补紫/同位语紫罗兰），其余成分不着色以突出核心句型 */
.fl-chip.comp-subject { background: #e74f40; color: #fff; border: 1px solid #e74f40; }
.fl-chip.comp-predicate { background: #379bdb; color: #fff; border: 1px solid #379bdb; }
.fl-chip.comp-object { background: #2db064; color: #fff; border: 1px solid #2db064; }
.fl-chip.comp-iobj { background: #e84594; color: #fff; border: 1px solid #e84594; }
.fl-chip.comp-predicative { background: #1aa188; color: #fff; border: 1px solid #1aa188; }
.fl-chip.comp-complement { background: #8f46ad; color: #fff; border: 1px solid #8f46ad; }
.fl-chip.comp-appositive { background: #7c3aed; color: #fff; border: 1px solid #7c3aed; }
/* 词性配色：情态动词（青绿）/ 助动词（棕褐），与成分着色并列、优先级更高 */
.fl-chip.pos-modal { background: #e0f7f5; color: #0d7a6e; border: 1px solid #b3eae4; }
.fl-chip.pos-aux { background: #f6efe2; color: #92600a; border: 1px solid #ecdcc0; }

/* ===== 单词分析卡片（竖向设计）===== */
.word-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 22px 8px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
    transition: transform 0.2s;
}

.word-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.word-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 2px solid var(--primary-light);
}

.word-head-meaning {
    flex: 1 1 260px;
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.word-title {
    font-size: 23px;
    font-weight: 700;
    color: var(--text);
}

.word-lemma {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    background: #FFF3E0;
    border: 1px solid #FFE0B2;
    padding: 2px 9px;
    border-radius: 10px;
    white-space: nowrap;
}

.word-pos {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.wd-rows {
    display: flex;
    flex-direction: column;
}

.wd-row {
    padding: 11px 0;
    border-bottom: 1px dashed var(--border);
}

.wd-row:last-child {
    border-bottom: none;
}

.wd-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 2px 11px;
    border-radius: 10px;
    margin-bottom: 6px;
}

.wd-value {
    font-size: 14.5px;
    color: var(--text);
    line-height: 1.65;
    word-break: break-word;
}
/* 英文释义（本地双语词库：ECDICT/WordNet 英文源）*/
.wd-def {
    white-space: pre-line;
    color: var(--text);
    line-height: 1.6;
    background: var(--primary-light, #eef2ff);
    border-left: 3px solid var(--primary, #4f46e5);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
}

.wd-user-note {
    white-space: pre-line;
    color: var(--text);
    line-height: 1.5;
    background: var(--bg-warm, #fffbeb);
    border-left: 3px solid #d97706;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
}

/* 词形转换 chips（广东高考选词填空备考） */
.word-forms {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.form-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 4px 9px;
    font-size: 13px;
    line-height: 1.4;
}
.form-label {
    font-size: 11px;
    font-weight: 700;
    color: #1a1a1a;
    background: #e8e8e8;
    border-radius: 7px;
    padding: 1px 7px;
    white-space: nowrap;
}
.form-word {
    font-weight: 700;
    color: var(--text);
}
.form-pos {
    font-size: 11.5px;
    color: var(--primary-dark);
    background: var(--primary-light);
    border-radius: 6px;
    padding: 0 6px;
    white-space: nowrap;
}
.form-meaning {
    color: var(--text-secondary);
    font-size: 12.5px;
}

.wd-value-text {
    color: var(--text);
}

.word-phonetic {
    font-family: 'Georgia', serif;
    color: var(--primary);
    font-size: 15px;
}

.word-syllables {
    color: var(--text);
    font-size: 14.5px;
    letter-spacing: 0.5px;
}

/* 音节中的元音字母/组合标红，突出拼读结构 */
.syl-vowel {
    color: #e5392f;
    font-weight: 700;
}

.word-collocations {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.collocation-chip {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.word-examples-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.word-example {
    padding: 8px 12px;
    background: #F5F7FA;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

/* ===== 多源助记 ===== */
.mnemonic-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.mnemonic-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    background: var(--primary-light, #EEF3FF);
    border-left: 3px solid var(--primary, #3B6BD6);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text, #222);
}
.mnemonic-src {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--primary-dark, #2A4FA0);
    border: 1px solid var(--primary, #3B6BD6);
    border-radius: 10px;
    padding: 1px 7px;
    margin-top: 1px;
    white-space: nowrap;
}
.mnemonic-text {
    flex: 1 1 auto;
}

/* ===== 短语分析（竖向设计）===== */
.phrase-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 22px 8px;
    margin-bottom: 14px;
    border-left: 4px solid var(--accent);
}

.phrase-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 2px solid #FFE3E3;
}

.phrase-head-meaning {
    flex: 1 1 260px;
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.phrase-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.phrase-block {
    padding: 11px 0;
    border-bottom: 1px dashed var(--border);
}

.phrase-block:last-child {
    border-bottom: none;
}

.phrase-block-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #C0392B;
    background: #FFEAEA;
    padding: 2px 11px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.phrase-words {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phrase-word {
    background: #F5F7FA;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.phrase-word-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.pw-word {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.pw-phonetic {
    font-family: 'Georgia', serif;
    color: var(--primary);
    font-size: 13px;
}

.pw-meaning {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.phrase-word-root {
    font-size: 12px;
    color: #2E7D32;
    margin-top: 4px;
    background: #EAF4EA;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
}

.phrase-roots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.root-item {
    background: #EAF4EA;
    border: 1px solid #C9E2C9;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    color: #2E7D32;
}

.root-item b {
    color: #1B5E20;
}

.mnemonic-group {
    margin-bottom: 8px;
}

.mnemonic-group:last-child {
    margin-bottom: 0;
}

.mnemonic-group-word {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark, #2A4FA0);
    margin-bottom: 4px;
}

/* ===== 练习题 ===== */
.exercise-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.exercise-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--primary-dark);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.exercise-question {
    font-size: 15px;
    margin-bottom: 10px;
    font-weight: 500;
}

.exercise-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.exercise-option {
    padding: 8px 16px;
    background: #F5F7FA;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.exercise-option:hover {
    background: var(--primary-light);
}

.exercise-option.correct {
    background: #E8F5E9;
    color: var(--success);
    font-weight: 600;
}

.exercise-option.wrong {
    background: #FFEBEE;
    color: var(--accent);
}

.exercise-answer {
    display: none;
    margin-top: 10px;
    padding: 10px 14px;
    background: #F0F9EB;
    border-radius: 6px;
    font-size: 14px;
}

.exercise-answer.show {
    display: block;
}

.exercise-answer .answer-label {
    font-weight: 700;
    color: var(--success);
}

.exercise-answer .explanation {
    color: var(--text-secondary);
    margin-top: 4px;
}

.exercise-answer .grammar-point {
    font-weight: 600;
    color: #8E44AD;
    margin-left: 10px;
}

.show-answer-btn {
    margin-top: 8px;
    padding: 6px 18px;
    background: linear-gradient(135deg, #9C27B0, #BA68C8);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: white;
    transition: all 0.2s;
}

.show-answer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(156,39,176,0.3);
}

/* ===== 练习题升级样式（六大题型） ===== */

/* 每道小题之间的分隔 */
.exercise-q {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border, #E0E0E0);
}
.exercise-q:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* (三) 连词成句 —— 乱序词块 */
.word-order-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}
.order-token {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-light, #E3F2FD);
    color: var(--primary-dark, #2A4FA0);
    border: 1px solid var(--primary, #4A90D9);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

/* (四) 翻译题 —— 提示与方向标签 */
.exercise-hint {
    font-size: 13px;
    color: var(--text-secondary, #666);
    background: #F5F7FA;
    padding: 6px 12px;
    border-radius: 6px;
    margin: 6px 0 10px;
}
.trans-tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--primary, #4A90D9);
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
    vertical-align: middle;
}

/* (五)(六) 短文 —— 篇章与空格标记 */
.passage-text {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #E0E0E0);
    border-left: 4px solid var(--primary, #4A90D9);
    border-radius: var(--radius, 8px);
    padding: 16px 20px;
    margin: 12px 0 18px;
    line-height: 1.9;
    font-size: 15px;
    color: var(--text, #333);
}
.blank-marker {
    display: inline-block;
    min-width: 22px;
    padding: 0 6px;
    margin: 0 2px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-dark, #2A4FA0);
    background: #FFF3CD;
    border: 1px dashed var(--primary, #4A90D9);
    border-radius: 4px;
}
.pq-head {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark, #2A4FA0);
    margin-bottom: 8px;
}
.blank-ctx {
    font-size: 13px;
    color: var(--text-secondary, #666);
    background: #F5F7FA;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* (六) 短文填空 —— 词库 */
.word-bank {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 12px 16px;
    background: #F5F7FA;
    border-radius: var(--radius, 8px);
}
.bank-title {
    font-weight: 700;
    color: var(--primary-dark, #2A4FA0);
    margin-right: 4px;
}
.bank-chip {
    display: inline-block;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid var(--primary, #4A90D9);
    border-radius: 16px;
    font-size: 14px;
    color: var(--primary-dark, #2A4FA0);
    font-weight: 600;
}

/* 练习题导语（对齐中高考模版） */
.exercise-intro {
    background: linear-gradient(135deg, #E3F2FD, #F3E8FF);
    border: 1px solid var(--border, #E0E0E0);
    border-left: 4px solid var(--primary, #4A90D9);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text, #2C3E50);
}

/* (六) 短文填空 —— 方框词库 */
.word-bank-box {
    background: #F8FAFD;
    border: 2px dashed var(--primary, #4A90D9);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 12px 0 18px;
}
.word-bank-box .bank-title {
    font-weight: 700;
    color: var(--primary-dark, #2A4FA0);
    margin-bottom: 10px;
    font-size: 14px;
}
.word-bank-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.word-bank-box .bank-chip {
    background: #fff;
    border: 1px solid var(--primary, #4A90D9);
    border-radius: 16px;
    padding: 5px 14px;
    font-size: 14px;
    color: var(--primary-dark, #2A4FA0);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(74,144,217,0.12);
}

/* (六) 短文填空 —— 每空输入框 + 核对 */
.blank-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 4px;
    flex-wrap: wrap;
}
.blank-input {
    width: 220px;
    padding: 7px 12px;
    border: 2px solid var(--border, #E0E0E0);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Georgia', serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.blank-input:focus {
    outline: none;
    border-color: var(--primary, #4A90D9);
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}
.blank-input.filled-correct {
    border-color: var(--success, #52C41A);
    background: #F6FFED;
}
.check-blank-btn {
    padding: 7px 18px;
    background: linear-gradient(135deg, #4A90D9, #3A7BC8);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.check-blank-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(74,144,217,0.3);
}
.blank-feedback {
    font-size: 13px;
    font-weight: 600;
}
.blank-feedback.correct {
    color: var(--success, #52C41A);
}
.blank-feedback.wrong {
    color: var(--accent, #FF6B6B);
}

/* ===== 背景图片遮罩层 ===== */
.bg-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.has-bg-image {
    background: transparent;
}

body.has-bg-image .input-section,
body.has-bg-image .sentence-card,
body.has-bg-image .word-card,
body.has-bg-image .phrase-card,
body.has-bg-image .exercise-card,
body.has-bg-image .tab-nav {
    backdrop-filter: blur(2px);
}

/* ===== 错误提示 ===== */
.error-message {
    background: #FFEBEE;
    color: #C62828;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
}

/* ===== 导出按钮固定栏 ===== */
.export-bar {
    position: sticky;
    bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    margin-top: 24px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .word-grid {
        grid-template-columns: 1fr;
    }
    .tab-nav {
        flex-direction: column;
    }
    .navbar {
        padding: 12px 16px;
    }
    .container {
        padding: 16px 12px;
    }
}

/* ===== 内容类型切换（文章 / 对话）===== */
.input-options {
    margin: 8px 0 4px;
}
.content-type-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.group-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}
.content-type-btn {
    padding: 6px 16px;
    border: 2px solid var(--border);
    background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
    color: #334155;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s ease;
}
.content-type-btn:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: var(--primary);
}
.content-type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 3px 10px rgba(74,144,217,0.35);
}

/* ===== 整体分析卡片 ===== */
.overall-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.overall-item {
    margin-bottom: 14px;
    line-height: 1.7;
}
.overall-item:last-child {
    margin-bottom: 0;
}
.overall-label {
    display: inline-block;
    min-width: 88px;
    font-weight: 700;
    color: #1A73E8;
    font-size: 15px;
}
.overall-value {
    font-size: 15px;
    color: var(--text);
}
.overall-en {
    margin-top: 4px;
    font-size: 12.5px;
    color: #888;
    font-style: italic;
    line-height: 1.6;
}
.overall-sub {
    margin: 12px 0 6px;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 14px;
}
.overall-paras, .overall-qa {
    margin: 6px 0 0;
    padding-left: 22px;
}
.overall-paras li, .overall-qa li {
    margin-bottom: 8px;
    line-height: 1.6;
}
.structure-parts-list {
    margin: 6px 0 0;
    padding-left: 22px;
}
.structure-parts-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}
.structure-parts-list b {
    color: var(--primary, #4A90D9);
}
/* 结构部分下的段落子列表 */
.structure-part-paras {
    margin: 4px 0 0;
    padding-left: 20px;
    list-style-type: circle;
}
.structure-part-paras li {
    margin-bottom: 4px;
    line-height: 1.5;
    font-size: 13.5px;
    color: #555;
}
.overall-desc {
    margin-top: 4px;
    font-size: 13.5px;
    color: #555;
}
.qa-q {
    font-weight: 600;
    color: #2C3E50;
}
.qa-a {
    color: #555;
    margin-top: 2px;
}

/* ===== 表格视图：横条结构图（大字体）===== */
.bar-diagram {
    margin: 16px 0;
    padding: 20px 22px;
    background: linear-gradient(135deg, #fafbfc, #f0f3f7);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.bar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.bar-label {
    min-width: 64px;
    font-size: 14px;           /* 与bar-text一致 */
    font-weight: 700;
    color: #333;
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    position: relative;
    min-height: 40px;
    background: #eceef1;
    border-radius: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    min-width: 70px;
    opacity: 0.88;
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    font-size: 14px;          /* 小四 ≈ 12pt，缩小后仍清晰 */
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 600;
    color: #1a1a1a;
    white-space: normal;       /* 允许自动换行 */
    word-break: break-word;    /* 长单词自动换行 */
    z-index: 1;
    text-shadow: 0 0 6px rgba(255,255,255,0.7);
    max-width: calc(100% - 28px); /* 不溢出轨道 */
    line-height: 1.3;
}

.bar-hint {
    margin-top: 12px;
    padding: 10px 16px;
    background: #FFFBEB;
    border-left: 4px solid #F59E0B;
    border-radius: 0 8px 8px 0;
    font-size: 15px;
    color: #795548;
}

/* ===== AI 辅导助手面板 ===== */
.agent-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 900;
    padding: 12px 24px;
    background: #4A90D9;
    color: #fff;
    border: none;
    border-radius: 28px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}
.agent-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.agent-fab.hidden {
    display: none;
}
.agent-panel {
    position: fixed;
    right: -420px;
    top: 0;
    bottom: 0;
    width: 400px;
    z-index: 1000;
    background: #f5f7fa;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}
.agent-panel.active {
    right: 0;
}
.agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #4A90D9;
    color: #fff;
    flex-shrink: 0;
}
.agent-title {
    font-size: 15px;
    font-weight: 500;
}
.agent-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.agent-close-btn:hover {
    background: rgba(255,255,255,0.2);
}
.agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.agent-msg {
    max-width: 85%;
    animation: agentFadeIn 0.3s ease;
}
@keyframes agentFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.agent-msg-user {
    align-self: flex-end;
}
.agent-msg-bot {
    align-self: flex-start;
}
.agent-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}
.agent-msg-user .agent-msg-content {
    background: #4A90D9;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.agent-msg-bot .agent-msg-content {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}
.agent-thinking .agent-msg-content {
    display: flex;
    gap: 4px;
    align-items: center;
}
.agent-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aaa;
    animation: agentBounce 1.4s infinite ease-in-out;
}
.agent-dot:nth-child(2) { animation-delay: 0.2s; }
.agent-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes agentBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
.agent-input-area {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    background: #fff;
}
.agent-input-area textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 13px;
    resize: none;
    font-family: inherit;
    outline: none;
    background: #fff;
    color: #333;
}
.agent-input-area textarea:focus {
    border-color: #4A90D9;
}
.agent-input-area textarea:disabled {
    opacity: 0.6;
}
.agent-send-btn {
    padding: 8px 20px;
    background: #4A90D9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}
.agent-send-btn:hover {
    opacity: 0.9;
}
@media (max-width: 600px) {
    .agent-panel {
        width: 100%;
        right: -100%;
    }
    .agent-panel.active {
        right: 0;
    }
}

/* ===== 真题风格：语法选择 & 短文填空 ===== */

/* 空位标记 —— 对齐真题 ____ 31 格式 */
.blank-marker {
    display: inline-block;
    min-width: 48px;
    padding: 0 4px;
    margin: 0 1px;
    text-align: center;
    font-weight: 700;
    color: #C0392B;              /* 真题红色编号 */
    background: transparent;
    border-bottom: 2px solid #333;
    border-radius: 0;
    letter-spacing: 0.5px;
}
.blank-marker b {
    color: #C0392B;
    font-size: 0.9em;
}

/* 导语块 */
.exercise-intro {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
    padding: 14px 18px;
    background: #FAFCFF;
    border-left: 4px solid var(--primary, #4A90D9);
    border-radius: 0 8px 8px 0;
    margin-bottom: 16px;
}

/* ---- 语法选择（对齐图1）---- */
.pc-card {
    margin-top: 20px;
}
.pc-passage {
    font-size: 15px !important;
    line-height: 2 !important;
    padding: 20px 24px !important;
    text-align: justify;
}
.pc-options-block {
    margin-top: 20px;
    overflow-x: auto;
}
.pc-options-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.pc-options-table tr {
    border-bottom: 1px solid var(--border, #E0E6ED);
}
.pc-options-table tr:last-child {
    border-bottom: none;
}
.pc-options-table td {
    padding: 10px 16px;
}
.pc-num {
    font-weight: 700;
    color: var(--text, #2C3E50);
    white-space: nowrap;
    min-width: 36px;
}
.pc-opt {
    cursor: pointer;
    padding: 6px 12px;
    margin: 0 4px;
    border-radius: 6px;
    transition: background 0.15s;
    white-space: nowrap;
}
.pc-opt:hover {
    background: var(--primary-light, #E8F1FB);
}
.pc-opt[data-correct="true"] {
    font-weight: 700;
    color: var(--success, #52C41A);
}
.pc-answer-row {
    margin-top: 6px;
    padding: 8px 14px;
    background: #F9FFF9;
    border-radius: 6px;
    font-size: 13px;
}

/* ---- 短文填空（对齐图2）---- */
.pf-card {
    margin-top: 20px;
}
.pf-passage {
    font-size: 15px !important;
    line-height: 2.2 !important;
    padding: 20px 24px !important;
    text-align: justify;
}

/* 方框词库表格（对齐真题图2的方框） */
.word-box-table-wrap {
    display: flex;
    justify-content: center;
    margin: 16px 0 8px 0;
}
.word-box-table {
    border: 2px solid #333;
    border-collapse: collapse;
    background: #fff;
    font-size: 15px;
    letter-spacing: 2px;
}
.word-box-table td {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 1px solid #333;
    font-weight: 600;
    color: var(--text, #2C3E50);
}
.word-box-table td:empty {
    border-color: transparent;
}

/* 填空题行 */
.pf-q-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #FBFDFB;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #E8F0E8;
}
.pq-num {
    font-weight: 700;
    color: var(--primary-dark, #2A4FA0);
    min-width: 32px;
}
.pq-cat {
    font-size: 13px;
    color: var(--text-secondary, #7F8C8D);
}

/* 填空输入框 */
.blank-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.blank-input {
    width: 160px;
    padding: 6px 12px;
    border: 1.5px solid var(--border, #E0E6ED);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.blank-input:focus {
    border-color: var(--primary, #4A90D9);
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}
.filled-correct {
    border-color: var(--success, #52C41A) !important;
    background: #F6FFED;
}
.check-blank-btn {
    padding: 6px 16px;
    background: var(--primary, #4A90D9);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.check-blank-btn:hover { opacity: 0.88; }
.blank-feedback {
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
}
.blank-feedback.correct { color: var(--success, #52C41A); }
.blank-feedback.wrong   { color: var(--accent, #FF6B6B); }

/* 响应式 */
@media (max-width: 650px) {
    .word-box-table td { width: 60px; font-size: 13px; }
    .pc-options-table { font-size: 13px; }
    .pc-opt { padding: 4px 8px; }
    .blank-input { width: 120px; }
    .pc-options-inline { flex: 1 1 100%; min-width: 0; }
    .pc-func-row { margin-left: 0; width: 100%; justify-content: flex-end; }
    .gc-options-row { flex-direction: column; align-items: stretch; }
    .gc-opt-btn { width: 100%; text-align: left; }
}

/* ===== 新增：统一交互作答模式样式 ===== */

/* (一) 语法单项选择 — A/B/C 选项按钮 */
.gc-options-row {
    display: flex;
    gap: 10px;
    margin: 8px 0 6px;
    flex-wrap: wrap;
}
.gc-opt-btn {
    display: inline-block;
    padding: 7px 18px;
    background: #F5F7FA;
    border: 2px solid var(--border, #E0E0E0);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text, #2C3E50);
    cursor: pointer;
    transition: all 0.2s;
}
.gc-opt-btn:hover {
    border-color: var(--primary, #4A90D9);
    background: var(--primary-light, #E8F1FB);
}
.gc-opt-btn.selected {
    border-color: var(--primary, #4A90D9);
    background: var(--primary-light, #E8F1FB);
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

/* (五) 短文语法选择 — 逐题交互行（对齐短文填空风格） */
.pc-q-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border, #E0E0E0);
    flex-wrap: wrap;
}
.pc-q-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.pc-func-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}
.pc-options-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 240px;
    min-width: 200px;
}
.pc-opt-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 14px;
    background: #F5F7FA;
    border: 2px solid var(--border, #E0E0E0);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text, #2C3E50);
    cursor: pointer;
    transition: all 0.2s;
}
.pc-opt-btn:hover {
    border-color: var(--primary, #4A90D9);
    background: var(--primary-light, #E8F1FB);
}
.pc-opt-btn.selected {
    border-color: var(--primary, #4A90D9);
    background: var(--primary-light, #E8F1FB);
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

/* (六) 短文填空 — 题号行 */
.pf-q-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border, #E0E0E0);
    flex-wrap: wrap;
}
.pf-q-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.pq-num {
    font-size: 15px;
    font-weight: 700;
    color: var(--text, #2C3E50);
    min-width: 24px;
}
.pq-cat {
    font-size: 13px;
    color: var(--text-secondary, #7F8C8D);
    background: #F5F7FA;
    padding: 2px 10px;
    border-radius: 12px;
}

/* 方框词库表格 */
.word-box-table-wrap {
    margin: 12px 0 16px;
}
.word-box-table {
    width: auto;
    border-collapse: collapse;
    margin: 0 auto;
}
.word-box-table td {
    width: 130px;
    min-width: 90px;
    height: 42px;
    border: 2px solid var(--primary, #4A90D9);
    border-radius: 6px;
    text-align: center;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--primary-dark, #2A4FA0);
    padding: 6px 10px;
    background: #FAFDFF;
}

/* 再来一题按钮 */
.retry-area {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #E0E0E0);
}
.retry-btn {
    padding: 10px 28px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 3px 12px rgba(255,152,0,0.3);
}
.retry-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 20px rgba(255,152,0,0.45);
}

/* ===== 导航栏登录态 ===== */
.auth-area {
    display: flex;
    align-items: center;
    gap: 10px;
}
.auth-link {
    padding: 7px 16px;
    border: 1.5px solid var(--primary, #4A90D9);
    color: var(--primary, #4A90D9);
    background: transparent;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.auth-link:hover {
    background: var(--primary, #4A90D9);
    color: #fff;
}
.auth-user {
    font-size: 13px;
    color: var(--text, #2C3E50);
}

/* ===== 登录 / 注册页 ===== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #F1F3F6);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}
.auth-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--text, #2C3E50);
    margin: 0 0 20px;
}
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.auth-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: #F1F3F6;
    color: var(--text-secondary, #8E9AA4);
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-tab.active {
    background: var(--primary, #4A90D9);
    color: #fff;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-form.hidden { display: none; }
/* 通用隐藏类：用于找回密码的“答案/新密码/确认”等子字段 */
.hidden { display: none !important; }
.auth-question {
    font-size: 14px;
    color: var(--text, #333);
    background: var(--bg-soft, #F5F7FA);
    border-radius: 8px;
    padding: 10px 12px;
    line-height: 1.5;
}
.auth-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border, #E0E6ED);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.auth-input:focus {
    border-color: var(--primary, #4A90D9);
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}
.auth-submit {
    padding: 12px 0;
    background: var(--primary, #4A90D9);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.auth-submit:hover { opacity: 0.9; }
.auth-msg {
    font-size: 13px;
    min-height: 18px;
    color: var(--text-secondary, #8E9AA4);
}
.auth-msg.err { color: var(--accent, #FF6B6B); }
.auth-tip {
    font-size: 12px;
    line-height: 1.5;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
}
/* 注册验证码：输入框 + 发送按钮 一行 */
.auth-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.auth-row .auth-input { flex: 1 1 auto; }
.auth-code-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0 14px;
    height: 46px;
    border: none;
    border-radius: 10px;
    background: var(--primary, #4A90D9);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.auth-code-btn:hover { opacity: 0.9; }
.auth-code-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}
.auth-back {
    text-align: center;
    font-size: 13px;
    color: var(--primary, #4A90D9);
    text-decoration: none;
}
.auth-back:hover { text-decoration: underline; }
.retry-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* (五) 句子成分分析 */
.sc-card { }

.sc-source {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 10px 14px;
    border-radius: 6px;
    margin: 4px 0 16px;
    line-height: 1.6;
}

.sc-chunks {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    margin: 8px 0;
}

.sc-chunk {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    padding: 0;
    border: none;
    background: none;
}

.sc-chunk.sc-correct {
    border-color: var(--success);
    background: rgba(82, 196, 26, 0.08);
}

.sc-chunk.sc-wrong {
    border-color: var(--accent);
    background: rgba(255, 107, 107, 0.08);
}

.sc-chunk-text {
    display: inline;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    vertical-align: middle;
}

/* 句子成分分析 —— 语块前方的填空输入框 */
.sc-blank-input {
    width: auto;
    min-width: 2ch;
    height: 28px;
    text-align: center;
    font-size: 14px;
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 0 4px;
    background: #fff;
    color: #333;
    outline: none;
}
.sc-blank-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}
.sc-blank-input.sc-input-correct {
    border-color: var(--success);
    color: var(--success);
    background: rgba(82, 196, 26, 0.06);
}
.sc-blank-input.sc-input-wrong {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 107, 107, 0.06);
}

/* 句子成分分析 —— 参考选项行（A.主语 B.谓语 ...） */
.sc-options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 10px 4px;
    margin: 8px 0 6px;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
}
.sc-opt-ref {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* (二) 括号内单词：题干中的横线 + 所给词提示 */
.fb-blank-rule {
    display: inline-block;
    width: 80px;
    height: 1px;
    vertical-align: middle;
    border-bottom: 2px solid var(--text);
    margin: 0 4px;
}
.fb-given-word {
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 600;
}

/* 重做按钮（连词成句 / 翻译题，位于「核对」之后） */
.redo-btn {
    padding: 7px 16px;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
    white-space: nowrap;
}
.redo-btn:hover {
    background: var(--primary-light);
}
.redo-btn:active {
    transform: translateY(1px);
}

/* 管理后台 */
.admin-block { margin-bottom:22px; padding-bottom:18px; border-bottom:1px dashed var(--border, #E0E6ED); }
.admin-block h3 { margin:0 0 12px; font-size:15px; color:var(--text, #333); }
.admin-block .auth-input { margin-bottom:10px; }
.admin-info { margin-top:10px; padding:10px 12px; background:var(--bg-soft, #F5F7FA); border-radius:8px; font-size:14px; line-height:1.7; color:var(--text, #333); }
.auth-sub { margin:0 0 18px; font-size:13px; color:var(--text-secondary, #8E9AA4); }

/* 句子成分分析 —— 随机色提示：每个空随机一种颜色，提示用户在此填写 */
.sc-rc-1 { background:#4f86c6; border-color:#4f86c6; color:#fff; }
.sc-rc-2 { background:#e8743b; border-color:#e8743b; color:#fff; }
.sc-rc-3 { background:#19a979; border-color:#19a979; color:#fff; }
.sc-rc-4 { background:#945ecf; border-color:#945ecf; color:#fff; }
.sc-rc-5 { background:#13a4b4; border-color:#13a4b4; color:#fff; }
.sc-rc-6 { background:#ec3f4e; border-color:#ec3f4e; color:#fff; }
.sc-rc-7 { background:#d4a017; border-color:#d4a017; color:#fff; }
.sc-rc-8 { background:#7b6cf6; border-color:#7b6cf6; color:#fff; }

/* “另存为”按钮（与上传按钮同款样式） */
.upload-save-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: linear-gradient(135deg, #52C41A, #3F9E12);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 8px;
}
.upload-save-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 8px rgba(82,196,26,0.4);
}

/* ===== 倍特拼读展示块（文章学习-重点词汇卡片；与 words.css 同款） ===== */
.bt-wrap{ margin:10px 0 4px; padding:8px 12px; max-width:560px; background:rgba(102,126,234,.08); border:1px solid rgba(102,126,234,.22); border-radius:10px; text-align:center; }
.bt-label{ font-size:11px; font-weight:700; color:#667eea; letter-spacing:2px; margin-bottom:6px; }
.bt-syls{ display:flex; flex-wrap:wrap; justify-content:center; align-items:flex-start; gap:2px; }
.bt-syl{ display:inline-flex; flex-direction:column; align-items:center; padding:2px 6px; border-radius:8px; }
.bt-syl.bt-stress{ background:rgba(240,147,43,.16); box-shadow:inset 0 0 0 1px rgba(240,147,43,.45); }
.bt-txt{ font-size:18px; font-weight:700; font-family:Georgia,'Times New Roman',serif; }
.bt-snd{ font-size:12px; color:#e74c3c; font-weight:600; margin-top:1px; }
.bt-type{ font-size:10px; opacity:.75; margin-top:1px; white-space:nowrap; }
.bt-dot{ align-self:center; color:#667eea; font-weight:700; padding:0 1px; }
.bt-rules{ margin-top:6px; display:flex; flex-wrap:wrap; justify-content:center; gap:4px; }
.bt-rule{ font-size:11px; opacity:.8; background:rgba(0,0,0,.05); border-radius:6px; padding:2px 7px; }

/* ===== 拼读课程-查询与打印 ===== */
.ph-print-title{ text-align:center; font-size:18px; font-weight:700; margin:8px 0 16px; color:var(--text); }
.ph-print-table{ width:100%; border-collapse:collapse; font-size:14px; table-layout:fixed; }
.ph-print-table th,
.ph-print-table td{ border:1px solid var(--border); padding:10px 8px; text-align:left; vertical-align:top; word-wrap:break-word; overflow-wrap:break-word; }
/* 列宽：倍特拼读 = 音标的 2 倍；词义收窄 */
.ph-print-table th:nth-child(1), .ph-print-table td:nth-child(1){ width:14%; }
.ph-print-table th:nth-child(2), .ph-print-table td:nth-child(2){ width:17%; }
.ph-print-table th:nth-child(3), .ph-print-table td:nth-child(3){ width:34%; }
.ph-print-table th:nth-child(4), .ph-print-table td:nth-child(4){ width:35%; }
.ph-print-table th{ background:var(--chip-bg); color:var(--text); font-weight:700; }
.ph-print-table tr:hover{ background:rgba(102,126,234,.06); }
.ph-print-w{ font-weight:700; font-size:15px; color:var(--text); }
.ph-print-p{ font-family:"Cambria Math",Consolas,monospace; color:var(--accent); }
.ph-print-b{ line-height:1.6; }
.ph-print-syl{ display:inline-flex; flex-direction:column; align-items:center; padding:2px 5px; border-radius:6px; vertical-align:middle; }
.ph-print-stress{ background:rgba(240,147,43,.16); box-shadow:inset 0 0 0 1px rgba(240,147,43,.45); }
.ph-print-sound{ font-size:12px; color:#e74c3c; font-weight:600; }
.ph-print-type{ font-size:10px; color:var(--text-soft,#888); }
.ph-print-dot{ color:var(--accent); font-weight:700; padding:0 2px; }
.ph-print-m{ color:var(--sub-text); line-height:1.5; }
.ph-print-missing{ color:var(--text-soft); font-style:italic; }

@media print {
  body *{ visibility:hidden; }
  #ph-print-area,
  #ph-print-area *{ visibility:visible; }
  #ph-print-area{ position:absolute; left:0; top:0; width:100%; }
  .ph-print-table th,
  .ph-print-table td{ border:1px solid #333 !important; color:#000 !important; }
  .ph-print-title{ color:#000 !important; }
}

/* ===== 网站页脚 / 合规链接（备案公示） ===== */
.site-footer{
    margin-top:32px;
    padding:20px 16px 28px;
    text-align:center;
    border-top:1px solid var(--border-color, #e5e7eb);
    background:var(--card-bg, #fff);
    color:var(--text-secondary, #7F8C8D);
    font-size:13px;
    line-height:1.9;
}
.site-footer .footer-links a{
    color:var(--primary, #4A90D9);
    text-decoration:none;
    margin:0 4px;
}
.site-footer .footer-links a:hover{ text-decoration:underline; }
.site-footer .footer-sep{ color:var(--text-soft,#bbb); margin:0 2px; }
.site-footer .footer-beian{ margin-top:6px; }
.site-footer .footer-beian a{ color:var(--text-secondary,#7F8C8D); text-decoration:none; margin:0 6px; }
.site-footer .footer-beian a:hover{ text-decoration:underline; }
.site-footer .footer-copy{ margin-top:6px; font-size:12px; color:var(--text-soft,#9aa0a6); }

/* 登录/注册页底部合规链接 */
.auth-footer-links{
    margin-top:18px;
    padding-top:14px;
    border-top:1px solid var(--border-color, #e5e7eb);
    text-align:center;
    font-size:12px;
}
.auth-footer-links a{
    color:var(--text-secondary, #7F8C8D);
    text-decoration:none;
    margin:0 8px;
}
.auth-footer-links a:hover{ color:var(--primary,#4A90D9); text-decoration:underline; }
