:root {
  --canvas: #f2f7f3;
  --surface: #ffffff;
  --ink: #163130;
  --muted: #5f7775;
  --line: #d8e6df;
  --sea: #247b74;
  --sea-deep: #145f5b;
  --mint: #bde7da;
  --coral: #f27a61;
  --yellow: #f7c94a;
  --shadow: 0 14px 30px rgba(35, 91, 81, 0.13);
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
body { min-width: 320px; margin: 0; background: var(--canvas); color: var(--ink); }
body.eye-care { --canvas: #f5f1e7; --surface: #fffcf6; --ink: #3c3424; --muted: #756a53; --line: #e4d9be; --sea: #6e7250; --sea-deep: #555b39; --mint: #e6dcbd; }
body.eye-care img, body.eye-care video { filter: sepia(0.16) saturate(0.8) brightness(0.93); }

.app-shell { width: min(100%, 1120px); min-height: 100dvh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) clamp(18px, 4vw, 44px) calc(86px + env(safe-area-inset-bottom)); }
.topbar { height: 54px; display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(18px, 3vw, 30px); }
.brand, .icon-button, .text-action, .nav-item, .filter, .sound-button, .control-button, .main-play, .featured-story, .story-card, .hold-to-enter, .quiet-switch { border: 0; cursor: pointer; }
.brand { display: inline-flex; align-items: center; gap: 9px; padding: 4px 0; color: var(--ink); background: transparent; font-size: 17px; font-weight: 800; letter-spacing: 0; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 11px 11px 11px 4px; color: #fff; background: var(--sea); font-family: Georgia, serif; font-size: 17px; transform: rotate(-5deg); }
.top-actions { display: flex; gap: 8px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; color: var(--sea-deep); border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,0.74); }
.icon-button svg { width: 20px; height: 20px; stroke-width: 2.2; }

.screen { display: none; animation: appear 220ms ease both; }
.screen.is-active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.welcome-row, .section-heading, .parent-title-row, .parent-list-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.kicker { margin: 0 0 6px; color: var(--sea); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 5vw, 48px); line-height: 1.04; letter-spacing: 0; }
h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.sun-counter { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; padding: 10px 12px; color: #946d05; border: 1px solid #eedb8e; border-radius: 15px; background: #fff8d7; }
.sun-counter svg { width: 18px; color: #e8ad1a; }

.featured-story { position: relative; width: 100%; height: min(47vw, 420px); min-height: 278px; overflow: hidden; margin-top: 22px; padding: 0; text-align: left; border-radius: 8px; background: #badfd8; box-shadow: var(--shadow); isolation: isolate; }
.featured-story img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; transition: transform 550ms ease; }
.featured-story:hover img { transform: scale(1.025); }
.featured-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,46,45,0.68), rgba(7,46,45,0.08) 68%); }
.featured-copy { position: absolute; z-index: 1; left: clamp(20px, 4vw, 48px); bottom: clamp(22px, 4vw, 44px); display: grid; gap: 8px; color: #fff; }
.featured-copy strong { font-family: Georgia, "Songti SC", serif; font-size: clamp(35px, 7vw, 66px); letter-spacing: 0; line-height: 0.95; }
.featured-copy small { font-size: 14px; font-weight: 700; }
.pill { width: fit-content; margin: 0; padding: 5px 8px; color: #fff; border: 1px solid rgba(255,255,255,0.42); border-radius: 5px; background: rgba(9,53,51,0.23); font-size: 10px; font-weight: 900; letter-spacing: 0.08em; }
.play-disc { position: absolute; z-index: 1; right: clamp(20px, 4vw, 48px); bottom: clamp(20px, 4vw, 44px); width: 64px; height: 64px; display: grid; place-items: center; color: var(--sea-deep); border-radius: 50%; background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.play-disc svg { width: 27px; margin-left: 3px; fill: currentColor; }

.phrase-card { position: relative; display: grid; gap: 4px; margin-top: 18px; padding: 20px 62px 20px 21px; border: 1px solid #f1dfab; border-radius: 8px; background: #fff9e4; }
.phrase-card p { margin-bottom: 0; color: #806c31; font-size: 13px; font-weight: 700; }
.phrase-card strong { color: #504217; font-family: Georgia, "Songti SC", serif; font-size: clamp(21px, 3vw, 30px); letter-spacing: 0; }
.sound-button { position: absolute; top: 50%; right: 18px; width: 42px; height: 42px; display: grid; place-items: center; color: #7f6420; border: 1px solid #ead68e; border-radius: 50%; background: #fff; transform: translateY(-50%); }
.sound-button svg { width: 19px; }
.content-section { margin-top: 31px; }
.section-heading { align-items: center; margin-bottom: 13px; }
.text-action { padding: 6px 0; color: var(--sea); background: transparent; font-size: 13px; font-weight: 850; }
.story-row { display: grid; grid-auto-columns: minmax(150px, 1fr); grid-auto-flow: column; gap: 13px; overflow-x: auto; padding-bottom: 7px; scrollbar-width: none; }
.story-row::-webkit-scrollbar { display: none; }
.story-card { position: relative; min-height: 172px; overflow: hidden; padding: 0; color: #fff; text-align: left; border-radius: 7px; background: var(--sea); }
.story-card img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.story-card::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg, rgba(12,45,43,0.72), transparent 65%); }
.story-card .card-copy { position: relative; z-index: 1; display: block; padding: 15px; margin-top: 105px; }
.story-card strong, .story-card small { display: block; }
.story-card strong { font-size: 16px; }
.story-card small { margin-top: 3px; opacity: 0.82; font-size: 11px; }
.story-card.placeholder { display: flex; flex-direction: column; justify-content: end; padding: 15px; background: var(--placeholder); }
.story-card.placeholder::after { display: none; }
.story-card.placeholder i { position: absolute; top: 17px; left: 17px; color: rgba(255,255,255,0.82); }

.library-head { margin-top: 11px; }
.filter-strip { display: flex; gap: 8px; margin-top: 23px; overflow-x: auto; }
.filter { padding: 9px 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 800; white-space: nowrap; }
.filter.is-selected { color: #fff; border-color: var(--sea); background: var(--sea); }
.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 21px; }
.library-grid .story-card { min-height: min(31vw, 245px); }
.library-grid .story-card .card-copy { margin-top: auto; position: absolute; bottom: 0; width: 100%; }

.stars-stage { position: relative; min-height: min(61vw, 520px); overflow: hidden; padding: clamp(32px, 7vw, 64px); border-radius: 8px; color: #fff; background: #194f4d; }
.stars-stage .kicker { position: relative; z-index: 1; color: #bde7da; }
.stars-stage h1, .stars-stage p, .star-total { position: relative; z-index: 1; }
.stars-stage h1 { max-width: 300px; }
.stars-stage > p:last-child { max-width: 270px; margin: 18px 0 0; color: #cae1dd; font-size: 14px; }
.star-total { display: block; margin-top: 20px; color: var(--yellow); font-family: Georgia, serif; font-size: clamp(80px, 15vw, 160px); line-height: 0.8; }
.stars-orbit { position: absolute; top: 8%; right: 7%; width: min(48vw, 350px); aspect-ratio: 1; border: 1px solid rgba(255,255,255,0.17); border-radius: 50%; transform: rotate(-14deg); }
.stars-orbit::before, .stars-orbit::after { position: absolute; inset: 20%; content: ""; border: 1px solid rgba(255,255,255,0.14); border-radius: 50%; }
.stars-orbit::after { inset: 39%; }
.stars-orbit span { position: absolute; width: 16px; height: 16px; background: var(--yellow); clip-path: polygon(50% 0%, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0% 50%, 39% 35%); }
.stars-orbit span:nth-child(1) { top: 11%; left: 49%; }.stars-orbit span:nth-child(2) { top: 41%; right: -4%; }.stars-orbit span:nth-child(3) { bottom: 11%; left: 48%; }.stars-orbit span:nth-child(4) { left: -4%; top: 41%; }.stars-orbit span:nth-child(5) { left: 47%; top: 46%; background: #fff; }
.tiny-moments { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.tiny-moments div { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 13px; font-weight: 750; }.tiny-moments svg { width: 18px; color: var(--coral); }

.bottom-nav { position: fixed; z-index: 20; right: max(14px, env(safe-area-inset-right)); bottom: max(13px, env(safe-area-inset-bottom)); left: max(14px, env(safe-area-inset-left)); width: min(calc(100% - 28px), 440px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 0 auto; padding: 7px; border: 1px solid rgba(216,230,223,0.9); border-radius: 18px; background: rgba(255,255,255,0.9); box-shadow: 0 14px 34px rgba(25,79,77,0.18); backdrop-filter: blur(12px); }
.nav-item { display: grid; place-items: center; gap: 3px; min-height: 54px; color: #69817f; border-radius: 12px; background: transparent; font-size: 11px; font-weight: 800; }.nav-item svg { width: 19px; }.nav-item.is-selected { color: var(--sea-deep); background: var(--mint); }

dialog { max-width: none; max-height: none; padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(8, 35, 34, 0.56); backdrop-filter: blur(3px); }
.player-dialog { width: min(100%, 1120px); height: min(100dvh, 820px); margin: auto; color: #fff; background: #082826; }.player-dialog[open] { display: grid; place-items: center; }.player-surface { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: end; overflow: hidden; padding: 28px clamp(20px, 5vw, 58px) clamp(30px, 5vw, 55px); }.player-surface::before { position: absolute; z-index: 0; inset: 0; content: ""; background: linear-gradient(180deg, rgba(1,19,18,0.35), transparent 38%, rgba(1,19,18,0.87)); pointer-events: none; }.player-surface video { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #082826; }.player-close { position: absolute; z-index: 2; top: 18px; left: clamp(18px, 4vw, 42px); color: #fff; border-color: rgba(255,255,255,0.35); background: rgba(0,0,0,0.2); }.player-meta, .progress-wrap, .player-controls, .caption { position: relative; z-index: 1; }.player-meta { display: flex; align-items: center; justify-content: space-between; }.player-meta h2 { font-family: Georgia, "Songti SC", serif; font-size: clamp(32px, 6vw, 54px); }.player-meta .icon-button { color: #fff; border-color: rgba(255,255,255,0.35); background: rgba(0,0,0,0.18); }.caption { align-self: center; margin: 0 auto 18px; padding: 7px 12px; color: #fff; border-radius: 5px; background: rgba(0,0,0,0.38); font-size: 17px; font-weight: 800; }.caption.is-hidden { display: none; }.progress-wrap { margin-top: 17px; }.progress-wrap input { width: 100%; height: 5px; accent-color: var(--yellow); cursor: pointer; }.progress-wrap div { display: flex; justify-content: space-between; margin-top: 4px; color: #d7e6e2; font-size: 12px; }.player-controls { display: flex; align-items: center; justify-content: center; gap: 23px; margin-top: 15px; }.control-button, .main-play { display: grid; place-items: center; color: #fff; background: transparent; }.control-button svg { width: 24px; }.main-play { width: 58px; height: 58px; color: var(--sea-deep); border-radius: 50%; background: #fff; }.main-play svg { width: 27px; }.main-play svg[data-lucide="play"] { margin-left: 3px; fill: currentColor; }
.touch-lock { position: absolute; z-index: 9; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(4,28,27,0.79); }.touch-lock[hidden] { display: none; }.touch-lock div { display: grid; place-items: center; gap: 14px; text-align: center; }.touch-lock svg { width: 46px; height: 46px; color: var(--yellow); }.touch-lock p { margin: 0; font-size: 20px; font-weight: 800; }.unlock-hold { min-width: 156px; padding: 12px 18px; color: #fff; border: 1px solid rgba(255,255,255,0.45); border-radius: 7px; background: transparent; font-weight: 800; }

.parent-dialog { width: min(calc(100% - 32px), 580px); max-height: calc(100dvh - 28px); margin: auto; overflow: auto; background: var(--surface); border-radius: 8px; color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,0.28); }.parent-sheet { position: relative; padding: clamp(25px, 6vw, 42px); }.parent-gate { min-height: 380px; display: grid; place-items: center; align-content: center; text-align: center; }.parent-gate[hidden], .parent-panel[hidden] { display: none; }.dialog-close { position: absolute; top: 16px; right: 16px; }.gate-mark { width: 49px; height: 49px; margin-bottom: 18px; color: var(--sea); }.parent-gate h2 { font-family: Georgia, "Songti SC", serif; font-size: 32px; }.hold-to-enter { position: relative; width: 170px; height: 54px; overflow: hidden; margin-top: 25px; color: #fff; border-radius: 7px; background: var(--sea); font-weight: 850; }.hold-to-enter b { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--coral); transition: width 1.5s linear; }.hold-to-enter span { position: relative; z-index: 1; }.hold-to-enter.is-holding b { width: 100%; }.parent-panel { min-height: 520px; }.parent-title-row { align-items: start; }.parent-title-row h2 { font-family: Georgia, "Songti SC", serif; font-size: 30px; }.parent-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 27px 0; }.parent-summary div { padding: 17px; border-radius: 7px; background: #eaf6f2; }.parent-summary span, .parent-summary small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }.parent-summary strong { display: block; margin: 4px 0; color: var(--sea-deep); font-family: Georgia, serif; font-size: 32px; }.parent-list { padding-top: 4px; border-top: 1px solid var(--line); }.parent-list-heading { align-items: center; padding: 17px 0 10px; }.parent-list-heading h3 { margin: 0; font-size: 15px; }.status-dot { padding: 4px 7px; color: #267052; border-radius: 5px; background: #daf2e5; font-size: 11px; font-weight: 800; }.parent-list article { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }.parent-list article > svg { flex: 0 0 auto; width: 19px; margin-top: 3px; color: var(--sea); }.parent-list strong, .parent-list small { display: block; }.parent-list strong { font-size: 14px; }.parent-list small { margin-top: 3px; color: var(--muted); font-size: 12px; }.quiet-switch { width: 100%; display: flex; align-items: center; gap: 10px; margin-top: 19px; padding: 13px 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: transparent; text-align: left; font-size: 14px; font-weight: 800; }.quiet-switch svg { width: 18px; color: var(--sea); }.quiet-switch b { width: 34px; height: 20px; position: relative; margin-left: auto; border-radius: 20px; background: #b8cac4; }.quiet-switch b::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; content: ""; border-radius: 50%; background: #fff; transition: transform 180ms ease; }.eye-care .quiet-switch b { background: var(--sea); }.eye-care .quiet-switch b::after { transform: translateX(14px); }

.toast { position: fixed; z-index: 30; bottom: calc(87px + env(safe-area-inset-bottom)); left: 50%; max-width: calc(100% - 36px); padding: 10px 14px; color: #fff; border-radius: 6px; background: rgba(19,51,48,0.95); box-shadow: 0 9px 25px rgba(0,0,0,0.17); font-size: 13px; font-weight: 800; opacity: 0; transform: translate(-50%, 12px); transition: opacity 180ms ease, transform 180ms ease; pointer-events: none; }.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) { .story-row { grid-auto-columns: minmax(190px, 1fr); }.featured-story { height: min(45vw, 440px); }.library-grid { grid-template-columns: repeat(4, 1fr); }.bottom-nav { position: sticky; bottom: 16px; margin: 28px auto 0; }.app-shell { padding-bottom: 20px; }.toast { bottom: 30px; } }
@media (max-width: 430px) { .featured-story { min-height: 260px; }.library-grid { grid-template-columns: repeat(2, 1fr); }.library-grid .story-card { min-height: 200px; }.parent-sheet { padding: 26px 22px; }.stars-stage { min-height: 415px; }.stars-orbit { width: 230px; }.player-dialog { height: 100dvh; }.player-surface { padding-bottom: 42px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
