/* 长明便利店 Longlight 官网（W-08，W-18 重做首页）
   颜色照游戏：深蓝夜色底，灯色 #e8a85c（PageStyle.Accent）。灯色只给「亮着的东西」：钟点、按钮、链接。
   首页按这一夜的钟点排：22:00 → 23:30 → 00:00 → 05:47 → 22:00，钟点是整页唯一显眼的东西。
   不带字体文件：标题是图，正文用系统自带的衬线 / 楷体（D23）。 */

:root {
  --night: #0c141c;
  --night-2: #121d28;
  --night-3: #1a2734;
  --lamp: #e8a85c;
  --lamp-soft: rgba(232, 168, 92, 0.35);
  --cream: #e9e5dc;
  --muted: #98a5b1;
  --cold: #e8f0f8;
  --line: rgba(240, 230, 214, 0.12);
  --serif-zh: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "Noto Serif CJK SC", "SimSun", serif;
  --kai-zh: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", var(--serif-zh);
  --serif-en: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --clock: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

/* 繁体页（W-17）：先用系统自带的繁体宋体 / 楷体，没有就退回简体那套（字都有，字形偏大陆） */
html[lang="zh-Hant"] {
  --serif-zh: "Songti TC", "PMingLiU", "MingLiU", "Source Han Serif TC", "Noto Serif TC", "Noto Serif CJK TC", "Songti SC", "SimSun", serif;
  --kai-zh: "Kaiti TC", "BiauKai", "DFKai-SB", var(--serif-zh);
}

* { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  color: var(--cream);
  background: var(--night);
  font-family: var(--serif-zh);
  font-size: 18px;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}

html[lang="en"] body { font-family: var(--serif-en); line-height: 1.7; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--lamp); }

/* ---------- 「灯下」按钮：只有字，悬停时字后亮一团暖光（跟游戏样式 C 一致，D131） ---------- */

.lamp-button, .lamp-link {
  display: inline-block;
  color: var(--lamp);
  text-decoration: none;
  letter-spacing: 0.08em;
  border-radius: 999px;
  transition: background 0.25s, text-shadow 0.25s;
}

.lamp-button {
  font-size: 1.15rem;
  padding: 0.7em 1.6em;
  border: 1px solid var(--lamp-soft);
}

.lamp-link { padding: 0.3em 0.8em; font-size: 0.95rem; white-space: nowrap; }

.lamp-button:hover, .lamp-button:focus-visible,
.lamp-link:hover, .lamp-link:focus-visible {
  background: radial-gradient(closest-side, rgba(232, 168, 92, 0.28), rgba(232, 168, 92, 0));
  text-shadow: 0 0 12px rgba(255, 196, 120, 0.8);
  outline: none;
}

.lamp-button.is-pending { cursor: default; opacity: 0.8; }

/* Steam 商店页挂出来以前（D272）：一块「Coming Soon」的牌子，不能点、不随鼠标发光，
   方一点的边、淡淡的底，跟能点的按钮分得开。AppID 下来换回愿望单按钮，这几行就用不上了。 */
.lamp-button.coming-soon {
  font-family: var(--serif-en);
  letter-spacing: 0.14em;
  border-radius: 6px;
  padding: 0.6em 1.5em;
  background: rgba(232, 168, 92, 0.07);
  opacity: 0.9;
}

.lamp-button.coming-soon:hover { background: rgba(232, 168, 92, 0.07); text-shadow: none; }

/* 还没开放的链接（攻略，D229、W-20）：灰字、不能点，跟 Steam 按钮一样没有 href */
.lamp-link.is-pending, .footer a.is-pending { color: var(--muted); opacity: 0.7; cursor: default; }

.lamp-link.is-pending:hover { background: none; text-shadow: none; }

.footer-nav a.is-pending:hover { text-decoration: none; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding: 16px 20px;
  z-index: 2;
}

.page-novel .topbar {
  position: static;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.topbar-home img { width: 150px; }

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 96px 6vw 64px;
  background:
    linear-gradient(90deg, rgba(12, 20, 28, 0) 25%, rgba(12, 20, 28, 0.82) 62%),
    linear-gradient(0deg, var(--night) 0%, rgba(12, 20, 28, 0) 30%),
    url("/assets/img/street.jpg") 30% center / cover no-repeat;
}

.hero-inner { width: min(520px, 100%); text-align: center; }

.hero-logo { width: 100%; margin: 0 auto 1.2rem; }

/* 打开页面时，标题字像店里的日光灯管一样闪两下再亮稳（W-18，整页只有这一处自己会动） */
@keyframes tube-on {
  0% { opacity: 0; }
  6% { opacity: 0.85; }
  10% { opacity: 0.15; }
  18% { opacity: 0.95; }
  22% { opacity: 0.4; }
  32%, 100% { opacity: 1; }
}

.hero-logo { animation: tube-on 1.5s linear 0.25s both; }

/* 一句话分三行（用户 10-26 定的断法），比标题宽一点，第一行才放得下；窄屏每行自己折、折得匀 */
.hero-oneliner { font-size: 1.05rem; color: var(--cream); margin: 0 max(-3rem, calc(16px - 6vw)) 0.6rem; }   /* 往外伸，但离屏幕右边至少留 16px（721～800 宽时 -3rem 会伸出屏幕） */

.hero-oneliner > span { display: block; text-wrap: balance; }

.hero-oneliner .seg { display: inline-block; }

/* 段落最后几个字连在一起，最后一行不会只剩一两个字 */
.tail { white-space: nowrap; }

html[lang="en"] :is(p, dd, li, figcaption) { text-wrap: pretty; }

html[lang="en"] h2 { text-wrap: balance; }

.hero-tagline { font-family: var(--kai-zh); color: var(--lamp); margin: 0 0 2rem; letter-spacing: 0.05em; }

/* 宣传语是 D158 定稿、字不改：窄屏放不下一行时只在「24 小时，」后面断（W-20） */
.hero-tagline .seg, .lineup .seg { display: inline-block; }

/* 按钮下面一行基本信息（W-20，用户 11-03 定的字）：几组之间空一格，折行只在组和组之间
   （组比整行还宽才在组里折）；空格用两边的 margin，不用全角空格，折行后每行照旧居中 */
.hero-facts { margin: 1.1rem 0 0; font-size: 0.85rem; line-height: 1.8; color: var(--muted); letter-spacing: 0.03em; text-wrap: balance; }

.hero-facts > span { display: inline-block; margin: 0 0.5em; }

html[lang="en"] .hero-tagline { font-family: var(--serif-en); font-style: italic; }

/* ---------- 首页：这一夜的几个钟点（W-18） ----------
   每节三栏：左边钟点（读这一节时一直钉在左上角，像墙上的钟），中间正文，右边配图。
   整节铺满屏宽，内容收在 78rem 以内。 */

.hour {
  display: grid;
  grid-template-columns: 14rem minmax(0, 34rem) minmax(0, 1fr);
  column-gap: clamp(2rem, 4.5vw, 4.5rem);
  align-items: start;
  padding: clamp(5rem, 13vh, 9rem) max(var(--gutter), calc((100% - 78rem) / 2));
}

.clock {
  grid-column: 1;
  grid-row: 1 / span 4;
  position: sticky;
  top: 2.2rem;
  font-family: var(--clock);
  font-size: clamp(3.4rem, 7vw, 6.2rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--lamp);
  text-shadow: 0 0 28px rgba(255, 190, 110, 0.45);
}

.hour-body { grid-column: 2; }

.hour h2 {
  font-family: var(--kai-zh);
  font-weight: normal;
  font-size: 1.9rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--cream);
  margin: 0.4rem 0 1.6rem;
}

html[lang="en"] .hour h2 { font-family: var(--serif-en); letter-spacing: 0.01em; }

.hour-body p { margin: 0 0 1.1em; line-height: 1.95; }

html[lang^="zh"] .hour-body p { text-align: justify; }

html[lang="en"] .hour-body p { line-height: 1.75; }

.hour-lead { font-family: var(--kai-zh); font-size: 1.15rem; color: var(--muted); }

html[lang="en"] .hour-lead { font-family: var(--serif-en); font-style: italic; }

.hour-side { grid-column: 3; justify-self: end; margin: 0; max-width: 15rem; }

.hour-side img {
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.6));
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
}

.hour-side figcaption, .lineup p { font-size: 0.92rem; line-height: 1.75; color: var(--muted); margin: 0.6rem 0 0; }

.hour-side b, .lineup b { display: block; font-family: var(--kai-zh); font-weight: normal; font-size: 1.15rem; color: var(--cream); margin-bottom: 0.2rem; }

html[lang="en"] .hour-side b, html[lang="en"] .lineup b { font-family: var(--serif-en); }

/* 店内大图：横贯整屏，上下渐隐进夜色 */
.plate { position: relative; margin: 0; }

.plate > img { width: 100%; height: clamp(260px, 40vw, 620px); object-fit: cover; }

.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--night) 0%, rgba(12, 20, 28, 0) 22%, rgba(12, 20, 28, 0) 78%, var(--night) 100%);
  pointer-events: none;
}

/* 店里的人：立绘并排站在同一条地面上，不装框 */
.lineup {
  grid-column: 2 / -1;
  list-style: none;
  margin: 3.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1.2rem, 3vw, 2.6rem);
  background: radial-gradient(60% 40% at 50% 58%, rgba(232, 168, 92, 0.09), rgba(232, 168, 92, 0));
}

.lineup img {
  width: 100%;
  max-width: 240px;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.6));
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
}

/* 怎么玩：四条，左边一句话，下面一段解释 */
.plays { margin: 2.2rem 0 0; }

.plays dt { font-family: var(--kai-zh); font-size: 1.2rem; color: var(--cream); margin: 1.6rem 0 0; }

html[lang="en"] .plays dt { font-family: var(--serif-en); font-style: italic; }

.plays dt:first-child { margin-top: 0; }

.plays dd { margin: 0.35rem 0 0; color: var(--muted); line-height: 1.85; }

.screen { grid-column: 2 / -1; margin: 3.5rem 0 0; }

.screen img { border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }

/* 05:47：没有图，只有一句刹车声和一道冷白的车灯光；钟点也换成冷白 */
.hour-crash {
  min-height: 86vh;
  align-content: center;
  background:
    radial-gradient(90% 60% at 100% 52%, rgba(225, 236, 248, 0.16), rgba(225, 236, 248, 0) 60%),
    linear-gradient(180deg, var(--night) 0%, #070d14 30%, #070d14 70%, var(--night) 100%);
}

.hour-crash .clock { color: var(--cold); text-shadow: 0 0 34px rgba(220, 235, 255, 0.5); }

.hour-crash .hour-body { grid-column: 2 / -1; }

.hour-crash h2 { font-size: clamp(1.8rem, 3.4vw, 2.9rem); line-height: 1.55; letter-spacing: 0.06em; color: var(--cold); margin: 0; max-width: 18em; }

/* 又是 22:00：只有你记得 */
.hour-loop h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); color: var(--lamp); text-shadow: 0 0 26px rgba(255, 190, 110, 0.35); margin: 1.4rem 0 2.4rem; }

.hour-loop .lamp-button { margin-bottom: 2.6rem; }

.novel-link { font-size: 0.95rem; color: var(--muted); }

/* 关于 AI：放在这一夜外面，安静的一小块，左边标题跟上面的钟点对齐 */
.about-ai {
  display: grid;
  grid-template-columns: 14rem minmax(0, 34rem);
  column-gap: clamp(2rem, 4.5vw, 4.5rem);
  padding: 4.5rem max(var(--gutter), calc((100% - 78rem) / 2)) 5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.about-ai h2 { grid-column: 2; font-family: var(--kai-zh); font-weight: normal; font-size: 1.2rem; letter-spacing: 0.12em; color: var(--cream); margin: 0 0 1rem; }

.about-ai ul { grid-column: 2; }

html[lang="en"] .about-ai h2 { font-family: var(--serif-en); letter-spacing: 0.01em; }

.about-ai ul { margin: 0; padding-left: 1.1rem; }

.about-ai li { margin-bottom: 0.5rem; }

/* ---------- 顶栏导航、开发日志（W-10） ---------- */

.topbar-nav { display: flex; gap: 0.4rem; }

.devlog .post { border-top: 1px solid var(--line); padding-top: 2rem; margin-top: 2.5rem; }

.devlog .post h2 { font-family: var(--kai-zh); font-weight: normal; color: var(--lamp); font-size: 1.5rem; letter-spacing: 0.08em; margin: 0 0 0.3rem; }

html[lang="en"] .devlog .post h2 { font-family: var(--serif-en); letter-spacing: 0.02em; }

.post-meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.4rem; }

.post-badge { display: inline-block; border: 1px dashed var(--lamp-soft); color: var(--lamp); border-radius: 999px; padding: 0.1em 0.8em; font-size: 0.85rem; }

.novel h3 { font-family: var(--kai-zh); font-weight: normal; color: var(--lamp); font-size: 1.15rem; margin: 2rem 0 0.8rem; }

html[lang="en"] .novel h3 { font-family: var(--serif-en); }

.devlog-empty { text-align: center; color: var(--muted); margin-top: 3rem; }

/* ---------- 页脚 ---------- */

.footer {
  padding: 48px 20px 64px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer p { max-width: 760px; margin: 0.4rem auto; }

.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.6rem; margin: 0 auto 1.4rem; font-size: 0.95rem; }

.footer-nav a { text-decoration: none; }

.footer-nav a:hover, .footer-nav a:focus-visible { text-decoration: underline; text-underline-offset: 0.25em; }

/* ---------- 小说页 ---------- */

.novel { max-width: 680px; margin: 0 auto; padding: 56px 20px 32px; }

.novel h1 { font-family: var(--kai-zh); font-weight: normal; color: var(--lamp); font-size: 2.2rem; letter-spacing: 0.2em; margin: 0; text-align: center; }

.novel-sub { text-align: center; color: var(--muted); margin: 0.4rem 0 3rem; font-size: 0.95rem; }

.novel h2 { font-family: var(--kai-zh); font-weight: normal; color: var(--lamp); font-size: 1.15rem; letter-spacing: 0.15em; margin: 3rem 0 1rem; }

.novel p { margin: 0 0 1.1em; }

.novel blockquote { margin: 1.4em 0; padding: 0.2em 1.2em; border-left: 2px solid var(--lamp); color: var(--lamp); font-family: var(--kai-zh); font-size: 1.15rem; }

.novel-end { text-align: center; margin-top: 3rem; }

/* ---------- 404 页（W-21）：简、繁、英各一句，加回首页的链接 ---------- */

.notfound { text-align: center; min-height: 62vh; }

.notfound h1 { font-family: var(--clock); letter-spacing: 0.12em; font-size: 3rem; margin-bottom: 2.2rem; }

.notfound section { margin: 0 auto 2rem; }

.notfound section p { margin: 0 0 0.3em; font-family: var(--kai-zh); font-size: 1.15rem; }

.notfound section[lang="en"] p { font-family: var(--serif-en); font-size: 1.05rem; }

/* ---------- 攻略页（W-13）：剧透警告、不折叠的「怎么玩」、各结局一块折叠 ---------- */

.guide-warning blockquote { font-family: inherit; font-size: 1rem; color: var(--cream); background: rgba(232, 168, 92, 0.08); padding: 0.9em 1.2em; border-radius: 0 8px 8px 0; }

.guide-warning blockquote p { margin: 0; }

.guide-warning strong, .guide strong { color: var(--lamp); font-weight: normal; }

.guide h2 { font-size: 1.35rem; }

html[lang="en"] .guide h2 { font-family: var(--serif-en); letter-spacing: 0.02em; }

.guide-open { margin-top: 2.5rem; }

.guide-open > h2 { margin-top: 0; }

.guide-fold { border-top: 1px solid var(--line); }

.guide-fold:last-of-type { border-bottom: 1px solid var(--line); }

.guide-fold summary { cursor: pointer; list-style: none; padding: 1rem 0; }

.guide-fold summary::-webkit-details-marker { display: none; }

.guide-fold summary::before { content: "▸"; display: inline-block; width: 1.4em; color: var(--lamp); transition: transform 0.2s; }

.guide-fold[open] summary::before { transform: rotate(90deg); }

.guide-fold summary:focus-visible { outline: 2px solid var(--lamp-soft); outline-offset: 4px; border-radius: 4px; }

.guide-fold summary h2 { display: inline; margin: 0; }

.guide-fold[open] { padding-bottom: 1.5rem; }

.guide ul, .guide ol { padding-left: 1.4rem; margin: 0 0 1.1em; }

.guide li { margin-bottom: 0.5em; }

.guide li > ul, .guide li > ol { margin: 0.5em 0 0; }

.guide code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88em; color: var(--lamp); background: rgba(240, 230, 214, 0.06); padding: 0.05em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }

.guide-shot { margin: 1.4em 0 1.8em; }

.guide-shot img { border: 1px solid var(--line); border-radius: 6px; }

.guide-shot figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5em; text-align: center; }

/* ---------- 个人信息收集清单（W-15）：五列的表，窄屏变成一张张卡片 ---------- */

.collection { max-width: 1040px; }

.collection h1 { font-size: 1.7rem; letter-spacing: 0.08em; margin-bottom: 2.4rem; }

html[lang="en"] .collection h1 { font-family: var(--serif-en); letter-spacing: 0.01em; }

.collection > p { max-width: 760px; }

.collection-table { margin: 1.8em 0 2.2em; }

.collection-table table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.9rem; line-height: 1.65; }

.collection-table th, .collection-table td { text-align: left; vertical-align: top; padding: 0.75em 0.7em; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }

.collection-table thead th { color: var(--lamp); font-weight: normal; border-bottom-color: var(--lamp-soft); }

.collection-table tbody th { color: var(--lamp); font-weight: normal; }

.collection-table thead th:nth-child(1) { width: 14%; }

.collection-table thead th:nth-child(2) { width: 30%; }

.collection-table thead th:nth-child(3) { width: 22%; }

.collection-table thead th:nth-child(4) { width: 14%; }

.collection-table thead th:nth-child(5) { width: 20%; }

/* ---------- 手机 ---------- */

@media (max-width: 720px) {
  body { font-size: 17px; }
  .hero {
    justify-content: center;
    align-items: flex-end;
    padding: 88px 16px 56px;
    background:
      linear-gradient(0deg, var(--night) 0%, rgba(12, 20, 28, 0.85) 45%, rgba(12, 20, 28, 0.1) 80%),
      url("/assets/img/street-small.jpg") 28% center / cover no-repeat;
  }
  .hero-oneliner { margin-inline: 0; }
  .hour, .about-ai { grid-template-columns: minmax(0, 1fr); padding-top: 4.5rem; padding-bottom: 4.5rem; }
  .clock { grid-row: auto; position: static; font-size: 3.4rem; margin-bottom: 0.6rem; }
  .hour-body, .hour-side, .lineup, .screen, .hour-crash .hour-body, .about-ai h2, .about-ai ul { grid-column: 1; }
  .hour-side { justify-self: start; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: end; max-width: none; margin-top: 1.4rem; }
  .lineup { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; margin-top: 2rem; }
  .lineup li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: end; }
  .hour h2 { font-size: 1.6rem; }
  .hour-crash { min-height: 70vh; }
  .about-ai h2 { margin-bottom: 1rem; }
  .topbar { padding: 12px 16px; gap: 0.2rem; }
  .topbar-nav { gap: 0.1rem; }
  .lamp-link { padding: 0.3em 0.5em; font-size: 0.88rem; }
  .page-novel .topbar-home img { width: 110px; }
  .collection h1 { font-size: 1.45rem; }
  .collection-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .collection-table table, .collection-table tbody, .collection-table tr, .collection-table th, .collection-table td { display: block; width: 100%; }
  .collection-table tr { border: 1px solid var(--line); border-radius: 8px; padding: 0.3em 0.9em 0.7em; margin-bottom: 1rem; }
  .collection-table tbody th, .collection-table td { border-bottom: 0; padding: 0.35em 0; }
  .collection-table tbody th { font-size: 1rem; padding-top: 0.55em; }
  .collection-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.85em; }
}

/* ---------- 首页的几处小动静（W-18，night.js 加上去的；没有脚本就是静的） ---------- */

.hero-night { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero-inner { position: relative; z-index: 1; }

/* 钉在左上角的钟（用户 10-26）：22:00 那节第一次出现起一直在，位置跟各节左边那一栏对齐；
   有了它，各节自己的钟点就藏起来，只留给读屏 */
.night-clock {
  position: fixed;
  z-index: 4;
  top: 2.2rem;
  left: max(var(--gutter), calc((100vw - 78rem) / 2));
  font-family: var(--clock);
  font-size: clamp(3.4rem, 7vw, 6.2rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--lamp);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.6s, transform 0.6s, color 0.8s;
  pointer-events: none;
}

.night-clock.is-on { opacity: 1; transform: none; }

.night-clock.is-cold { color: var(--cold); }

.night-clock.is-cold .odo { filter: drop-shadow(0 0 16px rgba(220, 235, 255, 0.55)); }

.has-night-clock .hour > .clock { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 翻牌钟：每一位是一卷 0～9，往上滚就是往前走 */
.clock-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.odo { display: inline-flex; filter: drop-shadow(0 0 14px rgba(255, 190, 110, 0.5)); }

.odo-digit { display: inline-block; height: 1em; overflow: hidden; }

.odo-reel { display: block; transition: transform 0.5s cubic-bezier(0.2, 0.75, 0.2, 1); }

.odo-reel > span { display: block; height: 1em; line-height: 1; }

.odo-colon { display: inline-block; height: 1em; line-height: 1; }

.is-fast .odo-reel { transition-duration: 0.08s; transition-timing-function: linear; }

/* 05:47：车灯从右往左扫过去，那句话跟着一震 */
.hour-crash { position: relative; overflow: hidden; }

.hour-crash::before {
  content: "";
  position: absolute;
  inset: -10% -30%;
  background: linear-gradient(100deg, rgba(235, 242, 255, 0) 38%, rgba(235, 242, 255, 0.26) 50%, rgba(235, 242, 255, 0) 62%);
  opacity: 0;
  transform: translateX(55%);
  pointer-events: none;
}

.hour-crash.is-lit::before { animation: headlight 2.2s cubic-bezier(0.3, 0, 0.2, 1) 0.15s both; }

@keyframes headlight {
  0% { opacity: 0; transform: translateX(55%); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-60%); }
}

.hour-crash.is-lit h2 { animation: jolt 0.45s ease-out 0.55s both; }

@keyframes jolt {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

/* 倒带（点「再来一夜」时，W-20 起只在这时候）：整页褪色，一路滚回开头，钟飞快地倒转回十点；滚完褪色收掉。
   整页的横纹（W-20，用户 11-03）：浓淡是 night.js 按读到哪儿算的 --tape，首屏 0，越往下越重，
   到最后那节是 1（就是这里写的浓度），一直到页底；倒回开头跟着淡到 0。没有脚本就没有横纹 */
html.is-rewinding main { filter: saturate(0.25) brightness(1.08) contrast(1.05); }

main { transition: filter 0.35s; }

html.has-night-clock body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(232, 240, 248, 0.05) 0 2px, rgba(232, 240, 248, 0) 2px 7px);
  animation: tape 0.6s linear infinite;
  opacity: var(--tape, 0);
}

@keyframes tape { from { background-position: 0 0; } to { background-position: 0 -70px; } }

/* 天色跟着钟走：一层灰白的光叠在整页上（screen 混合只往亮里提），越近 05:47 越浓 */
.dawn-veil {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(150, 168, 192, 0.32), rgba(105, 122, 145, 0.16));
  mix-blend-mode: screen;
  opacity: var(--dawn, 0);
  transition: opacity 0.8s;
}

/* 「怎么玩」里那段对话：照游戏的对话框画，脚本让它自己演一遍；没脚本就是一段静的对话 */
.demo {
  grid-column: 2 / -1;
  margin: 3rem 0 0;
  max-width: 50rem;
  padding: 1.2rem 1.5rem 1.1rem;
  background: rgba(14, 23, 32, 0.86);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.98rem;
  line-height: 1.8;
}

.demo-narr { margin: 0 0 0.9rem; text-align: right; font-style: italic; color: var(--muted); font-size: 0.9rem; }

.demo-hl { color: var(--lamp); font-style: normal; }

.demo-line { margin: 0 0 0.35rem; transition: opacity 0.3s; }

.demo-line.is-waiting { opacity: 0; }

.demo-who { color: var(--muted); }

.demo-npc .demo-who { color: var(--lamp); }

.demo-who small { font-size: 0.78em; color: var(--muted); }

.demo-say { color: var(--cream); transition: color 0.4s; }

.demo-say.is-streaming { color: var(--muted); }

.demo-input { display: flex; align-items: baseline; gap: 0.8rem; margin: 1rem 0 0; padding-bottom: 0.45rem; border-bottom: 1px solid var(--lamp-soft); min-height: 2.3em; }

.demo-chip { flex: none; padding: 0.1em 0.7em; border-radius: 6px; background: rgba(232, 168, 92, 0.14); color: var(--lamp); font-size: 0.9rem; }

.demo-caret { display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; vertical-align: -0.18em; background: var(--lamp); animation: caret 1s steps(1) infinite; }

@keyframes caret { 50% { opacity: 0; } }

/* 「再来一夜」 */
.again-row { margin-top: 2.2rem; }

.again-button {
  font: inherit;
  font-size: 1rem;
  color: var(--cream);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55em 1.4em;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}

.again-button:hover, .again-button:focus-visible { color: var(--lamp); border-color: var(--lamp-soft); outline: none; }

/* 店内大图上的电灯开关：装在后门右边那面白墙上（图是居中裁的，位置按图的比例算） */
.light-switch {
  position: absolute;
  z-index: 1;
  left: 58.6%;
  top: 40%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
  transition: filter 0.25s, transform 0.25s;
}

.light-switch img { width: 100%; height: 100%; object-fit: contain; }

.light-switch:hover, .light-switch:focus-visible { filter: drop-shadow(0 0 14px rgba(255, 196, 120, 0.55)); transform: scale(1.04); outline: none; }

.lights-out:not([hidden]) { position: fixed; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; pointer-events: none; }

.lights-out p { margin: 0; font-family: var(--kai-zh); font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: 0.14em; color: var(--lamp); text-shadow: 0 0 30px rgba(255, 190, 110, 0.55); }

html[lang="en"] .lights-out p { font-family: var(--serif-en); font-style: italic; letter-spacing: 0.02em; }

html.is-dark main { filter: brightness(0.12) saturate(0.6); transition-duration: 0.08s; }

html.is-flicker main { animation: tube-flicker 0.9s linear both; }

@keyframes tube-flicker {
  0% { filter: brightness(0.12); }
  10% { filter: brightness(1); }
  18% { filter: brightness(0.25); }
  30% { filter: brightness(0.95); }
  38% { filter: brightness(0.45); }
  52%, 100% { filter: brightness(1); }
}

/* 右下角的喇叭：默认不出声 */
.sound-toggle:not([hidden]) {
  position: fixed;
  z-index: 4;
  right: 1.2rem;
  bottom: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--lamp);
  background: rgba(12, 20, 28, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.sound-toggle:hover, .sound-toggle:focus-visible { border-color: var(--lamp-soft); outline: none; }

.sound-toggle[aria-pressed="false"] .sound-wave, .sound-toggle[aria-pressed="false"] .when-on,
.sound-toggle[aria-pressed="true"] .sound-mute, .sound-toggle[aria-pressed="true"] .when-off { display: none; }

/* 手机上的钟变成贴着屏幕顶边的一条窄横条，底色不透明，正文从它下面滑过去，不再跟字叠在一起
   （W-20；原来是左上角一个半透明小牌子，压在段落和立绘上）。要放在钟的基本样式后面 */
@media (max-width: 720px) {
  .demo { grid-column: 1; padding: 1rem 1.1rem; font-size: 0.92rem; }
  .demo-input { flex-wrap: wrap; gap: 0.4rem 0.6rem; }
  .light-switch { left: 64%; width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  .sound-toggle:not([hidden]) { right: 0.75rem; bottom: 0.75rem; padding: 0.55rem; }
  .sound-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .night-clock { top: 0; left: 0; right: 0; font-size: 1.5rem; padding: max(0.45rem, env(safe-area-inset-top)) var(--gutter) 0.45rem; background: rgba(12, 20, 28, 0.96); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
}

/* ---------- 中等宽度（平板、窄一点的笔记本）：配图挪到正文下面 ---------- */

@media (min-width: 721px) and (max-width: 1180px) {
  .hour, .about-ai { grid-template-columns: 9.5rem minmax(0, 1fr); }
  .clock, .night-clock { font-size: clamp(3rem, 6vw, 4.4rem); }
  .hour-side, .lineup, .screen, .hour-crash .hour-body { grid-column: 2; }
  .hour-side { justify-self: start; display: grid; grid-template-columns: 9rem minmax(0, 28rem); gap: 1.2rem; align-items: end; max-width: none; margin-top: 1.6rem; }
  .hour-body { max-width: 36rem; }
}

/* ---------- 少动一点（系统里开了「减弱动态效果」） ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
  .lamp-button, .lamp-link, .guide-fold summary::before, .night-clock, .odo-reel, .dawn-veil, .demo-line, .demo-say { transition: none; }
  .demo-caret { animation: none; }
  html.has-night-clock body::after { animation: none; }
}

.footer-nav a:focus-visible, .novel-link a:focus-visible { outline: 2px solid var(--lamp-soft); outline-offset: 3px; border-radius: 2px; }
