/* ============================================================
   云宿进销存 · 样式表
   浅色专业风，桌面 / 移动双端适配
   ============================================================ */

:root {
  --bg: #f2f6f5;
  --panel: #ffffff;
  --ink: #10201d;
  --ink-2: #556662;
  --ink-3: #8a9a96;
  --line: #e3eae8;
  --line-2: #eef3f1;

  --brand: #16705c;
  --brand-dark: #0d2a24;
  --brand-600: #12604f;
  --brand-50: #e7f3ef;
  --brand-100: #d2eae2;

  --amber: #c2760a;
  --amber-50: #fdf3e3;
  --red: #c94242;
  --red-50: #fceceb;
  --blue: #2563eb;
  --blue-50: #eaf0fe;
  --green: #17845f;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(14, 42, 36, 0.05);
  --shadow: 0 1px 3px rgba(14, 42, 36, 0.06), 0 10px 28px -16px rgba(14, 42, 36, 0.22);
  --shadow-lg: 0 24px 60px -24px rgba(14, 42, 36, 0.32);
  --sidebar: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 图标默认尺寸，避免在 flex 容器中被撑开；图表 SVG 用内联样式覆盖 */
svg { width: 18px; height: 18px; flex-shrink: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

input, button, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand); text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cdd8d5; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b3c2be; }
::-webkit-scrollbar-track { background: transparent; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ================= 登录页 ================= */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--panel);
}
.login-brand {
  position: relative;
  background: linear-gradient(150deg, #0d2a24 0%, #12453a 55%, #17705c 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 560px; height: 560px;
  right: -220px; bottom: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.13), transparent 68%);
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 30% 40%, #000 20%, transparent 78%);
}
.login-logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-logo .mark {
  width: 42px; height: 42px; border-radius: 11px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px; letter-spacing: .5px;
  backdrop-filter: blur(6px);
}
.login-logo .name { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.login-logo .sub { font-size: 12px; color: rgba(255,255,255,.62); letter-spacing: 1.6px; }
.login-hero { position: relative; z-index: 1; max-width: 440px; }
.login-hero h1 { font-size: 34px; line-height: 1.32; font-weight: 600; letter-spacing: -.5px; margin-bottom: 18px; }
.login-hero p { color: rgba(255,255,255,.7); font-size: 14.5px; line-height: 1.85; }
.login-feats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.login-feats span {
  font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.86);
}
.login-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,.42); }

.login-form-side { display: grid; place-items: center; padding: 40px 32px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 24px; font-weight: 600; letter-spacing: -.3px; }
.login-card .tip { color: var(--ink-2); font-size: 13.5px; margin: 8px 0 30px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; height: 46px; margin-top: 10px; font-size: 15px; }
.login-hint {
  margin-top: 26px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.9;
}
.login-hint b { color: var(--ink); font-weight: 600; }
.login-err {
  margin-top: 14px; padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--red-50); color: var(--red); font-size: 13px;
  display: none;
}

.login-mobile-brand { text-align: center; margin-bottom: 34px; }
.login-mobile-brand .mark {
  width: 58px; height: 58px; border-radius: 17px; margin: 0 auto 14px;
  background: linear-gradient(150deg, #1d8a70, #12604f); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 19px;
  letter-spacing: .5px; box-shadow: 0 10px 24px -10px rgba(18, 96, 79, .8);
}
.login-mobile-brand .nm { font-size: 18.5px; font-weight: 600; letter-spacing: -.2px; }
.login-mobile-brand .sb { font-size: 10px; letter-spacing: 2.4px; color: var(--ink-3); margin-top: 3px; }

/* ================= 表单 ================= */
.field label,
.form-label {
  display: block; font-size: 12.5px; color: var(--ink-2);
  margin-bottom: 6px; font-weight: 500;
}
.input, .select, textarea.input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 9px 12px; resize: vertical; min-height: 68px; line-height: 1.6; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 112, 92, .1);
}
.input::placeholder { color: #b4c1be; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a9a96' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px; cursor: pointer;
}
.input-sm { height: 34px; padding: 0 10px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  transition: all .15s;
}
.btn:hover { border-color: #cfdad7; background: #fafcfb; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-danger { color: var(--red); border-color: #f0d3d2; background: #fff; }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-color: transparent; background: transparent; }
.btn-icon:hover { background: var(--line-2); }

/* ================= 布局 ================= */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  background: var(--brand-dark); color: #fff;
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 60;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 18px;
}
.sb-brand .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  background: linear-gradient(150deg, #1d8a70, #14705c);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 14px -4px rgba(29, 138, 112, .7);
}
.sb-brand .t { font-size: 14.5px; font-weight: 600; letter-spacing: .2px; line-height: 1.3; }
.sb-brand .s { font-size: 10.5px; color: rgba(255,255,255,.42); letter-spacing: 1.4px; }

.sb-nav { flex: 1; overflow-y: auto; padding: 8px 10px 20px; }
.sb-group { font-size: 10.5px; letter-spacing: 1.4px; color: rgba(255,255,255,.32); padding: 16px 10px 7px; font-weight: 600; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 8px; margin-bottom: 2px;
  color: rgba(255,255,255,.68); font-size: 13.5px;
  cursor: pointer; transition: all .14s; position: relative;
}
.sb-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.sb-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-item.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 500; }
.sb-item.active::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 0 3px 3px 0; background: #38c99f;
}
.sb-item .dot {
  margin-left: auto; min-width: 18px; height: 18px; border-radius: 9px;
  background: #e0684f; color: #fff; font-size: 11px; font-weight: 600;
  display: grid; place-items: center; padding: 0 5px;
}
.sb-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-user { display: flex; align-items: center; gap: 9px; cursor: pointer; border-radius: 8px; padding: 4px; }
.sb-user:hover { background: rgba(255,255,255,.07); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
  background: linear-gradient(140deg, #35b795, #17846c);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: #fff;
}
.sb-user .nm { font-size: 13px; line-height: 1.35; }
.sb-user .rl { font-size: 11px; color: rgba(255,255,255,.45); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; }

.topbar {
  height: 60px; flex: 0 0 60px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 26px;
  position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 16.5px; font-weight: 600; letter-spacing: -.2px; }
.topbar .crumb { font-size: 12.5px; color: var(--ink-3); }
.topbar .spacer { flex: 1; }
.topbar .store-pick { display: flex; align-items: center; gap: 7px; }
.topbar .store-pick .select { height: 34px; width: auto; min-width: 148px; font-size: 13px; background-color: #fff; }

.content { padding: 22px 26px 40px; flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .tt { font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.page-head .ds { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ================= 卡片 ================= */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .more { margin-left: auto; font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.card-head .more:hover { color: var(--brand); }
.card-head .acts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ================= 统计卡 ================= */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 17px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.stat .k { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; padding-right: 44px; }
.stat .v { font-size: 25px; font-weight: 600; letter-spacing: -.7px; margin-top: 7px; line-height: 1.15; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.stat .x { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.stat .ic {
  position: absolute; right: 14px; top: 14px;
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; background: var(--brand-50); color: var(--brand);
}
.stat .ic svg { width: 17px; height: 17px; }
.stat.amber .ic { background: var(--amber-50); color: var(--amber); }
.stat.blue .ic { background: var(--blue-50); color: var(--blue); }
.stat.red .ic { background: var(--red-50); color: var(--red); }
.stat .v.up { color: var(--red); }
.stat .v.down { color: var(--green); }

/* ================= 表格 ================= */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-3);
  padding: 11px 14px; background: #fafcfb; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #fbfdfc; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl .nowrap { white-space: nowrap; }
.tbl .strong { font-weight: 600; }
.tbl .muted { color: var(--ink-3); }
.tbl .link { color: var(--brand); cursor: pointer; font-weight: 500; }
.tbl .link:hover { text-decoration: underline; }
.tbl .ops { display: flex; gap: 4px; justify-content: flex-end; }
.tbl .cell-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.gray { background: #f0f4f3; color: var(--ink-2); }
.badge.green { background: var(--brand-50); color: var(--brand); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.blue { background: var(--blue-50); color: var(--blue); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  background: var(--line-2); color: var(--ink-2); font-size: 11.5px;
}

/* ================= 工具栏 ================= */
.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.toolbar .search { position: relative; flex: 0 1 260px; }
.toolbar .search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-3);
}
.toolbar .search .input { padding-left: 33px; height: 36px; }
.toolbar .select { height: 36px; width: auto; min-width: 118px; }
.toolbar .grow { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 5px;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ================= 空状态 / 加载 ================= */
.empty { padding: 56px 20px; text-align: center; color: var(--ink-3); }
.empty svg { width: 46px; height: 46px; margin-bottom: 12px; opacity: .45; }
.empty .t { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.empty .s { font-size: 12.5px; }
.loading { padding: 48px; text-align: center; color: var(--ink-3); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--line);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skel {
  background: linear-gradient(90deg, #eef3f1 25%, #f6faf9 37%, #eef3f1 63%);
  background-size: 400% 100%; animation: skel 1.3s ease infinite; border-radius: 6px;
}
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ================= 分页 ================= */
.pager {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  padding: 13px 16px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2);
}
.pager .pinfo { margin-right: auto; color: var(--ink-3); font-size: 12.5px; }
.pager button {
  min-width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; padding: 0 9px;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ================= 弹窗 ================= */
.mask {
  position: fixed; inset: 0; background: rgba(10, 26, 22, .42);
  backdrop-filter: blur(2px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal.wide { max-width: 900px; }
.modal.narrow { max-width: 420px; }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 17px 20px;
  border-bottom: 1px solid var(--line-2); flex: 0 0 auto;
}
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-head .close {
  margin-left: auto; width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center; color: var(--ink-3);
}
.modal-head .close:hover { background: var(--line-2); color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; gap: 9px; justify-content: flex-end; padding: 14px 20px;
  border-top: 1px solid var(--line-2); flex: 0 0 auto; background: #fcfdfd;
  border-radius: 0 0 14px 14px;
}

/* ================= Toast ================= */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #16302a; color: #fff; padding: 10px 18px; border-radius: 9px;
  font-size: 13.5px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4);
  animation: toastin .22s ease; display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: #12604f; }
.toast.err { background: #a83a3a; }
@keyframes toastin { from { opacity: 0; transform: translateY(-10px); } }

/* ================= 特定页面 ================= */
.chart-box { padding: 8px 6px 0; }
.dash-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 14px; margin-bottom: 14px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.rank-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.rank-row:last-child { border-bottom: none; }
.rank-row .no {
  width: 20px; height: 20px; border-radius: 6px; flex: 0 0 20px;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600;
  background: var(--line-2); color: var(--ink-2);
}
.rank-row:nth-child(1) .no { background: #fdf0d3; color: #b7791f; }
.rank-row:nth-child(2) .no { background: #eef1f4; color: #718096; }
.rank-row:nth-child(3) .no { background: #faeee4; color: #b0703c; }
.rank-row .nm { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .bar { flex: 0 0 90px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.rank-row .bar i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.rank-row .amt { flex: 0 0 88px; text-align: right; font-size: 13px; font-weight: 600; }

.alert-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.alert-item:last-child { border-bottom: none; }
.alert-item .nm { flex: 1; min-width: 0; font-size: 13px; }
.alert-item .nm small { display: block; color: var(--ink-3); font-size: 11.5px; }
.alert-item .q { font-size: 13px; font-weight: 600; color: var(--red); }

/* 明细行编辑表 */
.lines { width: 100%; font-size: 13px; }
.lines th { font-size: 12px; color: var(--ink-3); font-weight: 500; padding: 8px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.lines td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.lines .input { height: 34px; }
.lines .qty-in { width: 78px; text-align: right; }
.lines .price-in { width: 96px; text-align: right; }
.lines .del { color: var(--ink-3); cursor: pointer; padding: 4px; border-radius: 5px; }
.lines .del:hover { color: var(--red); background: var(--red-50); }
.lines tr.picked td { background: #fbfdfc; }

.prod-picker { position: relative; }
.picker-drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); max-height: 290px; overflow-y: auto;
}
.picker-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.picker-item:last-child { border-bottom: none; }
.picker-item:hover { background: var(--brand-50); }
.picker-item .n { font-size: 13px; }
.picker-item .m { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 10px; margin-top: 1px; }

.sum-bar {
  display: flex; align-items: center; gap: 20px; justify-content: flex-end;
  padding: 13px 4px 0; font-size: 13px; color: var(--ink-2);
}
.sum-bar b { font-size: 19px; color: var(--ink); font-weight: 600; letter-spacing: -.4px; }

/* 详情 */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; margin-bottom: 18px; }
.detail-grid .it .k { font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.detail-grid .it .v { font-size: 13.5px; font-weight: 500; }

/* 设置页 */
.set-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.set-tab {
  padding: 10px 16px; font-size: 13.5px; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.set-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

.mode-card {
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: all .16s; position: relative;
}
.mode-card:hover { border-color: var(--brand-100); }
.mode-card.on { border-color: var(--brand); background: #fbfefd; }
.mode-card .h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.mode-card .h .radio {
  width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #cfdad7;
  margin-left: auto; display: grid; place-items: center;
}
.mode-card.on .h .radio { border-color: var(--brand); }
.mode-card.on .h .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.mode-card .d { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }

/* 凭证照片 */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-item {
  position: relative; width: 84px; height: 84px; border-radius: 9px;
  overflow: hidden; border: 1px solid var(--line); background: var(--line-2);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo-item .del {
  position: absolute; right: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%;
  background: rgba(16, 32, 29, 0.68); color: #fff; display: grid; place-items: center;
  border: none; cursor: pointer; padding: 0;
}
.photo-item .del svg { width: 11px; height: 11px; }
.photo-add {
  width: 84px; height: 84px; border-radius: 9px; border: 1px dashed #c8d4d1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); cursor: pointer; background: #fafcfb; font-size: 11px;
  transition: all 0.15s; user-select: none;
}
.photo-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.photo-add span { font-size: 20px; line-height: 1; font-weight: 300; }

.ai-note {
  margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.75;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line);
}
.ai-note.ok { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }
.ai-note.bad { background: var(--red-50); color: var(--red); border-color: #f2d5d4; }
.ai-note.warn { background: var(--amber-50); color: #8a5a08; border-color: #f3e2c4; }
.ai-note.pending { background: var(--blue-50); color: var(--blue); border-color: #d8e3fb; }

.lightbox {
  position: fixed; inset: 0; z-index: 900; background: rgba(8, 20, 17, 0.9);
  display: flex; align-items: center; justify-content: center; padding: 32px;
  animation: fade 0.15s;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lightbox-close {
  position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: #fff; display: grid; place-items: center;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ================= 移动端 ================= */
.mobile-only { display: none; }
.mtabbar { display: none; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar {
    transform: translateX(-100%); transition: transform .24s cubic-bezier(.3,.8,.4,1);
    width: 244px; flex-basis: 244px; box-shadow: var(--shadow-lg); z-index: 80;
  }
  .sidebar.open { transform: none; }
  .scrim {
    position: fixed; inset: 0; background: rgba(10,26,22,.4); z-index: 75;
    animation: fade .16s;
  }
  .main { margin-left: 0; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .topbar { height: 54px; flex-basis: 54px; padding: 0 12px; gap: 7px; }
  .topbar h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .store-pick > svg { display: none; }
  .store-pick .select {
    height: 32px; min-width: 84px; max-width: 112px; font-size: 12px;
    padding: 0 22px 0 9px; background-position: right 8px center;
  }
  .content { padding: 14px 13px 92px; }
  .page-head { margin-bottom: 13px; }
  .page-head .tt { font-size: 17.5px; }
  .page-head .acts { width: 100%; margin-left: 0; }
  .page-head .acts .btn { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
  .stat { padding: 13px; }
  .stat .v { font-size: 20px; }
  .stat .ic { width: 26px; height: 26px; right: 10px; top: 10px; }
  .card { border-radius: 11px; }
  .card-head { padding: 13px 14px; }
  .card-body { padding: 14px; }
  .toolbar { padding: 11px 12px; gap: 7px; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar input[type="date"] {
    flex: 1 1 calc(50% - 4px); width: auto !important; min-width: 0; height: 36px;
  }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .tbl th, .tbl td { padding: 10px 11px; }
  .mask { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0;
    animation: sheet .22s cubic-bezier(.2,.9,.3,1);
  }
  @keyframes sheet { from { transform: translateY(100%); } }
  .modal-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .modal-foot .btn { flex: 1; }
  .modal-body { padding: 16px 14px; }

  /* 移动端底部 Tab */
  .mtabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mtab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 5px 0; color: var(--ink-3); font-size: 10.5px; border-radius: 9px;
  }
  .mtab svg { width: 21px; height: 21px; }
  .mtab.active { color: var(--brand); font-weight: 500; }
  .mtab.active svg { transform: translateY(-1px); }

  /* 移动端列表卡片化 */
  .m-card-list { padding: 10px 11px; display: flex; flex-direction: column; gap: 9px; }
  .m-item {
    border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px;
    background: #fff; box-shadow: var(--shadow-sm);
  }
  .m-item:active { background: #fafcfb; }
  .m-item .l1 { display: flex; align-items: center; gap: 8px; }
  .m-item .l1 .nm { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-item .l2 { font-size: 12px; color: var(--ink-3); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .m-item .l3 {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line-2);
  }
  .m-item .l3 .amt { font-size: 17px; font-weight: 600; letter-spacing: -.4px; }
  .m-item .l3 .amt small { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-right: 2px; }

  .lines { font-size: 12.5px; }
  .lines th:nth-child(4), .lines td:nth-child(4) { display: none; }
  .lines .qty-in { width: 56px; }
  .lines .price-in { width: 72px; }
  .lines td:first-child { max-width: 150px; }
  .lines td:first-child > div:nth-child(2) {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 126px;
  }
  .photo-item, .photo-add { width: 72px; height: 72px; }
  .lightbox { padding: 12px; }
  .sum-bar { font-size: 12px; gap: 12px; }
  .sum-bar b { font-size: 17px; }
}

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-side { padding: 28px 22px; min-height: 100vh; align-content: center; }
  .login-card h2 { font-size: 22px; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 18px; }
}

/* ============================================================
   工作台下钻 / 维度切换
   ============================================================ */
.stat.clickable, .rank-row.clickable, .todo-card { cursor: pointer; transition: box-shadow .16s, transform .16s, border-color .16s; }
.stat.clickable:hover { box-shadow: var(--shadow); border-color: var(--brand-100); transform: translateY(-1px); }
.stat-go {
  margin-left: auto; flex: 0 0 auto; font-size: 11px; color: var(--brand); font-weight: 500;
  opacity: .55; transition: opacity .15s; white-space: nowrap;
}
.stat.clickable:hover .stat-go { opacity: 1; }
.rank-row.clickable:hover { background: var(--brand-50); border-radius: 8px; }

/* 所有可下钻的行 / 条目统一交互反馈 */
.row-click { cursor: pointer; }
.row-click:hover td { background: var(--brand-50); }
.row-click:active td { background: var(--brand-100); }
.alert-item.clickable { cursor: pointer; border-radius: 8px; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.alert-item.clickable:hover { background: var(--brand-50); }
.m-item.clickable { cursor: pointer; }
.m-item.clickable:active { transform: scale(.995); background: var(--brand-50); }
.stat.clickable:active { transform: translateY(0); }
.todo-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow); }
/* 触屏设备没有 hover，常驻显示"明细 →"提示 */
@media (hover: none) {
  .stat-go { opacity: .8; }
  .clickable:active { opacity: .85; }
}

.todo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.todo-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.todo-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow); }
.todo-card .ic {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px;
  background: var(--brand-50); color: var(--brand); display: grid; place-items: center;
}
.todo-card .ic.amber { background: var(--amber-50); color: var(--amber); }
.todo-card .ic.red { background: var(--red-50); color: var(--red); }
.todo-card .t { font-size: 13px; font-weight: 600; }
.todo-card .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.todo-card .n { margin-left: auto; font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.todo-card.danger .n { color: var(--red); }

.dim-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  border-top: 1px solid var(--line-2); background: #fbfdfc; flex-wrap: wrap;
}
.dim-label { font-size: 12px; color: var(--ink-3); }
.stats.mini { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.stats.mini .stat { padding: 13px 15px; }
.stats.mini .stat .v { font-size: 20px; margin-top: 5px; }
.stats.mini .stat .ic { display: none; }

@media (max-width: 860px) {
  .todo-row { grid-template-columns: 1fr; gap: 8px; }
  .stats.mini { grid-template-columns: 1fr 1fr; }
  .dim-bar { padding: 8px 12px; }
  .dim-bar .chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .dim-bar .chips .chip { white-space: nowrap; }
  .stat .k { padding-right: 26px; font-size: 12px; }
  /* 窄屏只显示一个箭头，避免标题换行 */
  .stat-go { font-size: 0; opacity: .55; }
  .stat-go::after { content: '›'; font-size: 16px; line-height: 1; }
}

/* ============================================================
   备份与容灾
   ============================================================ */
.cloud-status {
  display: flex; gap: 14px; align-items: flex-start; padding: 15px 18px;
  border-radius: var(--radius); margin-bottom: 14px;
  background: var(--amber-50); border: 1px solid #f0d6a8;
}
.cloud-status.ok { background: var(--brand-50); border-color: var(--brand-100); }
.cloud-status .cs-ico {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: #fff;
  display: grid; place-items: center; font-size: 19px; color: var(--amber);
}
.cloud-status.ok .cs-ico { color: var(--brand); }
.cloud-status .cs-t { font-size: 13.5px; font-weight: 700; }
.cloud-status .cs-s { font-size: 12.5px; color: var(--ink-2); line-height: 1.85; margin-top: 2px; }
.cloud-status .cs-w { font-size: 12px; color: var(--red); margin-top: 6px; line-height: 1.8; }

/* ============================================================
   授权与续期
   ============================================================ */
.dim { color: var(--ink-3); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; background: var(--line-2); color: var(--ink-3);
  font-size: 12px; font-weight: 500;
}
.pill.ok { background: var(--brand-50); color: var(--brand); }

.lic-chip {
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.lic-chip.warn { background: var(--amber-50); color: var(--amber); }
.lic-chip.bad { background: var(--red-50); color: var(--red); }

.lic-alert {
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px;
  background: var(--red-50); border: 1px solid #f3cfcb;
}
.lic-alert.frozen { background: var(--line-2); border-color: var(--line); }
.lic-alert .tt { font-size: 15px; font-weight: 700; color: var(--red); margin-bottom: 4px; }
.lic-alert.frozen .tt { color: var(--ink); }
.lic-alert .ss { font-size: 13px; color: var(--ink-2); line-height: 1.7; }

.lic-hero {
  display: grid; grid-template-columns: 1fr 320px; gap: 0; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.lic-main { padding: 24px 26px; }
.lic-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.lic-code { font-size: 12px; color: var(--ink-3); font-family: ui-monospace, monospace; letter-spacing: .04em; }
.lic-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.lic-plan { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.lic-days { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 10px; }
.lic-days .num { font-size: 46px; font-weight: 700; line-height: 1; color: var(--brand); letter-spacing: -.02em; }
.lic-days .num.warn { color: var(--amber); }
.lic-days .num.bad { color: var(--red); }
.lic-days .unit { font-size: 13px; color: var(--ink-3); }
.lic-bar { height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; max-width: 460px; }
.lic-bar i { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.lic-meta { display: flex; gap: 22px; font-size: 12.5px; color: var(--ink-3); margin-top: 14px; flex-wrap: wrap; }
.lic-meta b { color: var(--ink-2); font-weight: 600; }
.lic-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.lic-side { background: var(--brand-50); padding: 24px 22px; border-left: 1px solid var(--line); }
.usage .u-head { font-size: 12.5px; font-weight: 600; color: var(--brand); margin-bottom: 14px; letter-spacing: .02em; }
.u-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.u-row b { color: var(--ink); }
.u-bar { height: 5px; border-radius: 999px; background: #fff; overflow: hidden; margin-top: 6px; }
.u-bar i { display: block; height: 100%; border-radius: 999px; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding: 16px; }
.plan-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 16px;
  background: #fbfdfc; transition: border-color .15s, box-shadow .15s;
}
.plan-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-50); }
.plan-card .pn { font-size: 14px; font-weight: 700; }
.plan-card .pp { margin: 8px 0; color: var(--brand); font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.plan-card .pp small { font-size: 13px; font-weight: 600; margin-right: 1px; }
.plan-card .pp em { font-size: 11.5px; font-style: normal; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.plan-card .pf { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.plan-card .pf span { font-size: 11px; color: var(--ink-2); background: var(--line-2); padding: 2px 7px; border-radius: 5px; }
.plan-card .pl { font-size: 11.5px; color: var(--ink-3); }
.lic-quote {
  margin-top: 14px; padding: 12px 14px; border-radius: 9px;
  background: var(--brand-50); font-size: 12.5px; color: var(--ink-2); line-height: 1.8;
}

.lic-lock {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center;
  background: rgba(10, 26, 22, .58); backdrop-filter: blur(3px); padding: 24px;
}
.lk-card {
  background: #fff; border-radius: 16px; padding: 34px 32px; max-width: 430px; width: 100%;
  text-align: center; box-shadow: var(--shadow-lg); animation: pop .2s;
}
.lk-ico {
  width: 54px; height: 54px; border-radius: 14px; background: var(--amber-50); color: var(--amber);
  display: grid; place-items: center; margin: 0 auto 16px;
}
.lk-ico svg { width: 26px; height: 26px; }
.lk-t { font-size: 19px; font-weight: 700; }
.lk-s { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-top: 8px; }
.lk-btns { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.lk-tip { font-size: 11.5px; color: var(--ink-3); margin-top: 16px; line-height: 1.7; }

/* ============================================================
   电子秤
   ============================================================ */
.weigh-tag {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px;
  background: var(--amber-50); color: var(--amber); font-size: 10.5px; line-height: 16px;
  vertical-align: middle;
}
.weigh-tag.ok { background: var(--brand-50); color: var(--brand); }
.weigh-tag.warn { background: var(--amber-50); color: var(--amber); }
.qty-cell { display: flex; align-items: center; gap: 4px; }
.weigh-btn {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--brand-50); color: var(--brand); display: grid; place-items: center; cursor: pointer;
}
.weigh-btn:hover { background: var(--brand-100); }
.weigh-btn svg { width: 15px; height: 15px; }
.weigh-sub { font-size: 10.5px; color: var(--brand); margin-top: 3px; padding-left: 2px; }

.weigh-panel { padding: 2px 0; }
.weigh-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: 12.5px; }
.weigh-read {
  font-size: 54px; font-weight: 700; text-align: center; letter-spacing: -.03em;
  color: var(--ink); padding: 22px 0 6px; font-variant-numeric: tabular-nums;
}
.weigh-read small { font-size: 15px; color: var(--ink-3); margin-left: 6px; font-weight: 500; }
.weigh-read.live { color: var(--brand); }
.weigh-tip { text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.7; margin-bottom: 14px; }
.weigh-input { text-align: center; font-size: 20px; height: 48px; font-variant-numeric: tabular-nums; }
.weigh-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; }

/* 开关 */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 0; border-bottom: 1px solid var(--line-2);
}
.switch-row:last-of-type { border-bottom: 0; }
.switch-row .t { font-size: 13.5px; font-weight: 600; }
.switch-row .s { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.6; max-width: 560px; }
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: 0 0 44px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i {
  position: absolute; inset: 0; background: #cfd9d6; border-radius: 999px; transition: background .18s;
}
.switch i::after {
  content: ''; position: absolute; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(19px); }

.chk-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); height: 38px; }
.chk-line input { width: 16px; height: 16px; accent-color: var(--brand); }

@media (max-width: 860px) {
  .lic-hero { grid-template-columns: 1fr; }
  .lic-side { border-left: 0; border-top: 1px solid var(--line); }
  .lic-main { padding: 20px; }
  .lic-days .num { font-size: 38px; }
  .lic-chip { font-size: 11px; padding: 4px 9px; }
  .weigh-read { font-size: 44px; }
}

/* ============================================================
   登录页 · 申请开通
   ============================================================ */
.apply-entry {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2);
  text-align: center; font-size: 12.5px; color: var(--ink-3);
}
.link-btn {
  background: none; border: 0; padding: 0 2px; cursor: pointer;
  color: var(--brand); font-size: 12.5px; font-weight: 500; font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }
.apply-entry .sep, .apply-foot .sep { margin: 0 5px; color: var(--line); }
.req { color: var(--red); font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.apply-card textarea.input { height: auto; padding: 9px 11px; line-height: 1.5; resize: vertical; }
.apply-foot {
  margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line-2);
  display: flex; align-items: center; justify-content: center; gap: 2px;
  font-size: 12.5px; color: var(--ink-3);
}

.apply-done { text-align: center; padding: 6px 0 2px; }
.apply-done .ok-ico {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--brand-50); color: var(--brand);
  display: grid; place-items: center; font-size: 26px; font-weight: 700;
}
.apply-done h2 { font-size: 19px; margin-bottom: 14px; }
.apply-no {
  display: inline-block; padding: 7px 14px; border-radius: 8px;
  background: var(--bg); font-size: 13px; color: var(--ink-2); margin-bottom: 16px;
}
.apply-no b { color: var(--brand); letter-spacing: .4px; }
.apply-done-rows { text-align: left; margin: 0 auto 14px; max-width: 330px; }
.apply-done-rows div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.apply-done-rows span { color: var(--ink-3); }
.apply-done-tip { font-size: 12.5px; color: var(--ink-2); line-height: 1.75; margin-bottom: 18px; }
.apply-done-acts { display: flex; gap: 10px; }
.apply-done-acts .btn { flex: 1; }

.apply-or { text-align: center; font-size: 12px; color: var(--ink-3); margin: 10px 0; }
.apply-q { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.apply-q div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--line-2);
}
.apply-q div:last-child { border-bottom: 0; }
.apply-q span { color: var(--ink-3); }
.apply-q .st-pending { color: var(--amber); }
.apply-q .st-approved { color: var(--brand); }
.apply-q .st-rejected { color: var(--red); }
.apply-q-err { font-size: 12.5px; color: var(--red); padding: 8px 0; }
.apply-q-loading { font-size: 12.5px; color: var(--ink-3); padding: 8px 0; }

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* 禁用态输入框 */
.input:disabled, .select:disabled {
  background: var(--bg); color: var(--ink-3); cursor: not-allowed; opacity: .85;
}

/* ============================================================
   移动端适配：宽表卡片化 / 设置页标签 / 二级页顶栏返回
   ============================================================ */
@media (max-width: 860px) {
  /* 宽表在手机上转成一条一条的卡片，避免列被压成竖排单字 */
  table.tbl[data-cards="1"] { display: block; width: 100%; border: 0; font-size: 13px; }
  table.tbl[data-cards="1"] thead { display: none; }
  table.tbl[data-cards="1"] tbody { display: block; width: 100%; }
  table.tbl[data-cards="1"] tbody tr {
    display: block; width: 100%; margin-bottom: 9px; padding: 4px 0;
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow-sm);
  }
  table.tbl[data-cards="1"] tbody tr:hover { background: #fff; }
  table.tbl[data-cards="1"] tbody tr:last-child td { border-bottom: 0; }
  table.tbl[data-cards="1"] tbody td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    width: 100%; padding: 7px 13px; border: 0; text-align: right;
    font-size: 13px; line-height: 1.55; vertical-align: middle;
  }
  table.tbl[data-cards="1"] tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto; max-width: 42%;
    color: var(--ink-3); font-size: 12px; font-weight: 400; text-align: left;
  }
  table.tbl[data-cards="1"] tbody td:first-child {
    padding-top: 9px; padding-bottom: 9px; margin-bottom: 3px;
    border-bottom: 1px dashed var(--line-2);
    font-size: 14.5px; font-weight: 600; text-align: left;
    justify-content: flex-start;
  }
  table.tbl[data-cards="1"] tbody td:first-child::before { display: none; }
  table.tbl[data-cards="1"] tbody td[colspan] {
    justify-content: center; text-align: center; color: var(--ink-3);
  }
  table.tbl[data-cards="1"] tbody td[colspan]::before { display: none; }
  table.tbl[data-cards="1"] tbody td .ops { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  table.tbl[data-cards="1"] tbody td .nowrap { white-space: normal; }

  /* 设置页标签：改成可换行的胶囊，多出来的标签不再被切在屏幕外 */
  .set-tabs {
    flex-wrap: wrap; gap: 6px; overflow: visible;
    border-bottom: 0; padding-bottom: 0; margin-bottom: 14px;
  }
  .set-tab {
    flex: 1 1 auto; min-width: calc(33.3% - 6px);
    padding: 8px 10px; font-size: 12.5px; text-align: center;
    border: 1px solid var(--line); border-radius: 9px;
    background: #fff; margin-bottom: 0;
  }
  .set-tab.active {
    background: var(--brand-50); border-color: var(--brand-100);
    color: var(--brand); font-weight: 500;
  }

  /* 详情页内联返回键：手机上顶栏已有返回，内容区不再重复 */
  #detailBack { display: none; }
}
