/*
Theme Name: FODMAP饮食入门指南
Theme URI: https://example.com/fodmap-guide
Description: 一个专注于FODMAP饮食入门知识的WordPress主题，适合肠易激综合征患者和健康饮食爱好者
Version: 1.0.0
Author: Your Name
Author URI: https://example.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fodmap-guide
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* 颜色变量 */
:root {
    --primary-color: #4a9a9a;
    --secondary-color: #8ed47c;
    --text-color: #333;
    --light-bg: #f8fafb;
    --dark-bg: #2d3748;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero区域 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 100px 20px 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    background: #fff;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

/* 食物图标动画 */
.food-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.icon-item {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

.icon-item:nth-child(1) { animation-delay: 0s; }
.icon-item:nth-child(2) { animation-delay: 0.5s; }
.icon-item:nth-child(3) { animation-delay: 1s; }
.icon-item:nth-child(4) { animation-delay: 1.5s; }
.icon-item:nth-child(5) { animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 通用区块 */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-desc {
    font-size: 1.1rem;
    color: #666;
}

/* 信息卡片网格 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.info-card {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.info-card h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.info-card p {
    color: #666;
    line-height: 1.7;
}

/* FODMAP类型 */
.fodmap-types {
    background: rgba(74, 154, 154, 0.05);
    padding: 40px;
    border-radius: 20px;
}

.fodmap-types h3 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.type-card {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.type-badge {
    display: inline-flex;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 15px;
}

.type-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.type-card p {
    color: #666;
    font-size: 0.95rem;
}

/* 背景浅色 */
.bg-light {
    background: var(--light-bg);
}

/* 标签页 */
.tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.tab-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    background: rgba(74, 154, 154, 0.1);
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active,
.tab-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.tab-content {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 食物分类 */
.category-section {
    margin-bottom: 35px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-section h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.food-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.food-items span {
    padding: 10px 20px;
    background: rgba(74, 154, 154, 0.1);
    border-radius: 25px;
    color: var(--primary-color);
    font-size: 0.95rem;
    transition: all 0.3s;
}

.food-items span:hover {
    background: rgba(74, 154, 154, 0.2);
}

/* 步骤卡片 */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.step-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.step-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-content h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.step-content p {
    color: #666;
    font-size: 0.95rem;
}

/* 小贴士 */
.tips-section {
    background: rgba(74, 154, 154, 0.05);
    padding: 40px;
    border-radius: 20px;
}

.tips-section h3 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 15px 20px;
    border-radius: 12px;
}

.tip-icon {
    font-size: 1.5rem;
}

.tip-item p {
    color: #666;
    font-size: 0.95rem;
}

/* FAQ */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 15px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: #fff;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    transition: background 0.3s;
}

.faq-question:hover {
    background: rgba(74, 154, 154, 0.05);
}

.faq-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    background: rgba(74, 154, 154, 0.03);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
}

.faq-item.active .faq-answer {
    padding: 20px;
    max-height: 200px;
}

.faq-answer p {
    color: #666;
    line-height: 1.7;
}

/* CTA区域 */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 80px 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 15px;
}

.cta-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: #fff;
    color: var(--primary-color);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background: #fff;
    color: var(--primary-color);
}

/* 页脚 */
.site-footer {
    background: var(--dark-bg);
    color: #fff;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.footer-section p {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding-top: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* WordPress核心样式 */
.alignleft {
    display: inline;
    float: left;
    margin-right: 1.5em;
}

.alignright {
    display: inline;
    float: right;
    margin-left: 1.5em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.8rem;
    }

    .content-grid,
    .steps-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .tab-content {
        padding: 25px;
    }

    .step-card {
        flex-direction: column;
    }

    .food-items {
        justify-content: center;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.8rem;
    }

    .icon-item {
        font-size: 3rem;
    }

    .section {
        padding: 60px 0;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .info-card,
    .type-card,
    .step-card {
        padding: 20px;
    }
}