:root {
  --ink: #1a1612;
  --muted: #6d645b;
  --paper: #f6f1e8;
  --card: #fffdf8;
  --line: rgba(26, 22, 18, 0.12);
  --seal: #9c2f2f;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow: 0 18px 40px rgba(48, 32, 18, 0.16);
  --tab: 4.6rem;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang HK", "Noto Sans TC", sans-serif;
  line-height: 1.55;
  padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom));
}
button, select, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--seal); }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(0.8rem + env(safe-area-inset-top)) 0 0.2rem;
}
.brand { color: inherit; text-decoration: none; font-weight: 650; letter-spacing: -0.03em; }
.kicker { margin: 0; color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; }
main { width: min(720px, calc(100% - 2rem)); margin: 0 auto; }
h1, h2 {
  font-family: "Iowan Old Style", "New York", "Songti TC", "PMingLiU", serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}
h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); line-height: 1.2; margin: 0.35rem 0 0.4rem; overflow-wrap: anywhere; }
h2 { font-size: 1.35rem; }
.now { text-align: center; padding-top: 0.4rem; }
.cover {
  width: min(78vw, 320px);
  aspect-ratio: 1;
  margin: 0.4rem auto 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--wash, #6e3b2e);
}
.read p { margin: 0.35rem 0; }
.read .current { background: #efe2cc; }
.cover img, .mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.by { margin: 0 0 1rem; color: var(--muted); }
.transport { display: flex; justify-content: center; align-items: center; gap: 1.1rem; }
.play {
  width: 4.6rem; height: 4.6rem; border: 0; border-radius: 50%;
  background: var(--ink); color: #f6f1e8; font: inherit; font-size: 1rem;
}
.skip {
  border: 0; background: transparent; color: var(--ink); font: inherit; min-width: 4.4rem; min-height: 2.8rem;
}
button:active, .play:active, .skip:active { transform: scale(0.97); }
button, .skip, .play { transition: transform 140ms var(--ease-out); }
.scrub { display: grid; grid-template-columns: 3.2rem 1fr 3.2rem; gap: 0.45rem; align-items: center; margin-top: 0.8rem; font-variant-numeric: tabular-nums; font-size: 0.78rem; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--ink); }
.row { display: flex; justify-content: center; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin: 0.8rem 0 0.2rem; }
select, .text-btn {
  font: inherit; color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.8rem; text-decoration: none;
}
.copy { color: var(--muted); }
.shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.8rem;
  list-style: none;
  padding: 0.4rem 0 1rem;
  margin: 0;
}
.shelf a { color: inherit; text-decoration: none; display: grid; gap: 0.45rem; }
.mini {
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(48, 32, 18, 0.12);
  background: var(--wash, #6e3b2e);
}
.shelf small { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.steps { display: grid; gap: 0.7rem; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0.85rem 0.95rem 0.85rem 3rem; position: relative;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0.8rem; top: 0.85rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--paper); font-size: 0.8rem;
}
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(246, 241, 232, 0.92);
  backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  text-align: center; text-decoration: none; color: var(--muted);
  padding: 0.75rem 0.2rem 0.65rem; font-size: 0.82rem;
}
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.yt-form, .yt-list { display: grid; gap: 0.7rem; }
.yt-form label { display: grid; gap: 0.35rem; font-size: 0.92rem; }
.yt-form input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); padding: 0.75rem 0.8rem; font: inherit;
}
.yt-form button, .yt-list button {
  justify-self: start; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper);
  font: inherit; min-height: 2.8rem; padding: 0.45rem 1rem;
}
.yt-list button { background: transparent; color: var(--seal); padding: 0.45rem 0.2rem; }
.yt-player iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; background: #111; }
.yt-list { list-style: none; padding: 0; margin: 1rem 0; }
.yt-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0.7rem 0.8rem;
}
.yt-list a { color: var(--ink); text-decoration: none; }
.yt-list a[aria-current="page"] { font-weight: 650; }
@media (min-width: 720px) {
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  button, .skip, .play { transition: none; }
}
