/* =====================================================================
 *  鏡土預約系統 — 共用樣式＋玩家預約頁
 *  想改顏色？只要改下面 :root 裡的顏色代碼即可。
 * ===================================================================== */
:root {
  --bg: #0d0f14;
  --panel: #161a23;
  --panel2: #1d2230;
  --panel3: #242a3a;
  --line: #2a3142;
  --line2: #3a4258;
  --text: #ebe7df;
  --muted: #9aa0b0;
  --dim: #636a7d;
  --gold: #cfae72;
  --gold2: #ecd29c;
  --gold-bg: rgba(207, 174, 114, .13);
  --ok: #4fbf86;
  --ok-bg: rgba(79, 191, 134, .15);
  --warn: #e5a93d;
  --warn-bg: rgba(229, 169, 61, .15);
  --danger: #e66262;
  --danger-bg: rgba(230, 98, 98, .15);
  --info: #6c9cf0;
  --info-bg: rgba(108, 156, 240, .15);
  --radius: 14px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .38);
  --sans: 'Noto Sans TC', system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --serif: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(1100px 520px at 50% -180px, rgba(207, 174, 114, .11), transparent 70%),
    radial-gradient(700px 380px at 100% 0, rgba(108, 156, 240, .06), transparent 70%);
  background-attachment: fixed;
}
a { color: var(--gold2); }
code { background: rgba(255, 255, 255, .08); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- 示範模式提示 ---------- */
.demo-banner {
  background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid rgba(229, 169, 61, .35);
  text-align: center; font-size: 13px; padding: 6px 12px;
}

/* ---------- Logo：鏡面倒影 ---------- */
.logo {
  position: relative; display: inline-block;
  font-family: var(--serif); font-weight: 900; font-size: 56px; letter-spacing: .18em; line-height: 1.1;
  padding-left: .18em;
  background: linear-gradient(180deg, #f6e7c4 0%, var(--gold) 60%, #8d7243 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 26px;
}
.logo::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 100%; padding-left: .18em;
  transform: scaleY(-1); transform-origin: top;
  background: linear-gradient(0deg, rgba(207, 174, 114, .32) 0%, rgba(207, 174, 114, 0) 55%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  pointer-events: none;
}
.logo-sm { font-size: 40px; margin-bottom: 18px; }

/* ---------- 版面 ---------- */
.hero { text-align: center; padding: 38px 16px 10px; }
.hero h1 { font-family: var(--serif); font-size: 24px; margin: 0; letter-spacing: .08em; }
.tagline { color: var(--muted); margin: 6px 0 0; font-size: 14px; letter-spacing: .05em; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 14px 40px; }
.foot { text-align: center; color: var(--dim); font-size: 12px; padding: 20px 0 34px; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0)) , var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.step-title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0 0 14px; font-weight: 700; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--gold-bg); color: var(--gold2); border: 1px solid rgba(207, 174, 114, .45); font-size: 14px;
}
.hint { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.hint b { color: var(--gold2); }

.announce {
  border: 1px solid rgba(207, 174, 114, .35); background: var(--gold-bg); color: var(--gold2);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; white-space: pre-line;
}
.load-box { text-align: center; padding: 50px 0; color: var(--muted); }
.error-box { text-align: center; padding: 24px; border: 1px solid rgba(230, 98, 98, .4); background: var(--danger-bg); color: #ffb3b3; border-radius: 12px; margin-bottom: 16px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid var(--line2); border-top-color: var(--gold); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 按鈕／表單 ---------- */
.btn {
  appearance: none; border: 1px solid var(--line2); background: var(--panel2); color: var(--text);
  border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, opacity .15s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #dcbb7e, #b8955a); border-color: #c9a96b; color: #1b1406; font-weight: 700; }
.btn-primary:hover { background: linear-gradient(180deg, #e8c98c, #c4a165); border-color: var(--gold2); }
.btn-ghost { background: transparent; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: rgba(230, 98, 98, .45); }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 13px 18px; font-size: 17px; letter-spacing: .1em; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.icon-btn {
  appearance: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--panel2); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; flex: none;
}
.icon-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold2); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }

.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.field em { color: var(--danger); font-style: normal; }
.help { display: block; color: var(--dim); font-size: 12px; margin-top: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #10131a; border: 1px solid var(--line2);
  border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(207, 174, 114, .18); }
input::placeholder, textarea::placeholder { color: var(--dim); }
textarea { resize: vertical; }
select { cursor: pointer; }
input[type="date"] { color-scheme: dark; }
input[type="checkbox"] { width: auto; accent-color: var(--gold); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  appearance: none; border: 1px solid var(--line2); background: var(--panel2); color: var(--text);
  border-radius: 999px; padding: 8px 18px; font: inherit; cursor: pointer; min-width: 70px;
}
.pill:hover { border-color: var(--gold); }
.pill.active { background: var(--gold-bg); border-color: var(--gold); color: var(--gold2); font-weight: 700; }

.chip {
  appearance: none; border: 1px solid var(--line2); background: var(--panel2); color: var(--text);
  border-radius: 8px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--gold-bg); border-color: var(--gold); color: var(--gold2); }

.form-msg { border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.form-msg.error { background: var(--danger-bg); color: #ffb3b3; border: 1px solid rgba(230, 98, 98, .4); }
.form-msg.ok { background: var(--ok-bg); color: #a9ecc7; border: 1px solid rgba(79, 191, 134, .4); }
.fine { color: var(--dim); font-size: 12px; margin: 10px 0 0; text-align: center; }

.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid; line-height: 1.5; }
.tag-pending { color: var(--warn); border-color: rgba(229, 169, 61, .5); background: var(--warn-bg); }
.tag-closed { color: var(--danger); border-color: rgba(230, 98, 98, .45); background: var(--danger-bg); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--panel3); color: var(--text); border: 1px solid var(--line2); border-radius: 12px;
  padding: 11px 18px; box-shadow: var(--shadow); z-index: 1000; transition: all .25s; max-width: 92vw; font-size: 14px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(79, 191, 134, .6); }
.toast.error { border-color: rgba(230, 98, 98, .7); color: #ffc4c4; }
.toast.warn { border-color: rgba(229, 169, 61, .7); }

/* ---------- 月曆（玩家） ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-weight: 700; font-size: 16px; letter-spacing: .05em; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-week span { text-align: center; color: var(--muted); font-size: 13px; padding: 2px 0; }
.cal-week .we { color: var(--gold); }
.cal-day {
  appearance: none; position: relative; aspect-ratio: 1 / 1; min-height: 42px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0;
}
.cal-day.empty { visibility: hidden; }
.cal-day .n { font-size: 15px; font-weight: 500; line-height: 1; }
.cal-day .s { font-size: 10px; color: var(--dim); line-height: 1; }
.cal-day.we .n { color: var(--gold2); }
.cal-day:hover:not(:disabled) { border-color: var(--gold); }
.cal-day:disabled { cursor: not-allowed; background: transparent; border-color: transparent; }
.cal-day.st-out .n { color: var(--dim); opacity: .5; }
.cal-day.st-full .n { color: var(--dim); text-decoration: line-through; }
.cal-day.today::after { content: ''; position: absolute; inset: 3px; border-radius: 8px; border: 1px dashed var(--line2); pointer-events: none; }
.cal-day.selected { background: linear-gradient(180deg, #dcbb7e, #b8955a); border-color: var(--gold2); }
.cal-day.selected .n { color: #1b1406; font-weight: 700; }
.cal-day.selected .dot { background: #1b1406; box-shadow: none; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.dot-open { background: var(--ok); box-shadow: 0 0 6px rgba(79, 191, 134, .6); }
.dot-few { background: var(--warn); box-shadow: 0 0 6px rgba(229, 169, 61, .6); }
.dot-full { background: var(--dim); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 12px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 場館／時段 ---------- */
.venue-list { display: grid; gap: 14px; }
.venue-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: rgba(0, 0, 0, .15); }
.venue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.venue-head h3 { margin: 0; font-size: 17px; font-family: var(--serif); color: var(--gold2); letter-spacing: .1em; }
.venue-addr { color: var(--muted); font-size: 12px; }
.venue-desc { color: var(--muted); font-size: 13px; margin: -4px 0 10px; }
.slot-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.slot-btn {
  appearance: none; text-align: left; border: 1px solid var(--line2); background: var(--panel2); color: var(--text);
  border-radius: 12px; padding: 10px 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  transition: border-color .15s, background .15s;
}
.slot-btn b { font-size: 18px; letter-spacing: .03em; }
.slot-range { font-size: 12px; color: var(--muted); }
.slot-left { font-size: 13px; color: var(--ok); font-weight: 500; }
.slot-btn.last .slot-left { color: var(--warn); }
.slot-btn:hover:not(:disabled) { border-color: var(--gold); }
.slot-btn.off { opacity: .45; cursor: not-allowed; background: transparent; }
.slot-btn.off .slot-left { color: var(--dim); }
.slot-btn.selected { border-color: var(--gold2); background: var(--gold-bg); box-shadow: 0 0 0 2px rgba(207, 174, 114, .35) inset; }
.slot-btn.selected b { color: var(--gold2); }

/* ---------- 劇本 ---------- */
.script-wrap { margin-top: 10px; }
.script-chips { margin-top: 10px; display: grid; gap: 8px; }
.chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip-label { font-size: 12px; color: var(--gold); min-width: 64px; }

/* ---------- 摘要／成功 ---------- */
.summary { display: grid; grid-template-columns: 84px 1fr; gap: 8px 12px; margin: 0 0 14px; font-size: 15px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 500; word-break: break-all; }
.summary dd.missing { color: var(--dim); font-weight: 400; }
.summary .bk-id { font-family: ui-monospace, Consolas, monospace; color: var(--gold2); font-size: 17px; letter-spacing: .05em; }
.success { text-align: center; }
.success h2 { font-family: var(--serif); margin: 6px 0 4px; letter-spacing: .1em; }
.success .summary { text-align: left; max-width: 420px; margin: 18px auto; }
.success-icon {
  width: 64px; height: 64px; margin: 6px auto 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 32px; color: var(--ok); background: var(--ok-bg); border: 1px solid rgba(79, 191, 134, .5);
}

@media (min-width: 720px) {
  .card { padding: 24px 26px; }
  .cal-day .n { font-size: 16px; }
}
@media (max-width: 560px) {
  .slot-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .slot-btn { text-align: center; align-items: center; padding: 9px 4px; }
  .slot-btn b { font-size: 17px; }
  .slot-range { font-size: 11px; }
  .slot-desc { display: none; }
  .slot-left { font-size: 12px; }
  .venue-card { padding: 12px 10px; }
}
@media (max-width: 340px) {
  .cal-week, .cal-grid { gap: 4px; }
  .slot-row { grid-template-columns: 1fr; }
  .logo { font-size: 46px; }
}
