/* 全局样式 */
:root {
    --primary-color: #2B7A4B;
    --primary-dark: #1E5A38;
    --primary-light: #8FC9A3;
    --secondary-color: #E8B86B;
    --accent-color: #D97A3E;
    --herbal-color: #5B8C5A;
    --dark-color: #2C3E2F;
    --light-color: #6B7B6E;
    --gray-light: #F8F9F5;
    --gray-bg: #F4F6F0;
    --white-color: #FFFFFF;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
    color: var(--dark-color);
    background: var(--gray-light);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 通用部分样式 */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--dark-color);
}

.section-title span {
    color: var(--primary-color);
}

/* 顶部导航栏 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(43, 122, 75, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.6rem;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-link {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--dark-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    display: none;
    background: var(--white-color);
    border-top: 1px solid rgba(43, 122, 75, 0.1);
}

.mobile-menu.active {
    display: block;
}

.mobile-menu-container {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-nav-link {
    padding: 0.75rem 0;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary-color);
}

/* Banner区 */
.hero-banner {
    position: relative;
    min-height: 45vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #2B7A4B 0%, #4A9E6B 50%, #E8B86B 100%);
    overflow: hidden;
    padding: 4rem 0 6rem;
}

.hero-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.08"><path fill="white" d="M20,30 L30,20 L40,30 L30,40 Z M70,70 L80,60 L90,70 L80,80 Z M45,10 L50,5 L55,10 L50,15 Z M10,85 L15,80 L20,85 L15,90 Z M85,45 L90,40 L95,45 L90,50 Z"/><circle cx="75" cy="25" r="3"/><circle cx="15" cy="65" r="2"/></svg>');
    background-repeat: repeat;
    pointer-events: none;
}

.banner-content {
    position: relative;
    z-index: 10;
    color: var(--white-color);
    text-align: center;
    width: 100%;
}

.banner-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.banner-title {
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.02em;
}

.banner-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
    font-weight: 400;
}

.banner-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-number span {
    font-size: 1.2rem;
    font-weight: 500;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    line-height: 0;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: auto;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: -3.5rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 20;
}

.stat-card {
    background: var(--white-color);
    border-radius: 1.5rem;
    padding: 1.8rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border: 1px solid rgba(43, 122, 75, 0.1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(43, 122, 75, 0.12);
}

.stat-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.stat-card .number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card .number span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--light-color);
}

.stat-card .label {
    color: var(--dark-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-card .desc {
    color: var(--light-color);
    font-size: 0.8rem;
}

/* 搜索区域 */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    max-width: 36rem;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-left: 3rem;
    padding-right: 3rem;
    border: 2px solid rgba(43, 122, 75, 0.15);
    border-radius: 3rem;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    background: var(--white-color);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(43, 122, 75, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-color);
    font-size: 1.1rem;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--light-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    transition: var(--transition);
}

.search-clear:hover {
    color: var(--accent-color);
}

/* 筛选区域 */
.filter-section {
    background: var(--white-color);
    border-radius: 1.25rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(43, 122, 75, 0.08);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.filter-label i {
    font-size: 1rem;
}

/* 字母索引 */
.alphabet-index {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.alpha-link {
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: var(--gray-bg);
    color: var(--light-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.85rem;
}

.alpha-link:hover {
    background: var(--primary-light);
    color: var(--white-color);
    transform: translateY(-2px);
}

.alpha-link.active {
    background: var(--primary-color);
    color: var(--white-color);
    box-shadow: 0 4px 12px rgba(43, 122, 75, 0.3);
}

/* 分类导航 */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.category-btn {
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(43, 122, 75, 0.2);
    background: var(--white-color);
    color: var(--light-color);
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    background: rgba(43, 122, 75, 0.05);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(43, 122, 75, 0.2);
}

/* 统计和视图切换 */
.stats-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--white-color);
    border-radius: 2rem;
    box-shadow: var(--shadow-sm);
}

.total-count {
    font-weight: 500;
    color: var(--light-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.total-count i {
    color: var(--primary-color);
    font-size: 1rem;
}

.total-count span {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0.2rem;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--white-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--light-color);
}

.toggle-btn:hover,
.toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 药材网格 - 网格视图 */
.herbal-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.herbal-grid.list-view {
    grid-template-columns: 1fr;
}

.herbal-grid.list-view .herbal-card {
    display: grid;
    grid-template-columns: auto 1fr 1.2fr;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 1.5rem;
}

.herbal-grid.list-view .herbal-card .herbal-header {
    margin-bottom: 0;
    min-width: 100px;
}

.herbal-grid.list-view .herbal-card .herbal-efficacy {
    margin: 0;
}

.herbal-grid.list-view .herbal-card .herbal-usage {
    margin-top: 0;
}

/* 药材卡片 */
.herbal-card {
    background: var(--white-color);
    border-radius: 1.25rem;
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid rgba(43, 122, 75, 0.08);
}

.herbal-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(43, 122, 75, 0.2);
}

.herbal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.herbal-card:hover::before {
    opacity: 1;
}

.herbal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.herbal-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.herbal-name::before {
    content: '🌿';
    font-size: 1rem;
    opacity: 0.7;
}

.herbal-category {
    font-size: 0.7rem;
    padding: 0.2rem 0.7rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, rgba(43, 122, 75, 0.1), rgba(232, 184, 107, 0.1));
    color: var(--primary-color);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.herbal-efficacy {
    margin: 0.6rem 0;
    line-height: 1.5;
    flex-grow: 1;
}

.efficacy-label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.3rem;
}

.efficacy-text {
    color: var(--light-color);
    font-size: 0.9rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary-color);
    line-height: 1.5;
}

.herbal-usage {
    font-size: 0.8rem;
    color: var(--light-color);
    background: var(--gray-bg);
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
}

.usage-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-right: 0.3rem;
}

/* 页脚 */
.site-footer {
    background: linear-gradient(135deg, #1A3A2A 0%, #2C3E2F 100%);
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-title {
    color: var(--white-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-text {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-link {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    font-size: 1.2rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-link:hover {
    color: var(--white-color);
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.85rem;
}

.footer-link:hover {
    color: var(--secondary-color);
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 2.8rem;
    height: 2.8rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border: none;
    z-index: 100;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-color);
    transform: translateY(-3px) scale(1.05);
}

/* 提示消息 */
.toast-message {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 3rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideUp 0.3s ease;
    white-space: nowrap;
    max-width: 90vw;
    white-space: normal;
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--light-color);
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 4rem;
    color: var(--light-color);
    background: var(--white-color);
    border-radius: 1.5rem;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
    display: block;
}

/* 响应式设计 */
@media (min-width: 640px) {
    .herbal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .herbal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    .desktop-nav {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .herbal-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .banner-stats {
        gap: 1rem;
    }
    
    .stat-divider {
        display: none;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        margin-top: -2rem;
        gap: 1rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .alphabet-index {
        gap: 0.3rem;
    }
    
    .alpha-link {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.75rem;
    }
    
    .herbal-grid.list-view .herbal-card {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .toast-message {
        white-space: normal;
        max-width: 85vw;
        font-size: 0.8rem;
        padding: 0.6rem 1.2rem;
    }
}