@font-face { font-family: "NotoTC"; src: url("fonts/NotoSansTC-VF.ttf") format("truetype"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "InterV"; src: url("fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "Instrument"; src: url("fonts/InstrumentSerif-Regular.ttf") format("truetype"); font-weight: 400; font-display: block; }
@font-face { font-family: "JBM"; src: url("fonts/JetBrainsMono-Bold.ttf") format("truetype"); font-weight: 700; font-display: block; }


:root {
  --paper: rgba(19, 16, 13, .93);
  --ink: #efe8db;
  --ink-2: #b9ae9e;
  --mute: #8f8476;
  --line: rgba(239, 232, 219, .12);
  --accent: #b09a7c;
  --hud: rgba(16, 13, 11, .78);
  --hud-line: rgba(239, 232, 219, .1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0a0806; color: var(--ink);
  font-family: "NotoTC", "InterV", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: grab; }
#scene.dragging { cursor: grabbing; }

/* ---------- 左上：展名 ---------- */
.hud-title {
  position: fixed; top: 30px; left: 40px; pointer-events: none;
  color: var(--ink);
  background: var(--hud); border: 1px solid var(--hud-line);
  padding: 14px 20px 14px 18px; border-radius: 2px;
}
.hud-title .kicker { font-size: 11px; letter-spacing: .24em; color: var(--mute); margin-bottom: 8px; }
.hud-title h1 { font-weight: 600; font-size: 24px; letter-spacing: .1em; line-height: 1.2; }
.hud-title .disclaimer { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--hud-line); font-size: 11px; letter-spacing: .1em; color: var(--mute); }
.hud-title p { margin-top: 6px; font-size: 12.5px; letter-spacing: .12em; color: var(--ink-2); font-weight: 400; }

/* ---------- 下方：操作說明＋走廊位置 ---------- */
.hud-bottom {
  position: fixed; left: 40px; right: 40px; bottom: 30px; height: 54px;
  display: flex; align-items: flex-end; justify-content: space-between;
  pointer-events: none;
}
.keys {
  display: flex; align-items: center; gap: 7px; flex-wrap: nowrap;
  font-size: 12.5px; letter-spacing: .06em; color: var(--ink-2);
  background: var(--hud); border: 1px solid var(--hud-line);
  padding: 9px 14px; border-radius: 2px;
}
.keys .k {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 21px; height: 21px; padding: 0 5px;
  font-family: "JBM", monospace; font-size: 10.5px; color: var(--ink);
  border: 1px solid rgba(239,232,219,.28); border-bottom-width: 2px; border-radius: 3px; background: rgba(255,255,255,.04);
}
.keys .sep { width: 1px; height: 14px; background: rgba(239,232,219,.18); margin: 0 6px; }

.map {
  position: relative; width: 600px; height: 54px;
  background: var(--hud); border: 1px solid var(--hud-line);
  border-radius: 2px; padding: 0 22px;
}
.map .label { position: absolute; left: 22px; top: 8px; font-size: 10px; letter-spacing: .2em; color: var(--mute); }
.map .meter { position: absolute; right: 22px; top: 8px; font-family: "JBM", monospace; font-size: 9.5px; letter-spacing: .1em; color: var(--mute); }
.map .track { position: absolute; left: 22px; right: 22px; top: 32px; height: 1px; background: rgba(239,232,219,.22); }
.map .tick {
  position: absolute; top: 27px; width: 11px; height: 11px; margin-left: -5.5px;
  border: 1px solid rgba(239,232,219,.45); background: #15110e; border-radius: 50%;
}
.map .tick.on { background: var(--accent); border-color: var(--ink); }
.map .tick span {
  position: absolute; top: 13px; left: 50%; transform: translateX(-50%);
  font-family: "JBM", monospace; font-size: 9px; color: var(--mute); letter-spacing: .04em;
}
.map .me { position: absolute; top: 22px; width: 0; height: 0; }
.map .me i {
  position: absolute; left: -7px; top: -2px; width: 14px; height: 14px;
  background: #f1d9b5; clip-path: polygon(50% 0, 100% 100%, 50% 76%, 0 100%);
}

/* ---------- 資訊面板 ---------- */
.panel {
  position: fixed; top: 50%; width: 520px; max-height: 712px;
  background: var(--paper); color: var(--ink);
  border: 1px solid rgba(239,232,219,.09);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.7);
  padding: 24px 32px 22px 38px;
  opacity: 0; visibility: hidden; pointer-events: none;
  overflow: hidden;
}
.panel.left { left: 40px; }
.panel.right { right: 40px; }
.panel .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); transform-origin: top; }

.p-top { display: grid; grid-template-columns: 148px 1fr; gap: 20px; align-items: stretch; }
.p-photo { position: relative; width: 148px; height: 148px; overflow: hidden; background: #221c16; }
.p-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px;
  font-size: 10px; letter-spacing: .06em; color: #f3ece0; white-space: nowrap;
  background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0));
}
.p-id { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }

.p-head { display: flex; align-items: flex-start; justify-content: space-between; }
.p-no { font-family: "Instrument", serif; font-size: 54px; line-height: .9; letter-spacing: .01em; color: var(--ink); }
.p-no small { font-family: "NotoTC", sans-serif; font-size: 10.5px; letter-spacing: .2em; color: var(--mute); display: block; margin-bottom: 8px; }
.p-state { text-align: right; }
.p-state small { display: block; font-size: 10.5px; color: var(--mute); letter-spacing: .14em; margin-bottom: 6px; }
.p-status { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .16em; padding: 5px 10px 5px 12px; border-radius: 2px; }
.p-status.stopped { background: #e9dfcd; color: #1a1511; }
.p-status.never { border: 1.5px solid #e9dfcd; color: #e9dfcd; }

.p-name { font-size: 34px; font-weight: 700; letter-spacing: .06em; line-height: 1.15; }
.p-name span { font-size: 17px; font-weight: 400; color: var(--ink-2); margin-left: 10px; letter-spacing: .12em; }
.p-note { margin-top: 12px; font-size: 12px; line-height: 1.6; color: #d6b98a; letter-spacing: .03em; }

.p-rows { margin-top: 16px; border-top: 1px solid var(--line); }
.p-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.p-row dt { font-size: 12px; font-weight: 500; color: var(--mute); letter-spacing: .1em; padding-top: 2px; }
.p-row dd { font-size: 14px; line-height: 1.62; color: var(--ink); letter-spacing: .02em; }

.p-story { margin-top: 14px; padding: 12px 16px 12px 18px; background: rgba(239,232,219,.06); position: relative; }
.p-story .lbl { font-size: 12px; font-weight: 500; color: var(--mute); letter-spacing: .1em; margin-bottom: 6px; }
.p-story .q { position: absolute; right: 14px; top: 2px; font-family: "Instrument", serif; font-size: 60px; line-height: 1; color: rgba(239,232,219,.2); }
.p-story p { font-size: 13.5px; line-height: 1.7; color: #e3dbcd; letter-spacing: .02em; }
.p-story .by { margin-top: 6px; font-size: 11.5px; color: var(--mute); letter-spacing: .08em; }

/* ---------- 入口提示 ---------- */
.hint {
  position: fixed; left: 50%; bottom: 118px; transform: translateX(-50%);
  font-size: 15px; letter-spacing: .2em; color: var(--ink); pointer-events: none;
  background: var(--hud); border: 1px solid var(--hud-line); padding: 10px 20px; border-radius: 2px;
}

/* ---------- 展示模式（?hud=0）：隱藏標題框、操作提示、小地圖；保留一行很小的 AI 生成聲明 ---------- */
.credit { display: none; position: fixed; left: 24px; bottom: 18px; font-size: 11px; letter-spacing: .1em; color: rgba(239,232,219,.42); pointer-events: none; }
body.hud-off .hud-title, body.hud-off .hud-bottom, body.hud-off .hint { display: none !important; }
body.hud-off .credit { display: block; }
