/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 导航栏样式 */
.navbar {
    background-color: #2c3e50;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.logo {
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3498db;
}

/* 登录页面样式 */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #2c3e50, #3498db);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1rem;
}

.login-box h2 {
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.login-btn {
    width: 100%;
    padding: 0.8rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #2980b9;
}

.links {
    margin-top: 1rem;
    text-align: center;
}

.links a {
    color: #3498db;
    text-decoration: none;
    margin: 0 0.5rem;
}

/* 主页样式 */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://via.placeholder.com/1920x1080');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0 1rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.content-section {
    padding: 4rem 2rem;
}

.content-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.herb-grid, .knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.herb-card, .knowledge-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.herb-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px 8px 0 0;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 游戏页面样式 */
.game-hero {
    height: 300px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
}

.game-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.game-hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 游戏模式选择 */
.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.mode-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.mode-card h3 {
    color: #1a3c6b;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.mode-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.start-btn {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

/* 游戏区域 */
.game-area {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.score, .timer {
    font-size: 1.2rem;
    color: #1a3c6b;
    font-weight: bold;
}

/* 猜中药游戏 */
.guess-game {
    text-align: center;
}

.question-container {
    margin-bottom: 2rem;
}

.question-container h3 {
    color: #1a3c6b;
    margin-bottom: 1rem;
}

.answer-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

#herb-answer {
    width: 300px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#herb-answer:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

#submit-answer {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#submit-answer:hover {
    background: #0d47a1;
    transform: translateY(-2px);
}

.hint-container {
    margin-top: 1rem;
}

#show-hint {
    background: none;
    border: 2px solid #1a73e8;
    color: #1a73e8;
    padding: 8px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#show-hint:hover {
    background: #1a73e8;
    color: white;
}

#hint-text {
    margin-top: 1rem;
    color: #666;
    font-style: italic;
}

/* 配对游戏 */
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.match-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    height: auto;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.match-card .card-content {
    width: 100%;
    text-align: center;
    backface-visibility: hidden;
}

.match-card h4 {
    color: #1a3c6b;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.match-card p {
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.match-card .description {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    margin-top: 0.8rem;
}

.match-card.effect-card {
    background: #f8f9fa;
}

.match-card.herb-card {
    background: #e8f0fe;
}

.match-card:hover {
    border-color: #1a73e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.1);
}

.match-card.flipped {
    background: #e8f0fe;
    border-color: #1a73e8;
    transform: rotateY(180deg);
}

.match-card.matched {
    background: #e6f4ea;
    border-color: #34a853;
    cursor: default;
    transform: none;
}

.match-card.matched:hover {
    transform: none;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-hero h1 {
        font-size: 2rem;
    }

    .game-modes {
        grid-template-columns: 1fr;
    }

    .answer-container {
        flex-direction: column;
        align-items: center;
    }

    #herb-answer {
        width: 100%;
        max-width: 300px;
    }

    .match-grid {
        grid-template-columns: 1fr;
    }

    .match-card {
        min-height: 160px;
    }
}

/* 知识问答游戏 */
.quiz-game {
    text-align: center;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    border-color: #1a73e8;
    transform: translateY(-2px);
}

.option-btn.correct {
    background: #e6f4ea;
    border-color: #34a853;
}

.option-btn.wrong {
    background: #fce8e6;
    border-color: #ea4335;
}

/* 游戏控制按钮 */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

#next-question, #end-game {
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#next-question {
    background: #1a73e8;
    color: white;
    border: none;
}

#end-game {
    background: white;
    color: #ea4335;
    border: 2px solid #ea4335;
}

#next-question:hover {
    background: #0d47a1;
    transform: translateY(-2px);
}

#end-game:hover {
    background: #ea4335;
    color: white;
    transform: translateY(-2px);
}

/* 游戏结果 */
.game-result {
    text-align: center;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.game-result h2 {
    color: #1a3c6b;
    margin-bottom: 1.5rem;
}

.result-details {
    margin-bottom: 2rem;
}

.result-details p {
    font-size: 1.2rem;
    color: #666;
    margin: 0.5rem 0;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

#play-again, #back-to-modes {
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#play-again {
    background: #1a73e8;
    color: white;
    border: none;
}

#back-to-modes {
    background: white;
    color: #1a73e8;
    border: 2px solid #1a73e8;
}

#play-again:hover, #back-to-modes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

/* 英雄区按钮 */
.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.primary-btn, .secondary-btn {
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.primary-btn {
    background: #1a73e8;
    color: white;
    border: none;
}

.secondary-btn {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.primary-btn:hover {
    background: #0d47a1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* 特色功能 */
.features {
    padding: 4rem 2rem;
    background: #f8f9fa;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #1a3c6b;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* 热门中药 */
.popular-herbs {
    padding: 4rem 2rem;
}

.herb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 中医知识 */
.knowledge-section {
    padding: 4rem 2rem;
    background: #f8f9fa;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 养生保健 */
.health-section {
    padding: 4rem 2rem;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 关于我们 */
.about-section {
    padding: 4rem 2rem;
    background: #f8f9fa;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content > p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.8;
    margin-bottom: 3rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.about-feature {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.about-feature h4 {
    color: #1a3c6b;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.about-feature p {
    color: #666;
    font-size: 0.95rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .primary-btn, .secondary-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .feature-grid,
    .herb-grid,
    .knowledge-grid,
    .health-grid {
        grid-template-columns: 1fr;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .about-content > p {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

.detail-btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    text-align: center;
}

.detail-btn:hover {
    background-color: #2980b9;
    color: white;
    text-decoration: none;
}

/* 中药详情页面样式 */
.herb-detail-section {
    padding: 6rem 2rem 4rem;
    background: #f8f9fa;
    min-height: 100vh;
}

.herb-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.herb-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.herb-header h1 {
    color: #1a3c6b;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.herb-basic-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: #666;
}

.herb-content {
    display: grid;
    gap: 2rem;
}

.herb-image-container {
    text-align: center;
    margin-bottom: 2rem;
}

.herb-image-container img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.herb-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card h3 {
    color: #1a3c6b;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-card p {
    color: #666;
    line-height: 1.6;
}

.herb-description {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.herb-description h3 {
    color: #1a3c6b;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.herb-description p {
    color: #666;
    line-height: 1.8;
    text-align: justify;
}

@media (max-width: 768px) {
    .herb-detail-section {
        padding: 5rem 1rem 2rem;
    }

    .herb-detail-container {
        padding: 1.5rem;
    }

    .herb-header h1 {
        font-size: 2rem;
    }

    .herb-basic-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .herb-info-grid {
        grid-template-columns: 1fr;
    }

    .herb-image-container img {
        max-height: 300px;
    }
} 