:root {
  --bg: #f4f6fa; --card: #fff; --line: #e3e7ef; --text: #1f2933; --muted: #6b7785;
  --primary: #2563eb; --danger: #dc2626; --warn: #d97706; --ok: #16a34a; --side: #172033;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: var(--text);
  background: var(--bg); display: flex; min-height: 100vh; }
.sidebar { width: 190px; background: var(--side); color: #cfd8e6; position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; }
.brand { padding: 18px 16px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid #263149; }
.brand small { font-size: 12px; font-weight: 400; color: #8fa0bb; }
nav a { display: block; padding: 8px 18px; color: #cfd8e6; text-decoration: none; border-left: 3px solid transparent; }
nav a:hover { background: #1f2a42; }
nav a.active { background: #22304d; color: #fff; border-left-color: #60a5fa; }
nav .grp { position: relative; }
nav .grp-head { display: flex; align-items: center; gap: 8px; padding: 12px 34px 8px 14px; font-size: 14px; font-weight: 600;
  color: #dbe5f4; letter-spacing: .5px; cursor: pointer; user-select: none; transition: color .15s; }
nav .grp-head:hover { color: #fff; }
nav .grp-head .chev { flex: none; color: #7f93b3; transition: transform .18s ease, color .18s ease; }
nav .grp.open .grp-head .chev { transform: rotate(90deg); color: #7dd3fc; }
nav .grp.open .grp-head { color: #fff; }
nav .grp.open .grp-head:hover { color: #fff; }
/* 折叠动画：0fr ↔ 1fr，二级菜单整体过渡；折叠后不可聚焦 */
nav .grp-body { display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .2s ease, visibility .2s ease; }
nav .grp.open .grp-body { grid-template-rows: 1fr; visibility: visible; }
nav .grp-body > .grp-inner { overflow: hidden; min-height: 0; }
nav .grp-body a { font-size: 12.5px; padding: 7px 14px 7px 35px; color: #b6c5da; line-height: 1.45; }
nav .grp-body a:hover { color: #fff; }
nav .grp-body a.active { color: #fff; font-weight: 600; }
nav .pin { position: absolute; top: 9px; right: 8px; display: inline-flex; align-items: center; justify-content: center;
  padding: 3px; border: none; background: none; cursor: pointer; color: #7f93b3; line-height: 1; opacity: .55;
  border-radius: 5px; transition: opacity .15s, color .15s, background .15s; }
nav .pin:hover { opacity: 1; color: #fff; background: #24314b; }
nav .pin.on { opacity: 1; color: #7dd3fc; }
nav { overflow-y: auto; flex: 1; }
.base-info { padding: 12px 16px; font-size: 12px; color: #8fa0bb; border-top: 1px solid #263149; }
.base-info .base-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.base-info .base-row b { color: #cfd8e6; }
.base-info .base-today { color: #7dd3fc; }
.base-info .base-sub { font-size: 11px; color: #6f81a0; margin-top: 2px; }
.base-info button.mini { padding: 1px 7px; font-size: 11px; border-radius: 9px; border: 1px solid #34425c;
  background: #1f2a42; color: #cfe0ff; }
.base-info button.mini:hover { background: #26344f; color: #fff; border-color: #4a5d7d; }
.shell { margin-left: 190px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 24px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; }
.topbar .spacer { flex: 1; }
.bell { position: relative; padding: 4px 10px; border: 1px solid #c9d1dd; border-radius: 14px; color: var(--text); }
.bell b { position: absolute; top: -7px; right: -8px; background: var(--danger); color: #fff; font-size: 11px;
  border-radius: 9px; padding: 0 5px; min-width: 18px; text-align: center; }
main { padding: 20px 24px 40px; min-width: 0; }
.app-foot { margin-top: auto; padding: 10px 24px; border-top: 1px solid var(--line); text-align: center; }
.app-ver { font-size: 12px; color: var(--muted); }
.login-ver { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; }
.login { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(400px, 1fr); background: #fff; z-index: 40; }
.login.hidden { display: none; }
.login-hero { position: relative; overflow: hidden; background: #0b1730 url(/static/login-hero.svg) center / cover no-repeat; color: #fff; }
.login-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 18, 38, .78) 0%, rgba(8, 18, 38, .15) 45%, rgba(8, 18, 38, .55) 100%); }
.hero-copy { position: relative; z-index: 1; padding: 56px 64px; max-width: 640px; }
.hero-logo { display: flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: 2px; color: #cfe0ff; }
.hero-logo span { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #22d3ee); color: #fff; font-weight: 800; letter-spacing: 0; }
.hero-copy h1 { margin: 34px 0 12px; font-size: 36px; letter-spacing: 2px; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero-copy p { margin: 0 0 26px; font-size: 16px; color: #d6e4ff; }
.hero-copy ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hero-copy li { padding: 10px 14px; border-radius: 10px; background: rgba(15, 32, 66, .5); border: 1px solid rgba(125, 211, 252, .25); backdrop-filter: blur(4px); color: #dbe8ff; font-size: 13px; }
.hero-copy li b { display: inline-block; min-width: 72px; color: #7dd3fc; margin-right: 6px; }
.login-side { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px; background: linear-gradient(180deg, #f7f9fd, #eef3fb); }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; background: #fff; padding: 38px 36px; border-radius: 16px; box-shadow: 0 18px 50px rgba(23, 46, 92, .12); }
.login-box h2 { margin: 0; font-size: 26px; }
.login-box > p { margin: -10px 0 4px; }
.login-box > label { display: flex; flex-direction: column; gap: 6px; color: #3c4858; font-size: 13px; font-weight: 600; }
.login-input { display: flex; align-items: center; gap: 8px; border: 1px solid #cfd8e6; border-radius: 8px; padding: 0 10px; background: #fbfcfe; transition: border-color .15s, box-shadow .15s; }
.login-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); background: #fff; }
.login-input i { display: flex; color: #8a97ab; font-style: normal; }
.login-input input { flex: 1; border: none; background: transparent; padding: 11px 0; font-size: 14px; outline: none; font-weight: 400; }
.login-input .eye { border: none; background: none; color: var(--primary); font-size: 12px; padding: 4px; }
.login-opts { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #3c4858; }
.login-opts .inline { display: flex; align-items: center; gap: 4px; }
.login-btn { padding: 11px; font-size: 16px; letter-spacing: 6px; border-radius: 8px; background: linear-gradient(90deg, #2563eb, #1d4ed8); }
.login-foot { text-align: center; margin: 0; }
.wx-btn { padding: 11px; font-size: 15px; border-radius: 8px; background: #07c160; border-color: #07c160; color: #fff; }
.wx-btn:hover { background: #06ad56; border-color: #06ad56; color: #fff; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-hero { display: none; } }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 16px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.task-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.task-card.hl { border-left: 4px solid var(--primary); }
.task-card.focus { box-shadow: 0 0 0 2px var(--primary); }
.task-card .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.task-card .actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.progress { display: inline-block; width: 70px; height: 8px; background: #eef1f6; border-radius: 4px; vertical-align: middle; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.gantt { border-collapse: separate; border-spacing: 0; font-size: 11px; }
.gantt th, .gantt td { padding: 0; border-bottom: 1px solid #eef1f6; border-right: 1px solid #f3f5f9; text-align: center; min-width: 22px; height: 26px; }
.gantt th.name, .gantt td.name { position: sticky; left: 0; background: #fff; min-width: 110px; text-align: left; padding: 0 8px; z-index: 2; }
.gantt th { background: #f0f3f8; position: sticky; top: 0; z-index: 1; font-weight: 500; }
.gantt .we { background: #f7f8fb; }
.gantt .today { box-shadow: inset 2px 0 0 #ef4444; }
.gantt .seg { cursor: pointer; color: #fff; }
.gantt .seg.t-act { background: #2563eb; } .gantt .seg.t-plan { background: #93c5fd; color: #1e3a8a; }
.gantt .seg.i-act { background: #059669; } .gantt .seg.i-plan { background: #a7f3d0; color: #065f46; }
.gantt .seg.clash { box-shadow: inset 0 0 0 2px #dc2626; }
.gantt .off-休假 { background: #fde68a; } .gantt .off-非工作日 { background: #e5e7eb; }
.notice-list li { padding: 8px 4px; border-bottom: 1px solid var(--line); list-style: none; cursor: pointer; }
.notice-list li.unread { background: #f0f6ff; }
.notice-list { padding: 0; margin: 0; }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }
h2 { margin: 0 0 14px; font-size: 20px; }
h3 { margin: 0 0 10px; font-size: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.toolbar label { color: var(--muted); }
input, select, textarea { font: inherit; padding: 5px 8px; border: 1px solid #c9d1dd; border-radius: 5px; background: #fff; }
textarea { width: 100%; min-height: 54px; resize: vertical; }
button { font: inherit; padding: 5px 12px; border: 1px solid #c9d1dd; border-radius: 5px; background: #fff; cursor: pointer; }
button:hover { border-color: var(--primary); color: var(--primary); }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: #1d4ed8; color: #fff; }
button.danger { color: var(--danger); border-color: #f1b4b4; }
button.sm { padding: 2px 8px; font-size: 12px; }
button.icon { border: none; font-size: 20px; padding: 0 6px; background: none; }
button.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f0f3f8; font-weight: 600; color: #3c4858; white-space: nowrap; position: sticky; top: 0; }
tr:hover td { background: #fafcff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 6px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; background: #eef1f6; color: #3c4858; }
.badge.red { background: #fde2e2; color: #b91c1c; } .badge.orange { background: #fdecc8; color: #a15c07; }
.badge.green { background: #dcfce7; color: #15803d; } .badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.gray { background: #eceff3; color: #6b7785; }
.muted { color: var(--muted); } .small { font-size: 12px; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.kpi b { display: block; font-size: 24px; } .kpi span { color: var(--muted); font-size: 12px; }
.kpi.red b { color: var(--danger); } .kpi.orange b { color: var(--warn); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* 出差补贴查询：汇总指标与各卡片上下排列（避免与卡片并排挤成窄列） */
#alw { width: 100%; }
.alw-stack { display: flex; flex-direction: column; width: 100%; }
.alw-stack > * { min-width: 0; }
.alw-stack .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr 60px; gap: 8px; align-items: center; }
.bar-track { position: relative; height: 18px; background: #eef1f6; border-radius: 4px; }
.bar-fill { height: 100%; border-radius: 4px; background: #60a5fa; }
.bar-fill.red { background: #ef4444; } .bar-fill.orange { background: #f59e0b; } .bar-fill.green { background: #34d399; }
.bar-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; }
.bar-mark.alert { background: var(--danger); } .bar-mark.near { background: var(--warn); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.info-grid div span { color: var(--muted); margin-right: 6px; }
.info-grid .full { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.form-grid .f { display: flex; flex-direction: column; gap: 3px; }
.form-grid .f.full { grid-column: 1 / -1; } .form-grid .f.half { grid-column: span 2; }
.form-grid label { font-size: 12px; color: var(--muted); }
.form-grid label.req::after { content: " *"; color: var(--danger); }
.form-grid .check { flex-direction: row; align-items: center; gap: 6px; padding-top: 18px; }
.section-title { grid-column: 1 / -1; font-weight: 600; border-bottom: 1px solid var(--line); padding: 6px 0 2px; margin-top: 4px; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start;
  justify-content: center; z-index: 50; overflow: auto; padding: 30px 10px; }
.modal.hidden, .toast.hidden, .hidden { display: none; }
.modal-box { background: #fff; border-radius: 10px; width: min(980px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 16px 18px; max-height: 72vh; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal-err { color: var(--danger); margin-right: auto; white-space: pre-wrap; }
.toast { position: fixed; right: 20px; bottom: 20px; background: #1f2933; color: #fff; padding: 10px 16px; border-radius: 6px; z-index: 60; max-width: 460px; }
.toast.err { background: var(--danger); }
.notice { padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.notice.red { background: #fde2e2; color: #991b1b; } .notice.orange { background: #fef3c7; color: #92400e; }
.notice.blue { background: #e0ecff; color: #1e3a8a; }
.strip { display: flex; flex-wrap: wrap; gap: 2px; }
.strip .d { width: 22px; height: 22px; font-size: 10px; text-align: center; line-height: 22px; border-radius: 3px; background: #eef1f6; color: #6b7785; }
.strip .d.在途 { background: #93c5fd; color: #1e3a8a; } .strip .d.现场 { background: #2563eb; color: #fff; }
.strip .d.休假 { background: #fcd34d; color: #78350f; } .strip .d.非工作日 { background: #d1d5db; color: #374151; }
.legend span { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; font-size: 12px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.member-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; margin-bottom: 6px; }
select { min-width: 0; max-width: 100%; }
.choice-popup { position: fixed; z-index: 55; display: flex; flex-direction: column; gap: 4px; padding: 5px;
  border: 1px solid #bcc8da; border-radius: 7px; background: #fff; box-shadow: 0 5px 20px #13274130; }
.choice-popup input { width: 100%; min-height: 32px; }
.choice-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.choice-list [role=option], .choice-empty { padding: 6px 8px; border-radius: 3px; overflow-wrap: anywhere; }
.choice-list [role=option] { cursor: pointer; }
.choice-list [aria-selected=true] { color: var(--primary); font-weight: 600; }
.choice-list .active, .choice-list [role=option]:not([aria-disabled=true]):hover { background: #e7effc; }
.choice-list [aria-disabled=true], .choice-empty { color: var(--muted); cursor: default; }
@media (pointer: coarse) { .choice-list [role=option] { padding: 10px 8px; } }
.logs li { margin-bottom: 4px; }
svg text { font-size: 11px; fill: #4b5563; }
.matrix td.hot { background: #dbeafe; font-weight: 600; }
.tbar { display: inline-flex; width: 140px; height: 10px; background: #eef1f6; border-radius: 5px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.tbar i { display: block; height: 100%; }
tr.mine td { background: #f5f9ff; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin: 8px 0 12px; }
.check-grid label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
details summary { cursor: pointer; color: var(--primary); margin-bottom: 6px; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.role-card.locked { border-color: #c7d7f5; background: #f8fbff; }
.role-card .head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role-card .head b { font-size: 15px; }
.role-card .perm-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.role-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.perm-group { margin-bottom: 10px; }
.perm-group h4 { margin: 6px 0; font-size: 13px; color: #3c4858; }
.form-grid .hidden, .section-title.hidden { display: none; }
/* 多选与批量操作 */
th.sel, td.sel { width: 34px; min-width: 0 !important; padding-left: 10px; padding-right: 4px; text-align: center; }
th.sel input, td.sel input { width: 16px; height: 16px; margin: 0; vertical-align: middle; cursor: pointer; }
.batch-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 10px;
  background: #eef4ff; border: 1px solid #c7d7f5; border-radius: 6px; }
.batch-bar.hidden { display: none; }
.batch-bar b { color: var(--primary); margin-right: 4px; }
.batch-off { opacity: .45; pointer-events: none; }
.form-grid .f input:disabled, .form-grid .f select:disabled, .form-grid .f textarea:disabled { background: #f3f5f9; color: #9aa5b4; }
/* 点击表头排序：升序 → 降序 → 原顺序 */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--primary); }
th.sortable::after { content: "⇅"; margin-left: 4px; font-size: 10px; opacity: .35; }
th.sort-asc::after { content: "▲"; opacity: 1; color: var(--primary); }
th.sort-desc::after { content: "▼"; opacity: 1; color: var(--primary); }

/* ============================================================ 平板 / 手机适配 */
.nav-btn, .nav-mask, .login-brand { display: none; }
#crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { overflow-y: auto; }
  .login-brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #1e3a8a; }
  .login-brand span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #3b82f6, #22d3ee); color: #fff; font-size: 12px; font-weight: 800; }
}
@media (max-width: 768px) {
  /* 侧边栏改为左侧抽屉 */
  .sidebar { width: 240px; max-width: 82vw; z-index: 45; transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .sidebar { transform: none; box-shadow: 4px 0 24px rgba(0, 0, 0, .3); }
  .nav-open .nav-mask { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 44; }
  body.nav-open { overflow: hidden; }
  nav a { padding: 10px 18px; }
  nav .grp-head { padding: 14px 40px 8px 16px; font-size: 15px; }
  nav .grp-body a { padding: 9px 14px 9px 37px; font-size: 13.5px; }
  nav .pin { top: 10px; padding: 5px; }
  .shell { margin-left: 0; }
  .nav-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 32px; padding: 0; border: none; font-size: 20px; line-height: 1; }
  .topbar { gap: 6px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); }
  .topbar .spacer, .crumb-grp, #who .muted { display: none; }
  #crumb { flex: 1; font-weight: 600; color: var(--text); }
  #who { white-space: nowrap; }
  .topbar > button, .bell { flex: none; }
  main { padding: 12px 10px 28px; }
  .app-foot { padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  h2 { font-size: 17px; }

  /* 宽表格、图表在卡片内横向滑动，不撑破页面 */
  .card { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  th, td { padding: 6px; }
  /* 单元格保底宽度（容得下一个日期），避免中文被压成每行一两个字；编号链接、状态徽标不折行 */
  td { min-width: 6.5em; }
  td.num, td:has(> input:only-child), td:has(> button:only-child) { min-width: 0; }
  td a, td .badge { white-space: nowrap; }
  .line-chart { min-width: 640px; }
  .tbar { width: 100px; }
  .gantt th.name, .gantt td.name { min-width: 92px; padding: 0 6px; }

  .toolbar { gap: 6px; }
  .toolbar input:not([type=checkbox]):not([type=radio]), .toolbar select { flex: 1 1 140px; min-width: 0; max-width: 100%; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; padding: 8px 12px; white-space: nowrap; }

  /* 输入框 16px 防止 iOS 聚焦时自动放大；按钮加大触控区域 */
  input, select, textarea, .login-input input { font-size: 16px; }
  button { padding: 7px 12px; }
  button.sm { padding: 5px 10px; }

  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .f.half { grid-column: 1 / -1; }
  .form-grid .check { padding-top: 0; }
  .info-grid, .role-cards, .check-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi b { font-size: 20px; }
  .bar-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .task-card { padding: 12px; }

  /* 弹窗全屏，标题栏与按钮栏固定 */
  .modal { padding: 0; }
  .modal-box { width: 100%; min-height: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .modal-head { position: sticky; top: 0; z-index: 3; background: #fff; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .modal-body { flex: 1; max-height: none; padding: 12px; }
  .modal-foot { position: sticky; bottom: 0; z-index: 3; background: #fff; flex-wrap: wrap; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .modal-foot .modal-err { flex-basis: 100%; }
  .modal-foot .modal-err:empty { display: none; }
  .modal-foot button { min-width: 84px; }

  .toast { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: none; }

  .login-side { padding: 16px 16px 48px; }
  .login-box { padding: 26px 20px; gap: 14px; box-shadow: 0 10px 30px rgba(23, 46, 92, .1); }
  .login-box h2 { font-size: 22px; }
  .login-opts { flex-wrap: wrap; gap: 6px; }
}

.product-versions { margin-top: 18px; border-top: 1px solid var(--line); }
.product-versions h4 { margin: 12px 0 8px; }
.product-version-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) auto; align-items: end; margin-bottom: 10px; }
.product-version-row input:not([type=checkbox]) { min-width: 0; }
.product-version-actions { display: flex; align-items: center; gap: 8px; min-height: 32px; }
@media (max-width: 768px) {
  .product-version-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
}
