:root {
  --navy: #0d2f3f;
  --navy-2: #123c4e;
  --navy-3: #1a4d60;
  --accent: #147d7a;
  --accent-2: #1c9a95;
  --accent-soft: #e5f5f3;
  --gold: #b7862f;
  --gold-soft: #fbf3e2;
  --bg: #f2f5f7;
  --card: #fff;
  --line: #e3e9ed;
  --line-strong: #d2dde3;
  --text: #172b36;
  --muted: #6b7f8b;
  --green: #1f8f5f;
  --green-soft: #e6f6ee;
  --orange: #b97310;
  --orange-soft: #fdf1de;
  --red: #c33f45;
  --red-soft: #fdecec;
  --blue: #2b6cb0;
  --blue-soft: #eaf2fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 42, 55, .05), 0 8px 22px rgba(16, 42, 55, .05);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 13px; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 13px; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- 登录 ---------- */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1100px 620px at 18% 8%, #17505f 0%, #0d2f3f 48%, #071c26 100%);
  overflow: auto; padding: 24px;
}
.login-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 38%, #000 28%, transparent 75%);
}
.login-card {
  position: relative; width: 900px; max-width: 100%; background: #fff; border-radius: 18px;
  box-shadow: 0 34px 90px rgba(2, 16, 24, .5); display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden;
}
.login-hero {
  background: linear-gradient(150deg, #0f3a4a, #0a2634 70%);
  color: #fff; padding: 44px 40px; position: relative; overflow: hidden;
}
.login-hero::after {
  content: ""; position: absolute; right: -90px; bottom: -110px; width: 300px; height: 300px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 42px rgba(255,255,255,.035), 0 0 0 84px rgba(255,255,255,.02);
}
.login-hero h1 { font-size: 26px; letter-spacing: 1px; margin-bottom: 10px; }
.login-hero .sub { color: #a8c3cc; font-size: 13px; line-height: 1.8; }
.login-hero .hero-list { margin-top: 34px; display: grid; gap: 13px; position: relative; z-index: 2; }
.login-hero .hero-item { display: flex; gap: 10px; align-items: flex-start; color: #d3e5e9; font-size: 12.5px; line-height: 1.6; }
.login-hero .dot { width: 7px; height: 7px; border-radius: 50%; background: #4fd0c6; margin-top: 6px; flex: none; }
.login-hero .hero-foot { position: absolute; left: 40px; bottom: 28px; color: #6f939e; font-size: 11px; }
.login-main { padding: 44px 42px 32px; }
.login-brand { display: flex; gap: 13px; align-items: center; margin-bottom: 26px; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #1c9a95, #0f5d69);
  color: #fff; font-weight: 700; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(20, 125, 122, .32);
}
.login-brand h2 { font-size: 20px; letter-spacing: .5px; }
.login-brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.login-form label { display: block; margin-bottom: 15px; font-size: 12px; color: var(--muted); }
.login-form input {
  width: 100%; margin-top: 7px; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: #fbfcfd; outline: none; font-size: 14px;
}
.login-form input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(20, 125, 122, .12); }
.login-error { min-height: 18px; color: var(--red); font-size: 12px; margin: -4px 0 8px; }
.login-demo { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }
.login-demo-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.login-demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.login-demo-item {
  display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 7px; background: #fafcfc; text-align: left;
}
.login-demo-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.login-demo-item b { font-size: 12px; color: var(--navy); }
.login-demo-item span { font-size: 11px; color: var(--muted); }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 226px; flex: none; background: linear-gradient(180deg, #0e3343, #0a2834 100%);
  color: #cfe0e5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand .logo-mark { width: 36px; height: 36px; font-size: 16px; border-radius: 9px; }
.brand-text strong { display: block; color: #fff; font-size: 14px; letter-spacing: .3px; }
.brand-text span { display: block; font-size: 10.5px; color: #7fa3ad; margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px 20px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.nav-group { margin-top: 12px; }
.nav-group-title { font-size: 10.5px; color: #688b95; padding: 0 10px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px;
  color: #bed3d9; font-size: 12.5px; cursor: pointer; margin-bottom: 1px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(28,154,149,.9), rgba(28,154,149,.55)); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.nav-ico {
  width: 20px; height: 20px; border-radius: 5px; background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; font-size: 11px; flex: none;
}
.nav-item.active .nav-ico { background: rgba(255,255,255,.18); }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 10.5px; color: #6b8d96; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title { font-size: 16px; font-weight: 600; }
.page-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 20px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
.user-chip b { font-size: 12px; font-weight: 600; }
.user-chip span { font-size: 10.5px; color: var(--muted); }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; }
.content { padding: 18px 20px 40px; flex: 1; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 13.5px; }
.card-head .hint { font-size: 11.5px; color: var(--muted); }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 31px; padding: 0 12px;
  border-radius: 7px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font-size: 12.5px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0f6b68; color: #fff; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); color: #fff; }
.btn-danger { color: var(--red); border-color: #ecc9c9; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 6px; }
.btn-xs { height: 23px; padding: 0 7px; font-size: 11px; border-radius: 5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; height: 40px; font-size: 14px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.search-box { position: relative; }
.search-box input {
  height: 31px; width: 220px; padding: 0 10px 0 30px; border: 1px solid var(--line-strong);
  border-radius: 7px; background: #fff; outline: none;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20,125,122,.1); }
.search-box::before { content: "⌕"; position: absolute; left: 10px; top: 6px; color: var(--muted); font-size: 14px; }
select.filter, input.filter {
  height: 31px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; outline: none;
}
select.filter:focus, input.filter:focus { border-color: var(--accent); }
.date-range { display: flex; align-items: center; gap: 5px; }
.date-range input { height: 31px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; }

.table-wrap { overflow: auto; border-radius: var(--radius); }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.grid th {
  background: #f7fafb; color: #5d7480; font-weight: 600; text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.grid td { padding: 9px 10px; border-bottom: 1px solid #eef2f4; vertical-align: middle; }
table.grid tbody tr:hover { background: #f8fbfb; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid .ops { white-space: nowrap; text-align: right; }
table.grid .ops .btn { margin-left: 4px; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty .big { font-size: 28px; color: #cbd8de; margin-bottom: 8px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 20px; font-size: 11px; line-height: 1.6; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.gray { background: #f0f3f5; color: #637a86; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.teal { background: var(--accent-soft); color: var(--accent); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }

/* ---------- 工作台 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.kpi.gold::before { background: var(--gold); }
.kpi.blue::before { background: var(--blue); }
.kpi.red::before { background: var(--red); }
.kpi .k-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.kpi .k-value { font-size: 24px; font-weight: 600; margin-top: 6px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.kpi .k-foot { font-size: 11px; color: var(--muted); margin-top: 5px; }
.kpi .k-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.flow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.flow-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flow-grid.cols-4 .flow-sub b { font-size: 13px; white-space: nowrap; }
.flow-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px 0; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.flow-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.flow-card.gold::before { background: var(--gold); }
.flow-card.blue::before { background: var(--blue); }
.flow-card.red::before { background: var(--red); }
.flow-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.flow-value { font-size: 28px; font-weight: 600; margin: 6px 0 12px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.flow-value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.flow-subs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px dashed var(--line); padding: 9px 0 12px; }
.flow-sub span { display: block; font-size: 11px; color: var(--muted); }
.flow-sub b { display: block; font-size: 15px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.flow-sub b.pos { color: var(--accent); }
.flow-sub b.neg { color: var(--red); }
.cat-list { display: flex; flex-direction: column; }
.cat-row { display: grid; grid-template-columns: 1fr auto 96px; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px dashed var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cat-qty { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cat-qty b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.cat-value { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
.channel-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.channel-card { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: linear-gradient(180deg,#fbfdfd,#f6faf9); }
.channel-card .cc-title { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.channel-card .cc-val { font-size: 20px; font-weight: 600; margin: 4px 0; }
.channel-card .cc-foot { font-size: 11px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 8px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.bar { width: 70%; max-width: 38px; background: linear-gradient(180deg, #2bb3ac, #147d7a); border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .3s; }
.bar-col .bar-label { font-size: 10px; color: var(--muted); }
.bar-col .bar-val { font-size: 10px; color: #4d6874; }
.todo-list { display: grid; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fcfdfd; }
.todo-item:hover { border-color: var(--accent); background: var(--accent-soft); cursor: pointer; }
.todo-ico { width: 28px; height: 28px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.todo-main { flex: 1; min-width: 0; }
.todo-main b { display: block; font-size: 12.5px; font-weight: 600; }
.todo-main span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.alert-list { display: grid; gap: 8px; }
.alert-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid #f1e2c8; background: #fffdf8; border-radius: 7px; font-size: 12px; }
.alert-item b { color: var(--orange); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table td { padding: 7px 6px; border-bottom: 1px solid #eef2f4; }
.mini-table tr:last-child td { border-bottom: none; }
.dash-scroll { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.dash-scroll table.grid th { top: 0; }
.move-cat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.move-cat { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: linear-gradient(180deg, #fbfdfd, #f7faf9); }
.move-cat .mc-name { margin-bottom: 4px; }
.move-cat .mc-meta { font-size: 11px; color: var(--muted); }
.move-cat .mc-amt { font-size: 15px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.move-cat .mc-amt.pos { color: var(--accent); }
.move-cat .mc-amt.neg { color: var(--red); }
.worker-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.worker-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; }
.worker-chip b { font-weight: 600; }
.worker-chip .muted { color: #789; }

/* ---------- 弹窗/抽屉 ---------- */
.mask { position: fixed; inset: 0; background: rgba(9, 28, 37, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; }
.mask.center { align-items: center; }
.modal { background: #fff; border-radius: 12px; width: 620px; max-width: 100%; box-shadow: 0 30px 70px rgba(3,20,29,.35); animation: pop .16s ease; }
@keyframes pop { from { transform: translateY(-6px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal.lg { width: 900px; }
.modal.xl { width: 1080px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.modal-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.modal-close { border: none; background: none; font-size: 20px; color: #9aabb4; line-height: 1; padding: 0 2px; }
.modal-body { padding: 18px; max-height: calc(100vh - 200px); overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fbfcfd; border-radius: 0 0 12px 12px; }
.drawer { width: 760px; max-width: 100%; margin-left: auto; margin-right: 0; align-self: stretch; }
.drawer .modal-body { max-height: calc(100vh - 150px); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; height: 33px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fbfcfd; outline: none;
}
.field textarea { height: 66px; padding: 8px 9px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(20,125,122,.09); }
.field input.field-error, .field select.field-error, .field textarea.field-error { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 3px rgba(195,63,69,.12); }
.field .tip { font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.check-line { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.check-line input { width: auto; height: auto; }
.check-line span { font-size: 12px; }

.items-editor { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.items-editor.ws-wide { overflow-x: auto; }
.items-editor.ws-wide table { min-width: 2620px; }
.items-editor table { width: 100%; border-collapse: collapse; font-size: 12px; }
.items-editor th { background: #f7fafb; padding: 7px 6px; font-weight: 600; color: #5d7480; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.items-editor td { padding: 5px 4px; border-bottom: 1px solid #eef2f4; vertical-align: middle; }
.items-editor input, .items-editor select { width: 100%; height: 29px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; outline: none; }
.items-editor input:focus, .items-editor select:focus { border-color: var(--accent); }
.items-editor .amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.items-editor .del { border: none; background: none; color: #b6c4ca; font-size: 16px; padding: 0 4px; }
.items-editor .del:hover { color: var(--red); }
.items-editor .ws-pick { flex-wrap: wrap; }
.items-editor .ws-pick .ws-cat { flex: 1 0 100%; }
.items-editor .ws-colored-wrap { display: flex; align-items: center; gap: 3px; margin-top: 3px; font-size: 11px; color: #5d7480; white-space: nowrap; }
.items-editor .ws-colored-wrap input { width: auto; height: auto; }
.items-editor .ws-file-pick { display: flex; gap: 3px; }
.items-editor .ws-file-pick .ws-label { flex: 1; min-width: 0; }
.items-editor .ws-file-pick .ws-label-btn { flex: 0 0 auto; height: 29px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: #5d7480; font-size: 11px; cursor: pointer; }
.items-total { display: flex; justify-content: flex-end; gap: 20px; padding: 9px 12px; background: #f7fafb; font-size: 12px; }
.items-total b { font-size: 15px; color: var(--navy); }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-title { font-size: 18px; font-weight: 600; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.detail-meta b { color: var(--text); font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.detail-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfcfd; }
.detail-box span { display: block; font-size: 10.5px; color: var(--muted); }
.detail-box b { display: block; font-size: 15px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.section-title { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin: 18px 0 8px; color: #33505c; }
.section-title::before { content: ""; width: 3px; height: 12px; background: var(--accent); border-radius: 2px; margin-right: 7px; }
.section-title > span:first-child { flex: 1; }
.timeline { display: grid; gap: 0; }
.tl-item { display: flex; gap: 10px; padding: 7px 0; position: relative; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-main { flex: 1; font-size: 12px; }
.tl-main b { font-weight: 600; }
.tl-main span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab { padding: 8px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 300; display: grid; gap: 8px; }
.toast { background: #153c4b; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 12.5px; box-shadow: 0 10px 30px rgba(3,20,29,.28); animation: toastIn .18s ease; max-width: 360px; }
.toast.err { background: #a83036; }
.toast.ok { background: #146b52; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.note-box { background: var(--gold-soft); border: 1px solid #f0dfbd; color: #7a5a17; padding: 10px 12px; border-radius: 8px; font-size: 11.5px; line-height: 1.7; }
.info-box { background: var(--accent-soft); border: 1px solid #cfe9e6; color: #1d5e5c; padding: 10px 12px; border-radius: 8px; font-size: 11.5px; line-height: 1.7; }

.loading { padding: 60px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 2px solid #dbe5e9; border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 10px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-row { display: flex; gap: 18px; flex-wrap: wrap; }
.stat-row .stat { min-width: 110px; }
.stat-row .stat span { display: block; font-size: 11px; color: var(--muted); }
.stat-row .stat b { display: block; font-size: 18px; margin-top: 2px; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-grid.cols-3, .flow-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .flow-grid, .flow-grid.cols-3, .flow-grid.cols-4 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .nav-toggle { display: flex; }
  .content { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .login-card { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-main { padding: 32px 26px; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; inset: 0; padding: 0; }
  .no-print { display: none !important; }
}

/* 产品图片 / 订单选品 */
.prod-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: block; }
.prod-cell { display: flex; align-items: center; gap: 8px; }
.prod-cell .prod-thumb { width: 34px; height: 34px; flex: none; }
.oi-pick { display: flex; gap: 4px; }
.oi-pick select { flex: 1; min-width: 0; }
.oi-pick .oi-cat { flex: 0 0 82px; }
.oi-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; margin-right: 5px; }
.oi-hint { display: flex; align-items: center; gap: 4px; margin-top: 2px; min-height: 18px; }
.oi-img-td { min-width: 58px; }
.oi-imgbox { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.oi-imgthumb { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: #fff; display: block; }
.oi-imgbox .oi-imgbtn { height: 21px; padding: 0 5px; font-size: 10.5px; line-height: 21px; border: 1px solid var(--line-strong); background: #fff; border-radius: 4px; color: var(--accent); cursor: pointer; white-space: nowrap; }
.oi-imgbox .oi-imgbtn:hover { background: var(--accent-soft); }
.oi-imgbox .oi-imgbtn:disabled { opacity: .55; cursor: default; }
.oi-imgbox .oi-imgclear { position: absolute; top: -4px; right: 0; border: none; background: transparent; color: #a7b7be; font-size: 13px; line-height: 1; padding: 0; cursor: pointer; }
.oi-imgbox .oi-imgclear:hover { color: var(--red); }
.oi-detail-img { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.oi-detail-img .prod-thumb { width: 40px; height: 40px; }
.img-field { display: flex; gap: 12px; align-items: flex-start; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px; background: #fbfcfd; }
.img-preview { width: 96px; height: 96px; flex: none; border-radius: 8px; background: #f1f5f6; display: flex; align-items: center; justify-content: center; color: #93a5ad; font-size: 12px; overflow: hidden; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-actions { display: flex; flex-direction: column; gap: 8px; }
.img-upload { margin: 0; cursor: pointer; }
.img-actions .tip { margin: 0; }

/* 销售表格状态变色：退货质检 */
.grid tbody tr.row-return-pass td { background: #e9f7ee !important; }
.grid tbody tr.row-return-pass:hover td { background: #dcf2e4 !important; }
.grid tbody tr.row-return-wait td { background: #fff7e2 !important; }
.grid tbody tr.row-return-wait:hover td { background: #ffefcc !important; }
.grid tbody tr.row-return-fail td { background: #fdeceb !important; }
.grid tbody tr.row-return-fail:hover td { background: #fbdfdd !important; }
.video-link { display: inline-flex; align-items: center; gap: 4px; color: #0b6bcb; }
.media-box { margin-top: 10px; }
.media-box video { max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); background: #000; }

/* 销售录单表（长期台账） */
.sl-table { min-width: 1180px; }
.sl-table th { white-space: nowrap; }
.sl-table td { padding: 6px 6px; }
.sl-table .sl-input {
  width: 100%; min-width: 0; height: 30px; padding: 4px 7px; font-size: 12.5px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: inherit; outline: none;
}
.sl-table .sl-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sl-table .sl-hint { margin-top: 2px; min-height: 15px; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.sl-table .sl-amount { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent); font-weight: 600; }
.sl-table input[type="date"].sl-input { padding-right: 2px; }
@media (max-width: 1180px) { .sl-table { min-width: 980px; } }

/* 订单流转总表：角色阶段筛选 */
.stage-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-tab { border: 1px solid var(--line-strong); background: #fff; color: #566a72; border-radius: 20px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; }
.stage-tab:hover { border-color: var(--accent); color: var(--accent); }
.stage-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* 客户/销售端分表页面 */
.sheet-body { background: #eef3f4; min-height: 100vh; margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; color: #223; }
.sheet-wrap { max-width: 1080px; margin: 0 auto; padding: 18px 14px 60px; }
.sheet-hero { background: linear-gradient(135deg, #103c4b, #1c6b63); color: #fff; border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.sheet-hero h1 { margin: 0 0 4px; font-size: 20px; }
.sheet-hero p { margin: 0; opacity: .85; font-size: 13px; }
.sheet-card { background: #fff; border-radius: 12px; border: 1px solid #dde6e8; margin-bottom: 14px; overflow: hidden; }
.sheet-card-head { padding: 13px 16px; border-bottom: 1px solid #eef2f4; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet-card-head h2 { margin: 0; font-size: 15px; }
.sheet-card-head .hint { font-size: 12px; color: #7b8f97; margin-top: 2px; }
.sheet-card-body { padding: 14px 16px; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sheet-table th { text-align: left; font-weight: 600; color: #5b7079; font-size: 12px; padding: 8px 6px; border-bottom: 1px solid #e6ecee; white-space: nowrap; }
.sheet-table td { padding: 7px 6px; border-bottom: 1px solid #f0f4f5; vertical-align: middle; }
.sheet-table .num { text-align: right; }
.sheet-input { width: 100%; height: 32px; padding: 4px 8px; border: 1px solid #cfdbe0; border-radius: 7px; font-size: 12.5px; background: #fff; }
.sheet-input:focus { outline: none; border-color: #1c6b63; box-shadow: 0 0 0 2px rgba(28,107,99,.12); }
.sheet-btn { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #cfdbe0; background: #fff; color: #2d4a54; font-size: 13px; cursor: pointer; }
.sheet-btn.primary { background: #1c6b63; border-color: #1c6b63; color: #fff; font-weight: 600; }
.sheet-btn.ghost { border-style: dashed; }
.sheet-btn:disabled { opacity: .55; cursor: default; }
.sheet-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; background: #eef3f4; color: #5b7079; }
.sheet-pill.green { background: #e5f6ec; color: #157347; }
.sheet-pill.gold { background: #fff5e0; color: #a56a00; }
.sheet-pill.red { background: #fdeceb; color: #b02a2a; }
.sheet-pill.blue { background: #e8f1fd; color: #1b5fa8; }
.sheet-empty { padding: 26px; text-align: center; color: #93a5ad; font-size: 13px; }
.sheet-total { text-align: right; font-size: 13px; color: #5b7079; padding-top: 10px; }
.sheet-total b { font-size: 17px; color: #1c6b63; }
.sheet-scroll { overflow-x: auto; }
.sheet-table-wrap { min-width: 760px; }
/* 分表：按标准销售表头填报 */
.sheet-wrap.wide { max-width: 100%; }
.sheet-table-wrap.wide { min-width: 2620px; }
.sheet-head-fields { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sheet-head-fields label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #5b7079; white-space: nowrap; }
.sheet-head-fields .sheet-input { width: auto; min-width: 132px; }
.sheet-head-fields label.grow { flex: 1; min-width: 220px; }
.sheet-head-fields label.grow .sheet-input { flex: 1; width: 100%; }
.sheet-table.entry { table-layout: fixed; min-width: 2620px; }
.sheet-table.entry th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.sheet-table.entry td { padding: 5px 4px; }
.sheet-table.entry .sheet-input { height: 30px; padding: 2px 5px; font-size: 12px; }
.sheet-table.entry .oi-imgthumb { width: 34px; height: 34px; }
.oi-imgthumb[hidden] { display: none; }
.sheet-table.entry .oi-imgbox .oi-imgbtn { height: 19px; padding: 0 4px; font-size: 10px; line-height: 19px; }
.sheet-table.entry .s-colored-wrap { display: flex; align-items: center; gap: 3px; margin-top: 3px; font-size: 11px; color: #5d7480; white-space: nowrap; }
.sheet-table.entry .s-colored-wrap input { width: auto; height: auto; }
.sheet-table.entry .ws-file-pick { display: flex; gap: 3px; }
.sheet-table.entry .ws-file-pick .sheet-input { flex: 1; min-width: 0; }
.sheet-table.entry .s-label-btn { flex: 0 0 auto; height: 30px; padding: 0 6px; border: 1px solid #cfdbe0; border-radius: 7px; background: #fff; color: #5d7480; font-size: 11px; cursor: pointer; }
.sheet-table.entry .s-label-btn:disabled { opacity: .55; cursor: default; }
/* 分表：已发货订单回填信息弹窗 */
.sheet-linkbtn { border: none; background: none; padding: 0; color: #1c6b63; font-size: 11.5px; cursor: pointer; text-decoration: underline; }
.sheet-modal-mask { position: fixed; inset: 0; z-index: 80; background: rgba(15, 35, 42, .46); display: flex; align-items: flex-start; justify-content: center; padding: 38px 14px; overflow-y: auto; }
.sheet-modal { background: #fff; border-radius: 12px; width: 100%; max-width: 860px; box-shadow: 0 24px 60px rgba(15, 40, 48, .28); }
.sheet-modal-head { padding: 14px 18px; border-bottom: 1px solid #eef2f4; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-modal-head h3 { margin: 0; font-size: 16px; color: #223; }
.sheet-modal-head .hint { font-size: 12px; color: #7b8f97; margin-top: 3px; }
.sheet-modal-x { flex: 0 0 auto; width: 30px; height: 30px; border: none; border-radius: 50%; background: #f1f5f6; color: #5b7079; font-size: 18px; line-height: 1; cursor: pointer; }
.sheet-modal-body { padding: 16px 18px 20px; }
.sheet-ship-block { border: 1px solid #e6ecee; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.sheet-ship-block h4 { margin: 0; font-size: 13px; color: #2d4a54; }
.sheet-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 10px 0 2px; }
.sheet-field { background: #f6f9fa; border: 1px solid #e6ecee; border-radius: 9px; padding: 8px 11px; }
.sheet-field span { display: block; font-size: 11.5px; color: #7b8f97; }
.sheet-field b { display: block; margin-top: 2px; font-size: 13px; color: #223; word-break: break-all; }
.sheet-section-title { font-size: 13px; font-weight: 600; color: #2d4a54; margin: 16px 0 8px; }
.sheet-modal-foot { padding: 12px 18px 16px; border-top: 1px solid #eef2f4; display: flex; justify-content: flex-end; gap: 8px; }
.sheet-claim { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 4px; font-size: 11px; color: #5b7079; }
.sheet-claim .muted { color: #93a5ad; }
.sheet-paybtn { margin-top: 5px; border: 1px solid #1c6b63; background: #fff; color: #1c6b63; border-radius: 7px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.sheet-paybtn:hover { background: #1c6b63; color: #fff; }
.sheet-form-grid { display: grid; gap: 12px; }
.sheet-form-grid > label { display: grid; gap: 5px; font-size: 12px; color: #5b7079; }
.sheet-voucher-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet-voucher-row img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid #dde6e8; }
.sheet-voucher-row img[hidden] { display: none; }
.sheet-toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 120; background: #157347; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 9px; box-shadow: 0 10px 26px rgba(15,40,48,.22); max-width: 90vw; }
.sheet-toast.err { background: #b02a2a; }
@media (max-width: 760px) {
  .sheet-table-wrap { min-width: 620px; }
  .sheet-wrap { padding: 12px 10px 50px; }
  .sheet-modal-mask { padding: 14px 8px; }
}

/* ---------------- 共享订单表格 ---------------- */
.og-wrap { border: 1px solid #dfe8ea; border-radius: 12px; background: #fff; overflow: hidden; }
.og-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eef2f4; background: linear-gradient(180deg,#fbfdfd,#f6fafb); }
.og-head b { font-size: 14px; color: #223; }
.og-hint { margin-left: 8px; font-size: 11.5px; color: #7b8f97; }
.og-online { font-size: 11.5px; color: #1c6b63; background: #eaf6f3; border: 1px solid #cfe9e3; border-radius: 999px; padding: 3px 10px; white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.og-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #eef2f4; flex-wrap: wrap; }
.og-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.og-filter { display: grid; gap: 3px; }
.og-filter span { font-size: 10.5px; color: #7b8f97; }
.og-filter input, .og-filter select { height: 30px; border: 1px solid #d8e2e4; border-radius: 7px; padding: 0 7px; font-size: 12px; background: #fff; color: #223; min-width: 92px; }
.og-filter input[type="date"] { min-width: 128px; }
.og-btns { display: flex; gap: 7px; flex-wrap: wrap; }
.og-scroll { overflow: auto; max-height: 68vh; }
.og-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; table-layout: fixed; }
.og-table thead th { position: sticky; top: 0; z-index: 3; background: #f2f7f8; color: #2d4a54; font-weight: 600; text-align: left; padding: 7px 6px; border-bottom: 1px solid #dbe5e7; border-right: 1px solid #e8eef0; white-space: nowrap; cursor: pointer; user-select: none; }
.og-table thead th:last-child { border-right: none; }
.og-table thead th.og-num { text-align: right; }
.og-sort { display: inline-block; width: 0; height: 0; margin-left: 3px; vertical-align: middle; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid #a8b9bf; opacity: .55; }
.og-table tbody td { padding: 2px 3px; border-bottom: 1px solid #eef2f4; border-right: 1px solid #f3f6f7; vertical-align: middle; color: #2c3e45; background: #fff; }
.og-table tbody td:last-child { border-right: none; }
.og-table tbody tr:nth-child(even) td { background: #fbfdfd; }
.og-table tbody tr:hover td { background: #f4faf9; }
.og-table tbody td.og-num, .og-table tbody td.og-index { text-align: right; }
.og-index { color: #93a5ad; font-size: 11px; padding-right: 6px !important; }
.og-input { width: 100%; box-sizing: border-box; border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 5px 5px; font-size: 12px; color: #223; outline: none; min-height: 28px; }
.og-input:hover { border-color: #dbe5e7; background: #fff; }
.og-input:focus { border-color: #1c6b63; background: #fff; box-shadow: 0 0 0 2px rgba(28,107,99,.10); }
.og-input:disabled { color: #6b7f87; background: transparent; cursor: default; }
.og-input.og-saving { background: #fff8e6; }
.og-table td.og-locked { background: #f7f9fa; }
.og-static { padding: 6px !important; }
.og-static b { color: #223; }
.og-actions { white-space: nowrap; padding: 3px !important; }
.og-actions .btn { margin-right: 2px; padding: 2px 5px; font-size: 10.5px; }
.og-empty { text-align: center; color: #93a5ad; padding: 28px 10px !important; }
.og-sum { padding: 8px 10px; font-size: 12px; color: #5b7079; background: #f8fbfb; }
.og-sum b { color: #1c6b63; }
.og-foot { padding: 7px 12px; font-size: 11px; color: #93a5ad; background: #fbfdfd; border-top: 1px solid #eef2f4; }
.og-flash-ok td { animation: ogOk 1s ease; }
.og-flash-warn td { animation: ogWarn 1s ease; }
@keyframes ogOk { 0% { background: #d9f2e6; } 100% { background: inherit; } }
@keyframes ogWarn { 0% { background: #fde2e1; } 100% { background: inherit; } }
.og-loading { opacity: .72; pointer-events: none; }
.og-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 999; background: #157347; color: #fff; font-size: 13px; padding: 9px 15px; border-radius: 9px; box-shadow: 0 10px 26px rgba(15,40,48,.22); max-width: 92vw; }
.og-toast.err { background: #b02a2a; }
.og-mini { font-size: 11px; color: #7b8f97; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.og-badge { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; background: #eef3f5; color: #5b7079; }
.og-badge.green { background: #def3e8; color: #157347; }
.og-badge.blue { background: #e3effb; color: #1d5fa8; }
.og-badge.gold { background: #fdf1d7; color: #986600; }
.og-badge.red { background: #fbe3e2; color: #b02a2a; }
@media (max-width: 760px) {
  .og-head { flex-direction: column; align-items: flex-start; }
  .og-online { max-width: 100%; }
  .og-toolbar { align-items: stretch; }
  .og-btns { justify-content: flex-end; }
  .og-scroll { max-height: 60vh; }
}
.member-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; }
.member-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid #e4ebee; border-radius: 8px; cursor: pointer; background: #fbfdfd; }
.member-row:hover { border-color: #b9d6d1; background: #f4fbf9; }
.member-row input { margin: 0; }
.member-row span { display: flex; flex-direction: column; min-width: 0; }
.member-row b { font-size: 12.5px; color: #223; }
.member-row em { font-style: normal; font-size: 11px; color: #8a9ba2; }
@media (max-width: 760px) { .member-list { grid-template-columns: 1fr; } }
.og-btns .og-op { min-width: 168px; }
.og-btns .og-op input { height: 28px; }
.pub-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.pub-form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #5b7079; }
.pub-form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 700px) { .pub-form-grid { grid-template-columns: 1fr; } }

/* ---------------- 权限矩阵 ---------------- */
.perm-section { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.perm-grid { border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 320px; }
.perm-row { display: grid; grid-template-columns: 1fr 64px 64px; align-items: center; gap: 6px; padding: 6px 12px; border-bottom: 1px solid #f1f5f6; font-size: 12.5px; }
.perm-row:last-child { border-bottom: none; }
.perm-row.perm-head { position: sticky; top: 0; background: #f7fafb; font-weight: 600; color: #5d7480; z-index: 1; }
.perm-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.perm-row input[type="checkbox"]:disabled { opacity: .35; cursor: not-allowed; }

/* ---------------- 手机端适配 ---------------- */
.nav-mask { display: none; }
@media (max-width: 900px) {
  .sidebar { width: 268px; box-shadow: 12px 0 34px rgba(4, 22, 30, .28); }
  .nav-mask.show { display: block; position: fixed; inset: 0; background: rgba(6, 22, 30, .42); z-index: 55; }
  .topbar { height: auto; min-height: 56px; padding: 8px 12px; gap: 8px; }
  .topbar-left { gap: 8px; flex: 1; min-width: 0; }
  .page-title { font-size: 15px; }
  .page-sub { display: none; }
  .topbar-right { gap: 6px; }
  .user-chip { padding: 4px 8px 4px 4px; }
  .user-chip span { display: none; }
  .user-chip b { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .icon-btn { width: 36px; height: 36px; }
  .content { padding: 12px 10px 84px; }
  .card-head { flex-wrap: wrap; align-items: flex-start; }
  .card-head .toolbar { width: 100%; margin-top: 8px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi { padding: 12px; }
  .kpi .k-value { font-size: 20px; }
  .flow-value { font-size: 23px; }
  .flow-card { padding: 13px 14px 0; }
  .flow-subs { gap: 8px; }
  .flow-grid { gap: 9px; }
  .two-col, .three-col, .dash-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.grid { min-width: 720px; }
  table.grid th, table.grid td { padding: 9px 8px; }
  .toolbar { gap: 6px; }
  .search-box input { width: 100%; min-width: 160px; }
  .search-box { flex: 1; }
  select.filter, input.filter { flex: 1; min-width: 120px; }
  .btn { min-height: 34px; }
  .btn-sm { min-height: 30px; height: 30px; }
  .btn-xs { min-height: 26px; height: 26px; }
  .mask { padding: 0; align-items: flex-end; }
  .modal, .modal.lg, .modal.xl { width: 100%; max-height: 94vh; border-radius: 14px 14px 0 0; }
  .modal-body { max-height: calc(94vh - 118px); padding: 14px; }
  .drawer .modal-body { max-height: calc(94vh - 100px); }
  .modal-head, .modal-foot { padding-left: 14px; padding-right: 14px; }
  .login-screen { padding: 12px; align-items: flex-start; }
  .login-card { border-radius: 14px; margin: 12px 0 40px; }
  .login-main { padding: 26px 20px 22px; }
  .login-demo-grid { grid-template-columns: 1fr 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .login-demo-grid { grid-template-columns: 1fr; }
  .perm-row { grid-template-columns: 1fr 56px 56px; padding: 7px 10px; }
  .topbar #quickSale { padding: 0 8px; font-size: 11.5px; }
  .stat-row { gap: 10px; }
  .stat-row > span { width: 100%; }
}
/* 触屏设备统一放大可点击区域，避免误触 */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  .nav-item { min-height: 44px; }
  .btn { min-height: 36px; }
  .btn-sm { min-height: 32px; height: 32px; }
  table.grid td .btn-xs { min-height: 30px; height: 30px; }
}
