:root {
    --bg: #0b1622;
    --accent: #4fc3f7;
    --text-dim: #7d93a8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
    background: radial-gradient(ellipse at 30% 20%, #21405f 0%, #142c46 38%, #0b1a2a 100%);
    color: #dfe7ee;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === three.js 場景 === */
#bg3d {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
    pointer-events: none;
}

/* 讓文字在 3D 場景上仍清晰 */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 42%, rgba(11,22,34,0) 48%, rgba(11,22,34,0.32) 100%);
}

/* === 首頁橫幅 === */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header {
    text-align: center;
    padding: 0 1rem;
    transform: translateY(-8vh);
}

.scroll-hint {
    position: absolute;
    bottom: 3.2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(127,212,255,0.55);
    font-size: 0.72rem;
    letter-spacing: 0.4em;
    padding-left: 0.4em;
    text-decoration: none;
    text-transform: uppercase;
    animation: hint-breathe 3.4s ease-in-out infinite;
    transition: color 0.3s ease;
}

.scroll-hint:hover {
    color: rgba(127,212,255,0.95);
}

@keyframes hint-breathe {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50%      { opacity: 0.9; transform: translateX(-50%) translateY(6px); }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.logo-icon {
    filter: drop-shadow(0 0 18px rgba(79,195,247,0.5));
}

h1 {
    font-size: 3.6rem;
    font-weight: 200;
    color: #ffffff;
    letter-spacing: 0.4em;
    padding-left: 0.4em;
    text-shadow: 0 2px 34px rgba(0,0,0,0.8), 0 0 50px rgba(79,195,247,0.3);
}

.subtitle {
    color: rgba(127,212,255,0.9);
    font-size: 1.15rem;
    font-style: italic;
    letter-spacing: 0.45em;
    padding-left: 0.45em;
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 14px rgba(0,0,0,0.8);
}

.subtitle-en {
    color: #8aa2b8;
    font-size: 0.78rem;
    letter-spacing: 0.35em;
    padding-left: 0.35em;
    text-transform: uppercase;
    text-shadow: 0 2px 14px rgba(0,0,0,0.8);
}

/* === 內容區 === */
.content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
}

/* 內容區底襯：左右撐滿視口，把 three.js 場景壓暗，
   否則頁面邊緣裸露的雷峰塔與水面反光會跟卡片搶注意力。 */
.content::before {
    content: '';
    position: absolute;
    top: -4rem;
    bottom: -2rem;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: linear-gradient(
        180deg,
        rgba(8, 18, 30, 0) 0%,
        rgba(8, 18, 30, 0.66) 9%,
        rgba(8, 18, 30, 0.84) 100%
    );
    z-index: -1;
    pointer-events: none;
}

h2 {
    font-size: 0.95rem;
    margin-bottom: 0.9rem;
    color: rgba(127,212,255,0.9);
    font-weight: 400;
    letter-spacing: 0.35em;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

.section-lead {
    font-size: 0.85rem;
    line-height: 1.9;
    color: var(--text-dim);
    text-align: center;
    margin: 0 auto 2.2rem;
    max-width: 34em;
    letter-spacing: 0.04em;
}

section {
    margin-bottom: 3rem;
}

/* === 西湖十景 === */
.scene-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
}

.scene {
    position: relative;
    background: rgba(11, 22, 34, 0.72);
    border: 1px solid rgba(79,195,247,0.14);
    border-radius: 10px;
    padding: 1.6rem 1.5rem 1.4rem;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 卡背的柔光，滑過時像月光掃過水面 */
.scene::before {
    content: '';
    position: absolute;
    inset: -40% -60% auto -60%;
    height: 120%;
    background: radial-gradient(ellipse at 30% 0%, rgba(127,212,255,0.16), rgba(127,212,255,0) 62%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.scene:hover {
    border-color: rgba(79,195,247,0.42);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 24px rgba(79,195,247,0.15);
}

.scene:hover::before {
    opacity: 1;
}

.scene-no {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: rgba(127,212,255,0.45);
    font-family: "SF Mono", "Consolas", monospace;
    margin-bottom: 0.5rem;
}

.scene h3 {
    font-size: 1.08rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 0.25rem;
    letter-spacing: 0.16em;
}

.scene-py {
    font-size: 0.72rem;
    color: rgba(127,212,255,0.55);
    letter-spacing: 0.1em;
    margin-bottom: 0.85rem;
    font-style: italic;
}

.scene-desc {
    font-size: 0.83rem;
    line-height: 1.95;
    color: rgba(198,210,220,0.82);
    letter-spacing: 0.02em;
}

.scene-tags {
    display: flex;
    gap: 0.4rem;
    margin-top: 1.05rem;
}

.scene-tags span {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: rgba(127,212,255,0.8);
    border: 1px solid rgba(79,195,247,0.28);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
}

/* === 遊覽路線 === */
.route-list {
    display: grid;
    gap: 1rem;
}

.route {
    background: rgba(11, 22, 34, 0.72);
    border: 1px solid rgba(79,195,247,0.14);
    border-radius: 10px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease;
}

.route:hover {
    border-color: rgba(79,195,247,0.38);
}

.route-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.route-head h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.18em;
}

.route-time {
    font-size: 0.72rem;
    color: rgba(127,212,255,0.7);
    letter-spacing: 0.12em;
    font-family: "SF Mono", "Consolas", monospace;
    white-space: nowrap;
}

.route-path {
    font-size: 0.86rem;
    color: rgba(127,212,255,0.95);
    letter-spacing: 0.08em;
    line-height: 2;
    margin-bottom: 0.7rem;
}

.route-note {
    font-size: 0.82rem;
    line-height: 1.95;
    color: rgba(198,210,220,0.75);
}

/* === 詩詞 === */
.poem {
    text-align: center;
    padding: 2.8rem 2rem;
    background: rgba(11, 22, 34, 0.6);
    border: 1px solid rgba(79,195,247,0.12);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.poem blockquote {
    font-size: 1.1rem;
    line-height: 2.2;
    color: rgba(198,210,220,0.9);
    font-style: italic;
    margin-bottom: 1.4rem;
    letter-spacing: 0.1em;
}

/* 第二首詩與前一首留白分隔 */
.poem blockquote.poem-alt {
    margin-top: 2.4rem;
    padding-top: 2.4rem;
    border-top: 1px solid rgba(79,195,247,0.12);
}

.poem cite {
    display: block;
    font-size: 0.85rem;
    color: rgba(127,212,255,0.6);
    font-style: normal;
    letter-spacing: 0.2em;
}

/* === NAS 折疊區 === */
.nas {
    background: rgba(11, 22, 34, 0.6);
    border: 1px solid rgba(79,195,247,0.14);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.nas summary {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.5rem;
    cursor: pointer;
    list-style: none;
    transition: background 0.25s ease;
}

.nas summary::-webkit-details-marker {
    display: none;
}

.nas summary:hover {
    background: rgba(79,195,247,0.07);
}

.nas-title {
    font-size: 0.9rem;
    color: #fff;
    letter-spacing: 0.24em;
}

.nas-hint {
    font-size: 0.72rem;
    color: rgba(127,212,255,0.5);
    letter-spacing: 0.14em;
}

.nas summary::after {
    content: '▾';
    margin-left: auto;
    color: rgba(127,212,255,0.6);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.nas[open] summary::after {
    transform: rotate(180deg);
}

.nas[open] .card-grid {
    padding: 0 1.5rem 1.5rem;
}

/* === 卡片（NAS 折疊區內） === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.card {
    background: rgba(11, 22, 34, 0.72);
    border: 1px solid rgba(79,195,247,0.14);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.card:hover {
    background: rgba(79,195,247,0.12);
    border-color: rgba(79,195,247,0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 24px rgba(79,195,247,0.15);
}

.card-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 0.95rem; margin-bottom: 0.4rem; color: #fff; font-weight: 500; }
.card p { font-size: 0.8rem; color: var(--text-dim); }

footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2.5rem 0 3rem;
    color: #64798d;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    /* 頁腳不在 .content 裡，沒有底襯，three.js 的水面反光會從這裡透出來 */
    background: linear-gradient(180deg, rgba(8,18,30,0.84) 0%, rgba(6,14,24,0.96) 100%);
}

footer p {
    margin-bottom: 0.5rem;
}

footer .footer-sub {
    font-size: 0.7rem;
    letter-spacing: 0.36em;
    color: rgba(127,212,255,0.42);
}

/* === 條款 / 隱私頁 === */
.policy {
    background: rgba(11, 22, 34, 0.72);
    border: 1px solid rgba(79,195,247,0.14);
    border-radius: 10px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    line-height: 1.9;
}

.policy h3 {
    margin: 1.8rem 0 0.6rem;
    color: rgba(127,212,255,0.9);
    font-size: 1rem;
    font-weight: 500;
}

.policy p { color: #c6d2dc; font-size: 0.92rem; }
.policy ul { margin: 0.5rem 0 0 1.4rem; color: #c6d2dc; font-size: 0.92rem; }
.policy li { margin: 0.3rem 0; }
.policy a, footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 768px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 2.6rem; }
    .scene-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
    .poem { padding: 2.2rem 1.4rem; }
}

@media (max-width: 480px) {
    .content { padding: 3rem 1rem 1rem; }
    h1 { font-size: 2rem; letter-spacing: 0.5em; padding-left: 0.5em; }
    .logo { flex-direction: column; gap: 0.75rem; }
    .card-grid { grid-template-columns: 1fr; }
    .policy { padding: 1.5rem; }
    .scene-grid { grid-template-columns: 1fr; }
    .section-lead { margin-bottom: 1.6rem; }
    .scroll-hint { bottom: 2rem; letter-spacing: 0.3em; padding-left: 0.3em; }
    .nas summary { padding: 1rem 1.1rem; }
    .nas[open] .card-grid { padding: 0 1.1rem 1.1rem; }
    .route-path { font-size: 0.8rem; letter-spacing: 0.04em; }
    /* 窄屏副標題要收窄，否則字距一大就會壓到 three.js 場景裡的雷峰塔 */
    .subtitle { font-size: 0.95rem; letter-spacing: 0.26em; padding-left: 0.26em; }
    .subtitle-en { font-size: 0.66rem; letter-spacing: 0.22em; padding-left: 0.22em; }
}

/* 尊重系統的減少動態偏好：關掉巡游以外的裝飾動畫，避免前庭不適 */
@media (prefers-reduced-motion: reduce) {
    .scroll-hint { animation: none; }
    .scene, .card, .route { transition: none; }
}
