/* 
 * Gangwan Zhunong - Main Stylesheet
 * 港湾助农平台主样式表
 * 颜色方案：生态深绿 #1b4332 + 原蜜金 #c99738 + 宣纸白 #faf9f6
 */

/* ============================================
   基础重置与变量
   ============================================ */
:root {
    --color-primary: #1b4332;
    --color-secondary: #c99738;
    --color-background: #faf9f6;
    --color-text: #222222;
    --color-muted: #666666;
    --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-system);
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.7;
    margin: 0;
    padding: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

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

/* ============================================
   按钮样式
   ============================================ */
.gw-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.gw-btn-primary {
    background: var(--color-secondary);
    color: var(--color-primary);
}

.gw-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 151, 56, 0.4);
}

.gw-btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.gw-btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-background);
}

/* ============================================
   产品卡片
   ============================================ */
.gw-product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gw-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ============================================
   农户卡片
   ============================================ */
.gw-farmer-card {
    transition: box-shadow 0.3s ease;
}

.gw-farmer-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ============================================
   CTA 按钮（淘宝直达）
   ============================================ */
.gw-cta-button {
    display: block;
    background: var(--color-secondary);
    color: var(--color-primary);
    padding: 18px 40px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(201, 151, 56, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gw-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(201, 151, 56, 0.5);
}

/* ============================================
   导航菜单
   ============================================ */
.gw-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.gw-menu li a {
    color: #faf9f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.gw-menu li a:hover {
    color: #c99738;
}

/* ============================================
   响应式布局
   ============================================ */
@media (max-width: 768px) {
    .gw-product-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .gw-hero {
        padding: 40px 15px !important;
    }
    
    .gw-hero h1 {
        font-size: 2rem !important;
    }
    
    .gw-menu {
        flex-direction: column;
        gap: 15px;
    }
    
    .gw-footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    .gw-single-product .gw-product-grid {
        grid-template-columns: 1fr !important;
    }
    
    .gw-header-contact {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .gw-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .gw-cta-button {
        padding: 15px 25px;
        font-size: 1rem;
    }
}

/* ============================================
   辅助类
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }

/* ============================================
   深色模式支持
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #2d6a4f;
        --color-secondary: #d4a853;
        --color-background: #121212;
        --color-text: #e0e0e0;
        --color-muted: #999999;
    }
    
    body {
        background: var(--color-background);
        color: var(--color-text);
    }
    
    .gw-header,
    .gw-footer,
    .gw-product-card,
    .gw-contact-panel,
    .gw-register-form,
    .gw-comment-form,
    .gw-page-content,
    .gw-search-item {
        background: #1e1e1e !important;
        color: var(--color-text) !important;
    }
    
    .gw-header a,
    .gw-footer a,
    .gw-product-card h2,
    .gw-product-card p,
    .gw-contact-panel h2,
    .gw-contact-panel h3 {
        color: var(--color-text) !important;
    }
    
    input,
    textarea,
    select {
        background: #2d2d2d !important;
        color: var(--color-text) !important;
        border-color: #444 !important;
    }
    
    .gw-hero {
        background: linear-gradient(135deg, #1e3a2f 0%, #0d2818 100%) !important;
    }
    
    .gw-hero h1,
    .gw-hero p {
        color: var(--color-text) !important;
    }
    
    .gw-breadcrumb,
    .gw-filter-bar {
        background: #1e1e1e !important;
    }
}

/* ============================================
   深色模式手动切换开关（可选）
   ============================================ */
#gw-dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 45px;
    height: 45px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

#gw-dark-mode-toggle:hover {
    transform: scale(1.1);
}

/* 深色模式激活状态 */
body.dark-mode {
    --color-primary: #2d6a4f;
    --color-secondary: #d4a853;
    --color-background: #121212;
    --color-text: #e0e0e0;
    --color-muted: #999999;
}

body.dark-mode {
    background: var(--color-background);
}

/* ============================================
   打印样式（优化打印输出）
   ============================================ */
@media print {
    .gw-header,
    .gw-footer,
    .gw-cta-button,
    .gw-copy-phone,
    .gw-quick-form,
    #gw-dark-mode-toggle {
        display: none !important;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    .gw-single-product {
        padding: 20px;
    }
    
    h1, h2, h3 {
        color: #000;
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .gw-product-info {
        page-break-inside: avoid;
    }
}

/* ============================================
   法律页面样式（免责声明 / 服务条款 / 隐私政策 / 退换货政策）
   ============================================ */
.gw-page-legal {
    background: var(--color-background);
}

.gw-legal-content {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}

.gw-legal-content h1 {
    font-size: 2.2rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.gw-legal-content h2 {
    font-size: 1.35rem;
    color: var(--color-primary);
    margin-top: 35px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
}

.gw-legal-content h2:first-of-type {
    margin-top: 25px;
}

.gw-legal-content p {
    color: #444;
    line-height: 1.9;
    margin-bottom: 15px;
    font-size: 1rem;
}

.gw-legal-content ul,
.gw-legal-content ol {
    color: #444;
    line-height: 2;
    padding-left: 25px;
    margin-bottom: 15px;
}

.gw-legal-content ul li,
.gw-legal-content ol li {
    margin-bottom: 8px;
}

.gw-legal-content strong {
    color: var(--color-primary);
}

.gw-legal-content a {
    color: #c99738;
    text-decoration: underline;
}

.gw-legal-content a:hover {
    color: var(--color-primary);
}

.gw-legal-footer {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px dashed #d4a853;
}

.gw-legal-footer p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* 法律页面移动端适配 */
@media (max-width: 768px) {
    .gw-legal-content {
        padding: 25px 20px;
    }
    
    .gw-legal-content h1 {
        font-size: 1.8rem;
    }
    
    .gw-legal-content h2 {
        font-size: 1.2rem;
    }
}
