/**
 * 公共样式表 - 所有页面共用的基础样式
 * 设计基调：克制、优雅的杂志风 —— 米白纸张、墨蓝文字、雾玫瑰点缀、灰度照片
 * 包含：设计令牌、全站背景图+白遮罩、导航、页脚、滚动进度、光标、揭示动画工具类
 */

/* ============ 设计令牌 ============ */
:root {
    /* 色彩 —— 低饱和、单色调为主，仅以雾玫瑰 / 蓝月草做克制点缀 */
    --bg-color: #F7F5EF;
    --paper: #FBFAF6;
    --text-primary: #2C3E50;
    --text-secondary: #6B7884;
    --text-muted: #9AA4AD;
    --accent-rose: #C9A6A6;
    --accent-red: #9E7777;
    --accent-moon: #7E9EC4;   /* 蓝月草 */
    --accent-jade: #6FA088;   /* 芙莉莲的绿眸 */
    --accent-gold: #C7A463;   /* 魔法阵的金 */
    --card-bg: #FFFFFF;
    --line: rgba(44, 62, 80, 0.10);
    --line-strong: rgba(44, 62, 80, 0.18);

    /* 阴影 —— 柔和、低对比 */
    --shadow-sm: 0 2px 10px rgba(44, 62, 80, 0.05);
    --shadow-md: 0 14px 40px rgba(44, 62, 80, 0.09);
    --shadow-lg: 0 30px 70px rgba(44, 62, 80, 0.12);

    /* 排版 */
    --font-serif: "Playfair Display", "Noto Serif SC", "Songti SC", "SimSun", serif;
    --font-sans: "Helvetica Neue", "Inter", "Microsoft YaHei", "PingFang SC", sans-serif;

    /* 节奏 */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 30px;
    --nav-h: 76px;
}

/* ============ 重置 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* ============ 全站背景图 + 白色遮罩 ============ */
/* 底层：花海实景图，固定视差 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("../images/index/花海.jpg") center center / cover no-repeat;
    background-attachment: fixed;
    z-index: -3;
    transform: scale(1.05);
    filter: saturate(0.92) brightness(1.0);
}
/* 上层：白色遮罩（调低，让花海透出更多，并带一丝主题冷调） */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(135% 105% at 50% 0%, rgba(255, 255, 255, 0.30) 0%, rgba(247, 245, 239, 0.58) 46%, rgba(244, 244, 240, 0.78) 100%),
        linear-gradient(180deg, rgba(126, 158, 196, 0.05), rgba(201, 166, 166, 0.05));
    z-index: -2;
    pointer-events: none;
}
/* Three.js 3D 粒子画布层 */
#three-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
a:hover { color: var(--accent-red); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: normal;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

img { max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ============ 滚动进度条 ============ */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px; width: 0%;
    background: linear-gradient(90deg, var(--accent-rose), var(--accent-moon), var(--accent-jade), var(--accent-gold));
    z-index: 2000;
    transition: width 0.1s linear;
}

/* ============ 导航栏 ============ */
header.site-header {
    padding: 0;
    height: var(--nav-h);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background-color: rgba(251, 250, 246, 0.78);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    z-index: 1000;
    transition: transform 0.45s var(--ease-out), height 0.35s var(--ease-out),
                background-color 0.35s ease, box-shadow 0.35s ease;
}
header.site-header.scrolled { height: 62px; box-shadow: var(--shadow-sm); }
header.site-header.nav-hidden { transform: translateY(-100%); }

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

.logo {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    letter-spacing: 0.22em;
    font-weight: 700;
    position: relative;
}
.logo::after {
    content: "";
    position: absolute; left: 0; bottom: -4px;
    width: 0; height: 1px; background: var(--accent-red);
    transition: width 0.4s var(--ease-out);
}
.logo:hover::after { width: 100%; }

nav ul { display: flex; list-style: none; gap: 2.2rem; }
nav a {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    position: relative;
    padding: 0.4rem 0;
}
nav a::after {
    content: "";
    position: absolute; left: 50%; bottom: 0;
    width: 0; height: 1px; background: var(--accent-rose);
    transform: translateX(-50%);
    transition: width 0.35s var(--ease-out);
}
nav a:hover::after, nav a.active::after { width: 100%; }
nav a.active { color: var(--text-primary); }

/* 移动端汉堡按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: none; cursor: pointer;
    width: 30px; height: 24px; justify-content: center;
    z-index: 1100;
}
.nav-toggle span {
    display: block; height: 1.5px; width: 100%;
    background: var(--text-primary);
    transition: transform 0.35s var(--ease-out), opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============ 自定义光标 ============ */
.cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3000;
    mix-blend-mode: multiply;
    will-change: transform;
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent-red); margin: -3px 0 0 -3px; }
.cursor-ring {
    width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border: 1px solid var(--accent-rose);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
                background-color 0.25s ease, border-color 0.25s ease;
}
.cursor-ring.hover {
    width: 56px; height: 56px; margin: -28px 0 0 -28px;
    background: rgba(201, 166, 166, 0.12);
    border-color: var(--accent-red);
}
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ============ 回到顶部 ============ */
#back-to-top {
    position: fixed; right: 2rem; bottom: 2rem;
    width: 46px; height: 46px;
    border: 1px solid var(--line-strong);
    background: rgba(251, 250, 246, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(14px);
    transition: all 0.4s var(--ease-out);
    z-index: 900;
    color: var(--text-primary);
}
#back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
#back-to-top svg { width: 16px; height: 16px; }

/* ============ 页脚 ============ */
footer.site-footer {
    margin-top: 6rem;
    padding: 4rem 0 2.5rem;
    border-top: 1px solid var(--line);
    background: rgba(251, 250, 246, 0.6);
    backdrop-filter: blur(6px);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.5rem;
    text-align: left;
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--line);
}
.footer-brand .logo { font-size: 1.6rem; display: inline-block; margin-bottom: 1rem; }
.footer-brand p { max-width: 320px; color: var(--text-muted); font-size: 0.86rem; }
.footer-col h4 {
    font-family: var(--font-sans);
    font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--text-primary); margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { color: var(--text-secondary); font-size: 0.88rem; }
.footer-col a:hover { color: var(--accent-red); padding-left: 4px; transition: all 0.3s var(--ease-out); }
.footer-bottom p { margin-bottom: 0.5rem; }
.footer-quote { font-family: var(--font-serif); font-style: italic; color: var(--accent-rose); }
.footer-beian {
    margin-top: 1rem; font-size: 0.8rem; color: var(--text-muted);
    display: flex; gap: 0.5rem; justify-content: center; align-items: center; flex-wrap: wrap;
}
.footer-beian a { color: var(--text-muted); }
.footer-beian a:hover { color: var(--accent-red); }

/* ============ 通用按钮 ============ */
.btn-outline {
    display: inline-block;
    padding: 0.95rem 2.4rem;
    border: 1px solid var(--text-primary);
    border-radius: 999px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.82rem;
    position: relative;
    overflow: hidden;
    transition: color 0.4s var(--ease-out);
    z-index: 1;
}
.btn-outline::before {
    content: ""; position: absolute; inset: 0;
    background: var(--text-primary);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.45s var(--ease-out); z-index: -1;
}
.btn-outline:hover { color: #fff; }
.btn-outline:hover::before { transform: scaleX(1); }

.btn-text {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--accent-rose);
    padding-bottom: 3px;
    transition: color 0.3s ease;
}
.btn-text:hover { color: var(--accent-red); }

/* 胶囊按钮 —— 现代动漫风 */
.btn-fill, .btn-ghost {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-sans); font-size: 0.9rem; letter-spacing: 0.04em;
    padding: 0.95rem 2rem; border-radius: 999px;
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out), background-color 0.35s ease, color 0.35s ease;
    cursor: pointer;
}
.btn-fill {
    background: var(--text-primary); color: #fff;
    border: 1px solid var(--text-primary);
    box-shadow: 0 10px 22px rgba(44, 62, 80, 0.18);
}
.btn-fill:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 16px 30px rgba(44, 62, 80, 0.26); }
.btn-ghost {
    background: rgba(255, 255, 255, 0.6); color: var(--text-primary);
    border: 1px solid var(--line-strong);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent-red); color: var(--accent-red); }
.btn-fill svg, .btn-ghost svg { width: 16px; height: 16px; }

/* 徽章 chips */
.badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line-strong); border-radius: 999px;
    padding: 0.35rem 0.9rem;
}
.badge-dot::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent-red); display: inline-block;
    box-shadow: 0 0 0 3px rgba(158, 119, 119, 0.18);
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* 飘落花瓣装饰 */
.deco-petal { position: absolute; pointer-events: none; color: var(--accent-rose); opacity: 0.5; z-index: 1; }
.deco-petal svg { width: 100%; height: 100%; display: block; }
.deco-petal.moon { color: var(--accent-moon); }
.deco-petal.jade { color: var(--accent-jade); }
.deco-petal.gold { color: var(--accent-gold); }
.float-slow { animation: floatY 7s ease-in-out infinite; }
.float-mid  { animation: floatY 5s ease-in-out infinite; }
@keyframes floatY {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(8deg); }
}

/* 区块分隔纹样 */
.section-divider {
    display: flex; align-items: center; justify-content: center; gap: 1.1rem;
    width: min(360px, 72%); margin: 0 auto 4rem; color: var(--accent-rose);
}
.section-divider::before, .section-divider::after {
    content: ""; height: 1px; flex: 1;
}
.section-divider::before { background: linear-gradient(90deg, transparent, var(--line-strong)); }
.section-divider::after  { background: linear-gradient(90deg, var(--line-strong), transparent); }
.section-divider svg { width: 24px; height: 24px; opacity: 0.9; }

/* 主题色工具：组件内用 var(--c) 取色 */
.accent-rose { --c: var(--accent-rose); }
.accent-moon { --c: var(--accent-moon); }
.accent-jade { --c: var(--accent-jade); }
.accent-gold { --c: var(--accent-gold); }

/* ============ 揭示动画工具类（GSAP 接管，JS 缺失时回退为可见） ============ */
html.anim-ready [data-reveal] { opacity: 0; will-change: transform, opacity; }
html.anim-ready [data-reveal="up"]    { transform: translateY(40px); }
html.anim-ready [data-reveal="down"]  { transform: translateY(-40px); }
html.anim-ready [data-reveal="left"]  { transform: translateX(-50px); }
html.anim-ready [data-reveal="right"] { transform: translateX(50px); }
html.anim-ready [data-reveal="scale"] { transform: scale(0.92); }
html.anim-ready .fade-in { opacity: 0; }
.split-char { display: inline-block; will-change: transform, opacity; }

/* ============ 标题载体（卡片化，避免标题悬浮在背景图上） ============ */
.section-header, .news-header,
html .page-header, html .story-hero {
    text-align: center;
    width: -moz-max-content;
    width: max-content;
    max-width: min(92%, 720px);
    margin-left: auto;
    margin-right: auto;
    background: rgba(251, 250, 246, 0.62);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 1.9rem 3.2rem;
    box-shadow: var(--shadow-sm);
}
.section-header { margin-bottom: 3.5rem; }
.news-header { margin-bottom: 4rem; }
html .page-header { margin: 2rem auto 3.5rem; }
html .story-hero { margin: 2rem auto 3rem; }

/* 区块通用标题 */
.section-header { text-align: center; }
.section-subtitle {
    font-family: var(--font-sans);
    color: var(--accent-rose);
    letter-spacing: 0.24em;
    font-size: 0.82rem;
    text-transform: uppercase;
    display: block; margin-bottom: 0.8rem;
}
.section-header h2 { font-size: 2.6rem; color: var(--text-primary); }
.eyebrow-line {
    display: inline-block; width: 46px; height: 1px;
    background: var(--accent-rose); vertical-align: middle; margin: 0 0.8rem;
}

/* 无障碍：尊重减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    html.anim-ready [data-reveal], html.anim-ready .fade-in { opacity: 1 !important; transform: none !important; }
    body::before { background-attachment: scroll; }
    .cursor-dot, .cursor-ring { display: none; }
    * { scroll-behavior: auto; }
}

/* ============ 响应式 ============ */
@media (max-width: 820px) {
    .nav-toggle { display: flex; }
    nav {
        position: fixed; inset: 0;
        background: rgba(251, 250, 246, 0.97);
        backdrop-filter: blur(20px);
        display: flex; align-items: center; justify-content: center;
        transform: translateX(100%);
        transition: transform 0.5s var(--ease-out);
    }
    nav.open { transform: translateX(0); }
    nav ul { flex-direction: column; gap: 2rem; text-align: center; }
    nav a { font-size: 1.1rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .section-header h2 { font-size: 2rem; }
    #back-to-top { right: 1.2rem; bottom: 1.2rem; }
}
