/* 差點｜公開候選 v1（待批准，未部署）
   色：紙白底、墨藍字（取自畫裡的線稿與牛仔褲）、次墨給註記、球藍只給可以按的東西（404 的回首頁）、細線分群組。
   字：只用系統的繁中黑體，不帶字型檔；標題用最粗的那一級。大膽的只有主圖。
   路徑一律從網站根目錄寫起（/style.css、/img/…），深路徑的 404 也能載到。 */
:root {
  --paper: #ffffff;
  --ink: #1a2233;
  --ink-2: #4a5263;
  --ball: #24608f;
  --rule: #d8dce3;
  --gutter: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.75 "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
}
h1, h2, p, dl, dd, figure { margin: 0; }
img { display: block; max-width: 100%; height: auto; }

.page { display: flex; flex-direction: column; }

/* 主圖：漫畫格，一條墨線框，不加陰影與圓角 */
.hero { order: 2; }
.hero img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-block: 1.5px solid var(--ink);
}

.text { display: contents; }
.title { order: 1; padding: 28px var(--gutter) 24px; }
.story, .cast, .end { order: 3; }

h1 {
  font-size: 88px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
}
.lead { margin-top: 16px; font-size: 18px; line-height: 1.7; }

h2 { font-size: 20px; font-weight: 600; line-height: 1.4; }

.story, .cast {
  margin-inline: var(--gutter);
  padding-block: 28px;
  border-bottom: 1px solid var(--rule);
}

.story-body {
  display: flex;
  flex-direction: column-reverse;
  gap: 20px;
  margin-top: 16px;
}
.still {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.still img {
  width: 112px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border: 1px solid var(--ink);
}
.still figcaption { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.lines p + p { margin-top: 10px; }
.lines p, .cast dd, .end p { text-wrap: pretty; }
.aside { color: var(--ink-2); }

.cast dl { margin-top: 14px; }
.cast dl > div {
  display: grid;
  grid-template-columns: 4em minmax(0, 1fr);
  gap: 12px;
  padding-block: 9px;
}
.cast dl > div + div { border-top: 1px solid var(--rule); }
.cast dt { font-weight: 600; }

.end {
  padding: 24px var(--gutter) 40px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}

::selection { background: #cfe0ee; color: var(--ink); }

@media (min-width: 560px) {
  :root { --gutter: 32px; }
  .hero { padding-inline: var(--gutter); }
  .hero img { max-width: 480px; border: 1.5px solid var(--ink); }
  .story-body {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .still { display: block; }
  .still img { width: 100%; }
  .still figcaption { margin-top: 8px; }
}

/* 桌面：左邊主圖固定在視窗內，右邊讀字 */
@media (min-width: 900px) {
  :root { --gutter: 40px; }
  .page {
    display: grid;
    grid-template-columns: minmax(0, 34em) auto;
    justify-content: center;
    column-gap: 72px;
    max-width: 1280px;
    margin-inline: auto;
    padding: 40px var(--gutter) 0;
  }
  .text { display: block; padding-top: 8px; }
  .hero {
    position: sticky;
    top: 40px;
    align-self: start;
    padding: 0;
  }
  .hero img { width: min(500px, calc((100vh - 80px) * 0.5625)); }
  .title, .story, .cast, .end { margin-inline: 0; padding-inline: 0; }
  .title { padding-top: 0; padding-bottom: 32px; border-bottom: 1px solid var(--rule); }
  h1 { font-size: 132px; }
  .lead { font-size: 20px; margin-top: 24px; }
  .story, .cast { padding-block: 32px; }
  .end { padding-bottom: 56px; }
}

/* 404：同一套字與色，回首頁是整站唯一的按鈕 */
.missing {
  max-width: 34em;
  margin-inline: auto;
  padding: 72px var(--gutter) 56px;
}
.brand { font-weight: 600; color: var(--ink-2); }
.missing h1 { margin-top: 12px; font-size: 40px; line-height: 1.25; letter-spacing: 0.02em; }
.home {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 22px;
  border-radius: 4px;
  background: var(--ball);
  color: var(--paper);
  font-weight: 600;
  line-height: 24px;
  text-decoration: none;
}
.home:hover, .home:active { background: var(--ink); }
.home:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

@media (min-width: 900px) {
  .missing { padding-top: 120px; }
  .missing h1 { font-size: 56px; }
}
