/* GMMTV 上架通知 — portal styles.
 *
 * Ported from the design mock, which carried everything inline. The values are
 * the mock's; the organisation is not. Tokens first so a colour is stated once,
 * then layout, then components in the order the pages use them.
 *
 * Served by the app itself. No build step, no CDN, no second web server. */

:root {
  --ink: #231a20;          /* near-black, plum-shifted */
  --accent: #a5335c;       /* raspberry: the one colour that means "act" */
  --ground: #fdfcfd;
  --card: #ffffff;
  --sunk: #fbf9fa;
  --blush: #f9f1f4;        /* accent at low strength, for selected states */

  --muted: #6d616a;
  --faint: #8a7c83;
  --ghost: #b5a8ae;

  --line: #ece6e9;
  --line-warm: #efe2e8;
  --line-accent: #e7cdd8;
  --line-soft: #f6f2f4;
  --track: #e3dade;        /* switch, off */

  --shadow-card: 0 4px 16px rgba(35, 26, 32, .06);
  --shadow-row: 0 3px 12px rgba(35, 26, 32, .05);
  --shadow-lift: 0 8px 24px rgba(35, 26, 32, .22);
  --shadow-accent: 0 6px 18px rgba(165, 51, 92, .24);
  --shadow-poster: 0 24px 48px rgba(35, 26, 32, .18);

  --pill: 999px;
  --r-card: 18px;
  --r-panel: 20px;
  --r-banner: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.65 "Noto Sans TC", "Prompt", system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { text-wrap: pretty; }
input::placeholder { color: var(--ghost); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 28px 96px; }
.wrap.narrow { max-width: 760px; }
.wrap.tight { max-width: 640px; }

/* --- Header ------------------------------------------------------------- */

.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-warm);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand .word { font: 800 22px/1 "Prompt", sans-serif; letter-spacing: .5px; }
.brand .badge {
  font: 700 11px/1 "Noto Sans TC", sans-serif;
  color: #fff; background: var(--accent);
  border-radius: var(--pill); padding: 4px 10px; letter-spacing: 1px;
}
.bar nav {
  margin-left: auto;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.bar nav a {
  padding: 8px 16px; border-radius: var(--pill);
  font-weight: 500; color: var(--muted);
}
.bar nav a:hover { background: var(--blush); color: var(--accent); }
.bar nav a[aria-current="page"] {
  background: var(--accent); color: #fff; font-weight: 700;
}
.signout {
  border: 0; background: none; color: var(--faint);
  padding: 8px 10px; cursor: pointer; font-size: 14px;
}
.signout:hover { color: var(--accent); }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  border: 0; border-radius: var(--pill); cursor: pointer;
  font: 700 15px/1 "Noto Sans TC", sans-serif;
  padding: 12px 26px;
  background: var(--accent); color: #fff;
  box-shadow: var(--shadow-accent);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost {
  background: var(--card); color: var(--faint);
  border: 1.5px solid var(--line); box-shadow: none;
  font-weight: 600; font-size: 13px; padding: 9px 18px;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.following {
  background: var(--blush); color: var(--accent);
  border: 1.5px solid var(--line-accent); box-shadow: none;
}
.btn.block { width: 100%; padding: 10px 0; font-size: 14px; }
.btn.dark { background: var(--ink); box-shadow: var(--shadow-lift); }

/* --- Sign in ------------------------------------------------------------ */

.hero {
  display: flex; flex-wrap: wrap; gap: 56px; align-items: center;
  padding-top: 16px;
}
.hero .pitch { flex: 1 1 420px; min-width: 300px; }
.kicker {
  display: inline-block; margin: 0 0 20px;
  font: 600 13px/1 "Noto Sans TC", sans-serif; letter-spacing: 2px;
  color: var(--accent); background: var(--blush);
  border: 1px solid var(--line-accent); border-radius: var(--pill);
  padding: 8px 16px;
}
.hero h1 {
  font: 800 clamp(34px, 5vw, 56px)/1.2 "Prompt", "Noto Sans TC", sans-serif;
  margin: 0 0 20px;
}
.hero .lede {
  font-size: 18px; color: var(--muted); margin: 0 0 32px; max-width: 44ch;
}
.tg-button {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 17px; padding: 14px 28px;
}
.fineprint { color: var(--faint); font-size: 13px; margin: 20px 0 0; }
.stats { display: flex; gap: 32px; margin-top: 44px; flex-wrap: wrap; }
.stats .n { font: 800 26px/1.2 "Prompt", sans-serif; color: var(--accent); }
.stats .n.plain { color: var(--ink); }
.stats .label { font-size: 13px; color: var(--faint); }

.posters {
  flex: 1 1 380px; min-width: 300px;
  display: flex; justify-content: center; align-items: center;
  min-height: 440px; position: relative;
}
.poster {
  position: relative; width: 250px; height: 375px;
  border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow-poster); background: var(--blush);
}
.poster.a { transform: rotate(-6deg); z-index: 1; }
.poster.b { transform: rotate(5deg) translateX(-40px); z-index: 2; }
.ping {
  position: absolute; top: 20px; right: 0;
  background: #fff; border: 1px solid var(--line-warm);
  border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 12px 28px rgba(165, 51, 92, .15);
  z-index: 3; display: flex; gap: 10px; align-items: center;
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); display: inline-block; flex: none;
}
.ping .what { font-size: 13px; font-weight: 700; }
.ping .when { font-size: 12px; color: var(--faint); }

/* --- Featured ----------------------------------------------------------- */

.banner {
  position: relative; height: 380px;
  border-radius: var(--r-banner); overflow: hidden; background: var(--blush);
}
.banner .veil {
  position: absolute; inset: auto 0 0 0; z-index: 1;
  padding: 96px 36px 32px;
  background: linear-gradient(transparent, rgba(35, 26, 32, .72) 78%);
  display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap;
}
.banner .who { flex: 1; min-width: 240px; }
.banner .eyebrow {
  margin: 0 0 6px; font: 600 12px/1 sans-serif;
  letter-spacing: 2px; color: var(--line-accent);
}
.banner h1 { font: 800 clamp(28px, 4vw, 40px)/1.1 "Prompt", sans-serif; color: #fff; margin: 0; }
.banner .btn.following { background: rgba(255, 255, 255, .92); border-color: transparent; }

.section-head {
  display: flex; align-items: baseline; gap: 16px;
  margin: 36px 0 20px; flex-wrap: wrap;
}
.section-head h2 { font: 800 26px/1.2 "Prompt", "Noto Sans TC", sans-serif; margin: 0; }
.section-head .aside { font-size: 14px; color: var(--faint); }

.drops { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.drop {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-card);
}
.drop .shot { height: 280px; position: relative; background: var(--sunk); }
.drop .body { padding: 16px 18px 18px; }
.drop h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.drop .when { margin: 0; font-size: 13px; color: var(--faint); }
.tag {
  position: absolute; top: 12px; left: 12px;
  font: 700 12px/1 "Noto Sans TC", sans-serif; color: #fff;
  background: var(--accent); border-radius: var(--pill); padding: 6px 12px;
}
.tag.preorder { background: var(--ink); }
.tag.upcoming { background: var(--faint); }

/* --- Browse ------------------------------------------------------------- */

.browse-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
/* min-width:max-content is what stops the title shredding. A flex item defaults
   to min-width:auto, which resolves to min-content — and Chinese has no word
   boundaries, so min-content is ONE CHARACTER. Without this the heading
   collapses into a vertical column of single glyphs as soon as the search box
   wants room. */
.browse-head h1 {
  font: 800 30px/1.2 "Prompt", "Noto Sans TC", sans-serif;
  margin: 0; flex: 1 1 auto; min-width: max-content;
}
.search { flex: 1 1 260px; max-width: 380px; display: flex; }
.search input {
  flex: 1; padding: 12px 20px;
  border: 1.5px solid var(--line); border-radius: var(--pill);
  font: 15px/1 "Noto Sans TC", sans-serif;
  background: var(--sunk); color: var(--ink); outline: none;
}
.search input:focus { border-color: var(--accent); background: #fff; }

.groups { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 32px; }
.groups a {
  padding: 9px 18px; border: 1.5px solid var(--line);
  border-radius: var(--pill); background: var(--card);
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.groups a[aria-current="page"] {
  border-color: var(--accent); background: var(--blush); color: var(--accent);
}
.groups .count { margin-left: 8px; font-weight: 400; opacity: .65; font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow-row); display: flex; flex-direction: column;
}
.card .shot { height: 220px; background: var(--sunk); }
.card .body {
  padding: 14px 16px 16px; display: flex; flex-direction: column;
  gap: 10px; flex: 1;
}
.card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card .path { margin: 2px 0 0; font-size: 12px; color: var(--ghost); word-break: break-all; }

/* No image for this target — about one in twenty, plus anything the CDN fails
   to serve. A labelled panel reads as a deliberate absence; an empty box reads
   as a broken page. The placeholder always exists and the photo covers it. */
/* display:block matters: the arrivals card wraps its photo in an <a>, and an
   inline element ignores height entirely — the card collapses to nothing. */
.shot, .face, .poster, .banner {
  display: block; position: relative; overflow: hidden;
}
.noshot {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(
    45deg, var(--sunk), var(--sunk) 10px, var(--blush) 10px, var(--blush) 20px);
  color: var(--ghost); font-size: 12px; text-align: center;
}
img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* A placeholder directly after an image is not needed — the image is either
   loading or shown. It becomes visible only if onerror removes the image and
   this adjacency stops holding. */
img.cover + .noshot { display: none; }

/* --- Subscriptions ------------------------------------------------------ */

.callout {
  background: linear-gradient(120deg, var(--blush), var(--line-soft));
  border: 1.5px solid var(--line-accent); border-radius: var(--r-panel);
  padding: 24px 28px; margin-bottom: 32px;
}
.callout h2 { font: 800 19px/1.3 "Noto Sans TC", sans-serif; margin: 0 0 8px; }
.callout p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.live {
  display: flex; align-items: center; gap: 8px;
  color: var(--accent); font-weight: 600; font-size: 14px; margin: 0 0 24px;
}
.dot.sm { width: 8px; height: 8px; }

.page-title { font: 800 30px/1.2 "Prompt", "Noto Sans TC", sans-serif; margin: 0 0 6px; }
.page-sub { color: var(--faint); font-size: 14px; margin: 0 0 28px; }

.rows { display: flex; flex-direction: column; gap: 14px; }
.row {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow-row);
}
.row .face {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  overflow: hidden; background: var(--blush);
}
.row .face .noshot { font-size: 9px; }
.row .what { flex: 1; min-width: 0; }
.row .name { font-weight: 700; font-size: 15px; }
.row .group { font-size: 12px; color: var(--ghost); }

.empty {
  text-align: center; padding: 56px 0;
  background: var(--sunk); border-radius: var(--r-panel);
  border: 1.5px dashed var(--line);
}
.empty p { color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.empty a { color: var(--accent); font-weight: 700; }
.nothing { color: var(--faint); padding: 48px 0; text-align: center; }

/* --- Settings ----------------------------------------------------------- */

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-panel); padding: 24px 28px;
  margin-bottom: 20px; box-shadow: var(--shadow-row);
}
.panel h2 { font: 800 17px/1.3 "Noto Sans TC", sans-serif; margin: 0 0 4px; }
.panel .hint { color: var(--faint); font-size: 13px; margin: 0 0 16px; }

.segmented {
  display: inline-flex; background: var(--sunk);
  border: 1.5px solid var(--line); border-radius: var(--pill);
  padding: 4px; gap: 4px;
}
.segmented label { display: block; position: relative; }
.segmented input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.segmented span {
  display: block; border-radius: var(--pill); padding: 9px 24px;
  font: 700 14px/1 "Noto Sans TC", sans-serif;
  background: transparent; color: var(--faint); pointer-events: none;
}
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.toggles { display: flex; flex-direction: column; }
.toggle {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.toggle:last-child { border-bottom: 0; }
.toggle .what { flex: 1; }
.toggle .name { font-weight: 700; font-size: 15px; }
.toggle .desc { font-size: 12px; color: var(--ghost); }

/* The switch is a real checkbox, visually replaced. It keeps the keyboard and
   screen-reader behaviour the mock's <button> would have thrown away, and it
   posts its own value with the form. */
.switch { position: relative; flex: none; }
.switch input {
  position: absolute; inset: 0; width: 48px; height: 28px;
  margin: 0; opacity: 0; cursor: pointer;
}
.switch .track {
  display: block; width: 48px; height: 28px; border-radius: var(--pill);
  background: var(--track); transition: background .15s; pointer-events: none;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(35, 26, 32, .25);
  transition: left .15s; pointer-events: none;
}
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .knob { left: 23px; }
.switch input:focus-visible ~ .track { outline: 2px solid var(--accent); outline-offset: 3px; }

.saved { color: var(--accent); font-weight: 600; font-size: 14px; margin: 0 0 20px; }
.error { color: var(--accent); font-weight: 600; }
.inline { display: inline; }

@media (max-width: 640px) {
  .wrap { padding: 24px 16px 72px; }

  /* The header is sticky, so every row it grows costs the reader a row of the
     page for the whole session. Five nav items will not fit 360px, and letting
     them wrap took a fifth of the viewport — so the strip scrolls sideways
     instead, bleeding to both edges so it is visibly scrollable. */
  .bar { padding: 12px 16px; gap: 10px; }
  .bar nav {
    flex: 1 0 100%;
    margin: 0 -16px; padding: 2px 16px;
    flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .bar nav::-webkit-scrollbar { display: none; }
  /* A hard clip at the edge looks like a bug; a fade looks like a strip that
     continues. Applied only where the strip actually scrolls. */
  @supports (mask-image: linear-gradient(#000, #000)) {
    .bar nav {
      mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }
  }
  .bar nav > * { flex: none; }
  .bar nav a { padding: 7px 14px; font-size: 14px; white-space: nowrap; }
  .signout { padding: 7px 6px; }

  h1, .page-title, .browse-head h1 { font-size: 24px; }
  .section-head h2 { font-size: 21px; }
  .browse-head { gap: 14px; }
  .search { max-width: none; flex-basis: 100%; }

  /* The banner's caption sits over whatever photograph the store supplied, and
     most product shots are on white. A stronger, earlier scrim keeps the label
     legible without waiting for a lucky image. */
  .banner { height: 280px; }
  .banner .veil {
    padding: 80px 18px 18px;
    background: linear-gradient(transparent, rgba(35, 26, 32, .9) 58%);
    flex-direction: column; align-items: flex-start; gap: 14px;
  }
  .banner .who { min-width: 0; }
  .banner h1 { font-size: 24px; }
  .banner .eyebrow { color: #f3e2e9; }

  .hero { gap: 32px; padding-top: 8px; }
  .stats { gap: 20px 24px; margin-top: 32px; }
  /* Two 190px posters overlapping by 40px overflowed a 360px screen and gave
     the whole page a sideways scroll. */
  .posters { min-height: 300px; }
  .poster { width: 150px; height: 225px; }
  .poster.b { transform: rotate(5deg) translateX(-28px); }
  .ping { top: 8px; right: 0; padding: 10px 12px; }

  .callout { padding: 20px 18px; }
  .panel { padding: 20px 18px; }
  .row { padding: 12px 14px; gap: 12px; }
  .toggle { gap: 18px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .drops { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .drop .shot { height: 200px; }
  .card .shot { height: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .poster { transform: none !important; }
}
