/* ================================================================
   WHOLAND 網站樣式 — 宇宙暗黑主題
   ================================================================ */

/* ── Reset & Variables ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; }

:root {
    --bg-deep:    #070b1a;
    --bg-card:    rgba(255,255,255,0.05);
    --bg-card-h:  rgba(255,255,255,0.09);
    --border:     rgba(255,255,255,0.10);
    --cyan:       #4fc3f7;
    --cyan-dim:   #29b6f6;
    --gold:       #ffd54f;
    --text:       #e0e8f0;
    --text-muted: #8a9bb0;
    --radius:     12px;
    --shadow:     0 8px 32px rgba(0,0,0,0.5);
    --font:       'Noto Sans TC', 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

/* ── Starfield Canvas ───────────────────────────────────────────── */
#stars-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Layout ─────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-main  { position: relative; z-index: 1; }

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7,11,26,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-star { color: var(--gold); font-size: 18px; }
.logo-text  { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: 2px; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-card); }

/* ── Language Switch ────────────────────────────────────────────── */
.lang-switch { display: flex; align-items: center; }
.lang-btn {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color .2s, border-color .2s;
}
.lang-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all .2s;
    white-space: nowrap;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-primary {
    background: var(--cyan);
    color: #070b1a;
}
.btn-primary:hover { background: #81d4fa; transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-gold {
    background: var(--gold);
    color: #1a1200;
    font-weight: 700;
}
.btn-gold:hover { background: #ffe082; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(255,213,79,0.3); }

.btn-ghost {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--bg-card-h); }

/* ── User Pill ──────────────────────────────────────────────────── */
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 4px 12px 4px 4px;
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.user-name { font-size: 13px; color: var(--text-muted); }

/* ── Mobile Nav ─────────────────────────────────────────────────── */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .3s;
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(7,11,26,0.97);
        border-bottom: 1px solid var(--border);
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .site-nav.open { display: flex; }
    .nav-link { width: 100%; }
    .user-pill { width: 100%; justify-content: space-between; }
}

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
}
.hero-eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--cyan);
    margin-bottom: 20px;
}
.hero-title {
    font-size: clamp(42px, 7vw, 80px);
    font-weight: 700;
    letter-spacing: 6px;
    color: #fff;
    text-shadow: 0 0 60px rgba(79,195,247,0.4);
    margin-bottom: 20px;
    line-height: 1.1;
}
.hero-subtitle {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.8;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(79,195,247,0.1);
    border: 1px solid rgba(79,195,247,0.3);
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--cyan);
    margin-bottom: 28px;
}

/* ── Section ────────────────────────────────────────────────────── */
.section { padding: 60px 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 16px;
    flex-wrap: wrap;
}
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--cyan);
    border-radius: 2px;
}

/* ── Episode Cards ──────────────────────────────────────────────── */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.episode-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
.episode-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79,195,247,0.3);
    box-shadow: 0 12px 40px rgba(79,195,247,0.1);
}

.card-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #111827;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.episode-card:hover .card-thumb img { transform: scale(1.04); }

.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1b3e 0%, #1a1a4e 100%);
    color: var(--text-muted);
    font-size: 40px;
}

.badge-app {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--gold);
    color: #1a1200;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: .5px;
}

.card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

/* ── YouTube Embed ──────────────────────────────────────────────── */
.video-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Episode Page ───────────────────────────────────────────────── */
.episode-layout { max-width: 900px; margin: 0 auto; padding: 40px 20px; }
.episode-title  { font-size: clamp(22px, 4vw, 32px); font-weight: 700; margin: 24px 0 12px; }
.episode-meta   { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.episode-desc   { color: var(--text-muted); line-height: 1.8; font-size: 15px; white-space: pre-line; }

.app-cta {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(79,195,247,0.08) 0%, rgba(255,213,79,0.05) 100%);
    border: 1px solid rgba(79,195,247,0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.app-cta-text h3 { font-size: 16px; margin-bottom: 4px; color: var(--cyan); }
.app-cta-text p  { font-size: 13px; color: var(--text-muted); }

/* ── Auth / Status Pages ────────────────────────────────────────── */
.status-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.status-box {
    max-width: 480px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
}
.status-icon  { font-size: 56px; margin-bottom: 20px; }
.status-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.status-desc  { color: var(--text-muted); font-size: 15px; line-height: 1.8; margin-bottom: 28px; }
.status-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Divider ─────────────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
    margin: 60px 0;
}

/* ── Back Link ───────────────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: color .2s;
    margin-bottom: 24px;
}
.back-link:hover { color: var(--text); }

/* ── Featured App Banner ─────────────────────────────────────────── */
.featured-app {
    background: linear-gradient(135deg, rgba(10,14,39,0.9) 0%, rgba(26,26,78,0.8) 100%);
    border: 1px solid rgba(79,195,247,0.2);
    border-radius: 16px;
    padding: 48px 40px;
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}
.featured-app-info { flex: 1; min-width: 240px; }
.featured-app-info h2 { font-size: 28px; margin-bottom: 12px; color: var(--cyan); }
.featured-app-info p  { color: var(--text-muted); line-height: 1.8; margin-bottom: 24px; }
.featured-app-preview {
    flex: 1;
    min-width: 260px;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #0a0e27, #1a1a4e);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    border: 1px solid var(--border);
}

/* ── Login Prompt Strip ─────────────────────────────────────────── */
.login-strip {
    background: rgba(79,195,247,0.07);
    border: 1px solid rgba(79,195,247,0.2);
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.login-strip p { color: var(--text-muted); font-size: 14px; }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 80px;
}
.footer-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-desc  { color: var(--text-muted); font-size: 14px; }
.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color .2s;
}
.footer-links a:hover { color: var(--cyan); }
.footer-copy { color: #4a5568; font-size: 12px; }

/* ── Debug Banner ───────────────────────────────────────────────── */
.debug-banner {
    background: rgba(255,152,0,0.12);
    border: 1px solid rgba(255,152,0,0.3);
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 13px;
    color: #ffb74d;
    margin: 16px 0;
    font-family: monospace;
}

/* ── Utilities ───────────────────────────────────────────────────── */
.text-cyan   { color: var(--cyan); }
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.mb-32 { margin-bottom: 32px; }

/* ── Visualize Grid ─────────────────────────────────────────────── */
.viz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.viz-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    text-decoration: none;
    color: var(--text);
    transition: background .2s, border-color .2s, transform .15s;
}
.viz-card:hover {
    background: var(--bg-card-h);
    border-color: var(--cyan);
    transform: translateY(-2px);
}
.viz-card-icon  { font-size: 32px; flex-shrink: 0; }
.viz-card-body  { flex: 1; min-width: 0; }
.viz-card-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-all;
}
.viz-card-meta  { display: flex; gap: 8px; flex-wrap: wrap; }
.viz-card-arrow { color: var(--text); font-size: 20px; flex-shrink: 0; }

.viz-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
}
.viz-tag-yt   { background: rgba(255,0,0,0.15); color: #ff6b6b; }
.viz-tag-soon { background: rgba(255,213,79,0.12); color: var(--gold); }

/* ── Visualize List (detail) ────────────────────────────────────── */
.viz-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.viz-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text);
    transition: background .2s, border-color .2s;
}
.viz-item:hover {
    background: var(--bg-card-h);
    border-color: var(--cyan);
}
.viz-icon       { font-size: 24px; flex-shrink: 0; }
.viz-item-info  { flex: 1; min-width: 0; }
.viz-item-name  { display: block; font-size: 15px; font-weight: 500; }
.viz-item-hint  { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.viz-arrow      { color: var(--text); font-size: 18px; flex-shrink: 0; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .episodes-grid { grid-template-columns: 1fr; }
    .featured-app  { padding: 28px 20px; }
    .status-box    { padding: 32px 24px; }
    .hero { padding: 60px 0 50px; }
    .viz-grid      { grid-template-columns: 1fr; }
}
