:root {
  --brand: #2F7D6D; --brand-600: #28695C; --brand-700: #1F5247; --brand-50: #EEF6F3; --brand-100: #D4EAE3; --brand-300: #8CC7B6; --brand-ring: rgba(47,125,109,.16);
  --bg: #F4F5F7; --card: #FFFFFF; --line: #E8EAEE; --line-2: #F1F3F5; --hover: #F8F9FB;
  --text: #111827; --text-2: #4B5563; --muted: #9CA3AF; --input: #D1D5DB;
  --ok: #12B76A; --ok-bg: #ECFDF3; --ok-fg: #067647;
  --warn: #F79009; --warn-bg: #FFFAEB; --warn-fg: #B54708;
  --err: #F04438; --err-bg: #FEF3F2; --err-fg: #B42318;
  --info: #2E90FA; --info-bg: #EFF8FF; --info-fg: #175CD3;
  --violet-bg: #F4F3FF; --violet-fg: #5925DC;
  --radius: 14px; --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 24px 48px -12px rgba(16,24,40,.22);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum"; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: var(--brand-100); }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

/* ===== 登录 ===== */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(420px, 1fr); background: #fff; }
.login-brand { margin: 16px; border-radius: 28px; background: radial-gradient(120% 90% at 0% 0%, var(--brand-300) 0%, var(--brand) 42%, var(--brand-700) 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-brand::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 60%); }
.login-brand.has-img { background: var(--brand-700) var(--login-img) center/cover no-repeat; }
.login-brand.has-img::before { background-image: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.05) 35%, rgba(0,0,0,.62)); background-size: auto; mask-image: none; }
.login-brand > * { position: relative; z-index: 1; }
.login-brand .logo { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.login-brand .logo span { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-brand .logo span img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.login-brand h2 { font-size: 40px; line-height: 1.25; margin-bottom: 16px; letter-spacing: -.5px; white-space: pre-line; }
.login-brand p { opacity: .8; font-size: 16px; }
.login-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; }
.login-feats div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 16px; }
.login-feats b { display: block; font-size: 15px; margin-bottom: 4px; }
.login-feats span { font-size: 12px; opacity: .75; }
.login-foot { display: flex; gap: 16px; flex-wrap: wrap; opacity: .65; font-size: 12px; }
.login-foot a { color: inherit; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 28px; margin-bottom: 8px; }
.login-box .sub { color: var(--muted); margin-bottom: 28px; }
.login-box .field { margin-bottom: 16px; }
.login-box input { height: 46px !important; border-radius: 12px !important; }
.login-box .btn.primary { width: 100%; height: 46px; font-size: 15px; margin-top: 8px; border-radius: 12px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row img { height: 46px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; background: #F4F6F8; }
.dev-banner { background: var(--warn-bg); color: var(--warn-fg); border: 1px solid #FEDF89; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 18px; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-brand { display: none; } }

/* ===== 框架 ===== */
#app-view { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-300), var(--brand)); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; overflow: hidden; font-weight: 700; }
.mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sb-brand b { display: block; font-size: 15px; line-height: 1.3; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-brand small { color: var(--muted); font-size: 12px; }
.store-switch { padding: 0 16px 8px; }
.store-switch label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.store-switch select { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }
#nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
#nav .group { color: var(--muted); font-size: 12px; font-weight: 500; padding: 14px 10px 6px; }
#nav button.group { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; cursor: pointer; text-align: left; font-family: inherit; }
#nav button.group:hover { color: var(--text-2); }
#nav button.group .chev { width: 14px; height: 14px; margin-left: auto; transition: transform .15s; }
#nav button.group.closed .chev { transform: rotate(-90deg); }
#nav .nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--err); }
#nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; margin: 1px 0; border-radius: 10px; color: var(--text-2); font-weight: 500; text-decoration: none; }
#nav a svg.i { color: #9CA3AF; }
#nav a:hover { background: var(--line-2); color: var(--text); }
#nav a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
#nav a.active svg.i { color: var(--brand); }
#nav a .label { flex: 1; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sb-foot { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; }
.alert-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.alert-toggle .t { flex: 1; font-weight: 500; }
.alert-toggle .t small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.alert-toggle.on { border-color: var(--brand-100); background: var(--brand-50); }
.user-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 12px; border: none; background: none; cursor: pointer; text-align: left; }
.user-btn:hover { background: var(--line-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-300), var(--brand)); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-btn .t { flex: 1; min-width: 0; }
.user-btn .t b { display: block; font-size: 13px; }
.user-btn .t small { color: var(--muted); font-size: 12px; }
.menu-pop { position: absolute; bottom: 64px; left: 10px; right: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: none; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.menu-pop button:hover { background: var(--line-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; gap: 12px; position: sticky; top: 0; z-index: 20; }
.topbar .crumb { font-weight: 600; }
.topbar .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--line-2); color: var(--text-2); font-size: 12px; font-weight: 500; }
.pill.dev { background: var(--warn-bg); color: var(--warn-fg); }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill.err { background: var(--err-bg); color: var(--err-fg); }
.content { padding: 24px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; letter-spacing: -.2px; }
.page-head .desc { color: var(--muted); margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
/* 普通块布局（REVIEW-01）：原来是 flex，文字里夹着 <b> / <a> 时每一段都成了一列，一换行就断成竖条 */
.notice-bar { display: block; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info-fg); margin-bottom: 16px; font-size: 13px; line-height: 1.6; }
.notice-bar > svg.i:first-child { vertical-align: -4px; margin-right: 8px; }
.notice-bar.warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice-bar.err { background: var(--err-bg); color: var(--err-fg); }

/* ===== 卡片与网格 ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.grid { display: grid; gap: 16px; }
.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)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 18px 20px; }
.stat .k { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .v { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat .v small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .ico { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); }
.stat .ico svg.i { width: 16px; height: 16px; }

/* ===== 按钮与表单 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--input); background: #fff; color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s; text-decoration: none !important; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: var(--err-fg); border-color: #FDA29B; }
.btn.danger:hover { background: var(--err-bg); }
.btn.solid-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn svg.i { width: 16px; height: 16px; }
.link-btn { border: none; background: none; color: var(--brand); cursor: pointer; padding: 0; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--err-fg); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input:not([type]), select, textarea {
  width: 100%; height: 38px; border: 1px solid var(--input); border-radius: 10px; padding: 0 12px; background: #fff; outline: none; box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--line-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: -3px; }
input[type=color] { width: 44px; height: 38px; border: 1px solid var(--input); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.form { display: grid; gap: 14px; }
.form.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.form .full { grid-column: 1 / -1; }
.field > label:not(.switch) { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field > label .req { color: var(--err); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.input-group { display: flex; align-items: stretch; }
.input-group > span { display: flex; align-items: center; flex-shrink: 0; white-space: nowrap; padding: 0 10px; border: 1px solid var(--input); background: var(--line-2); color: var(--text-2); font-size: 13px; }
.input-group > span:first-child { border-radius: 10px 0 0 10px; border-right: none; }
.input-group > span:last-child { border-radius: 0 10px 10px 0; border-left: none; }
.input-group > input { border-radius: 0; }
.input-group > input:first-child { border-radius: 10px 0 0 10px; }
.input-group > input:last-child { border-radius: 0 10px 10px 0; }
.input-group > span:first-child + input:last-child { border-radius: 0 10px 10px 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; min-height: 38px; align-items: center; }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; min-height: 38px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #D0D5DD; position: relative; transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--brand-ring); }
.segment { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.segment a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none; white-space: nowrap; }
.segment a.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.segment button { border: none; background: none; height: 30px; padding: 0 12px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.segment button.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.segment button .n { margin-left: 4px; font-size: 12px; color: var(--muted); }
.segment button.on .n { color: var(--brand); }
/* 规则页分组 Tab（REVIEW-01） */
.rule-tabs { display: grid; gap: 8px; }
.rule-tab-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rule-tab-row .g { width: 64px; flex-shrink: 0; font-size: 12px; color: var(--muted); }
.rule-tab-row .segment { flex-wrap: wrap; max-width: 100%; }

/* 图片上传 */
.img-field { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.img-box { width: 88px; height: 88px; border-radius: 12px; border: 1px dashed var(--input); background: var(--hover); display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; position: relative; overflow: hidden; flex-shrink: 0; }
.img-box:hover { border-color: var(--brand); color: var(--brand); }
.img-box img { width: 100%; height: 100%; object-fit: cover; }
.img-box.contain img { object-fit: contain; background: #fff; }
.img-box .del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(17,24,39,.65); color: #fff; border: none; cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 14px; line-height: 1; }
.img-box:hover .del { display: flex; }
.img-box.wide { width: 176px; }
.img-box .uploading { position: absolute; inset: 0; background: rgba(255,255,255,.8); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-2); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 12px; background: var(--hover); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: none; }
table.t tr:hover td { background: #FCFCFD; }
table.t td.r, table.t th.r { text-align: right; }
table.t .ops { display: flex; gap: 12px; justify-content: flex-end; white-space: nowrap; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--line-2); flex-shrink: 0; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty svg.i { width: 36px; height: 36px; color: #D0D5DD; margin-bottom: 8px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { width: auto; height: 34px; }
.toolbar .search { width: 220px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 16px; color: var(--text-2); font-size: 13px; }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--text-2); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok-fg); }
.tag.warn { background: var(--warn-bg); color: var(--warn-fg); }
.tag.err { background: var(--err-bg); color: var(--err-fg); }
.tag.info { background: var(--info-bg); color: var(--info-fg); }
.tag.violet { background: var(--violet-bg); color: var(--violet-fg); }
.tag.brand { background: var(--brand-50); color: var(--brand-700); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(16,24,40,.45); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; display: flex; flex-direction: column; max-height: 88vh; animation: pop .18s; }
.modal > .modal-body { flex: 1; min-height: 0; overflow-y: auto; }
.modal > .modal-head, .modal > .modal-foot { flex-shrink: 0; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.modal-head h3 { font-size: 17px; flex: 1; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: none; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--line-2); color: var(--text); }
.modal-body { padding: 6px 22px 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--hover); border-radius: 0 0 18px 18px; }
.drawer-mask { position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 90; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: #fff; z-index: 91; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s; }
.drawer .modal-body { flex: 1; overflow-y: auto; padding-top: 12px; }
.drawer .modal-foot { border-radius: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }

#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; pointer-events: none; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .18s; max-width: 520px; }
.toast.err { background: var(--err-fg); }
.toast.ok { background: #067647; }
#alerts { position: fixed; right: 20px; bottom: 20px; z-index: 250; display: grid; gap: 10px; width: 340px; }
.alert-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px 16px; animation: pop .2s; }
.alert-card b { display: block; margin-bottom: 4px; }
.alert-card .row { margin-top: 10px; justify-content: flex-end; }

/* ===== 订单看板 ===== */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1200px) { .board { grid-template-columns: repeat(2, minmax(240px, 1fr)); } }
.board-col { background: #EDEFF3; border-radius: 14px; padding: 10px; min-height: 200px; }
/* 每列单独滚动、列头固定（REVIEW-01：原来单多时整页被一列拉得很长，其他列看不到） */
.board-col .board-body { max-height: max(360px, calc(100vh - 290px)); overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.board-col > h4 { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-size: 14px; }
.board-col > h4 .n { margin-left: auto; background: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--text-2); }
.ocard { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-xs); cursor: pointer; }
.ocard:hover { border-color: var(--brand-300); }
.ocard .no { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.ocard .items { margin: 8px 0; font-size: 13px; color: var(--text-2); }
.ocard .items div { display: flex; gap: 6px; }
.ocard .items .q { margin-left: auto; color: var(--text); font-weight: 600; }
.ocard .spec { color: var(--muted); font-size: 12px; }
.ocard .remark { background: var(--warn-bg); color: var(--warn-fg); border-radius: 8px; padding: 6px 8px; font-size: 12px; margin-bottom: 8px; }
.ocard .foot { display: flex; align-items: center; gap: 8px; }
.ocard .foot .btn { margin-left: auto; }
.ocard.new { animation: glow 1.2s ease 3; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px var(--brand-ring); border-color: var(--brand); } }
.big-no { font-size: 44px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.timeline { display: grid; gap: 10px; }
.timeline .it { display: flex; gap: 10px; font-size: 13px; }
.timeline .it .d { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-300); margin-top: 6px; flex-shrink: 0; }
.money-list { display: grid; gap: 6px; font-size: 13px; }
.money-list div { display: flex; justify-content: space-between; }
.money-list .total { font-weight: 700; font-size: 15px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }

/* ===== 装修 ===== */
.deco { display: grid; grid-template-columns: 260px 390px minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1250px) { .deco { grid-template-columns: 240px 360px minmax(280px, 1fr); } }
/* 小屏笔记本（1366×768 开 125% 缩放只有约 1093px）：属性面板挪到下面一整行，免得出现横向滚动条（REVIEW-01） */
@media (max-width: 1200px) { .deco { grid-template-columns: 240px 375px; } .deco > :nth-child(3) { grid-column: 1 / -1; } }
.deco-list .mod { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.deco-list .mod:hover { background: var(--line-2); }
.deco-list .mod.on { background: var(--brand-50); border-color: var(--brand-100); }
.deco-list .mod.off .name { color: var(--muted); text-decoration: line-through; }
.deco-list .mod .name { flex: 1; font-weight: 500; }
.deco-list .mod .ops { display: flex; gap: 2px; opacity: .55; }
.deco-list .mod:hover .ops, .deco-list .mod.on .ops { opacity: 1; }
.icon-btn { width: 26px; height: 26px; border-radius: 7px; border: none; background: none; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: #fff; color: var(--text); }
.icon-btn svg.i { width: 15px; height: 15px; }
.phone { width: 375px; border-radius: 36px; background: #111; padding: 12px; box-shadow: var(--shadow-lg); position: sticky; top: 72px; }
.phone-screen { border-radius: 26px; overflow: hidden; background: #F7F8FA; height: 720px; overflow-y: auto; position: relative; }
.phone-screen::-webkit-scrollbar { width: 0; }
.pv-mod { position: relative; cursor: pointer; }
.pv-mod.on::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--brand); border-radius: 6px; pointer-events: none; }
.pv-mod.hidden { opacity: .35; }
.list-editor .li { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--hover); }
.list-editor .li-head { display: flex; align-items: center; margin-bottom: 8px; font-weight: 600; font-size: 13px; gap: 4px; }
.list-editor .li-head span { flex: 1; }

/* 规格编辑器 */
.spec-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--hover); }
.spec-group .opts { display: grid; gap: 6px; margin-top: 8px; }
.spec-group .opt { display: grid; grid-template-columns: 1fr 110px 70px 30px; gap: 8px; align-items: center; }
.spec-group .opt input { height: 34px; }
.hours-row { display: grid; grid-template-columns: 1fr 120px 20px 120px 30px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.hours-row .days { display: flex; gap: 4px; flex-wrap: wrap; }
.hours-row .days label { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 30px; border-radius: 8px; border: 1px solid var(--input); cursor: pointer; font-size: 12px; user-select: none; }
.hours-row .days input { display: none; }
.hours-row .days input:checked + span { color: #fff; }
.hours-row .days label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }

.chart { position: relative; width: 100%; height: 220px; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart-y { position: absolute; left: 2px; transform: translateY(-115%); font-size: 10px; line-height: 1; color: #B6BCC6; pointer-events: none; }
.chart-x { position: absolute; bottom: 2px; transform: translateX(-50%); font-size: 11px; line-height: 1; color: #9CA3AF; white-space: nowrap; pointer-events: none; }
.bar-list { display: grid; gap: 10px; }
.bar-list .b { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.bar-list .b .track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar-list .b .track i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.merchant-card { padding: 18px 20px; }
.merchant-card + .merchant-card { margin-top: 14px; }
.merchant-card .head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.merchant-card .logo { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; overflow: hidden; flex-shrink: 0; }
.merchant-card .logo img { width: 100%; height: 100%; object-fit: contain; }
.merchant-card .stores { display: grid; gap: 8px; margin-top: 14px; }
.merchant-card .store-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--hover); flex-wrap: wrap; }
.cred { background: var(--hover); border: 1px dashed var(--input); border-radius: 12px; padding: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.8; }
.qr-img { width: 220px; height: 220px; border-radius: 12px; border: 1px solid var(--line); }
.verify-input { font-size: 28px; height: 60px !important; text-align: center; letter-spacing: 6px; font-weight: 700; }
kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--input); border-bottom-width: 2px; border-radius: 6px; font-size: 11px; background: #fff; color: var(--text-2); }

@media print { body * { visibility: hidden; } }

/* ---------------- 收银台 ---------------- */
.content.wide { max-width: none; padding: 16px 20px; }
.pos { display: flex; flex-direction: column; height: calc(100vh - 56px - 32px); min-height: 560px; gap: 12px; }
.pos-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pos-title { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-right: 8px; }
.pos-title svg.i { color: var(--brand); width: 20px; height: 20px; }
.pos-today { margin-left: auto; color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.pos-today b { color: var(--text); margin: 0 2px; }
.pos-today .sep { width: 1px; height: 14px; background: var(--line); margin: 0 10px; }
.pos-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 132px minmax(0, 1fr) 380px; gap: 12px; }
.pos-cats, .pos-goods, .pos-ticket { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; }
.pos-cats { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.pos-cats button { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; padding: 8px 10px; border: none; background: none; border-radius: 10px; cursor: pointer; color: var(--text-2); font-weight: 500; text-align: left; }
.pos-cats button span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.pos-cats button small { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.pos-cats button:hover { background: var(--line-2); }
.pos-cats button.on { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.pos-goods { display: flex; flex-direction: column; overflow: hidden; }
.pos-search { position: relative; display: flex; align-items: center; padding: 12px; border-bottom: 1px solid var(--line-2); }
.pos-search > svg.i { position: absolute; left: 24px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.pos-search input { width: 100%; height: 40px; padding: 0 36px 0 36px; border: 1px solid var(--input); border-radius: 10px; font-size: 14px; }
.pos-clear { position: absolute; right: 18px; width: 28px; height: 28px; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.pos-clear:hover { background: var(--line-2); }
.pos-grid { flex: 1; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; align-content: start; }
.pos-grid .empty { grid-column: 1 / -1; }
.pos-sku { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; overflow: hidden; cursor: pointer; padding: 0; transition: border-color .12s, box-shadow .12s, transform .06s; }
.pos-sku:hover { border-color: var(--brand-300); box-shadow: var(--shadow-sm); }
.pos-sku:active { transform: scale(.98); }
.pos-sku.off { cursor: not-allowed; opacity: .55; }
.pos-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--muted); }
/* 图片绝对定位铺满：竖图不会把卡片撑高，所有卡片一样高 */
.pos-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-so { position: absolute; inset: 0; background: rgba(16,24,40,.45); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pos-sku-name { padding: 8px 10px 2px; font-weight: 600; font-size: 13.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: calc(13.5px * 1.35 * 2 + 10px); }
.pos-sku-foot { display: flex; align-items: center; justify-content: space-between; padding: 2px 10px 10px; }
.pos-sku-foot b { color: var(--brand-700); }
.pos-sku-foot small { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.pos-ticket { display: flex; flex-direction: column; padding: 12px; gap: 10px; overflow: hidden; }
.pos-scene { display: flex; }
.pos-scene button { flex: 1; height: 34px; }
.pos-msearch { position: relative; display: flex; align-items: center; gap: 8px; }
.pos-msearch > svg.i { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.pos-msearch input { flex: 1; min-width: 0; height: 36px; padding: 0 10px 0 32px; border: 1px solid var(--input); border-radius: 10px; }
.pos-mcard { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.pos-mcard .grow { min-width: 0; }
.pos-mcard .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-mavatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pos-lines { flex: 1; min-height: 80px; overflow-y: auto; margin: 0 -12px; padding: 0 12px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.pos-empty { padding: 32px 8px; }
.pos-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.pos-line:last-child { border-bottom: none; }
.pos-line .grow { min-width: 0; }
.pos-line.bad .pos-lname { color: var(--err-fg); text-decoration: line-through; }
.pos-lname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-lspec { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-lbad { color: var(--err-fg); font-size: 12px; margin-top: 2px; }
.pos-step { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pos-step button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--input); background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.pos-step button:hover { border-color: var(--brand); color: var(--brand); }
.pos-step button svg.i { width: 14px; height: 14px; }
.pos-step span { min-width: 20px; text-align: center; font-weight: 600; }
.pos-extra { display: flex; gap: 8px; }
.pos-extra input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--input); border-radius: 10px; }
.pos-extra #pos-table { flex: 0 0 110px; }
.pos-coupon:empty { display: none; }
.pos-coupon label { display: flex; align-items: center; gap: 8px; color: var(--brand-700); }
.pos-coupon select { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: 10px; padding: 0 8px; color: var(--text); }
.pos-srow { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; padding: 2px 0; }
.pos-srow.minus span:last-child { color: var(--err-fg); }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 6px; margin-top: 4px; border-top: 1px dashed var(--line); }
.pos-total b { font-size: 26px; color: var(--brand-700); letter-spacing: -.5px; }
.pos-qerr { color: var(--err-fg); background: var(--err-bg); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.pos-actions { display: flex; gap: 8px; }
.pos-actions .btn.lg { flex: 1; height: 48px; font-size: 16px; }
.pos-actions .btn:first-child { height: 48px; }
/* 规格选择 */
.spec-g { margin-bottom: 16px; }
.spec-gh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.spec-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-o { min-height: 36px; padding: 0 14px; border: 1px solid var(--input); background: #fff; border-radius: 10px; cursor: pointer; color: var(--text); }
.spec-o small { color: var(--muted); }
.spec-o.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.spec-o:disabled { cursor: not-allowed; opacity: .45; text-decoration: line-through; }
.spec-qty { display: flex; align-items: center; gap: 10px; }
.spec-qty b { min-width: 24px; text-align: center; font-size: 16px; }
.modal-foot .grow { flex: 1; }
/* 结账 */
.co-amount { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 12px; background: var(--brand-50); margin-bottom: 14px; }
.co-amount b { font-size: 30px; color: var(--brand-700); }
.co-pay { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.co-pay button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 600; color: var(--text-2); }
.co-pay button svg.i { width: 22px; height: 22px; }
.co-pay button.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.co-pay button:disabled { cursor: not-allowed; opacity: .4; }
.co-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.co-change { margin-top: 12px; font-size: 15px; }
.co-change b { font-size: 22px; color: var(--brand-700); }
.co-err { color: var(--err-fg); font-weight: 600; }
.co-code { width: 100%; height: 46px; padding: 0 12px; border: 1.5px solid var(--input); border-radius: 10px; font-size: 20px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.co-code::placeholder { font-size: 14px; letter-spacing: 0; }
.co-code:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.co-wait { display: grid; justify-items: center; gap: 10px; padding: 26px 8px 14px; text-align: center; }
.co-wait b { font-size: 16px; }
.co-spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.co-deliver { margin-top: 14px; }
.co-done { text-align: center; padding: 8px 0 4px; display: grid; gap: 6px; }
.co-no { font-size: 56px; font-weight: 800; letter-spacing: 2px; color: var(--text); line-height: 1.1; }
.co-chg { font-size: 22px; font-weight: 700; color: var(--brand-700); }
.co-sumtop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.co-sumtop div { background: var(--line-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.co-sumtop span { color: var(--muted); font-size: 12px; }
@media (max-width: 1180px) {
  .pos-body { grid-template-columns: 108px minmax(0, 1fr) 330px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
}
