/* ========================================
   星露谷物语攻略站 - 样式表
   主题色：农场绿 + 温暖大地色
   ======================================== */

/* --- CSS 变量 --- */
:root {
    --green-primary: #4a7c3f;
    --green-light: #6ab04c;
    --green-dark: #2d5a27;
    --brown-earth: #8b6914;
    --brown-light: #c9a961;
    --cream: #f9f7f0;
    --cream-dark: #f0ece0;
    --text-dark: #2c2c2c;
    --text-light: #666;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-sm: 10px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-dark);
    background: var(--cream);
    line-height: 1.8;
}

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

a:hover {
    color: var(--green-light);
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

/* --- 导航栏 --- */
.navbar {
    background: var(--green-dark);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white) !important;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.3rem;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: var(--white);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Hero 区域 --- */
.hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-primary) 50%, var(--green-light) 100%);
    color: white;
    padding: 4rem 0 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: heroFloat 20s linear infinite;
}

@keyframes heroFloat {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.92;
    max-width: 650px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--white);
    color: var(--green-dark) !important;
}

.btn-primary:hover {
    background: var(--cream);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: var(--white) !important;
    border: 2px solid rgba(255,255,255,0.4);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 80px;
}

/* --- 区块通用 --- */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--green-dark);
}

.section-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* --- 卡片网格 --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    color: inherit;
}

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

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-tag {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-green { border-top: 4px solid var(--green-primary); }
.card-green .card-tag { background: #e8f5e9; color: var(--green-dark); }

.card-yellow { border-top: 4px solid #f9a825; }
.card-yellow .card-tag { background: #fff8e1; color: #f57f17; }

.card-blue { border-top: 4px solid #1976d2; }
.card-blue .card-tag { background: #e3f2fd; color: #1565c0; }

.card-purple { border-top: 4px solid #7b1fa2; }
.card-purple .card-tag { background: #f3e5f5; color: #6a1b9a; }

.card-pink { border-top: 4px solid #e91e63; }
.card-pink .card-tag { background: #fce4ec; color: #c2185b; }

.card-orange { border-top: 4px solid #ef6c00; }
.card-orange .card-tag { background: #fff3e0; color: #e65100; }

/* --- 文章列表 --- */
.articles-section {
    background: var(--cream-dark);
}

.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.article-meta {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.article-category {
    background: #e8f5e9;
    color: var(--green-dark);
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-weight: 600;
}

.article-date {
    color: var(--text-light);
}

.article-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.article-card h3 a {
    color: var(--text-dark);
}

.article-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.read-more {
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- 工具推荐 --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--green-dark);
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* --- FAQ --- */
.faq-section {
    background: var(--cream-dark);
}

.faq-list {
    max-width: 750px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-item summary {
    padding: 1.2rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    color: var(--green-dark);
    transition: background 0.3s;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
    content: '▶ ';
    font-size: 0.8rem;
    margin-right: 0.5rem;
    transition: transform 0.3s;
}

.faq-item[open] summary::before {
    transform: rotate(90deg);
    display: inline-block;
}

.faq-item summary:hover {
    background: var(--cream);
}

.faq-item p {
    padding: 0 1.5rem 1.2rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* --- 页脚 --- */
.footer {
    background: var(--green-dark);
    color: rgba(255,255,255,0.85);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h3 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.footer h4 {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.footer p {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.8;
}

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

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ========================================
   文章页通用样式
   ======================================== */
.article-hero {
    background: linear-gradient(135deg, var(--green-dark), var(--green-primary));
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.article-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.article-hero .article-meta {
    justify-content: center;
    display: flex;
    gap: 1rem;
    opacity: 0.85;
    font-size: 0.9rem;
}

.article-body {
    max-width: 750px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    font-size: 1.05rem;
    line-height: 2;
}

.article-body h2 {
    color: var(--green-dark);
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--green-light);
}

.article-body h3 {
    color: var(--green-primary);
    font-size: 1.2rem;
    margin: 2rem 0 0.8rem;
}

.article-body p {
    margin-bottom: 1.2rem;
}

.article-body ul,
.article-body ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.article-body th,
.article-body td {
    border: 1px solid #ddd;
    padding: 0.7rem 1rem;
    text-align: left;
}

.article-body th {
    background: var(--green-primary);
    color: white;
}

.article-body tr:nth-child(even) {
    background: var(--cream);
}

.tip-box {
    background: #e8f5e9;
    border-left: 4px solid var(--green-primary);
    padding: 1rem 1.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1.5rem 0;
}

.tip-box strong {
    color: var(--green-dark);
}

.warning-box {
    background: #fff8e1;
    border-left: 4px solid #f9a825;
    padding: 1rem 1.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1.5rem 0;
}

/* --- 分页 --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--white);
    box-shadow: var(--shadow);
    font-weight: 500;
}

.pagination .current {
    background: var(--green-primary);
    color: white;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--green-dark);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

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

    .section-title {
        font-size: 1.5rem;
    }

    .card-grid,
    .article-list,
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .article-hero h1 {
        font-size: 1.5rem;
    }

    .article-body {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}
