/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Chinese Traditional Colors */
    --primary-color: #2c5530;
    /* Deep Green - Nature & Cultivation */
    --secondary-color: #d4a574;
    /* Golden Brown - Earth & Harvest */
    --accent-color: #c41e3a;
    /* Vermillion Red - Chinese Traditional */
    --bg-light: #f8f6f0;
    /* Warm Ivory */
    --bg-gradient: linear-gradient(135deg, #f8f6f0 0%, #e8e2d5 100%);
    --text-dark: #2c3e50;
    --text-light: #5d6d7e;
    --text-white: #ffffff;
    --border-color: #d5dbdb;
    --shadow-light: 0 2px 10px rgba(44, 85, 48, 0.1);
    --shadow-heavy: 0 10px 30px rgba(44, 85, 48, 0.2);

    /* Typography */
    --font-primary: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Helvetica Neue', Arial, sans-serif;
    --font-accent: 'STKaiti', 'KaiTi', serif;

    /* Spacing */
    --container-max-width: 1200px;
    --section-padding: 4rem 0;
    --border-radius: 12px;

    /* Animations */
    --transition-fast: 0.3s ease;
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    overflow-x: hidden;
}

/* Utility Classes */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-smooth);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #3e7b3e);
    color: var(--text-white);
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-download {
    background: linear-gradient(135deg, var(--accent-color), #e74c3c);
    color: var(--text-white);
    padding: 1.25rem 3rem;
    font-size: 1.125rem;
    flex-direction: column;
    gap: 0.25rem;
}

.btn-download small {
    font-size: 0.875rem;
    opacity: 0.9;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(248, 246, 240, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.logo {
    width: 40px;
    height: 40px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: all var(--transition-fast);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--bg-gradient);
    position: relative;
    padding-top: 70px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="%23d4a574" opacity="0.1"/><circle cx="80" cy="40" r="0.5" fill="%232c5530" opacity="0.1"/><circle cx="40" cy="70" r="1.5" fill="%23c41e3a" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
    z-index: 0;
}

.hero-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: slideInLeft 1s ease;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    font-family: var(--font-accent);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.hero-info {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.hero-info span {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}



.hero-image {
    position: relative;
    animation: slideInRight 1s ease;
}

.hero-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    transition: transform var(--transition-smooth);
}

.hero-img:hover {
    transform: scale(1.02);
}

/* Features Section */
.features {
    padding: var(--section-padding);
    background: var(--text-white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(44, 85, 48, 0.05), transparent);
    transition: left var(--transition-smooth);
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Gallery Section */
.gallery {
    padding: var(--section-padding);
    background: var(--bg-gradient);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-smooth);
    background: #f0f0f0;
    /* 添加背景色以便调试 */
    min-height: 200px;
    /* 确保有最小高度 */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
    display: block;
    /* 确保图片显示 */
    opacity: 1;
    /* 确保图片不透明 */
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--text-white);
    padding: 2rem;
    transform: translateY(100%);
    transition: transform var(--transition-smooth);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover {
    box-shadow: var(--shadow-heavy);
}

.gallery-overlay h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* System Requirements */
.system {
    padding: var(--section-padding);
    background: var(--text-white);
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.system-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
}

.system-card.recommended {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(44, 85, 48, 0.05), rgba(196, 30, 58, 0.05));
}

.system-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.system-card ul {
    list-style: none;
}

.system-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.system-card li:last-child {
    border-bottom: none;
}

.system-card strong {
    color: var(--primary-color);
    min-width: 120px;
    display: inline-block;
}

/* Download Section */
.download {
    padding: var(--section-padding);
    background: linear-gradient(135deg, var(--primary-color), #3e7b3e);
    color: var(--text-white);
    text-align: center;
}

.download-content {
    max-width: 800px;
    margin: 0 auto;
}

.download .section-title {
    color: var(--text-white);
}

.download .section-title::after {
    background: var(--secondary-color);
}

.download-description {
    font-size: 1.125rem;
    margin-bottom: 3rem;
    line-height: 1.7;
    opacity: 0.9;
}

.download-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--text-white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-info p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
    line-height: 1.6;
}

.footer-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-links h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    color: var(--text-white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
    display: block;
    padding: 0.25rem 0;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--secondary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-tags {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-tags span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* 图片懒加载和错误处理样式 */
.gallery-item img[loading="lazy"] {
    opacity: 1 !important;
    /* 强制显示懒加载图片 */
}

.gallery-item img {
    background: #e0e0e0 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="50%" y="50%" text-anchor="middle" fill="%23999" font-family="sans-serif" font-size="16">图片加载中...</text></svg>') center/contain no-repeat;
}

.gallery-item img.loaded {
    background: none;
}

/* 图片加载错误处理 */
.gallery-item img[src]:invalid,
.gallery-item img:not([src]),
.gallery-item img[src=""] {
    background: #f0f0f0 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23f0f0f0"/><text x="50%" y="50%" text-anchor="middle" fill="%23999" font-family="sans-serif" font-size="16">图片无法加载</text></svg>') center/contain no-repeat;
}

/* 调试样式 */
.gallery-item img.debug-failed {
    background: #ffebee url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23ffebee"/><text x="50%" y="40%" text-anchor="middle" fill="%23c62828" font-family="sans-serif" font-size="16">图片加载失败</text><text x="50%" y="60%" text-anchor="middle" fill="%23666" font-family="sans-serif" font-size="12">请检查文件路径</text></svg>') center/contain no-repeat !important;
    border: 2px dashed #f44336;
}

.gallery-item img.debug-loaded {
    border: 2px solid #4caf50;
}

/* Hero图片调试样式 */
.hero-img.debug-failed {
    background: #ffebee url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 200"><rect width="400" height="200" fill="%23ffebee"/><text x="50%" y="50%" text-anchor="middle" fill="%23c62828" font-family="sans-serif" font-size="20">主图片加载失败</text></svg>') center/contain no-repeat !important;
    border: 3px dashed #f44336;
    min-height: 300px;
}

.hero-img.debug-loaded {
    border: 3px solid #4caf50;
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --section-padding: 3rem 0;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-light);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        transition: left var(--transition-smooth);
        box-shadow: var(--shadow-heavy);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .section-title {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .system-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .download-features {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .btn-download {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .system-card {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {

    .header,
    .nav-toggle,
    .download,
    .footer {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .btn {
        display: none;
    }

    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000;
        --secondary-color: #333;
        --accent-color: #000;
        --text-dark: #000;
        --text-light: #333;
        --border-color: #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1a1a1a;
        --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        --text-dark: #ffffff;
        --text-light: #cccccc;
        --border-color: #444444;
    }

    .header {
        background: rgba(26, 26, 26, 0.95);
    }

    .features {
        background: #222222;
    }

    .system {
        background: #222222;
    }
}