/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
    background-color: #f7f6f2;
    color: #1a1a1a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}

/* ===== Dark Mode Styles ===== */
body[data-theme="dark"] {
    background-color: #121212;
    color: #e0e0e0;
}
body[data-theme="dark"] .hero-image {
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    border-color: rgba(255,255,255,0.08);
}
body[data-theme="dark"] .stats-bar,
body[data-theme="dark"] .product-stats,
body[data-theme="dark"] .global-section,
body[data-theme="dark"] .cta-section {
    background-color: #1a1a1a;
    border-color: rgba(255,255,255,0.08);
}
body[data-theme="dark"] .advantage-card,
body[data-theme="dark"] .product-card,
body[data-theme="dark"] .step-card,
body[data-theme="dark"] .platform-card {
    background-color: #1e1e1e;
}
body[data-theme="dark"] .advantage-card:hover,
body[data-theme="dark"] .product-card:hover,
body[data-theme="dark"] .step-card:hover,
body[data-theme="dark"] .platform-card:hover {
    background-color: #252525;
}
body[data-theme="dark"] .section-desc, 
body[data-theme="dark"] .hero-desc, 
body[data-theme="dark"] .stat-label,
body[data-theme="dark"] .advantage-desc,
body[data-theme="dark"] .product-desc {
    color: #aaa;
}

/* 深色模式補充：按鈕、列表、分隔線、浮動按鈕（淺色寫死的顏色都在這裡翻轉） */
body[data-theme="dark"] .btn-primary,
body[data-theme="dark"] .btn-primary:hover,
body[data-theme="dark"] .btn-primary svg,
body[data-theme="dark"] .btn-secondary { color: #e0e0e0; border-color: rgba(255,255,255,0.22); }
body[data-theme="dark"] .btn-secondary:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.06); }
body[data-theme="dark"] .btn-secondary svg { fill: #bbb; }
body[data-theme="dark"] .step-num { background: #f7f6f2; color: #1a1a1a; }
body[data-theme="dark"] .cta-title, body[data-theme="dark"] .section-title, body[data-theme="dark"] .hero-title { color: #f0f0f0; }
body[data-theme="dark"] .cta-desc, body[data-theme="dark"] .step-desc, body[data-theme="dark"] .platform-desc,
body[data-theme="dark"] .accordion-desc, body[data-theme="dark"] .global-feature-desc { color: #aaa; }
body[data-theme="dark"] .product-stat-label, body[data-theme="dark"] .hero-feature, body[data-theme="dark"] .section-label,
body[data-theme="dark"] .hero-label, body[data-theme="dark"] .product-link, body[data-theme="dark"] .globe-hint { color: #999; }
body[data-theme="dark"] .product-link:hover { color: #fff; }
body[data-theme="dark"] .country-item { color: #bbb; border-bottom-color: rgba(255,255,255,0.08); }
body[data-theme="dark"] .country-item:hover { background: rgba(255,255,255,0.04); }
body[data-theme="dark"] .country-sub { color: #888; }
body[data-theme="dark"] .country-grid,
body[data-theme="dark"] .accordion-item,
body[data-theme="dark"] .platform-section { border-color: rgba(255,255,255,0.1); }
body[data-theme="dark"] .global-feature-item { border-bottom-color: rgba(255,255,255,0.1); }
body[data-theme="dark"] .stat-item:not(:last-child)::after,
body[data-theme="dark"] .product-stat:not(:last-child)::after { background: rgba(255,255,255,0.1); }
body[data-theme="dark"] .product-stats { border-color: rgba(255,255,255,0.1); }
body[data-theme="dark"] .advantages-grid, body[data-theme="dark"] .products-grid,
body[data-theme="dark"] .steps-grid, body[data-theme="dark"] .platform-grid { background: rgba(255,255,255,0.06); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== Utility ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: #999; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px;
}
.section-label svg { width: 14px; height: 14px; fill: #999; }
.section-title { font-size: 42px; font-weight: 700; line-height: 1.3; margin-bottom: 16px; letter-spacing: -0.5px; }
.section-desc { font-size: 17px; color: #666; max-width: 680px; line-height: 1.8; margin-bottom: 48px; }

/* ===== Hero Section ===== */
.hero { padding-top: 68px; padding-bottom: 80px; min-height: 90vh; display: flex; align-items: center; }
.hero .container { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.scroll-indicator { text-align: center; margin-top: 40px; color: #bbb; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; grid-column: 1 / -1; }
.hero-label {
    display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #999; margin-bottom: 20px;
}
.hero-label::before { content: ''; width: 6px; height: 6px; background: #4a7c59; border-radius: 50%; }
.hero-title { font-size: 56px; font-weight: 700; line-height: 1.25; margin-bottom: 24px; letter-spacing: -1px; }
.hero-desc { font-size: 18px; color: #666; line-height: 1.9; margin-bottom: 32px; max-width: 520px; }
.hero-features { display: flex; gap: 24px; margin-bottom: 40px; }
.hero-feature {
    display: flex; align-items: center; gap: 8px; font-size: 14px; color: #888;
}
.hero-feature svg { width: 16px; height: 16px; fill: #999; }
.hero-buttons { display: flex; gap: 16px; }
.btn-primary {
    background: #1a1a1a; color: #fff; font-size: 15px; padding: 14px 32px; border-radius: 10px;
    cursor: pointer; transition: all 0.2s; border: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 500;
}
.btn-primary:hover { background: #333; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.btn-primary svg { width: 18px; height: 18px; fill: #fff; }
.btn-secondary {
    background: transparent; color: #1a1a1a; font-size: 15px; padding: 14px 32px; border-radius: 10px;
    cursor: pointer; transition: all 0.2s; border: 1.5px solid #ddd; display: inline-flex; align-items: center; gap: 8px; font-weight: 500;
}
.btn-secondary:hover { border-color: #999; background: rgba(0,0,0,0.02); }
.btn-secondary svg { width: 18px; height: 18px; fill: #666; }

/* Hero Image Placeholder */
.hero-image {
    background: linear-gradient(135deg, #f0efe9 0%, #e8e6de 100%);
    border-radius: 16px; height: 480px; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,0.06); padding: 24px;
}
.hero-image picture { display: contents; }
.hero-vault-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Scroll indicator */
.scroll-indicator::before { content: ''; width: 40px; height: 1px; background: #ccc; }

/* ===== Stats Bar ===== */
.stats-bar { border-top: 1px solid rgba(0,0,0,0.08); border-bottom: 1px solid rgba(0,0,0,0.08); padding: 48px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.stat-item { text-align: center; padding: 20px; position: relative; }
.stat-item:not(:last-child)::after {
    content: ''; position: absolute; right: 0; top: 20%; height: 60%; width: 1px; background: rgba(0,0,0,0.08);
}
.stat-icon { margin-bottom: 12px; }
.stat-icon svg { width: 24px; height: 24px; fill: #999; }
.stat-number { font-size: 36px; font-weight: 700; margin-bottom: 4px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 14px; color: #999; }

/* ===== Why Choose QIN ZHEN ===== */
.why-section { padding: 100px 0; }
.advantages-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: rgba(0,0,0,0.06); border-radius: 12px; overflow: hidden; }
.advantage-card {
    background: #f7f6f2; padding: 40px 32px; position: relative; transition: background 0.3s;
}
.advantage-card:hover { background: #f0efe9; }
.advantage-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.advantage-icon svg { width: 24px; height: 24px; fill: #999; }
.advantage-num { font-size: 13px; color: #bbb; font-weight: 500; }
.advantage-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.advantage-desc { font-size: 14px; color: #777; line-height: 1.8; }

/* ===== Products Section ===== */
.products-section { padding: 100px 0; }
.product-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid rgba(0,0,0,0.08); border-bottom: 1px solid rgba(0,0,0,0.08); margin-bottom: 48px; }
.product-stat { padding: 32px; text-align: center; position: relative; }
.product-stat:not(:last-child)::after {
    content: ''; position: absolute; right: 0; top: 20%; height: 60%; width: 1px; background: rgba(0,0,0,0.08);
}
.product-stat-number { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.product-stat-label { font-size: 14px; color: #999; }

.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: rgba(0,0,0,0.06); border-radius: 12px; overflow: hidden; margin-bottom: 48px; }
.product-card {
    background: #f7f6f2; padding: 36px 32px; transition: background 0.3s; display: flex; flex-direction: column;
}
.product-card:hover { background: #f0efe9; }
.product-icon { margin-bottom: 16px; }
.product-icon svg { width: 28px; height: 28px; fill: #999; }
.product-name { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.product-desc { font-size: 14px; color: #777; line-height: 1.8; flex-grow: 1; margin-bottom: 20px; }
.product-link { font-size: 13px; color: #999; display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s; cursor: pointer; }
.product-link:hover { color: #1a1a1a; }
.product-link svg { width: 14px; height: 14px; fill: currentColor; }

/* ===== Steps Section ===== */
.steps-section { padding: 100px 0; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: rgba(0,0,0,0.06); border-radius: 12px; overflow: hidden; margin-bottom: 48px; position: relative; }
.step-card {
    background: #f7f6f2; padding: 48px 36px; position: relative; transition: background 0.3s;
}
.step-card:hover { background: #f0efe9; }
.step-num {
    width: 36px; height: 36px; background: #1a1a1a; color: #fff; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; margin-bottom: 24px;
}
.step-icon { margin-bottom: 16px; }
.step-icon svg { width: 28px; height: 28px; fill: #999; }
.step-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.step-desc { font-size: 14px; color: #777; line-height: 1.8; }
.step-arrow {
    position: absolute; right: -2px; top: 50%; transform: translateY(-50%); z-index: 2;
}
.step-arrow svg { width: 20px; height: 20px; fill: #ccc; }

/* ===== Global Section ===== */
.global-section { padding: 100px 0; background: #f0efe9; }
.global-content { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; margin-bottom: 60px; }
.global-features {}
.global-feature-item { padding: 24px 0; border-bottom: 1px solid rgba(0,0,0,0.08); display: flex; gap: 16px; align-items: flex-start; }
.global-feature-icon svg { width: 20px; height: 20px; fill: #999; flex-shrink: 0; margin-top: 3px; }
.global-feature-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.global-feature-desc { font-size: 14px; color: #888; }

/* Globe illustration */
.globe-container { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.globe-stage { position: relative; width: min(380px, 100%); }
.globe-canvas {
    display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 50%;
    cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent; outline: none;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}
.globe-canvas.grabbing { cursor: grabbing; }
.globe-canvas.over-marker { cursor: pointer; }
.globe-canvas:focus-visible { box-shadow: 0 0 0 3px rgba(74,124,89,0.5), 0 18px 40px rgba(0,0,0,0.12); }
.globe-tip {
    position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; white-space: nowrap;
    transform: translate(-50%, -100%); margin-top: -14px;
    background: #1a1a1a; color: #fff; font-size: 13px; line-height: 1.4; padding: 6px 12px; border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2); opacity: 0; transition: opacity 0.15s;
}
.globe-tip.show { opacity: 1; }
.globe-tip span { color: #bbb; margin-left: 2px; }
.globe-hint { font-size: 13px; color: #999; display: flex; align-items: center; justify-content: center; gap: 8px; }
.globe-hint svg { width: 16px; height: 16px; fill: #999; flex-shrink: 0; }
body[data-theme="dark"] .globe-canvas { box-shadow: 0 18px 40px rgba(0,0,0,0.45); }
body[data-theme="dark"] .globe-tip { background: #f7f6f2; color: #1a1a1a; }
body[data-theme="dark"] .globe-tip span { color: #666; }

/* Country list */
.country-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid rgba(0,0,0,0.08); }
.country-item { padding: 16px 24px; font-size: 15px; color: #555; border-bottom: 1px solid rgba(0,0,0,0.06); transition: background 0.2s; cursor: default; }
.country-item:hover { background: rgba(0,0,0,0.02); }
.country-sub { font-size: 13px; color: #aaa; margin-top: 2px; }

/* ===== Regulation Section (Accordion) ===== */
.regulation-section { padding: 100px 0; }
.accordion-item {
    border-top: 1px solid rgba(0,0,0,0.08); padding: 28px 0;
    cursor: pointer; transition: background 0.2s;
}
.accordion-header { display: flex; align-items: center; justify-content: space-between; }
.accordion-title-area { display: flex; align-items: center; gap: 14px; }
.accordion-icon svg { width: 20px; height: 20px; fill: #999; }
.accordion-title { font-size: 17px; font-weight: 600; }
.accordion-arrow {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease;
}
.accordion-arrow svg { width: 18px; height: 18px; fill: #999; }
.accordion-item.active .accordion-arrow { transform: rotate(180deg); }
.accordion-body {
    max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.3s ease;
}
.accordion-item.active .accordion-body { max-height: 200px; padding-top: 16px; }
.accordion-desc { font-size: 15px; color: #777; line-height: 1.9; max-width: 720px; }

/* ===== Platform Features ===== */
.platform-section { padding: 80px 0; border-top: 1px solid rgba(0,0,0,0.08); }
.platform-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: rgba(0,0,0,0.06); border-radius: 12px; overflow: hidden; }
.platform-card {
    background: #f7f6f2; padding: 36px 28px; transition: background 0.3s;
}
.platform-card:hover { background: #f0efe9; }
.platform-icon { margin-bottom: 14px; }
.platform-icon svg { width: 24px; height: 24px; fill: #999; }
.platform-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.platform-desc { font-size: 14px; color: #777; line-height: 1.8; }

/* ===== CTA Section ===== */
.cta-section {
    padding: 100px 0; background: #f0efe9;
    border-top: 1px solid rgba(0,0,0,0.08); border-bottom: 1px solid rgba(0,0,0,0.08);
}
.cta-title { font-size: 42px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.5px; }
.cta-desc { font-size: 17px; color: #666; margin-bottom: 36px; max-width: 560px; line-height: 1.8; }
.cta-buttons { display: flex; gap: 16px; }

/* ===== 區塊進場動畫（由腳本加上 .reveal，腳本失敗時內容仍可見） ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    html { font-size: 15px; }
    .section-title { font-size: 36px; }
    .hero-title { font-size: 48px; }
    .stats-grid, .advantages-grid, .products-grid, .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .platform-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    html { font-size: 15px; }

    /* Hero */
    .hero { padding-top: 56px; padding-bottom: 60px; min-height: auto; }
    .hero .container { grid-template-columns: 1fr; gap: 40px; }
    .hero-title { font-size: 32px; margin-bottom: 16px; }
    .hero-desc { font-size: 15px; margin-bottom: 24px; }
    .hero-features { flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; padding: 14px 24px; }
    .hero-image { height: 300px; border-radius: 12px; }

    /* Section */
    .section-title { font-size: 28px; margin-bottom: 12px; }
    .section-desc { font-size: 15px; margin-bottom: 32px; line-height: 1.7; }
    .container { padding: 0 16px; }

    /* Stats */
    .stats-bar { padding: 32px 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .stat-item:not(:last-child)::after { display: none; }
    .stat-number { font-size: 28px; }

    /* Grids */
    .advantages-grid, .products-grid, .steps-grid {
        grid-template-columns: 1fr; gap: 16px;
    }
    .platform-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

    /* Why Section */
    .why-section, .products-section, .steps-section, .regulation-section {
        padding: 60px 0;
    }

    /* Global */
    .global-section { padding: 60px 0; }
    .global-content { grid-template-columns: 1fr; gap: 40px; margin-bottom: 40px; }
    .country-grid { grid-template-columns: repeat(2, 1fr); }

    /* Accordion */
    .accordion-item { padding: 20px 0; }
    .accordion-title { font-size: 15px; }

    /* CTA */
    .cta-section { padding: 60px 0; }
    .cta-title { font-size: 28px; }
    .cta-buttons { flex-direction: column; gap: 12px; }
    .cta-buttons button, .cta-buttons a {
        width: 100%; text-align: center;
    }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    .hero-title { font-size: 28px; }
    .stats-grid, .platform-grid { grid-template-columns: 1fr; }
    .product-stats { grid-template-columns: 1fr; }
    .product-stat { padding: 20px 16px; }
    .product-stat:not(:last-child)::after { display: none; }
    .country-grid { grid-template-columns: 1fr; }
}
