:root {
  --navy: #0e1836;
  --navy-2: #172550;
  --navy-3: #24366b;
  --gold: #c6a15b;
  --gold-bright: #e3c887;
  --gold-soft: #f5eedc;
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e3e7ee;
  --ink: #1b2333;
  --muted: #6c7588;
  --good: #2e7d63;
  --good-soft: #e9f3ef;
  --warn: #a86e1f;
  --warn-soft: #f8f0e1;
  --bad: #a93d3d;
  --bad-soft: #f8e9e9;
  --info: #2f638f;
  --info-soft: #e9f1f7;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(14, 24, 54, 0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 系统级外壳 */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: 0 0 250px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 26px 18px 20px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 6px 22px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-logo {
  width: 62px; height: 62px; flex: 0 0 62px;
  background: #fff; border-radius: 10px;
  display: grid; place-items: center; padding: 5px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 22px; font-weight: 700; letter-spacing: 3px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #b8c4df; margin-top: 5px; letter-spacing: 2px; }
.side-label { font-size: 11px; color: #7f8fb5; letter-spacing: 2px; margin: 24px 10px 12px; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav-item {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: #c9d2e8;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px; border-radius: 10px;
  text-align: left; font: inherit; font-size: 14px;
  position: relative; transition: background .18s, color .18s;
}
.side-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav-item.active {
  background: linear-gradient(90deg, rgba(198,161,91,.22), rgba(198,161,91,.04));
  color: #fff; font-weight: 700;
}
.side-nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-bright);
}
.nav-icon { width: 26px; height: 26px; display: grid; place-items: center; color: var(--gold-bright); }
.nav-index { margin-left: auto; font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: #7182ab; }
.side-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.side-badge {
  display: inline-block; border: 1px solid rgba(227,200,135,.45); color: var(--gold-bright);
  border-radius: 99px; padding: 3px 10px; font-size: 11px; letter-spacing: 1px;
}
.side-note { font-size: 11px; color: #8c9ab9; margin-top: 8px; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 20px 34px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.eyebrow { font-size: 11px; color: var(--gold); letter-spacing: 2.5px; font-weight: 700; }
.topbar-title h1 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 27px; margin: 4px 0 0; color: var(--navy); letter-spacing: 2px; font-weight: 700;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  background: var(--navy); color: #fff;
}
.chip-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.page { max-width: 1500px; width: 100%; margin: 0 auto; padding: 24px 34px 60px; }

/* 高清主题横幅 */
.hero {
  position: relative; overflow: hidden;
  border-radius: 16px; min-height: 214px;
  background-image: url("./assets/hero-dining.png");
  background-size: cover; background-position: center 38%;
  display: flex; align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 14px 34px rgba(14,24,54,.14);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(9,17,41,.94) 0%, rgba(9,17,41,.72) 48%, rgba(9,17,41,.18) 100%);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(180deg, rgba(9,17,41,0) 0%, rgba(9,17,41,.82) 100%);
}
.hero-inner { position: relative; z-index: 2; padding: 30px 38px; color: #fff; max-width: 720px; }
.hero-kicker { font-size: 11px; letter-spacing: 3px; color: var(--gold-bright); font-weight: 700; }
.hero-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 32px; letter-spacing: 3px; margin: 10px 0 8px; font-weight: 700;
}
.hero-desc { font-size: 13px; color: #d9dfef; max-width: 560px; }
.hero-metrics { display: flex; gap: 26px; margin-top: 18px; flex-wrap: wrap; }
.hero-metric { display: flex; align-items: baseline; gap: 7px; }
.hero-metric b { font-family: "Noto Serif SC", serif; font-size: 22px; color: var(--gold-bright); }
.hero-metric span { font-size: 11px; color: #c8d1e6; letter-spacing: 1px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--gold);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0;
  display: flex; gap: 12px; align-items: flex-start;
}
.kpi-icon {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: var(--navy); color: var(--gold-bright);
  display: grid; place-items: center;
}
.kpi-body { min-width: 0; }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.kpi-value { font-size: 23px; font-weight: 800; margin-top: 2px; color: var(--navy); letter-spacing: -.5px; }
.kpi-note { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi.good .kpi-value { color: var(--good); }
.kpi.bad .kpi-value { color: var(--bad); }
.kpi.info .kpi-value { color: var(--info); }
.kpi.amber .kpi-value { color: var(--warn); }

.view { display: flex; flex-direction: column; gap: 18px; }
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow); min-width: 0;
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.panel-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 18px; font-weight: 700; color: var(--navy); margin: 0; letter-spacing: 1px;
  display: flex; align-items: center; gap: 9px;
}
.panel-title .icon { color: var(--gold); }
.panel-sub { color: var(--muted); font-size: 12px; margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
/* 提成核算等宽表格需要独占整行，避免与相邻面板并排被压缩 */
.stack { display: flex; flex-direction: column; gap: 18px; }

/* 客户痛点方案卡片 */
.pain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; }
.pain-grid .pain-card:last-child { grid-column: 1 / -1; }
.pain-card { display: flex; flex-direction: column; gap: 11px; padding: 20px 22px; }
.pain-head { display: flex; align-items: center; gap: 12px; }
.pain-no {
  font-family: "Noto Serif SC", "Songti SC", serif; font-size: 22px; font-weight: 700;
  color: var(--gold); line-height: 1; min-width: 30px;
}
.pain-line { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; line-height: 1.7; }
.pain-label {
  flex: 0 0 62px; color: var(--muted); font-weight: 700; letter-spacing: 1px;
  border-right: 1px solid var(--line); padding-right: 8px;
}
.pain-quote { color: var(--ink); }
.pain-essence { color: var(--bad); font-weight: 600; }
.pain-solution {
  background: linear-gradient(135deg, var(--gold-soft) 0%, #fdfaf3 100%);
  border: 1px solid #eadcbc; border-left: 3px solid var(--gold);
  border-radius: 9px; padding: 12px 14px;
}
.pain-solution-title {
  display: flex; align-items: center; gap: 7px; color: var(--warn);
  font-size: 12px; font-weight: 700; letter-spacing: 1px; margin-bottom: 5px;
}
.pain-solution-title .icon { width: 15px; height: 15px; }
.pain-solution-main { color: var(--navy); font-size: 13px; font-weight: 600; line-height: 1.7; }
.pain-steps { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.pain-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }

/* 图标 */
.icon { width: 18px; height: 18px; display: block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 22px; height: 22px; }
.icon-sm { width: 15px; height: 15px; }

/* 表单 */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #d9dee7; border-radius: 9px;
  padding: 9px 11px; outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,161,91,.14); }
textarea { resize: vertical; min-height: 76px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row > label.field { flex: 1 1 160px; }

.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  border-radius: 9px; padding: 9px 16px; font-size: 13px; font-weight: 700;
  background: var(--navy); color: #fff; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: filter .15s, transform .12s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-amber { background: var(--gold); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border-color: #d9dee7; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-danger { background: var(--bad); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.tag-good { background: var(--good-soft); color: var(--good); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }
.tag-info { background: var(--info-soft); color: var(--info); }
.tag-muted { background: #f0f2f5; color: var(--muted); }
.tag-amber { background: var(--gold-soft); color: var(--warn); }

/* 菜品卡片 */
.dish-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.dish-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 15px;
  display: flex; flex-direction: column; gap: 9px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.dish-card:hover { border-color: var(--gold); box-shadow: 0 6px 18px rgba(198,161,91,.12); }
.dish-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dish-name { font-weight: 700; font-size: 15px; }
.dish-price { color: var(--warn); font-weight: 800; font-size: 16px; }
.dish-meta { color: var(--muted); font-size: 11px; }
.dish-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.dish-bottom input { width: 66px; text-align: center; }

/* 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f7f8fa; color: #4d586f; font-weight: 700; font-size: 11.5px; letter-spacing: .3px; }
tbody tr:hover { background: #fcfbf7; }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--navy); font-weight: 700; }
.action-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* 提示条 */
.notice {
  border-radius: 11px; padding: 12px 15px; font-size: 12.5px;
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid transparent; border-left-width: 3px;
}
.notice b { font-weight: 700; }
.notice .icon { margin-top: 2px; }
.notice-amber { background: var(--gold-soft); border-color: #eadcbc; color: #6f5522; border-left-color: var(--gold); }
.notice-bad { background: var(--bad-soft); border-color: #efd2d2; color: var(--bad); border-left-color: var(--bad); }
.notice-info { background: var(--info-soft); border-color: #d3e1ec; color: var(--info); border-left-color: var(--info); }
.notice-good { background: var(--good-soft); border-color: #cee4da; color: var(--good); border-left-color: var(--good); }

.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-btn {
  appearance: none; border: 1px solid #d9dee7; background: #fff; color: var(--muted);
  padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* 付款识别码 */
.paycode {
  border: 1px dashed var(--gold); background: #fffdf7;
  border-radius: 10px; padding: 9px 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.paycode small { color: var(--muted); font-size: 10px; }
.paycode span { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 13px; color: var(--warn); }

.dish-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.dish-row input { width: 100%; }
.empty { padding: 34px 12px; text-align: center; color: var(--muted); font-size: 13px; }

/* 双节点场景图 */
.scene-banner {
  position: relative; overflow: hidden; border-radius: 12px;
  min-height: 128px; margin-bottom: 16px;
  background-image: url("./assets/dual-node.png");
  background-size: cover; background-position: center;
  display: flex; align-items: center;
}
.scene-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,17,41,.94), rgba(9,17,41,.45) 60%, rgba(9,17,41,.1)); }
.scene-banner::after { content: ""; position: absolute; right: 0; bottom: 0; width: 45%; height: 40%; background: linear-gradient(180deg, rgba(9,17,41,0), rgba(9,17,41,.85)); }
.scene-copy { position: relative; z-index: 2; padding: 20px 26px; color: #fff; }
.scene-copy h3 { font-family: "Noto Serif SC", serif; margin: 0 0 6px; font-size: 18px; letter-spacing: 2px; }
.scene-copy p { margin: 0; font-size: 12px; color: #d3dcec; }

/* 核销码强调 */
.code-big {
  display: inline-block; font-family: ui-monospace, Consolas, monospace;
  font-size: 16px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--navy); background: var(--gold-soft);
  border: 1px solid #ead6ad; border-radius: 7px; padding: 2px 8px; white-space: nowrap;
}
.label-sheet { max-height: 420px; overflow: auto; }

/* 活动日志 */
.log-list { display: flex; flex-direction: column; gap: 9px; }
.log-item { display: flex; gap: 10px; font-size: 12px; align-items: baseline; }
.log-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 84px; }
.log-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: 0 0 7px; }
.log-item.success .log-dot { background: var(--good); }
.log-item.warn .log-dot { background: var(--bad); }

/* Toast 与弹层 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.22);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }
.toast.good { background: var(--good); }
.modal-mask { position: fixed; inset: 0; background: rgba(9,17,41,.52); display: grid; place-items: center; padding: 20px; z-index: 100; }
.modal-mask[hidden] { display: none; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: min(450px, 100%); box-shadow: 0 24px 60px rgba(0,0,0,.26); }
.modal h3 { margin: 0 0 6px; font-size: 18px; font-family: "Noto Serif SC", serif; color: var(--navy); }
.modal p { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .hero, .kpis, .toast, .modal-mask, .panel-head, .scene-banner { display: none !important; }
  .app-shell, .main-wrap { display: block; }
  .page { padding: 0; max-width: none; }
  .view { display: block; }
  .panel { border: 0; box-shadow: none; padding: 0; }
  .label-sheet { max-height: none; overflow: visible; }
  .code-big { border: 1px solid #333; background: #fff; color: #000; }
}

@media (max-width: 980px) {
  .sidebar { width: 76px; flex: 0 0 76px; padding: 18px 10px; }
  .brand { justify-content: center; padding: 0 0 18px; }
  .brand-copy, .side-label, .nav-index, .side-footer, .nav-text { display: none; }
  .side-nav-item { justify-content: center; padding: 12px; }
  .page { padding: 20px 18px 48px; }
  .topbar { padding: 16px 18px; }
  .hero-title { font-size: 26px; }
}
