/* ============================================================
   幕境 · 设计系统
   墨黑底 / 香槟金强调 / 细金线 / 玻璃面板 / 等宽数字
   ============================================================ */
:root {
  --bg: #08090b;
  --bg-soft: #0d0f12;
  --surface: rgba(255, 255, 255, 0.038);
  --surface-2: rgba(255, 255, 255, 0.055);
  --line: rgba(233, 213, 175, 0.11);
  --line-soft: rgba(255, 255, 255, 0.06);
  --gold: #c9a063;
  --gold-bright: #e8ce9a;
  --gold-dim: #8a6f45;
  --ink: #ede7dc;
  --ink-2: #a8a294;
  --ink-3: #6f6a60;
  --teal: #4fd1c5;
  --amber: #e08a4b;
  --violet: #7e8ce0;
  --rose: #d9737a;
  --ok: #62c08a;
  --radius: 16px;
  --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --mono: "DIN Alternate", "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(201, 160, 99, 0.16), transparent 60%),
    radial-gradient(760px 480px at 92% 108%, rgba(79, 209, 197, 0.07), transparent 62%),
    radial-gradient(1200px 700px at 50% 50%, rgba(255, 255, 255, 0.014), transparent 70%);
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app, .shell, .adm-shell, .pos-shell { position: relative; z-index: 1; height: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(201, 160, 99, 0.24); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 版式 ---------- */
.brand {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.26em;
  color: var(--gold-bright);
  font-weight: 600;
  white-space: nowrap;
}
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--ink-3);
  margin-top: 3px;
  font-weight: 400;
}
.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.gold { color: var(--gold-bright); }
.tiny { font-size: 11px; }
.center { text-align: center; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* ---------- 面板 ---------- */
.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.014));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(120%);
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 206, 154, 0.5), transparent);
  opacity: 0.7;
}
.panel.pad { padding: 20px 22px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-title { font-size: 13.5px; font-weight: 600; letter-spacing: 0.04em; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  flex: 0 0 auto;
  position: relative;
}
/* 顶栏顶部金色渐变光带（两端统一） */
.topbar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(201, 160, 99, 0), rgba(232, 206, 154, 0.85) 22%, #e8ce9a 50%, rgba(232, 206, 154, 0.85) 78%, rgba(201, 160, 99, 0));
  pointer-events: none;
}
.topbar .divider { width: 1px; height: 22px; background: var(--line); }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(98, 192, 138, 0.28);
  background: rgba(98, 192, 138, 0.08);
  font-size: 11px;
  color: #9fd9b8;
  letter-spacing: 0.06em;
}
.live-pill.off { border-color: rgba(217, 115, 122, 0.3); background: rgba(217, 115, 122, 0.08); color: #e3a0a5; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(98, 192, 138, 0.6);
  animation: pulse 2.2s infinite;
}
.live-pill.off .dot { background: var(--rose); animation: none; box-shadow: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(98, 192, 138, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(98, 192, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(98, 192, 138, 0); }
}

.clock { font-family: var(--mono); font-size: 15px; letter-spacing: 0.04em; color: var(--ink); }
.clock small { color: var(--ink-3); font-size: 10px; letter-spacing: 0.12em; margin-left: 6px; }

/* ---------- 按钮 ---------- */
.btn {
  height: 34px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-size: 12.5px;
  font-family: var(--sans);
  cursor: pointer;
  transition: 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(232, 206, 154, 0.3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #e8ce9a, #c9a063 55%, #a8823f);
  color: #17120a;
  border: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 26px -14px rgba(201, 160, 99, 0.9);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, #f0d9ab, #d3aa6c 55%, #b28b46); }
.btn-ghost { background: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-danger { border-color: rgba(217, 115, 122, 0.35); color: #eda7ac; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 11px; letter-spacing: 0.12em; color: var(--ink-3); }
.input, select.input {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  padding: 0 11px;
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: 0.16s;
  width: 100%;
}
.input:focus { border-color: rgba(232, 206, 154, 0.5); box-shadow: 0 0 0 3px rgba(201, 160, 99, 0.1); }
.input.num { font-family: var(--mono); font-size: 15px; letter-spacing: 0.02em; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.hint { font-size: 10.5px; color: var(--ink-3); }

/* ---------- 徽标 / 状态 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10px;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.03);
}
.tag.gold { color: var(--gold-bright); border-color: rgba(232, 206, 154, 0.28); background: rgba(201, 160, 99, 0.09); }
.tag.teal { color: #8fe3da; border-color: rgba(79, 209, 197, 0.28); background: rgba(79, 209, 197, 0.08); }
.tag.amber { color: #f0b183; border-color: rgba(224, 138, 75, 0.3); background: rgba(224, 138, 75, 0.09); }
.tag.violet { color: #aab4f0; border-color: rgba(126, 140, 224, 0.3); background: rgba(126, 140, 224, 0.09); }
.tag.rose { color: #eda7ac; border-color: rgba(217, 115, 122, 0.3); background: rgba(217, 115, 122, 0.08); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px 14px; }
.kpi .label { font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-3); text-transform: uppercase; }
.kpi .value {
  font-family: var(--mono);
  font-size: 30px;
  line-height: 1.15;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.kpi.hero .value {
  font-size: 40px;
  background: linear-gradient(180deg, #f8f0dd, #c9a063 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi .sub { margin-top: 6px; font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .spark { margin-top: 10px; height: 26px; }

/* ---------- 进度条 ---------- */
.bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8a6f45, #e8ce9a); transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- 房态色 ---------- */
.s-idle { --room-color: var(--teal); }
.s-occupied { --room-color: var(--gold); }
.s-cleaning { --room-color: var(--amber); }
.s-reserved { --room-color: var(--violet); }
.s-maintenance { --room-color: #7b7b7b; }

/* ---------- 列表 ---------- */
.list { width: 100%; border-collapse: collapse; }
.list th {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  font-weight: 500;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-transform: uppercase;
  white-space: nowrap;
}
.list td { padding: 10px; font-size: 12.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.035); }
.list tr:last-child td { border-bottom: none; }
.list tbody tr { transition: background 0.15s; }
.list tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

/* ---------- 滚动区 ---------- */
.scroll { overflow-y: auto; }
.scroll-thin::-webkit-scrollbar { width: 5px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; align-items: center; }
.toast {
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(18, 20, 22, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -20px #000;
  font-size: 12.5px;
  animation: toastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; align-items: center; gap: 8px;
}
.toast.ok { border-color: rgba(98, 192, 138, 0.35); }
.toast.err { border-color: rgba(217, 115, 122, 0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px);
  z-index: 60; opacity: 0; pointer-events: none; transition: 0.25s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
  background: #0c0e11; border-left: 1px solid var(--line);
  z-index: 61; transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column; box-shadow: -30px 0 60px -30px #000;
}
.drawer.on { transform: none; }
.drawer-head {
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }

/* ---------- 空态 ---------- */
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 12px; }
.empty b { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes flashIn {
  0% { background: rgba(201, 160, 99, 0.18); }
  100% { background: transparent; }
}
.flash { animation: flashIn 1.4s ease-out; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 弹窗 ---------- */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link-btn {
  background: none; border: none; padding: 0 2px; cursor: pointer;
  color: var(--gold); font-size: 11px; font-family: inherit; letter-spacing: 0.04em;
  transition: 0.15s;
}
.link-btn:hover { color: var(--gold-bright); text-decoration: underline; }

.mj-mask {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  background: rgba(4, 5, 6, 0.64); backdrop-filter: blur(3px);
  animation: maskIn 0.18s ease;
}
.mj-dialog {
  width: 404px; max-width: 92vw; max-height: calc(100vh - 36px); background: #0c0e11;
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 34px 80px -34px #000; overflow: hidden;
  display: flex; flex-direction: column;
  animation: dlgIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.mj-dialog-head {
  padding: 18px 20px 13px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.mj-dialog-head h3 { margin: 0; font-size: 15px; letter-spacing: 0.06em; font-weight: 600; }
.mj-dialog-head p { margin: 7px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.75; }
.mj-dialog-body { padding: 16px 20px 6px; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; min-height: 0; }
.mj-dialog-foot {
  padding: 14px 20px 18px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--line-soft); margin-top: 10px;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

/* 一次性密码展示 */
.pwd-box {
  border: 1px solid rgba(201, 160, 99, 0.32); border-radius: 11px; padding: 14px 16px;
  background: linear-gradient(160deg, rgba(201, 160, 99, 0.12), rgba(255, 255, 255, 0.015));
  display: flex; flex-direction: column; gap: 10px;
}
.pwd-box > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pwd-box span { font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-3); }
.pwd-box b { font-size: 17px; color: var(--gold-bright); letter-spacing: 0.06em; user-select: all; }

/* 数字输入去掉上下微调箭头，收银台更干净 */
input[type="number"].input::-webkit-outer-spin-button,
input[type="number"].input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"].input { -moz-appearance: textfield; appearance: textfield; }

/* 日期控件跟随深色主题（原生弹出面板与日历图标） */
input[type="date"].input { color-scheme: dark; }
input[type="date"].input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type="date"].input::-webkit-calendar-picker-indicator:hover { opacity: .9; }

/* admin 端共用原子类：原先只在 pos.css 定义，老板端视图切换后样式会丢失 */
.divider-gold { height: 1px; background: linear-gradient(90deg, rgba(201, 160, 99, 0.45), transparent); margin: 16px 0; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; }
.staff-chip {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 9px;
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.02); cursor: pointer;
  font-size: 12px; color: var(--ink-2); transition: 0.15s; font-family: var(--sans);
}
.staff-chip:hover { border-color: rgba(232, 206, 154, 0.3); }
.staff-chip.on { border-color: rgba(232, 206, 154, 0.55); background: rgba(201, 160, 99, 0.12); color: var(--ink); }
.staff-chip .av {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; color: #14100a; background: linear-gradient(140deg, #e8ce9a, #b98f4c); flex: 0 0 auto;
}
.staff-chip.busy { opacity: 0.38; cursor: not-allowed; }
.staff-chip .next-tag {
  font-size: 9px; font-weight: 700; color: #14100a;
  background: linear-gradient(140deg, #e8ce9a, #b98f4c); padding: 1px 5px; border-radius: 6px;
  margin-left: 2px;
}
.txn-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.035); font-size: 12px; }
.txn-row:last-child { border-bottom: none; }
.txn-row .amt { font-family: var(--mono); }
.txn-row .amt.in { color: var(--gold-bright); }
.txn-row .amt.out { color: var(--teal); }

/* 键盘可达性 */
:focus-visible { outline: 2px solid rgba(232, 206, 154, 0.75); outline-offset: 2px; }

/* ============================================================
   玻璃胶囊菜单指示器
   当前项底色 = 半透明玻璃胶囊；切换时沿移动方向拉长滑行，到位弹性回弹
   ============================================================ */
.gnav-host { position: relative; }

.gnav-pill {
  position: absolute; z-index: 0; pointer-events: none; opacity: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.05));
  border: 0.5px solid rgba(232, 206, 154, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.1),
    0 2px 16px rgba(201, 160, 99, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  transition:
    left 0.42s cubic-bezier(0.22, 0.86, 0.24, 1),
    top 0.42s cubic-bezier(0.22, 0.86, 0.24, 1),
    width 0.42s cubic-bezier(0.22, 0.86, 0.24, 1),
    height 0.42s cubic-bezier(0.22, 0.86, 0.24, 1),
    transform 0.5s cubic-bezier(0.34, 1.5, 0.64, 1),
    opacity 0.2s ease;
  will-change: left, top, width, height, transform;
}

/* 起步瞬间拉长：transform 用短时长冲出去，松手后回到 0.5s 弹性曲线回弹 */
.gnav-pill.gnav-stretch {
  transition:
    left 0.42s cubic-bezier(0.22, 0.86, 0.24, 1),
    top 0.42s cubic-bezier(0.22, 0.86, 0.24, 1),
    width 0.42s cubic-bezier(0.22, 0.86, 0.24, 1),
    height 0.42s cubic-bezier(0.22, 0.86, 0.24, 1),
    transform 0.16s ease-out,
    opacity 0.2s ease;
}

/* 不支持 backdrop-filter 的旧内核：退回不透明玻璃底，避免胶囊"消失" */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gnav-pill { background: rgba(38, 36, 32, 0.94); }
}

/* 低性能设备（收银机 / 老平板）：关掉背景模糊，保留滑动与高光 */
.gnav-basic .gnav-pill {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(40, 38, 33, 0.9);
}

/* ---------- 语音播报开关 ---------- */
.voice-toggle { white-space: nowrap; }
.voice-toggle.on { color: var(--gold-bright); border-color: rgba(232, 206, 154, 0.3); }
.voice-toggle.off { color: var(--ink-3); }
