:root { --primary-color: #1a2a6c; --secondary-color: #b21f1f; --accent-color: #fdbb2d; --text-color: #333; }
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color)); color: var(--text-color); margin: 0; padding: 15px; min-height: 100vh; }
.container { background-color: rgba(255, 255, 255, 0.95); border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); width: 100%; max-width: 600px; margin: 0 auto; padding: 25px; text-align: center; }
h1 { color: var(--primary-color); margin-bottom: 5px; font-size: 22px; }
h2 { color: var(--primary-color); margin-top: 0; }
.subtitle { color: #666; font-size: 13px; margin-bottom: 15px; }
.site-filing { margin-top: 24px; font-size: 12px; line-height: 1.5; }
.site-filing a { color: #888; text-decoration: none; }
.site-filing a:hover, .site-filing a:focus-visible { color: var(--primary-color); text-decoration: underline; }
/* Navigation */
.nav { background: var(--primary-color); padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; border-radius: 10px; margin-bottom: 15px; color: #fff; }
.nav-title { font-weight: bold; font-size: 16px; }
.nav-right { display: flex; gap: 10px; align-items: center; }
.nav-right span { font-size: 13px; }
.btn-logout { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.4); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-logout:hover { background: rgba(255,255,255,0.3); }
/* Main-site cross-system navigation */
#main-system-switcher { margin: -7px 0 12px; max-width: 100%; overflow-x: auto; text-align: left; }
.main-system-switcher { display: inline-flex; min-height: 30px; align-items: center; padding: 1px 4px; border: 1px solid #d8dfeb; border-radius: 15px; background: #fff; color: #506176; font-size: 12px; line-height: 28px; white-space: nowrap; }
.main-system-switcher-item { display: inline-block; padding: 0 8px; border-radius: 13px; color: #506176; text-decoration: none; }
.main-system-switcher a.main-system-switcher-item:hover { background: #f1f5f9; color: var(--primary-color); }
.main-system-switcher a.main-system-switcher-item:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 1px; }
.main-system-switcher-item.is-current { background: #e8eefb; color: var(--primary-color); font-weight: bold; }
.main-system-switcher-separator { color: #b6c0cf; font-size: 11px; }
/* Buttons */
button { background-color: var(--primary-color); color: white; border: none; padding: 10px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: 0.2s; }
button:hover { opacity: 0.85; }
.btn-gold { background-color: var(--accent-color); color: #333; font-weight: bold; width: 100%; font-size: 16px; padding: 12px; border-radius: 8px; border:none; cursor: pointer; margin-top:10px; }
.btn-gold:hover { opacity: 0.9; }
.btn-small { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-danger { background: #dc3545; }
.btn-success { background: #28a745; }
/* Menu */
.menu-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 15px; }
.day-btn.active { background-color: var(--accent-color); color: #333; font-weight: bold; }
/* 作业包子项以状态色区分；选中时仅加描边，不覆盖绿/红。 */
.hw-package-children { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hw-package-child { padding: 8px 10px; font-size: 12px; }
.hw-status-complete { background: #28a745; color: #fff; }
.hw-status-incomplete { background: #dc3545; color: #fff; }
.hw-package-child.active,
.hw-status-complete.active,
.hw-status-incomplete.active { outline: 3px solid var(--primary-color); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(26, 42, 108, 0.16); }
/* Game area */
.game-area { background: #fff; border: 2px dashed #ccc; border-radius: 10px; padding: 20px; min-height: 250px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.word-display { font-size: 28px; font-weight: bold; color: var(--primary-color); margin-bottom: 10px; }
.phonetic { font-size: 16px; color: #666; margin-bottom: 20px; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.option-btn { background-color: #f0f0f0; color: #333; border: 1px solid #ddd; padding: 12px; font-size: 15px; cursor: pointer; border-radius: 8px; }
.option-btn:hover { background: #e0e0e0; }
/* Spelling */
.spell-container { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-bottom: 15px; }
.s-box { font-size: 20px; padding: 5px; text-align: center; border: none; border-bottom: 2px solid var(--primary-color); background: transparent; outline: none; font-weight: bold; color: var(--primary-color); }
.s-box:focus { border-bottom: 3px solid var(--accent-color); }
.meta-text { font-weight: bold; color: #888; font-size: 18px; margin: 0 2px; }
/* Status */
.status-bar { display: flex; justify-content: space-between; margin-bottom: 15px; font-weight: bold; color: var(--primary-color); width: 100%; }
.hidden { display: none !important; }
.audio-icon { cursor: pointer; font-size: 24px; vertical-align: middle; margin-left: 8px; }
.hint-text { color: #d9534f; font-weight: bold; margin-top: 10px; }
/* Forms */
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; }
th { background: var(--primary-color); color: #fff; font-weight: bold; }
tr:hover { background: #f5f5f5; }
/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 15px; border-bottom: 2px solid #ddd; }
.tab { padding: 10px 20px; cursor: pointer; font-weight: bold; color: #666; border-bottom: 3px solid transparent; background: none; font-size: 14px; }
.tab.active { color: var(--primary-color); border-bottom-color: var(--accent-color); }
/* 课后巩固：冻结错词双行词卡 */
.consolidation-word-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.consolidation-word-toolbar h3 { margin: 0; }
.consolidation-word-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.consolidation-word-list { display: grid; gap: 8px; }
.consolidation-word-card { border: 1px solid #d9e5f2; border-radius: 9px; background: #fff; overflow: hidden; transition: background .2s, border-color .2s, box-shadow .2s; }
.consolidation-word-card-title { display: flex; align-items: center; gap: 8px; padding: 9px 11px; background: #f5f9fd; }
.consolidation-word-number { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50%; background: #e6f4ff; color: #1677ff; font-size: 13px; font-weight: bold; }
.consolidation-word-en { min-width: 0; flex: 1; color: var(--primary-color); font-size: 16px; overflow-wrap: anywhere; }
.consolidation-word-play { flex: 0 0 auto; padding: 2px 4px; border: 0; background: transparent; color: #1677ff; cursor: pointer; font-size: 16px; }
.consolidation-word-play:hover { color: #0958d9; }
.consolidation-word-card-detail { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 2fr); gap: 10px; padding: 9px 11px; color: #555; font-size: 14px; line-height: 1.55; }
.consolidation-word-phonetic { color: #637387; overflow-wrap: anywhere; }
.consolidation-word-meaning { min-width: 0; overflow-wrap: anywhere; }
.consolidation-word-meaning-label { margin-right: 7px; color: #888; font-size: 12px; }
.consolidation-word-data.is-playing { border-color: #ffd666; background: #fff3cd; box-shadow: 0 0 0 2px #fff1b8; }
.consolidation-word-data.is-playing .consolidation-word-card-title { background: #fff1b8; }
/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; color: #fff; font-weight: bold; z-index: 1000; display: none; }
.toast.success { background: #28a745; }
.toast.error { background: #dc3545; }
/* Wide layout */
.wide { max-width: 900px; }
/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 25px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin-top: 0; color: var(--primary-color); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 15px; }
/* Progress bar */
.progress-bar { background: #e9ecef; border-radius: 10px; height: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-color), #28a745); border-radius: 10px; transition: width 0.3s; }
/* 页面首标题：无操作按钮时直接居中；有操作按钮时仍相对整行居中。 */
.page-title { text-align: center; }
.page-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 15px 0; }
.page-title-row .page-title { grid-column: 2; margin: 0; }
.page-title-row .page-title-actions { grid-column: 3; justify-self: end; }
@media (max-width: 480px) {
    .page-title-row { grid-template-columns: minmax(0, 1fr) auto; }
    .page-title-row .page-title { grid-column: 1 / -1; }
    .page-title-row .page-title-actions { grid-column: 2; }
}
/* Mobile */
@media (max-width: 480px) {
    body { padding: 8px; }
    .container { padding: 15px; border-radius: 10px; }
    h1 { font-size: 18px; }
    .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .menu-grid .day-btn { font-size: 11px; padding: 8px 4px; }
    .student-tabs .tab { flex: 1 1 0; min-width: 0; padding: 10px 4px; font-size: 13px; white-space: nowrap !important; word-break: keep-all; }
    .consolidation-word-toolbar { align-items: flex-start; flex-direction: column; }
    .consolidation-word-actions { justify-content: flex-start; }
    .consolidation-word-actions .btn-small { font-size: 12px; padding: 6px 8px; }
    .consolidation-word-card-title { padding: 8px 9px; }
    .consolidation-word-card-detail { grid-template-columns: 1fr; gap: 4px; padding: 8px 9px; font-size: 13px; }
    .consolidation-word-en { font-size: 15px; }
    .btn-gold { font-size: 14px; padding: 10px; }
    .nav { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
    .nav-title { font-size: 14px; }
    #main-system-switcher { margin-top: -7px; margin-bottom: 10px; }
    .main-system-switcher { max-width: 100%; }
    .word-display { font-size: 22px; }
    .options-grid { grid-template-columns: 1fr; gap: 8px; }
    .option-btn { padding: 10px; font-size: 14px; }
    table { font-size: 11px; }
    th, td { padding: 6px 4px; }
}
