/* 全局样式 */
:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --text-color: #333;
    --background-color: #FFF8DC;
    --accent-color: #CD853F;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f4f4f4;
    overflow-x: hidden;
}

/* 加载屏幕 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
}

.chinese-character {
    font-size: 5rem;
    font-family: 'Ma Shan Zheng', cursive;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

.loading-text {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

/* 导航栏 */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 248, 220, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* 英雄区域 */
.hero-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #FFF8DC 0%, #FFE4B5 100%);
}

.hero-content {
    text-align: center;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

/* 首页主标题美化 */
.hero-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 18px;
    display: inline-block;
}

/* 浮动汉字 */
.floating-characters {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.char {
    position: absolute;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 4rem;
    color: rgba(139, 69, 19, 0.1);
    animation: float 6s infinite ease-in-out;
}

.char:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.char:nth-child(2) { top: 40%; right: 15%; animation-delay: 1s; }
.char:nth-child(3) { bottom: 30%; left: 20%; animation-delay: 2s; }
.char:nth-child(4) { bottom: 20%; right: 25%; animation-delay: 3s; }

/* 文化传承部分 */
.culture-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    padding: 40px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.culture-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.culture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.culture-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.culture-card:hover {
    transform: translateY(-10px);
}

.card-content {
    padding: 2rem;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* 互动体验部分 */
.interactive-section {
    padding: 5rem 2rem;
    background-color: var(--background-color);
}

.interactive-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.interactive-left {
    position: relative;
}

.character-animation {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.character-canvas {
    width: 100%;
    height: 400px;
    background: #f9f9f9;
    border: 2px solid var(--accent-color);
    border-radius: 5px;
    touch-action: none; /* 防止触摸设备上的默认行为 */
    cursor: crosshair; /* 显示十字光标 */
}

.canvas-controls {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 5px;
}

.brush-size, .color-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.brush-size input[type="range"] {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--accent-color);
    border-radius: 2px;
    outline: none;
}

.brush-size input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.brush-size input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.color-picker select {
    padding: 0.5rem;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker select:hover {
    border-color: var(--primary-color);
}

.interactive-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.interactive-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-panel {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-panel.hidden {
    display: none;
}

.info-panel h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-panel ul {
    list-style: none;
    padding-left: 1rem;
}

.info-panel ul li {
    margin-bottom: 0.5rem;
    position: relative;
}

.info-panel ul li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: -1rem;
}

.animation-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.animation-controls button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.animation-controls button:hover {
    background-color: var(--secondary-color);
}

.learning-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.evolution-timeline {
    margin-top: 1rem;
    position: relative;
    padding-left: 2rem;
}

.evolution-timeline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--accent-color);
}

.timeline-item {
    position: relative;
    padding: 1rem 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -2.5rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translateY(-50%);
}

.period {
    font-weight: bold;
    color: var(--primary-color);
}

.year {
    margin-left: 1rem;
    color: var(--secondary-color);
}

.practice-content {
    text-align: center;
}

.practice-character {
    margin: 2rem 0;
    position: relative;
}

.character-display {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stroke-order {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.stroke {
    width: 2rem;
    height: 2rem;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stroke.visible {
    opacity: 1;
}

.practice-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.practice-controls button {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.practice-controls button:hover {
    background-color: var(--secondary-color);
}

/* 数字画廊部分 */
.gallery-section {
    padding: 5rem 2rem;
    background-color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 16/9;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 2rem;
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

/* 页脚 */
.footer {
    background-color: var(--primary-color);
    color: #fff;
    padding: 4rem 2rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 动画 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .interactive-container {
        grid-template-columns: 1fr;
    }

    .canvas-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .interactive-controls {
        grid-template-columns: 1fr;
    }

    .learning-tabs {
        flex-direction: column;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* 响应式设计 - 小屏幕 */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .interactive-controls button {
        padding: 0.8rem 1.2rem;
    }

    .gallery-item img {
        height: 200px;
    }
}

/* 滚动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--primary-color);
}

.arrow {
    width: 30px;
    height: 30px;
    border-right: 3px solid var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    transform: rotate(45deg);
    margin: 1rem auto;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
    40% { transform: translateY(-20px) rotate(45deg); }
    60% { transform: translateY(-10px) rotate(45deg); }
}

/* 新页面样式 */
header {
    background: #35424a;
    color: #ffffff;
    padding: 20px 0;
    text-align: center;
}

header h1 {
    color: #ffffff; /* 确保标题在深色背景上可见 */
}

main {
    padding: 20px;
}

section {
    background: #ffffff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: #35424a;
}

footer {
    text-align: center;
    padding: 10px 0;
    background: #35424a;
    color: #ffffff;
}

footer a {
    color: #ffffff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 新页面卡片样式 */
.card-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    margin-top: 24px;
}
.card-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 28px 24px;
    max-width: 350px;
    min-width: 260px;
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card-item:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.card-item h2 {
    margin-top: 0;
    color: #35424a;
    font-size: 1.3em;
    margin-bottom: 12px;
}
.card-item p {
    color: #444;
    font-size: 1em;
    margin-bottom: 0;
} 

.culture-section {
    background: #f8f6f3;
    padding: 80px 20px;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.05);
}

.culture-section h2 {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 4rem;
    color: var(--primary-color);
    font-family: 'Ma Shan Zheng', cursive;
}

.culture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
}

.culture-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px var(--shadow-color);
    transition: all 0.3s ease;
    transform: translateY(0);
    position: relative;
}

.culture-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary-color);
}

.culture-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 36px rgba(139, 69, 19, 0.15);
}

.culture-card:hover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.9));
}

.card-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-content h3 {
    font-size: 1.8rem;
    font-family: 'Noto Serif SC', serif;
    color: var(--primary-color);
    line-height: 1.2;
    position: relative;
}

.card-content h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.card-content h3 a:hover {
    color: var(--secondary-color);
}

.card-content h3 a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.card-content h3 a:hover::after {
    width: 100%;
}

.card-content p {
    font-size: 1.15rem;
    color: #555;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .culture-section {
        padding: 60px 20px;
    }
    
    .culture-section h2 {
        font-size: 2.4rem;
        margin-bottom: 3rem;
    }

    .culture-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .culture-section {
        padding: 40px 15px;
    }
    
    .culture-grid {
        padding: 0 1rem;
        gap: 2rem;
    }

    .card-content {
        padding: 2rem;
    }

    .card-content h3 {
        font-size: 1.6rem;
    }
}
