/* css/style.css - 终极完整版 */

/* --- 1. 基础变量与重置 --- */
:root {
    --bg-color: #ffffff;
    --text-main: #1d1d1f;
    --text-light: #86868b;
    --accent: #f96c00; /* 芒果品牌色 */
    --nav-height: 60px;
    --max-width: 1100px; /* 加宽一点以容纳地图 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- 2. 导航栏 (响应式) --- */
header {
    position: fixed; top: 0; width: 100%; height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    z-index: 999; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-container {
    max-width: var(--max-width); margin: 0 auto; height: 100%;
    display: flex; justify-content: space-between; align-items: center; padding: 0 20px;
}
.logo {
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
    text-transform: lowercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    background: linear-gradient(90deg, #ffd37a 0%, #f96c00 40%, #f9b233 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; gap: 30px; }
.nav-links a { text-decoration: none; color: var(--text-light); font-size: 14px; font-weight: 500; transition: color 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* 手机端汉堡按钮 */
.menu-toggle { display: none; flex-direction: column; justify-content: space-between; width: 24px; height: 18px; cursor: pointer; background: none; border: none; }
.menu-toggle span { display: block; width: 100%; height: 2px; background: var(--text-main); border-radius: 2px; transition: 0.3s; }

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .nav-links {
        position: absolute; top: var(--nav-height); left: 0; width: 100%;
        background: white; flex-direction: column; padding: 20px; gap: 0;
        opacity: 0; transform: translateY(-20px); pointer-events: none; transition: 0.3s;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    }
    .nav-links.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .nav-links a { display: block; padding: 15px 0; border-bottom: 1px solid #f5f5f7; font-size: 16px; }
}

/* --- 3. 通用布局 --- */
.main-content { margin-top: var(--nav-height); min-height: 80vh; }
.page-header { background-color: #f5f5f7; padding: 80px 20px; text-align: center; margin-bottom: 40px; }
.page-header h1 { font-size: 2.5rem; margin-bottom: 10px; }
footer { background: #f5f5f7; padding: 40px 0; margin-top: 80px; font-size: 12px; color: var(--text-light); text-align: center; }

/* --- 4. 首页 Hero (大图) --- */
.hero {
    height: 100vh; width: 100%; background-image: url('../images/hero.jpg');
    background-size: cover; background-position: center; background-attachment: fixed;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; position: relative;
}
.hero::before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); }
.hero-content { position: relative; z-index: 1; color: white; max-width: 800px; padding: 20px; }
.hero h1 { font-size: 4rem; font-weight: 700; line-height: 1.1; margin-bottom: 20px; }
.hero p { font-size: 1.5rem; opacity: 0.9; margin-bottom: 30px; }
.btn { display: inline-block; padding: 15px 40px; background: var(--accent); color: white; text-decoration: none; border-radius: 30px; font-weight: 500; transition: transform 0.2s; }
.btn:hover { transform: scale(1.05); }

/* --- 5. 特性卡片 (Grid) --- */
.features { padding: 80px 20px; background: #fff; }
.section-title { font-size: 2.5rem; font-weight: 600; text-align: center; margin-bottom: 60px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; max-width: 1200px; margin: 0 auto; }
.feature-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: transform 0.3s; }
.feature-card:hover { transform: translateY(-10px); }
.feature-card img { width: 100%; height: 250px; object-fit: cover; }
.feature-info { padding: 30px; text-align: left; }
.feature-info h3 { font-size: 1.5rem; margin-bottom: 10px; }

/* --- 6. 关于我们板块 --- */
.about-section {
    padding: 40px 20px 80px;
    background: #fff;
}
.main-content .about-section {
    background: #fff;
}
.about-container {
    max-width: 1200px;
    margin: 0 auto;
}
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.about-image {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}
.about-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
.about-text {
    padding: 20px;
}
.about-text .section-title {
    text-align: left;
    margin-bottom: 30px;
    font-size: 2.5rem;
}
.about-intro {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 30px;
    line-height: 1.8;
    font-weight: 500;
}
.about-details {
    color: var(--text-light);
    line-height: 1.8;
}
.about-details p {
    margin-bottom: 20px;
    font-size: 16px;
}
.about-details p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-text .section-title {
        text-align: center;
        font-size: 2rem;
    }
    .about-intro {
        font-size: 1.1rem;
    }
}

/* --- 7. 👥 社会责任板块 (Our Community & Growers) --- */
.community-section {
    padding: 100px 20px;
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8d6 100%);
    position: relative;
}

.community-container {
    max-width: 1200px;
    margin: 0 auto;
}

.community-section .section-title {
    text-align: center;
    margin-bottom: 80px;
    color: var(--text-main);
}

.community-story {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 80px;
}

.story-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.story-subtitle {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 50px;
    font-weight: 400;
}

.story-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.story-text {
    font-size: 1.25rem;
    line-height: 1.9;
    color: var(--text-main);
    font-weight: 400;
    letter-spacing: 0.2px;
}

.story-quote {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--accent);
    font-weight: 500;
    margin-top: 20px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    border-left: 4px solid var(--accent);
}

/* 照片墙 Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    aspect-ratio: 1;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(249, 108, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    text-align: center;
    padding: 20px;
}

.photo-overlay h4 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-overlay p {
    font-size: 1rem;
    opacity: 0.95;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.photo-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.photo-item:hover img {
    transform: scale(1.1);
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-item:hover .photo-overlay h4,
.photo-item:hover .photo-overlay p {
    transform: translateY(0);
}

/* 手机端适配 */
@media (max-width: 768px) {
    .community-section {
        padding: 60px 20px;
    }

    .community-section .section-title {
        margin-bottom: 50px;
        font-size: 2rem;
    }

    .story-title {
        font-size: 2rem;
    }

    .story-subtitle {
        font-size: 1.2rem;
        margin-bottom: 30px;
    }

    .story-text {
        font-size: 1.1rem;
        line-height: 1.8;
    }

    .story-quote {
        font-size: 1.2rem;
        padding: 20px;
    }

    .photo-grid {
        display: flex;
        gap: 20px;
        margin-top: 40px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
    }

    .photo-item {
        flex: 0 0 200px;
        scroll-snap-align: start;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        gap: 15px;
    }

    .photo-item {
        flex: 0 0 180px;
    }
}

/* --- 8. 🌍 世界地图板块 (完美复刻) --- */
.map-section { max-width: 1100px; margin: 80px auto; padding: 0 20px; text-align: center; }
.map-container { position: relative; display: inline-block; width: 100%; max-width: 900px; margin-top: 40px; }
.map-img { width: 100%; opacity: 0.6; filter: grayscale(100%); display: block; }

/* 攀枝花原点 (呼吸动画) */
.origin-dot {
    position: absolute; width: 14px; height: 14px;
    background: var(--accent); border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.3); z-index: 2;
}
.pulse { animation: pulse-animation 2s infinite; }
@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(255, 102, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 102, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 102, 0, 0); }
}

/* 客户分布点 */
.client-dot {
    position: absolute; width: 8px; height: 8px;
    background: #333; border-radius: 50%; cursor: pointer; z-index: 1; transition: all 0.3s;
}
.client-dot:hover { transform: scale(1.5); background: var(--accent); }
.client-dot::after {
    content: attr(data-city); position: absolute; bottom: 15px; left: 50%;
    transform: translateX(-50%) scale(0); background: #000; color: #fff;
    padding: 4px 8px; font-size: 12px; border-radius: 4px; white-space: nowrap;
    opacity: 0; transition: all 0.2s; pointer-events: none;
}
.client-dot:hover::after { transform: translateX(-50%) scale(1); opacity: 1; }

/* 底部数据条 */
.stats-row { display: flex; justify-content: space-around; margin-top: 50px; padding-top: 30px; border-top: 1px solid #eee; }
.stat-item h3 { font-size: 36px; color: var(--accent); margin: 0; }
.stat-item p { color: #86868b; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }

/* --- 9. 📅 供货日历 (Products页专用) --- */
.season-section { max-width: 900px; margin: 60px auto; padding: 0 20px; text-align: center; }
.calendar-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.month-box {
    flex: 1; min-width: 60px; border: 1px solid #d2d2d7; border-radius: 8px;
    padding: 15px 5px; background: #fbfbfd; position: relative; transition: 0.3s;
}
.month-name { font-size: 14px; font-weight: 600; display: block; margin-bottom: 5px; }
.status-dot { height: 10px; width: 10px; background: #e5e5ea; border-radius: 50%; display: inline-block; }

/* 激活状态 (有货) */
.month-box.active { background: white; border-color: var(--accent); box-shadow: 0 4px 12px rgba(255, 102, 0, 0.15); transform: translateY(-5px); }
.month-box.active .month-name { color: var(--accent); }
.month-box.active .status-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2); }

/* --- 10. 📊 规格表与营养表 --- */
.specs-container { max-width: 900px; margin: 60px auto; padding: 0 20px; }
.specs-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.specs-table th, .specs-table td { padding: 15px; border-bottom: 1px solid #eee; text-align: left; }
.specs-table th { width: 30%; color: var(--text-light); }
.specs-table td { font-weight: 600; }

.nutrition-wrapper { display: flex; flex-wrap: wrap; gap: 50px; max-width: 900px; margin: 80px auto; padding: 0 20px; align-items: flex-start; }
.nutrition-text { flex: 1; min-width: 300px; }
.nutrition-label { width: 280px; border: 2px solid #333; padding: 10px; font-family: Arial, sans-serif; background: #fff; box-shadow: 10px 10px 0 rgba(0,0,0,0.05); }
.nut-header { border-bottom: 10px solid #333; margin-bottom: 10px; padding-bottom: 5px; }
.nut-title { font-size: 28px; font-weight: 900; margin: 0; line-height: 1; }
.nut-row { display: flex; justify-content: space-between; border-bottom: 1px solid #ddd; padding: 5px 0; font-size: 14px; }
.nut-row.thick { border-bottom: 4px solid #333; font-weight: bold; }
.nut-row.indent { padding-left: 20px; }

/* 包装方式两栏 */
.packaging-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 900px; margin: 40px auto; }
.pack-box { background: #fbfbfd; padding: 30px; border-radius: 12px; border: 1px solid #d2d2d7; }

/* --- 11. 联系表单 --- */
.contact-container { max-width: 600px; margin: 80px auto; padding: 40px; background: white; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.05); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group textarea { width: 100%; padding: 15px; border: 1px solid #d2d2d7; border-radius: 12px; font-size: 16px; background: #fbfbfd; }
.submit-btn { width: 100%; padding: 15px; background: var(--accent); color: white; border: none; border-radius: 12px; font-size: 18px; cursor: pointer; }

/* --- 12. 手机端适配修补 --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .stats-row { flex-direction: column; gap: 30px; }
    .month-box { min-width: 45%; margin-bottom: 10px; } /* 日历一行变两个 */
    .packaging-grid { grid-template-columns: 1fr; }
    .nutrition-wrapper { flex-direction: column; }
}
/* --- ✨ 新增：交互组件样式 (Phase 4) --- */

/* Tab 按钮容器 */
.tab-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* 按钮样式 */
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

/* 选中状态的按钮 */
.tab-btn.active {
    background-color: var(--text-main);
    color: white;
}

/* 内容区域控制 */
.tab-content {
    display: none; /* 默认隐藏 */
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block; /* 激活时显示 */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 计算器样式 */
.calculator-box {
    background: #fbfbfd;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #d2d2d7;
    text-align: center;
}

.calc-results {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.calc-results p {
    font-size: 18px;
    margin: 5px 0;
    color: var(--text-main);
}

.calc-results strong {
    color: var(--accent);
    font-size: 24px;
}