/*
 * 茶叶百科首页专用样式
 * 适用于 baike/index.html 页面
 * 包含分类折叠、统计卡片、茶叶网格等模块
 */

/* intro-section 区域样式 */
.intro-section {
    background: linear-gradient(135deg, var(--primary-green), var(--light-green));
    color: white;
    padding: 20px 20px;
    border-radius: 15px;
    margin: 1px 0 20px;
    box-shadow: 0 4px 15px rgba(45, 90, 45, 0.2);
}

.intro-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

.intro-section > p {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto 30px;
    text-align: center;
}

/* 统计栏样式 */
.stats-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.stat-link {
    text-decoration: none;
    color: inherit;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 100px;
}

.stat-link:hover .stat-item {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

/* 分类区块样式 */
.category-section {
    margin-bottom: 30px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.category-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 默认折叠状态 */
.category-section:not(.expanded) .tea-grid {
    display: none;
}

.category-section.expanded .tea-grid {
    display: grid;
}

/* 整个区块都可以点击展开 */
.category-section {
    cursor: pointer;
}

/* 标题区域单独设置指针样式 */
.category-title {
    cursor: pointer;
}

/* 分类标题样式 */
.category-title {
    background: linear-gradient(135deg, var(--pale-green), var(--cream));
    padding: 18px 25px;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    user-select: none;
}

.category-title:hover {
    background: linear-gradient(135deg, var(--accent-green), var(--pale-green));
    color: white;
}

.category-title .tea-icon {
    font-size: 24px;
    margin-right: 12px;
}

.category-meta {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.5);
    padding: 5px 12px;
    border-radius: 15px;
    margin-left: auto;
    transition: all 0.3s ease;
}

.category-title:hover .category-meta {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 展开/折叠指示器 */
.category-title::after {
    content: '+';
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-green);
    margin-left: 15px;
    transition: transform 0.3s ease;
}

.category-section.expanded .category-title::after {
    content: '−';
    transform: rotate(180deg);
}

.category-title:hover::after {
    color: white;
}

/* 茶简介区域 */
.tea-intro {
    padding: 20px 25px;
    background: rgba(245, 247, 245, 0.5);
    border-bottom: 1px dashed var(--border);
}

.tea-intro p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.tea-intro a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px dotted transparent;
}

.tea-intro a:hover {
    color: var(--light-green);
    border-bottom-color: var(--light-green);
}

/* 茶叶网格布局 */
.tea-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 25px;
    background: white;
}

.tea-item {
    background: linear-gradient(135deg, #fafafa, #f5f7f5);
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.tea-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--accent-green));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tea-item:hover::before {
    transform: scaleX(1);
}

.tea-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(45, 90, 45, 0.15);
    border-color: var(--pale-green);
}

.tea-item a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    transition: color 0.2s ease;
}

.tea-item:hover a {
    color: var(--primary-green);
}

/* 响应式设计 - 移动端 */
@media (max-width: 768px) {
    .tea-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }

    .tea-item {
        padding: 10px 6px;
    }

    .tea-item a {
        font-size: 13px;
    }

    .stats-bar {
        gap: 10px;
    }

    .stat-item {
        padding: 12px 18px;
        min-width: 80px;
    }

    .stat-number {
        font-size: 22px;
    }

    .stat-label {
        font-size: 12px;
    }

    .category-title {
        padding: 15px 18px;
    }

    .category-title .tea-icon {
        font-size: 20px;
    }

    .tea-intro {
        padding: 15px 18px;
    }

    .intro-section {
        padding: 15px 15px;
        margin: 5px 0 15px;
    }

    .intro-section h1 {
        font-size: 22px;
    }

    .intro-section > p {
        font-size: 15px;
    }
}

/* 平板端自适应 */
@media (min-width: 769px) and (max-width: 1024px) {
    .tea-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
