:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #131a2b;
  --ink-2: #46506b;
  --muted: #8892a6;
  --line: #e4e8ef;
  --line-2: #eef1f6;
  --accent: #2f6df6;
  --accent-soft: #eaf0ff;
  --good: #12854a;
  --good-soft: #e6f6ed;
  --warn: #b45309;
  --warn-soft: #fdf1e0;
  --bad: #c22a2a;
  --bad-soft: #fdecec;
  --side: #131a2b;
  --side-ink: #b9c2d8;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }

.boot { padding: 80px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------- login / setup */
.auth-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: linear-gradient(180deg, #131a2b 0%, #1d2740 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border-radius: 16px;
  padding: 32px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-logo {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-family: var(--mono); font-size: 20px; font-weight: 700;
}
.auth-card h1 { font-size: 20px; }
.auth-sub { color: var(--muted); margin: 4px 0 24px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.input, textarea.input, select.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { min-height: 92px; resize: vertical; }
.auth-note { font-size: 12px; color: var(--muted); margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font-weight: 600; font-size: 13px;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { background: #f7f9fc; border-color: #d3d9e4; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #245de0; border-color: #245de0; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { color: var(--bad); border-color: #f0c9c9; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* --------------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side-brand .auth-logo { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
.side-brand b { color: #fff; font-size: 14px; display: block; }
.side-brand span { font-size: 11px; color: #7d89a6; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: var(--side-ink); cursor: pointer; font-size: 13px; border: 0; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: #1d2740; color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.nav-item .badge { margin-left: auto; background: #e34d4d; color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; line-height: 17px; }
.nav-item.active .badge { background: rgba(255,255,255,.28); }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #232e4a; font-size: 12px; color: #7d89a6; }
.side-foot .who { color: #fff; font-weight: 600; margin-bottom: 6px; }
.side-foot .link { background: none; border: 0; color: #98a4c2; cursor: pointer; padding: 0; font-size: 12px; }
.side-foot .link:hover { color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 5;
}
.topbar h2 { font-size: 16px; }
.topbar .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 4px 11px; border-radius: 7px; cursor: pointer;
  font-size: 12px; color: var(--ink-2); font-weight: 600;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.content { padding: 22px; }

/* --------------------------------------------------------------------- cards */
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g23 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.g32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 14px; }
.card-head .hint { font-size: 12px; color: var(--muted); }
.card-head .spacer { flex: 1; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 2px; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi .delta { font-size: 12px; margin-top: 4px; color: var(--muted); }
.kpi .delta.good { color: var(--good); }
.kpi .delta.bad { color: var(--bad); }

/* --------------------------------------------------------------------- table */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th {
  position: sticky; top: 0; background: #fafbfd; color: var(--ink-2); font-weight: 600; font-size: 12px;
  white-space: nowrap; z-index: 1;
}
tbody tr:hover { background: #fafcff; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-strong { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.wide { width: 100%; }

/* ---------------------------------------------------------------------- pills */
.pill {
  display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.pill.ac { background: var(--good-soft); color: var(--good); }
.pill.wa, .pill.re, .pill.ce { background: var(--bad-soft); color: var(--bad); }
.pill.tle, .pill.mle { background: var(--warn-soft); color: var(--warn); }
.pill.pe { background: #eef2ff; color: #4338ca; }
.pill.tag { background: var(--accent-soft); color: #1d4ed8; margin: 1px 3px 1px 0; }
.pill.open { background: var(--warn-soft); color: var(--warn); }
.pill.fixed { background: var(--good-soft); color: var(--good); }
.pill.na, .pill.ignored { background: var(--line-2); color: var(--muted); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.error { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: #1d4ed8; }
.bar { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; min-width: 54px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.good > i { background: var(--good); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

/* --------------------------------------------------------------------- charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-size: 10.5px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.hbar-row { display: grid; grid-template-columns: 88px 1fr 52px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 12.5px; }
.hbar-row .name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.hbar { height: 8px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.hbar > i { display: block; height: 100%; border-radius: 5px; background: var(--bad); }
.hbar.blue > i { background: var(--accent); }

/* ---------------------------------------------------------------------- misc */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 150px; padding: 7px 10px; font-size: 13px; }
.search { position: relative; }
.search .input { padding-left: 30px; min-width: 220px; }
.search:before { content: "⌕"; position: absolute; left: 10px; top: 5px; font-size: 16px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; font-size: 13px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; font-size: 14px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
  border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--ink-2);
  font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

pre.code {
  background: #101728; color: #dbe4ff; border-radius: 10px; padding: 14px 16px; overflow: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.65; margin: 0 0 14px;
  max-height: 420px;
}
pre.code .cm { color: #7f8cae; }
.kv { display: grid; grid-template-columns: 132px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 9px 9px 0; font-size: 13px; color: #1e3a8a; margin-bottom: 14px; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); color: #92400e; }

.msg-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.msg-item.new { border-left: 3px solid var(--accent); }
.msg-item.done { opacity: .72; background: #fbfcfe; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.msg-body { color: var(--ink-2); white-space: pre-wrap; }
.msg-reply { margin-top: 10px; background: var(--good-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; }
.msg-reply b { color: var(--good); font-size: 12px; display: block; margin-bottom: 2px; }

.err-detail { background: #101728; color: #ffd9d9; border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow: auto; }
.err-code { background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; white-space: pre; overflow: auto; max-height: 200px; }

/* --------------------------------------------------------------------- modal */
.mask { position: fixed; inset: 0; background: rgba(15,22,40,.42); display: grid; place-items: center; padding: 20px; z-index: 60; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 940px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { font-size: 15px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.x:hover { color: var(--ink); }

/* --------------------------------------------------------------------- toast */
#toast-root { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast {
  background: #131a2b; color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 13px;
  max-width: 380px; box-shadow: 0 6px 18px rgba(16,24,40,.18);
}
.toast.bad { background: #8f1d1d; }
.toast.good { background: #12693c; }

/* ------------------------------------------------------------------ calendar */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { margin-bottom: 4px; }
.cal-head div { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-grid { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-cell { background: #fff; min-height: 106px; padding: 5px 6px; cursor: pointer; transition: background .12s; }
.cal-cell:hover { background: #fafcff; }
.cal-cell.out { background: #fafbfc; }
.cal-cell.out .cal-num { color: #c4cbd8; }
.cal-cell.today { background: #f1f7ff; box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.cal-cell.today .cal-num { color: var(--accent); }
.cal-more { font-size: 11px; color: var(--muted); margin-top: 2px; }
.chip {
  display: block; font-size: 11px; padding: 1px 5px; border-radius: 4px; margin-top: 3px;
  color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; line-height: 17px;
}
.chip.done { text-decoration: line-through; opacity: .55; }
.agenda-item { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.agenda-item:last-child { border-bottom: 0; }
.agenda-time { font-size: 11.5px; color: var(--muted); width: 46px; flex: none; padding-top: 2px; font-variant-numeric: tabular-nums; }
.agenda-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; margin-top: 6px; }
.agenda-day { font-size: 12px; font-weight: 700; color: var(--ink); padding: 12px 0 4px; }

/* ------------------------------------------------------------------- stickies */
.sticky-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sticky { border-radius: 11px; padding: 12px 14px; border: 1px solid; min-height: 130px; position: relative; display: flex; flex-direction: column; }
.sticky.amber { background: #fff8e6; border-color: #f0dfaf; }
.sticky.green { background: #eefaf1; border-color: #c7e8d2; }
.sticky.blue { background: #eef4ff; border-color: #cfe0fb; }
.sticky.pink { background: #fdeff5; border-color: #f6d3e2; }
.sticky.purple { background: #f4effe; border-color: #ded1f7; }
.sticky.gray { background: #f5f6f8; border-color: #e2e5ea; }
.sticky.pinned { box-shadow: inset 0 0 0 2px var(--accent); }
.sticky h4 { font-size: 13px; margin-bottom: 4px; padding-right: 46px; }
.sticky .text { font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; flex: 1; overflow: hidden; }
.sticky .foot { display: flex; gap: 4px; align-items: center; margin-top: 8px; }
.sticky .foot .when { font-size: 11px; color: var(--muted); margin-right: auto; }
.sticky .tools { position: absolute; right: 8px; top: 8px; display: none; gap: 3px; }
.sticky:hover .tools { display: flex; }
.icon-btn {
  border: 1px solid rgba(0, 0, 0, .08); background: rgba(255, 255, 255, .72); border-radius: 6px;
  width: 22px; height: 22px; line-height: 1; font-size: 11px; cursor: pointer; color: var(--ink-2); padding: 0;
}
.icon-btn:hover { background: #fff; }
.quick-add { display: flex; gap: 8px; margin-bottom: 14px; }
.quick-add .input { flex: 1; }
.swatches { display: flex; gap: 5px; align-items: center; }
.swatch { width: 20px; height: 20px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .1); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--accent); }
.note-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.note-row h4 { font-size: 14px; margin-bottom: 3px; }
.note-row .text { font-size: 13px; color: var(--ink-2); white-space: pre-wrap; max-height: 42px; overflow: hidden; }
.note-row.open .text { max-height: none; }

/* ---------------------------------------------------------------------- inbox */
.inbox-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 14px; align-items: start; }
.inbox-input textarea { min-height: 260px; font-size: 13.5px; line-height: 1.9; font-family: inherit; }
.parsed-item {
  display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fff;
}
.parsed-item .pick { margin-top: 4px; width: 15px; height: 15px; flex: none; accent-color: var(--accent); }
.parsed-item .pi-main { flex: 1; min-width: 0; }
.parsed-item .pi-title { font-weight: 600; font-size: 13.5px; }
.parsed-item .pi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.parsed-item.strike { opacity: .45; }
.conf { font-size: 11px; padding: 0 6px; border-radius: 20px; line-height: 17px; background: var(--good-soft); color: var(--good); flex: none; }
.conf.mid { background: var(--warn-soft); color: var(--warn); }
.conf.low { background: var(--line-2); color: var(--muted); }
.example { font-size: 12.5px; color: var(--ink-2); background: #fafbfd; border: 1px dashed var(--line); border-radius: 8px; padding: 9px 12px; line-height: 1.8; }
.ai-badge { font-size: 11.5px; padding: 1px 8px; border-radius: 20px; background: var(--accent-soft); color: #1d4ed8; }

@media (max-width: 1180px) {
  .cal-layout, .inbox-layout { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g23, .g32 { grid-template-columns: 1fr; }
}
/* ============================== 移动端（手机） ============================== */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side-brand { padding: 0 8px 0 2px; flex: none; }
  .side-brand span { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav-item { width: auto; white-space: nowrap; padding: 7px 10px; font-size: 13px; }
  .nav-item .ico { display: none; }
  .side-foot { display: none; }
  .g2 { grid-template-columns: 1fr; }
  .content { padding: 12px 10px 90px; }
  .split { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar h2 { font-size: 15px; }
  /* 弹窗：满屏化 */
  .mask { padding: 0; align-items: end; }
  .modal { max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal.wide { max-width: 100%; }
  .modal-body { padding: 14px; }
  .modal-foot { position: sticky; bottom: 0; background: #fff; }
  /* 表格：允许横向滑动而不是撑破布局 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 12.5px; }
  th, td { padding: 8px 9px; }
  /* 日历：压缩格子 */
  .cal-cell { min-height: 64px; padding: 3px 3px; }
  .cal-num { font-size: 11px; }
  .chip { font-size: 10px; padding: 1px 3px; line-height: 15px; margin-top: 2px; }
  .cal-head div { font-size: 11px; }
  /* 工具栏与搜索框 */
  .toolbar { gap: 6px; }
  .toolbar .input { min-width: 0; width: 100%; }
  .search .input { min-width: 0; width: 100%; }
  .search { width: 100%; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .btn { flex: none; }
  .quick-add { flex-direction: column; }
  .sticky-grid { grid-template-columns: 1fr; }
  /* 速记区 */
  .inbox-input textarea { min-height: 160px; }
  .parsed-item { padding: 9px 10px; }
  /* 消息 */
  .msg-head { gap: 5px; }
  .msg-item { padding: 12px; }
  /* 登录页 */
  .auth-card { padding: 22px 18px; }
}

@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi .value { font-size: 20px; }
  .kpi .delta { font-size: 11px; }
  .card { padding: 12px; border-radius: 10px; }
  .content { padding: 10px 8px 80px; }
  .topbar { height: 50px; padding: 0 10px; }
  .topbar .seg button { padding: 4px 7px; font-size: 11px; }
  .topbar [data-refresh] { padding: 4px 8px; font-size: 12px; }
  /* KPI 紧凑 */
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 表格再紧凑 + 序号列窄化 */
  table { font-size: 12px; }
  th, td { padding: 7px 8px; }
  /* 日历格子显示更多信息的方式：点击为准，格子只留数字+点 */
  .cal-cell { min-height: 52px; }
  .chip { font-size: 9px; padding: 0 2px; line-height: 14px; }
  .cal-more { font-size: 9px; }
  /* 表单弹窗内字段全宽 */
  .split { grid-template-columns: 1fr; }
  /* 底部操作条：让"写入/保存"类按钮随手可及 */
  .content::after { content: none; }
  .tabs button { padding: 8px 10px; font-size: 12.5px; }
  .swatches { flex-wrap: wrap; }
}

/* 超窄屏（小手机） */
@media (max-width: 380px) {
  .g4 { grid-template-columns: 1fr; }
  .topbar h2 { font-size: 14px; }
}

/* iOS 聚焦输入框时不自动放大（需 ≥16px） */
@media (max-width: 900px) {
  .input, select.input, textarea.input { font-size: 16px; }
  .toolbar .input { font-size: 16px; }
}
