:root {
    --primary: #3BBCBC;
    --primary-dark: #1A8080;
    --primary-light: #E6F7F7;
    --secondary: #F5A623;
    --success: #52C41A;
    --warning: #F5A623;
    --danger: #FF4D4F;
    --bg: #F2F2F7;
    --card-bg: #ffffff;
    --text: #1A1A1A;
    --text-light: #666666;
    --text-lighter: #999999;
    --border: #E5E5EA;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-btn: 0 4px 12px rgba(59, 188, 188, 0.25);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-btn: 25px;
    --font-base: 15px;
}

html.dark {
    --primary: #4FC9C9;
    --primary-dark: #7DD3D3;
    --primary-light: #1A4F4F;
    --bg: #152528;
    --card-bg: #1F2D30;
    --text: #F1F5F5;
    --text-light: #A0AEC0;
    --text-lighter: #7A8B8F;
    --border: #334B4F;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-btn: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: var(--font-base);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px;
}

.app-header {
    text-align: center;
    margin-bottom: 28px;
}

.app-header h1 {
    font-size: 22px;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-light);
    font-size: 15px;
}

/* 用户登录状态 */
.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.user-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.user-status {
    color: var(--text-light);
}

.user-status.logged-in {
    color: var(--success);
    font-weight: 600;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* 错误提示（弹窗内） */
.error-message {
    background: #FEF2F2;
    color: var(--danger);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-top: 12px;
}

html.dark .error-message {
    background: rgba(229, 115, 115, 0.15);
}

/* 顶部导航 */
.app-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 8px;
    border-radius: var(--radius-btn);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

/* 全局学段/年级选择条 */
.global-grade-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.global-grade-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.global-grade-label {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.global-grade-selects {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 220px;
}

.global-grade-selects select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #F8F8F8;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.global-grade-selects select:disabled {
    background: var(--primary-light);
    color: var(--text);
    opacity: 0.8;
    cursor: not-allowed;
}

.global-grade-selects select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
}

.global-grade-bar .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: var(--radius-sm);
}

.global-grade-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.grade-required-hint {
    margin: 12px 0 4px;
    font-size: 14px;
    color: var(--danger);
}

@media (max-width: 480px) {
    .global-grade-content {
        gap: 10px;
    }
    .global-grade-selects {
        width: 100%;
        min-width: 0;
    }
    .global-grade-bar .btn {
        flex: 1;
    }
}

/* 模式切换 */
.mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    background: var(--primary-light);
    border-radius: var(--radius-btn);
}

.mode-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.mode-btn:hover {
    color: var(--text);
}

.mode-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* 页面说明 */
.page-info h2 {
    font-size: 18px;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.page-info p {
    color: var(--text-light);
    line-height: 1.6;
}

/* 老师欢迎区 */
.teacher-welcome {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
    border: 1px solid #B8E0E8;
}

.teacher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.teacher-message p {
    margin-bottom: 10px;
}

.teacher-message p:last-child {
    margin-bottom: 0;
}

.teacher-tip {
    color: var(--primary-dark);
    font-size: 13px;
    background: rgba(64, 168, 184, 0.08);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 12px;
    transition: background 0.3s, box-shadow 0.2s;
}

.section-header {
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    color: var(--primary-dark);
}

.ai-setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
}

.ai-setting-toggle {
    font-size: 14px;
    color: var(--primary);
    user-select: none;
}

.ai-setting-body {
    margin-top: 16px;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.word-count {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 6px;
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.info-section {
    background: var(--primary-light);
    border: 1px solid #B8E0E8;
    color: var(--primary-dark);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 15px;
}

html.dark .info-section {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.history-filter {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.history-filter input,
.history-filter select {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
}

.thinking-toggle-group {
    margin-bottom: 12px;
}

.thinking-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
    font-size: 15px;
}

.thinking-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.thinking-hint {
    margin-top: 4px;
    margin-bottom: 0;
    font-size: 13px;
    color: var(--text-light);
}

@media (min-width: 600px) {
    .history-filter {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group .checkbox-label,
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
}

.form-group .checkbox-label input[type="checkbox"],
.checkbox-label input[type="checkbox"] {
    width: auto;
    min-width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.genre-tips-link {
    float: right;
    font-size: 12px;
    font-weight: normal;
    color: var(--primary);
    text-decoration: none;
    margin-left: 8px;
}

.genre-tips-link:hover {
    text-decoration: underline;
}

.textarea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.textarea-header label {
    margin-bottom: 0;
}

.clear-textarea-btn {
    padding: 2px 8px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.clear-textarea-btn:hover {
    color: var(--danger);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #F8F8F8;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 188, 188, 0.12);
    background: var(--card-bg);
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.hint {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 6px;
}

.hint.success {
    color: #166534;
}

.hint.error {
    color: #991b1b;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.modal-body .form-actions {
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    height: 50px;
    border-radius: var(--radius-btn);
    padding: 0 28px;
    font-size: 16px;
}

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

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-btn);
    -webkit-tap-highlight-color: transparent;
}

.form-actions .btn-primary {
    min-width: 200px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.btn-label-short {
    display: none;
}

.btn-primary:disabled {
    background: #A5D8E0;
    color: #ffffff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--primary-dark);
    border: 1px solid var(--primary);
}

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

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-section {
    background: #FEF2F2;
    border: 1px solid #FDCACA;
    color: #B91C1C;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 15px;
}

.results-section {
    animation: fadeIn 0.4s ease-out;
}

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

.results-header h2 {
    font-size: 1.4rem;
}

.results-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.results-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 1rem;
}

.results-loading .spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
}

html.dark .results-loading .spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
}

.result-source-info {
    background: var(--primary-light);
    border: 1px solid #B8E0E8;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-top: 8px;
}

.result-source-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.result-source-item {
    margin-bottom: 8px;
    line-height: 1.5;
}

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

.result-source-label {
    font-weight: 600;
    color: var(--text);
}

.result-source-value {
    color: var(--text-light);
}

html.dark .result-source-info {
    background: var(--primary-light);
    border-color: var(--border);
}

.result-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.samples-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-subtitle {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 400;
}

.result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.chat-hint {
    flex: 1 1 100%;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    line-height: 1.4;
    text-align: right;
}

.action-btn,
.copy-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.action-btn:hover,
.copy-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.edit-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.chat-btn:hover {
    background: #FFF3E0;
    border-color: var(--secondary);
    color: #B8731A;
}

.save-btn:hover {
    background: #E6FAF5;
    border-color: var(--success);
    color: #2A8F7A;
}

.cancel-btn:hover {
    background: #FEF2F2;
    border-color: var(--danger);
    color: #B91C1C;
}

.result-body {
    padding: 18px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

.result-body p {
    margin-bottom: 12px;
}

.result-body ul,
.result-body ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.result-body li {
    margin-bottom: 8px;
}

.result-body .highlight {
    background: #fef9c3;
    padding: 2px 4px;
    border-radius: 4px;
}

/* 编辑模式 */
.edit-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    min-height: 150px;
    background: var(--card-bg);
}

.edit-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(64, 168, 184, 0.12);
}

/* 讨论弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--primary-light);
}

.modal-header h3 {
    font-size: 16px;
    color: var(--primary-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 16px 20px;
}

.genre-tips-intro {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.5;
}

.genre-tips-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.genre-tip-tab {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.genre-tip-tab:hover,
.genre-tip-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.genre-tips-content {
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin: 0;
    color: var(--text);
}

.chat-context {
    flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
}

.context-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 4px;
}

.context-content {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    max-height: 45vh;
    padding-right: 4px;
}

.chat-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.chat-message.teacher {
    flex-direction: row;
}

.chat-message.student {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--bg);
}

.chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
}

.chat-message.teacher .chat-bubble {
    background: var(--primary-light);
    border-bottom-left-radius: 4px;
}

.chat-message.student .chat-bubble {
    background: #FFF3E0;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.chat-input-area textarea {
    flex: 1;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    background: var(--card-bg);
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64, 168, 184, 0.12);
}

.chat-input-area .btn {
    padding: 0 20px;
}

.apply-action {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* 范文参考 */
.sample-essay {
    background: var(--bg);
    border-left: 4px solid var(--primary);
    padding: 16px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    line-height: 1.8;
    color: var(--text);
    font-size: 15px;
}

/* 作文评分 */
.score-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 15px;
}

.score-table th,
.score-table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}

.score-table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.score-table tr:nth-child(even) {
    background: var(--bg);
}

.score-cell {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    text-align: center;
}

.score-cards {
    display: none;
}

/* 历史记录 */
.history-section h2 {
    font-size: 18px;
    color: var(--text);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    height: auto;
}

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

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-empty {
    color: var(--text-light);
    font-size: 0.95rem;
    text-align: center;
    padding: 16px 0;
}

.history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.history-pagination button {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.history-pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.history-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.history-item:hover {
    background: var(--bg);
    box-shadow: var(--shadow);
}

.history-topic {
    font-weight: 500;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.history-meta {
    font-size: 13px;
    color: var(--text-light);
}

.history-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.history-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

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

.history-btn.delete-btn:hover {
    background: #FEF2F2;
    border-color: var(--danger);
}

.app-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    margin-top: 32px;
}

.beian-record {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

.beian-record a {
    color: var(--text-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.beian-icon {
    width: auto;
    height: 16px;
    vertical-align: middle;
}

.icp-record {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.hidden {
    display: none !important;
}

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

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

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* 深色模式补充 */
html.dark body {
    background: var(--bg);
}

html.dark .form-group input,
html.dark .form-group textarea,
html.dark .form-group select,
html.dark .chat-input-area textarea {
    background: #152528;
    color: var(--text);
    border-color: var(--border);
}

html.dark .sample-essay,
html.dark .chat-message.teacher .chat-bubble,
html.dark .history-item {
    background: #152528;
}

html.dark .score-table tr:nth-child(even) {
    background: #152528;
}

html.dark .btn-secondary {
    background: var(--card-bg);
}

@media (max-width: 600px) {
    .app-header h1 {
        font-size: 1.5rem;
    }
    .teacher-welcome {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 14px;
        gap: 8px;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
    }

    .chat-hint {
        margin-top: 0;
        font-size: 11px;
        text-align: center;
    }

    .app-footer {
        margin-top: 24px;
        padding: 16px 12px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    .chat-bubble {
        max-width: 85%;
    }

    /* 导航项两行显示，避免被挤成 3+1 */
    .app-nav {
        gap: 4px;
        padding: 6px;
    }

    .nav-item {
        padding: 8px 2px;
        font-size: 13px;
        line-height: 1.35;
    }

    /* 顶部年级选择条避免按钮盖住下拉框 */
    .global-grade-content {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .global-grade-label {
        margin-bottom: 2px;
    }

    .global-grade-selects {
        width: 100%;
        min-width: 0;
    }

    .global-grade-selects select {
        width: 100%;
    }

    .global-grade-bar .btn {
        width: 100%;
    }

    /* 主操作按钮固定在底部 */
    .sticky-actions {
        position: sticky;
        bottom: 0;
        margin: 16px -16px -24px;
        padding: 12px 16px;
        background: var(--card-bg);
        border-top: 1px solid var(--border);
        z-index: 50;
    }

    html.dark .sticky-actions {
        background: var(--card-bg);
    }

    .sticky-actions .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .sticky-actions .btn {
        width: 100%;
    }

    .btn-label-full {
        display: none;
    }

    .btn-label-short {
        display: inline;
    }

    /* 结果卡片操作按钮紧凑排列 */
    .result-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .result-actions .action-btn,
    .result-actions .copy-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 64px;
        padding: 8px 4px;
        font-size: 0.8rem;
        text-align: center;
        justify-content: center;
    }

    /* 评分表格改为卡片式 */
    .score-table {
        display: none;
    }

    .score-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .score-card {
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 12px;
    }

    html.dark .score-card {
        background: #152528;
    }

    .score-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .score-card-name {
        font-weight: 600;
        color: var(--text);
    }

    .score-card-score {
        font-weight: 700;
        color: var(--primary);
    }

    .score-card-comment {
        color: var(--text-light);
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* 讨论弹窗改为 bottom sheet */
    .modal {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        animation: sheetIn 0.3s ease-out;
    }

    .modal-header {
        position: relative;
        flex-direction: column;
        align-items: stretch;
        padding-top: 8px;
        border-radius: 16px 16px 0 0;
    }

    .modal-header h3 {
        margin-top: 12px;
        padding-right: 36px;
    }

    .modal-close {
        position: absolute;
        top: 16px;
        right: 16px;
    }

    /* 拖拽指示条 */
    .sheet-handle {
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
        margin: 0 auto;
    }

    @keyframes sheetIn {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* 讨论弹窗移动端紧凑布局 */
    .chat-context {
        padding: 8px;
        font-size: 13px;
        margin-bottom: 8px;
    }

    .chat-input-area textarea {
        min-height: 40px;
        padding: 8px 10px;
    }

    .chat-input-area .btn {
        padding: 0 14px;
    }
}

/* AI 模型选择按钮组 */
.ai-profile-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.ai-profile-btn {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ai-profile-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ai-profile-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

.ai-profile-label {
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.ai-service-hint {
    width: 100%;
    font-size: 13px;
    color: var(--text-light);
    margin-top: -6px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.ai-service-hint.doubao-hint {
    color: #B8731A;
    background: #FFF8F0;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid #F5A623;
}

/* 流式生成面板 */
.stream-panel {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--primary-light);
    background: var(--card-bg);
}

.stream-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 12px;
}

.stream-header .spinner {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.stream-output {
    max-height: 240px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

html.dark .stream-output {
    background: #152528;
}

/* ---------- 范文/写作示例页面 ---------- */
.sample-outline {
    margin: 0.5rem 0 1rem 1.25rem;
    font-size: 14px;
    line-height: 1.7;
}

.sample-outline li {
    margin-bottom: 0.35rem;
}

.sample-fragment {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.fragment-part {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}

.fragment-content {
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.fragment-guidance {
    font-size: 13px;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

.sample-sentences {
    margin-top: 0.75rem;
}

.sample-sentence-row {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    line-height: 1.7;
}

.sentence-label {
    font-weight: 600;
    color: var(--text-light);
    margin-right: 0.25rem;
}

/* ---------- Tab 切换（评分结果 / 历史记录） ---------- */
.result-tabs-section {
    padding-top: 0.5rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.empty-tab-hint {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
}

.empty-tab-hint p {
    margin: 0.5rem 0;
}

/* ---------- 看图写话图片上传 ---------- */
.file-upload-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -1;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.file-upload-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    word-break: break-all;
}

.picture-preview {
    margin-top: 0.75rem;
    max-width: 320px;
}

.picture-preview img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.picture-status {
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

.picture-description-result {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text);
    line-height: 1.6;
}

.picture-description-result p {
    margin: 0.5rem 0 0;
}

/* ===================== 素材库 ===================== */

.material-search-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.material-search-inline input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
}

.material-search-inline input:focus {
    outline: none;
    border-color: var(--primary);
}

.material-tip {
    padding: 14px 18px;
    background: var(--primary-light, #E6F4F7);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

.material-tip p {
    margin: 0;
}

.material-browse {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.material-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
    min-height: 20px;
}

.breadcrumb-separator {
    color: var(--border);
}

.breadcrumb-link {
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.material-level {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-scene-box {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    animation: materialPanelFadeIn 0.2s ease;
}

.custom-scene-box input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
}

.custom-scene-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.custom-scene-bubble {
    border-style: dashed;
    color: var(--primary);
}

.level-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.bubble-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bubble-tag {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.bubble-tag:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.bubble-tag.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.material-result-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.material-section h4 {
    font-size: 15px;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.material-chip {
    display: inline-block;
    padding: 5px 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 14px;
}

.material-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.material-list li {
    position: relative;
    padding-left: 18px;
    line-height: 1.6;
    color: var(--text);
}

.material-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* 收藏区 */
.favorites-section {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--card-bg) 100%);
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.favorites-header h3 {
    font-size: 16px;
    color: var(--primary-dark);
    margin: 0;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.favorite-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.favorite-title {
    font-weight: 600;
    color: var(--text);
}

.favorite-path {
    font-size: 13px;
    color: var(--text-light);
    flex-basis: 100%;
}

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

html.dark .favorites-section {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--card-bg) 100%);
}

html.dark .material-search-inline input {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
}

/* 统一的浏览器标签页样式（素材库 & 拆解思路结果区） */
.material-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 16px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
}

.material-tab {
    flex: 0 1 auto;
    padding: 9px 18px 9px;
    margin-bottom: -1px;
    border: 1px solid transparent;
    border-top-width: 2px;
    border-bottom-color: transparent;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
    z-index: 0;
}

.material-tab:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text);
}

.material-tab.active {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
    border-bottom-color: var(--bg);
    border-top-color: var(--primary);
    font-weight: 600;
    z-index: 1;
}

.material-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transform: translateY(8px);
}

.material-panel.active {
    display: flex;
    animation: materialPanelFadeIn 0.25s ease forwards;
}

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

html.dark .material-tabs {
    background: var(--bg);
}

html.dark .material-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

html.dark .material-tab.active {
    background: var(--bg);
    border-bottom-color: var(--bg);
}

/* 弱项追踪 / 写作能力报告 */
.ability-report-section {
    margin-top: 0;
    padding: 16px 20px;
}

.ability-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ability-report-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--primary-dark);
}

.ability-report-section > .hint {
    margin: 0 0 12px;
    font-size: 13px;
}

.ability-summary {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--bg);
    border-left: 4px solid var(--primary);
}

.ability-summary h4,
.ability-overall-suggestion h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--primary-dark);
}

.ability-summary p,
.ability-overall-suggestion p {
    margin: 0;
    line-height: 1.6;
}

.ability-dimensions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ability-dimension {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--card-bg);
}

.ability-dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--primary-light);
    font-weight: 600;
}

.ability-dimension-score {
    font-size: 14px;
    color: var(--primary-dark);
}

.ability-dimension-body {
    padding: 12px;
}

.ability-dimension-body .hint {
    margin: 0;
}

.ability-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin: 10px 0 6px;
}

.ability-subtitle:first-child {
    margin-top: 0;
}

.ability-issue-list,
.ability-suggestion-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.6;
}

.ability-issue-list li,
.ability-suggestion-list li {
    margin-bottom: 4px;
}

.ability-dimension.weak .ability-dimension-header {
    background: #FEF2F2;
    color: #B91C1C;
}

.ability-dimension.average .ability-dimension-header {
    background: #FFF3E0;
    color: #B8731A;
}

.ability-dimension.good .ability-dimension-header {
    background: #E6FAF5;
    color: #2A8F7A;
}

.ability-overall-suggestion {
    padding: 14px 16px;
    background: var(--bg);
    border-left: 4px solid var(--secondary);
}

/* ===== 新版顶部栏与底部 TabBar ===== */
.app-top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 60px;
    background: var(--primary);
    color: #ffffff;
}

.app-top-bar-content {
    max-width: 760px;
    height: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 12px;
}

.app-top-title {
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
    text-align: left;
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-top-actions {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.top-user-status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.top-action-btn {
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    border: none;
    background: rgba(26, 128, 128, 0.9);
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.top-action-btn:hover {
    background: rgba(26, 128, 128, 1);
}

.bottom-tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: 76px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-tab-bar .tab-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-lighter);
    font-size: 11px;
    transition: color 0.2s;
    position: relative;
}

.bottom-tab-bar .tab-item.active {
    color: var(--primary);
}

.bottom-tab-bar .tab-icon-wrap {
    position: relative;
    width: 28px;
    height: 28px;
}

.bottom-tab-bar .tab-icon,
.bottom-tab-bar .tab-icon-active {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.2s;
}

.bottom-tab-bar .tab-icon {
    opacity: 0.7;
}

.bottom-tab-bar .tab-icon-active {
    opacity: 0;
    pointer-events: none;
}

.bottom-tab-bar .tab-item.active .tab-icon {
    opacity: 0;
}

.bottom-tab-bar .tab-item.active .tab-icon-active {
    opacity: 1;
}

.container {
    padding-bottom: 92px;
}

.app-footer {
    padding-bottom: 92px;
}

.theme-toggle {
    bottom: 92px;
}

/* 隐藏旧的顶部导航 */
.app-nav {
    display: none;
}

.app-header {
    display: none;
}

/* ===== AI 设置行（参考 Frame2304） ===== */
.ai-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: 12px;
}

.ai-setting-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.ai-setting-icon {
    width: 22px;
    height: 22px;
}

.ai-setting-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--primary);
}

.ai-setting-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.ai-setting-row.expanded .ai-setting-arrow {
    transform: rotate(180deg);
}

.ai-setting-body {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

/* 老师欢迎语弱化 */
.teacher-welcome {
    display: none;
}

/* 隐藏页面顶部介绍卡片，贴近参考设计 */
.page-info {
    display: none;
}
