/* ==========================================================================
   非常智造 · 统一管理门户
   设计基调：森林绿主色 / 暖白背景 / 香槟金少量点缀
   约束：CSP 为 style-src 'self'，禁止内联样式；所有变体通过 class 表达。
   ========================================================================== */

:root {
  --forest-900: #07281e;
  --forest-800: #0a392b;
  --forest-700: #0c4835;
  --forest: #0e5a41;
  --forest-600: #12694b;
  --forest-100: #e4efe9;
  --forest-050: #f1f7f3;

  --gold: #b8912f;
  --gold-strong: #9c7a20;
  --gold-soft: #f6e6bd;
  --gold-050: #fdf6e4;

  --ink: #16241e;
  --ink-soft: #33443c;
  --muted: #69776f;
  --muted-2: #8b978f;

  --canvas: #f7f3ea;
  --paper: #fffdf9;
  --paper-2: #fbf8f1;
  --line: #e5ded0;
  --line-strong: #d6ccb9;

  --danger: #a83b34;
  --danger-bg: #fbeae7;
  --warn: #8a6218;
  --warn-bg: #fdf3dc;
  --ok: #176a4c;
  --ok-bg: #e6f3ec;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(22, 36, 30, .05);
  --shadow: 0 10px 28px rgba(24, 46, 37, .07);
  --shadow-lg: 0 24px 60px rgba(9, 34, 25, .18);

  --sidebar-w: 264px;
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

:focus-visible { outline: 2px solid var(--forest-600); outline-offset: 2px; border-radius: 4px; }

/* ---------- 品牌标识 ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  width: 40px; height: 40px;
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  padding-bottom: 9px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f7d992, var(--gold));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.brand__mark i { display: block; width: 4px; border-radius: 3px; background: var(--forest-900); }
.brand__mark i:nth-child(1) { height: 10px; }
.brand__mark i:nth-child(2) { height: 19px; }
.brand__mark i:nth-child(3) { height: 14px; }
.brand__text strong { display: block; font-size: 17px; letter-spacing: .1em; }
.brand__text small { display: block; margin-top: 2px; font-size: 9px; letter-spacing: .18em; opacity: .62; }
.brand--light { color: #f2f7f4; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(380px, .9fr); }

.login__brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 32px;
  padding: 44px clamp(28px, 6vw, 88px);
  color: #eef5f1;
  background: radial-gradient(120% 90% at 100% 0%, #12543e 0%, var(--forest-900) 58%);
}
.login__brand::after {
  content: ""; position: absolute; right: -180px; bottom: -220px;
  width: 520px; height: 520px; border-radius: 50%;
  border: 1px solid rgba(246, 230, 189, .18);
  box-shadow: 0 0 0 70px rgba(246, 230, 189, .05), 0 0 0 150px rgba(246, 230, 189, .03);
}
.login__copy { position: relative; margin: auto 0; max-width: 560px; }
.kicker { color: var(--gold-soft); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.login__copy h1 {
  margin: 18px 0 20px;
  font-family: ui-serif, Georgia, "Songti SC", serif;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.16;
  letter-spacing: -.02em;
}
.login__copy p { color: #b6cbc1; font-size: 15px; line-height: 1.9; }

.login__facts { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .13); }
.login__facts li { display: grid; gap: 2px; }
.login__facts b { font-family: ui-serif, Georgia, serif; font-size: 24px; color: #fff; }
.login__facts span { color: #92aa9f; font-size: 12px; }

.login__panel { display: grid; place-items: center; padding: 40px 28px; background: var(--canvas); }
.login__card { width: min(400px, 100%); }
.login__card h2 { margin: 18px 0 6px; font-family: ui-serif, Georgia, "Songti SC", serif; font-size: 30px; }
.login__hint { margin-bottom: 26px; color: var(--muted); font-size: 13px; }
.login__foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 12px; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill--env { color: var(--forest); background: var(--forest-100); }
.pill--env i { width: 7px; height: 7px; border-radius: 50%; background: #35a273; box-shadow: 0 0 0 4px rgba(53, 162, 115, .14); }

/* ---------- 表单 ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap);
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px rgba(18, 105, 75, .12);
}
.field input::placeholder, .field textarea::placeholder { color: #a9b3ac; }

.alert { padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.6; }
.alert--error { color: #8d322c; background: var(--danger-bg); }
.alert--warn { color: var(--warn); background: var(--warn-bg); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px; font-weight: 700;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { color: #fff; background: var(--forest); }
.btn--primary:hover { background: var(--forest-600); }
.btn--ghost { color: var(--forest); background: #fff; border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--forest-600); background: var(--forest-050); }
.btn--danger { color: var(--danger); background: #fff; border-color: #e8cdc8; }
.btn--danger:hover { background: var(--danger-bg); }
.btn--link { color: var(--forest); background: transparent; min-height: 36px; padding: 6px 0; font-weight: 600; }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn[disabled] { opacity: .55; }
.btn--pending { color: var(--muted); background: var(--paper-2); border: 1px dashed var(--line-strong); cursor: not-allowed; }
[data-sso-mapping], [data-sso-picker] { min-height: var(--tap); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap);
  padding: 0;
  border: 0; border-radius: 10px;
  background: transparent; color: inherit;
  font-size: 20px; line-height: 1;
}
.icon-btn:hover { background: rgba(0, 0, 0, .06); }

/* ---------- 门户骨架 ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0;
  display: flex; flex-direction: column;
  height: 100vh;
  padding: 22px 16px 16px;
  color: #dbe8e1;
  background: linear-gradient(180deg, var(--forest-900), #061f17);
  z-index: 40;
}
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 18px; }
.sidebar__close { display: none; color: #cfe0d7; }

.workspace {
  display: grid; gap: 4px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(246, 230, 189, .2);
  border-radius: var(--radius);
  background: rgba(246, 230, 189, .07);
}
.workspace span { color: #86a396; font-size: 11px; letter-spacing: .1em; }
.workspace strong { font-size: 15px; color: #fff; }
.workspace small { color: #9db5a9; font-size: 11.5px; line-height: 1.5; word-break: break-word; }

.nav { display: grid; gap: 3px; overflow-y: auto; }
.nav__group { padding: 14px 12px 6px; color: #6d8f80; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0; border-radius: 9px;
  background: transparent; color: #b3c7bd;
  font-size: 14px; text-align: left;
}
.nav__item:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav__item.is-active { color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 3px 0 var(--gold-soft); }
.nav__icon { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.nav__badge { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: #3b2d06; font-size: 11px; font-weight: 800; }

.sidebar__foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar__foot i { width: 8px; height: 8px; border-radius: 50%; background: #5ecb95; box-shadow: 0 0 0 4px rgba(94, 203, 149, .12); }
.sidebar__foot strong { display: block; font-size: 12px; }
.sidebar__foot small { display: block; color: #7c9a8c; font-size: 11px; }

.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(6, 26, 19, .55); backdrop-filter: blur(2px); }

.stage { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  min-height: 62px;
  padding: 0 clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, .92);
  backdrop-filter: blur(10px);
}
.topbar__menu { display: none; color: var(--ink); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.crumb b { color: var(--muted-2); font-weight: 400; }
.crumb strong { color: var(--ink); font-weight: 700; }
.topbar__actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.legend { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.legend__dot { width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; }
.legend__dot--nfc { background: #1c8c68; margin-left: 0; }
.legend__dot--cms { background: #375d7c; }
.legend__dot--portal { background: var(--gold); }

.account { display: flex; align-items: center; gap: 9px; padding: 5px 8px 5px 5px; border: 1px solid transparent; border-radius: 999px; background: transparent; text-align: left; }
.account:hover { border-color: var(--line); background: var(--paper); }
.account__avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: #fff; font-size: 14px; font-weight: 700; }
.account__text strong { display: block; font-size: 13px; }
.account__text small { display: block; color: var(--muted); font-size: 11px; }

.content { width: 100%; max-width: 1360px; margin: 0 auto; padding: clamp(20px, 2.6vw, 34px) clamp(16px, 3vw, 36px) 56px; }

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.page-head__desc { margin-top: 8px; max-width: 620px; color: var(--muted); font-size: 14px; }
.page-head h1 { margin-top: 6px; font-family: ui-serif, Georgia, "Songti SC", serif; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.25; letter-spacing: -.01em; }
.eyebrow { color: var(--forest-600); font-size: 11px; font-weight: 800; letter-spacing: .16em; }

.scope { min-width: 250px; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.scope span { display: block; color: var(--muted); font-size: 11px; }
.scope strong { display: block; margin: 3px 0 2px; font-size: 14px; }
.scope small { color: var(--muted-2); font-size: 10.5px; letter-spacing: .08em; }

/* ---------- 提示条 ---------- */
.callout { display: flex; align-items: flex-start; gap: 12px; margin: 16px 0 22px; padding: 14px 16px; border: 1px solid #ecd9a8; border-radius: var(--radius); background: var(--gold-050); }
.callout__icon { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #fff; font-size: 14px; font-weight: 800; }
.callout strong { display: block; font-size: 14px; }
.callout p { margin-top: 2px; color: #7a6435; font-size: 13px; line-height: 1.6; }

/* ---------- 指标卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { position: relative; min-height: 116px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.stat__label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.stat__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--forest); }
.stat__value { display: block; margin: 12px 0 4px; font-family: ui-serif, Georgia, serif; font-size: 30px; line-height: 1.1; }
.stat__hint { color: var(--muted-2); font-size: 11.5px; }
.stat--b .stat__dot { background: #375d7c; }
.stat--c .stat__dot { background: var(--gold); }
.stat--d .stat__dot { background: #6d5b86; }

/* ---------- 区块 ---------- */
.section { margin-top: 28px; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section__head h2 { margin-top: 3px; font-family: ui-serif, Georgia, "Songti SC", serif; font-size: 20px; }
.section__hint { color: var(--muted); font-size: 12.5px; }

/* ---------- 业务入口卡 ---------- */
.entries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.entry { display: flex; flex-direction: column; gap: 10px; min-height: 168px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.entry__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.entry h3 { font-size: 15.5px; }
.entry p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.entry__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.tag--nfc { color: #0d5e46; background: #e2f1ea; }
.tag--cms { color: #2c4f6b; background: #e6edf4; }
.tag--portal { color: var(--gold-strong); background: var(--gold-soft); }
.tag--muted { color: var(--muted); background: var(--paper-2); border: 1px dashed var(--line-strong); }

/* ---------- 状态徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge--ok { color: var(--ok); background: var(--ok-bg); }
.badge--warn { color: var(--warn); background: var(--warn-bg); }
.badge--danger { color: var(--danger); background: var(--danger-bg); }
.badge--neutral { color: var(--muted); background: var(--paper-2); border: 1px solid var(--line); }

/* ---------- 面板与表格 ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel__head h2 { margin-top: 3px; font-family: ui-serif, Georgia, "Songti SC", serif; font-size: 19px; }
.panel__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.panel__body { padding: 0; }
.panel__body--pad { padding: 16px 18px; }
.panel__note { padding: 12px 18px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); background: var(--paper-2); }

/* ---------- 列表工具条（搜索 / 状态筛选 / 排序） ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.toolbar__search { flex: 1 1 240px; min-width: 0; display: grid; gap: 6px; }
.toolbar__sort { display: grid; gap: 6px; }
.toolbar__group { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar__label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
/* 桌面端：折叠区随工具条平铺；开关按钮只出现在移动端 */
.toolbar__extra { display: contents; }
.toolbar__toggle { display: none; }
.toolbar__chevron { display: inline-block; font-size: 12px; transition: transform .15s; }
.toolbar__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.toolbar__meta b { color: var(--ink); font-size: 13px; }

.input, .select {
  min-height: var(--tap);
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--forest-600); box-shadow: 0 0 0 3px rgba(18, 105, 75, .12); }
.input::placeholder { color: #a9b3ac; }
.select { min-width: 156px; }

.seg {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap);
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.seg:hover { border-color: var(--forest-600); background: var(--forest-050); }
.seg.is-active { color: #fff; background: var(--forest); border-color: var(--forest); }
.seg__count { padding: 1px 7px; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.seg.is-active .seg__count { background: rgba(255, 255, 255, .22); color: #fff; }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table thead th { position: sticky; top: 0; background: var(--paper-2); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfaf4; }
.table td code { color: var(--ink-soft); }

/* ---------- 门店卡片 ---------- */
.shops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shop { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.shop__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.shop__name { font-size: 16px; font-weight: 700; }
.shop__meta { color: var(--muted); font-size: 12px; }
.kv { display: grid; gap: 8px; }
.kv__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv__row span { color: var(--muted); }
.kv__row b { min-width: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.shop__foot { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- 店员大按钮 ---------- */
.actions { display: grid; gap: 10px; }
.action {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.action:not([disabled]):hover { border-color: var(--forest-600); background: var(--forest-050); }
.action__icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--forest-100); color: var(--forest); font-size: 20px; }
.action__text { flex: 1; min-width: 0; }
.action__text strong { display: block; font-size: 16px; }
.action__text small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.action__arrow { color: var(--muted-2); font-size: 18px; }
.action[disabled] { opacity: .78; }
.action--primary { border-color: var(--forest); background: var(--forest); color: #fff; }
.action--primary .action__icon { background: rgba(255, 255, 255, .16); color: #fff; }
.action--primary .action__text small { color: rgba(255, 255, 255, .78); }
.action--primary .action__arrow { color: rgba(255, 255, 255, .8); }
.action--primary:not([disabled]):hover { background: var(--forest-600); border-color: var(--forest-600); }

/* ---------- 状态视图 ---------- */
.state { display: grid; place-items: center; gap: 10px; padding: 56px 20px; text-align: center; color: var(--muted); }
.state__icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--forest-100); color: var(--forest); font-size: 20px; }
.state h3 { color: var(--ink); font-size: 16px; }
.state p { max-width: 420px; font-size: 13.5px; }
.state--error .state__icon { background: var(--danger-bg); color: var(--danger); }
.state--error h3 { color: var(--danger); }
.state--empty .state__icon { background: var(--gold-soft); color: var(--gold-strong); }

.skeleton { display: grid; gap: 10px; padding: 18px; }
.skeleton__bar { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #efe9dc 25%, #f7f2e7 37%, #efe9dc 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton__bar--w40 { width: 40%; }
.skeleton__bar--w70 { width: 70%; }
.skeleton__bar--lg { height: 46px; border-radius: 10px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- 弹窗 ---------- */
.modal {
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal::backdrop { background: rgba(6, 26, 19, .62); backdrop-filter: blur(3px); }
.modal__inner { display: flex; flex-direction: column; max-height: min(86vh, 760px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-family: ui-serif, Georgia, "Songti SC", serif; font-size: 21px; }
.modal__body { padding: 18px 20px 4px; overflow-y: auto; }
.modal__lead { margin-bottom: 14px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.modal__foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px 18px; border-top: 1px solid var(--line); background: var(--paper); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .field--wide { grid-column: 1 / -1; }
.note-box { margin-bottom: 14px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--gold-050); border: 1px solid #eeddb4; color: #7a6435; font-size: 12.5px; line-height: 1.6; }
.summary { display: grid; gap: 6px; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--paper-2); border: 1px solid var(--line); font-size: 13px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; }
.summary span { color: var(--muted); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; z-index: 100; right: 20px; top: 18px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff; background: var(--forest-700);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .22);
  font-size: 13.5px;
  transform: translateY(-120%); opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.toast.is-visible { transform: none; opacity: 1; }
.toast--error { background: var(--danger); }

/* ---------- 权限标签 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 5px 9px; border-radius: 6px; background: var(--forest-050); color: #2f5a49; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.two-col { display: grid; grid-template-columns: 1.3fr .7fr; gap: 12px; align-items: start; }
.unauthorized { display: grid; place-items: center; gap: 10px; min-height: 60vh; text-align: center; }
.unauthorized h1 { font-family: ui-serif, Georgia, serif; font-size: 30px; }
.unauthorized p { color: var(--muted); font-size: 14px; }

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(300px, 84vw);
    transform: translateX(-102%);
    transition: transform .22s ease;
    will-change: transform;
  }
  .sidebar.is-open { transform: none; }
  .sidebar__close { display: inline-flex; }
  .topbar__menu { display: inline-flex; }
  .topbar { min-height: 56px; padding: 0 12px; }
  .legend { display: none; }
  .content { padding: 18px 14px 64px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .scope { min-width: 0; }
  .shops { grid-template-columns: 1fr; }
}

/* 手机：表格转卡片，避免横向硬挤 */
@media (max-width: 820px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    overflow: hidden;
  }
  .table tr:hover { background: var(--paper); }
  .table td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px dashed var(--line);
    white-space: normal;
    text-align: right;
  }
  .table td:last-child { border-bottom: 0; }
  .table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
  }
  .table td.is-empty { justify-content: center; text-align: center; }
  .table td.is-empty::before { content: ""; }
  .btn--sm { min-height: 44px; padding: 8px 16px; }
  .btn--link { min-height: 44px; padding: 10px 2px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .toolbar__search, .toolbar__sort { flex: 1 1 auto; }
  .toolbar__extra { display: none; }
  .toolbar.is-open .toolbar__extra { display: grid; gap: 10px; }
  .toolbar.is-open .toolbar__chevron { transform: rotate(180deg); }
  .toolbar__toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: var(--tap);
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-soft);
    font-size: 14px; font-weight: 700;
  }
  .toolbar__toggle-side { display: inline-flex; align-items: center; gap: 8px; }
  .toolbar__group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar__meta { padding: 9px 14px; }
  .select { width: 100%; min-width: 0; }
  .panel__head { flex-direction: column; align-items: flex-start; }
  .panel__head .badge { align-self: flex-start; }
  .section__head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .entries { grid-template-columns: 1fr; }
  .modal__inner { max-height: min(88vh, 720px); }
}

@media (max-width: 430px) {
  html, body { font-size: 15px; }
  .content { padding: 14px 12px 60px; }
  .page-head h1 { font-size: 24px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { min-height: 96px; padding: 12px 14px; }
  .stat__value { font-size: 24px; margin: 8px 0 2px; }
  .stat__label { font-size: 12px; }
  .stat__hint { font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--wide { grid-column: auto; }
  .modal { width: calc(100vw - 16px); border-radius: 14px; }
  .modal__body { padding: 14px 14px 2px; }
  .modal__head { padding: 14px 14px 12px; }
  .modal__foot { padding: 12px 14px 14px; }
  .modal__foot .btn { flex: 1; }
  .action { min-height: 64px; padding: 12px 14px; }
  .action__icon { flex-basis: 40px; width: 40px; height: 40px; }
  .account__text { display: none; }
  .topbar { gap: 8px; }
  .crumb { font-size: 12px; }
}

@media (max-width: 340px) {
  .stats { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .btn { padding: 9px 14px; font-size: 13px; }
}

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