/* ==========================================================================
   MY俱乐部 · 设计系统
   蓝色主色 / 浅色 + 深色 / 极简
   所有颜色都走变量，深色主题只覆盖变量，组件规则一份
   ========================================================================== */

:root {
  color-scheme: light;

  --bg:        #F4F7FC;
  --surface:   #FFFFFF;
  --surface-2: #EDF2FA;
  --surface-3: #E5ECF8;
  --line:      #E1E8F4;
  --line-2:    #EEF3FB;

  /* 服务券的券根（卡片底部那条「价格 + 下单」）。
     比纸面沉一档，撕票线才看得出是「另一段」。 */
  --stub-bg:   #F5F9FF;

  /* 服务券上的撕票线。比 --brand-line 重一点，否则浅色纸上几乎看不见。 */
  --perf:      rgba(28, 92, 214, .34);

  /* 浅色主题下的大面板。深色主题在下面重新赋值成玻璃 ——
     不能只靠 var(--paper, …) 的 fallback：--paper 定义在 :root，
     两个主题都会命中它，fallback 永远不会生效。 */
  --paper:     rgba(255, 255, 255, .93);

  --text:      #0D1526;
  --text-2:    #54617D;
  --muted:     #606B83;   /* 四种底上全过 4.5:1：白 5.35、--surface-2 4.76、
                             页面底 4.98、--surface-3 4.50。原来 #66718A 在
                             --surface-2 上 4.35、在 --surface-3 上 4.29。 */

  --brand:      #1C5CD6;
  --brand-2:    #4B8BFF;
  --brand-ink:  #123F9E;
  --brand-soft: rgba(28, 92, 214, .10);
  --brand-line: rgba(28, 92, 214, .24);
  --on-brand:   #FFFFFF;

  --ok:   #0E9E68;
  --warn: #8A5A00;
  --err:  #DC3448;
  --wx:   #07C160;
  --ali:  #1677FF;

  /* 「写给人看的字」要比「画给眼睛看的面」更深一档。
     原色是给圆点、进度条、描边和渐变用的（非文本，3:1 就够）；
     直接拿去写徽标、提示条上的字就不够了 —— 因为徽标底本身是原色 12% 的淡染，
     等于浅色字压浅色底：
       --ok      on 自己的 12% 染底  只有 2.69:1   （「已付款」徽标，最糟）
       --brand-2 on 自己的 14% 染底  只有 2.54:1   （「进行中」徽标）
       --warn    on 自己的 12% 染底  只有 4.49:1   （「待接单」徽标，差 0.01）
       --err     on 自己的 10% 染底  只有 3.94:1   （登录失败、查单没查到）
     下面四个是同色相压深后的文字专用版，在最糟的染底上全部 >= 4.5:1。 */
  --ok-ink:      #0A744D;   /* 染底 5.05:1、白底 5.80:1 */
  --warn-ink:    #895A00;   /* 染底 5.02:1 */
  --err-ink:     #CB3043;   /* 染底 4.51:1、白底 5.19:1 */
  --brand-2-ink: #3663B6;   /* 染底 5.02:1 */

  --r-xs: 7px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;
  --r-full: 999px;

  --sh-1: 0 1px 2px rgba(13, 21, 38, .05);
  --sh-2: 0 1px 2px rgba(13, 21, 38, .05), 0 10px 26px -16px rgba(13, 21, 38, .30);
  --sh-3: 0 2px 6px rgba(13, 21, 38, .06), 0 26px 60px -28px rgba(13, 21, 38, .40);
  --sh-brand: 0 8px 22px -12px rgba(28, 92, 214, .85);

  --pad:  clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --barh: 64px;

  --sans: "Inter", "Noto Sans SC", "Microsoft YaHei UI", "微软雅黑", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "LXGW WenKai", "楷体", KaiTi, "STKaiti", var(--sans);
  --mono: "Cascadia Mono", Consolas, ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg:        #070A12;
  --surface:   #111726;
  --surface-2: #151C2E;
  --surface-3: #1B2437;
  --line:      #232C42;
  --line-2:    #1A2233;

  /* 深色下大面板继续用玻璃（浅色那边是近乎不透明的白纸）。
     --glass-hi 在下方 :root 里定义，这里只是换个名字给 .panel/.login-card 用。 */
  --paper:     color-mix(in srgb, var(--surface) 86%, transparent);

  /* 深色下卡片是玻璃，券根只需一点提亮 */
  --stub-bg:   rgba(255, 255, 255, .035);
  --perf:      rgba(92, 155, 255, .40);

  --text:      #E9F0FF;
  --text-2:    #9BA9C6;
  --muted:     #8B99B8;   /* 对 --surface 6.3:1，之前 #6D7B9A 只有 4.3:1 */

  --brand:      #5C9BFF;
  --brand-2:    #82B6FF;
  --brand-ink:  #A8CDFF;
  --brand-soft: rgba(92, 155, 255, .15);
  --brand-line: rgba(92, 155, 255, .32);
  --on-brand:   #06122B;

  --ok:   #2ECC8F;
  --warn: #E2A33C;
  --err:  #FF6174;

  /* 深色底本来就够暗，这几个原色直接当文字用都过 4.5:1
     （--ok 8.20:1、--brand-2 6.79:1、--err 5.47:1），不需要再压深。
     变量仍然列出来，是为了让「文字走 ink」这条规则在两套主题下写法一致。 */
  --ok-ink:      #2ECC8F;
  --warn-ink:    #E2A33C;
  --err-ink:     #FF6174;
  --brand-2-ink: #82B6FF;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -18px rgba(0, 0, 0, .85);
  --sh-3: 0 2px 8px rgba(0, 0, 0, .45), 0 30px 70px -30px rgba(0, 0, 0, .9);
  --sh-brand: 0 10px 26px -14px rgba(92, 155, 255, .8);
}

/* ---------------------------------------------------------------- 基础 */

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

[hidden] { display: none !important; }

/* 手机上点任何东西都会先卡 300ms —— 浏览器在等「这是不是双击缩放的第二下」。
   touch-action: manipulation 告诉它这里不用等，点哪儿算哪儿。
   只关掉双击缩放，双指捏合缩放照常能用。 */
a, button, [role="button"], label, summary,
input, select, textarea { touch-action: manipulation; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

img, svg, video { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

::selection { background: var(--brand); color: var(--on-brand); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { flex: 0 0 auto; }

.btn-p {
  color: var(--on-brand);
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: var(--sh-brand);
}
.btn-p:hover { filter: brightness(1.07); }
.btn-p[disabled] { opacity: .5; box-shadow: none; cursor: not-allowed; filter: none; }

.btn-g {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--sh-1);
}
.btn-g:hover { border-color: var(--brand-line); color: var(--brand); }

.btn-o {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand-line);
}
.btn-o:hover { background: var(--brand-line); }

.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }

/* 图标按钮（主题切换等） */
.icobtn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: color .18s, border-color .18s, background .18s;
}
.icobtn:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }

/* ---------------------------------------------------------------- 标签 / 徽标 */

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
}
.tags-inline { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px 0 8px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}

.badge.st-pending   { color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.badge.st-accepted  { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-line); }
.badge.st-running   { color: var(--brand-2-ink); background: color-mix(in srgb, var(--brand-2) 14%, transparent); border-color: color-mix(in srgb, var(--brand-2) 30%, transparent); }
.badge.st-done      { color: var(--ok-ink); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.badge.st-canceled  { color: var(--muted); }
.badge.pay-paid     { color: var(--ok-ink); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.badge.pay-unpaid   { color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.badge.pay-refunded { color: var(--muted); }
.badge.role-admin   { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-line); }
.badge.role-staff   { color: var(--text-2); }

@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  .badge.st-pending, .badge.pay-unpaid { background: var(--surface-2); }
  .badge.st-running { background: var(--brand-soft); }
  .badge.st-done, .badge.pay-paid { background: var(--surface-2); }
}

/* ---------------------------------------------------------------- 面板 */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.panel-h {
  position: relative;
  /* 头部的第二块（徽标 / 按钮 / .panel-act）以前是普通块级流，
     天然会掉到说明文字下面，所以下面的注解让人「自己包一层」。
     直接给头部上 flex 更省事：标题块吃满剩余宽度，右侧那块贴右；
     窄屏放不下时照旧换行。 */
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.panel-h > :first-child { min-width: 0; flex: 1 1 auto; }
/* 并排之后 .panel-act 不再需要自己顶开一段间距 */
.panel-h > .panel-act { margin-top: 0; }
.panel-h h2, .panel-h h3 {
  position: relative;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.panel-h p {
  position: relative;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}
/* .panel-h 是普通块级流，头部里的按钮天然会掉到说明文字下面。
   要并排放得自己包一层。 */
.panel-act {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
/* 这里原本有个 .panel-h::after：在面板头部右上角挂一个 170×170 的
   --brand-soft 径向渐变圆（right:-30px; top:-70px）。它压在 6% 的
   bg-erii 壁纸上时几乎看不出来，壁纸一删就成了一块飘在标题旁边的淡蓝雾，
   而且每个面板头都长一个 —— 正是「模板感」的来源。
   装饰性图案在数据密集的界面里只会跟内容抢注意力，所以整条删掉。
   .panel-h 的 overflow:hidden 留着，它还能挡住标题过长之类的溢出。 */
.panel-b { padding: 18px; }
.panel-pad { padding: 18px; }

/* 强调面板（价格 / 合计） */
.amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.amount .lbl { font-size: 12.5px; color: var(--text-2); }
.amount .val {
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.amount .val i { font-size: 13px; font-style: normal; font-weight: 500; color: var(--muted); margin-left: 3px; }

/* 键值表 */
.kv { display: grid; gap: 0; font-size: 13.5px; }
.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.kv > div:last-child { border-bottom: 0; }
.kv dt, .kv .k { color: var(--muted); flex: 0 0 auto; }
.kv dd, .kv .v { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }

/* 上面那段管的是「每行有 <div> 包着」的结构；订单卡里的 <dl class="kv"> 是
   dt/dd 直接挂着，得显式分两列，否则退化成单列 —— dt 独占一行、dd 掉到下一行
   被 text-align:right 甩到最右边。
   这段原本只写在 shop.css，而 lib/ui.php:315 是 shop / console 二选一，工作台
   从来拿不到它，订单详情因此一直是错位的。放这里两套版式都能用。 */
dl.kv { grid-template-columns: auto minmax(0, 1fr); }
dl.kv dt,
dl.kv dd { padding: 9px 0; border-bottom: 1px dashed var(--line); }
dl.kv dt { color: var(--muted); white-space: nowrap; }
dl.kv dd { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }

/* 折叠订单行展开以后，.kv 是整行宽的（点单页约 760px、工作台那两列约 500px）。
   上面那套「标签左、值右对齐」在这个宽度下会拉出半屏空白，眼睛得横跨整行
   才能把标签和它的值连起来。改成值紧跟标签，标签列按最长那条对齐。 */
.oline .kv, .orow .kv { grid-template-columns: max-content minmax(0, 1fr); column-gap: 14px; }
.oline .kv dd, .orow .kv dd { text-align: left; }

/* 窄屏放不下两列，改成「标签在上、值在下」 */
@media (max-width: 620px) {
  dl.kv { grid-template-columns: minmax(0, 1fr); }
  dl.kv dt {
    padding: 9px 0 0;
    border-bottom: 0;
    white-space: normal;
    font-size: 12px;
  }
  dl.kv dd { padding: 2px 0 9px; text-align: left; }
}

/* ---------------------------------------------------------------- 表单 */

.form { display: grid; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.f { display: grid; gap: 6px; min-width: 0; }
.f > label, .f .lb {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.f .hint { font-size: 11.5px; color: var(--muted); }
.f .err { font-size: 11.5px; color: var(--err-ink); display: none; }
.f.bad .inp, .f.bad .ta, .f.bad .sel { border-color: var(--err); }
.f.bad .err { display: block; }

.req { color: var(--err-ink); margin-left: 2px; }

.inp, .ta, .sel {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  height: 42px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.ta { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; min-height: 92px; }
/* 下拉箭头用内联 SVG，不再用两条 linear-gradient 拼出来的 5px 三角
   （那个又小又糊，缩放还会走形）。data URI 里取不到 currentColor，
   所以暗色主题要单独再覆盖一次 stroke 颜色。 */
.sel { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366718A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-position: calc(100% - 13px) center;
  background-size: 12px 12px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
html[data-theme="dark"] .sel {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B99B8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
}
.inp::placeholder, .ta::placeholder { color: var(--muted); opacity: .85; }
.inp:hover, .ta:hover, .sel:hover { border-color: var(--brand-line); }
.inp:focus, .ta:focus, .sel:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-actions .btn { flex: 0 0 auto; }

/* 数量步进器 */
.qty {
  display: inline-flex;
  align-items: stretch;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.qty button {
  width: 40px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 17px;
  transition: background .16s, color .16s;
}
.qty button:hover { background: var(--brand-soft); color: var(--brand); }
.qty input {
  width: 58px;
  text-align: center;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  font-weight: 600;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; background: var(--brand-soft); }
.qty .unit {
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
}

/* ---------------------------------------------------------- 胶囊按钮组 */

/* 只准点、不准手打。44px 高保证手指能点准。
   这组胶囊给「开始时间」的日期快捷项用；平台 / 分区两组在下面另有方形版式。 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  min-height: 44px;
  padding: 0 17px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color .16s, background .16s, border-color .16s;
}
.chip:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }
.chip[aria-pressed="true"] {
  color: var(--on-brand);
  background: var(--brand);
  border-color: var(--brand);
}
/* 必填项没选时，整组描红；选了任意一项后由 bindPick 自己摘掉 */
.f.bad .chip { border-color: var(--err); }
.f.bad > label { color: var(--err-ink); }

/* 平台 / 分区两组：复用顶栏 nav.has-pill 的滑动指示条。
   结构仍是原来的两组 [data-pick] + .chip 单选，交互一个字不动；
   把「谁被选中就给谁整块填色」换成一条在组内滑动的品牌色滑块，
   几何由 app.js 的 movePickPill() → slidePill() 按选中项 rect 算，这里只管外观。
   圆角用 --r / --r-sm 而不是 999px：滑块机制、渐变、阴影、缓动跟 nav 完全一致，
   但形状跟 .inp / .panel 保持同一套语言，不回到上一轮嫌弃的全圆胶囊。
   选择器一律带 [data-pick]，开始时间的 [data-daypick] 胶囊完全不受影响。 */
.chips[data-pick] {
  position: relative;              /* .pick-pill 的定位参照 */
  isolation: isolate;              /* z-index 关在组内，别和页面其它层打架 */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* 和 .nav-pill / .tab-pill / .tpill 同一套视觉；
   width / height / transform 由 JS 写进来。 */
.pick-pill {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: var(--sh-brand);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: transform .4s var(--ease), width .4s var(--ease),
              height .4s var(--ease), opacity .2s;
}
.chips[data-pick].has-pill .pick-pill { opacity: 1; }

/* 按钮必须透明：z-index 1 压在滑块上，但凡有一点不透明背景或边框，
   滑块滑过来就会被盖住 / 框住。border 用 transparent 占位保证尺寸不跳。 */
.chips[data-pick] .chip {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-align: center;
  transition: color .18s var(--ease);
}
.chips[data-pick] .chip:hover {
  color: var(--brand-ink);
  background: transparent;
  border-color: transparent;
}
.chips[data-pick] .chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
/* 特异性压过通用 .chip:hover / .chip[aria-pressed="true"] 的整块填色，
   选中态只留品牌色上的反白文字，底色全部交给滑块。 */
.chips[data-pick] .chip[aria-pressed="true"],
.chips[data-pick] .chip[aria-pressed="true"]:hover {
  color: var(--on-brand);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* 必填没选时整组描红；容器吃红框，按钮自己的边框仍保持透明。 */
.f.bad .chips[data-pick] { border-color: var(--err); }
.f.bad .chips[data-pick] .chip { border-color: transparent; }

/* 手机端 form-row 始终是两列，每个字段只有约 155px；收紧内衬和高度。 */
@media (max-width: 620px) {
  .chips[data-pick] { padding: 2px; }
  .chips[data-pick] .chip { min-height: 38px; padding: 0 6px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .pick-pill, .chips[data-pick] .chip { transition: none !important; }
}

/* ------------------------------------------------------ 开始时间选择器 */

.starttime { display: grid; gap: 10px; }

/* 拖动条。原生 range 在 iOS 上默认又细又难拖，这里把轨道和滑块都加粗，
   滑块本体 24px，外面套一圈和卡片同色的环，视觉上像浮在轨道上。 */
.clock {
  display: grid;
  gap: 4px;
  padding: 12px 15px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.clock-hd { display: flex; align-items: baseline; gap: 8px; }
/* display:grid 会盖掉 UA 的 [hidden]{display:none}，必须显式声明一次 */
.clock[hidden] { display: none; }
.clock-hd b {
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.clock-hd span { font-size: 12.5px; color: var(--muted); }

.clock-r {
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.clock-r::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}
.clock-r::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
}
.clock-r::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}
.clock-r::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--brand);
}
.clock-r:focus { outline: none; }
.clock-r:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--brand-soft); }
.clock-r:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--brand-soft); }

.clock-ft {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 内联月历。不用弹层：手机上一个弹层再套键盘/滚动容易把页面顶飞。 */
.cal {
  padding: 10px 12px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.cal[hidden] { display: none; }
.cal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.cal-hd b { font-size: 13.5px; color: var(--text); }
.cal-nav {
  width: 36px;
  height: 36px;
  font-size: 19px;
  line-height: 1;
  color: var(--text-2);
  border-radius: 9px;
  transition: background .16s, color .16s;
}
.cal-nav:hover { background: var(--brand-soft); color: var(--brand); }

.cal-wk, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wk span {
  padding-bottom: 2px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.cal-d {
  height: 36px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  border-radius: 9px;
  transition: background .14s, color .14s;
}
.cal-d:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand); }
.cal-d.today { box-shadow: inset 0 0 0 1px var(--brand-line); }
.cal-d.on { background: var(--brand); color: var(--on-brand); font-weight: 700; }
.cal-d:disabled { color: var(--muted); opacity: .4; cursor: not-allowed; }

/* ---------------------------------------------------------------- 表格 */

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; vertical-align: middle; }
.tbl th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { border-bottom: 1px solid var(--line-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--brand-soft); }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* 操作列靠右 —— 按钮/图标贴右是表格惯例，也顺手解决最后一列
   内容靠左留出一大块空白、看着像没撑满的问题。 */
.tbl th.act, .tbl td.act { text-align: right; }

/* ---------------------------------------------------------------- 订单行 */

/* 工作台的 .oline 和点单页的 .orow 是同一个东西：折叠起来的一行订单，
   点一下才展开详情。两边页面只加载 console.css 或 shop.css 之一，
   所以这些共用规则必须住在两边都会加载的 base.css 里 ——
   否则改了工作台忘了点单页，两边就长歪了。 */

.oline,
.orow {
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color .2s, background .2s;
}
.oline:hover,
.orow:hover { border-color: var(--brand-line); }
.oline[open],
.orow[open] { border-color: var(--brand-line); background: var(--surface); }

.oline > summary,
.orow > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  cursor: pointer;
  list-style: none;
  transition: background .18s;
}
.oline > summary::-webkit-details-marker,
.orow > summary::-webkit-details-marker { display: none; }

/* 展开箭头。用 border 画三角是因为它对任何字号都稳定，
   也不用往 HTML 里塞一个只有装饰作用的 <svg>。 */
.oline > summary::before,
.orow > summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0; height: 0;
  margin-right: 2px;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .22s var(--ease);
}
.oline[open] > summary::before,
.orow[open] > summary::before { transform: rotate(90deg); border-left-color: var(--brand); }

.oline > summary:hover,
.orow > summary:hover { background: var(--surface-2); }
.oline[open] > summary,
.orow[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--line); }

/* 两个状态徽标（如「待接单」+「已付款」）挨在一起时，统一 gap 只有 9px，
   看上去像粘成了一个。给相邻徽标补一点呼吸。 */
.oline .badge + .badge,
.orow .badge + .badge { margin-left: 3px; }

/* 点一下是展开，双击不该顺手把订单号选中 */
.oline > summary,
.orow > summary,
.gdet > summary { user-select: none; -webkit-user-select: none; }

.oline .code,
.orow .code { font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .03em; }
.oline .svc,
.orow .svc { font-size: 13.5px; font-weight: 600; }
.oline .met,
.orow .met { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
.oline .met .amt,
.orow .met .amt { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--brand); }
.oline .when,
.orow .when { font-size: 12px; color: var(--muted); }
.oline .cust,
.orow .cust { font-size: 12px; color: var(--text-2); }

/* ---------------------------------------------------------------- 提示条 */

.flashbox { display: grid; gap: 10px; margin: 16px 0 0; }
.flash {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
}
.flash.ok  { color: var(--ok-ink);  background: color-mix(in srgb, var(--ok) 10%, var(--surface));  border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.flash.err { color: var(--err-ink); background: color-mix(in srgb, var(--err) 10%, var(--surface)); border-color: color-mix(in srgb, var(--err) 26%, transparent); }
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  .flash.ok, .flash.err { background: var(--surface-2); }
}

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}
.empty b { display: block; font-size: 15px; color: var(--text); margin-bottom: 5px; }
.empty .btn { margin-top: 16px; }

/* ---------------------------------------------------------------- 页脚 */

.foot {
  margin-top: 46px;
  padding: 22px var(--pad) 30px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.foot .in {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
}
.foot code {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 入场 */

.reveal { opacity: 0; transform: translateY(12px); }
.reveal.on {
  opacity: 1;
  transform: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

/* ---------------------------------------------------------------- 品牌 */

.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--brand-2), var(--brand));
  box-shadow: var(--sh-brand);
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .28);
}

.brand-txt { display: grid; gap: 0; min-width: 0; line-height: 1.18; }
.brand-txt b {
  font-family: var(--hand);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.brand-txt i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .22em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 动效开关 */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------------------------------------------------------- 主题按钮修正 */
.icobtn > svg { width: 18px; height: 18px; flex: 0 0 auto; }
.icobtn .i-moon { display: none; }
html[data-theme="dark"] .icobtn .i-sun { display: none; }
html[data-theme="dark"] .icobtn .i-moon { display: block; }
/* =====================================================================
   右下角通知 + 自建弹窗（两套版式共用）
   全部自己实现，页面里不允许再出现 alert / confirm / prompt
   ===================================================================== */

/* ------------------------------------------- 通知（桌面右下角 / 手机顶部下拉） */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 98;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 13px 40px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-3);
  font-size: 13.5px;
  line-height: 1.55;
  overflow: hidden;
  opacity: 0;
  transform: translateX(22px) scale(.97);
  transition: opacity .28s var(--ease), transform .34s var(--ease);
}
.toast.on { opacity: 1; transform: none; }

.toast .tico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
}
.toast .tico svg { width: 15px; height: 15px; }
.toast .tmsg { flex: 1 1 auto; min-width: 0; word-break: break-word; }

.toast .tx {
  position: absolute;
  top: 5px; right: 5px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.toast .tx:hover { background: var(--surface-2); color: var(--text); }

/* 底部走完就消失的进度条 */
.toast .tbar {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left center;
  background: var(--brand);
  animation: tbar 3.4s linear forwards;
}
@keyframes tbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.toast.ok   .tico { background: var(--ok); }
.toast.ok   .tbar { background: var(--ok); }
.toast.err  .tico { background: var(--err); }
.toast.err  .tbar { background: var(--err); animation-duration: 5.4s; }
.toast.warn .tico { background: var(--warn); }
.toast.warn .tbar { background: var(--warn); }
.toast.info .tico { background: var(--brand); }

/* 左边一条配色竖线，扫一眼就知道是成功还是失败 */
.toast::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
}
.toast.ok::before   { background: var(--ok); }
.toast.err::before  { background: var(--err); }
.toast.warn::before { background: var(--warn); }

/* ------------------------------------------------------------ 弹窗 */

html.modal-open, html.modal-open body { overflow: hidden; }

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 22, .46);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  opacity: 0;
  transition: opacity .26s var(--ease);
}
@supports not (backdrop-filter: blur(2px)) { .modal-mask { background: rgba(8, 12, 22, .62); } }

.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-3);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transition: opacity .26s var(--ease), transform .32s var(--ease);
}
.modal.on .modal-mask { opacity: 1; }
.modal.on .modal-card { opacity: 1; transform: none; }

.modal-sm .modal-card { width: min(430px, 100%); }
.modal-md .modal-card { width: min(580px, 100%); }
.modal-lg .modal-card { width: min(780px, 100%); }
.modal-xl .modal-card { width: min(1060px, 100%); }

.modal-h {
  padding: 20px 52px 0 22px;
}
.modal-h h2 { font-size: 18px; line-height: 1.35; }
.modal-h p { margin-top: 5px; font-size: 13px; color: var(--text-2); }

.modal-b { padding: 18px 22px 4px; }
.modal-h + .modal-b { padding-top: 16px; }
.modal-b > :first-child { margin-top: 0; }

.modal-p { font-size: 14px; line-height: 1.7; color: var(--text-2); }

.modal-f {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 18px 22px 20px;
}

.modal-x {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 21px; line-height: 1;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.modal-x:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }

/* 弹窗里的信息摘要：比页面上的 .kv 更紧凑 */
.kv-summary {
  margin-top: 0;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}
.kv-summary > div { padding: 9px 0; }
.kv-summary > div + div { border-top: 1px dashed var(--line); }
.kv-summary b { text-align: right; word-break: break-word; }

.modal-b .amount { margin-top: 16px; }

/* ------------------------------------------------------- 选支付方式 */

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.pay-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.pay-big:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
}
.pay-big:active { transform: translateY(0); }
.pay-big .pn { font-size: 14px; font-weight: 600; }
.pay-big .pd { font-size: 12px; color: var(--muted); }
/* 支付方式图标：两家官方的原始标识，直接当图片用（不再手绘 SVG）。
   图本身带透明通道和圆角，所以这里只统一尺寸与对齐，不画底色。 */
.pi {
  display: block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.pay-big .pi { width: 38px; height: 38px; }

/* ------------------------------------------------ 通用图片/图标缓冲加载
   海报走 .blur-up 那套（模糊占位图 + 转圈）；这里管支付通道图标、收款二维码
   这类小图：加载期间由骨架微光顶着位置，decode 完成才淡入，失败留固定底色。
   图本身没来时 <img> 会露出自己的背景，所以把微光直接画在 img 上，
   不必给每种容器再套一层 wrapper。 */
img.img-fade {
  color: transparent; font-size: 0;   /* 别把 alt 文字提前露出来 */
  border-radius: 6px;
  background: linear-gradient(100deg,
              var(--surface-2) 20%, var(--brand-soft, rgba(90,140,240,.18)) 42%,
              var(--surface-2) 64%) 0 0 / 220% 100%;
  animation: imgShimmer 1.25s linear infinite;
}
img.img-fade.is-ready {
  background: none; border-radius: 0;
  animation: imgIn .35s ease both;
}
img.img-fade.is-failed {
  background: var(--surface-2); animation: none; opacity: .6;
}
@keyframes imgShimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
@keyframes imgIn { from { opacity: .2; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  img.img-fade, img.img-fade.is-ready { animation: none; }
}

/* --------------------------------------------------------- 收银台 */

.cashier { text-align: center; }

.cash-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  text-align: left;
}
.cash-head .pi { width: 38px; height: 38px; flex: 0 0 auto; }
.cash-who { flex: 1 1 auto; min-width: 0; }
.cash-who b { display: block; font-size: 14.5px; }
.cash-who span { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.cash-amt { flex: 0 0 auto; font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--brand); }
.cash-amt i { font-style: normal; font-size: 14px; margin-right: 1px; }

.cash-qr {
  position: relative;
  width: 196px;
  height: 196px;
  margin: 18px auto 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  box-shadow: var(--sh-2);
}
.cash-qr svg { width: 100%; height: 100%; display: block; }
/* 真实收款码是 V免签 的 enQrcode 生成的 PNG，不是原来的 SVG 了。
   白色底和 12px 内边距在 .cash-qr 上已经给好，图片铺满即可。 */
.cash-qr img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* 四个角的小取景框 */
.cash-corner {
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid var(--brand);
  border-radius: 2px;
}
.cash-corner.tl { top: -5px; left: -5px; border-right: 0; border-bottom: 0; }
.cash-corner.tr { top: -5px; right: -5px; border-left: 0; border-bottom: 0; }
.cash-corner.bl { bottom: -5px; left: -5px; border-right: 0; border-top: 0; }
.cash-corner.br { bottom: -5px; right: -5px; border-left: 0; border-top: 0; }

.cash-tip { margin-top: 16px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

.cash-timer {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.cash-timer b { font-family: var(--mono); font-size: 15px; color: var(--brand); }

/* 收银台里面那行提示链接（二维码扫不出来时跳 V免签 自带收银台） */
.cash-alt { margin-top: 10px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.cash-alt a { color: var(--brand); border-bottom: 1px solid var(--brand-line); }

/* 只有一种支付方式时不要撑成两列，右边留个空位很难看 */
.pay-grid.single { grid-template-columns: 1fr; }

/* 付款页的说明文字：金额必须按实际应付付，这句话要比普通 hint 更醒目 */
.pay-note {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}
.pay-note b { color: var(--brand); font-weight: 600; }
.pay-note-live { padding: 9px 12px; border-radius: var(--r); background: var(--brand-soft); color: var(--text-2); }

/* --------------------------------------------------- 弹窗里的付款成功 */

.pay-done-modal { text-align: center; padding: 6px 0 4px; }
.pay-done-modal .done-mark { margin-bottom: 6px; }
.pay-done-modal .order-code { margin: 12px auto 14px; }
.pay-done-modal .done-kv { margin-top: 0; }

/* ------------------------------------------------------------ 响应式 */

@media (max-width: 620px) {
  /* 手机上的通知改成「顶部下拉」，跟系统通知一个感觉。
     原来跟着桌面一起放右下角：正好压在悬浮的底部标签栏、以及「加进这一单 / 标记完成」
     那一排操作按钮上 —— 想看单子还得先等通知自己消失。手机上拇指本来就占着下半屏，
     把通知挪到上面是唯一不打架的位置。 */
  .toasts {
    top: calc(10px + env(safe-area-inset-top, 0px));
    bottom: auto;
    left: 10px;
    right: 10px;
    max-width: none;
    align-items: stretch;
    gap: 8px;
  }
  .toast {
    width: auto;
    padding: 11px 38px 12px 12px;
    border-radius: 14px;
    box-shadow: 0 16px 34px -14px rgba(13, 21, 38, .45), 0 2px 6px -2px rgba(13, 21, 38, .16);
    transform: translateY(-16px) scale(.96);   /* 从上方掉下来，而不是从右边滑进来 */
  }
  html[data-theme="dark"] .toast {
    box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .62), 0 2px 6px -2px rgba(0, 0, 0, .42);
  }
  .modal-root, .modal { padding: 12px; }
  .modal-card { max-height: 92vh; border-radius: var(--r); }
  .modal-h { padding: 17px 46px 0 16px; }
  .modal-b { padding: 15px 16px 2px; }
  .modal-f { padding: 15px 16px 16px; }
  .modal-f .btn { flex: 1 1 auto; }
  .pay-grid { grid-template-columns: 1fr; }
  .cash-qr { width: 168px; height: 168px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .modal-card, .modal-mask, .pay-big { transition: none !important; }
  .toast .tbar { animation: none !important; }
  .toast { transform: none; }
}

/* 完成态/弹窗里的键值行：标签靠左、值靠右（此前 done-kv 没带 kv 类，标签和值粘在一起） */
.done-kv > div { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.done-kv > div + div { margin-top: 5px; }
.done-kv span { color: var(--text-2); }
.done-kv b { text-align: right; word-break: break-word; }
/* ==================================================================== 错误页 */

.errwrap { padding: 64px var(--pad) 90px; }
.errcard {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 32px 34px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--sh-3);
}
@supports not (backdrop-filter: blur(4px)) {
  .errcard { background: var(--surface); }
}
.errcode {
  font-family: var(--mono);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  background: linear-gradient(160deg, var(--brand-2), var(--brand-ink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
@supports not (background-clip: text) {
  .errcode { color: var(--brand); }
}
.errcard h1 {
  margin-top: 16px;
  /* 跟 .login-title / .ld-name 一致：中小标题不用楷体（理由见 shop.css 登录标题那段） */
  font-family: var(--sans);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.errdesc { margin-top: 10px; font-size: 14px; line-height: 1.75; color: var(--text-2); }
.errdetail {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 12.5px;
  text-align: left;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  word-break: break-word;
}
.erracts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}
.errfoot { margin-top: 22px; font-size: 12px; color: var(--muted); }

@media (max-width: 620px) {
  .errwrap { padding: 40px 14px 70px; }
  .errcard { padding: 30px 20px 26px; }
  .errcode { font-size: 58px; }
  .errcard h1 { font-size: 22px; }
  .erracts .btn { flex: 1 1 auto; }
}
/* ==================================================================== 动效打磨 */

/* 锚点跳转 / 回顶部用平滑滚动（用户要求减少动效时自动关掉） */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* 所有可点元素统一手感：底色渐变 + 按下轻微回弹 */
.btn, .icobtn, .tabs-b a, .side-link, .pay-big, .pay-opt, .back {
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), box-shadow .22s var(--ease), transform .12s var(--ease);
}
.btn:active, .icobtn:active, .pay-big:active, .pay-opt:active, .side-link:active, .back:active {
  transform: scale(.975);
}

@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rowIn   { from { opacity: 0; transform: translateY(9px); }  to { opacity: 1; transform: none; } }
@keyframes dcIn    { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

/* 面板整体浮上来。
   注意这里**不能**写 .view .panel —— 客户端切视图时 .view 已经有一层 viewIn，
   每个面板再来一层就会「外面在动、里面也在动」，看起来发飘。
   客户端只留 .view-in + .cards-in 两层，工作台是整页加载，用 panelIn 正好。 */
.cbody > .panel { animation: panelIn .46s var(--ease) both; }

/* 订单行 / 工作台列表错峰入场（错峰上限收短，长列表不再越等越久） */
.rows > *, .olist > * { animation: rowIn .36s var(--ease) both; }
.rows > *:nth-child(2),  .olist > *:nth-child(2)  { animation-delay: .03s; }
.rows > *:nth-child(3),  .olist > *:nth-child(3)  { animation-delay: .06s; }
.rows > *:nth-child(4),  .olist > *:nth-child(4)  { animation-delay: .09s; }
.rows > *:nth-child(5),  .olist > *:nth-child(5)  { animation-delay: .12s; }
.rows > *:nth-child(n+6), .olist > *:nth-child(n+6) { animation-delay: .15s; }

/* 展开订单详情时内容淡入，而不是硬切 */
.oline[open] > .dc { animation: dcIn .28s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  .view .panel, .cbody > .panel, .rows > *, .olist > *, .oline[open] > .dc {
    animation: none !important;
  }
  .btn:active, .icobtn:active, .pay-big:active, .pay-opt:active, .side-link:active, .back:active {
    transform: none;
  }
}
/* ============================================================ 滚动条 */
/* scrollbar-gutter: stable —— 滚动条出现 / 消失时不再把整页挤变形 */
html { scrollbar-gutter: stable; }

* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 42%, transparent) transparent;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover  { background: color-mix(in srgb, var(--brand) 62%, transparent); background-clip: content-box; }
::-webkit-scrollbar-thumb:active { background: var(--brand); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ============================================================ 磨砂玻璃 */
/* 和顶栏 / 底部标签栏同一套配方（--surface 半透明 + backdrop-filter） */
:root {
  --glass:      color-mix(in srgb, var(--surface) 74%, transparent);
  --glass-hi:   color-mix(in srgb, var(--surface) 86%, transparent);
  --glass-lo:   color-mix(in srgb, var(--surface) 58%, transparent);
  --glass-blur:    saturate(165%) blur(18px);
  --glass-blur-sm: saturate(150%) blur(9px);   /* 列表里几十个卡片用的小半径 */
}

/* ============================================================
   手机端通用可用性（客户站与工作台都要，所以放 base.css）
   1) iOS Safari 遇到字号 <16px 的输入框会整页自动放大，且松开后不会缩回；
      表单里所有可输入控件在窄屏统一 16px。
   2) 38px 的按钮在拇指下偏小，统一抬到 44px（Apple/ WCAG 的最小触摸目标）。
   3) 去掉触屏默认的灰色点击高亮块，改由各组件自己的 :active 反馈。
   ============================================================ */
html { -webkit-tap-highlight-color: transparent; }

@media (max-width: 620px) {
  .inp, .ta, .sel, .inp-mini, .qty input,
  body .search input { font-size: 16px; }
  .btn { height: 44px; font-size: 14px; }
  .btn-xs { height: 38px; }
  .form-actions { gap: 8px; }
  .form-actions .btn { flex: 1 1 auto; }
  /* 订单号、联系方式这类长串在 320px 屏上会把整行撑出横向滚动 */
  .code, .order-code, .q-chip { overflow-wrap: anywhere; }
}

/* ------------------------------------------------------------ 密钥显隐 */

/* 后台「企业微信通知」里的 Webhook / Token / EncodingAESKey。
   默认密文：输入框上只盖一串 *******，但 value 从头到尾都是真实值 ——
   表单提交送出去的还是真值，不会把星号写进配置，也不会被误判成「没填」。
   密文态由 CSS 本身保证（JS 没加载也不会露出明文），JS 只管切换和 readonly。 */
.secret-field {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.secret-field .inp {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding-right: 12px;
}
.secret-field .secret-toggle {
  flex: 0 0 auto;
  align-self: stretch;
  height: auto;
  padding: 0 14px;
  white-space: nowrap;
}
.secret-field .secret-cover {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
/* 只有「有值 + 密文态」才藏文字和光标；空值态保持可输入、显示 placeholder */
.secret-field:not(.is-plain):not(.is-empty) .inp {
  color: transparent;
  caret-color: transparent;
}
.secret-field.is-plain .secret-cover,
.secret-field.is-empty .secret-cover { display: none; }
/* 密文态（含 readonly）也要给焦点反馈，别让人以为输入框坏了 */
.secret-field:not(.is-plain):not(.is-empty) .inp:focus {
  border-color: var(--brand-line);
}
@media (max-width: 620px) {
  .secret-field .inp,
  .secret-field .secret-toggle { min-height: 44px; }
  .secret-field .secret-cover { left: 12px; }
}