:root {
    /* 墨行調色盤 */
    --ink-black: #0a0a0a;
    --ink-dark: #1a1a1a;
    --ink-medium: #333333;
    --ink-light: #666666;

    --paper-white: #f7f5f0;
    --paper-light: #ffffff;
    --paper-texture: #e8e4dc;

    --accent-red: #c0392b;
    /* 硃砂紅（印章色） */
    --accent-gold: #d4af37;
    /* 隱喻皇權與財富，少量使用 */

    /* 字體系統 */
    --font-heading: 'Ma Shan Zheng', cursive;
    /* 書法字標題 */
    --font-body: 'Noto Serif TC', serif;
    /* 閱讀宋體 */

    /* 佈局 */
    --container-width: 1200px;
    --header-height: 80px;
}

/* 全局紙張紋理 */
.paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.5'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* 自訂水墨游標 */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--ink-black);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(10, 10, 10, 0.5);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover 互動效果 */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(192, 57, 43, 0.1);
    border-color: var(--accent-red);
}

/* 重置與基礎設置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 僅在桌面端啟用自訂游標，隱藏系統游標 */
@media (min-width: 1024px) {

    body,
    a,
    button,
    .region-card {
        cursor: none;
    }
}

/* 行動裝置隱藏自訂游標 */
@media (max-width: 1023px) {

    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--paper-white);
    color: var(--ink-dark);
    line-height: 1.8;
    overflow-x: hidden;
    /* 隱約的紙張紋理背景 */
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
}

/* 粒子特效容器 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

/* ================= Navbar ================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(247, 245, 240, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nav-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-chinese {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--ink-black);
    line-height: 1;
}

.logo-sub {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-red);
    font-weight: 700;
}

.nav-links a {
    text-decoration: none;
    color: var(--ink-medium);
    margin-left: 2rem;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
    /* 調整為更暗的遮罩，提升文字對比度 */
    opacity: 0.8;
    filter: grayscale(100%) contrast(110%) brightness(0.7);
    /* Slightly brighter than 0.6 */
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-red);
    transition: width 0.3s ease;
}

.title-char {
    display: inline-block;
    animation: inkFloat 3s ease-in-out infinite;
    color: white;
    /* Explicitly set to white */
}

.nav-links a:hover {
    color: var(--ink-black);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    border: 2px solid var(--ink-black);
    padding: 0.5rem 1.5rem;
    color: var(--ink-black) !important;
}

.nav-cta:hover {
    background-color: var(--ink-black);
    color: var(--paper-white) !important;
}

.nav-cta:hover::after {
    display: none;
}

/* ================= Hero Section ================= */
.hero {
    min-height: 100vh;
    /* Changed from height to min-height to allow growth */
    display: flex;
    flex-direction: column;
    /* Stack content vertically */
    align-items: center;
    justify-content: space-between;
    /* Distribute space */
    text-align: center;
    position: relative;
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 2rem;
    background-color: var(--ink-black);
    overflow: hidden;
}

/* Hero Transparency Overlay - Cinematic Style */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('hero_bg.png');
    background-size: cover;
    background-position: center;
    z-index: 0;

    /* 動態運鏡 - Ken Burns Effect */
    animation: heroZoom 20s infinite alternate ease-in-out;

    /* 濾鏡調整：微調對比度與飽和度，不再全灰階 */
    filter: contrast(110%) brightness(0.9) sepia(20%);
}

/* 額外的暗角層 (Vignette) - 加強文字可讀性而不破壞圖片 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 複雜的漸層疊加：
       1. 底部黑色漸層 (讓 stats 清晰)
       2. 中心黑色徑向漸層 (讓標題清晰)
    */
    background:
        linear-gradient(to top, var(--ink-black) 10%, transparent 60%),
        radial-gradient(circle at center, rgba(0, 0, 0, 0.5) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

@keyframes heroZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    animation: fadeIn 1.5s ease-out;
    margin: auto 0;
    /* Center vertically in available space */
    flex: 1;
    /* Allow to take up space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #ffffff;
    /* 強制白色文字 */
}

/* 確保 Hero 區域內的所有文字都有足夠的陰影和對比 */
.hero-content h1,
.hero-content p,
.hero-content .hero-badge {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* 恢復按鈕樣式 */
.hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
}

.btn-primary {
    background-color: var(--accent-red);
    color: white !important;
    /* 確保白色字 */
    border: 1px solid var(--accent-red);
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.5);
}

.btn-primary:hover {
    background-color: #a93226;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.7);
}

/* Secondary Button - Light Mode for Dark Background */
.btn-secondary {
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: white !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background-color: white;
    color: var(--ink-black) !important;
}

/* Badge - Light on Dark */
.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-red);
    color: white;
    background: rgba(192, 57, 43, 0.2);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 8rem;
    margin: 0;
    color: white;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 1);
    /* 更強的陰影 */
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* 數據展示容器 */
.hero-stats-container {
    position: relative;
    /* Changed from absolute */
    width: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-bottom: 2rem;
    margin-top: 2rem;
    /* Ensure spacing from content above */
}

/* Responsive fix: 如果螢幕太矮，讓內容緊湊一點 */
@media (max-height: 800px) {
    .hero {
        padding-top: 100px;
    }

    .hero-title {
        font-size: 5rem;
    }

    .hero-content {
        margin: 1rem 0;
    }
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    width: 80%;
    max-width: 600px;
}

/* Scroll Indicator */
.scroll-indicator {
    color: var(--paper-white);
    font-size: 0.8rem;
    opacity: 0.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--paper-white);
    border-bottom: 2px solid var(--paper-white);
    transform: rotate(45deg);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    font-family: var(--font-heading);
    color: var(--paper-white);
    /* 白色數字 */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    /* 淺色標籤 */
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ================= Difference Section ================= */
.difference {
    background-color: var(--ink-black);
    color: var(--paper-white);
    padding: 6rem 0;
    position: relative;
    /* 墨跡邊緣效果可以用 SVG mask，這裡先簡化 */
}

.diff-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-title.light {
    color: var(--paper-white);
}

.section-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
}

.diff-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.diff-card {
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    /* 半透明黑 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 100%;
}

.diff-old {
    opacity: 0.6;
}

.diff-new {
    background: rgba(192, 57, 43, 0.1);
    /* 微紅底 */
    border: 1px solid var(--accent-red);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.diff-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.diff-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.diff-card ul {
    list-style: none;
}

.diff-card li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.diff-card li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-red);
}

.diff-vs {
    font-weight: 900;
    font-style: italic;
    font-size: 2rem;
    color: var(--ink-light);
}

/* ================= Features Grid ================= */
.features {
    padding: 6rem 0;
    background-color: var(--paper-white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    padding: 2rem;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-bottom-color: var(--accent-red);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--ink-dark);
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.feature-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    color: var(--ink-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* ================= World / Regions ================= */
.world {
    background-color: var(--ink-dark);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.world-bg {
    width: 100%;
    height: 100%;
    /* 使用長卷圖 */
    background-image: url('regions_scroll.png');
    background-size: 500% 100%;
    /* 寬度是容器的5倍，因為有5個區域 */
    background-position: 0% center;
    /* 預設顯示最左邊（北地） */
    transition: background-position 1s ease-in-out, opacity 0.5s ease;
    opacity: 0.8;
    /* 提高不透明度讓圖更清楚 */
}

/* 針對不同區域的背景位置調整 */
/* 由於 JS 會在 .region-card 加 active，我們需要一個機制讓 visual 知道哪個 active。
   但在目前的 HTML 結構中，visual 和 card 是兄弟元素。
   最簡單的方法是讓 JS 同時修改 .regions-visual 的 class 或者 style。
   或者我們直接用 CSS 選擇器如果結構允許（但這裡 sibling 不好選）。
   
   更好的做法：JS 在切換時直接設定 .regions-visual 的 style.backgroundPosition。
   
   所以 CSS 這裡只需要基礎設定。
*/

.regions-showcase {
    display: flex;
    justify-content: center;
    margin: 4rem 0;
    height: 400px;
    position: relative;
}

.region-card {
    position: absolute;
    width: 100%;
    max-width: 800px;
    height: 100%;
    display: flex;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s ease;
    pointer-events: none;
}

.region-card.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.region-visual {
    flex: 1;
    background-color: var(--ink-dark);
    background-size: cover;
    background-position: center;
    position: relative;
    /* 增加一點陰影讓圖片更有層次 */
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* 區域背景圖片 */
.region-visual.north {
    background-image: url('region_north.png');
}

.region-visual.jiangnan {
    background-image: url('region_jiangnan.png');
}

.region-visual.central {
    background-image: url('region_central.png');
}

.region-visual.south {
    background-image: url('region_south.png');
}

.region-visual.west {
    background-image: url('region_west.png');
}

.region-info {
    flex: 1;
    background: var(--paper-white);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.region-info h3 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--ink-black);
}

.region-mood {
    color: var(--accent-red);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.region-tags {
    margin-top: 2rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.region-tags span {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.region-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.region-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.3s;
}

.region-btn:hover,
.region-btn.active {
    background: var(--paper-white);
    color: var(--ink-black);
    border-color: var(--paper-white);
}

/* ================= Story Section ================= */
.story {
    padding: 6rem 0;
    background: var(--paper-texture);
    /* 稍微深一點的紙色 */
}

.story-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.scene-image {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: 10px 10px 0 var(--ink-black);
}

.scene-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.2) contrast(1.1);
}

.story-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.story-text p {
    margin-bottom: 1.2rem;
}

.story-highlight {
    color: var(--accent-red);
    font-weight: 700;
    border-left: 3px solid var(--accent-red);
    padding-left: 1rem;
    font-style: italic;
}

.story-climax {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--ink-black);
    margin-top: 2rem;
}

.choice-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.choice-card {
    background: white;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.choice-card:hover {
    border-color: var(--ink-black);
    background: var(--ink-black);
}

.choice-card:hover * {
    color: white !important;
}

.choice-tag {
    font-weight: 900;
    color: var(--ink-black);
    display: block;
    margin-bottom: 0.3rem;
}

.choice-card p {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--ink-light);
    margin: 0;
}

/* ================= CTA ================= */
.cta {
    padding: 8rem 0;
    text-align: center;
    background-color: var(--ink-black);
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 這裡可以放墨水暈開的動畫 SVG */
}

.cta-content {
    position: relative;
    z-index: 10;
}

.cta h2 {
    font-family: var(--font-heading);
    font-size: 4rem;
    margin-bottom: 2rem;
}

.btn-large {
    font-size: 1.5rem;
    padding: 1.2rem 4rem;
    margin: 2rem 0;
}

.cta-note {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* ================= Footer ================= */
.footer {
    background-color: #000;
    color: #666;
    padding: 4rem 0 2rem;
    border-top: 1px solid #222;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.footer-brand .logo-chinese {
    color: white;
    font-size: 2rem;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin-left: 2rem;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #111;
    font-size: 0.8rem;
}

/* ================= Animations ================= */
@keyframes inkFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        filter: blur(0px);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
        filter: blur(0.5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RWD */
@media (max-width: 768px) {
    .hero-title {
        font-size: 5rem;
    }

    .diff-grid,
    .story-showcase {
        grid-template-columns: 1fr;
    }

    .diff-vs {
        text-align: center;
        margin: 2rem 0;
    }

    .regions-showcase {
        height: auto;
        min-height: 600px;
    }

    .region-card {
        flex-direction: column;
    }

    .region-visual {
        min-height: 200px;
    }

    .choice-cards {
        grid-template-columns: 1fr;
    }
}

/* Responsive adjustments for shorter screens */
@media (max-height: 850px) {
    .hero-title {
        font-size: 6rem;
    }

    .hero-subtitle-en {
        margin-bottom: 1rem;
    }

    .hero-desc {
        margin-bottom: 2rem;
    }

    .hero-content {
        margin-bottom: 6rem;
    }
}

@media (max-height: 700px) {
    .hero-title {
        font-size: 4rem;
    }

    .hero-stats {
        margin-top: 1rem;
        padding-top: 1rem;
    }
}