/* ========================================
   北瓜大四六英语 - 样式文件
   ======================================== */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* 主题色 - 高级蓝色系 */
    --primary-color: #2563EB;
    --primary-light: #EFF6FF;
    --primary-dark: #1D4ED8;
    --accent-color: #0EA5E9;
    
    /* 背景色 */
    --bg-primary: #F8FAFC;
    --bg-white: #FFFFFF;
    --bg-gradient-start: #1E40AF;
    --bg-gradient-end: #3B82F6;
    
    /* 文字颜色 */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    
    /* 边框颜色 */
    --border-color: #E2E8F0;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 999px;
}

/* ========================================
   登录注册页面样式
   ======================================== */
#login-page,
#register-page {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#login-page:not(.active),
#register-page:not(.active) {
    display: none;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    position: relative;
}

.login-form input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.login-form input::placeholder {
    color: var(--text-tertiary);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

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

.btn-login::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:active::after {
    width: 300px;
    height: 300px;
}

.login-footer {
    text-align: center;
    margin-top: 10px;
}

.link-register {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.link-register:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

input, textarea {
    font-family: inherit;
}

/* ========================================
   Page Container
   ======================================== */
.page-container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* ========================================
   Header
   ======================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.header-back:active {
    background: var(--bg-primary);
}

.header-back svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

/* ========================================
   Bottom Navigation
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 12px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 24px;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
}

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

.nav-item svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.nav-item:active svg {
    transform: scale(0.95);
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* ========================================
   Home Page
   ======================================== */

/* Banner - 高级蓝色渐变 */
.banner {
    position: relative;
    padding: 32px 20px;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 50%, #0EA5E9 100%);
    color: white;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.banner-content {
    position: relative;
    z-index: 1;
}

.banner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.app-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.exam-types {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.exam-type {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

.vip-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.banner-decoration {
    position: absolute;
    right: -30px;
    top: -30px;
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
    border-radius: 50%;
}

/* 底部导航留白 */
.home-content {
    padding-bottom: 80px;
}

/* 考试类型切换 */
.type-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.current-type {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.switch-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.switch-icon {
    font-size: 12px;
}

/* 功能模块 */
.module-card {
    margin: 16px;
    padding: 24px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.module-card .module-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-card .module-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 2px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 16px 12px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    background: var(--bg-primary);
    border: 1px solid transparent;
}

.feature-item:hover {
    background: var(--bg-white);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature-item:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: transform 0.3s ease;
}

.feature-item:hover .feature-icon {
    transform: scale(1.05);
}

.feature-icon svg {
    width: 26px;
    height: 26px;
}

.icon-practice {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
}

.icon-special {
    background: linear-gradient(135deg, #0EA5E9 0%, #38BDF8 100%);
}

.icon-listening {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
}

.icon-vocab {
    background: linear-gradient(135deg, #2563EB 0%, #60A5FA 100%);
}

.icon-phrase {
    background: linear-gradient(135deg, #3B82F6 0%, #93C5FD 100%);
}

.icon-record {
    background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 100%);
}

.icon-notebook {
    background: linear-gradient(135deg, #2563EB 0%, #818CF8 100%);
}

.icon-guide {
    background: linear-gradient(135deg, #0EA5E9 0%, #60A5FA 100%);
}

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

/* ========================================
   页面头部
   ======================================== */
.page-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.back-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

/* ========================================
   练习页面样式
   ======================================== */
.practice-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.practice-header h1 {
    font-size: 16px;
}

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

.timer {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: monospace;
}

.practice-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.footer-btn {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    transition: all 0.2s;
}

.footer-btn.primary {
    background: var(--primary-color);
    color: white;
}

.footer-btn.submit-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
    color: white;
}

.footer-btn:active {
    opacity: 0.8;
}

.question-indicator {
    font-size: 14px;
    color: var(--text-secondary);
}

.question-indicator #current-num {
    color: var(--primary-color);
    font-weight: 600;
}

/* ========================================
   真题列表
   ======================================== */
.year-selector {
    padding: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.year-item {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-white);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.year-item.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.exam-list {
    padding: 16px;
}

.exam-month-group {
    margin-bottom: 24px;
}

.exam-month-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.exam-set-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.exam-set-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    transition: transform 0.2s;
}

.exam-set-item:active {
    transform: scale(0.95);
}

/* ========================================
   听力精炼列表
   ======================================== */
.listening-list {
    padding: 0 16px 100px;
}

.listening-set-group {
    margin-bottom: 24px;
}

.listening-set-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.listening-type-title {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.listening-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.listening-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    transition: transform 0.2s;
}

.listening-item:active {
    transform: scale(0.95);
}

/* ========================================
   练习页面
   ======================================== */
.practice-page {
    padding-bottom: 80px;
}

.practice-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.practice-progress {
    font-size: 14px;
    color: var(--text-tertiary);
}

.practice-progress .current {
    color: var(--primary-color);
    font-weight: 600;
}

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

.action-btn {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.action-btn:active {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* 顶部按钮区域 */
.top-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-white);
}

.catalog-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    width: fit-content;
}

.catalog-btn span {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.original-text-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    width: fit-content;
}

.original-text-btn span {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.original-text-btn.active {
    background: var(--primary-color);
}

.original-text-btn.active span {
    color: white;
}

.text-tabs {
    display: none;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-white);
}

.text-tab {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    transition: all 0.2s;
}

.text-tab.active {
    background: var(--primary-color);
    color: white;
}

/* 题目容器 */
.question-container {
    padding: 16px 16px 60px;
}

/* 听力原文区域 */
.original-text,
.translation-text {
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-top: 12px;
}

/* ========================================
   写作区域
   ======================================== */
.writing-section {
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
}

.directions {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.writing-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    resize: vertical;
}

.writing-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.writing-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

/* ========================================
   翻译区域
   ======================================== */
.translation-section {
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
}

.source-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ========================================
   题目卡片
   ======================================== */
.question-item {
    margin-bottom: 16px;
}

.question-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.question-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* 选项列表 */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:active {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.option-item.selected {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.option-item.correct {
    background: #D4EDDA;
    border-color: #28A745;
}

.option-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.option-item.selected .option-radio {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.option-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 8px;
}

.option-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    flex: 1;
}

/* ========================================
   底部导航栏
   ======================================== */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    transition: all 0.2s;
}

.nav-btn:active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   音频播放器
   ======================================== */
.audio-player {
    display: none;
    padding: 12px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

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

.audio-left,
.audio-right {
    flex: 0 0 auto;
}

.audio-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1;
}

.audio-catalog-btn {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.original-text-btn {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.original-text-btn.active {
    background: var(--primary-color);
    color: white;
}

.audio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    transition: background 0.2s;
}

.audio-btn:active {
    background: var(--primary-dark);
}

.audio-btn svg {
    width: 18px;
    height: 18px;
}

.audio-btn.small {
    width: 32px;
    height: 32px;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.audio-btn.small svg {
    width: 16px;
    height: 16px;
}

.audio-progress {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s linear;
}

.time-display {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ========================================
   答题卡
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.answer-grid {
	padding:15px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-tertiary);
}

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

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

.answer-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.answer-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.answer-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.answer-number:active {
    transform: scale(0.95);
}

.answer-number.answered {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.answer-number.correct {
    background: #28A745;
    border-color: #28A745;
    color: white;
}

.answer-number.wrong {
    background: #DC3545;
    border-color: #DC3545;
    color: white;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.btn-secondary,
.btn-primary {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary {
	margin: 20px;
    height: 50px;
    background: var(--primary-color);
    color: white;
}

.btn-secondary:active,
.btn-primary:active {
    opacity: 0.8;
}

/* ========================================
   解析区域
   ======================================== */
.explanation-section {
    margin-top: 16px;
    padding: 16px;
    background: #FFF9E6;
    border-radius: var(--radius-md);
}

.explanation-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.correct-answer {
    font-size: 14px;
    font-weight: 500;
    color: #28A745;
    margin-bottom: 8px;
}

.explanation-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-text {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ========================================
   目录弹窗
   ======================================== */
.catalog-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
}

.catalog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.catalog-content {
    position: relative;
    width: 280px;
    height: 100%;
    background: var(--bg-white);
    animation: slideInLeft 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

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

.catalog-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    font-size: 24px;
    color: var(--text-tertiary);
    padding: 0 8px;
}

.catalog-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.catalog-section-title {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.catalog-item {
    padding: 14px 20px;
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.catalog-item:hover {
    background: var(--bg-primary);
}

.catalog-item.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: rgba(91, 140, 90, 0.05);
    font-weight: 500;
}

/* ========================================
   选词填空样式
   ======================================== */
.cloze-passage {
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.cloze-blank {
    display: inline-block;
    min-width: 40px;
    padding: 2px 8px;
    background: #FFF3CD;
    border: 1px solid #FFC107;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    margin: 0 2px;
}

.cloze-blank:hover {
    background: #FFE69C;
}

.cloze-blank.filled {
    background: #D4EDDA;
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.cloze-options-area {
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.option-btn {
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
}

.option-btn:hover {
    background: #E8F5E9;
    border-color: var(--primary-color);
}

.option-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.option-btn.disabled {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ========================================
   段落匹配样式
   ======================================== */
.matching-passage {
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.paragraph-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.paragraph-letter {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
}

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

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

.matching-section .question-btn {
    display: inline-block;
}

.matching-options-area {
    margin-top: 12px;
}

/* ========================================
   阅读理解样式
   ======================================== */
.reading-section {
    margin-bottom: 16px;
}

.reading-section .passage-text {
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.reading-section .question-btn {
    display: inline-block;
}

.reading-options-area {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
}

/* ========================================
   题目按钮通用样式
   ======================================== */
.question-btn {
	line-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.question-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.question-btn.answered {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 题目按钮容器 - 横向排列 */
.question-btn-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
}

/* 段落匹配选项网格 */
.matching-options-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.matching-options-grid .option-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 8px;
}

.matching-options-grid .option-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.matching-options-grid .option-item.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.matching-options-grid .option-item.selected .option-letter {
    color: white;
}

.matching-options-grid .option-item.disabled {
    background: var(--bg-primary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.matching-options-grid .option-item.disabled:hover {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.option-letter {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ========================================
   专项练习
   ======================================== */
.special-type-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.special-type-item:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.special-type-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.special-type-info {
    flex: 1;
    margin-left: 14px;
}

.special-type-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.special-type-desc {
    font-size: 13px;
    color: var(--text-tertiary);
}

.special-type-arrow {
    font-size: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* ========================================
   Page transitions
   ======================================== */

/* ========================================
   首页统计卡片
   ======================================== */
.home-stats-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 16px;
    padding: 20px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.home-stat-item {
    text-align: center;
    padding: 12px 4px;
    border-radius: var(--radius-sm);
    transition: transform 0.2s;
}

.home-stat-item:active {
    transform: scale(0.98);
}

.home-stat-item.blue {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}

.home-stat-item.blue .home-stat-value {
    color: #2563EB;
}

.home-stat-item.green {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
}

.home-stat-item.green .home-stat-value {
    color: #16A34A;
}

.home-stat-item.orange {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
}

.home-stat-item.orange .home-stat-value {
    color: #EA580C;
}

.home-stat-item.red {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
}

.home-stat-item.red .home-stat-value {
    color: #DC2626;
}

.home-stat-value {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.home-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   个人中心
   ======================================== */
.profile-user {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 20px 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.profile-avatar svg {
    width: 36px;
    height: 36px;
}

.profile-user-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-nickname {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-vip-tag {
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-primary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    width: fit-content;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-white);
    margin: 0 16px 16px;
    padding: 20px 12px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-item:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.profile-menu {
    background: var(--bg-white);
    margin: 0 16px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-menu-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.profile-menu-item:active {
    background: var(--bg-primary);
}

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-icon svg {
    width: 20px;
    height: 20px;
}

.menu-text {
    flex: 1;
    margin-left: 14px;
    font-size: 15px;
    color: var(--text-primary);
}

.menu-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
}

.profile-section {
    margin: 0 16px 16px;
}

.section-title {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    padding-left: 4px;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.quick-access-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.quick-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.quick-icon svg {
    width: 24px;
    height: 24px;
}

.quick-access-item span {
    font-size: 12px;
    color: var(--text-secondary);
}
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   Loading states
   ======================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   Utilities
   ======================================== */
.text-center {
    text-align: center;
}

.mt-16 {
    margin-top: 16px;
}

.mb-16 {
    margin-bottom: 16px;
}

.p-16 {
    padding: 16px;
}

.hidden {
    display: none !important;
}
