/* 开发日期：2026-08-13 */

/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 15px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f6fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    cursor: pointer;
    background: none;
    font-family: inherit;
}

input {
    border: none;
    outline: none;
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== 容器 ===== */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 100vh;            /* 这里加下面两行 ↓↓↓ */
    padding-bottom: 180px;        /* 避开底部导航栏，不够大就 120px */
    box-sizing: border-box;
}

/* ===== 顶部导航 ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar .title {
    font-size: 1.1rem;
    font-weight: 600;
}

.navbar .back-btn {
    font-size: 1.5rem;
    color: #fff;
    padding: 4px 8px;
}

/* ===== 底部导航 ===== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.05);
    z-index: 100;
    padding: 4px 0;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
    min-height: 36px;
}

.tab-bar .tab-item {
    flex: 1;
    text-align: center;
    padding: 4px 0;
    color: #888;
    font-size: 0.9333rem;
    transition: color 0.2s, background 0.2s;
    margin: 0 4px;
    border-radius: 16px;
    cursor: pointer;
    user-select: none;
}

.tab-bar .tab-item.active {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.35);
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-outline {
    background: #fff;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9333rem;
    width: auto;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 领取账号按钮 - 次级强调按钮 */
.btn-claim {
    background: #fff;
    color: #667eea;
    border: 1px dashed #667eea;
    font-size: 0.9333rem;
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-claim:active {
    background: #f0f3ff;
    transform: scale(0.98);
}

.btn-copy {
    background: #f0f3ff;
    color: #667eea;
    border: none;
    padding: 4px 10px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-copy:active {
    background: #dfe6ff;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9333rem;
    color: #666;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: #f5f6fa;
    border-radius: 8px;
    font-size: 1rem;
    transition: background 0.2s;
}

.form-input:focus {
    background: #fff;
    box-shadow: 0 0 0 2px #667eea;
}

.form-input.with-suffix {
    padding-right: 100px;
}

.suffix-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 0.9333rem;
    white-space: nowrap;
}

.form-item {
    position: relative;
}

/* ===== 科目选择器 ===== */
.grade-tabs {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.grade-tab {
    padding: 8px 14.5px;
    background: #fff;
    border-radius: 20px;
    font-size: 0.9333rem;
    color: #666;
    white-space: nowrap;
    transition: all 0.2s;
}

.grade-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* ===== 科目卡片 ===== */
.subject-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.subject-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.subject-card:active {
    transform: scale(0.97);
}

.subject-card .grade-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.8rem;
    border-radius: 4px;
    margin-bottom: 6px;
}

.subject-card .name {
    font-size: 0.8667rem;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.3;
}

.subject-card .info {
    font-size: 0.8667rem;
    color: #999;
}

.subject-card .activated-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: #52c41a;
    border-radius: 50%;
}

.subject-card.locked {
    opacity: 0.7;
}

.subject-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1rem;
}

/* ===== 答题页面 ===== */
.exam-header {
    background: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 50;
}

.exam-progress {
    flex: 1;
    margin: 0 12px;
}

.progress-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

.exam-progress .text {
    font-size: 1rem;
    color: #666;
    margin-top: 4px;
    text-align: center;
}

.question-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 16px;
    margin-top: 12px;
}

.question-type {
    display: inline-block;
    padding: 2px 8px;
    background: #e6f7ff;
    color: #1890ff;
    font-size: 1rem;
    border-radius: 4px;
    margin-bottom: 12px;
}

.question-stem {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
}

.question-stem pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    background: #f5f5f5;
    padding: 8px;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.question-stem code {
    word-break: break-all;
    white-space: pre-wrap;
}

.question-stem table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.question-stem img {
    max-width: 100%;
    margin: 8px 0;
    border-radius: 8px;
}

.options-list {
    list-style: none;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 14px;
    background: #f8f9fc;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.option-item:active {
    transform: scale(0.99);
}

.option-item.selected {
    background: #e6f0ff;
    border-color: #667eea;
}

.option-item.correct {
    background: #f6ffed;
    border-color: #52c41a;
}

.option-item.wrong {
    background: #fff2f0;
    border-color: #ff4d4f;
}

.option-label {
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 0.9333rem;
}

.option-item.selected .option-label {
    background: #667eea;
    color: #fff;
}

.option-item.correct .option-label {
    background: #52c41a;
    color: #fff;
}

.option-item.wrong .option-label {
    background: #ff4d4f;
    color: #fff;
}

.option-content {
    flex: 1;
    min-width: 0;
    line-height: 1.6;
    padding-top: 3px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.exam-actions {
    display: block;
    background: #fff;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    z-index: 40;
}

/* ===== 解析面板 ===== */
.analysis-panel {
    margin-top: 16px;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    
}

.analysis-panel .title {
    font-size: 0.9333rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.analysis-panel .content {
    font-size: 0.9333rem;
    line-height: 1.8;
    color: #555;
}

.analysis-panel .correct-answer {
    color: #52c41a;
    font-weight: 600;
}

/* ===== 结果页面 ===== */
.result-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.result-header .score {
    font-size: 3rem;
    font-weight: 700;
    margin: 16px 0;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    margin: -20px 16px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.result-stats .stat-item {
    text-align: center;
}

.result-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.result-stats .stat-label {
    font-size: 1rem;
    color: #999;
}

/* ===== 个人中心 ===== */
.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    position: relative;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 16px;
}
/* 不显示头像图标（只显示文字）*/
.profile-avatar { display: none !important; }

.profile-info .nickname {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}
/* 不显示昵称，只显示账号 */
.profile-info .nickname { display: none !important; }

.profile-info .username,
.profile-info .phone {
    font-size: 0.9333rem;
    opacity: 0.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #eee;
    margin: 0 16px 16px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.stats-grid .stat-item {
    background: #fff;
    padding: 6px 4px;
    text-align: center;
}

.stats-grid .stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

.stats-grid .stat-label {
    font-size: 0.9333rem;
    color: #999;
    margin-top: 0px;
}

.menu-list {
    background: #fff;
    border-radius: 12px;
    margin: 0 16px 16px;
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: #f5f6fa;
}

.menu-item .icon {
    font-size: 1.2rem;
    margin-right: 12px;
}

.menu-item .text {
    flex: 1;
    padding-left: 4px;
}

.menu-item .arrow {
    color: #ccc;
    font-size: 0.9333rem;
}

/* ===== 激活码页面 ===== */
.activate-section {
    padding: 20px 16px;
}

.activate-input {
    width: 100%;
    padding: 14px;
    background: #f8f9fc;
    border-radius: 8px;
    font-size: 1.1rem;
    letter-spacing: 4px;
    text-align: center;
    font-family: monospace;
}

.activate-tips {
    margin-top: 12px;
    font-size: 0.9333rem;
    color: #999;
    text-align: center;
}

/* 激活码Tab切换 */
.activate-tabs {
    display: flex;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 20px;
}

.activate-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.9333rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.activate-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 500;
}

.activate-tab-panel {
    display: none;
}

.activate-tab-panel.active {
    display: block;
}

/* 找回账号结果 */
.find-result-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.find-result-box.success {
    border-left: 4px solid #52c41a;
}

.find-result-box.error {
    border-left: 4px solid #ff4d4f;
}

.find-result-box .result-title {
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.find-result-box.success .result-title {
    color: #52c41a;
}

.find-result-box.error .result-title {
    color: #ff4d4f;
}

.find-result-box .credential-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.find-result-box .credential-row:last-child {
    border-bottom: none;
}

.find-result-box .credential-row .label {
    color: #666;
    font-size: 0.9333rem;
}

.find-result-box .credential-row .value {
    font-weight: 500;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 错题本 ===== */
.wrong-filters {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-chip {
    padding: 6px 14px;
    background: #fff;
    border-radius: 16px;
    font-size: 0.9333rem;
    color: #666;
    white-space: nowrap;
}

.filter-chip.active {
    background: #667eea;
    color: #fff;
}

/* ===== 通用组件 ===== */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    font-size: 0.9333rem;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    flex-direction: column;
    gap: 12px;
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid #eee;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-overlay .text {
    color: #667eea;
    font-size: 0.9333rem;
}

/* ===== 领取账号页面 ===== */
.claim-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
}

.claim-logo {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
}
.claim-logo .icon {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 16px;
}
.claim-logo h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}
.claim-logo p {
    opacity: 0.85;
    font-size: 0.9333rem;
}

.account-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.account-card .ac-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.account-item {
    background: #f8f9fc;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-item .ac-label {
    color: #999;
    font-size: 0.9333rem;
    margin-bottom: 4px;
}

.account-item .ac-value {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: monospace;
    color: #333;
    letter-spacing: 0.5px;
}

.account-item .ac-actions {
    flex-shrink: 0;
}

.warning-box {
    background: #fff7e6;
    border: 1px solid #ffe58f;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.warning-box .wb-title {
    color: #faad14;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.warning-box .wb-text {
    color: #d48806;
    font-size: 0.9333rem;
    line-height: 1.6;
}

.claim-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.claim-actions .btn {
    flex: 1;
}

/* ===== 响应式 ===== */
@media (min-width: 768px) {
    .container {
        padding: 0 24px;
        padding-bottom: 180px;
    }

    .subject-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 800px;
    }

    .subject-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== 登录页 ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
}

.login-header {
    padding: 8px 40px 8px;
    text-align: center;
    color: #fff;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    margin: 0 auto 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.login-header p {
    opacity: 0.8;
    font-size: 0.9333rem;
}

.login-form {
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 10px 24px;
    flex: 1;
}

.login-tabs {
    display: flex;
    gap: 32px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.login-tab {
    padding-bottom: 12px;
    color: #999;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
}

.login-tab.active {
    color: #333;
    font-weight: 600;
}

.login-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.login-tab-panel {
    display: none;
}
.login-tab-panel.active {
    display: block;
}

.login-footer {
    text-align: center;
    color: #fff;
    font-size: 0.9333rem;
    padding: 5px;
    opacity: 0.6;
}

/* 登录页附加操作区 */
.login-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    margin-bottom: 24px;
    font-size: 0.9333rem;
}

.login-extra .link {
    color: #667eea;
    cursor: pointer;
    text-decoration: none;
}
.login-extra .link:active {
    opacity: 0.7;
}

.login-extra .spacer {
    flex: 1;
}

/* 管理员后台标签色 */
.tag-yellow {
    background: #fff7e6;
    color: #faad14;
    border: 1px solid #ffe58f;
}
.tag-blue {
    background: #e6f0ff;
    color: #1890ff;
    border: 1px solid #91caff;
}
/* ===== 登录页-补充缺失样式 ===== */
.login-tab-content {
    display: block;
}

.claim-section {
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px dashed #e8e8ef;
    text-align: center;
}

.claim-divider {
    position: relative;
    text-align: center;
    margin-bottom: 5px;
    color: #999;
    font-size: 0.9333rem;
}

.claim-divider span {
    background: #fff;
    padding: 0 10px;
    position: relative;
    z-index: 1;
}

.claim-divider::before {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    height: 1px;
    background: #eee;
}

.claim-tip {
    margin-top: 10px;
    color: #999;
    font-size: 0.9333rem;
    line-height: 1.5;
}

/* ===== 领取账号成功页-补充缺失样式 ===== */
.claim-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
}

.claim-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 22px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-width: 520px;
    margin: 0 auto 24px;
}

.claim-card-header {
    text-align: center;
    margin-bottom: 22px;
}

.claim-success-icon {
    width: 64px;
    height: 64px;
    line-height: 64px;
    text-align: center;
    margin: 0 auto 12px;
    background: #f6ffed;
    border: 2px solid #52c41a;
    color: #52c41a;
    border-radius: 50%;
    font-size: 2rem;
}

.claim-card-header h2 {
    font-size: 1.25rem;
    color: #333;
    margin-bottom: 4px;
}

.claim-card-header p {
    color: #999;
    font-size: 0.9333rem;
}

.claim-info {
    background: #fafbfd;
    border-radius: 12px;
    padding: 8px 0;
    margin-bottom: 18px;
}

.claim-info-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 10px;
    border-bottom: 1px solid #f0f0f5;
}
.claim-info-row:last-child { border-bottom: none; }

.claim-info-label {
    flex: 0 0 56px;
    color: #999;
    font-size: 0.9333rem;
}

.claim-info-value {
    flex: 1;
    font-family: monospace;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    letter-spacing: 0.5px;
    word-break: break-all;
}

.claim-copy-btn {
    flex-shrink: 0;
    background: #f0f3ff;
    color: #667eea;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.9333rem;
    cursor: pointer;
}
.claim-copy-btn:active { background: #dfe6ff; }

.claim-warn {
    background: #fff7e6;
    border: 1px solid #ffe58f;
    border-radius: 10px;
    padding: 12px 14px;
    color: #d48806;
    font-size: 0.9333rem;
    line-height: 1.6;
    margin-bottom: 20px;
}
.claim-warn b { color: #d46b08; }

.claim-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.claim-actions .btn { flex: 1; }

.claim-tips {
    max-width: 520px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    padding: 18px 20px;
}
.claim-tips h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #333;
}
.claim-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.claim-tips li {
    position: relative;
    padding-left: 20px;
    color: #555;
    font-size: 0.9333rem;
    line-height: 1.8;
}
.claim-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #52c41a;
    font-weight: 700;
}

/* ===== 找回结果-补充缺失样式 ===== */
.find-result-box .find-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9333rem;
}
.find-result-box .find-result-row:last-child {
    border-bottom: none;
}
.find-result-box .find-result-row span:first-child {
    color: #666;
}
/* ===== 题目分类标签 ===== */
.question-category {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.cat-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.6;
}
.cat-part {
    background: #fff7e6;
    color: #d48806;
    border: 1px solid #ffe58f;
}
.cat-section {
    background: #e6f4ff;
    color: #1677ff;
    border: 1px solid #91caff;
}

/* ===== 答案解析面板（增强版） ===== */
.analysis-panel {
    margin-top: 16px;
    padding: 14px;
    background: #fafafa;
    border-radius: 8px;
}
.analysis-result {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9333rem;
}
.analysis-result.ok {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}
.analysis-result.err {
    background: #fff2f0;
    color: #cf1322;
    border: 1px solid #ffa39e;
}
.analysis-score {
    font-size: 0.9333rem;
    opacity: 0.9;
}
.analysis-body {
    font-size: 0.9333rem;
    line-height: 1.8;
    color: #555;
}
.analysis-body p {
    margin-bottom: 6px;
}
.ok-text {
    color: #389e0d;
    font-weight: 600;
}
.err-text {
    color: #cf1322;
    font-weight: 600;
}
.correct-answer {
    color: #389e0d;
    font-weight: 700;
    font-family: monospace;
    font-size: 1.05rem;
}
.analysis-text {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
    line-height: 1.8;
    color: #444;
}
.options-reviewed {
    margin-bottom: 10px;
}

/* ===== 按章节练习 ===== */
.part-group {
    margin-bottom: 18px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eef0f5;
}
.part-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.08));
    border-bottom: 1px solid #eef0f5;
}
.part-title {
    font-weight: 600;
    font-size: 0.9333rem;
    color: #333;
}
.part-count {
    color: #667eea;
    font-size: 0.9333rem;
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.section-list {
    padding: 0;
}
.section-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f0;
}
.section-item:last-child {
    border-bottom: none;
}
.section-item:active {
    background: #f5f7fa;
}
.sec-left {
    flex: 1;
    min-width: 0;
}
.sec-name {
    font-size: 0.9333rem;
    color: #333;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sec-count {
    font-size: 1rem;
    color: #999;
}
.sec-right {
    flex-shrink: 0;
    color: #bbb;
    padding: 0 6px;
    font-size: 1rem;
}

/* ===== 答题结果 Tab + 详细解析 ===== */
.review-tabs {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: #f5f6fa;
    border-radius: 10px;
    margin-bottom: 12px;
}
.review-tabs .tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    font-size: 0.9333rem;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}
.review-tabs .tab-item.active {
    background: #fff;
    color: #667eea;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.tab-badge {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #eee;
    color: #999;
    border-radius: 9px;
    font-size: 0.9333rem;
    font-weight: 600;
}
.tab-badge.ok {
    background: #f6ffed;
    color: #389e0d;
}
.tab-badge.err {
    background: #fff2f0;
    color: #cf1322;
}

.review-card {
    background: #fff;
    border: 1px solid #f0f0f5;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 6px;
}
.review-header.ok {
    background: #f6ffed;
    color: #389e0d;
}
.review-header.err {
    background: #fff2f0;
    color: #cf1322;
}
.review-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.review-seq {
    font-weight: 700;
    font-size: 0.9333rem;
    font-family: monospace;
}
.review-type {
    background: rgba(255,255,255,0.7);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 1rem;
}
.review-header .question-category {
    margin: 0;
    flex: 1;
}
.review-right {
    font-weight: 700;
    font-size: 0.9333rem;
}
.review-stem {
    padding: 6px 4px 10px;
    line-height: 1.8;
    font-size: 0.9333rem;
    color: #222;
}
.review-options {
    margin-bottom: 10px;
}
.review-analysis {
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}
/* ===== 白天/黑夜模式 + 字号调整 ===== */

/* 工具栏 */
.exam-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 6px 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 50;
}
.tool-btn {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.9333rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
}
.tool-btn:active { transform: scale(0.95); }
.tool-btn.active { background: #667eea; color: #fff; border-color: #667eea; }
.font-controls { display: flex; gap: 3px; align-items: center; }
.font-controls .tool-btn { padding: 4px 8px; min-width: 32px; text-align: center; }

/* 黑夜模式 */
body.dark-theme {
    background-color: #2a3a5c;
    color: #f0f0f0;
}
body.dark-theme .exam-toolbar { background: #324369; border-bottom-color: #4a5c85; }
body.dark-theme .tool-btn { background: #3a4d78; color: #e6e6e6; border-color: #5b74aa; }
body.dark-theme .tool-btn.active { background: #667eea; color: #fff; }
body.dark-theme .navbar { background: linear-gradient(135deg, #25314f, #2a3a5c); }
body.dark-theme .card { background: #324369; color: #f0f0f0; }
body.dark-theme .question-card { background: #324369; color: #f0f0f0; border: 1px solid #4a5c85; }
body.dark-theme .question-stem { color: #f0f0f0; }
body.dark-theme .question-type { color: #b8c2dc; }
body.dark-theme .option-item { border-color: #4a5c85; background: #3a4d78; color: #f0f0f0; }
body.dark-theme .option-item.selected { border-color: #667eea; background: #4a5f94; }
body.dark-theme .option-item.correct { border-color: #52c41a; background: #2f5239; }
body.dark-theme .option-item.wrong { border-color: #ff4d4f; background: #522f35; }
body.dark-theme .option-label { background: #4a5f94; color: #fff; border-color: #6b7fb8; }
body.dark-theme .option-item.correct .option-label { background: #52c41a; color: #fff; }
body.dark-theme .option-item.wrong .option-label { background: #ff4d4f; color: #fff; }
body.dark-theme .analysis-panel { background: #3a4d78; border-color: #5b74aa; color: #f0f0f0; }
body.dark-theme .analysis-result.ok { background: rgba(82,196,26,0.2); color: #73d13d; }
body.dark-theme .analysis-result.err { background: rgba(255,77,79,0.2); color: #ff7875; }
body.dark-theme .analysis-body { color: #e6e6e6; }
body.dark-theme .exam-header { background: #324369; border-bottom-color: #4a5c85; }
body.dark-theme .progress-bar { background: #4a5c85; }
body.dark-theme .btn-outline { border-color: #5b74aa; color: #e6ecff; background: #324369; }
body.dark-theme .btn-outline:active { background: #3d5286; }
body.dark-theme .exam-wrapper { background: #2a3a5c; }
body.dark-theme .container { background: transparent; }
body.dark-theme .exam-actions { background: #324369; border-top-color: #4a5c85; }
body.dark-theme .exam-actions-row { background: #324369 !important; }
body.dark-theme .cat-tag { background: #3a4d78; color: #e6e6e6; border-color: #4a5c85; }
body.dark-theme .cat-part { background: #4a3f1f; color: #ffd666; border-color: #6b5c2b; }
body.dark-theme .cat-section { background: #1f3850; color: #91d5ff; border-color: #2d5578; }
body.dark-theme input, body.dark-theme textarea { background: #324369; color: #f0f0f0; border-color: #5b74aa; }

/* 字号缩放：作用于html根元素使所有rem单位联动 */
html.font-sm { font-size: 12px; }
html.font-md { font-size: 15px; }
html.font-lg { font-size: 16px; }
html.font-xl { font-size: 18px; }
body.font-sm { font-size: 12px; }
body.font-md { font-size: 15px; }
body.font-lg { font-size: 16px; }
body.font-xl { font-size: 18px; }

/* 考试记录卡片 */
.record-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.record-card .record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.record-card .record-score {
    font-size: 1.5rem;
    font-weight: 700;
}
.record-card .record-score.pass { color: #52c41a; }
.record-card .record-score.fail { color: #ff4d4f; }
.record-card .record-meta {
    font-size: 0.9333rem;
    color: #999;
    display: flex;
    gap: 12px;
}
body.dark-theme .record-card { background: #16213e; color: #e0e0e0; }

/* ===== 题目搜索样式 ===== */
.search-container {
    position: relative;
    margin-bottom: 8px;
}
.search-input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9333rem;
    background: #fff;
    transition: border-color 0.2s;
}
.search-input:focus {
    border-color: #667eea;
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.9333rem;
    pointer-events: none;
}
.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1rem;
    cursor: pointer;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    display: none;
}
.search-clear:active {
    background: #eee;
}
.search-results {
    margin-top: 12px;
}
.search-count {
    font-size: 0.9333rem;
    color: #667eea;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #f0f4ff;
    border-radius: 6px;
}
.search-item {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
}
.search-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fafafa;
    cursor: pointer;
}
.q-tag {
    font-size: 0.9333rem;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    flex-shrink: 0;
}
.tag-single {
    background: #667eea;
}
.tag-multi {
    background: #faad14;
}
.q-section {
    font-size: 1rem;
    color: #999;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.toggle-icon {
    color: #999;
    font-size: 0.9333rem;
    flex-shrink: 0;
}
.search-item-stem {
    padding: 10px 12px;
    font-size: 0.9333rem;
    line-height: 1.6;
    color: #333;
    word-break: break-all;
}
.search-item-stem mark {
    background: #fff3cd;
    color: #d93025;
    padding: 0 2px;
    border-radius: 2px;
}
.search-item-detail {
    padding: 10px 12px;
    border-top: 1px dashed #eee;
    background: #fcfcfc;
}
.opt-line {
    padding: 5px 0;
    font-size: 0.9333rem;
    color: #555;
}
.opt-correct {
    color: #52c41a;
    font-weight: 500;
    background: #f6ffed;
    padding: 5px 8px;
    border-radius: 4px;
    margin: 2px 0;
}
.ans-line {
    margin-top: 8px;
    padding: 8px;
    background: #f0f4ff;
    border-radius: 6px;
    font-size: 0.9333rem;
    color: #333;
}
.ans-val {
    color: #667eea;
    font-size: 1rem;
    letter-spacing: 1px;
}
.analysis-line {
    margin-top: 8px;
    padding: 8px;
    background: #fffbe6;
    border-radius: 6px;
    font-size: 0.9333rem;
    color: #614700;
    line-height: 1.7;
}
/* 暗色主题适配 */
body.dark-theme .search-input { background: #16213e; border-color: #2a3a5c; color: #e0e0e0; }
body.dark-theme .search-item { background: #16213e; border-color: #2a3a5c; }
body.dark-theme .search-item-head { background: #1a2540; }
body.dark-theme .search-item-stem { color: #e0e0e0; }
body.dark-theme .search-item-detail { background: #14244a; border-top-color: #2a3a5c; }
body.dark-theme .opt-line { color: #ccc; }
body.dark-theme .ans-line { background: #1a2540; color: #e0e0e0; }
body.dark-theme .analysis-line { background: #2a2410; color: #ffd666; }

/* ===== 搜索结果行：题干可点击查看详情 ===== */
.search-item-stem {
    cursor: pointer;
    user-select: none;
}
.search-item-stem:hover {
    background: rgba(102, 126, 234, 0.06);
    border-radius: 6px;
}
.stem-has-image {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 0.72rem;
    background: #fff7e6;
    color: #d46b08;
    border-radius: 10px;
    vertical-align: middle;
}
.stem-click-hint {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.9333rem;
    background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.12));
    color: #667eea;
    border-radius: 10px;
    font-weight: 500;
    vertical-align: middle;
}

/* ===== 题目详情模态框 ===== */
.qdetail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: qdFadeIn .2s ease-out;
}
@keyframes qdFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.qdetail-overlay.active {
    display: flex;
}
.qdetail-modal {
    width: calc(100% - 24px);
    max-width: 720px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,.2);
    animation: qdSlideUp .25s cubic-bezier(.4,.2,.2,1);
    margin-bottom: 40px;
}
@keyframes qdSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.qdetail-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    z-index: 2;
}
.qdetail-header .qd-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qdetail-header .qd-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
    user-select: none;
    opacity: 0.9;
}
.qdetail-body {
    padding: 20px 18px 24px;
    color: #333;
}
.qd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.qd-meta .qd-tag {
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 500;
}
.qd-tag.qd-single { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }
.qd-tag.qd-multi { background: #fff0f6; color: #c41d7f; border: 1px solid #ffadd2; }
.qd-tag.qd-section { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.qd-stem {
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 20px;
    padding: 14px;
    background: #fafbff;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    word-break: break-word;
}
.qd-stem img,
.qd-opt-body img,
.qd-analysis img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px;
    display: block;
    margin: 10px auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.qd-stem p, .qd-stem div, .qd-stem span {
    max-width: 100%;
}
.qd-stem table, .qd-opt-body table, .qd-analysis table {
    border-collapse: collapse;
    margin: 8px 0;
    width: 100%;
}
.qd-stem table th, .qd-stem table td,
.qd-opt-body table th, .qd-opt-body table td,
.qd-analysis table th, .qd-analysis table td {
    border: 1px solid #d9d9d9;
    padding: 6px 10px;
    font-size: 0.9333rem;
    text-align: left;
}
.qd-options { margin-bottom: 18px; }
.qd-opt {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #fafafa;
    border: 1px solid #eee;
    font-size: 0.92rem;
    line-height: 1.7;
    word-break: break-word;
}
.qd-opt-correct {
    background: linear-gradient(135deg, #f6ffed, #eaffdf) !important;
    border-color: #95de64 !important;
    color: #237804;
    font-weight: 500;
}
.qd-opt-label {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9333rem;
    color: #666;
}
.qd-opt-correct .qd-opt-label {
    background: #52c41a;
    color: #fff;
    border-color: #52c41a;
}
.qd-opt-body {
    flex: 1;
    min-width: 0;
}
.qd-ans {
    padding: 12px 14px;
    background: linear-gradient(135deg, #f0f4ff, #e8ecff);
    border-radius: 8px;
    font-size: 0.9333rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.qd-ans-label {
    padding: 4px 12px;
    background: #667eea;
    color: #fff;
    border-radius: 14px;
    font-size: 0.9333rem;
    font-weight: 600;
    white-space: nowrap;
}
.qd-ans-val {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #333;
}
.qd-analysis-wrap {
    padding: 14px;
    background: #fffbe6;
    border-radius: 8px;
    border-left: 3px solid #faad14;
}
.qd-analysis-title {
    font-size: 0.9333rem;
    font-weight: 600;
    color: #ad6800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.qd-analysis {
    font-size: 0.88rem;
    line-height: 1.8;
    color: #614700;
    word-break: break-word;
}
.qd-analysis-empty {
    font-size: 0.9333rem;
    color: #bfbfbf;
    font-style: italic;
}
body.dark-theme .qdetail-modal { background: #16213e; }
body.dark-theme .qdetail-body { color: #e0e0e0; }
body.dark-theme .qd-stem { background: #1a2540; border-color: #667eea; }
body.dark-theme .qd-opt { background: #1a2540; border-color: #2a3a5c; color: #ccc; }
body.dark-theme .qd-opt-label { background: #0f1e3c; border-color: #334a75; color: #ddd; }
body.dark-theme .qd-ans { background: #1a2540; }
body.dark-theme .qd-ans .qd-ans-val { color: #fff; }
body.dark-theme .qd-analysis-wrap { background: #2a2410; border-color: #faad14; }
body.dark-theme .qd-analysis { color: #ffd666; }
body.dark-theme .qd-tag.qd-single { background: #1a2b4a; color: #69c0ff; border-color: #274879; }
body.dark-theme .qd-tag.qd-multi { background: #4a1a33; color: #ffadd2; border-color: #79274f; }
body.dark-theme .qd-tag.qd-section { background: #1f4a1a; color: #b7eb8f; border-color: #367927; }


/* =====================================================
   ===== 移动端手机端自适应（手机 / 窄屏 / 横屏） =====
   ===================================================== */

@media (max-width: 375px) {
    .container { padding: 0 12px; padding-bottom: 180px; }
    .card { padding: 14px; border-radius: 10px; }
    .navbar { padding: 10px 12px; }
    .navbar .title { font-size: 1rem; }
    .back-btn { width: 30px; height: 30px; line-height: 30px; font-size: 1.1rem; }
    .exam-header { padding: 8px 12px; }
    .exam-toolbar { padding: 6px 10px; gap: 4px; flex-wrap: nowrap; justify-content: flex-start; }
    .font-controls { width: auto; justify-content: center; margin-bottom: 0; }
    .tool-btn { padding: 4px 8px; font-size: 0.85rem; }
    .font-controls .tool-btn { min-width: 28px; }
    .subject-title { font-size: 1.1rem; }
    .question-card { padding: 12px; }
    .question-stem { font-size: 0.9333rem; line-height: 1.75; }
    .option-item { padding: 10px; gap: 8px; }
    .option-label { width: 26px; height: 26px; line-height: 26px; }
    .btn { height: 42px; padding: 0 14px; font-size: 0.9333rem; border-radius: 8px; }
    .exam-actions-row { padding: 10px 12px !important; gap: 8px !important; }
    .exam-actions-row .btn { flex: 1 !important; min-width: 0 !important; white-space: nowrap; }
    .exam-actions-row .btn:only-child { flex: 1; }
    .answer-card-grid { grid-template-columns: repeat(5, 1fr); }
    .form-input { height: 44px; padding: 0 12px; font-size: 0.9333rem; }
    .subject-actions button { height: 44px; }
    .record-card { padding: 12px; }
    .review-tabs .tab-item { font-size: 0.85rem; padding: 8px 4px; }
    .search-input { height: 42px; padding: 0 40px; font-size: 0.9333rem; }
    .subject-list { grid-template-columns: 1fr 1fr; gap: 10px; }
    .section-item { padding: 10px 12px; }
    .activate-card { padding: 16px; }
    .record-score { font-size: 1.2rem; }
    .user-info-card .avatar { width: 54px; height: 54px; font-size: 1.4rem; }
    .stat-num { font-size: 1.2rem; }
    .empty-state { padding: 60px 16px; }
    .modal-sheet { padding: 18px 16px; }
    .login-form { padding: 28px 18px; }
    .login-header { padding: 8px 20px 8px; }
    .progress-banner { padding: 10px 12px; gap: 8px; }
    .continue-btn { height: 36px; padding: 0 12px; font-size: 0.85rem; }
}

@media (max-width: 320px) {
    .container { padding: 0 10px; padding-bottom: 180px; }
    .card { padding: 12px; }
    .exam-actions-row { display: grid !important; grid-template-columns: 1fr 1fr; }
    .exam-actions-row .btn.btn-primary.primary-only { grid-column: 1 / -1; }
    .answer-card-grid { grid-template-columns: repeat(4, 1fr); }
    .font-controls { gap: 2px; }
    .tool-btn { padding: 3px 6px; border-radius: 5px; }
    .subject-list { grid-template-columns: 1fr; }
    .navbar .title { font-size: 0.9333rem; }
    .exam-progress .text { font-size: 0.8rem; }
    .question-card { padding: 10px; }
    .question-stem { font-size: 0.9rem; line-height: 1.7; }
    .option-item { padding: 8px; }
    .option-label { width: 24px; height: 24px; line-height: 24px; font-size: 0.85rem; }
    .btn { height: 40px; font-size: 0.9rem; }
    .form-input { height: 42px; font-size: 0.9rem; }
    .review-tabs { gap: 4px; }
    .review-tabs .tab-item { font-size: 0.8rem; }
    .stat-num { font-size: 1.1rem; }
    .continue-btn { height: 34px; }
}

@media (min-width: 700px) {
    .question-container { padding: 0 24px; }
    .exam-actions-row { padding: 14px 24px !important; }
    .answer-card-grid { grid-template-columns: repeat(8, 1fr); }
    .subject-list { grid-template-columns: repeat(3, 1fr); }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .exam-actions,
    .exam-actions-row,
    .bottom-tab-bar,
    .container {
        padding-bottom: calc(150px + env(safe-area-inset-bottom))6
    .modal-sheet {
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

.exam-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
    padding-bottom: 8px;
}
.exam-wrapper {
    padding-bottom: 130px;
}
.exam-actions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 6px;
    background: #fff;
    flex-wrap: nowrap;
    max-width: 720px;
    margin: 0 auto;
}
.exam-actions-row .btn {
    flex: 1;
    min-width: 0;
    height: 46px;
    font-size: 0.9333rem;
    font-weight: 500;
    border-radius: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exam-actions-row .btn:active {
    transform: scale(0.97);
    opacity: 0.85;
}
.exam-actions-row .btn[style*="visibility:hidden"],
.exam-actions-row .btn.btn-disabled-ghost {
    visibility: visible !important;
    opacity: 0.35 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.answer-card-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 12px;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.answer-card-cell {
    aspect-ratio: 1;
    min-height: 38px;
    font-weight: 600;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn {
    min-height: 44px;
    line-height: 1;
    padding: 0 18px;
    border-radius: 10px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    font-size: 0.9333rem;
    font-weight: 500;
}
.form-input,
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.9333rem;
    line-height: 1.3;
    -webkit-appearance: none;
    appearance: none;
}
textarea {
    min-height: 100px;
    padding: 12px 14px;
    line-height: 1.6;
}

.progress-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff7e6, #ffe7ba);
    border: 1px solid #ffd591;
    border-radius: 10px;
    color: #873800;
}
.progress-banner .pb-left { flex: 1; min-width: 0; }
.progress-banner .pb-title {
    font-weight: 600;
    font-size: 0.9333rem;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.progress-banner .pb-desc {
    font-size: 0.85rem;
    color: #ad4e00;
    opacity: 0.9;
}
.continue-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 14px;
    height: 38px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
}
.continue-btn:active { transform: scale(0.96); }
.clear-progress-btn {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid #ffa940;
    color: #ad4e00;
    border-radius: 8px;
    padding: 0 8px;
    height: 30px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-right: 4px;
}

.question-container {
    padding: 0 14px 24px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}
.question-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.question-type {
    display: inline-block;
    margin-bottom: 10px;
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 500;
    background: #f0f4ff;
    padding: 3px 10px;
    border-radius: 12px;
}
.question-stem {
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 16px;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: break-word;
}
.options-list {
    list-style: none;
    margin-bottom: 12px;
}
.option-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    background: #fafbff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    word-break: break-word;
}
.option-item:active { background: #eef1ff; border-color: #c7d2fe; }
.option-item.selected {
    background: #eef2ff;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.10);
}
.option-label {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #d1d5db;
    color: #6b7280;
    text-align: center;
    font-weight: 700;
    font-size: 0.9333rem;
}
.option-item.selected .option-label {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}
.option-content {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
    font-size: 0.9333rem;
    line-height: 1.65;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: break-word;
}

.option-item.correct {
    background: linear-gradient(135deg, #f6ffed, #eaffdf);
    border-color: #73d13d;
}
.option-item.correct .option-label {
    background: #52c41a;
    color: #fff;
    border-color: #52c41a;
}
.option-item.wrong {
    background: linear-gradient(135deg, #fff2f0, #ffd9d4);
    border-color: #ff7875;
}
.option-item.wrong .option-label {
    background: #ff4d4f;
    color: #fff;
    border-color: #ff4d4f;
}

.exam-toolbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.exam-toolbar::-webkit-scrollbar { display: none; }
.font-controls {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}
.font-controls .tool-btn {
    min-width: 30px;
    padding: 4px 8px;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.exam-toolbar .tool-btn {
    flex-shrink: 0;
}

@media (orientation: landscape) and (max-height: 500px) {
    .exam-header { padding: 4px 12px; }
    .exam-toolbar { padding: 4px 12px; }
    .exam-toolbar .tool-btn { font-size: 0.8rem; }
    .question-card { padding: 12px; margin-top: 8px; }
    .question-stem { font-size: 0.9333rem; line-height: 1.7; margin-bottom: 10px; }
    .option-item { padding: 8px 12px; margin-bottom: 6px; }
    .option-label { width: 26px; height: 26px; line-height: 26px; }
    .exam-actions-row { padding: 6px 12px !important; gap: 6px !important; }
    .exam-actions-row .btn { height: 40px; font-size: 0.85rem; }
    .exam-wrapper { padding-bottom: 130px; }
}

@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    select,
    textarea,
    .search-input,
    .form-input {
        font-size: 16px !important;
    }
}



/* =============== 首页/通用：底部导航 fixed，强制 .container 保留底部占位 =============== */
body > .container,
.container {
    padding-bottom: 180px !important;
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body > .container,
    .container {
        padding-bottom: calc(170px + env(safe-area-inset-bottom)) !important;
    }
}
@media (max-width: 375px) {
    body > .container, .container { padding-bottom: 190px !important; }
}
@media (max-width: 320px) {
    body > .container, .container { padding-bottom: 200px !important; }
}
