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

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* 登录页 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    text-align: center;
}

.login-logo {
    margin-bottom: 30px;
    color: #fff;
}

.logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: normal;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-box h2 {
    margin-bottom: 25px;
    color: #333;
    font-weight: normal;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #5568d3;
}

.error-msg {
    background: #ffe6e6;
    color: #e74c3c;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.test-tip {
    margin-top: 15px;
    font-size: 12px;
    color: #999;
}

/* 顶部导航 */
.top-nav {
    background: #f0f0f0;
    padding: 8px 20px;
    font-size: 13px;
    border-bottom: 1px solid #ddd;
}

.nav-links a {
    color: #666;
    text-decoration: none;
    margin: 0 5px;
}

.nav-links a:hover {
    color: #333;
}

/* 头部 */
.header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.nav-tabs {
    display: flex;
    gap: 5px;
}

.tab-item {
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.tab-item.active {
    background: #e8e8e8;
    font-weight: bold;
}

.tab-sub {
    font-size: 11px;
    color: #999;
}

.tab-icon.orange { color: #e67e22; }
.tab-icon.brown { color: #8b4513; }
.tab-icon.green { color: #27ae60; }
.tab-icon.blue { color: #2980b9; }
.tab-icon.red { color: #c0392b; }

/* 主容器 */
.main-container {
    display: flex;
    padding: 20px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    flex-shrink: 0;
}

.user-card {
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #ddd;
}

.user-icon {
    font-size: 28px;
}

.user-info {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.welcome {
    color: #999;
    font-size: 12px;
}

.username {
    font-weight: bold;
    color: #e67e22;
}

.coin-count {
    font-size: 11px;
    color: #999;
}

.menu-item {
    background: #fff;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid #ddd;
}

.menu-item.active {
    background: #e8f4f8;
    border-color: #3498db;
    color: #2980b9;
}

/* 内容区 */
.content-area {
    flex: 1;
    background: #fff;
    border-radius: 5px;
    padding: 20px;
    border: 1px solid #ddd;
}

.course-title {
    font-size: 16px;
    font-weight: bold;
    color: #b8860b;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.unit-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.unit-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.unit-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.unit-name {
    font-weight: bold;
    color: #333;
}

.unit-arrow {
    color: #999;
    font-size: 12px;
}

.unit-progress {
    margin-bottom: 10px;
}

.progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: #27ae60;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: #999;
}

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

.btn-learn, .btn-test {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-learn {
    background: #27ae60;
    color: #fff;
}

.btn-test {
    background: #e67e22;
    color: #fff;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: #b8860b;
    border-top: 1px solid #ddd;
    background: #fff;
}

.footer a {
    color: #b8860b;
    text-decoration: none;
}

/* 意见反馈 */
.feedback-btn {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #999;
    color: #fff;
    padding: 15px 8px;
    writing-mode: vertical-rl;
    cursor: pointer;
    border-radius: 5px 0 0 5px;
    font-size: 13px;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-window {
    background: #fff;
    width: 700px;
    max-width: 90%;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    background: #fff;
    padding: 12px 15px;
    border-bottom: 3px solid #555;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-icon {
    color: #e67e22;
}

.modal-header span:nth-child(2) {
    flex: 1;
    font-weight: bold;
    color: #333;
}

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

.modal-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #e67e22;
}

.modal-body {
    padding: 40px 30px;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-footer {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    font-size: 12px;
    color: #666;
}

.modal-footer strong {
    color: #333;
}

/* 开始界面 */
.start-screen {
    text-align: center;
    width: 100%;
}

.start-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 30px 50px;
    margin-bottom: 30px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.start-box p {
    font-size: 18px;
    color: #333;
}

.btn-green {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-green:hover {
    background: #219a52;
}

.btn-blue {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* 单词卡片学习 */
.word-card-learn {
    width: 100%;
    text-align: center;
}

.speaker-icon {
    font-size: 24px;
    margin-bottom: 20px;
    cursor: pointer;
    display: inline-block;
}

.meaning-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 30px;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.forget-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 12px;
    color: #999;
    cursor: pointer;
}

.forget-btn:hover {
    color: #e74c3c;
}

.btn-next-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.btn-next-arrow:hover {
    background: #219a52;
}

/* 单词详情卡片 */
.word-detail {
    width: 100%;
}

.word-title {
    font-size: 24px;
    color: #e67e22;
    margin-bottom: 15px;
    font-weight: bold;
}

.phonetic {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.phonetic span {
    margin-right: 15px;
}

/* 拼写卡片 */
.spell-card {
    width: 100%;
}

.meaning-toggle {
    margin-bottom: 30px;
    text-align: center;
}

.toggle-btn {
    display: inline-block;
    background: #b0ff57;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    margin-right: 10px;
}

.toggle-btn.active {
    background: #a0e050;
}

.spell-meaning {
    font-size: 16px;
    color: #333;
}

.spell-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.headphone-icon {
    font-size: 36px;
    color: #e67e22;
    cursor: pointer;
}

.spell-input {
    flex: 1;
    max-width: 300px;
    padding: 10px 15px;
    border: 1px solid #999;
    border-radius: 3px;
    font-size: 16px;
    outline: none;
}

.spell-input.error {
    border-color: #e74c3c;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.btn-next {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.word-hint {
    text-align: center;
    color: #c0392b;
    font-size: 24px;
    font-weight: bold;
    margin-top: 10px;
}

/* 完成界面 */
.complete-screen {
    text-align: center;
    width: 100%;
}

.complete-screen h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #27ae60;
}

.complete-screen p {
    margin-bottom: 10px;
    color: #666;
}

.complete-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 测试页面 */
.test-page {
    background: #808080;
    min-height: 100vh;
    padding: 20px;
}

.test-container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 5px;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #556b2f;
    color: #fff;
    margin-bottom: 20px;
}

.test-header h2 {
    font-size: 16px;
    font-weight: normal;
}

.test-timer {
    color: #b22222;
    font-size: 24px;
    font-weight: bold;
}

.test-section-title {
    background: #556b2f;
    color: #fff;
    padding: 8px 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

.question-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.question-audio {
    margin-bottom: 10px;
}

.audio-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.option-item {
    display: block;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

.option-item:hover {
    background: #f5f5f5;
}

.option-item input {
    margin-right: 10px;
}

.submit-area {
    text-align: center;
    padding: 20px;
}

.btn-submit {
    background: #e67e22;
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.btn-submit:hover {
    background: #d35400;
}

/* 结果弹窗 */
.result-box {
    background: #fff;
    padding: 30px 40px;
    border-radius: 5px;
    text-align: center;
    min-width: 400px;
}

.result-header {
    background: #9acd32;
    color: #fff;
    padding: 8px;
    margin: -30px -40px 20px;
    border-radius: 5px 5px 0 0;
    font-weight: bold;
}

.result-score {
    font-size: 24px;
    margin-bottom: 20px;
}

.result-score span:first-of-type {
    color: #e74c3c;
}

.result-score span:last-of-type {
    color: #e67e22;
}

.result-status {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 24px;
}

.result-status label:first-child {
    color: #27ae60;
    font-weight: bold;
}

.result-status label:last-child {
    color: #e74c3c;
    font-weight: bold;
}

.result-tip {
    font-size: 12px;
    color: #999;
    margin-bottom: 20px;
}

/* 退出按钮 */
.exit-btn {
    position: absolute;
    bottom: 80px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .nav-tabs {
        flex-wrap: wrap;
    }
}

/* ===== 单词卡片笑脸交互样式 ===== */
.meaning-box.question-mode {
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-mark {
    font-size: 48px;
    font-weight: bold;
    color: #666;
}

.word-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.face-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.2s;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.face-green {
    color: #27ae60;
    border: 2px solid #27ae60;
}

.face-green:hover {
    background: #27ae60;
    color: #fff;
}

.face-red {
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.face-red:hover {
    background: #e74c3c;
    color: #fff;
}

.countdown-tip {
    margin-top: 20px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.countdown-tip span {
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
}

/* 调整单词卡片内边距适配新布局 */
.word-card-learn .meaning-box {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 测试结果分数动画与勾选样式 ===== */
.score-animate {
    font-weight: bold;
    font-size: 32px;
    display: inline-block;
    min-width: 60px;
    text-align: right;
}

.result-score span:first-of-type {
    color: #e74c3c;
}

.result-score span:last-of-type {
    color: #e67e22;
}

.status-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: bold;
}

.big-checkbox {
    width: 28px;
    height: 28px;
    cursor: pointer;
    accent-color: #27ae60;
}

.fail-label .big-checkbox {
    accent-color: #e74c3c;
}

.pass-label {
    color: #27ae60;
}

.fail-label {
    color: #e74c3c;
}