:root {
  --paper: #f7f0e5;
  --paper-deep: #eadac7;
  --ink: #3d2b25;
  --muted-ink: #8e766a;
  --cocoa: #6f4638;
  --rosewood: #a96f61;
  --line: rgba(104, 70, 56, 0.14);
  --card-shadow: 0 18px 45px rgba(79, 51, 39, 0.12);
  --font-editorial: "Songti SC", "STSong", "Noto Serif SC", serif;
}

html {
  background: #d8cbbb;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 7%, rgba(255,255,255,.8) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 12%, rgba(169,111,97,.1), transparent 30%),
    linear-gradient(180deg, #fbf6ee 0%, var(--paper) 55%, #f0e4d5 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background:
    radial-gradient(circle at 20% 30%, rgba(99,67,51,.06) 0 1px, transparent 1.5px) 0 0 / 23px 23px,
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.65) 0 1px, transparent 1.5px) 0 0 / 31px 31px;
}

.sky { display: none; }

#app {
  max-width: 460px;
  padding: max(22px, env(safe-area-inset-top)) 20px max(42px, env(safe-area-inset-bottom));
}

.view { animation: editorialIn .38s cubic-bezier(.2,.75,.25,1); }

@keyframes editorialIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.changelog-btn {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  right: 0;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, .82);
  box-shadow: 0 8px 24px rgba(79, 51, 39, .08);
  backdrop-filter: blur(14px);
}

.changelog-btn-icon { font-size: 1.12rem; }

.hero {
  min-height: 214px;
  padding: 10px 74px 30px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.hero-kicker {
  order: 0;
  margin: 0 0 12px;
  color: var(--rosewood);
  font: 700 .64rem/1.2 var(--font-body);
  letter-spacing: .19em;
}

.hero h1 {
  order: 1;
  font-family: var(--font-editorial);
  font-size: clamp(2.2rem, 10vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.06em;
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
}

.subtitle {
  order: 2;
  margin-top: 12px;
  padding: 0;
  max-width: 260px;
  color: var(--muted-ink);
  font: 400 .84rem/1.7 var(--font-body);
}

.hero-image-wrap {
  position: absolute;
  right: 0;
  bottom: 30px;
  width: 72px;
  height: 72px;
  margin: 0;
}

.hero-image,
.hero-image-wrap--jiujiu .hero-image {
  padding: 0;
  border: 3px solid #fffaf4;
  background: #eedccc;
  box-shadow: 0 10px 28px rgba(83, 54, 42, .15), 0 0 0 1px rgba(95, 62, 48, .08);
  animation: none;
}

.hero-glow { display: none; }

.shelf-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 16px;
  border-top: 1px solid var(--line);
}

.shelf-heading > div > span {
  display: block;
  margin-bottom: 5px;
  color: var(--rosewood);
  font: 700 .58rem/1.2 var(--font-body);
  letter-spacing: .16em;
}

.shelf-heading h2 {
  font: 700 1.38rem/1.25 var(--font-editorial);
  letter-spacing: -.04em;
}

.shelf-count {
  color: var(--muted-ink);
  font-size: .72rem;
  padding-bottom: 3px;
}

.theme-grid,
.theme-grid--two {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.theme-card {
  min-width: 0;
  border: 0;
  border-radius: 22px;
  background: #fffaf4;
  text-align: left;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.theme-card::before { display: none; }

.theme-card:hover { transform: translateY(-3px); box-shadow: 0 22px 48px rgba(79,51,39,.16); }
.theme-card:active { transform: scale(.98); }

.theme-card-visual {
  position: relative;
  width: 100%;
  height: 220px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #ddc9b6;
}

.theme-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.2,.75,.25,1);
}

.theme-card:hover .theme-card-cover { transform: scale(1.035); }

.theme-card-emoji {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 250, 244, .88);
  font-size: 1rem;
  box-shadow: 0 5px 18px rgba(59, 39, 31, .14);
  backdrop-filter: blur(10px);
}

.theme-card-body { padding: 16px 14px 18px; }

.theme-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font: 700 1.4rem/1.25 var(--font-editorial);
  letter-spacing: -.04em;
  text-shadow: none;
}

.theme-card p {
  min-height: 2.8em;
  color: var(--muted-ink);
  font-size: .72rem;
  line-height: 1.45;
}

.theme-card .story-count {
  margin-top: 11px;
  padding: 0;
  border-radius: 0;
  color: var(--cocoa);
  background: none;
  font-size: .64rem;
  letter-spacing: -.01em;
}

.back-btn {
  min-height: 42px;
  margin-bottom: 18px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cocoa);
  background: rgba(255,250,244,.84);
  box-shadow: 0 6px 20px rgba(79,51,39,.06);
}

.list-header,
.changelog-header { text-align: left; padding: 8px 4px 22px; }

.list-header .theme-icon,
.changelog-header-icon { font-size: 1.5rem; margin-bottom: 10px; }

.list-header h2,
.changelog-header h2 {
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: currentColor;
  font: 700 2rem/1.2 var(--font-editorial);
  letter-spacing: -.05em;
}

.list-header p,
.changelog-subtitle {
  margin-top: 8px;
  padding: 0;
  color: var(--muted-ink);
}

.story-list { gap: 10px; }

.story-item,
.changelog-day {
  border: 1px solid rgba(104,70,56,.1);
  border-radius: 18px;
  background: rgba(255,250,244,.9);
  box-shadow: 0 8px 24px rgba(79,51,39,.07);
}

.story-item { min-height: 76px; padding: 14px; gap: 12px; }

.story-item .num {
  width: 38px;
  height: 38px;
  background: #efe2d4;
  color: var(--cocoa);
  font-family: var(--font-editorial);
}

.story-item .info h4 { color: var(--ink); font-weight: 700; }
.story-duration-text,
.story-item .info span { color: var(--muted-ink); }
.story-item .arrow { color: var(--rosewood); }

.player-card {
  border: 1px solid rgba(104,70,56,.1);
  border-radius: 24px;
  background: rgba(255,250,244,.92);
  box-shadow: var(--card-shadow);
}

.player-mini-avatar { border-color: #fffaf4; box-shadow: 0 7px 20px rgba(79,51,39,.12); }

.player-meta h2,
#player-title {
  color: var(--ink);
  font-family: var(--font-editorial);
  letter-spacing: -.04em;
  text-shadow: none;
}

.story-text-wrap {
  margin: 0 16px 12px;
  border: 1px solid rgba(104,70,56,.09);
  background: #fcf6ed;
}

.story-text { color: #4d3830; font-family: var(--font-editorial); line-height: 2.05; }
.story-text .sentence.reading { color: var(--ink); background: #eed9c7; }

.progress-fill { background: linear-gradient(90deg, #c98e78, #7d5143); }
.ctrl-btn { color: var(--ink); border-color: #fffaf4; background: #f8eee3; box-shadow: 0 6px 16px rgba(79,51,39,.12); }
.play-btn,
.play-btn:hover:not(:disabled) { color: #fff; background: linear-gradient(145deg, #b87966, #75493c); box-shadow: 0 8px 24px rgba(111,70,56,.3); }
.play-btn.paused { background: linear-gradient(145deg, #c7927c, #805748); }

@media (max-width: 390px) {
  #app { padding-inline: 16px; }
  .hero { min-height: 200px; }
  .theme-card-visual { height: 190px; }
  .theme-card-body { padding-inline: 12px; }
  .theme-card p { font-size: .68rem; }
}

@media (min-width: 700px) {
  body { border-inline: 1px solid rgba(91,61,47,.08); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
