/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

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

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

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

.nav-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    margin: 0;
}

.nav-logo span {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
}

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

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
    background-color: #eff6ff;
}

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

.bar {
    width: 25px;
    height: 3px;
    background-color: #64748b;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

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

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.floating-characters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.floating-characters .char {
    font-size: 4rem;
    font-weight: 700;
    animation: float 3s ease-in-out infinite;
    opacity: 0.9;
}

.floating-characters .char:nth-child(2) {
    animation-delay: 0.5s;
}

.floating-characters .char:nth-child(3) {
    animation-delay: 1s;
}

.floating-characters .char:nth-child(4) {
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

/* Characters Grid */
.characters-section {
    padding: 80px 0;
    background: white;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.character-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.char-main {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.char-info-hover {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.char-pinyin {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.char-english {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.character-card:hover .char-info-hover {
    opacity: 1;
    transform: translateY(0);
}

.character-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: #f8fafc;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.feature-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.feature-link:hover {
    color: #1d4ed8;
}

/* Games Section */
.games-section {
    padding: 80px 0;
    background: white;
}

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

.game-card {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.game-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-4px);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.game-card p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.game-area {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

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

/* Comparison Section */
.comparison-section {
    padding: 80px 0;
    background: white;
}

.comparison-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

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

.comparison-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.comparison-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-4px);
}

.comparison-card .simplified {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.comparison-card .traditional {
    font-size: 2.5rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 1rem;
}

.comparison-card .pinyin {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.comparison-card .meaning {
    font-size: 0.8rem;
    color: #64748b;
}

/* Dictionary Section */
.dictionary-section {
    padding: 80px 0;
    background: white;
}

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

.search-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 300px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
}

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

.dictionary-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dictionary-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-4px);
}

.dictionary-card .character {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.dictionary-card .english {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal[style*="display: block"] .modal-content {
    transform: translateY(0);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #000;
}

/* Calligraphy Section */
.calligraphy-section {
    padding: 80px 0;
    background: white;
}

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

.calligraphy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
}

.calligraphy-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calligraphy-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-4px);
}

.calligraphy-card .character {
    font-size: 3rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-family: 'KaiTi', '楷体', serif;
}

.calligraphy-card .pinyin {
    font-size: 0.9rem;
    color: #64748b;
}

/* Practice Section */
.practice-section {
    padding: 80px 0;
    background: #f8fafc;
}

.practice-area {
    max-width: 600px;
    margin: 0 auto;
}

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

.practice-canvas-container {
    text-align: center;
}

#practiceCanvas {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    cursor: crosshair;
}

.practice-guide {
    margin-top: 1rem;
    color: #64748b;
}

/* Memory Game Styles */
.memory-game {
    text-align: center;
    padding: 2rem 0;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.game-instructions {
    margin-top: 2rem;
    padding: 1rem;
    background: #eff6ff;
    border-radius: 8px;
    color: #1e40af;
}

.game-instructions p {
    margin: 0;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 1.1rem;
    grid-column: 1 / -1;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.memory-card {
    aspect-ratio: 1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    min-height: 80px;
}

.memory-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.memory-card.flipped .card-back {
    display: none;
}

.memory-card.flipped .card-front {
    display: block;
}

.memory-card.matched {
    background: #dcfce7;
    border-color: #16a34a;
    color: #16a34a;
}

.card-back {
    display: block;
    font-size: 1.5rem;
    color: #64748b;
}

.card-front {
    display: none;
}

/* Word Search Game Styles */
.word-search-game {
    text-align: center;
    padding: 2rem 0;
}

.word-search-instructions {
    margin-bottom: 2rem;
}

.word-search-instructions p {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #1e293b;
}

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

.target-char {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: white;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.word-search-grid {
    display: inline-block;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    background: white;
    margin-bottom: 2rem;
}

.grid-row {
    display: flex;
}

.grid-cell {
    width: 50px;
    height: 50px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.grid-cell:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

.grid-cell.found {
    background: #dcfce7;
    border-color: #16a34a;
    color: #16a34a;
    animation: found 0.5s ease;
}

.game-progress {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

@keyframes found {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

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

/* Quiz Game Styles */
.character-quiz {
    text-align: center;
    padding: 2rem 0;
    max-width: 600px;
    margin: 0 auto;
}

.quiz-progress {
    margin-bottom: 2rem;
    font-weight: 600;
    color: #1e293b;
}

.quiz-question {
    margin-bottom: 3rem;
}

.quiz-char {
    font-size: 4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.quiz-text {
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.quiz-option {
    padding: 1rem 2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.quiz-option.correct {
    background: #dcfce7;
    border-color: #16a34a;
    color: #16a34a;
}

.quiz-option.incorrect {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

.quiz-option:disabled {
    cursor: not-allowed;
}

.quiz-results {
    text-align: center;
    padding: 2rem;
}

.quiz-results h3 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.quiz-results p {
    color: #64748b;
    margin-bottom: 0.5rem;
}

/* Stroke Order Game Styles */
.stroke-order-game {
    text-align: center;
    padding: 2rem 0;
    max-width: 600px;
    margin: 0 auto;
}

.stroke-progress {
    margin-bottom: 2rem;
    font-weight: 600;
    color: #1e293b;
}

.stroke-display {
    margin-bottom: 3rem;
}

.stroke-char {
    font-size: 4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.stroke-description {
    font-size: 1.1rem;
    color: #64748b;
    line-height: 1.6;
}

.stroke-steps {
    margin-bottom: 3rem;
}

.stroke-steps h4 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.stroke-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 300px;
    margin: 0 auto;
}

.stroke-step {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.stroke-step.completed {
    background: #dcfce7;
    border-color: #16a34a;
    color: #16a34a;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
}

.stroke-step.completed .step-number {
    background: #16a34a;
}

.step-stroke {
    font-weight: 600;
}

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

.stroke-results {
    text-align: center;
    padding: 2rem;
}

.stroke-results h3 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.stroke-results p {
    color: #64748b;
    margin-bottom: 1rem;
}

/* Character Detail Styles */
.character-detail-content {
    text-align: center;
}

.char-display {
    margin-bottom: 2rem;
}

.main-char {
    font-size: 4rem;
    font-weight: 700;
    color: #1e293b;
    display: block;
    margin-bottom: 1rem;
}

.char-pinyin-large {
    font-size: 1.5rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 2rem;
}

.char-info {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.info-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #2563eb;
}

.info-section h4 {
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.char-info p {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.char-info strong {
    color: #2563eb;
    margin-right: 0.5rem;
}

.char-comment {
    line-height: 1.6;
    color: #374151;
    font-style: italic;
}

.usage-examples {
    display: grid;
    gap: 0.5rem;
}

.usage-examples div {
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Calligraphy Detail Styles */
.calligraphy-detail-content {
    text-align: center;
}

.calligraphy-display {
    margin-bottom: 2rem;
}

.calligraphy-char {
    font-size: 4rem;
    font-weight: 700;
    color: #1e293b;
    display: block;
    margin-bottom: 1rem;
    font-family: 'KaiTi', '楷体', serif;
}

.calligraphy-info {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.calligraphy-info p {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.calligraphy-info strong {
    color: #2563eb;
    margin-right: 0.5rem;
}

/* Info Sections */
.info-section,
.calligraphy-info-section,
.tips-section {
    padding: 80px 0;
    background: #f8fafc;
}

.info-grid,
.calligraphy-info-grid,
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.info-card,
.tip-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.info-card h3,
.tip-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.info-card p,
.tip-card p {
    color: #64748b;
    line-height: 1.6;
}

.tip-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #f8fafc;
}

.footer-section p {
    color: #cbd5e1;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #2563eb;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    color: #cbd5e1;
}

.footer-copyright {
    color: #cbd5e1;
}

.footer-external-links {
    display: flex;
    gap: 1rem;
}

.external-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #000000;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #000000;
}

.external-link:hover {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
}

.link-icon {
    font-size: 1rem;
}

.link-text {
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

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

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

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .character-card {
        font-size: 1.5rem;
        padding: 0.5rem;
    }

    .comparison-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .dictionary-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .calligraphy-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .memory-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        max-width: 300px;
    }

    .memory-card {
        font-size: 1.5rem;
    }

    .search-controls,
    .comparison-controls,
    .calligraphy-controls {
        flex-direction: column;
        align-items: center;
    }

    .search-input {
        min-width: 250px;
    }

    .game-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .practice-controls {
        flex-wrap: wrap;
    }

    #practiceCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-external-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 100px 0 60px;
    }

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .floating-characters .char {
        font-size: 2.5rem;
    }

    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 0.5rem;
    }

    .character-card {
        font-size: 1.2rem;
        padding: 0.5rem;
    }

    .features-grid,
    .games-grid,
    .info-grid,
    .calligraphy-info-grid,
    .tips-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
    }
}

/* Page-specific hero backgrounds */
.hero-games {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.hero-traditional {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.hero-english {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.hero-calligraphy {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.hero-time {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-tools {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

/* 404 Error Page Styles */
.error-section {
    padding: 120px 0 80px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

/* Floating bookmark button */
.floating-actions {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.bookmark-btn {
    background: #ffffff;
    color: #333;
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
    padding: 8px 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.bookmark-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border-color: #cbd5e1;
}

.bookmark-btn.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* Share section */
.share-section {
    padding: 40px 0;
    background: #f8f9fa;
}

.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-label {
    color: #333;
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #333;
    border-radius: 9999px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.share-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.share-btn.facebook { border-color: #1877f2; color: #1877f2; }
.share-btn.twitter { border-color: #1da1f2; color: #1da1f2; }
.share-btn.linkedin { border-color: #0a66c2; color: #0a66c2; }
.share-btn.reddit { border-color: #ff4500; color: #ff4500; }
.share-btn.whatsapp { border-color: #25d366; color: #25d366; }

/* Page summary */
.page-summary {
    padding: 40px 0;
}

.page-summary .summary-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.page-summary h2 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.page-summary p {
    color: #555;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .floating-actions { right: 12px; top: 12px; }
}

.error-content h1 {
    font-size: 8rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.error-content h2 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    color: #fff;
}

.error-content p {
    font-size: 1.2rem;
    margin: 0 0 2rem 0;
    opacity: 0.9;
}

.error-actions {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-suggestions {
    margin-top: 3rem;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.error-suggestions h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

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

.error-suggestions li {
    margin: 0.5rem 0;
}

.error-suggestions a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    display: inline-block;
    transition: background 0.3s ease;
}

.error-suggestions a:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    .error-content h1 {
        font-size: 6rem;
    }
    
    .error-content h2 {
        font-size: 2rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-suggestions {
        padding: 0 1rem;
    }
}

/* Site Map Page Styles */
.sitemap-section {
    padding: 120px 0 80px;
}

.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.sitemap-category {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sitemap-category h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.sitemap-category ul {
    list-style: none;
    padding: 0;
}

.sitemap-category li {
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.sitemap-category li:last-child {
    border-bottom: none;
}

.sitemap-category a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
}

.sitemap-category a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.sitemap-category p {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
}

.sitemap-info {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 3rem;
}

.sitemap-info h3 {
    color: #333;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
}

.sitemap-info h3:first-child {
    margin-top: 0;
}

.sitemap-info p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.sitemap-info ul {
    color: #555;
    line-height: 1.8;
}

.sitemap-info li {
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    .sitemap-grid {
        grid-template-columns: 1fr;
    }
    
    .sitemap-category {
        padding: 1.5rem;
    }
    
    .sitemap-info {
        padding: 1.5rem;
    }
}

/* Time Characters Page Styles */
.time-vocabulary-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.time-categories {
    margin-top: 3rem;
}

.time-category {
    margin-bottom: 4rem;
}

.time-category h3 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 3px solid #667eea;
    padding-bottom: 1rem;
}

.time-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.time-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.time-card .char {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.time-card .pinyin {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.time-card .meaning {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.time-card .example {
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
}

.time-tools-section {
    padding: 80px 0;
}

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

.tool-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tool-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.cultural-context-section {
    padding: 80px 0;
    background: #f8f9fa;
}

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

.cultural-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cultural-card h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.cultural-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.cultural-card ul {
    list-style: none;
    padding: 0;
}

.cultural-card li {
    color: #555;
    padding: 0.3rem 0;
    border-bottom: 1px solid #eee;
}

.cultural-card li:last-child {
    border-bottom: none;
}

.faq-section {
    padding: 80px 0;
}

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

.faq-item {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.faq-item h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.faq-item p {
    color: #666;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .time-category h3 {
        font-size: 1.5rem;
    }
    
    .time-card .char {
        font-size: 2.5rem;
    }
    
    .tools-grid,
    .cultural-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card,
    .cultural-card,
    .faq-item {
        padding: 1.5rem;
    }
}

/* Time Learning Tools Page Styles */
.time-converter-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.converter-tool {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.converter-input h3,
.converter-output h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.output-display {
    text-align: center;
}

.chinese-time {
    font-size: 2rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pinyin-time {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.english-time {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

.time-quiz-section {
    padding: 80px 0;
}

.quiz-container {
    max-width: 600px;
    margin: 3rem auto 0;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-header h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.quiz-progress {
    color: #666;
    font-size: 1rem;
}

.quiz-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quiz-option {
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
}

.quiz-option:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.quiz-feedback {
    text-align: center;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.quiz-results {
    text-align: center;
    padding: 2rem;
}

.quiz-results h3 {
    color: #333;
    margin-bottom: 1rem;
}

.calendar-practice-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.calendar-tool {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.calendar-display,
.calendar-practice {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.calendar-display h3,
.calendar-practice h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.date-display {
    text-align: center;
}

.chinese-date {
    font-size: 1.8rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pinyin-date {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.english-date {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.practice-input {
    margin-bottom: 1.5rem;
}

.practice-input input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.practice-output {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.writing-practice-section {
    padding: 80px 0;
}

.writing-tools {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-top: 3rem;
}

.character-selector,
.writing-area {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.character-selector h3,
.writing-area h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.character-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.char-btn {
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 2rem;
    color: #667eea;
    transition: all 0.3s ease;
}

.char-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.stroke-guide {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.writing-canvas {
    text-align: center;
}

#writingCanvas {
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 1rem;
    cursor: crosshair;
}

.progress-section {
    padding: 80px 0;
    background: #f8f9fa;
}

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

.stat-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .converter-tool,
    .calendar-tool,
    .writing-tools {
        grid-template-columns: 1fr;
    }
    
    .character-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chinese-time {
        font-size: 1.5rem;
    }
    
    .chinese-date {
        font-size: 1.4rem;
    }
} 