/* ========================================
   刷题通 - 样式表
   ======================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    line-height: 1.6;
    min-height: 100vh;
}

/* ---------- 启动缓冲画面 ---------- */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    transition: opacity 0.5s ease;
}

.splash-screen.splash-fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-card {
    text-align: center;
    animation: splashBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes splashBounceIn {
    0% { opacity: 0; transform: scale(0.7) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: splashPulse 1.2s ease-in-out infinite;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.splash-title {
    font-size: 2rem;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.splash-subtitle {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-bottom: 24px;
}

.splash-bar-bg {
    width: 160px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.splash-bar-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #3182ce, #63b3ed);
    border-radius: 2px;
    animation: splashLoading 1s ease-in-out infinite;
}

@keyframes splashLoading {
    0% { transform: translateX(-100%); width: 30%; }
    50% { width: 50%; }
    100% { transform: translateX(300%); width: 30%; }
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ---------- 页脚 ---------- */
.app-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid #e2e8f0; text-align: center; }
.footer-item { font-size: 0.8rem; color: #94a3b8; margin-bottom: 6px; }
.footer-item a { color: #94a3b8; text-decoration: none; }
.footer-item a:hover { color: #3b82f6; }
.footer-github { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 用户菜单 ---------- */
.user-menu { position: relative; flex-shrink: 0; }
.user-avatar { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 12px; border-radius: 8px; transition: background 0.2s; }
.user-avatar:hover { background: rgba(255,255,255,0.15); }
.avatar-letter { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #3182ce; color: #fff; font-weight: 700; font-size: 0.9rem; }
.avatar-name { font-size: 0.85rem; color: #2d3748; font-weight: 600; }
.avatar-arrow { font-size: 0.7rem; color: #a0aec0; }
.user-dropdown {
    position: absolute; right: 0; top: 48px;
    background: #fff; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 200px; z-index: 100; padding: 8px 0;
    opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
}
.user-dropdown.open {
    opacity: 1; visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.dropdown-header { padding: 10px 16px 6px; font-size: 0.8rem; color: #a0aec0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.dropdown-item { display: block; padding: 10px 16px; font-size: 0.9rem; color: #4a5568; text-decoration: none; transition: background 0.15s; }
.dropdown-item:hover { background: #f7fafc; color: #2d3748; }
.dropdown-divider { height: 1px; background: #e2e8f0; margin: 4px 0; }

/* ---------- 公告横幅 ---------- */
.announcement-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #1e40af;
    animation: bannerSlideIn 0.4s ease-out;
}
@keyframes bannerSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.announcement-banner.hidden { display: none; }
.announcement-icon { font-size: 1.2rem; flex-shrink: 0; }
.announcement-text { flex: 1; line-height: 1.5; }
.announcement-close {
    background: none; border: none; font-size: 1.1rem; cursor: pointer;
    color: #93c5fd; padding: 4px 6px; border-radius: 4px; transition: all 0.2s; flex-shrink: 0;
}
.announcement-close:hover { color: #ef4444; background: #fee2e2; }

/* ---------- Header ---------- */
/* ---------- App 首页 Header（含用户菜单） ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}
.app-header-left h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}
.app-header-left .subtitle {
    color: #718096;
    font-size: 0.85rem;
    margin: 2px 0 0;
}

.subtitle {
    color: #718096;
    font-size: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

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

.btn-primary {
    background: #3182ce;
    color: white;
}

.btn-primary:hover {
    background: #2b6cb0;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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

.btn-exam {
    background: #dd6b20;
    color: white;
}

.btn-exam:hover {
    background: #c05621;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-back {
    background: transparent;
    color: #4a5568;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-back:hover {
    background: #e2e8f0;
    box-shadow: none;
}

.btn-large {
    padding: 12px 32px;
    font-size: 1.05rem;
    width: 100%;
}

/* ---------- 搜题 ---------- */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #2d3748;
}

.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-select {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    color: #2d3748;
    min-width: 200px;
    flex: 1;
}

.search-select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
}

.search-input {
    flex: 3;
    padding: 8px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 200px;
    color: #2d3748;
}

.search-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
}

.search-input::placeholder {
    color: #a0aec0;
}

.search-results {
    margin-top: 16px;
}

.search-loading,
.search-empty,
.search-error {
    text-align: center;
    padding: 24px;
    color: #718096;
    font-size: 0.9rem;
}

.search-error {
    color: #e53e3e;
}

.search-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #2d3748;
    flex-wrap: wrap;
    gap: 8px;
}

.search-result-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: box-shadow 0.2s;
}

.search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-q-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.search-q-num {
    font-size: 0.75rem;
    color: #a0aec0;
}

.search-q-text {
    font-size: 0.9rem;
    color: #2d3748;
    line-height: 1.6;
    margin-bottom: 6px;
}

.search-q-opts {
    font-size: 0.8rem;
    color: #718096;
    line-height: 1.7;
}

.search-opt {
    margin-right: 12px;
}

.search-highlight {
    background: #fefcbf;
    color: #744210;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* ---------- Bank Section ---------- */
.bank-section, .upload-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.bank-section h2, .upload-section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #2d3748;
}

/* Bank Card */
.bank-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    gap: 12px;
    overflow: hidden;
}

.bank-card.removing {
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-width: 0;
    gap: 0;
}

.bank-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.bank-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.bank-icon {
    font-size: 1.5rem;
}

.bank-details {
    display: flex;
    flex-direction: column;
}

.bank-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bank-name {
    font-weight: 600;
    color: #2d3748;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-rename {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
    line-height: 1;
}

.bank-card:hover .btn-rename {
    opacity: 0.6;
}

.btn-rename:hover {
    opacity: 1 !important;
    background: #edf2f7;
}

/* Type badges */
.bank-type-badges {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.type-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.6;
}

.type-badge.single {
    background: #ebf8ff;
    color: #2b6cb0;
}

.type-badge.multi {
    background: #faf5ff;
    color: #6b46c1;
}

.type-badge.judge {
    background: #fffaf0;
    color: #c05621;
}

.type-badge.fill {
    background: #f0fff4;
    color: #276749;
}

.bank-meta {
    font-size: 0.8rem;
    color: #a0aec0;
}

.bank-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 32px;
    color: #718096;
}

.empty-state p {
    margin-bottom: 16px;
}

/* ---------- Upload Section ---------- */
.form-row {
    margin-bottom: 16px;
}

.file-label {
    display: block;
    padding: 16px;
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    color: #718096;
    transition: all 0.2s;
}

.file-label:hover {
    border-color: #3182ce;
    color: #3182ce;
    background: #ebf8ff;
}

.mode-select {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.mode-select label {
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
}

.mode-hint {
    font-weight: 400;
    font-size: 0.85rem;
    color: #a0aec0;
}

/* ---------- 题数选择器 ---------- */

.bank-actions .count-label {
    font-size: 14px;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
}

.bank-actions .count-select {
    padding: 4px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
}

.bank-actions .count-select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
}

.msg {
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.msg.error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #fed7d7;
}

.msg.success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
}

/* ---------- Quiz Page ---------- */
.quiz-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.quiz-main {
    flex: 1;
    min-width: 0;
}

/* Answer Sheet Sidebar */
.answer-sheet {
    width: 200px;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.answer-sheet.hidden {
    display: none;
}

.answer-sheet h3 {
    font-size: 0.95rem;
    color: #2d3748;
    margin-bottom: 12px;
    text-align: center;
}

.sheet-legend,
#sheet-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.7rem;
    color: #718096;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.answered {
    background: #3182ce;
}

.dot.current {
    background: #fff;
    border: 2px solid #3182ce;
}

.dot.unanswered {
    background: #e2e8f0;
}

.sheet-grid,
#sheet-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.sheet-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    color: #718096;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.sheet-num.answered {
    background: #3182ce;
    color: #fff;
    border-color: #3182ce;
}

.sheet-num.current {
    border: 2px solid #3182ce;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.3);
    font-weight: 700;
}

.sheet-num:hover {
    background: #ebf8ff;
    border-color: #3182ce;
}

.sheet-num.answered:hover {
    background: #2b6cb0;
}

.sheet-stats,
#sheet-stats {
    text-align: center;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 12px;
}

.btn-sm {
    display: block;
    width: 100%;
    text-align: center;
    padding: 6px 0;
    font-size: 0.8rem;
}

.sheet-expand {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    border-radius: 20px;
    padding: 10px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sheet-expand.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(49, 130, 206, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(49, 130, 206, 0); }
}

/* header quiz-main override for layout */
.quiz-layout .quiz-main {
    background: white;
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-height: 400px;
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    text-align: left;
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.quiz-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quiz-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
}

.quiz-info h1 {
    font-size: 1.1rem;
    margin: 0;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-practice {
    background: #ebf8ff;
    color: #2b6cb0;
}

.badge-exam {
    background: #fffaf0;
    color: #c05621;
}

.quiz-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quiz-progress {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 600;
}

/* Exam Timer */
.exam-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 8px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #2d3748;
    transition: all 0.3s ease;
}

.exam-timer.hidden {
    display: none;
}

.exam-timer.timer-warning {
    border-color: #fc8181;
    background: #fff5f5;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(229, 62, 62, 0); }
}

/* Question Area */
.quiz-main {
    background: white;
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-height: 400px;
}

.loading {
    text-align: center;
    color: #718096;
    padding: 60px 0;
    font-size: 1.1rem;
}

/* Question Card */
.question-card {
    animation: fadeIn 0.3s ease;
}

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

.question-number {
    font-size: 0.85rem;
    color: #a0aec0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Star/Favorite button */
.fav-btn {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
    user-select: none;
    margin-left: auto;
}

.fav-btn:hover {
    transform: scale(1.3);
}

.fav-btn.fav-active {
    animation: favPop 0.3s ease;
}

@keyframes favPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.fav-count {
    font-size: 0.8rem;
    color: #d69e2e;
    font-weight: 600;
}

.fav-item {
    border: 1px solid #fefcbf;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #fffff0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.fav-item:last-child {
    margin-bottom: 0;
}

.fav-item.removing {
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-width: 0;
}

/* Question Type Badge */
.question-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.question-type-badge.single {
    background: #ebf8ff;
    color: #2b6cb0;
}

.question-type-badge.multi {
    background: #faf5ff;
    color: #6b46c1;
}

.question-type-badge.judge {
    background: #fffaf0;
    color: #c05621;
}

.question-type-badge.fill {
    background: #f0fff4;
    color: #276749;
}

/* ---------- 填空题输入框 ---------- */
.fill-input-wrap {
    margin: 20px 0;
}

.fill-input-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fill-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
}

.fill-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    font-size: 1.05rem;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    color: #2d3748;
}

.fill-input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.fill-input::placeholder {
    color: #a0aec0;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 24px;
    line-height: 1.7;
}

/* Options */
.options-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: #3182ce;
    background: #ebf8ff;
}

.option-item.selected {
    border-color: #3182ce;
    background: #ebf8ff;
}

.option-item.correct-show {
    border-color: #38a169;
    background: #f0fff4;
}

.option-item.wrong-show {
    border-color: #e53e3e;
    background: #fff5f5;
}

.option-input,
.option-radio {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: #3182ce;
}

.option-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 20px;
}

.option-text {
    color: #2d3748;
}

/* Practice Mode Hint */
.practice-hint {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.practice-hint.correct {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
}

.practice-hint.wrong {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #fed7d7;
}

.practice-hint.info {
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #bee3f8;
}

/* Navigation */
.quiz-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
}

.quiz-nav.hidden {
    display: none;
}

#question-indicator {
    font-size: 0.9rem;
    color: #718096;
    min-width: 60px;
    text-align: center;
}

/* ---------- Result Page ---------- */
.result-summary {
    background: white;
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    text-align: center;
}

.result-summary.loading {
    opacity: 0.5;
}

.result-score {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.result-score.excellent { color: #38a169; }
.result-score.good { color: #3182ce; }
.result-score.fair { color: #dd6b20; }
.result-score.poor { color: #e53e3e; }

.result-meta {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 16px;
}

.result-bar-bg {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.result-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}

.result-bar-fill.excellent { background: #38a169; }
.result-bar-fill.good { background: #3182ce; }
.result-bar-fill.fair { background: #dd6b20; }
.result-bar-fill.poor { background: #e53e3e; }

.result-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.detail-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.detail-card.correct {
    border-left: 4px solid #38a169;
}

.detail-card.wrong {
    border-left: 4px solid #e53e3e;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-header .correct-icon { color: #38a169; }
.detail-header .wrong-icon { color: #e53e3e; }

.detail-question {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d3748;
}

.detail-answers {
    font-size: 0.9rem;
}

.detail-answers .user-ans {
    color: #e53e3e;
}

.detail-answers .correct-ans {
    color: #38a169;
    font-weight: 600;
}

/* Option highlight in result details */
.detail-options {
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 4px;
}

.detail-options .correct-show {
    color: #38a169;
    font-weight: 600;
}

.detail-options .wrong-show {
    color: #e53e3e;
    font-weight: 600;
    text-decoration: line-through;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- 学习统计 ---------- */
.stats-section {
    margin-bottom: 32px;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.stats-section > h2 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 20px;
}

/* 总览卡片 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stats-card {
    text-align: center;
    padding: 16px 8px;
    background: #f7fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.stats-card-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.stats-card-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #2d3748;
}

.stats-card-value.excellent { color: #38a169; }
.stats-card-value.good { color: #3182ce; }
.stats-card-value.fair { color: #dd6b20; }
.stats-card-value.poor { color: #e53e3e; }

.stats-card-label {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 2px;
}

/* 图表网格 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 子区域 */
.stats-chart-section,
.stats-sub-section {
    margin-bottom: 20px;
}

.stats-chart-section h3,
.stats-sub-section h3 {
    font-size: 0.95rem;
    color: #2d3748;
    margin-bottom: 12px;
}

/* 得分趋势柱状图 */
.stats-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 120px;
    padding: 8px 4px;
    border-bottom: 1px solid #e2e8f0;
}

.stats-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.stats-bar-fill {
    width: 100%;
    max-width: 36px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.4s ease;
}

.stats-bar-fill.excellent { background: #38a169; }
.stats-bar-fill.good { background: #3182ce; }
.stats-bar-fill.fair { background: #dd6b20; }
.stats-bar-fill.poor { background: #e53e3e; }

.stats-bar-label {
    font-size: 0.65rem;
    color: #718096;
    margin-top: 4px;
    white-space: nowrap;
}

/* 题库正确率 */
.stats-bank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.stats-bank-info {
    min-width: 0;
    flex: 1;
}

.stats-bank-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2d3748;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-bank-meta {
    font-size: 0.7rem;
    color: #a0aec0;
}

.stats-bank-bar-bg {
    flex: 2;
    height: 8px;
    background: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
}

.stats-bank-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stats-bank-bar-fill.excellent { background: #38a169; }
.stats-bank-bar-fill.good { background: #3182ce; }
.stats-bank-bar-fill.fair { background: #dd6b20; }
.stats-bank-bar-fill.poor { background: #e53e3e; }

.stats-bank-pct {
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 36px;
    text-align: right;
}

.stats-bank-pct.excellent { color: #38a169; }
.stats-bank-pct.good { color: #3182ce; }
.stats-bank-pct.fair { color: #dd6b20; }
.stats-bank-pct.poor { color: #e53e3e; }

/* 模式对比 */
.stats-mode-compare {
    display: flex;
    gap: 12px;
}

.stats-mode-item {
    flex: 1;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
}

.stats-mode-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
}

.stats-mode-nums {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 8px;
}

.stats-mode-bar-bg {
    height: 6px;
    background: #edf2f7;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.stats-mode-acc {
    font-size: 1rem;
    font-weight: 700;
}

.stats-mode-acc.excellent { color: #38a169; }
.stats-mode-acc.good { color: #3182ce; }
.stats-mode-acc.fair { color: #dd6b20; }
.stats-mode-acc.poor { color: #e53e3e; }

/* 每日活跃 */
.stats-day-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 80px;
    padding: 8px 4px;
    border-bottom: 1px solid #e2e8f0;
}

.stats-day-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.stats-day-bar {
    width: 100%;
    max-width: 28px;
    background: #3182ce;
    border-radius: 3px 3px 0 0;
    min-height: 3px;
    opacity: 0.7;
}

.stats-day-label {
    font-size: 0.65rem;
    color: #718096;
    margin-top: 3px;
}

.stats-day-name {
    font-size: 0.6rem;
    color: #a0aec0;
}

/* 响应式 */
@media (max-width: 640px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stats-mode-compare {
        flex-direction: column;
    }
}

/* ---------- 错题本 ---------- */
.wrongbook-section {
    margin-bottom: 32px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wrongbook-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wrongbook-section-header h2 {
    font-size: 1.2rem;
    color: #2d3748;
}

.wrongbook-group {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}

.wrongbook-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

.wrongbook-bank-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.wrongbook-count {
    font-size: 0.8rem;
    color: #e53e3e;
    font-weight: 600;
}

.wrongbook-items {
    padding: 8px;
}

.wrongbook-item {
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #fff5f5;
    transition: all 0.2s;
    overflow: hidden;
}

.wrongbook-item:last-child {
    margin-bottom: 0;
}

.wrongbook-item.removing {
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-width: 0;
}

.wrongbook-q-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.wrongbook-type {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.wrongbook-type.single {
    background: #ebf8ff;
    color: #2b6cb0;
}

.wrongbook-type.multi {
    background: #faf5ff;
    color: #6b46c1;
}

.wrongbook-type.judge {
    background: #fffaf0;
    color: #c05621;
}

.wrongbook-type.fill {
    background: #f0fff4;
    color: #276749;
}

.wrongbook-qtext {
    font-size: 0.9rem;
    color: #2d3748;
    line-height: 1.5;
}

.wrongbook-q-body {
    padding: 8px 0 4px 0;
    font-size: 0.85rem;
    border-top: 1px dashed #fed7d7;
    margin-top: 8px;
}

.wrongbook-opts {
    color: #4a5568;
    margin-bottom: 6px;
    line-height: 1.7;
}

.wrongbook-answers {
    display: flex;
    gap: 20px;
    margin-bottom: 4px;
}

.wrongbook-user-ans {
    color: #e53e3e;
}

.wrongbook-user-ans strong {
    text-decoration: line-through;
}

.wrongbook-correct-ans {
    color: #38a169;
    font-weight: 600;
}

.wrongbook-meta {
    font-size: 0.75rem;
    color: #a0aec0;
}

.wrongbook-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.wrongbook-group-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

/* ---------- 历史记录 ---------- */
.history-section {
    margin-bottom: 32px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.history-section h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #2d3748;
}

.history-table-wrap {
    overflow-x: auto;
    margin-bottom: 12px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th,
.history-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.history-table th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 600;
    white-space: nowrap;
}

.history-table tbody tr:hover {
    background: #f7fafc;
}

.hist-time {
    color: #718096;
    white-space: nowrap;
    font-size: 0.85rem;
}

.hist-bank a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
}

.hist-bank a:hover {
    text-decoration: underline;
}

.hist-score {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.hist-score.excellent {
    background: #c6f6d5;
    color: #22543d;
}

.hist-score.good {
    background: #bee3f8;
    color: #2a4365;
}

.hist-score.fair {
    background: #fefcbf;
    color: #744210;
}

.hist-score.poor {
    background: #fed7d7;
    color: #9b2c2c;
}

.history-actions {
    text-align: right;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid #e53e3e;
    color: #e53e3e;
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-danger-outline:hover {
    background: #e53e3e;
    color: #fff;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.82rem;
}

/* ---------- 上传方式切换标签 ---------- */
.upload-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.upload-tab {
    padding: 10px 24px;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #718096;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.upload-tab:hover {
    color: #3182ce;
}

.upload-tab.active {
    color: #3182ce;
    border-bottom-color: #3182ce;
}

/* AI 文本输入区 */
.ai-textarea {
    width: 100%;
    min-height: 200px;
    padding: 14px 16px;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.7;
    color: #2d3748;
    resize: vertical;
    transition: border-color 0.2s;
}

.ai-textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.ai-textarea::placeholder {
    color: #a0aec0;
}

/* ---------- Error Page ---------- */
.error-page {
    text-align: center;
    padding: 40px 0;
}

.error-message {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    color: #c53030;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    header h1 {
        font-size: 1.5rem;
    }

    .bank-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .bank-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .quiz-header-left {
        flex-wrap: wrap;
    }

    .quiz-header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .quiz-main {
        padding: 20px 16px;
    }

    .question-text {
        font-size: 1.05rem;
    }

    .option-item {
        padding: 12px 14px;
    }

    .result-score {
        font-size: 3rem;
    }
}