/* ==========================================================
   印刷记账 · 后台  ——  「活字印刷」品牌风格
   墨青 #123528 × 印刷青 #d9b36a × 半调网点
   ========================================================== */
:root {
  --ink: #123528;
  --ink-2: #1d5c43;
  --cyan: #d9b36a;
  --cyan-d: #b98f45;
  --paper: #f3efe3;
  --paper-2: #faf7ee;
  --card: #ffffff;
  --line: #e4ddca;
  --amber: #e8940a;
  --green: #1e9a63;
  --red: #d84343;
  --text: #1c2721;
  --muted: #707a70;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; max-width: 100%;
  /* 禁止微信/安卓 webview 自动放大文字把排版撑出屏 */
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  /* 根绝整页横向拖动（clip 不产生滚动容器，不影响 sticky） */
  overflow-x: hidden; overflow-x: clip;
}
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* 品牌 logo（dmlogo 墨绿印章图，原图直出，不加任何衬底） */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--serif); font-weight: 900;
  position: relative; flex: none;
  overflow: hidden;
}
.seal img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 14%; }
.seal-lg { width: 76px; height: 76px; font-size: 40px; }
.seal-sm { width: 38px; height: 38px; font-size: 20px; }

/* CMYK 四色点（印刷签名细节） */
.cmyk { display: inline-flex; gap: 6px; }
.cmyk i { width: 9px; height: 9px; border-radius: 50%; }
.cmyk i:nth-child(1) { background: #0bbcd6; }
.cmyk i:nth-child(2) { background: #e23b8e; }
.cmyk i:nth-child(3) { background: #f6c609; }
.cmyk i:nth-child(4) { background: #101b31; }

/* ==========================================================
   登录：左品牌幕 + 右表单
   ========================================================== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: stretch; justify-content: center;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(217,179,106,.14), transparent 70%),
    var(--paper);
  padding: 0;
}
.login-stage {
  width: 100%; min-height: 100vh;
  display: grid; grid-template-columns: minmax(360px, 42%) 1fr;
  background: var(--card);
}
/* 关键：grid 子项默认 min-width:auto，会被内容撑宽导致整页横向溢出 */
.login-stage > * { min-width: 0; }
/* 侧栏折叠按钮 */
.side-toggle {
  margin-left: auto; width: 28px; height: 28px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); border: none; border-radius: 8px;
  color: rgba(255,255,255,.7);
  transition: background .15s, color .15s;
}
.side-toggle svg { width: 15px; height: 15px; transition: transform .2s; }
.side-toggle:hover { background: rgba(255,255,255,.16); color: #fff; }
.app.side-collapsed .side-toggle svg { transform: rotate(180deg); }
.app.side-collapsed .side-toggle { margin-left: 0; }

/* 折叠态：图标栏（桌面） */
.app.side-collapsed { grid-template-columns: 64px 1fr; }
.app.side-collapsed .side-brand { flex-direction: column; gap: 12px; padding: 22px 0 18px; }
.app.side-collapsed .side-brand-text { display: none; }
.app.side-collapsed .side-nav { padding: 10px 10px; }
.app.side-collapsed .side-nav-label { display: none; }
.app.side-collapsed .side-nav .tab { font-size: 0; gap: 0; justify-content: center; padding: 13px 0; }
.app.side-collapsed .side-nav .tab svg { width: 20px; height: 20px; }
.app.side-collapsed .side-user { justify-content: center; padding: 0 0 10px; }
.app.side-collapsed .cur-user { display: none; }
.app.side-collapsed .btn-ghost { font-size: 0; gap: 0; justify-content: center; padding: 0; }

/* 抽屉遮罩（手机端展开侧栏时） */
.side-mask {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(18,53,40,.45);
  animation: rise .2s both;
}

/* 左品牌幕 */
.login-brand {
  position: relative; overflow: hidden;
  background:
    radial-gradient(720px 420px at 110% -10%, rgba(217,179,106,.42), transparent 62%),
    radial-gradient(560px 360px at -20% 118%, rgba(217,179,106,.16), transparent 60%),
    linear-gradient(168deg, var(--ink-2), var(--ink) 58%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 44px;
}
.brand-halftone, .side-halftone {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.4px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(420px 300px at 78% 12%, #000 0%, transparent 72%);
          mask-image: radial-gradient(420px 300px at 78% 12%, #000 0%, transparent 72%);
}
.brand-aurora {
  position: absolute; width: 420px; height: 420px; right: -140px; top: -140px;
  background: radial-gradient(closest-side, rgba(217,179,106,.5), transparent 70%);
  filter: blur(10px); pointer-events: none;
}
.brand-top {
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
  animation: rise .6s .05s both;
}
.brand-top-en { font-size: 11px; letter-spacing: .32em; opacity: .55; }
.brand-center { position: relative; z-index: 1; }
.brand-center .seal-lg { animation: rise .6s .15s both; }
.brand-title {
  font-family: var(--serif); font-weight: 900;
  /* 自适应字号：窄屏自动缩小，保证「东木滴塑加工」6 字一行放下 */
  font-size: clamp(28px, 7.2vw, 44px);
  letter-spacing: .12em; margin: 26px 0 10px;
  white-space: nowrap;
  animation: rise .6s .25s both;
}
.brand-tag {
  margin: 0; font-size: 15px; letter-spacing: .28em; opacity: .62;
  font-family: var(--serif);
  animation: rise .6s .35s both;
}
.brand-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .14em; opacity: .55;
  animation: rise .6s .45s both;
}
.brand-foot-dot { opacity: .6; }

/* 右表单 */
.login-form-side {
  display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(rgba(18,53,40,.035) 1px, transparent 1.3px);
  background-size: 16px 16px;
  padding: 48px 40px;
}
.login-form { width: 340px; max-width: 100%; animation: rise .6s .2s both; }
.login-head {
  font-family: var(--serif); font-weight: 700; font-size: 26px;
  margin: 0 0 6px; color: var(--ink);
}
.login-sub { margin: 0 0 30px; color: var(--muted); font-size: 14px; }
.field { display: block; margin-bottom: 18px; }
.field-label {
  display: block; font-size: 13px; color: var(--muted);
  margin-bottom: 7px; letter-spacing: .04em;
}
.login-form input {
  width: 100%; height: 48px; padding: 0 15px;
  border: 1px solid var(--line); border-radius: 11px;
  font-size: 15px; background: var(--paper-2); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-form input:focus {
  border-color: var(--cyan); background: #fff;
  box-shadow: 0 0 0 3.5px rgba(217,179,106,.16);
}
.btn-primary {
  width: 100%; height: 48px; margin-top: 6px; border: none; border-radius: 11px;
  background: linear-gradient(135deg, #23684c, #123528);
  color: #f5efdd; font-size: 16px; font-weight: 600; letter-spacing: .3em; text-indent: .3em;
  box-shadow: 0 8px 22px rgba(18,53,40,.38);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(217,179,106,.45); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.login-err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ==========================================================
   主应用：左菜单 + 右内容
   ========================================================== */
.app {
  display: grid; grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(560px 320px at 120% -8%, rgba(217,179,106,.38), transparent 62%),
    linear-gradient(175deg, var(--ink-2), var(--ink) 60%);
  color: #fff; overflow: hidden;
}
.side-halftone {
  background-size: 13px 13px;
  -webkit-mask-image: radial-gradient(340px 240px at 85% 0%, #000, transparent 70%);
          mask-image: radial-gradient(340px 240px at 85% 0%, #000, transparent 70%);
}
.side-aurora {
  position: absolute; width: 300px; height: 300px; right: -110px; top: -110px;
  background: radial-gradient(closest-side, rgba(217,179,106,.45), transparent 70%);
  filter: blur(8px); pointer-events: none;
}
.side-halftone, .side-aurora { z-index: 0; }
.side-brand, .side-nav, .side-foot { position: relative; z-index: 1; }

.side-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 20px 20px;
}
.side-brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.side-brand-text b { font-family: var(--serif); font-size: clamp(14px, 4.2vw, 18px); font-weight: 700; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand-text i { font-style: normal; font-size: 11px; opacity: .55; letter-spacing: .12em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-nav { flex: 1; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.side-nav-label {
  font-size: 11px; letter-spacing: .28em; opacity: .4;
  padding: 10px 12px 8px;
}
.side-nav .tab {
  display: flex; align-items: center; gap: 11px;
  border: none; background: transparent; color: rgba(255,255,255,.66);
  font-size: 14.5px; padding: 12px 14px; border-radius: 11px;
  position: relative; text-align: left;
  transition: background .15s, color .15s;
}
.side-nav .tab svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side-nav .tab:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav .tab.active { background: rgba(217,179,106,.16); color: #fff; font-weight: 600; }
.side-nav .tab.active svg { opacity: 1; color: var(--cyan); }
.side-nav .tab.active::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 3px; background: var(--cyan);
  box-shadow: 0 0 12px rgba(217,179,106,.8);
}

.side-foot { padding: 16px 14px 18px; border-top: 1px solid rgba(255,255,255,.09); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 0 8px 12px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #23684c, #123528);
  color: #f5efdd; font-size: 13px; font-weight: 700;
}
.cur-user { font-size: 13px; opacity: .85; }
.btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; background: rgba(255,255,255,.08); border: none; color: rgba(255,255,255,.8);
  height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13px;
  transition: background .15s, color .15s;
}
.btn-ghost svg { width: 15px; height: 15px; }
.btn-ghost:hover { background: rgba(216,67,67,.22); color: #fff; }

/* 内容区 */
.content {
  padding: 30px 34px 44px;
  max-width: 1160px; width: 100%; margin: 0 auto;
  background-image: radial-gradient(rgba(18,53,40,.03) 1px, transparent 1.3px);
  background-size: 16px 16px;
}
.view { animation: rise .4s both; }

/* 统计卡 */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 18px 16px; position: relative; overflow: hidden;
  box-shadow: 0 4px 18px rgba(18,53,40,.05);
  transition: transform .15s, box-shadow .15s;
}
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ink); opacity: .25;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(18,53,40,.1); }
.stat-card .label { font-size: 12.5px; color: var(--muted); margin-bottom: 9px; letter-spacing: .04em; }
.stat-card .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .value.cyan { color: var(--cyan-d); }
.stat-card .value.cyan::before { background: transparent; }
.stat-card .value.green { color: var(--green); }
.stat-card .value.red { color: var(--red); }
.stat-card .value.amber { color: var(--amber); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; box-shadow: 0 4px 18px rgba(18,53,40,.05); margin-bottom: 18px;
}
.panel h3 {
  margin: 0 0 14px; font-size: 15px; font-family: var(--serif);
  color: var(--ink); letter-spacing: .04em;
}
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 7px;
  background: var(--paper-2); font-size: 12px; color: var(--muted); flex: none;
}
.rank-row:first-child .rank-no { background: rgba(217,179,106,.14); color: var(--cyan-d); font-weight: 700; }
.rank-name { flex: 1; font-weight: 600; }
.rank-cnt { color: var(--muted); font-size: 13px; margin-right: 12px; }
.rank-amt { font-variant-numeric: tabular-nums; font-weight: 600; }

/* 订单工具栏 */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select {
  height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar input:focus, .toolbar select:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(217,179,106,.14);
}
.toolbar .spacer { flex: 1; }
.btn-add {
  height: 40px; padding: 0 20px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #23684c, #123528);
  color: #f5efdd; font-weight: 600; font-size: 14px;
  box-shadow: 0 6px 16px rgba(18,53,40,.32);
  transition: filter .12s, transform .12s;
}
.btn-add:hover { filter: brightness(1.06); }
.btn-add:active { transform: translateY(1px); }

/* 表格 */
.table-wrap {
  overflow-x: auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 4px 18px rgba(18,53,40,.05);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th {
  background: var(--paper-2); color: var(--muted); font-weight: 600; font-size: 12px;
  letter-spacing: .08em;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(217,179,106,.045); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.paid { background: rgba(30,154,99,.12); color: var(--green); }
.pill.unpaid { background: rgba(216,67,67,.12); color: var(--red); }
.pill.cyan { background: rgba(217,179,106,.14); color: var(--cyan-d); }
.pill.off { background: #f0ecdf; color: #8a9384; }
.row-actions button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 4px 11px; font-size: 13px; margin-left: 6px; color: var(--text);
  transition: border-color .12s, color .12s;
}
.row-actions button:hover { border-color: var(--cyan); color: var(--cyan-d); }
.row-actions button.danger:hover { border-color: var(--red); color: var(--red); }

/* 分页 */
.pager {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  margin-top: 14px; font-size: 13px; color: var(--muted);
}
.pager button {
  height: 32px; padding: 0 14px; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; transition: border-color .12s, color .12s;
}
.pager button:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan-d); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* 预设管理 */
.preset-block { margin-bottom: 22px; }
.preset-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px;
  border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line);
  font-size: 14px; transition: border-color .12s, background .12s;
}
.chip:hover { border-color: rgba(217,179,106,.5); background: #fff; }
.chip .sub { color: var(--muted); font-size: 12px; }
.chip .x { cursor: pointer; color: var(--muted); font-weight: 700; transition: color .12s; }
.chip .x:hover { color: var(--red); }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-row input {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper-2); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.add-row input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(217,179,106,.14); }
.add-row .btn-sm {
  height: 38px; padding: 0 18px; border: none; border-radius: 9px;
  background: linear-gradient(135deg, #23684c, #123528);
  color: #f5efdd; font-weight: 600; transition: filter .12s;
}
.add-row .btn-sm:hover { filter: brightness(1.06); }

/* 模态 */
.modal {
  position: fixed; inset: 0; background: rgba(18,53,40,.5);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-box {
  width: 460px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 16px;
  box-shadow: 0 20px 70px rgba(0,0,0,.35);
  animation: rise .28s both;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 16px; font-family: var(--serif); color: var(--ink);
}
.modal-close { border: none; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); }
.modal-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-body label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.modal-body input, .modal-body textarea, .modal-body select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper-2); font-size: 14px; outline: none; margin-bottom: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.modal-body input:focus, .modal-body textarea:focus, .modal-body select:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(217,179,106,.14);
}
.modal-body textarea { min-height: 64px; resize: vertical; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.btn-cancel { height: 40px; padding: 0 18px; border: 1px solid var(--line); background: #fff; border-radius: 9px; }
.btn-save {
  height: 40px; padding: 0 22px; border: none; border-radius: 9px;
  background: linear-gradient(135deg, #23684c, #123528);
  color: #f5efdd; font-weight: 600; transition: filter .12s;
}
.btn-save:hover { filter: brightness(1.06); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 10px;
  font-size: 14px; z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  animation: rise .25s both;
}
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* 入场动画 */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 版本角标（登录页 + 主界面底部） */
.ver-foot {
  position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%);
  z-index: 70; font-size: 11px; color: var(--muted); opacity: .45;
  letter-spacing: .08em; pointer-events: none; user-select: none;
}

/* ==========================================================
   移动端（H5 / 微信内打开）
   注意：必须放在文件最末尾 —— 同优先级规则后者胜出，
   否则会被上方基础规则（.app 232px / .side-brand-text 等）反杀
   ========================================================== */
@media (max-width: 860px) {
  /* ---- 登录页：品牌幕改紧凑横幅，标题一行 ---- */
  .login-stage { grid-template-columns: minmax(0, 1fr); }
  .login-brand { padding: 30px 26px 34px; }
  .seal-lg { width: 58px; height: 58px; }
  .brand-title { font-size: 30px; letter-spacing: .1em; margin: 16px 0 8px; }
  .brand-tag { font-size: 13px; letter-spacing: .2em; }
  .brand-top { gap: 8px; }
  .brand-top-en { font-size: 10px; letter-spacing: .18em; white-space: nowrap; }
  .brand-foot { font-size: 11px; letter-spacing: .1em; gap: 7px; flex-wrap: wrap; }
  .login-form-side { padding: 34px 24px 44px; }

  /* ---- 主应用：侧栏收窄为 64px 图标栏，可点按钮展开抽屉 ---- */
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .content { min-width: 0; max-width: 100%; padding: 18px 14px 40px; }
  .side-brand { flex-direction: column; gap: 10px; padding: 16px 0 12px; }
  .side-brand-text { display: none; }
  .side-toggle { margin-left: 0; }
  .side-nav { padding: 8px 10px; }
  .side-nav-label { display: none; }
  .side-nav .tab { font-size: 0; gap: 0; justify-content: center; padding: 13px 0; }
  .side-nav .tab svg { width: 20px; height: 20px; }
  .side-user { justify-content: center; padding: 0 0 10px; }
  .cur-user { display: none; }
  .btn-ghost { font-size: 0; gap: 0; justify-content: center; padding: 0; }

  /* 抽屉展开态：完整侧栏覆盖 + 遮罩（侧栏本体 fixed 覆盖，关闭后回到图标栏） */
  .app.side-open .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 232px; height: 100vh; z-index: 60;
  }
  .app.side-open .side-brand { flex-direction: row; flex-wrap: nowrap; padding: 24px 16px 20px; gap: 10px; }
  .app.side-open .side-brand-text { display: flex; flex: 1; min-width: 0; }
  .app.side-open .side-brand-text b { font-size: 15px; letter-spacing: .04em; }
  .app.side-open .side-toggle { margin-left: auto; }
  /* 抽屉展开时箭头转向右，提示「再点收起」 */
  .app.side-open .side-toggle svg { transform: rotate(180deg); }
  .app.side-open .side-nav { padding: 10px 14px; }
  .app.side-open .side-nav-label { display: block; }
  .app.side-open .side-nav .tab { font-size: 14.5px; gap: 11px; justify-content: flex-start; padding: 12px 14px; }
  .app.side-open .side-nav .tab svg { width: 18px; height: 18px; }
  .app.side-open .side-user { justify-content: flex-start; padding: 0 8px 12px; }
  .app.side-open .cur-user { display: inline; font-size: 13px; }
  .app.side-open .btn-ghost { font-size: 13px; gap: 7px; justify-content: center; padding: 0 14px; }

  /* 仪表盘：两列卡 + 数值不溢出 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px 14px 12px; border-radius: 12px; }
  .stat-card .value { font-size: 21px; }
  .panel { padding: 16px 14px; border-radius: 12px; }
  .rank-row { gap: 9px; padding: 9px 0; }
  .rank-cnt { font-size: 12px; margin-right: 6px; white-space: nowrap; }
  .rank-amt { font-size: 13.5px; text-align: right; }

  /* 工具栏：搜索框吃满剩余宽度 */
  .toolbar input { flex: 1; min-width: 0; }
  .btn-add { flex: none; }

  /* 表格保持横向滚动（table-wrap 已有 overflow-x），内边距收窄 */
  th, td { padding: 10px 10px; }

  /* 分页居中 */
  .pager { justify-content: center; flex-wrap: wrap; }

  /* 表单弹窗：单列 */
  .form-grid { grid-template-columns: 1fr; }
  .modal-box { max-width: 94vw; border-radius: 14px; }
  .modal-body { padding: 16px; }

  /* 预设胶囊换行不挤压 */
  .add-row input { flex: 1; min-width: 0; }
}

/* ==========================================================
   微动效（全局）：仪表盘卡片交错进场 + 悬停抬升
   ========================================================== */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.stat-card {
  animation: cardIn .38s cubic-bezier(.2,.8,.3,1) both;
  transition: transform .16s ease, box-shadow .16s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(18,53,40,.38); }
.stat-grid .stat-card:nth-child(1) { animation-delay: .05s; }
.stat-grid .stat-card:nth-child(2) { animation-delay: .12s; }
.stat-grid .stat-card:nth-child(3) { animation-delay: .19s; }
.stat-grid .stat-card:nth-child(4) { animation-delay: .26s; }
.stat-grid .stat-card:nth-child(5) { animation-delay: .33s; }
.stat-grid .stat-card:nth-child(6) { animation-delay: .40s; }
.stat-grid .stat-card:nth-child(7) { animation-delay: .47s; }
.rank-row { transition: transform .15s ease, background .15s ease; }
.rank-row:hover { background: rgba(217,179,106,.08); transform: translateX(3px); }
tbody tr { transition: background .14s ease; }
.btn-add:hover, .btn-save:hover, .btn-sm:hover { transform: translateY(-1px); }

/* ==========================================================
   小程序用户页：子页签 / 状态药丸 / 设备码
   ========================================================== */
.sub-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.sub-tab {
  border: none; background: transparent; padding: 11px 20px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
  border-radius: 8px 8px 0 0;
}
.sub-tab:hover { color: var(--ink); background: rgba(217,179,106,.08); }
.sub-tab.on { color: var(--ink); border-bottom-color: var(--ink-2, #1d5c43); }
.sub-tab span { color: var(--red); font-size: 12px; font-weight: 700; }
.pill.amber { background: rgba(232,148,10,.13); color: #a8690a; border: 1px solid rgba(232,148,10,.26); }
/* 小程序用户：管理员徽章（奶油金，区别于状态药丸） */
.pill.admin { background: rgba(217,179,106,.22); color: #8a6520; border: 1px solid rgba(217,179,106,.45); }
.mp-code {
  display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis;
  vertical-align: middle; white-space: nowrap; font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: 12.5px; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 7px; color: var(--ink);
}
.mp-sub { font-size: 12px; color: var(--muted); }


/* ==========================================================
   访问权限：邀请码一键复制 + 启用/停用操作按钮语义色
   停用 = 暖琥珀（警示但不与红色删除混淆）；启用/通过 = 品牌绿
   ========================================================== */
.mp-code-cell { white-space: nowrap; }
.mp-code-copy { cursor: pointer; }
.mp-code-copy:hover { border-color: var(--cyan); background: #fff; }
.btn-copy {
  margin-left: 6px; padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--paper-2);
  color: var(--ink-2); font-size: 12px; font-weight: 600;
  vertical-align: middle; transition: border-color .12s, background .12s, color .12s;
}
.btn-copy:hover { border-color: var(--cyan); color: var(--cyan-d); background: #fff; }
.btn-copy.is-copied {
  border-color: var(--green); color: var(--green); background: rgba(30,154,99,.10);
}

.row-actions button.toggle-on,
.row-actions button.toggle-off { font-weight: 600; }
.row-actions button.toggle-on {
  border-color: rgba(30,154,99,.42); background: rgba(30,154,99,.10); color: #147a4d;
}
.row-actions button.toggle-off {
  border-color: rgba(232,148,10,.42); background: rgba(232,148,10,.10); color: #a8690a;
}
.row-actions button.toggle-on:hover {
  border-color: var(--green); background: rgba(30,154,99,.18); color: #0f6b43;
}
.row-actions button.toggle-off:hover {
  border-color: var(--amber); background: rgba(232,148,10,.18); color: #8a5405;
}
