/* ============================================================
   实验室 · 每日模拟器训练报名
   视觉：机位牌 / 仪表舱 —— 深墨底、琥珀信号、硬边切角
   ============================================================ */
:root {
  --ink: #08090a;
  --ink-2: #0d1011;
  --panel: #111516;
  --panel-2: #161b1d;
  --line: rgba(232, 240, 236, 0.10);
  --line-2: rgba(232, 240, 236, 0.20);
  --text: #edf1ee;
  --dim: #a6b3b0;
  --dim-2: #86928f;
  --amber: #ffb02e;
  --amber-d: #d98f16;
  --green: #46e0a0;
  --red: #ff6a5a;
  --paper: #f1ece0;
  --paper-ink: #14181a;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Mono", ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --r: 2px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 78% -12%, rgba(255, 176, 46, 0.10), transparent 62%),
    radial-gradient(760px 500px at 6% 100%, rgba(70, 224, 160, 0.06), transparent 60%),
    linear-gradient(rgba(232, 240, 236, 0.028) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(232, 240, 236, 0.028) 1px, transparent 1px) 0 0 / 46px 100%;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--amber); color: #000; }

/* ---------------- 布局 ---------------- */
.shell { position: relative; z-index: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 0 18px 56px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 18px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--amber); color: #000; font-family: var(--mono); font-weight: 700; font-size: 15px;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.brand-txt span { font-family: var(--mono); font-size: 9.5px; color: var(--dim-2); letter-spacing: 0.18em; }
.top-date { font-family: var(--mono); font-size: 11px; color: var(--dim); text-align: right; }
.top-date b { display: block; color: var(--text); font-size: 12.5px; font-weight: 500; }

/* ---------------- 席位盘 ---------------- */
.board { padding: 26px 0 4px; }
.eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--dim-2);
  display: flex; align-items: center; gap: 9px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--amber); }
h1 {
  margin: 14px 0 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em;
}
h1 em { font-style: normal; color: var(--amber); }

.gauge { display: flex; align-items: flex-end; gap: 14px; margin: 22px 0 6px; }
.gauge-num {
  font-family: var(--mono); font-size: 76px; line-height: 0.82; font-weight: 600; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums; color: var(--amber);
  text-shadow: 0 0 42px rgba(255, 176, 46, 0.35);
}
.gauge-sub { padding-bottom: 4px; border-left: 1px solid var(--line-2); padding-left: 14px; }
.gauge-sub b { display: block; font-size: 15px; font-weight: 600; }
.gauge-sub span { font-family: var(--mono); font-size: 11px; color: var(--dim-2); letter-spacing: 0.1em; }

.meter { display: flex; gap: 4px; margin: 20px 0 22px; height: 4px; }
.meter i { flex: 1; background: rgba(232, 240, 236, 0.10); }
.meter i.on { background: var(--amber); }
.meter.full i.on { background: var(--red); }
.meter-cap { font-family: var(--mono); font-size: 9.5px; color: var(--dim-2); letter-spacing: 0.08em; margin: -14px 0 18px; }
.board.loading { opacity: 0.55; transition: opacity 0.15s; }

.seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.seat {
  position: relative; min-height: 66px; padding: 9px 10px 10px;
  border: 1px solid var(--line); background: rgba(232, 240, 236, 0.02);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.seat .no { font-family: var(--mono); font-size: 9.5px; color: var(--dim-2); letter-spacing: 0.12em; }
.seat .nm { font-size: 12.5px; color: var(--dim); }
.seat .nm.empty { color: var(--dim-2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }
.seat.taken { border-color: rgba(255, 176, 46, 0.42); background: rgba(255, 176, 46, 0.07); }
.seat.taken .nm { color: var(--text); font-weight: 600; }
.seat.trained { border-color: rgba(70, 224, 160, 0.38); background: rgba(70, 224, 160, 0.06); }
.seat.trained .nm { color: var(--green); font-weight: 600; }
.seat-tag { margin-top: 3px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--dim-2); }
.seat.taken .seat-tag { color: rgba(255, 176, 46, 0.85); }
.seat.trained .seat-tag { color: rgba(70, 224, 160, 0.85); }
.seat .dot {
  position: absolute; top: 9px; right: 11px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--line-2);
}
.seat.taken .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.seat.trained .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.note-line {
  margin: 18px 0 0; font-size: 12.5px; color: var(--dim); line-height: 1.7;
  display: flex; gap: 8px; align-items: flex-start;
}
.note-line::before { content: "※"; color: var(--amber); font-size: 11px; line-height: 1.9; }

/* ---------------- 日期条 ---------------- */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 34px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.sec-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.sec-head span { font-family: var(--mono); font-size: 10px; color: var(--dim-2); letter-spacing: 0.16em; }

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.day {
  min-width: 0; padding: 9px 2px 8px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.day b { display: block; font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.day span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em; display: block; margin-top: 2px; }
.day:hover { border-color: var(--line-2); }
.day.on { border-color: var(--amber); background: rgba(255, 176, 46, 0.10); }
.day.on b, .day.on span { color: var(--amber); }
.day:disabled { opacity: 0.32; cursor: not-allowed; }

/* ---------------- 表单 ---------------- */
.panel {
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(22, 27, 29, 0.92), rgba(13, 16, 17, 0.92));
  padding: 20px 18px 22px; position: relative;
}
.panel::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 34px; height: 2px; background: var(--amber);
}
.field { margin-bottom: 16px; }
.field label {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12px; color: var(--dim); margin-bottom: 7px; letter-spacing: 0.02em;
}
.field label i { font-family: var(--mono); font-style: normal; font-size: 9px; color: var(--dim-2); letter-spacing: 0.14em; }
.field input {
  width: 100%; height: 46px; padding: 0 13px; background: rgba(0, 0, 0, 0.36);
  border: 1px solid var(--line); border-radius: 0; color: var(--text); font-size: 15px;
  outline: none; transition: border-color 0.16s, background 0.16s;
}
.field input::placeholder { color: #4d5756; font-size: 13.5px; }
.field input:focus { border-color: var(--amber); background: rgba(255, 176, 46, 0.05); }
.field input:invalid:not(:placeholder-shown) { border-color: rgba(255, 106, 90, 0.5); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; cursor: pointer; height: 52px; padding: 0 20px; width: 100%;
  background: var(--amber); color: #0a0a0a; font-size: 15.5px; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: transform 0.12s, background 0.16s;
}
.btn:hover { background: #ffc052; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: #2a2f30; color: #6b7473; cursor: not-allowed; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line-2); color: var(--text);
  height: 44px; font-size: 13.5px; font-weight: 500; clip-path: none;
}
.btn-ghost:hover { background: rgba(232, 240, 236, 0.05); border-color: var(--dim); }
.btn-line { background: transparent; border: 1px solid var(--line-2); color: var(--dim); height: 38px; font-size: 12.5px; font-weight: 500; clip-path: none; }
.btn-line:hover { color: var(--text); border-color: var(--dim); }
.btn-sm { height: 34px; width: auto; padding: 0 12px; font-size: 12px; font-weight: 600; }

.hint { font-size: 13px; color: var(--dim); margin: 10px 0 0; line-height: 1.65; }
label .req { color: var(--amber); letter-spacing: 0.14em; }
.rescue { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--dim); }
.rescue a { color: var(--amber); text-decoration: none; border-bottom: 1px solid rgba(255, 176, 46, 0.4); padding-bottom: 1px; }
.alert {
  display: none; margin: 0 0 14px; padding: 11px 13px; font-size: 13px; line-height: 1.55;
  border-left: 2px solid var(--red); background: rgba(255, 106, 90, 0.08); color: #ffb4ab;
}
.alert.show { display: block; animation: shake 0.32s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ---------------- 取票（成功） ---------------- */
.ticket {
  background: var(--paper); color: var(--paper-ink); position: relative;
  padding: 24px 20px 22px; margin-top: 4px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.ticket::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background-image: radial-gradient(circle at 5px 7px, rgba(20, 24, 26, 0.14) 3px, transparent 3.2px);
  background-size: 11px 7px; background-repeat: repeat-x;
}
.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ticket-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: #5b564b; }
.ticket h3 { margin: 6px 0 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.ticket-stamp {
  border: 1.5px solid var(--paper-ink); padding: 3px 7px; font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.16em; transform: rotate(3deg); white-space: nowrap;
}
.ticket-code {
  margin: 18px 0 4px; padding: 14px 0; border-top: 1px dashed rgba(20, 24, 26, 0.35); border-bottom: 1px dashed rgba(20, 24, 26, 0.35);
  font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: 0.14em; text-align: center;
}
.ticket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin-top: 14px; }
.ticket-grid div span { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: #56514a; }
.ticket-grid div b { font-size: 13.5px; font-weight: 600; }
.ticket-foot { margin-top: 16px; font-size: 12.5px; color: #514c45; line-height: 1.7; }
.ticket-acts { display: flex; gap: 10px; margin-top: 14px; }
.ticket-acts .btn { flex: 1; }

/* ---------------- 名单 ---------------- */
.roster { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  border: 1px solid var(--line); font-size: 12px; color: var(--dim);
  background: rgba(232, 240, 236, 0.02);
}
.chip b { color: var(--text); font-weight: 600; }
.chip::before { content: ""; width: 4px; height: 4px; background: var(--amber); }
.chip.quiet::before { background: var(--dim-2); }

/* ---------------- 弹层 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 40; display: none; align-items: flex-end; justify-content: center;
  background: rgba(4, 5, 6, 0.78); backdrop-filter: blur(3px); padding: 0;
}
.modal.open { display: flex; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 480px; background: var(--panel-2); border-top: 1px solid var(--line-2);
  padding: 22px 20px 26px; max-height: 86vh; overflow-y: auto; animation: up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes up { from { transform: translateY(18px); } to { transform: translateY(0); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.x {
  width: 30px; height: 30px; border: 1px solid var(--line); background: transparent; color: var(--dim);
  cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.x:hover { color: var(--text); border-color: var(--dim); }

.mine { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.mine-row {
  border: 1px solid var(--line); padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.mine-row .m1 { font-size: 13.5px; font-weight: 600; }
.mine-row .m2 { font-family: var(--mono); font-size: 10.5px; color: var(--dim-2); letter-spacing: 0.06em; }
.st { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; padding: 2px 6px; border: 1px solid; white-space: nowrap; }
.st.booked { color: var(--amber); border-color: rgba(255, 176, 46, 0.5); }
.st.trained { color: var(--green); border-color: rgba(70, 224, 160, 0.5); }
.st.absent { color: var(--red); border-color: rgba(255, 106, 90, 0.5); }
.st.cancelled { color: var(--dim-2); border-color: var(--line); }

body.ticket-mode #daysSec,
body.ticket-mode #boardSec,
body.ticket-mode #formHead,
body.ticket-mode #bookForm { display: none; }
body.ticket-mode .foot { margin-top: 26px; }
body.ticket-mode #formSec { padding-top: 18px; }
body.ticket-mode .ticket { margin-top: 0; }

.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.foot span { font-family: var(--mono); font-size: 10px; color: var(--dim-2); letter-spacing: 0.14em; }
.foot a { font-size: 13px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.foot a:hover { color: var(--amber); border-color: var(--amber); }
.foot a { border-color: rgba(232, 240, 236, 0.28); }

.enter { animation: rise 0.5s cubic-bezier(0.16, 0.9, 0.3, 1) both; }
.enter-2 { animation-delay: 0.06s; }
.enter-3 { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------- 桌面 ---------------- */
@media (min-width: 760px) {
  .shell { max-width: 560px; padding: 0 24px 72px; }
  h1 { font-size: 36px; }
  .gauge-num { font-size: 92px; }
  .seats { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .seat { min-height: 76px; }
  body { font-size: 15.5px; }
}
