:root {
  color-scheme: light;
  --c-primary: oklch(0.51 0.25 278);
  --c-primary-hover: oklch(0.45 0.23 278);
  --c-primary-soft: oklch(0.95 0.04 278);
  --c-sidebar: oklch(0.22 0.03 260);
  --c-bg: oklch(0.975 0.008 255);
  --c-surface: oklch(1 0 0);
  --c-ok: oklch(0.56 0.16 158);
  --c-ok-soft: oklch(0.95 0.04 158);
  --c-warn: oklch(0.68 0.16 68);
  --c-warn-soft: oklch(0.96 0.05 88);
  --c-danger: oklch(0.58 0.22 17);
  --c-danger-soft: oklch(0.96 0.04 20);
  --c-info: oklch(0.55 0.17 250);
  --c-info-soft: oklch(0.95 0.035 250);
  --c-ink: oklch(0.27 0.025 260);
  --c-sub: oklch(0.52 0.025 260);
  --c-muted: oklch(0.68 0.018 260);
  --c-line: oklch(0.91 0.012 260);
  --c-line-strong: oklch(0.85 0.018 260);
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 260 / 0.05);
  --shadow-md: 0 8px 24px oklch(0.2 0.02 260 / 0.07);
  --focus: 0 0 0 3px oklch(0.51 0.25 278 / 0.22);
}
* { box-sizing: border-box; margin: 0; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
       color: var(--c-ink); background: var(--c-bg); font-size: 14px; line-height: 1.5; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.ui-icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.icon-wrap { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px;
             background: var(--c-primary-soft); color: var(--c-primary); }
.btn .ui-icon { width: 16px; height: 16px; }
h3 > [data-icon], .admin-top [data-icon], .head [data-icon] { display: inline-flex; align-items: center; }
.report-mark, .result-mark { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 12px;
                              display: grid; place-items: center; color: var(--c-primary); background: var(--c-primary-soft); }
.report-mark.success { color: var(--c-ok); background: var(--c-ok-soft); }
.section-index { display: inline-grid; place-items: center; min-width: 23px; height: 22px; padding: 0 5px;
                 border-radius: 6px; background: var(--c-primary-soft); color: var(--c-primary);
                 font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fund-labels { font-size: 11px; color: oklch(0.7 0.025 245); margin-bottom: 6px; }
.fund-labels b { color: oklch(0.79 0.14 83); }
.fund-help { font-size: 11px; color: oklch(0.62 0.025 245); margin-top: 8px; }
.fund-state { font-size: 12px; margin-top: 6px; }
.screen-empty { color: oklch(0.62 0.025 245); font-size: 11px; padding: 12px 0; }
.batch-card { width: 100%; display: block; text-align: left; color: var(--c-ink); cursor: pointer; }
.batch-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow-md); }
.batch-card:focus-visible { box-shadow: var(--focus); }
.emp-choice { display:flex; gap:8px; align-items:center; padding:8px 0; border-bottom:1px solid var(--c-line); }
.quota-progress { background:var(--c-line); }
.quota-progress i { background:var(--c-primary); }
.notice.success { background:var(--c-ok-soft); border-color:oklch(0.88 0.06 158); color:oklch(0.39 0.12 158); }
.print-note { color:gray; }

/* 通用控件 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px;
       padding: 8px 14px; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px;
       cursor: pointer; background: var(--c-primary); color: white; font-weight: 600; transition: .16s ease; }
.btn:hover { background: var(--c-primary-hover); color: white; box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line-strong); }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-ink); border-color: var(--c-muted); }
.btn-danger { background: var(--c-danger); }
.btn-danger:hover { background: oklch(0.49 0.20 17); }
.btn-ok { background: var(--c-ok); }
.btn-ok:hover { background: oklch(0.48 0.15 158); }
.btn-warn { background: var(--c-warn); color: var(--c-ink); }
.btn-sm { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.btn-lg { min-height: 46px; padding: 11px 16px; font-size: 14px; width: 100%; }
.btn-block { width: 100%; }

.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
        box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 12px; }
.card h3 { font-size: 14px; font-weight: 650; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--c-sub); font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
         font-size: 11px; font-weight: 650; white-space: nowrap; }
.b-ok { background: var(--c-ok-soft); color: oklch(0.39 0.12 158); }
.b-warn { background: var(--c-warn-soft); color: oklch(0.42 0.12 65); }
.b-danger { background: var(--c-danger-soft); color: oklch(0.43 0.17 18); }
.b-info { background: var(--c-info-soft); color: oklch(0.4 0.14 250); }
.b-gray { background: oklch(0.95 0.008 260); color: var(--c-sub); }
.b-dark { background: var(--c-sidebar); color: white; }

.field { margin-bottom: 12px; min-width: 0; }
.field label { display: block; font-size: 12px; color: var(--c-sub); margin-bottom: 5px; font-weight: 550; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid var(--c-line-strong);
  border-radius: 8px; font-size: 13px; color: var(--c-ink); background: var(--c-surface); transition: .15s; }
.field input::placeholder, .field textarea::placeholder { color: var(--c-muted); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--focus); }
.field .req::after { content: " *"; color: var(--c-danger); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--c-surface); }
.tbl th { text-align: left; padding: 10px 12px; color: var(--c-sub); font-weight: 600; background: var(--c-bg);
          border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: oklch(0.985 0.008 255); }

/* 提示、Toast 与统一二次确认 */
.notice { background: var(--c-warn-soft); border: 1px solid oklch(0.89 0.08 88); border-radius: 8px;
          padding: 10px 12px; font-size: 12px; color: oklch(0.42 0.12 65); margin-bottom: 12px; line-height: 1.65; }
.notice.info { background: var(--c-info-soft); border-color: oklch(0.88 0.05 250); color: oklch(0.4 0.14 250); }
.notice.danger { background: var(--c-danger-soft); border-color: oklch(0.88 0.06 20); color: oklch(0.43 0.17 18); }
#toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999;
             display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: 92vw; }
.toast { padding: 10px 15px; border-radius: 9px; color: white; font-size: 13px; box-shadow: var(--shadow-md); animation: slidein .2s ease; }
.toast.ok { background: oklch(0.39 0.08 158); } .toast.err { background: oklch(0.43 0.15 18); }
.toast.info { background: var(--c-sidebar); }
@keyframes slidein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }
#dlg-mask, #dlg-mask-input { position: fixed; inset: 0; background: oklch(0.18 0.03 260 / .48); z-index: 9998;
            display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
#dlg-mask.show, #dlg-mask-input.show { display: flex; }
#dlg-mask-input { z-index: 9999; }
#dlg { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 14px; padding: 20px;
       width: 100%; max-width: 400px; box-shadow: 0 20px 50px oklch(0.15 0.02 260 / .22); }
#dlg h4 { font-size: 15px; margin-bottom: 8px; }
#dlg .dlg-body { font-size: 13px; color: var(--c-ink); line-height: 1.7; margin-bottom: 16px; }
#dlg .dlg-btns { display: flex; gap: 10px; }
#dlg .dlg-btns .btn { flex: 1; }

/* C端 H5 */
.phone { max-width: 430px; margin: 0 auto; min-height: 100vh; background: var(--c-bg);
         display: flex; flex-direction: column; box-shadow: 0 0 36px oklch(0.2 0.02 260 / .08); }
.phone-head { position: sticky; top: 0; z-index: 10; height: 56px; flex: 0 0 56px;
              background: oklch(1 0 0 / .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--c-line);
              display: flex; align-items: center; padding: 0 14px; gap: 10px; }
.phone-head .title { font-size: 15px; font-weight: 650; }
.phone-head .back { display: inline-grid; place-items: center; width: 34px; height: 34px; color: var(--c-sub);
                    cursor: pointer; border: 0; border-radius: 8px; background: transparent; }
.phone-head .back:hover { background: var(--c-bg); color: var(--c-ink); }
.phone-body { flex: 1; padding: 14px; padding-bottom: 22px; background: linear-gradient(180deg,var(--c-primary-soft),var(--c-bg) 150px); }
.phone-nav { position: sticky; bottom: 0; z-index: 10; display: flex; border-top: 1px solid var(--c-line);
             background: oklch(1 0 0 / .96); backdrop-filter: blur(10px); padding-bottom: env(safe-area-inset-bottom); }
.phone-nav a { flex: 1; text-align: center; padding: 8px 2px 6px; font-size: 10px; color: var(--c-sub); transition: color .15s; }
.phone-nav a .ui-icon { display: block; margin: 0 auto 3px; }
.phone-nav a.on { color: var(--c-primary); font-weight: 650; }
.phone .page { animation: pagein .18s ease; }
@keyframes pagein { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.qr-card { background: linear-gradient(145deg,var(--c-primary),oklch(0.57 0.22 300)); border-radius: 16px;
           padding: 20px; color: white; text-align: center; box-shadow: 0 12px 26px oklch(0.43 0.19 278 / .2); }
.qr-card canvas { background: white; padding: 10px; border-radius: 10px; }
.qr-card .cno { letter-spacing: 2px; font-weight: 650; margin-top: 8px; }
.mock-map { position: relative; height: 220px; border-radius: 10px; background: oklch(0.95 0.015 245);
            overflow: hidden; border: 1px solid var(--c-line); }
.mock-map .grid { position: absolute; inset: 0;
  background-image: linear-gradient(oklch(0.89 0.02 245) 1px, transparent 1px),
                    linear-gradient(90deg,oklch(0.89 0.02 245) 1px, transparent 1px); background-size: 28px 28px; }
.mock-map .road { position: absolute; background: oklch(0.88 0.025 245); }
.mock-map .pin { position: absolute; transform: translate(-50%,-100%); color: var(--c-danger); cursor: grab;
                 filter: drop-shadow(0 2px 3px oklch(0.2 0.02 260 / .28)); }
.mock-map .pin:active { cursor: grabbing; }

/* B端管理工作台 */
.admin { display: flex; min-height: 100vh; background: var(--c-bg); }
.admin-side { width: 224px; background: var(--c-sidebar); color: oklch(0.87 0.015 260); flex-shrink: 0;
              position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-bottom: 18px; }
.admin-side .logo { padding: 18px 16px; color: white; font-weight: 700; font-size: 14px; border-bottom: 1px solid oklch(0.3 0.03 260); }
.admin-side .logo small { display: block; font-weight: 400; color: oklch(0.69 0.02 260); font-size: 11px; margin-top: 3px; }
.admin-side a { display: flex; align-items: center; gap: 10px; margin: 2px 9px; padding: 9px 10px; color: oklch(0.82 0.018 260);
               font-size: 12px; border-radius: 7px; border-left: 0; transition: .15s; }
.admin-side a .ui-icon { color: oklch(0.65 0.025 260); }
.admin-side a:hover { background: oklch(0.29 0.03 260); color: white; }
.admin-side a.on { background: oklch(0.33 0.075 278); color: white; box-shadow: inset 2px 0 var(--c-primary); }
.admin-side a.on .ui-icon { color: oklch(0.83 0.12 278); }
.admin-side .grp { padding: 14px 16px 5px; font-size: 10px; color: oklch(0.59 0.02 260); letter-spacing: .08em; text-transform: uppercase; }
.admin-main { flex: 1; background: var(--c-bg); padding: 22px 26px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin: -22px -26px 20px;
             padding: 14px 26px; min-height: 56px; background: oklch(1 0 0); border-bottom: 1px solid var(--c-line); }
.admin-top h2 { font-size: 16px; font-weight: 650; }
.admin-top > div { display: flex; align-items: center; gap: 12px; }
.admin-main > .page { max-width: 1500px; margin: 0 auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); gap: 12px; }
.kpi { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 10px; padding: 14px; box-shadow: var(--shadow-sm); }
.kpi .n { font-size: 24px; line-height: 1.2; font-weight: 700; color: var(--c-ink); }
.kpi .t { font-size: 11px; color: var(--c-sub); margin-top: 6px; }

/* 管理大屏 */
.screen { background: oklch(0.16 0.025 260); color: oklch(0.91 0.015 245); min-height: 100vh; }
.screen-content { padding: 20px 24px; }
.screen h1 { display:flex; align-items:center; justify-content:center; gap:9px; font-size: 20px; text-align: center; color: oklch(0.79 0.14 83); letter-spacing: .08em; margin-bottom: 4px; }
.screen h1 .ui-icon { color: oklch(0.74 0.13 205); }
.screen .sub { text-align: center; color: oklch(0.62 0.025 245); font-size: 11px; margin-bottom: 16px; }
.screen .grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 13px; max-width: 1600px; margin: auto; }
.panel { background: oklch(0.21 0.03 260); border: 1px solid oklch(0.3 0.035 260); border-radius: 10px; padding: 14px; }
.panel h3 { font-size: 12px; color: oklch(0.7 0.025 245); margin-bottom: 10px; font-weight: 550; }
.panel .big { font-size: 29px; font-variant-numeric: tabular-nums; font-weight: 700; color: oklch(0.79 0.14 83); }
.panel .big.ok { color: oklch(0.76 0.14 160); } .panel .big.warn { color: oklch(0.79 0.14 83); }
.panel .big.danger { color: oklch(0.72 0.17 18); }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11px; }
.bar-row .lbl { width: 88px; color: oklch(0.79 0.02 245); flex-shrink: 0; }
.bar-row .bar { flex: 1; height: 9px; background: oklch(0.29 0.035 260); border-radius: 99px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: linear-gradient(90deg,var(--c-primary),oklch(0.72 0.14 205)); border-radius: inherit; }
.bar-row .v { width: 34px; text-align: right; color: oklch(0.79 0.14 83); font-variant-numeric: tabular-nums; }
.scroll-list { max-height: 130px; overflow: hidden; position: relative; }
.scroll-list ul { list-style: none; padding: 0; animation: scrollup 14s linear infinite; }
.scroll-list li { padding: 5px 0; font-size: 11px; color: oklch(0.7 0.025 245); border-bottom: 1px dashed oklch(0.3 0.035 260);
                  display: flex; justify-content: space-between; }
@keyframes scrollup { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }
.progress { height: 10px; background: oklch(0.29 0.035 260); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg,oklch(0.72 0.14 70),oklch(0.79 0.14 83)); border-radius: inherit; }

.steps { display: flex; margin: 12px 0; }
.steps .s { flex: 1; text-align: center; font-size: 10px; color: var(--c-sub); position: relative; }
.steps .s::before { content: ""; display: block; width: 22px; height: 22px; margin: 0 auto 5px; border-radius: 50%;
                    background: var(--c-line); color: white; line-height: 22px; }
.steps .s.done::before { background: var(--c-ok); content: "✓"; }
.steps .s.cur::before { background: var(--c-primary); }
.steps .s.cur { color: var(--c-primary); font-weight: 600; }
.chk-list label { display: flex; gap: 9px; align-items: flex-start; padding: 10px; border: 1px solid var(--c-line);
                  border-radius: 8px; margin-bottom: 7px; font-size: 12px; cursor: pointer; transition: .15s; }
.chk-list label:hover { border-color: var(--c-primary); background: var(--c-primary-soft); }
.chk-list input { margin-top: 3px; accent-color: var(--c-primary); }
.chk-list small { display: block; color: var(--c-sub); margin-top: 2px; line-height: 1.5; }
.empty { text-align: center; color: var(--c-sub); padding: 36px 0; font-size: 12px; }
.skl { padding: 4px 0; }
.skl-row { height: 54px; border-radius: 10px; margin-bottom: 8px;
           background: linear-gradient(90deg, var(--c-line) 25%, oklch(0.96 0.01 260) 50%, var(--c-line) 75%);
           background-size: 200% 100%; animation: skl 1.1s ease infinite; }
@keyframes skl { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--c-line);
        border-top-color: var(--c-primary); border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .admin-side { width: 205px; }
  .admin-main { padding: 18px; }
  .admin-top { margin: -18px -18px 16px; padding: 12px 18px; }
}
@media (max-width: 760px) {
  .admin { flex-direction: column; }
  .admin-side { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; display: flex; overflow-x: auto; padding: 0; }
  .admin-side .logo { display: none; }
  .admin-side a { white-space: nowrap; flex: 0 0 auto; margin: 5px 2px; padding: 8px 10px; }
  .admin-side .grp { display: none; }
  .admin-main { padding: 14px; }
  .admin-top { margin: -14px -14px 14px; padding: 10px 14px; }
}
@media (max-width: 600px) {
  .screen-content { padding: 14px 12px; }
  .screen .grid { gap: 8px; }
  .screen .grid > .panel { grid-column: span 6 !important; }
  .screen .grid > .panel:nth-child(n+9) { grid-column: span 12 !important; }
  .panel { padding: 10px; }
  .panel .big { font-size: 23px; }
  .bar-row .lbl { width: 72px; }
  .admin-top > div { font-size: 0; }
  .admin-top > div a { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
