/* 全局重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    padding: 0 40px 40px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

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

h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 2.2em;
}

h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

p {
    font-size: 1.15em;
    margin: 10px 0;
    line-height: 1.6;
}

label {
    font-size: 1.05em;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    max-width: 320px;
    padding: 14px 20px;
    margin: 10px 0 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.05em;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    background: white;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

button:active {
    transform: translateY(0);
}

button.secondary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}

button.secondary:hover {
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.6);
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 20px 20px 0 0;
}

.nav-item {
    font-size: 1.1em;
    font-weight: 500;
}

.nav-item button {
    padding: 8px 20px;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.nav-item button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 复习选项 */
.review-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}

.review-options button {
    padding: 20px 40px;
    font-size: 1.3em;
}

/* 消息提示 */
#message,
#loginMessage {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 1em;
}

#message.error,
#loginMessage.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

#message.success,
#loginMessage.success {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
    color: white;
}

/* 认证框 */
.auth-box {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    background: #fafafa;
}

.auth-box h2 {
    margin-bottom: 25px;
    color: #2c3e50;
}

/* 表单 */
form {
    margin: 20px 0;
}

/* 复习页面样式 - 为按钮添加wrapper */
body.review-mode {
    padding-top: 140px;
}

.review-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.progress-bar {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 25px;
    text-align: center;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: 600;
    margin: 10px auto;
    max-width: fit-content;
}

.stats-bar {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 25px;
    text-align: center;
    font-size: 1em;
    border-radius: 15px;
    margin: 10px auto;
    max-width: fit-content;
}

.stats-bar span {
    margin: 0 15px;
    font-weight: 600;
}

.stats-bar span.highlight {
    color: #ffd93d;
    font-size: 1.1em;
}

#wordDisplay,
#characterDisplay {
    text-align: center;
    padding: 120px 20px 80px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

#wordDisplay h2,
#characterDisplay h2 {
    font-size: 7em;
    margin: 30px 0;
    color: #1a1a2e;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.1em;
}

.pronunciation {
    font-size: 2.2em;
    color: #4a5568;
    font-style: italic;
    margin: 20px 0;
    font-weight: 500;
}

.buttons-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0;
}

#buttonsContainer {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 25px;
    padding: 40px 20px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.choice-btn {
    padding: 20px 50px;
    font-size: 1.5em;
    font-weight: 700;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    flex: 0 0 auto;
}

.choice-btn:hover {
    transform: translateY(-3px) scale(1.02);
}

.correct-btn {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
    box-shadow: 0 6px 20px rgba(38, 222, 129, 0.4);
}

.correct-btn:hover {
    box-shadow: 0 8px 25px rgba(38, 222, 129, 0.6);
}

.incorrect-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
}

.incorrect-btn:hover {
    box-shadow: 0 8px 25px rgba(238, 90, 36, 0.6);
}

.unsure-btn {
    background: linear-gradient(135deg, #ffd93d 0%, #f9ca24 100%);
    box-shadow: 0 6px 20px rgba(249, 202, 36, 0.4);
    color: #2c3e50;
}

.unsure-btn:hover {
    box-shadow: 0 8px 25px rgba(249, 202, 36, 0.6);
}

/* 选择题按钮样式 */
#choicesContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 40px 20px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.quiz-choice-btn {
    padding: 25px 50px;
    font-size: 2em;
    font-weight: 700;
    border: 3px solid #667eea;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    background: white;
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex: 0 0 auto;
}

.quiz-choice-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.quiz-choice-btn .choice-letter {
    font-weight: bold;
    color: #667eea;
    margin-right: 10px;
}

.quiz-choice-btn:hover .choice-letter {
    color: white;
}

#feedbackDisplay {
    margin: 40px auto;
    max-width: 750px;
    padding: 35px;
    border-radius: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: left;
    border-left: 6px solid #667eea;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

#feedbackDisplay h3 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 25px;
}

#feedbackDisplay p {
    font-size: 1.15em;
    margin: 15px 0;
    line-height: 1.8;
}

#feedbackDisplay strong {
    color: #1a1a2e;
    font-weight: 700;
}

.speakBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 12px;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.speakBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

#nextButtonContainer {
    text-align: center;
    padding: 30px;
}

.next-btn {
    padding: 18px 50px;
    font-size: 1.3em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

#completionMessage {
    text-align: center;
    padding: 100px 20px 80px;
    font-size: 1.3em;
    animation: fadeIn 0.5s ease-in;
}

#completionMessage h2 {
    font-size: 3.5em;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#syncFeedback {
    font-size: 1.2em;
    margin: 30px 0;
    padding: 20px;
    border-radius: 10px;
}

#syncFeedback.success {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
    color: white;
}

#syncFeedback.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.home-btn {
    padding: 18px 50px;
    font-size: 1.3em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    display: inline-block;
    margin: 10px;
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

#homeButtonContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
.container {
        padding: 20px;
        margin: 20px 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    #wordDisplay h2,
    #characterDisplay h2 {
        font-size: 5em;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .review-options {
        grid-template-columns: 1fr;
    }
    
    .choice-btn {
        padding: 18px 40px;
        font-size: 1.3em;
        min-width: 140px;
        flex: 1 1 auto;
    }
    
    #buttonsContainer {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 30px 20px;
    }
    
    .review-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .stats-bar {
        flex-wrap: wrap;
    }
    
    .stats-bar span {
        margin: 5px 10px;
        display: inline-block;
    }
    
    input[type="text"],
    input[type="password"] {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .container {
        padding: 20px;
        border-radius: 0;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    #wordDisplay h2,
    #characterDisplay h2 {
        font-size: 4em;
    }
    
    .review-header {
        padding: 12px;
    }
    
    #wordDisplay,
    #characterDisplay {
        padding: 100px 15px 60px;
        min-height: 350px;
    }
    
    #feedbackDisplay {
        padding: 25px;
        margin: 30px 15px;
    }
    
    #feedbackDisplay h3 {
        font-size: 1.3em;
    }
    
    #feedbackDisplay p {
        font-size: 1em;
    }
}
