:root {
    --primary: #4f7ef7;
    --primary-dark: #3a66d8;
    --primary-light: #eef3ff;
    --accent: #f59e0b;
    --success: #22c55e;
    --success-light: #e7f9ef;
    --danger: #ef4444;
    --danger-light: #fdeaea;
    --warning: #f59e0b;
    --warning-light: #fef3e2;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --bg: #f3f5f9;
    --card-bg: #ffffff;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 16px rgba(17, 24, 39, 0.08);
    --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.14);
    --shadow-hover: 0 8px 24px rgba(79, 126, 247, 0.18);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 12px;
}
a { text-decoration: none; color: inherit; }

/* ================= 导航栏 ================= */
.navbar {
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: linear-gradient(135deg, #4f7ef7 0%, #3a66d8 100%);
    color: white;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(58, 102, 216, 0.28);
}
.nav-brand { font-size: 20px; font-weight: 700; margin-right: 32px; letter-spacing: 0.5px; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-link {
    padding: 7px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.85);
}
.nav-link:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.nav-link.active { background: rgba(255, 255, 255, 0.24); font-weight: 600; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.2); }
.nav-user { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.nav-name { font-weight: 500; white-space: nowrap; }
.btn-logout {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.btn-logout:hover { background: rgba(255, 255, 255, 0.3); }
.nav-version { font-size: 11px; background: rgba(255, 255, 255, 0.14); padding: 4px 10px; border-radius: 20px; color: rgba(255,255,255,0.85); }

/* 积分徽章 */
.nav-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border-radius: 22px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    letter-spacing: 0.5px;
}
.nav-points-badge:hover { transform: scale(1.05); box-shadow: 0 6px 16px rgba(245, 158, 11, 0.55); }

.points-flash { animation: pointsPulse 0.6s ease-in-out 2; }
@keyframes pointsPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
    50% { transform: scale(1.18); box-shadow: 0 0 22px rgba(245, 158, 11, 0.85); }
}

/* ================= 主内容区 ================= */
.main-content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.main-content.with-nav { padding-top: 20px; }

/* 页面标题统一风格 */
.calendar-page h2, .shop-page h2, .profile-page h2, .points-detail-page h2,
.manage-students-page h2, .task-manage-page h2, .parent-checkins-page h2,
.shop-manage-page h2, .parent-orders-page h2, .adjust-points-page h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-left: 14px;
    position: relative;
}
.calendar-page h2::before, .shop-page h2::before, .profile-page h2::before,
.points-detail-page h2::before, .manage-students-page h2::before,
.task-manage-page h2::before, .parent-checkins-page h2::before,
.shop-manage-page h2::before, .parent-orders-page h2::before, .adjust-points-page h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 5px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

/* ================= 认证页面 ================= */
.auth-page { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 20px); }
.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 420px;
    max-width: 95%;
    border: 1px solid var(--border);
}
.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-card .version-info { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
/* 登录卡片底部的安卓 App 下载卡片 */
.app-download-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.adc-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adc-icon { font-size: 22px; line-height: 1; }
.adc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adc-info strong { font-size: 14px; color: var(--text); }
.adc-meta {
    font-size: 12px;
    color: var(--text-secondary);
    /* 卡片只有三百来像素宽，不折行，实在放不下就省略 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.adc-btn {
    flex: none;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}
.adc-btn:hover { background: var(--primary-dark); }
.adc-btn.is-disabled { background: var(--border); color: var(--text-muted); cursor: default; }

/* 导航栏里的下载入口（登录后也能找到） */
.btn-app-download {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-app-download:hover { background: rgba(255, 255, 255, 0.3); }
/* 窄屏只留图标，给姓名和退出按钮让位 */
@media (max-width: 900px) { .btn-app-download-text { display: none; } }
.auth-tabs { display: flex; margin-bottom: 24px; background: var(--bg); border-radius: 12px; padding: 4px; }
.auth-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-size: 15px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 9px;
    transition: all 0.2s;
    font-weight: 500;
}
.auth-tabs button.active { color: var(--primary); background: white; font-weight: 600; box-shadow: var(--shadow-sm); }
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { display: block; margin-bottom: 7px; font-weight: 500; color: var(--text-secondary); font-size: 13px; }

/* ================= 按钮 ================= */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(79, 126, 247, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(79, 126, 247, 0.42); transform: translateY(-1px); }
.btn-primary:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 11px 22px;
    border-radius: 12px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
    transition: all 0.2s;
}
.btn-secondary:hover { background: #e5e7eb; }
.btn-block { width: 100%; }
.btn-small {
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 9px;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.15s;
    font-weight: 500;
}
.btn-small:hover { background: #f9fafb; transform: translateY(-1px); }
.btn-primary.btn-small { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; border: 1px solid transparent; }
.btn-primary.btn-small:hover { box-shadow: 0 3px 10px rgba(79,126,247,0.35); }
.btn-edit { border-color: var(--primary); color: var(--primary); }
.btn-delete { border-color: var(--danger); color: var(--danger); }
.btn-restock { border-color: var(--success); color: var(--success); }
.btn-remove { border-color: var(--danger); color: var(--danger); padding: 3px 10px; font-size: 12px; border-radius: 8px; cursor: pointer; background: white; }
.btn-points { border-color: var(--accent); color: var(--accent); }
.btn-add {
    background: var(--primary-light);
    border: 1.5px dashed var(--primary);
    color: var(--primary);
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    margin: 12px 0;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}
.btn-add:hover { background: #dbe7ff; }
.btn-buy { width: 100%; text-align: center; }

/* ================= 表单通用 ================= */
.form-group { margin-bottom: 18px; }
label { display: block; margin-bottom: 7px; font-weight: 500; color: var(--text-secondary); font-size: 13px; }
input, select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 126, 247, 0.12);
}
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-actions { margin-top: 22px; text-align: right; }

/* ================= 日历打卡 ================= */
.calendar-layout { display: flex; gap: 24px; }
.calendar-section { flex: 1; max-width: 360px; }
.calendar-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-controls h3 { font-size: 17px; margin: 0; color: var(--text); font-weight: 600; }
.btn-month-nav {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-month-nav:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    background: white;
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.calendar-weekday { text-align: center; padding: 8px 4px; font-weight: 600; font-size: 12px; color: var(--text-muted); }
.calendar-day {
    text-align: center;
    padding: 8px 2px;
    font-size: 13px;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.18s;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid transparent;
    font-weight: 500;
}
.calendar-day .day-num { line-height: 1; }
.calendar-day:hover { background: var(--primary-light); border-color: var(--primary); }

/* 日历状态颜色 */
.calendar-day.other-month { color: #d1d5db; background: #fafafa; cursor: default; }
.calendar-day.today { background: var(--warning-light); font-weight: 700; border: 2px solid var(--warning); box-shadow: 0 0 10px rgba(245, 158, 11, 0.35); }
.calendar-day.today.completed { background: var(--success); color: white; border: 2px solid var(--warning); }
.calendar-day.today.overdue { background: var(--danger); color: white; border: 2px solid var(--warning); }
.calendar-day.today.partial { background: var(--warning); color: white; border: 2px solid var(--warning); }
.calendar-day.today.partial-overdue { background: #ea580c; color: white; border: 2px solid var(--warning); }

.calendar-day.completed { background: var(--success); color: white; border: 1.5px solid var(--success); font-weight: 600; }
.calendar-day.overdue { background: var(--danger); color: white; border: 1.5px solid #dc2626; }
.calendar-day.partial-overdue { background: #ea580c; color: white; border: 1.5px solid #c2410c; }
.calendar-day.partial { background: var(--warning); color: white; border: 1.5px solid #d97706; }
.calendar-day.future { background: var(--primary-light); color: var(--primary-dark); border: 1.5px solid #bfdbfe; }

/* 选中状态 */
.calendar-day.selected { box-shadow: 0 0 0 3px var(--text), 0 0 12px rgba(0,0,0,0.25); transform: scale(1.08); z-index: 2; position: relative; }

.calendar-legend { display: flex; justify-content: center; gap: 10px; margin-top: 16px; font-size: 11px; flex-wrap: wrap; }
.legend-item { padding: 4px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; background: white; box-shadow: var(--shadow-sm); }
.legend-item.completed { color: var(--success); }
.legend-item.overdue { color: var(--danger); }
.legend-item.today { color: var(--warning); border: 1px solid var(--warning); }
.legend-item.future { color: var(--primary); border: 1px solid #bfdbfe; }

/* ================= 选中日期任务列表 ================= */
.selected-date-section { flex: 1; }
.selected-date-section h3 { font-size: 17px; color: var(--text); margin-bottom: 18px; font-weight: 600; }
.task-list-for-date { max-height: 80vh; overflow-y: auto; padding-right: 4px; }
.date-task-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.date-task-card:hover { box-shadow: var(--shadow-hover); }
.date-task-card h4 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.date-task-card .task-header { display: flex; justify-content: space-between; align-items: center; }
.date-task-card .task-badge { font-size: 11px; padding: 3px 9px; border-radius: 20px; color: white; font-weight: 500; }
.date-task-card .task-badge.daily { background: var(--primary); }
.date-task-card .task-badge.weekly { background: #8b5cf6; }
.date-task-card .task-badge.monthly { background: #10b981; }
.date-task-card .task-badge.none { background: #94a3b8; }
.date-subtask { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.date-subtask:last-child { border-bottom: none; }
.date-subtask.completed .subtask-name { color: var(--success); text-decoration: line-through; }
.subtask-name { font-weight: 500; }
.subtask-count { font-size: 12px; color: var(--text-secondary); margin-left: 8px; background: var(--bg); padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.subtask-status-icon { font-size: 16px; margin-left: 8px; }
.subtask-actions { display: flex; gap: 4px; }
.subtask-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.progress-bar { flex: 1; height: 8px; background: #eef1f5; border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: 20px; transition: width 0.3s; }
.no-task-message { text-align: center; padding: 48px; color: var(--text-muted); }

/* ================= 打卡对话框 ================= */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(17, 24, 39, 0.55); display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(3px); }
.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 500px;
    max-width: 95%;
    max-height: 82vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 22px; color: var(--text); font-weight: 600; }
.checkin-form .form-group { margin-bottom: 16px; }
.file-preview { margin-top: 8px; padding: 10px; background: var(--primary-light); border-radius: 10px; display: flex; justify-content: space-between; align-items: center; }

/* ================= 积分商城 ================= */
.points-info { font-size: 17px; margin-bottom: 20px; color: var(--accent); font-weight: 600; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.22s;
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.product-image { margin-bottom: 12px; border-radius: 12px; overflow: hidden; }
.product-image img { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; }
.product-card h3 { font-size: 16px; margin-bottom: 6px; font-weight: 600; }
.product-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; min-height: 40px; }
.product-price { font-size: 19px; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.product-stock { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* ================= 订单卡片 ================= */
.my-orders-section { margin-top: 32px; }
.my-orders-section h3 { color: var(--text); margin-bottom: 16px; font-size: 17px; font-weight: 600; }
.order-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.order-card:hover { box-shadow: var(--shadow-hover); }
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-product { font-weight: 600; font-size: 15px; }
.order-no { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.order-status { font-size: 12px; padding: 4px 12px; border-radius: 20px; font-weight: 600; }
.order-status.status-ordered { background: var(--warning-light); color: #b45309; }
.order-status.status-verified { background: var(--success-light); color: #15803d; }
.order-status.status-cancelled { background: var(--danger-light); color: #b91c1c; }
.order-info { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.order-date { color: var(--text-muted); }
.order-actions { margin-top: 12px; text-align: right; }
.order-verified-info { margin-top: 6px; font-size: 12px; color: var(--success); }

/* ================= 个人中心 / 积分明细 ================= */
.profile-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.profile-card p { margin-bottom: 9px; }
.profile-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.change-password-form { margin-top: 16px; }

/* ================= 管理学生 ================= */
.student-list-section { margin-top: 16px; }
.student-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
.student-card:hover { box-shadow: var(--shadow-hover); }
.student-info h3 { font-size: 16px; color: var(--text); font-weight: 600; }
.student-info p { font-size: 13px; color: var(--text-secondary); }
.student-card-actions { display: flex; gap: 8px; align-items: center; }
.create-student-form {
    background: var(--card-bg);
    padding: 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 16px;
    border: 1px solid var(--border);
}
.student-points-view {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.student-points-view h3 { color: var(--text); margin-bottom: 12px; font-weight: 600; }
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }

/* ================= 任务管理 ================= */
.task-list-section { margin-top: 16px; }
.student-task-group { margin-bottom: 32px; }
.student-group-title {
    font-size: 17px;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    font-weight: 600;
}
.task-header { display: flex; justify-content: space-between; align-items: center; }
.task-header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.parent-task-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.parent-task-card:hover { box-shadow: var(--shadow-hover); }
.parent-task-card h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.parent-task-card .task-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; color: white; font-weight: 500; }
.parent-task-card .task-badge.daily { background: var(--primary); }
.parent-task-card .task-badge.weekly { background: #8b5cf6; }
.parent-task-card .task-badge.monthly { background: #10b981; }
.parent-task-card .task-badge.none { background: #94a3b8; }
.parent-task-card p { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.task-form {
    background: var(--card-bg);
    padding: 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 16px;
    border: 1px solid var(--border);
}
.task-form h3 { margin-bottom: 16px; font-size: 16px; font-weight: 600; color: var(--text); }
.subtask-forms { margin-bottom: 10px; }
.subtask-form-item { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.subtask-form-item .subtask-name-input { flex: 3; }
.subtask-form-item .subtask-count-input { flex: 1; max-width: 100px; }
.form-hint { font-size: 12px; color: var(--text-muted); font-weight: normal; }

/* ================= 家长查看打卡 ================= */
.student-checkin-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* 学生头部 */
.student-checkin-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.student-checkin-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 126, 247, 0.3);
}
.student-checkin-info h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.student-checkin-meta { display: flex; gap: 12px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.student-checkin-meta span { background: var(--bg); padding: 3px 10px; border-radius: 20px; }

/* 统计卡片 */
.checkin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    transition: all 0.2s;
}
.stat-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-value.good { color: var(--success); }
.stat-value.stat-recent { font-size: 16px; line-height: 1.6; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 任务卡片列表 */
.student-task-list { display: flex; flex-direction: column; gap: 16px; }
.ci-task-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: all 0.2s;
}
.ci-task-card:hover { box-shadow: var(--shadow-sm); }
.ci-task-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ci-task-name { font-size: 16px; font-weight: 600; color: var(--text); }
.ci-task-header .task-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; color: white; font-weight: 500; }
.ci-task-header .task-badge.daily { background: var(--primary); }
.ci-task-header .task-badge.weekly { background: #8b5cf6; }
.ci-task-header .task-badge.monthly { background: #10b981; }
.ci-task-header .task-badge.none { background: #94a3b8; }
.ci-task-reward { margin-left: auto; font-size: 12px; color: var(--accent); font-weight: 600; }

/* 打卡记录 */
.ci-records { display: flex; flex-direction: column; gap: 10px; }
.ci-record {
    background: #fafbfc;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.ci-record-date { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ci-date { font-weight: 700; color: var(--text); font-size: 14px; }
.ci-cycle { font-size: 12px; color: var(--text-muted); background: white; padding: 2px 10px; border-radius: 20px; border: 1px solid var(--border); }

.ci-subtasks { display: flex; flex-direction: column; gap: 6px; }
.parent-subtask {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: white;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
    flex-wrap: wrap;
}
.parent-subtask.completed { border-left: 3px solid var(--success); }
.ci-subtask-name { font-weight: 500; color: var(--text); }
.parent-subtask.completed .ci-subtask-name { color: var(--success); }
.ci-count-badge { font-size: 12px; color: var(--text-secondary); background: var(--bg); padding: 2px 10px; border-radius: 20px; font-weight: 600; }
.ci-status { font-size: 15px; }
.ci-text { color: var(--text-secondary); font-size: 13px; width: 100%; margin-top: 2px; }
.ci-no-record { text-align: center; color: var(--text-muted); font-size: 13px; padding: 14px; }

/* 打卡媒体 */
.ci-media { width: 100%; margin-top: 6px; }
.ci-media-img { max-width: 120px; max-height: 120px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); object-fit: cover; }
.ci-media-video { max-width: 200px; border-radius: 8px; }
.ci-media-audio { max-width: 240px; }
.ci-media-link { font-size: 13px; color: var(--primary); }

/* ================= 商城管理 ================= */
.product-form {
    background: var(--card-bg);
    padding: 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.product-form h3 { margin-bottom: 16px; color: var(--text); font-weight: 600; }
.manage-product-list { background: var(--card-bg); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.manage-product-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.manage-product-item:last-child { border-bottom: none; }
.manage-product-info { display: flex; gap: 15px; align-items: center; }
.manage-product-name { font-weight: 500; }
.manage-product-stock { font-size: 12px; color: var(--text-muted); }

.manage-product-card {
    display: flex;
    gap: 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    align-items: flex-start;
    transition: all 0.2s;
}
.manage-product-card:hover { box-shadow: var(--shadow-hover); }
.manage-product-image { width: 100px; height: 100px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--bg); }
.manage-product-image img { width: 100%; height: 100%; object-fit: cover; }
.manage-product-body { flex: 1; min-width: 0; }
.manage-product-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.manage-product-header h4 { font-size: 16px; color: var(--text); font-weight: 600; }
.manage-product-price { font-size: 16px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.manage-product-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-product-meta { display: flex; gap: 12px; align-items: center; }
.manage-product-status { font-size: 11px; padding: 3px 10px; border-radius: 20px; background: var(--success-light); color: var(--success); font-weight: 600; }
.manage-product-status:not(.active) { background: var(--danger-light); color: var(--danger); }
.manage-product-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.manage-product-actions .btn-small { white-space: nowrap; }

/* ================= 积分记录 ================= */
.points-log-item { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; }
.points-log-item:last-child { border-bottom: none; }
.points-log-item .points-log-header { display: flex; justify-content: space-between; align-items: center; }
.points-log-points { font-weight: 700; font-size: 15px; }
.points-log-item.positive .points-log-points { color: var(--success); }
.points-log-item.negative .points-log-points { color: var(--danger); }
.points-log-balance { font-size: 13px; color: var(--text-muted); margin-left: 6px; }
.points-log-date { font-size: 12px; color: var(--text-muted); }
.points-log-reason { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.points-log-task { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-style: italic; }

/* ================= 底部备案号 ================= */
.site-footer {
    /* 以前是 fixed，会浮在正文上方挡住卡片底部的按钮（点击落到备案栏上像“没反应”）；
       改成普通页脚，跟内容一起排在文档末尾 */
    position: static;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }

/* ================= 手机端适配 ================= */
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; height: auto; padding: 6px 12px; min-height: auto; }
    .nav-brand { font-size: 15px; line-height: 32px; }
    .nav-user { flex: 1; display: flex; justify-content: flex-end; align-items: center; font-size: 12px; gap: 6px; line-height: 32px; }
    .nav-links { width: 100%; display: flex; justify-content: flex-start; gap: 2px; padding: 4px 0; border-top: 1px solid rgba(255,255,255,0.25); flex-basis: 100%; overflow-x: auto; }
    .nav-link { padding: 4px 9px; font-size: 12px; white-space: nowrap; border-radius: 8px; }
    .nav-version { display: none; }
    .nav-points-badge { font-size: 12px; padding: 3px 10px; border-radius: 14px; }
    .btn-logout { padding: 3px 8px; font-size: 12px; line-height: 24px; }

    .main-content { padding: 14px; }
    .calendar-layout { flex-direction: column; gap: 14px; }
    .calendar-section { max-width: 100%; }
    .calendar-controls h3 { font-size: 14px; }
    .calendar-day { padding: 5px 1px; font-size: 11px; min-height: 34px; }
    .calendar-weekday { font-size: 10px; padding: 4px 2px; }
    .calendar-legend { font-size: 10px; gap: 4px; }

    .selected-date-section h3 { font-size: 15px; margin-bottom: 12px; }
    .date-task-card { padding: 14px; margin-bottom: 12px; }
    .date-task-card h4 { font-size: 14px; flex-wrap: wrap; }
    .task-list-for-date { max-height: none; }
    .date-subtask { padding: 7px 0; flex-wrap: wrap; gap: 4px; }
    .subtask-name { flex: 1; }
    .subtask-actions { width: 100%; display: flex; justify-content: flex-end; margin-top: 4px; }

    .auth-card { padding: 26px 18px; }
    .form-row { flex-direction: column; gap: 0; }
    input, select, textarea { padding: 12px; font-size: 16px; }
    .btn-primary, .btn-secondary { padding: 12px 20px; font-size: 16px; width: 100%; margin-left: 0; margin-top: 8px; }

    .modal { padding: 22px 16px; max-width: 100%; border-radius: 18px 18px 0 0; margin-top: auto; max-height: 90vh; }
    .modal-overlay { align-items: flex-end; }

    .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .product-card { padding: 14px; }
    .product-image img { height: 120px; }

    .student-card { flex-direction: column; gap: 10px; align-items: stretch; }
    .student-card-actions { justify-content: flex-end; }
    .student-card button { align-self: flex-end; }

    .parent-task-card { padding: 14px; }
    .task-form { padding: 16px; }
    .create-student-form { padding: 16px; }
    .product-form { padding: 16px; }
    .subtask-form-item { flex-direction: column; gap: 6px; }
    .subtask-form-item .subtask-count-input { max-width: none; }
    .student-checkin-card { padding: 14px; }
    .checkin-stats { grid-template-columns: repeat(2, 1fr); }
    .ci-task-reward { margin-left: 0; width: 100%; }
    .order-card { padding: 14px; }
    .order-info { flex-direction: column; gap: 4px; }
    .manage-product-item { flex-direction: column; gap: 8px; align-items: stretch; }
    .manage-product-item button { align-self: flex-end; }
    .manage-product-card { flex-direction: column; }
    .manage-product-image { width: 100%; height: 160px; }
}

/* ================= 家长评价（星级） ================= */
.eval-rule-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.eval-rule-grid .form-group label {
    font-size: 13px;
    color: #666;
}

.task-eval-rule {
    color: #b7791f;
    background: #fffbf0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
}

.btn-eval {
    background: #fff8e1;
    border: 1px solid #f1c40f;
    color: #b7791f;
    white-space: nowrap;
}

.btn-eval:hover {
    background: #fef3c7;
}

.star-picker {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 8px 0 4px;
}

/* 44x44 是移动端可点区域下限，星星按钮不能只靠字形大小 */
.star-btn {
    background: none;
    border: none;
    padding: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    color: #ddd;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.15s, transform 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.star-btn:hover {
    transform: scale(1.1);
}

.star-btn:active {
    background: #fff8e1;
}

.star-btn.active {
    color: #f1c40f;
}

.star-picked {
    margin-left: 8px;
    color: #e67e22;
    font-weight: 600;
}

.student-eval,
.ci-eval-comment {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    padding: 4px 8px;
    background: #fffbf0;
    border-radius: 6px;
    font-size: 13px;
    color: #8a6d3b;
}

.eval-stars {
    color: #f1c40f;
    letter-spacing: 1px;
}

.eval-source {
    font-size: 12px;
    color: #95a5a6;
}

.eval-comment {
    color: #555;
}

.subtask-eval {
    display: inline-flex;
    gap: 4px;
}

.eval-chip {
    color: #f1c40f;
    font-size: 13px;
    letter-spacing: 1px;
}

.ci-eval-slots {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.ci-eval-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* 评价弹窗：标题精简为一行，附带小字号上下文 */
.eval-modal h3 {
    margin-bottom: 4px;
}

.eval-dialog-sub {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 清除评价：与「保存」拉开距离，避免误触；
   不用 .btn-secondary，否则会被 @media(max-width:768px) 的 width:100% 撑成整行 */
.eval-clear-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.btn-clear-eval {
    flex: 0 0 auto;
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid var(--danger, #e74c3c);
    color: var(--danger, #e74c3c);
    background: white;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-clear-eval:hover:not(:disabled) {
    background: #fef2f2;
}

.btn-clear-eval:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.eval-clear-confirm {
    padding: 8px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
}

.eval-clear-tip {
    flex: 1 1 100%;
    font-size: 12px;
    color: #b91c1c;
}

.eval-clear-hint {
    flex: 0 1 auto;
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
}

/* 学生日历：单次评价的评语独占一行 */
.subtask-eval-comment {
    margin: 0 0 8px;
}

/* 加载失败提示（不要伪装成「暂无记录」） */
.load-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .eval-rule-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .star-btn {
        width: 40px;
        height: 44px;
        font-size: 26px;
    }
    .modal {
        padding: 20px;
    }
    .star-picked {
        margin-left: 4px;
        font-size: 14px;
    }
}

/* ================= 生字本 ================= */
.vocab-page { max-width: 860px; margin: 0 auto; }
.vocab-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.vocab-head h2 { font-size: 20px; font-weight: 700; }
.vocab-student-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 14px;
    min-height: 40px;
}

/* 语文生字 / 英语单词两侧切换 */
.vocab-kind-switch {
    display: flex;
    gap: 6px;
    background: var(--bg);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 12px;
}
.vocab-kind-btn {
    flex: 1 1 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.vocab-kind-btn:hover { color: var(--text); }
.vocab-kind-btn.active {
    background: white;
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.vocab-kind-count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
}
.vocab-kind-btn.active .vocab-kind-count {
    background: var(--primary-light);
    color: var(--primary-dark);
}
/* 家长关掉的一侧：变灰但仍可点（家长要能切过去管理） */
.vocab-kind-btn.off { color: var(--text-muted); }
.vocab-kind-btn.off.active { color: var(--text-secondary); }
.vocab-kind-off {
    padding: 1px 6px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
}

/* 页签：移动端保证 44px 点击高度 */
.vocab-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    background: white;
    padding: 5px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.vocab-tab {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.vocab-tab:hover { background: #f3f4f6; color: var(--text); }
.vocab-tab.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.vocab-stats-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.vocab-stats-bar span {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-secondary);
}
.vocab-stats-bar b { color: var(--primary-dark); font-size: 13px; }

/* ---------- 学习卡片 ---------- */
.vocab-card { padding: 24px; }
.vocab-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.vocab-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
}
.vocab-progress-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 99px;
    transition: width 0.25s;
}

.vocab-char {
    font-family: 'Kaiti SC', 'STKaiti', 'KaiTi', 'Songti SC', serif;
    font-size: 76px;
    line-height: 1.15;
    text-align: center;
    color: var(--text);
    margin: 10px 0 2px;
    letter-spacing: 4px;
}
.vocab-pinyin {
    text-align: center;
    font-size: 18px;
    color: var(--primary-dark);
    letter-spacing: 1px;
}
/* 英语单词比汉字长得多，用正常字体和小一号字号，允许长单词折行 */
.vocab-char-word {
    font-family: inherit;
    font-size: 46px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.vocab-char-word + .vocab-pinyin {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 16px;
    color: var(--text-secondary);
}
.vocab-meaning {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.vocab-block {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}
.vocab-block-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.vocab-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vocab-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 8px;
    padding: 5px 11px;
    font-size: 14px;
    line-height: 1.4;
}
.vocab-chip.editing { background: #f1f5f9; color: var(--text); }
.chip-x {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1;
    padding: 2px 3px;
    cursor: pointer;
    border-radius: 4px;
}
.chip-x:hover { background: rgba(0, 0, 0, 0.08); color: var(--danger); }
.vocab-sentence {
    font-size: 15px;
    color: var(--text);
    line-height: 1.9;
    padding-left: 12px;
    border-left: 3px solid var(--primary-light);
    margin-bottom: 6px;
}

/* ---------- 五关闯关 ---------- */
.vocab-stages {
    display: flex;
    gap: 6px;
    margin: 14px 0 4px;
}
.vocab-stage {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
    font-size: 12px;
    white-space: nowrap;
    color: var(--text-muted);
}
.vocab-stage b {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #eef0f3;
    color: var(--text-secondary);
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vocab-stage.on {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}
.vocab-stage.on b { background: var(--primary); color: white; }
.vocab-stage.done { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.vocab-stage.done b { background: #16a34a; color: white; }
.vocab-stage.fail { border-color: #fed7aa; background: #fff7ed; color: #b45309; }
.vocab-stage.fail b { background: #f59e0b; color: white; }

.vocab-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 18px 0 6px;
}
.vocab-stage-title { font-size: 15px; font-weight: 600; color: var(--text-primary, #1f2937); }
.vocab-hint-line {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 14px;
}

/* 手写格：touch-action 必须关掉，否则手指一划就变成滚动页面 */
.dict-box {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}
.dict-canvas {
    display: block;
    width: 100%;
    height: 220px;
    /* 手指一划就变成滚动页面，写不了字 */
    touch-action: none;
    /* 写字时手在画布上停一下，别弹出「复制/全选」或长按菜单 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: crosshair;
}
.dict-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}
.dict-verdict {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f7f8fa;
    font-size: 14px;
    color: var(--text-secondary);
}
.dict-verdict.ok { background: #f0fdf4; color: #15803d; }
.dict-verdict.bad { background: #fff7ed; color: #b45309; }
.dict-selfcheck { margin-top: 10px; }
.dict-answer { font-size: 15px; }
.dict-answer b { font-size: 20px; color: var(--primary-dark); }

/* 拍照上传的手写图 */
.hidden-file { display: none; }
.dict-photo { margin-top: 10px; text-align: center; }
.dict-photo img {
    max-width: 100%;
    max-height: 220px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* 第三关：近义词 / 反义词选择题 */
.choice-prompt {
    margin-top: 12px;
    padding: 18px 14px;
    border-radius: 14px;
    background: #f7f8fa;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    color: var(--text);
    word-break: break-word;
}
.choice-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.choice-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    font-size: 17px;
    color: var(--text);
    text-align: left;
    word-break: break-word;
}
.choice-option b {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #eef0f3;
    color: var(--text-secondary);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.choice-option.wrong { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.choice-option.wrong b { background: var(--danger); color: white; }
.choice-option:disabled { opacity: 0.85; }

/* 第四 / 五关：朗读录音 */
.record-box {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    text-align: center;
}
.btn-record {
    width: 100%;
    padding: 15px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-size: 17px;
    font-weight: 600;
}
.btn-record.recording { background: var(--danger); }
.record-status { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.record-play { width: 100%; margin-top: 10px; }

.vocab-stage-text {
    margin-top: 12px;
    padding: 22px 16px;
    border-radius: 14px;
    background: #f7f8fa;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    color: var(--text-primary, #1f2937);
    word-break: break-word;
}
.vocab-wait {
    margin-top: 8px;
    font-size: 13px;
    color: var(--warning);
    text-align: center;
}
.vocab-round-result {
    margin: 14px 0 6px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f7f8fa;
}
.vocab-round-result h3 { font-size: 16px; margin-bottom: 4px; }
.vocab-round-result p { font-size: 13px; color: var(--text-secondary); }
.vocab-round-result.ok { background: #f0fdf4; }
.vocab-round-result.ok h3 { color: #15803d; }
.vocab-round-result.no { background: #fff7ed; }
.vocab-round-result.no h3 { color: #b45309; }

.vocab-tip {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-top: 6px;
}
.vocab-summary p { margin-bottom: 8px; }

/* ---------- 生字库 ---------- */
.vocab-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.vocab-search {
    flex: 1 1 180px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.vocab-toolbar select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 14px;
    min-height: 40px;
}
.vocab-word-list { display: flex; flex-direction: column; gap: 10px; }
.vocab-word-item {
    background: white;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.vocab-word-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.vocab-word-char {
    font-family: 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}
.vocab-word-pinyin { font-size: 13px; color: var(--primary-dark); }
.vocab-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    line-height: 1.6;
}
.vocab-badge.learning { background: var(--warning-light); color: #b45309; }
.vocab-badge.mastered { background: var(--success-light); color: #15803d; }
.vocab-word-meta { font-size: 11px; color: var(--text-muted); }
.vocab-word-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    word-break: break-word;
}
.vocab-word-source { color: var(--text-muted); }
.vocab-word-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}
.vocab-delete-tip { font-size: 12px; color: var(--danger); }
.btn-danger-ghost {
    border-color: var(--danger) !important;
    color: var(--danger) !important;
    background: white;
}
.btn-danger-ghost:hover { background: var(--danger-light) !important; }

/* ---------- 学习记录 ---------- */
.vocab-session-item {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}
.vocab-session-date { font-weight: 600; color: var(--text); }
.vocab-session-mastered { color: var(--success); }

/* ---------- 设置 ---------- */
.vocab-settings { display: flex; flex-direction: column; gap: 14px; }
.vocab-switch {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 10px 0 4px;
    line-height: 1.6;
    cursor: pointer;
}
.vocab-switch input { margin-top: 3px; width: 16px; height: 16px; flex: 0 0 auto; }
.vocab-token-row { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vocab-ai-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    word-break: break-all;
}
.vocab-ai-result.ok { background: var(--success-light); color: #15803d; }
.vocab-ai-result.fail { background: var(--danger-light); color: #b91c1c; }

/* 录入拿到积分等轻提示，3 秒后自动消失；
   sticky 让在设置页下方点保存也能看到，top 要让开 64px 的吸顶导航栏 */
.vocab-notice {
    position: sticky;
    top: 72px;
    z-index: 20;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--success-light);
    color: #15803d;
    font-size: 13px;
    font-weight: 500;
}

/* 积分奖励：生字 / 单词两列并排，窄屏自动堆叠 */
.vocab-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.vocab-points-col {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 10px 12px 2px;
}
.vocab-points-head {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.vocab-points-earned {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
}
.vocab-ai-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 4px 0 6px;
}
.vocab-add-row { display: flex; gap: 8px; margin-top: 8px; }
.vocab-add-row input { flex: 1; }
/* 拼音 / 音标：输入框旁边放自动注音按钮，下面多音字可选 */
.vocab-pinyin-row { display: flex; gap: 8px; align-items: center; }
.vocab-pinyin-row input { flex: 1; min-width: 0; }
.vocab-pinyin-row .btn-small { flex: none; }
.vocab-pinyin-chips { margin-top: 8px; }
.pinyin-chip {
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.pinyin-chip:hover { border-color: var(--primary); }
.pinyin-chip.is-picked { background: var(--primary); color: #fff; }
.vocab-dialog { max-height: 88vh; overflow-y: auto; }

/* 拍照识字：照片预览 + 可勾选的识别结果 */
.ocr-file-input { display: none; }
.ocr-dialog { max-height: 88vh; overflow-y: auto; }
.ocr-preview {
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f2f3f5;
}
.ocr-preview img { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.ocr-status { color: var(--text-secondary); font-size: 14px; padding: 10px 0; }
.ocr-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.ocr-pick-all { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.ocr-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 46vh;
    overflow-y: auto;
}
.ocr-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
}
.ocr-item.is-exists { background: #f7f8fa; }
.ocr-item-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.ocr-item-word { font-size: 20px; font-weight: 600; }
.ocr-item-pinyin { color: var(--text-secondary); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.ocr-item-tag {
    flex: none;
    font-size: 12px;
    color: var(--text-secondary);
    background: #eef0f3;
    border-radius: 999px;
    padding: 2px 8px;
}

/* 移动端：卡片内按钮不要被「宽度 100%」规则撑成两行 */
@media (max-width: 768px) {
    .vocab-card .form-actions,
    .vocab-settings .form-actions {
        display: flex;
        gap: 8px;
        text-align: left;
    }
    .vocab-card .form-actions .btn-primary,
    .vocab-card .form-actions .btn-secondary,
    .vocab-settings .form-actions .btn-primary,
    .vocab-settings .form-actions .btn-secondary {
        width: auto;
        flex: 1 1 0;
    }
    .vocab-tab { flex: 1 1 40%; padding: 8px 10px; }
}

@media (max-width: 640px) {
    .vocab-char { font-size: 60px; }
    .vocab-char-word { font-size: 34px; }
    .vocab-card { padding: 18px 16px; }
    .vocab-stage { font-size: 12px; padding: 6px 4px; }
    .dict-canvas { height: 180px; }
    .vocab-stage-text { font-size: 22px; padding: 18px 12px; }
    .vocab-toolbar .btn-primary { width: 100%; }
}
