/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f9f7f2;
    background-image: url('traditional-bg.png');
    background-attachment: fixed;
    background-position: center;
    background-repeat: repeat;
    background-size: cover;
    position: relative;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 导航栏样式 */
.navbar {
    background-color: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background-color: #e4e7ed;
    color: #2a5298;
    transform: translateY(-2px);
}

.favorite-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    background-color: #ee5253;
    transform: translateY(-2px);
}

/* 搜索框样式 */
.search-section {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid #e6d7c3;
}

.search-section h2 {
    color: #8B4513;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.search-form {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.search-btn {
    background-color: #8B4513;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background-color: #A0522D;
    transform: translateY(-2px);
}

/* 分类链接样式 */
.category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.category-links a {
    background-color: #f5efe6;
    color: #8B4513;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid #e6d7c3;
}

.category-links a:hover {
    background-color: #8B4513;
    color: white;
    transform: translateY(-2px);
}

/* 内容卡片样式 */
.content-card {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-card h2 {
    color: #1e3c72;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e4e7ed;
    font-size: 1.8rem;
}

/* 药方列表样式 */
.prescription-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.prescription-item {
    background-color: #f8f5f0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    border-left: 4px solid #8B4513;
}

.prescription-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
    border-color: #2a5298;
}

.prescription-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 10px;
}

.prescription-title a {
    color: #1e3c72;
    text-decoration: none;
    transition: color 0.3s ease;
}

.prescription-title a:hover {
    color: #2a5298;
    text-decoration: underline;
}

.prescription-categories {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.category-tag {
    background-color: #e4e7ed;
    color: #666;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
}

.category-tag a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-tag a:hover {
    color: #2a5298;
}

/* 药方详情样式 */
.prescription-detail {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.prescription-detail h1 {
    color: #1e3c72;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e4e7ed;
    font-size: 2rem;
}

.prescription-detail-content {
    line-height: 1.8;
    color: #333;
    margin-top: 20px;
}

.prescription-detail-content p {
    margin-bottom: 15px;
    text-align: justify;
}

/* 导航按钮样式 */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e4e7ed;
}

.nav-btn {
    background-color: #f0f2f5;
    color: #1e3c72;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-btn:hover {
    background-color: #2a5298;
    color: white;
    transform: translateY(-2px);
}

/* 说明区域样式 */
.description-section {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.description-section h2 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.description-section p {
    line-height: 1.8;
    color: #333;
    margin-bottom: 15px;
    text-align: justify;
}

/* 页脚样式 */
.footer {
    background-color: #8B4513;
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
    border-top: 4px solid #CD853F;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #f8f5f0;
}

.footer-copyright {
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }
    
    .favorite-btn {
        width: 100%;
        text-align: center;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .search-form {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .search-btn {
        margin-left: 0;
        width: 100%;
        max-width: 400px;
        align-self: center;
    }
    
    .prescription-grid {
        grid-template-columns: 1fr;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .content-card,
    .prescription-detail,
    .description-section {
        padding: 20px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card,
.search-section,
.prescription-detail,
.description-section {
    animation: fadeIn 0.5s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 音乐控制按钮样式 */
.music-control {
    background-color: #CD853F;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.music-control:hover {
    background-color: #D2B48C;
    transform: translateY(-2px);
}

.music-control.playing {
    background-color: #8B4513;
}

/* 移动端菜单按钮样式 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #1e3c72;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 移动端菜单展开状态 */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Toast通知样式 */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-notification.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 响应式调整 - 移动端菜单显示 */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background-color: white;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        padding: 80px 20px 20px;
        transition: right 0.3s ease;
        z-index: 100;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        margin-bottom: 15px;
        font-size: 18px;
        padding: 10px 0;
    }
}