/* ============================================================
   餐秀预约订座管理系统 · 设计系统 V2.2
   依据需求说明书第二~八章：9 套主题色板 / 楷体标题+宋体正文 / 组件规范
   ============================================================ */

:root {
  --brand: #C41E3A;
  --brand-2: #1A3A5C;
  --accent: #D4AF37;
  --bg: #FDF8F0;
  --bg-2: #FFFFFF;
  --bg-3: #F8F1E5;
  --text: #1A1A2E;
  --text-2: #6B6B7B;
  --text-3: #A8A8B8;
  --border: #E4D9C8;
  --card: #FFFFFF;
  --hero-a: #8C1226;
  --hero-b: #1A3A5C;
  --success: #28A745;
  --warning: #E8A33D;
  --danger: #DC3545;
  --info: #17A2B8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(60, 30, 10, .08);
  --shadow-lg: 0 8px 28px rgba(60, 30, 10, .14);
  --font-title: "KaiTi", "STKaiti", "楷体", "Kaiti SC", serif;
  --font-body: "SimSun", "Songti SC", "宋体", "STSong", serif;
  --font-num: "Times New Roman", "Georgia", serif;
  --scale: 1;
  /* 全站浅色设计：显式声明 light only，阻止手机「强制深色」把深色卡片与白字自动反色 */
  color-scheme: light only;
}

/* ---------- 主题：国潮风（默认） ---------- */
[data-theme="guochao"] {
  --brand: #C41E3A; --brand-2: #1A3A5C; --accent: #D4AF37;
  --bg: #FDF8F0; --bg-3: #F7EEDF; --text: #1A1A2E; --border: #E6D8C3;
  --hero-a: #8C1226; --hero-b: #1A3A5C;
}
/* ---------- 地域文化风 ---------- */
[data-theme="regional"] {
  --brand: #E8652E; --brand-2: #2D5016; --accent: #D4A574;
  --bg: #FAF5EF; --bg-3: #F3E9DC; --text: #3D2B1F; --border: #E3D3C0;
  --hero-a: #B84A1C; --hero-b: #2D5016;
}
/* ---------- 唐代 ---------- */
[data-theme="tang"] {
  --brand: #8B4513; --brand-2: #E0115F; --accent: #FFD700;
  --bg: #F5E6C8; --bg-3: #EFDCB8; --text: #3A2410; --border: #DCC69C;
  --hero-a: #6B3410; --hero-b: #A2164A;
}
/* ---------- 宋代 ---------- */
[data-theme="song"] {
  --brand: #2C2C2C; --brand-2: #7F9E8B; --accent: #7F9E8B;
  --bg: #FAFAFA; --bg-3: #F2F4F2; --text: #2C2C2C; --border: #E2E6E2;
  --hero-a: #3A3A3A; --hero-b: #6F8E7B;
}
/* ---------- 元代 ---------- */
[data-theme="yuan"] {
  --brand: #4A6FA5; --brand-2: #8B2500; --accent: #C4A882;
  --bg: #F0E4D0; --bg-3: #E7D8C0; --text: #33291D; --border: #D6C3A5;
  --hero-a: #35507A; --hero-b: #7A2000;
}
/* ---------- 明代 ---------- */
[data-theme="ming"] {
  --brand: #FFD700; --brand-2: #1B4D5C; --accent: #C41E3A;
  --bg: #FFF8E7; --bg-3: #FBEFD2; --text: #1E2A2E; --border: #E8D9B4;
  --hero-a: #1B4D5C; --hero-b: #8A6A18;
}
/* ---------- 清代 ---------- */
[data-theme="qing"] {
  --brand: #8B0000; --brand-2: #F5DEB3; --accent: #1C1C1C;
  --bg: #F5E6C8; --bg-3: #EEDAB8; --text: #241A12; --border: #DBC49B;
  --hero-a: #6E0000; --hero-b: #8A7448;
}
/* ---------- 民国 ---------- */
[data-theme="minguo"] {
  --brand: #2E5E3A; --brand-2: #722F37; --accent: #F7E7CE;
  --bg: #FDF5E6; --bg-3: #F6EBD8; --text: #2A2118; --border: #E0D0B7;
  --hero-a: #24492E; --hero-b: #5C252C;
}
/* ---------- 红色经典 ---------- */
[data-theme="red"] {
  --brand: #DE2910; --brand-2: #006600; --accent: #FFDE00;
  --bg: #FFFFFF; --bg-3: #FFF4F2; --text: #1A1A1A; --border: #F0D8D4;
  --hero-a: #B51F0B; --hero-b: #004D00;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: calc(14px * var(--scale));
  line-height: 1.5;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-title);
  margin: 0;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text);
}
h1 { font-size: calc(26px * var(--scale)); }
h2 { font-size: calc(20px * var(--scale)); }
h3 { font-size: calc(17px * var(--scale)); }
h4 { font-size: calc(15px * var(--scale)); }
.num { font-family: var(--font-num); }

a { color: var(--brand); text-decoration: none; }
p { margin: 0 0 8px; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.wrap-gap { flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 14px; }
.muted { color: var(--text-2); }
.tiny { font-size: calc(12px * var(--scale)); }
.small { font-size: calc(13px * var(--scale)); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.mono { font-family: Consolas, "Courier New", monospace; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.card-title h3 { display: flex; align-items: center; gap: 8px; }
.card-title h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff; font-family: var(--font-body);
  font-size: calc(14px * var(--scale));
  cursor: pointer; transition: .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.soft { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); }
.btn.text { background: none; border: none; color: var(--brand); padding: 0 6px; height: auto; }
.btn.sm { height: 34px; padding: 0 12px; font-size: calc(12.5px * var(--scale)); }
.btn.xs { height: 28px; padding: 0 10px; font-size: calc(12px * var(--scale)); border-radius: 6px; }
.btn.block { width: 100%; }
.btn:disabled, .btn.disabled {
  background: #CFCFCF; border-color: #CFCFCF; color: #fff; cursor: not-allowed;
  filter: none; transform: none;
}
.btn.gold { background: linear-gradient(135deg, var(--brand), var(--accent)); border: none; }
.btn.danger { background: var(--danger); border-color: var(--danger); }

/* ---------- 徽标 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: calc(11.5px * var(--scale));
  background: var(--bg-3); color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.ok { background: #EAF7EE; color: #1E7B36; border-color: #C7E9D2; }
.badge.warn { background: #FFF6E5; color: #A56A10; border-color: #F3DFB8; }
.badge.danger { background: #FDECEE; color: #B02A37; border-color: #F5C6CB; }
.badge.info { background: #E9F6F8; color: #0F6C7A; border-color: #C3E6EB; }
.badge.brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; background: var(--bg-3); font-size: 12px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: calc(12.5px * var(--scale)); color: var(--text-2); }
.input, .select, textarea.input {
  height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text);
  font-family: var(--font-body); font-size: calc(14px * var(--scale));
  outline: none; width: 100%; transition: .15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.input.sm, .select.sm { height: 34px; font-size: 13px; }
.switch {
  width: 46px; height: 26px; border-radius: 20px; background: #D8D8D8;
  position: relative; cursor: pointer; transition: .2s; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch.on { background: var(--brand); }
.switch.on::after { left: 23px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--scale)); }
.table th {
  text-align: left; padding: 10px 12px; font-weight: 600;
  background: color-mix(in srgb, var(--brand) 8%, var(--bg-2));
  color: var(--text-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-3); }
.table .num { font-family: var(--font-num); }

/* ---------- 座位图 ---------- */
.seat-map { display: flex; flex-direction: column; gap: 16px; }
.area-block { background: var(--bg-3); border-radius: var(--radius); padding: 12px; }
.area-label { font-size: 12px; color: var(--text-2); margin-bottom: 8px; letter-spacing: 1px; }
.seat-grid { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.seat-row { display: flex; gap: 6px; align-items: center; }
.seat {
  width: 30px; height: 26px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: pointer; transition: .12s;
  background: #E8E8EC; color: #8A8A96; border: 1px solid transparent;
  font-family: var(--font-num);
}
.seat.free:hover { transform: scale(1.18); border-color: var(--brand); z-index: 2; }
.seat.sold { background: #B8CBDE; color: #fff; cursor: not-allowed; }
.seat.seated { background: #2F7D5A; color: #fff; cursor: not-allowed; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.seat.checked { background: #7FB98F; color: #fff; cursor: not-allowed; }
.seat.refund { background: #FFF0E0; color: #C08A3E; border: 1px dashed #E0A860; }
.seat.selected { background: var(--brand); color: #fff; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.seat.vip { border-radius: 6px 6px 3px 3px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }

/* ---------- 侧边导航 / 顶栏 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex: none; background: var(--brand-2); color: #fff;
  display: flex; flex-direction: column; transition: width .2s;
}
.sidebar.collapsed { width: 64px; }
.sidebar .brand-box { padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.14); }
.sidebar .brand-box h2 { color: #fff; font-size: 18px; }
.sidebar .brand-box span { font-size: 11px; opacity: .7; letter-spacing: 2px; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 8px;
  color: rgba(255,255,255,.82); font-size: 13.5px; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar.collapsed .nav a span.txt, .sidebar.collapsed .brand-box span { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30; gap: 12px;
}
.crumb { font-size: 12.5px; color: var(--text-2); }
.crumb b { color: var(--text); font-weight: 600; }
.content { padding: 18px 20px 40px; }

/* ---------- 指标卡 ---------- */
.stat {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -18px; top: -18px;
  width: 56px; height: 56px; border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.stat .k { font-size: 12px; color: var(--text-2); }
.stat .v { font-family: var(--font-num); font-size: 26px; font-weight: 700; margin-top: 4px; line-height: 1.1; }
.stat .s { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.stat.hl { background: linear-gradient(135deg, var(--brand), var(--hero-b)); color: #fff; border: none; }
.stat.hl .k, .stat.hl .s { color: rgba(255,255,255,.78); }
.stat.hl::after { background: rgba(255,255,255,.14); }

/* ---------- 弹窗 / Toast ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(20, 12, 8, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px; backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-2); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  box-shadow: var(--shadow-lg); animation: pop .18s ease-out;
}
.modal.wide { max-width: 780px; }
.modal-h { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.modal-b { padding: 18px; }
.modal-f { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

#toasts { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 900; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(30, 22, 16, .92); color: #fff; padding: 10px 18px;
  border-radius: 22px; font-size: 13px; box-shadow: var(--shadow-lg);
  animation: tin .2s ease-out; max-width: 82vw;
}
.toast.ok { background: #1E7B36; }
.toast.err { background: #B02A37; }
.toast.warn { background: #A56A10; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 36px 12px; color: var(--text-3); font-size: 13px; }
.empty .ico { font-size: 34px; opacity: .35; display: block; margin-bottom: 8px; }

/* ---------- C 端手机壳 ---------- */
.phone {
  width: 100%; max-width: 430px; margin: 0 auto; min-height: 100vh;
  background: var(--bg); position: relative; padding-bottom: 74px;
}
.hero {
  position: relative; height: 268px; overflow: hidden;
  background: linear-gradient(140deg, var(--hero-a), var(--hero-b));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px; color: #fff;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 82% 18%, rgba(255,215,0,.28), transparent 42%),
    radial-gradient(circle at 18% 78%, rgba(255,255,255,.16), transparent 46%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.42));
}
.hero > * { position: relative; z-index: 2; }
.hero h1 { color: #fff; font-size: 27px; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.hero .sub { font-size: 13px; opacity: .9; letter-spacing: 3px; margin-top: 4px; }
.pattern {
  position: absolute; inset: 0; opacity: .16; z-index: 1;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.5) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 1px, transparent 1px 14px);
}
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; height: 60px;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--border);
  display: flex; z-index: 100; backdrop-filter: blur(8px);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; color: var(--text-3); cursor: pointer;
}
.tabbar a .ico { font-size: 19px; line-height: 1; }
.tabbar a.active { color: var(--brand); font-weight: 600; }
.section { padding: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title h3 { font-size: 16px; }

/* ---------- 场次卡 ---------- */
.sess-card {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--border); margin-bottom: 10px;
  cursor: pointer; transition: .15s;
}
.sess-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.sess-thumb {
  width: 84px; height: 84px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, var(--hero-a), var(--hero-b));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-num); position: relative; overflow: hidden;
}
.sess-thumb .t { font-size: 20px; font-weight: 700; }
.sess-thumb .d { font-size: 10px; opacity: .85; }
.sess-body { flex: 1; min-width: 0; }
.sess-body h4 { font-size: 15px; margin-bottom: 3px; }
.sess-meta { font-size: 11.5px; color: var(--text-2); display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 步骤条 ---------- */
.steps { display: flex; align-items: center; gap: 0; }
.steps .st { flex: 1; text-align: center; font-size: 11.5px; color: var(--text-3); position: relative; }
.steps .st::before {
  content: ""; display: block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); margin: 0 auto 5px;
}
.steps .st.done { color: var(--brand); font-weight: 600; }
.steps .st.done::before { background: var(--brand); }
.steps .st + .st::after {
  content: ""; position: absolute; top: 4px; left: -50%; width: 100%; height: 1.5px; background: var(--border);
}

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 6px; background: var(--bg-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), var(--accent)); }

/* ---------- 键值行 ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-2); flex: none; }
.kv .v { text-align: right; font-weight: 500; }

/* ---------- 榜单 ---------- */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num); font-size: 12px; font-weight: 700;
  background: var(--bg-3); color: var(--text-2);
}
.rank-row:nth-child(1) .rank-no { background: #D4AF37; color: #fff; }
.rank-row:nth-child(2) .rank-no { background: #B8B8C0; color: #fff; }
.rank-row:nth-child(3) .rank-no { background: #C08A5A; color: #fff; }

/* ---------- 大屏 ---------- */
.screen { background: #0E0A08; color: #F4E6C8; min-height: 100vh; padding: 30px; }
.screen h1 { color: #FFD700; font-size: 48px; }
.screen .call-no { font-family: var(--font-num); font-size: 128px; line-height: 1; color: #FFD700; text-shadow: 0 0 40px rgba(255,215,0,.4); }

/* ---------- 响应式断点 ---------- */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 992px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sidebar { width: 64px; }
  .sidebar .nav a span.txt, .sidebar .brand-box span { display: none; }
}
@media (max-width: 768px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 120; height: 100vh; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; }
}
@media (min-width: 1400px) { .wrap { max-width: 1320px; } }

/* ---------- 无障碍：尊重系统「减少动态效果」设置（同时保证截图/打印稳定） ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
}
