:root {
    --text: #eaeaea;
    --muted: #a0a0a8;
    --accent: #0071e3;
    --overlay: rgba(0, 0, 0, 0.45);
    --panel-blur: 12px;
    --radius: 18px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    --header-h: 64px;
    --border: rgba(255, 255, 255, 0.12);
    --glow: rgba(0, 113, 227, 0.45);
    --card: rgba(15, 18, 32, 0.9);
    --fg: #f5f5f7;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

/* Base */
body {
    margin: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-color: #000;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top));
}

/* Top navigation */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: 64px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    backdrop-filter: blur(var(--panel-blur));
    background: rgba(10, 10, 10, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    justify-self: start;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .3px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    transition: 0.2s;
}

.brand:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

.menu {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.menu a {
    color: var(--text);
    text-decoration: none;
    opacity: .85;
}

.menu a:hover {
    opacity: 1;
}

.contact-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    text-decoration: none;
    transition: 0.25s ease;
}

.contact-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 通用页面容器：所有页面主内容区建议包一层 .page */
.page {
    padding-top: var(--header-h);
}

/* Scroll stack container（如果某些页面用到全屏滚动） */
.stack {
    position: relative;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

/* Fullscreen panels that overlap as you scroll */
.panel {
    position: sticky;
    top: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    text-align: center;
    scroll-snap-align: start;
    overflow: hidden;
}

@media (max-width: 768px) {
    .panel {
        position: relative;
        scroll-snap-align: none;
    }
}

.plain {
    background: #000;
}

/* Background for image panels */
.image {
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
}

/* Background for video panels */
.bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Subtle dark overlay so text always reads */
.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--overlay);
    z-index: 1;
    pointer-events: none;
}

/* Centered text block */
.text {
    position: relative;
    z-index: 2;
    max-width: 680px;
    padding: 24px;
    filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.6));
    animation: rise 700ms ease both;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

h1,
h2 {
    margin: 0 0 10px;
    font-size: clamp(32px, 5.5vw, 64px);
    letter-spacing: -0.02em;
}

p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: clamp(16px, 2.2vw, 20px);
}

/* CTA buttons */
.cta {
    display: inline-block;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 113, 227, 0.35);
    transition: transform .15s ease, opacity .2s ease;
}

.cta:hover {
    transform: translateY(-1px);
    opacity: .95;
}

/* Responsive tweaks */
@media (max-width: 960px) {
    .text {
        padding: 18px;
    }
}

/* Spotify embed styling */
.spotify-wrap {
    position: relative;
    border-radius: 16px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(122, 166, 255, .18), rgba(122, 166, 255, 0));
    box-shadow: 0 0 0 1px var(--border), 0 16px 60px -30px var(--glow);
    animation: breathe 6s ease-in-out infinite;
}

.spotify-wrap iframe {
    display: block;
    border: 0;
    width: 100%
}

@keyframes breathe {

    0%,
    100% {
        box-shadow: 0 0 0 1px var(--border), 0 16px 60px -30px var(--glow)
    }

    50% {
        box-shadow: 0 0 0 1px var(--border), 0 22px 90px -28px var(--glow)
    }
}

/* Featured grid（适合 music / movies / books 等） */
.section--grid {
    padding-top: 16px
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width:1000px) {
    .grid-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:720px) {
    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:460px) {
    .grid-cards {
        grid-template-columns: 1fr;
    }
}

/* 通用卡片（grid 用） */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.card__link {
    display: block;
    color: inherit;
    text-decoration: none
}

.card__img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #0f1220;
}

.card__body {
    padding: 14px 14px 16px
}

.card__title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600
}

.card__meta {
    margin: 0;
    color: var(--muted);
    font-size: 13px
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(122, 166, 255, .35);
    box-shadow: 0 16px 50px -28px var(--glow);
}

/* Quotes with CSS-only crossfade */
.quotes {
    position: relative;
    min-height: 40px;
    padding: 12px 0 4px;
}

.quote {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    opacity: 0;
    animation: quoteCycle 18s infinite;
    padding: 0 12px;
}

.quote.q1 {
    animation-delay: 0s
}

.quote.q2 {
    animation-delay: 6s
}

.quote.q3 {
    animation-delay: 12s
}

@keyframes quoteCycle {
    0% {
        opacity: 0;
        transform: translateY(6px)
    }

    6% {
        opacity: 1;
        transform: none
    }

    28% {
        opacity: 1
    }

    33% {
        opacity: 0
    }

    100% {
        opacity: 0
    }
}

/* Pill links */
.section--links {
    padding-top: 12px
}

.pill-links {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-links a {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .02);
    color: var(--fg);
    text-decoration: none;
    font-size: 14px;
    transition: border-color .25s ease, background .25s ease;
}

.pill-links a:hover {
    border-color: rgba(122, 166, 255, .35);
    background: rgba(122, 166, 255, .08);
}

/* Footer */
.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0;
    color: var(--muted);
}

.tiny-link {
    color: var(--muted);
    text-decoration: none
}

.tiny-link:hover {
    color: var(--fg)
}

footer {
    text-align: center;
    padding: 40px 0;
    color: #666;
    font-size: 0.9em;
}

/* Now playing card（music 页专用） */
.nowplaying-card {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(122, 166, 255, .10), rgba(122, 166, 255, 0));
    box-shadow: 0 10px 40px -24px var(--glow);
}

.np-cover {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    background: #0f1220 center/cover no-repeat;
    flex: 0 0 auto;
}

.np-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0
}

.np-title {
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.np-artist,
.np-album {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.recent-grid .card__img {
    height: 160px
}

/* Hero & section layout（music 页面顶部 + 其他页面可共用） */
.hero {
    text-align: center;
    padding: 80px 20px 40px;
}


/* Quiz cards */
.quiz .q-block {
    background: rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 28px;
}

.q-block h3 {
    margin: 0 0 16px;
    font-size: 1.25rem;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

/* Quiz里的卡片用 .options .card，避免影响全局 grid-cards */
.options .card {
    display: block;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
    user-select: none;
}

.options .card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.options .card.selected {
    outline: none;
    border-color: #1db954;
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.4);
}

.options .card input[type="radio"] {
    display: none;
}

.options .card .card-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #222;
    margin-bottom: 6px;
}

.avatar.has-img::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--avatar);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

/* Buttons and results */
.submit-btn {
    margin-top: 12px;
    padding: 10px 18px;
    background: #1db954;
    border: none;
    color: white;
    border-radius: 10px;
    font-weight: 650;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.submit-btn:hover {
    background: #18a34a;
}

.result {
    margin-top: 10px;
    font-style: italic;
    color: #ccc;
}

/* Animations for quiz feedback */
.correct {
    color: #1db954;
    text-shadow: 0 0 8px rgba(29, 185, 84, 0.75);
}

.wrong {
    color: #ff6b6b;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.shake {
    animation: shake 0.5s ease;
}

.pulse {
    animation: pulse 0.7s ease-out;
}

.shake-card {
    animation: shake 0.4s ease;
}

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

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

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.5);
    }

    100% {
        box-shadow: 0 0 0 14px rgba(29, 185, 84, 0);
    }
}

/* Recommend block */
.recommend {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    transition: background 0.3s;
}

.recommend:hover {
    background: rgba(255, 255, 255, 0.08);
}

#recommendForm {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 通用 input/textarea/button 样式（目前主要用于 Recommend） */
input,
textarea {
    width: 90%;
    max-width: 520px;
    padding: 12px;
    border-radius: 10px;
    border: none;
    margin-top: 10px;
    font-size: 1em;
    color: #f5f5f7;
    background: rgba(255, 255, 255, 0.08);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

button[type="submit"] {
    margin-top: 15px;
    padding: 10px 25px;
    background: #1db954;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

button[type="submit"]:hover {
    background: #18a34a;
}

/* =========================================================
   UNIVERSAL PAGE LAYOUT FIX
   首页（home-page）继续使用原来的全屏布局
   其他页面使用窄版居中布局（避免被全局设置拉宽）
   ========================================================= */

/* 其他页面的统一内容宽度（music/movies/books/...） */
.page-standard {
    max-width: 980px;
    margin: 0 auto;
    padding: 80px 24px 40px;
}

/* 如果页面 body 上不含 home-page，则自动使用窄版布局 */
body:not(.home-page) .panel,
body:not(.home-page) .stack,
body:not(.home-page) .page {
    width: 100%;
    height: auto;
    position: static;
    scroll-snap-type: none;
}

/* 禁用非首页的 sticky 全屏特性 */
body:not(.home-page) .panel {
    display: block;
    height: auto;
    padding: 0;
    background: none;
}

/* 非首页移除 overlay */
body:not(.home-page) .panel::before {
    display: none;
}

/* 非首页正文容器样式（你以后所有内容写进这个容器里） */
body:not(.home-page) .content-wrapper {
    max-width: 980px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 让 grid-cards 在非首页保持正常宽度，不铺满全屏 */
body:not(.home-page) .grid-cards {
    max-width: 980px;
    margin: 0 auto;
}

/* Hero 在非首页也居中、固定宽度 */
body:not(.home-page) .hero {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px 20px;
}

/* Inline section images */
.section-image {
    width: 100%;
    max-width: 100%;
    display: block;
    margin: 20px 0;
    border-radius: 16px;
    height: auto;
    object-fit: cover;
    box-sizing: border-box;
}

/* 让 hero 里的 h1 永远最大 */
.music-page .hero h1 {
    font-size: 4.8rem !important;
    line-height: 1.2;
    margin-bottom: 10px;
}

/* 让 section 里的 h2 比 h1 小一档 */
.music-page h2 {
    font-size: 3.8rem !important;
    font-weight: 600;
    margin-bottom: 6px;
}

/* style.css（只新增/覆盖 movies 相关即可；你也可以单独建 movies.css） */

.movies-page .page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}

.page-hero {
    margin-bottom: 28px;
}

.page-hero h1 {
    margin: 0 0 10px;
    font-size: 44px;
    letter-spacing: -0.02em;
}

.page-hero p {
    margin: 0;
    max-width: 70ch;
    opacity: 0.85;
    line-height: 1.6;
}

.movie-card {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    padding: 18px;
    margin-top: 18px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
}

.movie-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 6px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.movie-head h2 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.01em;
}

.subtitle {
    margin: 6px 0 0;
    opacity: 0.75;
    line-height: 1.5;
}

.pill {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0.9;
}

.pill:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.movie-body {
    padding: 18px 6px 6px;
}

.split {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: start;
}

.media {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.media img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
}

.content p {
    margin: 0 0 14px;
    opacity: 0.9;
    line-height: 1.7;
    max-width: 75ch;
}

.interactive {
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.14);
}

.interactive h3 {
    margin: 0 0 12px;
    font-size: 16px;
    letter-spacing: 0.01em;
    opacity: 0.95;
}

.slider-row {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 14px;
    align-items: center;
}

.slider {
    width: 100%;
}

.slider-meta .value {
    font-size: 18px;
    margin-bottom: 4px;
}

.slider-meta .hint {
    font-size: 12px;
    opacity: 0.7;
}

.quiz {
    display: grid;
    gap: 10px;

    justify-items: start;
    /* 🔥 关键：grid 子项左对齐 */
    text-align: left;
    /* 防止文字继承居中 */
}


.option {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
}

.option:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.option input {
    accent-color: currentColor;
}

.btn {
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    cursor: pointer;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.10);
}

.result {
    margin: 10px 0 0;
    line-height: 1.6;
    opacity: 0.9;
    min-height: 1.4em;
}

.page-footer {
    margin-top: 24px;
    opacity: 0.65;
    padding: 10px 4px 0;
}

@media (max-width: 920px) {
    .split {
        grid-template-columns: 1fr;
    }

    .media img {
        max-height: 360px;
    }

    .slider-row {
        grid-template-columns: 1fr;
    }
}

/* ===== QUIZ OPTIONS: FORCE LEFT ALIGN ===== */
/* === FORCE quiz option layout === */
.quiz label.option {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
}

.quiz label.option span {
    flex: 1 !important;
    text-align: left !important;
}

.quiz label.option input {
    margin: 2px 0 0 0 !important;
}