/* ═══════════════════════════════════════════════════════════════
   VAL'S DREAMSCAPE — 沉浸式梦境主题
   ═══════════════════════════════════════════════════════════════ */

/* Google Fonts removed for China accessibility */

:root {
    --void: #030308;
    --deep: #0a0a1a;
    --night: #12122a;
    --mist: #1a1a3e;
    --crystal: #2a2a5e;
    --glow-purple: #7b68ee;
    --glow-blue: #4a90d9;
    --glow-cyan: #22d3ee;
    --text-light: #e8e8f8;
    --text-dim: #8888aa;
    --font-serif: 'Songti SC', 'Noto Serif SC', 'SimSun', Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-serif);
    background: var(--void);
    color: var(--text-light);
    line-height: 1.9;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.18;
    background-image:
      radial-gradient(circle at 20% 18%, rgba(255,255,255,0.10), transparent 40%),
      radial-gradient(circle at 78% 72%, rgba(125, 211, 252, 0.12), transparent 44%),
      linear-gradient(120deg, rgba(123,104,238,0.05), rgba(34,211,238,0.02));
    mix-blend-mode: screen;
}

/* ═══ 星空画布 ═══ */
#starfield {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ═══ 导航 ═══ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1.2rem;
    background: linear-gradient(180deg, rgba(3,3,8,0.85) 0%, rgba(3,3,8,0.28) 60%, transparent 100%);
    backdrop-filter: blur(8px);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.35s ease;
}

.nav-logo {
    font-size: 1.5rem;
    color: var(--glow-purple);
    text-decoration: none;
    animation: pulse 3s ease-in-out infinite;
}

.nav-link {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.3s, text-shadow 0.3s, opacity 0.3s;
}

.nav-link:hover {
    color: var(--glow-cyan);
    text-shadow: 0 0 20px var(--glow-cyan);
}

/* 单篇旅程页：弱化“网页操作感” */
body.immersive-single .nav {
    justify-content: flex-start;
    gap: 0.8rem;
    padding: 0.7rem 0.9rem;
    background: linear-gradient(180deg, rgba(3,3,8,0.45) 0%, rgba(3,3,8,0.10) 65%, transparent 100%);
}

body.immersive-single .nav-link {
    font-size: 0.72rem;
    opacity: 0;
    pointer-events: none;
}

body.immersive-single .nav:hover .nav-link,
body.immersive-single .nav:focus-within .nav-link {
    opacity: 0.75;
    pointer-events: auto;
}

/* ═══ 主内容 ═══ */
main {
    flex: 1;
    padding: 6rem 1.5rem 4rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

body.immersive-single main {
    max-width: min(980px, 100%);
    padding-top: 3.6rem;
}

/* ═══ 首页英雄区 ═══ */
.dream-home { padding-top: 8vh; }

.hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--glow-purple), var(--glow-cyan), var(--glow-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 8s ease-in-out infinite;
}

.hero-glyph {
    display: block;
    font-size: 0.4em;
    margin-bottom: 0.5rem;
    opacity: 0.6;
    animation: rotate 20s linear infinite;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    color: var(--text-dim);
    max-width: 600px;
    line-height: 1.8;
}

.hero-scroll {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.6;
}

.scroll-arrow {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, var(--glow-purple), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

/* ═══ 内容区块 ═══ */
.dream-section {
    padding: 5rem 0;
    border-top: 1px solid rgba(123,104,238,0.1);
}

.section-heading {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--glow-cyan);
}

.section-glyph {
    font-size: 1.5rem;
    opacity: 0.7;
    animation: pulse 3s ease-in-out infinite;
}

/* ═══ 卡片星座 ═══ */
.card-constellation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.dream-card {
    position: relative;
    display: block;
    padding: 1.8rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(26,26,62,0.6), rgba(10,10,26,0.8));
    border: 1px solid rgba(123,104,238,0.15);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), border-color 0.3s;
}

.dream-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(123,104,238,0.08), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s;
}

.dream-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(123,104,238,0.4);
}

.dream-card:hover::before { opacity: 1; }

.card-glow {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--glow-purple), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.dream-card:hover .card-glow { opacity: 1; }

.card-time {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-sans);
}

.card-title {
    font-size: 1.15rem;
    margin: 0.5rem 0;
    color: var(--text-light);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.7;
}

.card-tags {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(123,104,238,0.15);
    color: var(--glow-purple);
    font-family: var(--font-sans);
}

/* ═══ 故事沉浸层（文章页） ═══ */
.story-journey {
    position: relative;
    isolation: isolate;
    --scene-accent: rgba(123,104,238,0.30);
    --scene-accent-soft: rgba(34,211,238,0.16);
    transition: transform 0.12s linear, filter 0.4s ease;
    will-change: transform;
}

.scene-veil {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
      radial-gradient(circle at 20% 20%, var(--scene-accent), transparent 45%),
      radial-gradient(circle at 80% 70%, var(--scene-accent-soft), transparent 55%);
    opacity: 0.45;
    transition: opacity 0.5s ease, filter 0.5s ease, background 0.6s ease;
}

body[data-scene="void"] .scene-veil {
    background:
      radial-gradient(circle at 18% 24%, rgba(99,102,241,0.30), transparent 46%),
      radial-gradient(circle at 74% 75%, rgba(56,189,248,0.14), transparent 56%);
}

body[data-scene="starsea"] .scene-veil {
    background:
      radial-gradient(circle at 28% 18%, rgba(34,211,238,0.30), transparent 44%),
      radial-gradient(circle at 76% 70%, rgba(147,197,253,0.18), transparent 56%);
}

body[data-scene="crystal"] .scene-veil {
    background:
      radial-gradient(circle at 18% 32%, rgba(167,139,250,0.32), transparent 44%),
      radial-gradient(circle at 82% 70%, rgba(96,165,250,0.20), transparent 56%);
}

body[data-scene="calling"] .scene-veil {
    background:
      radial-gradient(circle at 22% 24%, rgba(45,212,191,0.32), transparent 44%),
      radial-gradient(circle at 76% 74%, rgba(59,130,246,0.18), transparent 56%);
}

.story-orb {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
    filter: blur(36px);
    opacity: 0.35;
    mix-blend-mode: screen;
    transition: transform 0.2s ease-out;
}

.orb-1 {
    width: 280px;
    height: 280px;
    top: 14%;
    left: -80px;
    background: radial-gradient(circle, rgba(123,104,238,0.42), transparent 70%);
}

.orb-2 {
    width: 220px;
    height: 220px;
    top: 48%;
    right: -60px;
    background: radial-gradient(circle, rgba(34,211,238,0.34), transparent 72%);
}

.orb-3 {
    width: 320px;
    height: 320px;
    bottom: 6%;
    left: 24%;
    background: radial-gradient(circle, rgba(74,144,217,0.30), transparent 72%);
}

.story-progress {
    position: sticky;
    top: 62px;
    height: 4px;
    background: rgba(123,104,238,0.18);
    border-radius: 999px;
    overflow: hidden;
    margin: -1rem 0 2rem;
    z-index: 40;
}

.story-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--glow-purple), var(--glow-cyan));
    box-shadow: 0 0 18px rgba(123,104,238,0.6);
    transition: width 0.08s linear;
}

.title-card {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at center, rgba(3,3,8,0.55), rgba(3,3,8,0.88));
}

.title-card-inner {
    text-align: center;
    letter-spacing: 0.06em;
    transform: translateY(10px) scale(0.98);
    filter: blur(2px);
}

.title-card-kicker {
    display: block;
    font-size: 0.72rem;
    color: rgba(232,232,248,0.62);
    margin-bottom: 0.9rem;
    font-family: var(--font-sans);
}

.title-card strong {
    display: block;
    font-size: clamp(1.5rem, 4.8vw, 2.8rem);
    color: #f4f4ff;
    text-shadow: 0 0 24px rgba(123,104,238,0.45);
}

.title-card em {
    display: block;
    margin-top: 0.75rem;
    font-style: normal;
    font-size: 0.8rem;
    color: rgba(232,232,248,0.62);
}

body.immersive-single .title-card.show {
    animation: titleCardIn 1.35s cubic-bezier(.19,.8,.25,1) forwards;
}

body.immersive-single .title-card.fade {
    animation: titleCardOut 0.8s ease forwards;
}


/* 场景段落：像旅程节点 */
.article-body > p {
    position: relative;
    padding-left: 1.1rem;
}

.article-body > p::before {
    content: '';
    position: absolute;
    left: -0.15rem;
    top: 0.85rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--glow-purple);
    box-shadow: 0 0 12px rgba(123,104,238,0.8);
    opacity: 0.55;
}

.article-body > p.active-scene::before {
    background: var(--glow-cyan);
    box-shadow: 0 0 16px rgba(34,211,238,0.9);
    opacity: 1;
}

.article-body > p.active-scene {
    text-shadow: 0 0 18px rgba(123,104,238,0.22);
}

.article-body > p.active-scene::after {
    content: '';
    position: absolute;
    left: -0.4rem;
    top: 0.35rem;
    width: 2px;
    height: calc(100% - 0.6rem);
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(34,211,238,0.7), transparent);
    opacity: 0.75;
}

body.scene-shift .scene-veil {
    opacity: 0.7;
    filter: saturate(1.25) brightness(1.05);
}

/* 手机端沉浸优化 */
@media (max-width: 640px) {
    .story-progress {
        top: 54px;
        margin: -0.5rem 0 1.2rem;
    }
    .story-orb {
        filter: blur(26px);
        opacity: 0.28;
    }
    .orb-1 { width: 180px; height: 180px; left: -60px; }
    .orb-2 { width: 150px; height: 150px; right: -45px; }
    .orb-3 { width: 190px; height: 190px; left: 20%; }
}

/* 降级策略：用户偏好减少动画 */
@media (prefers-reduced-motion: reduce) {
    #starfield,
    body::before,
    .story-orb,
    .story-progress-bar,
    .scene-veil,
    .title-card,
    .reveal,
    .js-ready .article-body p {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* ═══ 文章页 ═══ */
.dream-article {
    padding-top: 2rem;
}

.article-hero {
    text-align: center;
    padding: 4rem 0 3rem;
    border-bottom: 1px solid rgba(123,104,238,0.1);
    margin-bottom: 3rem;
}

body.immersive-single .article-hero {
    padding-top: 1.2rem;
    margin-bottom: 1.6rem;
    border-bottom-color: rgba(123,104,238,0.06);
}

body.immersive-single .article-glyph,
body.immersive-single .article-title,
body.immersive-single .article-meta {
    opacity: 0.14;
    filter: blur(0.2px);
    transition: opacity 0.4s ease;
}

body.immersive-single .article-hero:hover .article-glyph,
body.immersive-single .article-hero:hover .article-title,
body.immersive-single .article-hero:hover .article-meta {
    opacity: 0.75;
}


.article-glyph {
    font-size: 2rem;
    color: var(--glow-purple);
    opacity: 0.5;
    margin-bottom: 1rem;
    animation: pulse 4s ease-in-out infinite;
}

.article-title {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--text-dim);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.article-tags { display: flex; gap: 0.5rem; }

/* ═══ 文章正文 — 沉浸式排版 ═══ */
.article-body {
    font-size: clamp(1.06rem, 1.2vw, 1.2rem);
    line-height: 2.08;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

body.immersive-single .article-body {
    max-width: min(740px, 92vw);
    letter-spacing: 0.018em;
}


.article-body p {
    margin-bottom: 1.8rem;
    text-align: justify;
}

.js-ready .article-body p {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.js-ready .article-body p:nth-child(1) { animation-delay: 0.1s; }
.js-ready .article-body p:nth-child(2) { animation-delay: 0.2s; }
.js-ready .article-body p:nth-child(3) { animation-delay: 0.3s; }
.js-ready .article-body p:nth-child(4) { animation-delay: 0.4s; }
.js-ready .article-body p:nth-child(5) { animation-delay: 0.5s; }
.js-ready .article-body p:nth-child(n+6) { animation-delay: 0.6s; }

.article-body h2 {
    font-size: 1.5rem;
    margin: 3rem 0 1.5rem;
    color: var(--glow-cyan);
    text-align: center;
}

.article-body h3 {
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    color: var(--glow-purple);
}

.article-body a {
    color: var(--glow-cyan);
    text-decoration: none;
    border-bottom: 1px solid rgba(34,211,238,0.3);
    transition: border-color 0.3s;
}

.article-body a:hover { border-color: var(--glow-cyan); }

.article-body blockquote {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    border-left: 3px solid var(--glow-purple);
    background: linear-gradient(135deg, rgba(123,104,238,0.08), transparent);
    font-style: italic;
    color: var(--text-light);
    position: relative;
}

.article-body blockquote::before {
    content: '"';
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-size: 4rem;
    color: var(--glow-purple);
    opacity: 0.2;
    font-family: Georgia, serif;
}

.article-body strong {
    color: var(--glow-cyan);
    font-weight: 600;
}

.article-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 0 40px rgba(123,104,238,0.2);
}

.article-body pre {
    background: var(--night);
    border: 1px solid rgba(123,104,238,0.2);
    border-radius: 8px;
    padding: 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.article-body code {
    background: var(--night);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ═══ 文章导航 ═══ */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(123,104,238,0.1);
    font-size: 0.9rem;
}

body.immersive-single .article-nav {
    opacity: 0.2;
    filter: blur(0.1px);
    transition: opacity 0.3s ease;
}

body.immersive-single .article-nav:hover {
    opacity: 0.85;
}


.article-nav a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s;
}

.article-nav a:hover { color: var(--glow-cyan); }

/* ═══ 列表页 ═══ */
.dream-list { padding-top: 2rem; }

.list-heading {
    font-size: 1.8rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--glow-cyan);
}

.list-entry {
    display: block;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(123,104,238,0.1);
    text-decoration: none;
    transition: padding-left 0.3s;
}

.list-entry:hover { padding-left: 1rem; }

.list-entry time {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.list-entry h3 {
    font-size: 1.2rem;
    margin: 0.3rem 0;
    color: var(--text-light);
}

.list-entry p {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* ═══ 页脚 ═══ */
.footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-top: 1px solid rgba(123,104,238,0.1);
}

body.immersive-single .footer {
    border-top-color: transparent;
    color: rgba(136,136,170,0.35);
    opacity: 0.45;
}

body.immersive-single .footer:hover {
    opacity: 0.85;
}

/* ═══ 动画 ═══ */
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; height: 40px; }
    50% { opacity: 1; height: 50px; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes titleCardIn {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes titleCardOut {
    from { opacity: 1; }
    to { opacity: 0; }
}


.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.js-ready .reveal {
    opacity: 0;
    transform: translateY(30px);
}

.js-ready .reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══ 响应式 ═══ */
@media (max-width: 640px) {
    .nav { gap: 1rem; padding: 1rem; }
    .nav-link { font-size: 0.75rem; }
    main { padding: 5rem 1rem 3rem; }
    .hero-title { font-size: 2rem; }
    .article-body { font-size: 1rem; }
    .card-constellation { grid-template-columns: 1fr; }

    body.immersive-single .nav {
        gap: 0.45rem;
        padding: 0.45rem 0.65rem;
    }

    body.immersive-single .nav-link {
        font-size: 0.64rem;
    }

    body.immersive-single main {
        padding-top: 3rem;
    }
}
