/* Guide player — museum dark, mobile reading */

html,
body {
  overflow-x: clip;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #141414;
  --bg-2: #1c1c1c;
  --ink: #f2f2f2;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --gold: #c9a46a;
  --pad: 1.15rem;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.shell {
  width: min(430px, 100%);
  margin-inline: auto;
  min-height: 100dvh;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: max(0.55rem, env(safe-area-inset-top, 0px)) var(--pad) 0.7rem;
  background: linear-gradient(#1a1a1a, #141414);
}

.tabs-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.tabs-nav a[aria-current="page"] {
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.15rem;
  margin-left: 0.2rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #3a3a3a;
  color: var(--ink);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  vertical-align: 0.08em;
}

.tools {
  position: relative;
  display: flex;
  gap: 0.35rem;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
}

.icon-btn[aria-expanded="true"] {
  color: var(--gold);
}

.lang-menu {
  position: absolute;
  top: calc(100% - 0.1rem);
  right: 0;
  z-index: 30;
  min-width: 11rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  box-shadow: 0 14px 32px rgb(0 0 0 / 0.45);
}

.lang-menu button {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.62rem 0.7rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.lang-menu button span {
  color: var(--muted);
  font-size: 0.78rem;
}

.lang-menu button[aria-selected="true"] {
  color: var(--gold);
  background: #242424;
}

.lang-menu button[aria-selected="true"] span {
  color: color-mix(in srgb, var(--gold) 70%, var(--muted));
}

.cover-wrap {
  padding: 0.35rem var(--pad) 0.2rem;
  display: flex;
  justify-content: center;
}

.cover {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  border-radius: 0.35rem;
  background: #0d0d0d;
}

.meta {
  text-align: center;
  padding: 1.15rem var(--pad) 0.35rem;
}

.title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.3;
}

.player {
  padding: 0.85rem var(--pad) 0.4rem;
}

.rate-row {
  display: flex;
  justify-content: flex-end;
}

.rate {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 2.25rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
}

.scrub {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.15rem;
}

.time {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: #3f3f3f;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d9d9d9;
  border: 0;
  cursor: pointer;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0 1.25rem;
}

.ctrl {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
}

.ctrl[disabled] {
  opacity: 0.28;
  cursor: default;
}

.play {
  width: 4.5rem;
  height: 4.5rem;
  flex: 0 0 4.5rem;
  border: 0;
  border-radius: 50%;
  background: #ececec;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.play:active {
  transform: scale(0.98);
}

.skip15 {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
}

#back15 {
  margin-left: 0.25rem;
  margin-right: 1.75rem;
}

#fwd15 {
  margin-left: 1.75rem;
  margin-right: 0.25rem;
}

.skip15 svg {
  width: 56px;
  height: 56px;
  display: block;
  overflow: visible;
}

.skip15:hover,
.skip15:active,
.skip15:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none;
}

.skip15:hover {
  filter: brightness(1.18);
}

.skip15:active {
  transform: scale(0.94);
}

.skip15:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold);
}

.content-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  margin-top: 0.2rem;
}

.content-tabs button {
  min-height: 3rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.content-tabs button[aria-selected="true"] {
  color: var(--ink);
}

.tab-rule {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #2f2f2f;
}

.tab-rule i {
  display: block;
  width: 50%;
  height: 2px;
  background: var(--gold);
  transform: translateX(100%);
  transition: transform 180ms var(--ease);
}

.tab-rule[data-tab="intro"] i {
  transform: translateX(0);
}

.panel {
  margin: 0;
  padding: 1.05rem var(--pad) calc(1.5rem + env(safe-area-inset-bottom, 0px));
  border-radius: 0;
  background: #2a2a2a;
  color: #ececec;
  font-size: 0.98rem;
  line-height: 1.85;
}

.panel p {
  margin: 0 0 1rem;
}

.panel p:last-child {
  margin-bottom: 0;
}

.panel[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .tab-rule i,
  .play:active,
  .skip15:active {
    transition: none;
    transform: none;
  }
}

@media (min-width: 720px) {
  body {
    background: #0c0c0c;
  }
  .shell {
    box-shadow: 0 0 0 1px #222;
  }
}
