/* CLAUDE.md 合規配色方案 */
:root {
    --background: #8c7851;
    --headline: #fffffe;
    --paragraph: #020826;
    --card-background: #eaddcf;
    --highlight: #f25042;
    --form-button: #8c7851;
    --form-button-text: #fffffe;
}

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

body {
    font-family: 'Noto Sans TC', Arial, sans-serif;
    line-height: 1.6;
    color: var(--paragraph);
    background-color: var(--card-background);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 導航欄 */
.navbar {
    background: var(--background);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    color: var(--headline);
    font-size: 1.5rem;
    font-weight: bold;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

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

.nav-link:hover {
    color: var(--highlight);
    transform: translateY(-2px);
}

.language-btn {
    background: transparent;
    border: 2px solid var(--headline);
    color: var(--headline);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-btn:hover {
    background: var(--headline);
    color: var(--background);
    transform: scale(1.05);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--headline);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--background), #9d8760);
    color: var(--headline);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.highlight {
    color: var(--highlight);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--highlight);
    color: var(--headline);
    box-shadow: 0 4px 15px rgba(242, 80, 66, 0.4);
}

.btn-primary:hover {
    background: #e04638;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(242, 80, 66, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--headline);
    border: 2px solid var(--headline);
}

.btn-secondary:hover {
    background: var(--headline);
    color: var(--background);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    color: var(--form-button);
    border: 2px solid var(--form-button);
}

.btn-outline:hover {
    background: var(--form-button);
    color: var(--headline);
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: var(--paragraph);
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    animation: countUp 2s ease-out 1s both;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--highlight);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* 功能區域 */
.features-section {
    padding: 80px 0;
    background: var(--card-background);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--paragraph);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--highlight);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--highlight);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--background), var(--highlight));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--headline);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--paragraph);
    opacity: 0.8;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* 詞彙學習區域 */
.vocabulary-section, .listening-section, .progress-section {
    padding: 80px 0;
    background: var(--background);
}

.vocabulary-section .section-title,
.listening-section .section-title,
.progress-section .section-title {
    color: var(--headline);
}

.vocabulary-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.word-card {
    background: var(--card-background);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    position: relative;
    transition: all 0.3s ease;
}

.word-card:hover {
    transform: scale(1.02);
}

.word-text {
    font-size: 3rem;
    font-weight: bold;
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.word-pronunciation {
    font-size: 1.2rem;
    color: var(--form-button);
    margin-bottom: 1rem;
}

.audio-btn {
    background: var(--highlight);
    color: var(--headline);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-btn:hover {
    background: #e04638;
    transform: scale(1.1);
}

.word-translation {
    font-size: 2rem;
    color: var(--highlight);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.word-example {
    text-align: left;
    background: rgba(255,255,255,0.5);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid var(--highlight);
}

.vocabulary-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.vocabulary-progress {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.progress-bar {
    background: rgba(255,255,255,0.3);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    background: linear-gradient(90deg, var(--highlight), #ff6b5a);
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--paragraph);
    font-weight: 600;
}

/* 語法練習區域 */
.grammar-section {
    padding: 80px 0;
    background: var(--background);
}

.grammar-container {
    max-width: 900px;
    margin: 0 auto;
}

.grammar-lesson-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.lesson-header h3 {
    color: var(--paragraph);
    font-size: 1.5rem;
    margin: 0;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-badge.beginner {
    background: #28a745;
    color: white;
}

.difficulty-badge.intermediate {
    background: #ffc107;
    color: var(--paragraph);
}

.difficulty-badge.advanced {
    background: var(--highlight);
    color: white;
}

.grammar-rule {
    background: rgba(255,255,255,0.7);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--highlight);
}

.grammar-rule h4 {
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.rule-examples p {
    margin: 0.5rem 0;
    color: var(--paragraph);
}

.grammar-exercise {
    background: rgba(255,255,255,0.5);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.grammar-exercise h4 {
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.exercise-question {
    margin-bottom: 1.5rem;
}

.exercise-question p {
    color: var(--paragraph);
    margin-bottom: 0.5rem;
}

.fill-blank-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.fill-blank-input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid var(--form-button);
    border-radius: 8px;
    font-size: 1rem;
}

.grammar-feedback {
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-weight: 600;
}

.grammar-feedback.correct {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.grammar-feedback.incorrect {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.sentence-reconstruction {
    background: rgba(255,255,255,0.3);
    padding: 1.5rem;
    border-radius: 15px;
}

.sentence-reconstruction h4 {
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.word-tiles-container {
    margin: 1rem 0;
}

.word-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    min-height: 60px;
}

.word-tile {
    background: var(--highlight);
    color: var(--headline);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: grab;
    user-select: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.word-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.word-tile:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.sentence-builder {
    min-height: 80px;
    background: rgba(255,255,255,0.7);
    border: 2px dashed var(--form-button);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.drop-zone {
    color: var(--paragraph);
    opacity: 0.6;
    font-style: italic;
    width: 100%;
    text-align: center;
}

.sentence-builder:not(:empty) .drop-zone {
    display: none;
}

.reconstruction-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.grammar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 15px;
    margin-top: 2rem;
}

.grammar-progress {
    text-align: center;
}

.grammar-progress span {
    display: block;
    color: var(--paragraph);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* 口語練習區域 */
.speaking-section {
    padding: 80px 0;
    background: var(--background);
}

.speaking-container {
    max-width: 900px;
    margin: 0 auto;
}

.pronunciation-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.pronunciation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.pronunciation-header h3 {
    color: var(--paragraph);
    margin: 0;
}

.pronunciation-score {
    text-align: center;
}

.score-label {
    display: block;
    color: var(--paragraph);
    font-size: 0.9rem;
    opacity: 0.8;
}

.score-value {
    display: block;
    color: var(--highlight);
    font-size: 2rem;
    font-weight: bold;
}

.pronunciation-target {
    text-align: center;
    margin-bottom: 2rem;
}

.target-word {
    margin-bottom: 1rem;
}

.word-text {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    color: var(--paragraph);
    margin-bottom: 0.5rem;
}

.word-phonetic {
    color: var(--form-button);
    font-size: 1.2rem;
}

.recording-controls {
    text-align: center;
    margin: 2rem 0;
}

.record-btn {
    background: var(--highlight);
    color: var(--headline);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(242, 80, 66, 0.4);
}

.record-btn.recording {
    background: #dc3545;
    animation: pulse 1.5s infinite;
}

.recording-status {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.recording-animation {
    display: flex;
    gap: 0.2rem;
}

.wave {
    width: 4px;
    height: 20px;
    background: var(--highlight);
    border-radius: 2px;
    animation: wave 1.5s ease-in-out infinite;
}

.wave:nth-child(2) {
    animation-delay: 0.2s;
}

.wave:nth-child(3) {
    animation-delay: 0.4s;
}

.pronunciation-feedback {
    background: rgba(255,255,255,0.7);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 1rem;
}

.feedback-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.feedback-label {
    color: var(--paragraph);
    font-weight: 600;
}

.feedback-score.excellent {
    color: #28a745;
    font-weight: bold;
    font-size: 1.2rem;
}

.tone-accuracy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tone-bar {
    width: 60px;
    height: 8px;
    border-radius: 4px;
}

.tone-bar.excellent {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.feedback-suggestions h4 {
    color: var(--paragraph);
    margin: 1rem 0 0.5rem 0;
}

.feedback-suggestions ul {
    list-style: none;
    padding: 0;
}

.feedback-suggestions li {
    background: rgba(255,255,255,0.5);
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 5px;
    border-left: 3px solid var(--highlight);
}

.dialogue-practice {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.dialogue-practice h3 {
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.dialogue-scenario h4 {
    color: var(--form-button);
    margin-bottom: 1rem;
}

.dialogue-script {
    background: rgba(255,255,255,0.5);
    padding: 1.5rem;
    border-radius: 15px;
}

.dialogue-line {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 10px;
}

.dialogue-line.ai {
    background: rgba(140, 120, 81, 0.1);
}

.dialogue-line.user {
    background: rgba(242, 80, 66, 0.1);
}

.speaker {
    font-weight: bold;
    color: var(--paragraph);
    min-width: 80px;
}

.dialogue-text {
    flex: 1;
    color: var(--paragraph);
}

.play-dialogue,
.record-dialogue {
    background: var(--form-button);
    color: var(--headline);
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speaking-stats {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.speaking-stats h3 {
    color: var(--paragraph);
    margin-bottom: 1.5rem;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--highlight);
    display: block;
}

.stat-label {
    color: var(--paragraph);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 閱讀理解區域 */
.reading-section {
    padding: 80px 0;
    background: var(--background);
}

.reading-container {
    max-width: 1000px;
    margin: 0 auto;
}

.reading-article {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.article-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--form-button);
}

.article-header h3 {
    color: var(--paragraph);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.article-meta span {
    background: rgba(255,255,255,0.7);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
    color: var(--paragraph);
}

.reading-level.intermediate {
    background: #ffc107;
    color: var(--paragraph);
}

.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--paragraph);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.highlight-word {
    background: linear-gradient(120deg, rgba(242, 80, 66, 0.3) 0%, rgba(242, 80, 66, 0.3) 100%);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.highlight-word:hover {
    background: rgba(242, 80, 66, 0.5);
    transform: scale(1.02);
}

.reading-tools {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--form-button);
    flex-wrap: wrap;
}

.comprehension-test {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.comprehension-test h3 {
    color: var(--paragraph);
    margin-bottom: 1.5rem;
}

.test-question {
    background: rgba(255,255,255,0.5);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
}

.test-question p {
    color: var(--paragraph);
    font-weight: 600;
    margin-bottom: 1rem;
}

.multiple-choice {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.choice-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-option:hover {
    background: rgba(255,255,255,0.5);
    transform: translateX(5px);
}

.choice-text {
    color: var(--paragraph);
}

.test-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.test-result {
    background: rgba(255,255,255,0.7);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 1rem;
}

.speed-reading {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.speed-reading h3 {
    color: var(--paragraph);
    margin-bottom: 1.5rem;
}

.speed-reading-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.speed-reading-controls label {
    color: var(--paragraph);
    font-weight: 600;
}

.speed-reading-controls select {
    padding: 0.5rem;
    border: 2px solid var(--form-button);
    border-radius: 5px;
    margin-left: 0.5rem;
}

.speed-reading-display {
    background: rgba(255,255,255,0.9);
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-focus {
    font-size: 3rem;
    font-weight: bold;
    color: var(--paragraph);
    transition: all 0.1s ease;
}

/* 寫作訓練區域 */
.writing-section {
    padding: 80px 0;
    background: var(--background);
}

.writing-container {
    max-width: 1200px;
    margin: 0 auto;
}

.writing-templates {
    margin-bottom: 2rem;
}

.writing-templates h3 {
    color: var(--headline);
    margin-bottom: 1.5rem;
}

.template-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.template-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.template-card.active {
    border-color: var(--highlight);
    box-shadow: 0 0 20px rgba(242, 80, 66, 0.3);
}

.template-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.template-title {
    color: var(--paragraph);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.template-description {
    color: var(--paragraph);
    font-size: 0.9rem;
    opacity: 0.8;
}

.writing-editor {
    background: var(--card-background);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.editor-header {
    background: rgba(255,255,255,0.3);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--form-button);
}

.editor-header h3 {
    color: var(--paragraph);
    margin: 0;
}

.writing-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--paragraph);
}

.template-guide {
    padding: 1.5rem 2rem;
    background: rgba(255,255,255,0.5);
    border-bottom: 1px solid var(--form-button);
}

.template-guide h4 {
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.guide-content {
    color: var(--paragraph);
    line-height: 1.6;
}

.guide-content ol {
    padding-left: 1.5rem;
}

.guide-content li {
    margin-bottom: 0.5rem;
}

.editor-workspace {
    padding: 0;
}

.editor-toolbar {
    background: rgba(255,255,255,0.3);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--form-button);
    display: flex;
    gap: 0.5rem;
}

.toolbar-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    color: var(--paragraph);
    transition: all 0.3s ease;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.5);
    transform: scale(1.1);
}

.writing-textarea {
    width: 100%;
    min-height: 300px;
    border: none;
    padding: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
    resize: vertical;
    background: transparent;
    color: var(--paragraph);
    font-family: 'Noto Sans TC', Arial, sans-serif;
}

.writing-textarea:focus {
    outline: none;
    background: rgba(255,255,255,0.1);
}

.writing-suggestions {
    background: rgba(255,255,255,0.7);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--form-button);
}

.writing-suggestions h4 {
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.writing-feedback {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.writing-feedback h3 {
    color: var(--paragraph);
    margin-bottom: 1.5rem;
}

.feedback-scores {
    margin-bottom: 2rem;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.score-label {
    min-width: 100px;
    color: var(--paragraph);
    font-weight: 600;
}

.score-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--highlight), #ff8a7a);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-value {
    min-width: 60px;
    text-align: right;
    color: var(--paragraph);
    font-weight: bold;
}

.feedback-details h4 {
    color: var(--paragraph);
    margin: 1.5rem 0 0.75rem 0;
}

.feedback-details ul {
    list-style: none;
    padding: 0;
}

.feedback-details li {
    background: rgba(255,255,255,0.5);
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    border-left: 3px solid var(--highlight);
    color: var(--paragraph);
}

.writing-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 聽力訓練區域 */
.listening-container {
    max-width: 800px;
    margin: 0 auto;
}

.audio-player {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.audio-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--paragraph);
    margin-bottom: 1.5rem;
    text-align: center;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-control-btn {
    background: var(--highlight);
    color: var(--headline);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-control-btn:hover {
    background: #e04638;
    transform: scale(1.1);
}

.audio-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-timeline {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.audio-progress-bar {
    height: 100%;
    background: var(--highlight);
    border-radius: 3px;
    transition: width 0.1s ease;
}

.audio-time {
    color: var(--paragraph);
    font-size: 0.9rem;
    white-space: nowrap;
}

.listening-exercise {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.listening-exercise h3 {
    color: var(--paragraph);
    margin-bottom: 1.5rem;
    text-align: center;
}

.question {
    margin-bottom: 2rem;
}

.question p {
    color: var(--paragraph);
    font-weight: 600;
    margin-bottom: 1rem;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.options label:hover {
    background: rgba(255,255,255,0.1);
}

.listening-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.listening-script {
    background: rgba(255,255,255,0.9);
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--highlight);
    margin-top: 1rem;
}

.listening-script h4 {
    color: var(--paragraph);
    margin-bottom: 1rem;
}

.listening-script p {
    color: var(--paragraph);
    line-height: 1.8;
}

/* 進度追蹤區域 */
.progress-dashboard {
    display: grid;
    gap: 2rem;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.progress-stat-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.progress-stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--highlight);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--headline);
    font-size: 1.5rem;
}

.stat-info .stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--paragraph);
    line-height: 1;
}

.stat-info .stat-label {
    font-size: 0.9rem;
    color: var(--paragraph);
    opacity: 0.8;
}

.progress-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.chart-container {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.chart-container h3 {
    color: var(--paragraph);
    margin-bottom: 2rem;
    text-align: center;
}

.time-chart {
    height: 200px;
    display: flex;
    align-items: end;
    justify-content: center;
}

.chart-bars {
    display: flex;
    align-items: end;
    gap: 0.5rem;
    height: 100%;
}

.chart-bar {
    background: linear-gradient(to top, var(--highlight), #ff8a7a);
    width: 30px;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chart-bar:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--paragraph);
    white-space: nowrap;
}

.bar-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--paragraph);
    white-space: nowrap;
}

.achievements-container {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.achievements-container h3 {
    color: var(--paragraph);
    margin-bottom: 2rem;
    text-align: center;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.achievement {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.achievement.earned {
    background: linear-gradient(135deg, var(--highlight), #ff8a7a);
    color: var(--headline);
    box-shadow: 0 5px 15px rgba(242, 80, 66, 0.3);
}

.achievement:not(.earned) {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement:hover {
    transform: scale(1.05);
}

.achievement i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.achievement span {
    font-size: 0.8rem;
    text-align: center;
    font-weight: 600;
}

/* 頁腳 */
.footer {
    background: var(--paragraph);
    color: var(--headline);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.bounce {
    animation: bounce 2s infinite;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--background);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .vocabulary-controls,
    .listening-controls {
        flex-direction: column;
    }

    .progress-charts {
        grid-template-columns: 1fr;
    }

    .chart-bars {
        justify-content: space-between;
        padding: 0 1rem;
    }

    .progress-stats {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .word-text {
        font-size: 2rem;
    }

    .word-card {
        padding: 2rem;
    }

    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--paragraph);
    color: var(--headline);
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::before {
    opacity: 1;
}

/* 載入動畫 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--card-background);
    border-top: 4px solid var(--highlight);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 新增的動畫效果 */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes wave {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.5);
    }
}

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

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes flipIn {
    0% {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    100% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

/* 響應式更新 */
@media (max-width: 768px) {
    .grammar-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .template-cards {
        grid-template-columns: 1fr;
    }
    
    .word-tiles {
        justify-content: center;
    }
    
    .writing-stats {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .dialogue-line {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .speaker {
        min-width: auto;
    }
    
    .pronunciation-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* 訊息通知 */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--highlight);
    color: var(--headline);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.warning {
    background: #ffc107;
    color: var(--paragraph);
}