/* ═══════════════════════════════════════════════════════════
   蘭境 · Liminal Field — 城市異常點接收器
   暗色、安靜、精密的儀器。琥珀只在城市回應你的那一刻亮一次。
   ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* 墨金深色系：暖金=儀器本體與選取，冷綠=城市訊號，琥珀=鎖定瞬間 */
  --bg: #0e0f12;
  --bg-elevated: #15171c;  /* 兩翼表面 */
  --panel: #1a1d23;        /* 卡片表面 */
  --panel-2: #21242c;      /* 更高一階 */

  --gold: #c2a574;
  --gold-dim: #8c7d5e;
  --amber: #e7b75c;        /* 鎖定峰值，全頁最亮 */

  --forest: #4e9a7d;       /* 訊號冷綠 */
  --forest-soft: #3f8068;
  --forest-bright: #63b89a;
  --forest-deep: #16392f;

  --silver: #ece6d6;       /* 暖象牙主文字 */
  --silver-dim: #9c9684;
  --silver-ghost: #6a6557;

  --graphite: #2b2e36;     /* 盤面環線（暖灰、較亮） */
  --line: rgba(194, 165, 116, 0.14);     /* 暖金髮絲線 */
  --line-strong: rgba(194, 165, 116, 0.24);

  --red: #c4604f;
  --street: #20292a;

  --card-radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 14px 38px -16px rgba(0, 0, 0, 0.74);
  --shadow-soft: 0 6px 18px -10px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --serif: "Noto Serif TC", "Songti TC", "Songti SC", serif;
  --mono: "DM Mono", "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 680px at 50% -8%, rgba(194, 165, 116, 0.06), transparent 60%),
    radial-gradient(900px 600px at 50% 120%, rgba(78, 154, 125, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--silver);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.readout {
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ── 主骨架：儀表三聯屏 ─────────────────────────────── */
.receiver {
  display: grid;
  grid-template-columns:
    [edge] clamp(244px, 22vw, 288px)
    [center] minmax(0, 1fr)
    [side] clamp(212px, 18vw, 252px);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "brand brand brand"
    "tuner stage dossier";
  gap: 0;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1640px;
  margin: 0 auto;
}

.brand { grid-area: brand; }
.tuner { grid-area: tuner; }
.stage { grid-area: stage; }
.dossier { grid-area: dossier; }

/* ── 品牌列 ───────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--silver);
}

.brand-en {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--silver-dim);
}

.brand-nav {
  display: flex;
  gap: 18px;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--silver-dim);
  cursor: pointer;
  transition: color 160ms var(--ease);
}

.link-btn:hover { color: var(--silver); }
.link-reset:hover { color: var(--red); }

/* ── 左右兩欄共同質感（聚光燈打在盤面，兩翼退半階） ─── */
.tuner,
.dossier {
  padding: 28px;
  background: var(--bg-elevated);
  transition: opacity 420ms var(--ease), filter 420ms var(--ease);
}

.tuner {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.dossier {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── 表單欄位 ─────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--silver);
}

.field-label .readout {
  font-size: 12px;
  color: var(--gold);
}

/* 模式四選 */
.modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}

.mode:hover { border-color: var(--line-strong); background: var(--panel-2); }

.mode.is-active {
  border-color: rgba(194, 165, 116, 0.55);
  background: linear-gradient(180deg, rgba(194, 165, 116, 0.16), rgba(194, 165, 116, 0.06));
  box-shadow: inset 0 1px 0 rgba(231, 183, 92, 0.12), 0 6px 18px -12px rgba(194, 165, 116, 0.5);
}

.mode.is-active .mode-name { color: var(--amber); }
.mode.is-active .mode-hint { color: var(--silver); }

.mode-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--silver);
}

.mode-hint {
  font-size: 11.5px;
  color: var(--silver-dim);
}

/* 多人共振：左欄只收「人數與代號」，真正的按壓儀式仍留在盤面 */
.group-count {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.count-pill {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--silver-dim);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.count-pill:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
  color: var(--silver);
}

.count-pill.is-active {
  border-color: rgba(194, 165, 116, 0.55);
  background: linear-gradient(180deg, rgba(194, 165, 116, 0.16), rgba(194, 165, 116, 0.06));
  color: var(--amber);
  box-shadow: inset 0 1px 0 rgba(231, 183, 92, 0.12), 0 6px 18px -14px rgba(194, 165, 116, 0.5);
}

.participant-names {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
}

.participant-names.is-visible { display: grid; }

.participant-name {
  min-height: 40px;
}

.field-hint {
  margin: -2px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--silver-dim);
}

.group-field.is-single .field-hint,
.group-field.is-single .participant-names {
  display: none;
}

/* 滑桿 */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--graphite);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--gold), 0 0 10px rgba(194, 165, 116, 0.5);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--bg);
}

/* 座標輸入 = 儀器讀數 */
.coord-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.readout-input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--silver);
  outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.readout-input {
  min-height: 42px;
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.readout-input:focus,
textarea:focus {
  border-color: rgba(194, 165, 116, 0.6);
  background: var(--panel-2);
  box-shadow: 0 0 0 3px rgba(194, 165, 116, 0.12);
}

select.readout-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--silver-dim) 50%),
    linear-gradient(135deg, var(--silver-dim) 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* 進階設定（左欄） */
.advanced-settings {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.advanced-settings summary,
.advanced-details summary {
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--silver-dim);
  user-select: none;
}

.advanced-settings summary::-webkit-details-marker,
.advanced-details summary::-webkit-details-marker { display: none; }

.advanced-settings summary::after,
.advanced-details summary::after {
  content: " ⌄";
  color: var(--silver-ghost);
}

.advanced-settings[open] summary { margin-bottom: 16px; }

/* ═══ 中央：接收盤面 ═══════════════════════════════ */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: 32px 28px;
  min-width: 0;
  overflow-y: auto;
}

.dial-caption {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.03em;
  text-align: center;
  color: var(--silver);
  transition: opacity 360ms var(--ease);
}

/* 校準與揭示時，盤面上方改為沉靜小標（中文易讀、省出垂直空間） */
.receiver[data-stage="c"] .dial-caption,
.receiver[data-stage="d"] .dial-caption {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--silver-dim);
  margin-bottom: 16px;
}
.receiver[data-stage="d"] .dial-caption {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.dial-wrap {
  position: relative;
  width: min(44vh, 100%, 400px);
  aspect-ratio: 1;
  flex: none;
  transition: width 500ms var(--ease), transform 500ms var(--ease);
}

.dial {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.dial-sub {
  margin: 18px 0 0;
  min-height: 18px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--silver-dim);
  text-align: center;
  transition: opacity 220ms var(--ease);
}

.dial-sub .amber { color: var(--amber); }

.press-points[hidden] { display: none; }

.press-points {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.press-point {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(194, 165, 116, 0.56);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 46%, rgba(231, 183, 92, 0.22), rgba(194, 165, 116, 0.08) 52%, rgba(14, 15, 18, 0.76) 72%),
    var(--panel);
  color: var(--silver);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(14, 15, 18, 0.72), 0 10px 22px -16px rgba(194, 165, 116, 0.85);
  transition: border-color 140ms var(--ease), background 140ms var(--ease), color 140ms var(--ease), box-shadow 140ms var(--ease), transform 140ms var(--ease);
}

.press-point::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(78, 154, 125, 0.24);
  border-radius: 50%;
}

.press-point.is-active {
  border-color: rgba(231, 183, 92, 0.88);
  background:
    radial-gradient(circle at 50% 46%, rgba(231, 183, 92, 0.62), rgba(194, 165, 116, 0.18) 58%, rgba(14, 15, 18, 0.74) 76%),
    var(--panel);
  color: var(--amber);
  box-shadow: 0 0 18px rgba(231, 183, 92, 0.42), 0 0 32px rgba(78, 154, 125, 0.18);
  transform: translate(-50%, -50%) scale(1.04);
}

.receiver[data-resonance="armed"] .dial-wrap {
  width: min(50vh, 100%, 430px);
}

.receiver[data-resonance="armed"] .scan-ring {
  opacity: 0.72;
}

.receiver[data-resonance="armed"] .core {
  fill: var(--gold);
  filter: drop-shadow(0 0 8px rgba(194, 165, 116, 0.64));
}

.group-resonance[hidden] { display: none; }

.group-resonance {
  width: min(100%, 560px);
  margin-top: 18px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.receiver[data-resonance="armed"] .group-resonance {
  display: flex;
}

.resonance-copy {
  max-width: 500px;
  margin: -2px 0 2px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--silver-dim);
}

.resonance-meter {
  width: min(100%, 420px);
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--graphite);
}

.resonance-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--gold), var(--amber));
  box-shadow: 0 0 18px rgba(231, 183, 92, 0.32);
  transition: width 80ms linear;
}

.resonance-status {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  color: var(--gold);
}

.receiver[data-resonance="armed"] .compose-intent,
.receiver[data-resonance="armed"] .compose-actions {
  opacity: 0.24;
  filter: blur(3px);
  pointer-events: none;
}

/* ── 盤面圖元 ─────────────────────────────────────── */
.dial-field { /* 暖金徑向輝光，給盤面存在感 */ }

.ring {
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1;
}
/* 內圈較亮、外圈較淡，營造景深 */
.ring:nth-of-type(1) { stroke: rgba(194, 165, 116, 0.10); }
.ring:nth-of-type(2) { stroke: rgba(194, 165, 116, 0.16); }
.ring:nth-of-type(3) { stroke: rgba(194, 165, 116, 0.22); }
.ring:nth-of-type(4) { stroke: rgba(194, 165, 116, 0.30); }

.ticks line {
  stroke: rgba(194, 165, 116, 0.30);
  stroke-width: 1;
}
.ticks line.major { stroke: rgba(194, 165, 116, 0.55); }

.crosshair line {
  stroke: rgba(194, 165, 116, 0.18);
  stroke-width: 1;
  stroke-dasharray: 2 6;
}

.scan-ring {
  fill: none;
  stroke: var(--forest);
  stroke-width: 1;
  opacity: 0.45;
  transition: r 240ms var(--ease), opacity 360ms var(--ease);
}

.sector path {
  fill: var(--forest-deep);
  opacity: 0;
  transition: opacity 600ms var(--ease);
}

.streets line {
  stroke: var(--street);
  stroke-width: 1;
}

.noise circle {
  fill: var(--silver-dim);
}

.scanline {
  transform-origin: 200px 200px;
  opacity: 0;
}
.scanline line {
  stroke: var(--forest);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.target { transition: transform 600ms var(--ease); }

.lockring {
  fill: none;
  stroke: var(--forest);
  stroke-width: 1.4;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.core {
  fill: var(--forest);
  filter: drop-shadow(0 0 5px rgba(78, 154, 125, 0.7));
  transform-box: fill-box;
  transform-origin: center;
}

.seal { opacity: 0; transition: opacity 500ms var(--ease); }
.seal path { fill: none; stroke: var(--amber); stroke-width: 1.4; }
.seal text {
  fill: var(--amber);
  font-family: var(--sans);
  font-size: 11px;
  text-anchor: middle;
}

/* 待機呼吸（A / B） */
.receiver[data-stage="a"] .core,
.receiver[data-stage="b"] .core {
  animation: breathe 4s var(--ease) infinite;
  opacity: 0.85;
}
.receiver[data-stage="b"] .core { animation-duration: 2.6s; }

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.5); opacity: 1; }
}

/* 模式脾氣（盤面隨選擇微調） */
.dial[data-mode="power"] .ring { animation: ringPulse 3s var(--ease) infinite; }
.dial[data-mode="blind"] .scan-ring { animation: jitter 1.6s steps(6) infinite; }
@keyframes ringPulse { 50% { opacity: 0.55; } }
@keyframes jitter { 25% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 1px); } }

/* 鎖定後的生命感（D 起） */
.receiver[data-stage="d"] .core,
.receiver[data-stage="e"] .core {
  animation: coreBreathe 3.2s var(--ease) infinite;
}
.receiver[data-stage="d"] .lockring,
.receiver[data-stage="e"] .lockring {
  opacity: 0.5;
  animation: ringSpin 24s linear infinite;
}
@keyframes coreBreathe {
  0%, 100% { transform: scale(1); opacity: 0.88; }
  50% { transform: scale(1.18); opacity: 1; }
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* 鎖定核心 = 全頁唯一的琥珀 */
.dial.is-locked .core {
  fill: var(--amber);
  filter: drop-shadow(0 0 10px rgba(231, 183, 92, 0.85)) drop-shadow(0 0 22px rgba(231, 183, 92, 0.45));
}
.dial.is-locked .lockring { stroke: var(--amber); }
.dial.is-locked .sector path { opacity: 1; }
.dial.is-locked .seal { opacity: 1; }

/* ── 校準四幕的暫態動畫 ───────────────────────────── */
.dial.scanning .scanline {
  opacity: 1;
  animation: scanSpin 0.7s linear infinite;
}
@keyframes scanSpin { to { transform: rotate(360deg); } }

.core.is-jitter { animation: coreJitter 0.12s steps(2) infinite; }
@keyframes coreJitter {
  0% { transform: translate(1.5px, 0); }
  50% { transform: translate(-1.5px, 1px); }
  100% { transform: translate(0, -1.5px); }
}

.core.rebound { animation: rebound 0.34s var(--ease); }
@keyframes rebound {
  0% { transform: scale(1); }
  55% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.lockring.prelock {
  opacity: 0.6;
  stroke-dasharray: 5 7;
  animation: ringSpin 6s linear infinite;
}

.carrier-pulse {
  fill: none;
  stroke: var(--forest);
  stroke-width: 1;
  animation: carrierPulse 0.5s var(--ease) forwards;
}
@keyframes carrierPulse {
  from { r: 4px; opacity: 0.6; }
  to { r: 62px; opacity: 0; }
}

.amber-pulse {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.4;
  animation: amberPulse 0.7s var(--ease) forwards;
}
@keyframes amberPulse {
  from { r: 4px; opacity: 0.5; }
  to { r: 50px; opacity: 0; }
}

@keyframes seep { to { stroke-dashoffset: 0; } }

.coordinate.flash { animation: coordFlash 0.46s var(--ease); }
@keyframes coordFlash { 50% { color: var(--amber); } }

.seal-svg { display: block; }

/* ── 結果 / 紀錄 / 歷史 面板 ───────────────────────── */
.panel {
  width: 100%;
  display: none;
}

.panel-reveal {
  margin-top: 8px;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.coordinate {
  margin: 0;
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 400;
  color: var(--silver);
  text-align: center;
  text-shadow: 0 0 18px rgba(231, 183, 92, 0.18);
}

.reveal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--silver);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), transform 120ms var(--ease), box-shadow 180ms var(--ease);
}

.btn:hover {
  border-color: rgba(194, 165, 116, 0.5);
  background: var(--panel-2);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  border-color: rgba(194, 165, 116, 0.55);
  background: linear-gradient(135deg, rgba(231, 183, 92, 0.26), rgba(194, 165, 116, 0.12));
  color: var(--silver);
  box-shadow: 0 10px 26px -12px rgba(194, 165, 116, 0.55), inset 0 1px 0 rgba(231, 183, 92, 0.18);
}
.btn-primary:hover {
  border-color: rgba(231, 183, 92, 0.7);
  background: linear-gradient(135deg, rgba(231, 183, 92, 0.36), rgba(194, 165, 116, 0.18));
}

.btn-wide { width: 100%; justify-content: center; }

.ico {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 紀錄面板 */
.panel-journal {
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
  text-align: left;
}

.panel-title {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--silver);
}

.panel-journal textarea { min-height: 110px; padding: 14px; font-size: 15px; line-height: 1.7; resize: vertical; }

.tags,
.hit-rating {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.hit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--silver-dim);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease);
}

.tag.is-active,
.hit.is-active {
  border-color: rgba(194, 165, 116, 0.55);
  background: linear-gradient(180deg, rgba(194, 165, 116, 0.16), rgba(194, 165, 116, 0.06));
  color: var(--silver);
}

.wax {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.wax-amber { background: var(--amber); }
.wax-silver { background: var(--silver-dim); }
.wax-red { background: var(--red); }

.photo-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 180ms var(--ease);
}
.photo-drop:hover { border-color: rgba(194, 165, 116, 0.5); }
.photo-hint { font-size: 13px; color: var(--silver-dim); }
.photo-drop img { max-height: 220px; max-width: 100%; border-radius: 3px; }

/* 歷史面板 */
.panel-history {
  flex-direction: column;
  gap: 4px;
  max-width: 620px;
  text-align: left;
}

.echo-list { display: flex; flex-direction: column; }

.echo {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 4px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: transform 220ms var(--ease), background 220ms var(--ease);
}
.echo:hover { transform: translateX(6px); background: rgba(255, 255, 255, 0.015); }

.echo-glyph { width: 40px; height: 40px; }
.echo-intent { font-family: var(--serif); font-size: 16px; color: var(--silver); line-height: 1.4; }
.echo-meta { margin-top: 4px; font-family: var(--mono); font-size: 11px; color: var(--silver-dim); }
.echo-summary { margin-top: 4px; font-size: 12.5px; color: var(--silver-dim); }
.echo-wax { width: 10px; height: 10px; border-radius: 50%; }

.history-empty {
  margin: 32px 0;
  text-align: center;
  color: var(--silver-dim);
  font-size: 14px;
}

/* ── 意圖輸入（盤面下方） ─────────────────────────── */
.compose-intent {
  width: 100%;
  margin-top: 24px;
  padding: 0;
  display: flex;
  justify-content: center;
}

.compose-intent textarea {
  width: min(100%, 560px);
  min-height: 56px;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  text-align: center;
  transition: border-color 160ms var(--ease);
}
.compose-intent textarea::placeholder { color: var(--silver-dim); }
textarea::placeholder { color: var(--silver-dim); }
.compose-intent.is-nudge textarea { animation: nudge 480ms var(--ease); border-color: rgba(194, 165, 116, 0.6); }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
}

/* ── 開始接收 + 安全提醒 ─────────────────────────── */
.compose-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 0 0;
}

.btn-start {
  min-width: min(100%, 560px);
  min-height: 52px;
  justify-content: center;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.safety {
  max-width: 520px;
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--red);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--silver-dim);
}

/* ── 右欄：本次檔案 / 介紹 ─────────────────────────── */
.file-seal {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
}

.file-meta,
.adv-meta { margin: 0; display: flex; flex-direction: column; }

.file-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.file-meta dt {
  font-size: 11px;
  color: var(--silver-dim);
}
.file-meta dd {
  margin: 0;
  font-size: 13px;
  color: var(--silver);
  overflow-wrap: anywhere;
}

.advanced-details { margin-top: 6px; }
.advanced-details[open] summary { margin-bottom: 14px; }

.adv-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--silver-ghost);
}
.adv-meta dt { color: var(--silver-ghost); }
.adv-meta dd { margin: 0; color: var(--silver-dim); overflow-wrap: anywhere; text-align: right; }
.advanced-details[open] .adv-meta > div { animation: lineIn 300ms var(--ease) both; }
.adv-meta > div:nth-child(2) { animation-delay: 40ms; }
.adv-meta > div:nth-child(3) { animation-delay: 80ms; }
.adv-meta > div:nth-child(4) { animation-delay: 120ms; }
.adv-meta > div:nth-child(5) { animation-delay: 160ms; }
.adv-meta > div:nth-child(6) { animation-delay: 200ms; }
.adv-meta > div:nth-child(7) { animation-delay: 240ms; }
@keyframes lineIn { from { opacity: 0; } to { opacity: 1; } }

.intro-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--silver-dim);
}

/* ── 會員中心：覆蓋式頁面，不打斷六態接收器 ───────────── */
.member-center[hidden] { display: none; }

.member-center {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.member-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 11, 0.78);
  backdrop-filter: blur(10px);
}

.member-sheet {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(860px, calc(100dvh - 48px));
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--card-radius);
  background:
    radial-gradient(760px 420px at 72% -12%, rgba(231, 183, 92, 0.09), transparent 62%),
    linear-gradient(180deg, rgba(26, 29, 35, 0.98), rgba(14, 15, 18, 0.98));
  box-shadow: 0 30px 90px -30px rgba(0, 0, 0, 0.88), inset 0 1px 0 rgba(231, 183, 92, 0.12);
}

.member-head,
.plans-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.member-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--silver);
}

.member-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--silver-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background 180ms var(--ease);
}
.member-close:hover {
  border-color: rgba(194, 165, 116, 0.52);
  background: var(--panel-2);
  color: var(--silver);
}

.member-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(260px, 1.2fr);
  gap: 14px;
  margin-top: 24px;
}

.member-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(26, 29, 35, 0.74);
  box-shadow: var(--shadow-soft);
}

.member-block h3,
.plan-card h4,
.feature-grid h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--silver);
}

.member-block h3 { font-size: 19px; line-height: 1.45; }
.member-copy {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--silver-dim);
}

.language-select-label {
  display: block;
  margin: 18px 0 8px;
  font-size: 12px;
  color: var(--silver-dim);
}

.plans-block,
.membership-features {
  margin-top: 14px;
}

.payment-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--silver-dim);
  font-size: 12px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  min-height: 248px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.plan-card.is-featured {
  border-color: rgba(231, 183, 92, 0.48);
  background:
    radial-gradient(320px 180px at 50% 0%, rgba(231, 183, 92, 0.12), transparent 72%),
    var(--panel);
  box-shadow: 0 16px 34px -24px rgba(231, 183, 92, 0.6);
}

.plan-kicker {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.plan-price {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--amber);
}

.plan-copy {
  flex: 1;
  margin: 14px 0 18px;
  color: var(--silver-dim);
  font-size: 13px;
  line-height: 1.75;
}

.plan-btn {
  width: 100%;
  justify-content: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.feature-grid > div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.feature-grid h4 {
  font-size: 15px;
}

.feature-grid p {
  margin: 10px 0 0;
  color: var(--silver-dim);
  font-size: 13px;
  line-height: 1.75;
}

html[dir="rtl"] .member-sheet,
html[dir="rtl"] .tuner,
html[dir="rtl"] .dossier,
html[dir="rtl"] .panel-journal,
html[dir="rtl"] .panel-history {
  text-align: right;
}

html[dir="rtl"] .brand-name,
html[dir="rtl"] .brand-nav,
html[dir="rtl"] .member-head,
html[dir="rtl"] .plans-head,
html[dir="rtl"] .field-label,
html[dir="rtl"] .history-head {
  flex-direction: row-reverse;
}

html[dir="rtl"] .safety {
  padding-left: 0;
  padding-right: 12px;
  border-left: 0;
  border-right: 2px solid var(--red);
}

/* ═══════════════════════════════════════════════════
   六態切換：誰顯示、兩翼如何退場
   ═══════════════════════════════════════════════════ */

/* 預設：意圖 / 開啟 只在 A、B 出現 */
.compose-intent,
.compose-actions { transition: opacity 360ms var(--ease); }

.receiver[data-stage="a"] .tuner,
.receiver[data-stage="a"] .dossier { opacity: 0.38; }

/* 校準：兩翼與輸入退場，全部注意力逼向盤面 */
.receiver[data-stage="c"] .tuner,
.receiver[data-stage="c"] .dossier,
.receiver[data-stage="c"] .compose-intent,
.receiver[data-stage="c"] .compose-actions {
  opacity: 0.22;
  filter: blur(6px);
  pointer-events: none;
}

/* 揭示 / 紀錄 / 軌跡：收起意圖與開啟，盤面交給結果 */
.receiver[data-stage="c"] .compose-intent,
.receiver[data-stage="c"] .compose-actions,
.receiver[data-stage="d"] .compose-intent,
.receiver[data-stage="d"] .compose-actions,
.receiver[data-stage="e"] .compose-intent,
.receiver[data-stage="e"] .compose-actions,
.receiver[data-stage="f"] .compose-intent,
.receiver[data-stage="f"] .compose-actions {
  display: none;
}

.receiver[data-stage="d"] .tuner,
.receiver[data-stage="e"] .tuner,
.receiver[data-stage="f"] .tuner { opacity: 0.32; pointer-events: none; }

/* 面板顯示 */
.receiver[data-stage="d"] .panel-reveal { display: flex; }
.receiver[data-stage="e"] .panel-journal { display: flex; }
.receiver[data-stage="f"] .panel-history { display: flex; }

/* 紀錄態：盤面縮為一角的定格回放 */
.receiver[data-stage="e"] .stage { justify-content: flex-start; }
.receiver[data-stage="e"] .dial-wrap {
  width: 132px;
  align-self: center;
}
.receiver[data-stage="e"] .dial-caption,
.receiver[data-stage="e"] .dial-sub { display: none; }

/* 軌跡態：盤面退下，列表為主 */
.receiver[data-stage="f"] .stage { justify-content: flex-start; }
.receiver[data-stage="f"] .dial-wrap,
.receiver[data-stage="f"] .dial-caption,
.receiver[data-stage="f"] .dial-sub { display: none; }

/* 揭示/紀錄前隱藏結果讀數 */
.receiver:not([data-stage="d"]) .dial-sub { opacity: 0; }

/* 行動鍵入場（揭示時 stagger） */
.receiver[data-stage="d"] .reveal-actions .btn {
  animation: riseIn 380ms var(--ease) both;
}
.receiver[data-stage="d"] .reveal-actions .btn:nth-child(2) { animation-delay: 60ms; }
.receiver[data-stage="d"] .reveal-actions .btn:nth-child(3) { animation-delay: 120ms; }
@keyframes riseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.receiver[data-stage="d"] .coordinate,
.receiver[data-stage="d"] .panel-reveal { animation: riseIn 460ms var(--ease) both; }

/* ═══ 手機：垂直儀器捲軸 ═══════════════════════════ */
@media (max-width: 900px) {
  .receiver {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  .brand { padding: 16px 20px; order: 0; }

  /* stage 攤平，讓盤面/意圖/結果與左欄(模式/半徑)在同一 flex 流排序 */
  /* 儀式線：意圖 → 接收偏好 → 半徑 → 開始接收 → 結果 → 紀錄 */
  .stage { display: contents; }

  .dial-caption   { order: 1; font-size: 22px; margin: 0 18px 16px; }
  .dial-wrap      { order: 2; width: min(72vw, 340px); align-self: center; }
  .group-resonance { order: 3; padding: 0 18px; }
  .dial-sub       { order: 4; padding: 0 18px; }
  .panel-reveal   { order: 5; padding: 0 18px 8px; }
  .compose-intent { order: 6; padding: 0 18px; }
  .tuner          { order: 7; border-right: 0; border-top: 1px solid var(--line); }
  .compose-actions { order: 8; padding: 22px 18px 4px; }
  .panel-journal  { order: 9; padding: 0 18px; }
  .panel-history  { order: 10; padding: 0 18px; }
  .dossier        { order: 11; border-left: 0; border-top: 1px solid var(--line); }

  .tuner,
  .dossier { background: var(--bg); }

  .compose-intent textarea,
  .btn-start { width: 100%; min-width: 0; }

  /* 校準/揭示/紀錄/軌跡：左欄收起，不在手機下方殘留調諧台 */
  .receiver[data-stage="c"] .tuner,
  .receiver[data-stage="d"] .tuner,
  .receiver[data-stage="e"] .tuner,
  .receiver[data-stage="f"] .tuner { display: none; }

  /* 觸控目標放大 */
  .link-btn { min-height: 44px; display: inline-flex; align-items: center; }

  /* 校準時盤面接管更多視窗 */
  .receiver[data-stage="c"] .dial-wrap { width: min(82vw, 400px); }
  .receiver[data-resonance="armed"] .dial-wrap { width: min(82vw, 390px); }

  .member-center { padding: 12px; }
  .member-sheet {
    max-height: calc(100dvh - 24px);
    padding: 20px;
  }
  .member-grid,
  .plans,
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .dial-caption { font-size: 20px; }
  .coordinate { font-size: clamp(19px, 6vw, 25px); max-width: 100%; }
  .reveal-actions { flex-direction: column; width: 100%; }
  .reveal-actions .btn { width: 100%; justify-content: center; }
  .press-point {
    width: 50px;
    height: 50px;
  }
}

/* ═══ 尊重 reduced-motion：關閉儀式動畫，直給結果 ═══ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
}

/* 焦點可見性（暖金環，深背景上清楚） */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* 螢幕報讀器專用（視覺隱藏但保留於可存取樹，不可用 display:none） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* 軌跡標題列 + 清空鈕 */
.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
#clearHistory.armed { color: var(--red); }

/* 回聲列右側：命中蠟點 + 刪除 */
.echo-end {
  display: flex;
  align-items: center;
  gap: 12px;
}
.echo-del {
  border: 0;
  background: none;
  color: var(--silver-ghost);
  font-size: 13px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms var(--ease), color 180ms var(--ease);
}
.echo:hover .echo-del,
.echo:focus-within .echo-del { opacity: 1; }
.echo-del:hover { color: var(--red); }
@media (hover: none) {
  .echo-del { opacity: 1; }
}
