/* 巅峰网咖交班系统 —— 「夜幕灯牌 + 吧台账本」
   顶部是深靛蓝的门店灯牌（唯一的重装饰），下面是安静、精确的账本。
   暗色不是简单反色：夜班在昏暗吧台看屏幕，降低大面积亮度、提高数字对比 */
:root, [data-theme="light"] {
  --bg: #F4F6FB;            /* 瓷白 */
  --surface: #FFFFFF;
  --surface-2: #F1F4FA;
  --ink: #121833;           /* 墨 */
  --muted: #69728F;
  --line: #E1E6F0;
  --line-2: #CFD6E4;
  --brand: #4361EE;         /* 电光蓝：操作与链接 */
  --brand-2: #3149C9;
  --brand-ink: #FFFFFF;
  --brand-soft: #E8ECFD;
  --night: #141B4D;         /* 夜幕靛：灯牌 */
  --night-2: #22166A;
  --gold: #C8902E;          /* 香槟金：品牌标、关键金额 */
  --gold-soft: #FBF1DD;
  --ok: #0F9468;  --ok-bg: #E3F6EE;
  --warn: #B56F05; --warn-bg: #FFF3DC;
  --bad: #D03A40; --bad-bg: #FDEBEC;
  --shadow: 0 1px 2px rgba(20, 27, 77, .05), 0 8px 24px -8px rgba(20, 27, 77, .12);
  --shadow-lg: 0 2px 4px rgba(20, 27, 77, .06), 0 18px 40px -12px rgba(20, 27, 77, .22);
  --r-lg: 18px; --r-md: 12px; --r-sm: 9px;
  --num: "DIN Alternate", "Bahnschrift", "D-DIN", "Roboto Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0A0F24;
  --surface: #121A36;
  --surface-2: #18224A;
  --ink: #E8ECFA;
  --muted: #98A3C7;
  --line: #243061;
  --line-2: #33407A;
  --brand: #7B8CFF;
  --brand-2: #9AA7FF;
  --brand-ink: #0A0F24;
  --brand-soft: #1F2A5E;
  --night: #0E1438;
  --night-2: #1A1152;
  --gold: #E8B75A;
  --gold-soft: #2F2715;
  --ok: #3FD19A;  --ok-bg: #0F2E27;
  --warn: #F2B452; --warn-bg: #2E2413;
  --bad: #FF7A7E; --bad-bg: #36171E;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 28px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 44px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  transition: background-color .2s;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 1.45rem; line-height: 1.3; margin: 0 0 .25rem; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 1.04rem; margin: 0 0 .85rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h2 small { font-weight: 400; }
h3 { font-size: .95rem; margin: 0 0 .5rem; font-weight: 650; }
p { margin: .4rem 0; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.r { text-align: right; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.mono-break { word-break: break-all; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* 区块标题前的图标徽章：h2 里放 <span class="hb ic-xxx"></span> 或用 icon() */
.hb { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); flex: none; }
.hb::before { content: ""; width: 17px; height: 17px; background: currentColor; -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; }
.hb.gold { background: var(--gold-soft); color: var(--gold); }
.hb.ok { background: var(--ok-bg); color: var(--ok); }
.hb.warn { background: var(--warn-bg); color: var(--warn); }
.hb.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- 顶栏：夜幕灯牌 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  color: #EEF1FF;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(0deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    radial-gradient(120% 180% at 100% 0%, rgba(123, 140, 255, .35), transparent 55%),
    linear-gradient(100deg, var(--night) 0%, var(--night-2) 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 6px 20px -10px rgba(10, 12, 50, .6);
}
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; font-weight: 750; min-width: 0; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #F4D38A, #C8902E); box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 4px 14px -4px rgba(232, 183, 90, .7); }
.brand-mark svg { width: 20px; height: 20px; fill: #1A1452; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: none; gap: .15rem; }
.topnav a { display: inline-flex; align-items: center; gap: .35rem; color: rgba(236, 240, 255, .72); padding: .4rem .7rem; border-radius: 10px; font-size: .93rem; }
.topnav a .ic { width: 1.05em; height: 1.05em; opacity: .85; }
.topnav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.topnav a[aria-current] { color: #fff; background: rgba(255,255,255,.14); font-weight: 650; box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.theme-btn { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.theme-btn:hover { background: rgba(255,255,255,.16); }
.theme-btn svg { width: 18px; height: 18px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; font-weight: 650; color: #fff; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: .95rem;
  background: linear-gradient(145deg, #8FA0FF, #5A45D6); color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.22); flex: none; }
.usermenu .who { display: none; flex-direction: column; line-height: 1.2; }
.usermenu .who small { color: rgba(236,240,255,.65); font-weight: 400; font-size: .74rem; }
@media (min-width: 560px) { .usermenu .who { display: flex; } }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 10px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 190px; padding: .4rem; }
.usermenu .menu a, .usermenu .menu button { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: 9px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .menu a .ic, .usermenu .menu button .ic { color: var(--muted); }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--surface-2); text-decoration: none; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  padding: .25rem .3rem calc(.25rem + env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: .35rem 0 .3rem; color: var(--muted); font-size: .72rem; border-radius: 12px; }
.tabbar a:hover { text-decoration: none; }
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current] { color: var(--brand); font-weight: 650; }
.tabbar a[aria-current] svg { background: var(--brand-soft); border-radius: 10px; padding: 3px 12px; width: 48px; height: 29px; }

@media (min-width: 820px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body { padding-bottom: 2.5rem; }
}

/* ---------- 布局 ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 1.1rem 1rem; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: .35rem 0 1.1rem; }
.pagehead h1 { margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pagehead h1 .muted { font-weight: 500; font-size: .95rem; }
.ph-ico { width: 40px; height: 40px; padding: 9px; border-radius: 12px; flex: none; color: #fff;
  background: linear-gradient(145deg, var(--brand), #7A56E8); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.15rem 1.2rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel .pad { padding: 1.1rem 1.2rem 0; }
.panel.narrow, .narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.cols { display: grid; gap: 1rem 2rem; }
@media (min-width: 720px) { .cols { grid-template-columns: 1fr 1fr; } }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.stack { display: grid; gap: .6rem; }
.count { display: inline-block; min-width: 1.6em; padding: 0 .45em; border-radius: 99px; background: var(--bad); color: #fff; font-size: .75rem; line-height: 1.55; text-align: center; font-family: var(--num); }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1.05rem; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; min-height: 40px;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.btn.primary { background: linear-gradient(180deg, var(--brand), var(--brand-2)); color: var(--brand-ink); border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 16px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn.primary:hover { color: var(--brand-ink); filter: brightness(1.06); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: transparent; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.big { width: 100%; min-height: 50px; font-size: 1.05rem; border-radius: 12px; }
.btn:disabled { opacity: .6; cursor: wait; }
.form { display: grid; gap: .95rem; }
.form h2 { margin: .7rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); }
.form h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
label { display: grid; gap: .32rem; font-weight: 600; font-size: .92rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; min-height: 43px; width: 100%;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
input[type=file] { padding: .45rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); box-shadow: none; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .45rem; }
legend { font-weight: 650; font-size: .92rem; margin-bottom: .35rem; }
.file small { font-weight: 400; }
.preview { max-width: 100%; max-height: 260px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: var(--surface-2); }
.inline-form { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.inline-form input { flex: 1 1 180px; }

.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chips legend { width: 100%; }
.chip { display: block; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 92px; min-height: 62px; padding: .45rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2); font-size: 1.08rem; font-weight: 750; cursor: pointer; transition: border-color .15s, background-color .15s; }
.chip span:hover { border-color: var(--line-2); }
.chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip.disabled span { opacity: .5; cursor: not-allowed; }
.chip small { font-size: .7rem; margin-top: .15rem; }

/* ---------- 提示 ---------- */
.flash { display: block; padding: .75rem 1rem .75rem 2.6rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid transparent; background: var(--ok-bg); color: var(--ok); position: relative; }
.flash::before { content: ""; position: absolute; left: .9rem; top: .95rem; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.8'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.8'/%3E%3C/svg%3E") center/contain no-repeat; }
.flash.err, .flash.warn { --alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9.5 17h-19zM12 10v4m0 3h.01'/%3E%3C/svg%3E"); }
.flash.err::before, .flash.warn::before { -webkit-mask-image: var(--alert); mask-image: var(--alert); }
.flash.err { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 20%, transparent); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.flash ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.flash a { color: inherit; text-decoration: underline; font-weight: 700; }
.note { padding: .6rem .85rem; border-left: 3px solid var(--line-2); border-radius: 0 10px 10px 0; margin: .75rem 0; background: var(--surface-2); }
.note.ok { border-color: var(--ok); background: var(--ok-bg); }
.note.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 650; padding: .08rem .55rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid var(--line); }
.tag.t-pending { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag.t-approved { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag.t-rejected { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.tag.t-pending::before, .tag.t-approved::before, .tag.t-rejected::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 印章：模拟店长盖章确认 ---------- */
.stamp {
  --c: var(--warn);
  display: inline-block; color: var(--c); border: 2px solid var(--c); outline: 1px solid var(--c); outline-offset: 2px;
  border-radius: 6px; padding: .05rem .45rem; font-weight: 800; font-size: .78rem; letter-spacing: .12em;
  transform: rotate(-9deg); opacity: .9; white-space: nowrap;
}
.s-approved .stamp { --c: var(--ok); }
.s-rejected .stamp { --c: var(--bad); }
.s-other .stamp { --c: var(--muted); }
.stamp.big { font-size: 1.25rem; padding: .25rem .8rem; outline-offset: 3px; transform: rotate(-11deg); }

/* ---------- 首页主视觉：灯牌延伸 + 班次灯位 ---------- */
.hero {
  position: relative; overflow: hidden; color: #EEF1FF; border-radius: 22px; padding: 1.3rem 1.3rem 1.2rem; margin: .2rem 0 1.2rem;
  background:
    radial-gradient(90% 140% at 105% -10%, rgba(123, 140, 255, .45), transparent 60%),
    radial-gradient(60% 90% at -10% 120%, rgba(232, 183, 90, .22), transparent 60%),
    linear-gradient(115deg, var(--night) 0%, var(--night-2) 100%);
  box-shadow: var(--shadow-lg);
}
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 26px 26px, linear-gradient(0deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 26px 26px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 60%); mask: linear-gradient(90deg, transparent, #000 60%); }
.hero > * { position: relative; }
.hero-art { position: absolute; right: -10px; bottom: -6px; width: 330px; max-width: 58%; opacity: .9; pointer-events: none; }
.hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.hero h1 { font-size: clamp(1.35rem, 4.6vw, 1.9rem); color: #fff; margin: 0; }
.hero .sub { color: rgba(236, 240, 255, .72); margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .92rem; }
.hero .sub .ic { opacity: .8; margin-right: .2rem; }
.hero .btn.primary { background: linear-gradient(180deg, #F4D38A, #D9A441); color: #1A1452; box-shadow: 0 8px 20px -8px rgba(232, 183, 90, .75); }
.hero .btn.primary:hover { color: #1A1452; }
.lights { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin-top: 1.15rem; max-width: 720px; }
.light {
  --c: rgba(255,255,255,.28);
  position: relative; display: grid; gap: .1rem; padding: .8rem .85rem .75rem; min-height: 112px; color: #EEF1FF;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.light::before { content: ""; position: absolute; left: .85rem; right: .85rem; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); box-shadow: 0 0 14px 1px var(--c); }
a.light:hover { text-decoration: none; background: rgba(255,255,255,.12); }
.light.s-approved { --c: #3FD19A; }
.light.s-pending { --c: #F2B452; }
.light.s-rejected { --c: #FF7A7E; }
.light.s-none { border-style: dashed; background: transparent; }
.light .l-shift { font-size: 1.3rem; font-weight: 800; display: flex; align-items: center; justify-content: space-between; }
.light .l-state { font-size: .72rem; font-weight: 650; padding: .05rem .5rem; border-radius: 99px; background: rgba(255,255,255,.12); color: var(--c); }
.light.s-none .l-state { color: rgba(236,240,255,.6); }
.light .l-who { color: rgba(236,240,255,.72); font-size: .85rem; }
.light .l-money { font-size: 1.15rem; font-weight: 700; margin-top: auto; }
.light .l-money small { font-size: .72rem; font-weight: 400; color: rgba(236,240,255,.6); margin-right: .25rem; font-family: inherit; }
.light .l-diff { font-size: .78rem; color: rgba(236,240,255,.62); }
.light .l-diff.bad { color: #FF9EA1; }
.light .l-cta { margin-top: auto; color: #F4D38A; font-weight: 700; display: flex; align-items: center; gap: .3rem; }

/* 快捷入口 */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin-bottom: 1.1rem; }
.quick a { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font-weight: 650; box-shadow: var(--shadow); }
.quick a:hover { text-decoration: none; border-color: var(--brand); }
.quick .qi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.quick .qi svg { width: 20px; height: 20px; }
.quick .qi.gold { background: var(--gold-soft); color: var(--gold); }
.quick .qi.ok { background: var(--ok-bg); color: var(--ok); }
.quick .qi.warn { background: var(--warn-bg); color: var(--warn); }
.quick small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }

/* 旧版小票（其他页面仍在用） */
.stubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.stub { position: relative; display: grid; gap: .1rem; padding: .75rem .8rem 1rem; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; min-height: 118px; }
a.stub:hover { text-decoration: none; border-color: var(--brand); }
.stub-shift { font-size: 1.3rem; font-weight: 800; }
.stub-who { color: var(--muted); font-size: .85rem; }
.stub .stamp { position: absolute; right: .6rem; top: .7rem; }
.s-none { border-style: dashed; }

/* ---------- 列表 ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.rows li:first-child { border-top: 0; }
.rows li > a, .rows li > span:first-child { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .65rem .1rem; color: var(--ink); }
.rows li > a { flex: 1; border-radius: 8px; }
.rows li > a:hover { text-decoration: none; color: var(--brand); }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
.grid th { text-align: left; font-weight: 650; color: var(--muted); font-size: .78rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; letter-spacing: .02em; }
.grid td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td.num, .grid td .num { font-size: .95rem; }
.grid th.r { text-align: right; }
.grid tbody tr { cursor: pointer; transition: background-color .12s; }
.grid tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); }
.grid tr:last-child td { border-bottom: 0; }
.grid tfoot td { background: var(--surface-2); font-weight: 650; }
.grid.compact td, .grid.compact th { padding: .4rem .65rem; }
.pager { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: 1rem 0; }
.pager a { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.pager a[aria-current] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters select, .filters input { width: auto; min-width: 0; flex: 1 1 130px; }
.filters .btn { flex: none; }
.filters .check { flex: none; }
.seg { display: flex; flex-wrap: wrap; gap: .3rem; width: 100%; }
.seg label { font-weight: 500; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .38rem .85rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .88rem; }
.seg span:hover { border-color: var(--line-2); }
.seg input:checked + span { background: var(--night); color: #fff; border-color: var(--night); }
[data-theme="dark"] .seg input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.custom-range { display: flex; align-items: center; gap: .4rem; flex: 1 1 280px; }
.custom-range input { flex: 1; }

/* ---------- 金额 ---------- */
.kv { display: grid; grid-template-columns: 1fr auto; gap: .28rem 1rem; margin: 0 0 .8rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; }
.kv dd.sub { color: var(--muted); border-bottom: 1px dashed var(--line); }
.kv dd.strong { font-weight: 800; font-size: 1.08rem; }
.kv.grid4 { grid-template-columns: repeat(2, 1fr auto); column-gap: 1.2rem; }
@media (min-width: 720px) { .kv.grid4 { grid-template-columns: repeat(4, 1fr auto); } }
.ledger { display: grid; gap: 1rem 2rem; }
@media (min-width: 640px) { .ledger { grid-template-columns: 1fr 1fr; } }
.bigfigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; margin: .4rem 0 1rem; }
.bigfigs > div { display: grid; gap: .1rem; padding: .8rem .95rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.bigfigs > div::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); opacity: .75; }
.bigfigs > div:nth-child(2)::after { background: #7A56E8; }
.bigfigs > div:nth-child(3)::after { background: var(--gold); }
.bigfigs > div.ok::after { background: var(--ok); }
.bigfigs > div.bad::after { background: var(--bad); }
.bigfigs span { color: var(--muted); font-size: .8rem; }
.bigfigs b { font-family: var(--num); font-size: clamp(1.25rem, 4.2vw, 1.95rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .005em; line-height: 1.2; }
.bigfigs .bad b { color: var(--bad); }
.bigfigs .ok b { color: var(--ok); }
.chartbox { position: relative; height: 250px; margin-top: .5rem; }

/* ---------- 交班详情：小票 ---------- */
.receipt { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 8px 8px; padding: 1.2rem 1.2rem 1.7rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.receipt::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: linear-gradient(90deg, var(--night), var(--brand), var(--gold)); }
.receipt::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 8px;
  background: radial-gradient(circle at 6px 8px, var(--bg) 4.5px, transparent 5px) 0 0 / 12px 8px repeat-x;
}
.receipt > section { margin-top: 1.3rem; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: .9rem; border-bottom: 2px dashed var(--line); }
.receipt-head .stamp { margin-top: .6rem; flex: none; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .9rem 0; border-bottom: 2px dashed var(--line); margin-top: .5rem !important; }
.total-line { display: grid; }
.total-line span { font-size: .82rem; color: var(--muted); }
.total-line b { font-family: var(--num); font-size: clamp(1.15rem, 4.4vw, 1.8rem); font-weight: 700; }
.total-line.diff.bad b { color: var(--bad); }
.total-line.diff.ok b { color: var(--ok); }
.photo img { display: block; max-width: 100%; max-height: 520px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.actions { border-top: 2px dashed var(--line); padding-top: 1rem; }
details > summary { cursor: pointer; color: var(--muted); margin: .8rem 0 .4rem; }

/* ---------- 登录：左侧夜景插画，右侧登录卡 ---------- */
.login { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.login-shell { width: 100%; max-width: 920px; display: grid; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: var(--surface); }
@media (min-width: 820px) { .login-shell { grid-template-columns: 1.05fr 1fr; } }
.login-art { position: relative; color: #EEF1FF; padding: 1.6rem 1.6rem 0; display: flex; flex-direction: column; min-height: 220px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(123, 140, 255, .45), transparent 60%), radial-gradient(70% 80% at 0% 100%, rgba(232, 183, 90, .25), transparent 60%), linear-gradient(135deg, var(--night), var(--night-2)); }
.login-art .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.login-art .brand-mark svg { width: 26px; height: 26px; }
.login-art h2 { color: #fff; font-size: 1.35rem; margin: .9rem 0 .2rem; }
.login-art p { color: rgba(236,240,255,.72); margin: 0; font-size: .92rem; max-width: 30em; }
.login-art svg.scene { width: 100%; height: auto; margin-top: auto; display: block; }
@media (max-width: 819px) { .login-art { min-height: 0; } .login-art svg.scene { max-height: 150px; } }
.login-card { padding: 1.6rem 1.5rem 1.4rem; text-align: center; }
.login-card h1 { font-size: 1.35rem; }
.qrbox { margin: 1.1rem auto; }
.qr { width: 220px; height: 220px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 10px; display: grid; place-items: center; border: 1px solid var(--line); box-shadow: 0 10px 30px -14px rgba(20, 27, 77, .35); }
.qr svg { width: 100%; height: 100%; }
.qrbox.expired .qr, .qrbox.scanned .qr { opacity: .25; }
.qr-tip { color: var(--muted); font-size: .9rem; }
.pwlogin { text-align: left; border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .2rem; }
.bindcode { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: .5rem 0 1rem; }
.bindcode .qr { width: 180px; height: 180px; margin: 0; }
.bindcode > div:last-child { flex: 1 1 240px; }
code { background: var(--surface-2); padding: .05rem .4rem; border-radius: 6px; font-size: .85em; word-break: break-all; border: 1px solid var(--line); }

.row-form { grid-template-columns: 1fr; }
@media (min-width: 820px) {
  .row-form { grid-template-columns: 1.2fr 2fr 1.3fr 1.6fr .7fr .9fr auto; align-items: end; }
  .row-form h2 { grid-column: 1 / -1; }
}

/* ---------- 费用报销 / 财务 ---------- */
.btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.btn.small { padding: .25rem .6rem; min-height: 0; font-size: .85rem; }
.prewrap { white-space: pre-wrap; word-break: break-word; margin: 0; }
.kv dd.strong { font-weight: 800; border-top: 1px solid var(--line); }
form.inline { display: inline; }
.actions .btn + form.inline { margin-left: .4rem; }
.row3 { display: grid; gap: .6rem; }
@media (min-width: 640px) { .row3 { grid-template-columns: 1fr 1fr 2fr; } }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.thumb { position: relative; display: flex; flex-direction: column; gap: .25rem; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.thumb.dup img { outline: 3px solid var(--bad); outline-offset: -3px; }
.thumb .tag { position: absolute; left: .3rem; top: .3rem; }
.itemtable select, .itemtable input { width: 100%; min-width: 0; }
.itemtable td { vertical-align: top; }
.itemtable [data-del-row] { font-size: 1.1rem; line-height: 1; }
@media (max-width: 640px) {
  /* 手机上把每行明细变成一张小卡片 */
  .itemtable thead { display: none; }
  .itemtable, .itemtable tbody, .itemtable tr, .itemtable td { display: block; }
  .itemtable tbody tr { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .6rem .2rem; margin-bottom: .6rem; background: var(--surface-2); }
  .itemtable td { border: 0; padding: .2rem 0; }
  .itemtable td[data-l]::before { content: attr(data-l); display: block; font-size: .75rem; color: var(--muted); }
  .itemtable td:last-child { position: absolute; right: .3rem; top: .3rem; padding: 0; }
  .itemtable tfoot tr { display: flex; justify-content: space-between; align-items: center; }
}
.timeline li { font-size: .9rem; }
@media print {
  .topbar, .tabbar, .noprint, .pagehead .btns, details > summary { display: none !important; }
  details { display: block; }
  details > * { display: block; }
  body, .panel, .receipt { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .panel { border-color: #999; break-inside: avoid; }
}
@media (min-width: 820px) { .usermenu .menu-overflow { display: none; } }
.row2 { display: grid; gap: .6rem; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; } }
.print-head { display: none; }
@media print { .print-head { display: block; text-align: center; margin-bottom: .5rem; } }

/* ---------- 门店不存在 ---------- */
.missing { max-width: 520px; margin: 2rem auto; text-align: center; }
.missing h1 { margin: .5rem 0; }
.missing-art { width: 100%; max-width: 360px; height: auto; }
.m-shadow { fill: var(--line); opacity: .6; }
.m-wall { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.m-roof { fill: var(--brand); }
.m-awning { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; }
.m-sign { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; }
.m-signtext { fill: var(--muted); font: 700 11px system-ui, sans-serif; letter-spacing: .12em; }
.m-door { fill: var(--surface-2); stroke: var(--muted); stroke-width: 2; }
.m-slats line { stroke: var(--line); stroke-width: 2; }
.m-string { stroke: var(--muted); stroke-width: 1.5; }
.m-tag { fill: var(--warn-bg); stroke: var(--warn); stroke-width: 2; }
.m-tagtext { fill: var(--warn); font: 800 12px system-ui, sans-serif; }
.m-glass circle { fill: var(--surface); fill-opacity: .85; stroke: var(--bad); stroke-width: 5; }
.m-glass line { stroke: var(--bad); stroke-width: 7; stroke-linecap: round; }
.m-glass text { fill: var(--bad); font: 800 22px system-ui, sans-serif; }

/* ---------- 门店切换 ---------- */
.storechip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .2rem .7rem; border-radius: 99px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #F4D38A; white-space: nowrap; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.storechip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #F4D38A; box-shadow: 0 0 8px #F4D38A; flex: none; }
.usermenu .menu .menu-sub { font-size: .75rem; color: var(--muted); padding: .4rem .7rem .1rem; }
.usermenu .menu a.on { color: var(--brand); font-weight: 700; }
.login-store { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 700; color: var(--gold); background: var(--gold-soft); padding: .15rem .7rem; border-radius: 99px; margin: 0 0 .5rem; }
.storepick { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; }
.storepick .share { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; font-size: .9rem; }
.storepick .share input { width: 5.5rem; }
.wxbox { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 10px; padding: .5rem .8rem; }
.wxbox summary { cursor: pointer; }
.wxbox[open] summary { margin-bottom: .5rem; }
.sharetbl td.pct { color: var(--muted); }
[hidden] { display: none !important; }
.w4 { width: 4.5rem; } .w6 { width: 6.5rem; }
input.warnin { border-color: var(--warn); background: var(--warn-bg); }
.prodform { grid-template-columns: 1fr; }
@media (min-width: 820px) { .prodform { grid-template-columns: 2fr 1fr .8fr 1fr 1fr auto; align-items: end; } }
.stktbl input { min-width: 0; }
tr.muted td { color: var(--muted); }
.mpcode { width: 180px; height: 180px; border-radius: 8px; background: #fff; } .center { text-align: center; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .9rem; padding: .25rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs a { padding: .38rem .95rem; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.stub-money { font-size: .85rem; }
.stub-diff { font-size: .8rem; color: var(--muted); }
.stub-cta { margin-top: auto; color: var(--brand); font-weight: 700; }
.theme-btn .i-sun { display: none; }
[data-theme="dark"] .theme-btn .i-sun { display: block; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }
.login-card .flash { text-align: left; }
.login-art svg.scene { margin: auto -1.6rem 0; width: calc(100% + 3.2rem); max-width: none; }
@media (max-width: 560px) {
  .brand > span:last-child { display: none; }
  .hero { padding: 1.1rem 1rem 1rem; border-radius: 18px; }
  .hero-art { display: none; }
  .lights { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .light { padding: .7rem .6rem .6rem; min-height: 104px; border-radius: 13px; }
  .light::before { left: .6rem; right: .6rem; }
  .light .l-shift { flex-direction: column; align-items: flex-start; gap: .2rem; font-size: 1.12rem; }
  .light .l-money { font-size: 1rem; }
  .quick { grid-template-columns: 1fr 1fr; }
}
.msgbox { padding: 2rem 1.4rem 1.6rem; }
.msg-ico { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; margin-bottom: .6rem; color: #fff;
  background: linear-gradient(145deg, var(--brand), #7A56E8); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--brand) 80%, transparent); }
.msg-ico svg { width: 30px; height: 30px; }
.topnav a, .usermenu .who { white-space: nowrap; }
.topnav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
@media (min-width: 820px) and (max-width: 1240px) {
  .topbar { gap: .6rem; }
  .brand > span:last-child { display: none; }
  .topnav a { padding: .4rem .5rem; font-size: .9rem; }
}
@media (min-width: 820px) and (max-width: 1000px) {
  .topnav a .ic { display: none; }
  .usermenu .who { display: none; }
}
/* 隐藏的单选框不能撑宽页面 */
.chip, .seg label { position: relative; }
.chip input, .seg input { width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; left: 0; top: 0; }
.login-shell.single { max-width: 460px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .login-shell.single { grid-template-columns: 1fr; } }
.hqform { text-align: left; margin-top: 1rem; }
.brand-mark.has-logo { background: transparent; padding: 0; box-shadow: none; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; display: block; }
.brand-mark.has-logo.big img { border-radius: 14px; }
.logopick .logo-prev { background: transparent; border-style: dashed; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto .6rem; }
.brand-mark.big svg { width: 32px; height: 32px; }
.logopick { display: flex; align-items: flex-start; gap: .9rem; font-weight: 400; }
.logopick .logo-prev { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; flex: none; }
.logopick .logo-prev img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.logopick > span:last-child { flex: 1; display: grid; gap: .35rem; }
.delta { font-family: var(--num); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.delta.up-good { color: var(--ok); }
.delta.up-bad { color: var(--bad); }
.delta.flat { color: var(--muted); }
.alerts .rows li { padding: .15rem 0; }
.warn-t { color: var(--warn); }
.bigfigs > div .small { color: var(--muted); font-size: .76rem; }
.signbox { background: var(--warn-bg); border: 1px dashed var(--warn); color: var(--warn); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .8rem; }
.signbox strong { color: inherit; }
