/* =========================================================
   心定心理 OA · 模版二「靛」
   扁平、极简：纯色色带 + 白色纸面，不用渐变和装饰性阴影
   靛蓝 #3538cd 承担结构，暖黄 #ffc83d 只标记“当前 / 主要动作”
   ========================================================= */
:root {
  --brand: #3538cd;
  --brand-d: #2b2eb3;
  --brand-dd: #1f2190;
  --brand-1: #e9eaff;
  --brand-05: #f4f5ff;
  --sun: #ffc83d;
  --sun-d: #f2b60c;

  --ink: #12131a;
  --ink-2: #4a4f5e;
  --ink-3: #717686;
  --ink-4: #a6abb8;
  --ground: #f2f3f6;
  --paper: #ffffff;
  --fill: #f1f2f5;
  --fill-2: #e6e8ee;
  --line: #e2e4ea;
  --line-2: #eef0f3;
  --hover: #f7f8fa;

  --danger: #d93f3f;
  --danger-1: #fdecec;
  --warn: #d97400;
  --ok: #16864a;
  --info: #2f6fed;

  /* 页面脚本里少量行内样式沿用的旧变量名，映射到新色板 */
  --teal: var(--brand);
  --teal-7: var(--brand);
  --teal-dd: var(--ink);
  --leaf: var(--brand);
  --leaf-d: var(--ok);

  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --num: "DIN Alternate", "Bahnschrift", "DIN Condensed", "Roboto Condensed", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;

  --gutter: clamp(16px, 3.4vw, 56px);
  --mast-h: 64px;
  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --float: 0 12px 32px rgba(18, 19, 26, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted, .dim { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd0d9; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #a9adb9; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ico.sm { width: 15px; height: 15px; vertical-align: -3px; }
.ico.lg { width: 24px; height: 24px; }

/* ---------------- 框架：顶部导航 ---------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.masthead { position: sticky; top: 0; z-index: 30; height: var(--mast-h); background: var(--brand); color: #fff; display: flex; align-items: stretch; gap: 36px; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 19px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.nav a { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 14px; color: rgba(255, 255, 255, .74); font-size: 15px; white-space: nowrap; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.active { color: #fff; font-weight: 700; }
.nav a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 4px; background: var(--sun); }
.nav .badge { font-family: var(--num); font-style: normal; font-size: 12px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; border-radius: 9px; background: var(--sun); color: var(--ink); }
.mast-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.today { text-align: right; font-size: 12px; line-height: 1.35; color: rgba(255, 255, 255, .7); white-space: nowrap; margin-right: 6px; }
.today .clock { color: #fff; font-size: 13px; font-family: var(--num); letter-spacing: .3px; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: var(--r); background: transparent; color: rgba(255, 255, 255, .8); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.masthead :focus-visible { outline-color: var(--sun); }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 22px; cursor: pointer; }
.user-chip:hover { background: rgba(255, 255, 255, .12); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-1); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.masthead .avatar { background: #fff; }
.user-chip .who { line-height: 1.25; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 600; }
.user-chip .who small { font-size: 11px; color: rgba(255, 255, 255, .66); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: 48px; }
.content > :where(:not(.page-head, .journey, .daystrip, .hero, .subtabs, .batchbar)) { margin: 20px var(--gutter) 0; }
.foot { padding: 18px var(--gutter) 26px; font-size: 12px; color: var(--ink-3); }

/* ---------------- 色带：页面标题区 ---------------- */
.page-head { background: var(--brand); color: #fff; display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 30px var(--gutter) 30px; }
.page-title { margin: 0; font-size: 36px; line-height: 1.15; font-weight: 800; letter-spacing: 1px; }
.page-desc { margin-top: 8px; font-size: 14px; color: rgba(255, 255, 255, .72); max-width: 62ch; }
.page-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-head .btn { height: 40px; padding: 0 18px; background: transparent; border-color: rgba(255, 255, 255, .42); color: #fff; }
.page-head .btn:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.page-head .btn-primary { background: var(--sun); border-color: var(--sun); color: var(--ink); font-weight: 700; }
.page-head .btn-primary:hover { background: var(--sun-d); border-color: var(--sun-d); }
.page-head .search-box .ico { color: rgba(255, 255, 255, .7); top: 11px; }
.page-head .input { height: 40px; background: rgba(255, 255, 255, .14); color: #fff; }
.page-head .input::placeholder { color: rgba(255, 255, 255, .6); }
.page-head .input:focus { background: rgba(255, 255, 255, .2); border-color: #fff; }
.page-head :focus-visible, .journey :focus-visible, .daystrip :focus-visible, .hero :focus-visible, .subtabs :focus-visible { outline-color: var(--sun); }

.subtabs { background: var(--brand); display: flex; gap: 4px; padding: 0 var(--gutter); margin-top: -8px; overflow-x: auto; }
.subtabs a { position: relative; padding: 12px 16px 16px; color: rgba(255, 255, 255, .74); font-size: 15px; white-space: nowrap; }
.subtabs a:first-child { padding-left: 0; }
.subtabs a:hover { color: #fff; text-decoration: none; }
.subtabs a.on { color: #fff; font-weight: 700; }
.subtabs a.on::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 4px; background: var(--sun); }
.subtabs a:first-child.on::after { left: 0; }

/* ---------------- 按钮 ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: var(--r); border: 1.5px solid transparent; background: var(--fill); color: var(--ink); cursor: pointer; white-space: nowrap; font-size: 14px; font-weight: 500; line-height: 1; user-select: none; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--fill-2); }
.btn[disabled], .btn.is-disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--brand-d); }
.btn-dark { background: var(--ink); color: #fff; font-weight: 600; }
.btn-dark:hover { background: #2b2d38; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-05); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-1); }
.btn-danger.solid { background: var(--danger); color: #fff; }
.btn-danger.solid:hover { background: #c23232; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: var(--r-sm); gap: 4px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }

/* ---------------- 表单：填充式输入框 ---------------- */
.input, .select, .textarea { height: 36px; width: 100%; min-width: 0; padding: 0 12px; border: 1.5px solid transparent; border-radius: var(--r); background: var(--fill); font-size: 14px; transition: background .12s, border-color .12s; }
.textarea { height: auto; min-height: 88px; padding: 9px 12px; line-height: 1.65; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a4f5e' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover, .textarea:hover { background-color: var(--fill-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; background-color: #fff; border-color: var(--brand); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input[readonly], .textarea[readonly] { color: var(--ink-2); }
.input:disabled, .select:disabled { opacity: .55; cursor: not-allowed; }
.input.sm, .select.sm { height: 30px; font-size: 13px; }
.is-invalid { border-color: var(--danger) !important; background-color: #fff !important; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field .req::after { content: " *"; color: var(--danger); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.field-err { font-size: 12px; color: var(--danger); }
.field-err:empty { display: none; }
.form-grid { display: grid; gap: 16px 16px; grid-template-columns: repeat(12, 1fr); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.form-sec { font-size: 16px; font-weight: 800; margin: 2px 0 14px; padding-left: 12px; border-left: 4px solid var(--sun); line-height: 1.2; }
.form-sec + .form-grid { margin-bottom: 28px; }
.inline-row { display: flex; gap: 8px; align-items: center; }
.inline-row > * { flex: 1; }
.inline-row > .sep { flex: none; color: var(--ink-3); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13px; color: var(--ink-2); height: 36px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 22px; border-radius: 11px; background: #cdd0d9; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch .on-text { display: none; color: var(--ink); font-weight: 600; }
.switch input:checked ~ .on-text { display: inline; }
.switch input:checked ~ .off-text { display: none; }

.ck { position: relative; display: inline-flex; width: 18px; height: 18px; flex: none; cursor: pointer; vertical-align: middle; }
.ck input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ck span { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid #b4b9c6; background: #fff; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.ck input:checked + span, .ck input:indeterminate + span { background: var(--brand); border-color: var(--brand); }
.ck input:checked + span::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.ck input:indeterminate + span::after { content: ""; width: 8px; height: 2px; background: #fff; }
.ck input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ck input:disabled + span { opacity: .5; }

.seg { display: inline-flex; background: var(--fill); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 4px; cursor: pointer; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------------- 纸面 ---------------- */
.panel { background: var(--paper); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: baseline; gap: 12px; padding: 22px 24px 0; }
.panel-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.panel-head .sub { font-size: 13px; color: var(--ink-3); }
.panel-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; align-self: center; }
.panel-body { padding: 18px 24px 24px; }

.pill { --c: var(--ink-2); display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; white-space: nowrap; color: color-mix(in srgb, var(--c) 78%, #000); background: color-mix(in srgb, var(--c) 14%, #fff); }
.yn { font-size: 13px; }
.yn.y { color: var(--ok); font-weight: 700; }
.yn.n { color: var(--ink-4); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.tag.risk { background: var(--danger-1); color: var(--danger); }

/* ---------------- 访客旅程（色带内的大数字） ---------------- */
.journey { background: var(--brand); display: flex; gap: 0; padding: 0 var(--gutter); overflow-x: auto; }
.journey button { flex: 1 0 auto; min-width: 96px; border: 0; background: transparent; cursor: pointer; text-align: left; color: #fff; padding: 6px 18px 16px 0; border-bottom: 5px solid transparent; }
.journey .j-n { display: block; font-family: var(--num); font-size: 40px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.journey .j-l { display: block; margin-top: 2px; font-size: 13px; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.journey button:hover .j-l { color: #fff; }
.journey button.on { border-bottom-color: var(--sun); }
.journey button.on .j-n { color: var(--sun); }
.journey button.on .j-l { color: #fff; font-weight: 600; }
.journey .all { flex: 0 0 auto; min-width: 128px; margin-right: 28px; border-right: 1px solid rgba(255, 255, 255, .2); }

/* ---------------- 筛选 ---------------- */
.filterbar { background: var(--paper); border-radius: var(--r-lg); }
.filter-quick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 20px; }
.search-box { position: relative; flex: 1 1 280px; max-width: 380px; }
.search-box .ico { position: absolute; left: 12px; top: 10px; color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-left: 36px; }
.filter-quick .select { width: auto; min-width: 118px; }
.filter-quick .spacer { flex: 1; }
.filter-more { border-top: 1px solid var(--line-2); padding: 20px 20px 4px; display: none; }
.filterbar.open .filter-more { display: block; }
.fgroup { display: grid; grid-template-columns: 84px 1fr; gap: 12px; margin-bottom: 16px; align-items: start; }
.fgroup-t { font-size: 13px; font-weight: 800; padding-top: 26px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 12px; }
.fitem { display: flex; flex-direction: column; gap: 4px; }
.fitem > span { font-size: 12px; color: var(--ink-3); }
.fitem.w2 { grid-column: span 2; }
.fitem .input, .fitem .select { height: 34px; font-size: 13px; }
.filter-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 0 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 16px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: var(--r-sm); background: var(--brand-1); font-size: 12px; color: var(--brand-dd); }
.chip b { font-weight: 700; }
.chip button { width: 20px; height: 20px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--brand); }
.chip button:hover { background: rgba(53, 56, 205, .14); }
.chip-clear { font-size: 12px; color: var(--ink-3); background: none; border: 0; cursor: pointer; padding: 0 6px; }
.chip-clear:hover { color: var(--danger); }
.more-toggle .count { font-family: var(--num); background: var(--brand); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; height: 17px; line-height: 17px; }

/* ---------------- 数据表 ---------------- */
.table-panel { background: var(--paper); border-radius: var(--r-lg); overflow: hidden; }
.table-tools { display: flex; align-items: center; gap: 8px; padding: 16px 20px 12px; flex-wrap: wrap; }
.table-tools .total { font-size: 14px; color: var(--ink-2); }
.table-tools .total b { font-family: var(--num); color: var(--ink); font-size: 24px; font-weight: 700; margin: 0 3px; vertical-align: -2px; }
.table-tools .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.table-tools .right label { white-space: nowrap; }
.tbl-scroll { overflow: auto; max-height: calc(100vh - var(--mast-h) - 150px); min-height: 300px; position: relative; }
table.dt { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.dt th, .dt td { padding: 0 12px; height: 50px; border-bottom: 1px solid var(--line-2); white-space: nowrap; text-align: left; background: var(--paper); }
.dt th:first-child, .dt td:first-child { padding-left: 20px; }
.dt th:last-child, .dt td:last-child { padding-right: 20px; }
.dt thead th { position: sticky; top: 0; z-index: 3; height: 42px; color: var(--ink-3); font-weight: 600; font-size: 12px; border-bottom: 2px solid var(--ink); }
.dt thead th.sortable { cursor: pointer; }
.dt thead th.sortable:hover { color: var(--ink); }
.dt thead th .sort-ind { opacity: .4; margin-left: 3px; font-size: 10px; }
.dt thead th.sorted { color: var(--ink); }
.dt thead th.sorted .sort-ind { opacity: 1; color: var(--brand); }
.dt .sl, .dt .sr { position: sticky; z-index: 2; }
.dt thead .sl, .dt thead .sr { z-index: 4; }
.dt .sl.edge { border-right: 1px solid var(--line); }
.dt .sr.edge { border-left: 1px solid var(--line); }
.dt tbody tr:hover td { background: var(--hover); }
.dt tbody tr.sel td { background: var(--brand-05); }
.dt td.name { font-weight: 700; font-size: 14px; cursor: pointer; }
.dt td.name:hover { color: var(--brand); }
.dt td.name .tag { margin-left: 5px; }
.dt tbody tr.locked td.name { color: var(--ink-3); }
.dt .cell-edit { cursor: pointer; }
.dt tbody tr .cell-edit:hover { background: var(--brand-1); }
.dt .staff { color: var(--ink-2); }
.dt .staff.none { color: var(--ink-4); }
.dt .ops { display: flex; gap: 2px; }
.dt .ops .btn { background: transparent; color: var(--brand); padding: 0 7px; font-size: 13px; font-weight: 600; }
.dt .ops .btn:hover { background: var(--brand-1); }
.dt .ops .btn-danger { color: var(--danger); }
.dt .ops .btn-danger:hover { background: var(--danger-1); }
.dt .ellip { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 64px 20px; text-align: center; color: var(--ink-3); }
.empty .ico { width: 44px; height: 44px; color: var(--ink-4); stroke-width: 1.3; }
.empty p { margin: 10px 0 16px; }

.pager { display: flex; align-items: center; gap: 4px; padding: 14px 20px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.pager .pg { min-width: 32px; height: 32px; border: 0; background: transparent; border-radius: var(--r); cursor: pointer; padding: 0 8px; font-family: var(--num); font-size: 14px; }
.pager .pg:hover:not([disabled]) { background: var(--fill); }
.pager .pg.on { background: var(--ink); color: #fff; font-weight: 700; }
.pager .pg[disabled] { opacity: .3; cursor: not-allowed; }
.pager .gap { padding: 0 2px; color: var(--ink-3); }
.pager .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pager .select { width: auto; height: 32px; font-size: 13px; }
.pager .input { width: 56px; height: 32px; text-align: center; }

.batchbar { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; border-radius: var(--r-lg); display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 20px; z-index: 40; max-width: calc(100vw - 32px); overflow-x: auto; opacity: 0; visibility: hidden; transition: transform .25s var(--ease), opacity .2s, visibility .25s; }
.batchbar.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.batchbar .cnt { font-size: 13px; white-space: nowrap; margin-right: 10px; }
.batchbar .cnt b { font-family: var(--num); color: var(--sun); font-size: 20px; margin: 0 2px; vertical-align: -1px; }
.batchbar .btn { background: transparent; color: #fff; height: 34px; }
.batchbar .btn:hover { background: rgba(255, 255, 255, .14); }
.batchbar .btn.danger { color: #ff9c9c; }

/* ---------------- 弹层 ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(18, 19, 26, .56); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .18s; }
.overlay.show { opacity: 1; }
.modal { background: var(--paper); border-radius: 12px; width: 560px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; transform: translateY(12px); transition: transform .2s var(--ease); }
.overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 26px 28px 6px; }
.modal-head h3 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.25; }
.modal-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.modal-x { margin-left: auto; width: 34px; height: 34px; border: 0; background: var(--fill); border-radius: 50%; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; flex: none; }
.modal-x:hover { background: var(--fill-2); color: var(--ink); }
.modal-body { padding: 18px 28px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 28px 26px; }
.modal-foot .btn { height: 40px; padding: 0 22px; }
.modal-foot .left { margin-right: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12px; }

.drawer-mask { position: fixed; inset: 0; background: rgba(18, 19, 26, .44); z-index: 90; opacity: 0; transition: opacity .2s; }
.drawer-mask.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(860px, 100vw); background: var(--ground); z-index: 91; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s var(--ease); }
.drawer.show { transform: none; }
.drawer-head { background: var(--brand); color: #fff; padding: 26px 30px 0; }
.drawer-head :focus-visible { outline-color: var(--sun); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 30px 36px; }

.pop, .menu { position: fixed; z-index: 120; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--float); }
.pop { padding: 14px; min-width: 220px; opacity: 0; transform: translateY(-4px); transition: opacity .14s, transform .14s; }
.pop.show { opacity: 1; transform: none; }
.pop-title { font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.pop .opt-list { display: flex; flex-direction: column; gap: 2px; max-height: min(400px, 60vh); overflow-y: auto; margin: 0 -6px; }
.pop .opt { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: var(--r); cursor: pointer; font-size: 13px; }
.pop .opt:hover { background: var(--fill); }
.pop .opt.on { background: var(--brand-1); color: var(--brand-dd); font-weight: 700; }
.pop .opt .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.menu { padding: 6px; min-width: 176px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 9px 12px; border-radius: var(--r); cursor: pointer; font-size: 14px; text-align: left; }
.menu button:hover { background: var(--fill); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 4px; }
.tip { position: fixed; z-index: 130; background: var(--ink); color: rgba(255, 255, 255, .86); font-size: 12px; padding: 9px 12px; border-radius: var(--r); max-width: 380px; line-height: 1.65; pointer-events: none; }
.tip b { color: #fff; }

.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: var(--r); padding: 12px 18px; font-size: 14px; pointer-events: auto; animation: toastIn .22s var(--ease); }
.toast .ico { color: #6fe3a5; }
.toast.err .ico { color: #ff9c9c; }
.toast.warn .ico, .toast.info .ico { color: var(--sun); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.loading-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--sun); z-index: 300; width: 0; transition: width .3s; }
.spin { width: 20px; height: 20px; border: 2.5px solid var(--fill-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.lightbox { position: fixed; inset: 0; background: rgba(18, 19, 26, .92); z-index: 300; display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 90vh; }

/* ---------------- 访客档案抽屉 ---------------- */
.vd-top { display: flex; align-items: flex-start; gap: 16px; }
.vd-avatar { width: 56px; height: 56px; border-radius: var(--r-lg); background: #fff; color: var(--brand); display: grid; place-items: center; font-size: 26px; font-weight: 800; flex: none; }
.vd-name { font-size: 28px; font-weight: 800; line-height: 1.2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vd-name .tag { background: rgba(255, 255, 255, .16); color: #fff; }
.vd-name .tag.risk { background: var(--sun); color: var(--ink); font-weight: 700; }
.vd-meta { color: rgba(255, 255, 255, .76); font-size: 13px; margin-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; }
.vd-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.vd-actions .btn { background: rgba(255, 255, 255, .14); color: #fff; }
.vd-actions .btn:hover { background: rgba(255, 255, 255, .26); }
.vd-flags { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.flag { display: flex; align-items: center; gap: 9px; text-align: left; padding: 9px 14px; border: 0; border-radius: var(--r); background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; font-size: 13px; }
.flag:hover { background: rgba(255, 255, 255, .22); }
.flag small { display: block; font-size: 11px; line-height: 1.2; color: rgba(255, 255, 255, .7); }
.flag b { display: block; font-size: 13px; line-height: 1.4; font-weight: 600; }
.flag .pill { margin-top: 2px; height: 20px; }
.flag.overdue b { color: var(--sun); }
.tabs { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; }
.tabs button { position: relative; border: 0; background: transparent; padding: 12px 14px 16px; cursor: pointer; color: rgba(255, 255, 255, .74); font-size: 15px; white-space: nowrap; }
.tabs button:first-child { padding-left: 0; }
.tabs button:hover { color: #fff; }
.tabs button.on { color: #fff; font-weight: 700; }
.tabs button.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 4px; background: var(--sun); }
.tabs button:first-child.on::after { left: 0; }
.tabs button .n { font-family: var(--num); font-size: 12px; margin-left: 5px; opacity: .8; }

.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--paper); border-radius: var(--r-lg); padding: 6px 22px; margin: 0; }
.kv > div { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.kv > div:nth-last-child(-n+3) { border-bottom: 0; }
.kv dt { font-size: 12px; color: var(--ink-3); }
.kv dd { margin: 3px 0 0; font-size: 15px; font-weight: 500; word-break: break-all; }
.kv dd .dim { font-weight: 400; color: var(--ink-4); }
.sec-t { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin: 28px 0 12px; }
.sec-t:first-child { margin-top: 0; }
.sec-t .tools { margin-left: auto; display: flex; gap: 6px; }
.textbox { background: var(--paper); border-radius: var(--r-lg); padding: 16px 20px; white-space: pre-wrap; min-height: 52px; font-size: 15px; line-height: 1.75; }
.textbox.empty-t { color: var(--ink-3); }
.modal .textbox { background: var(--fill); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--brand)); }
.tl-head { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.tl-head b { color: var(--ink); font-weight: 700; font-size: 13px; }
.tl-body { background: var(--paper); border-radius: var(--r); padding: 10px 14px; margin-top: 5px; font-size: 14px; white-space: pre-wrap; }
.modal .tl-body { background: var(--fill); }
.tl-empty { color: var(--ink-3); font-size: 13px; padding: 4px 0 10px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.rte { border-radius: var(--r-lg); background: var(--fill); overflow: hidden; }
.rte-bar { display: flex; gap: 4px; padding: 8px; flex-wrap: wrap; align-items: center; }
.rte-bar .btn { background: #fff; }
.rte-bar .hint { margin-left: auto; font-size: 12px; color: var(--ink-3); padding-right: 6px; }
.rte-area { min-height: 260px; max-height: 52vh; overflow-y: auto; margin: 0 8px 8px; padding: 14px 16px; outline: none; line-height: 1.75; background: #fff; border-radius: var(--r); }
.rte-area img { max-width: 100%; display: block; margin: 6px 0; }
.rte-area:empty::before { content: attr(data-ph); color: var(--ink-4); }
.chat-view { background: var(--paper); border-radius: var(--r-lg); padding: 18px 20px; min-height: 120px; line-height: 1.75; font-size: 15px; }
.chat-view img { max-width: 100%; display: block; margin: 6px 0; cursor: zoom-in; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.g-item { position: relative; border-radius: var(--r); overflow: hidden; background: var(--fill); }
.drawer .g-item { background: var(--paper); }
.g-item img { width: 100%; height: 120px; object-fit: cover; display: block; cursor: zoom-in; }
.g-item .g-bar { display: flex; align-items: center; gap: 6px; padding: 7px 8px; font-size: 12px; color: var(--ink-2); }
.g-item .g-bar .input { height: 26px; width: 64px; font-size: 12px; padding: 0 6px; background: #fff; }
.g-item.del { opacity: .4; }
.g-item.del img { filter: grayscale(1); }
.g-add { border: 2px dashed #c3c7d2; border-radius: var(--r); min-height: 160px; display: grid; place-items: center; text-align: center; color: var(--ink-3); cursor: pointer; font-size: 13px; }
.g-add:hover, .g-add.drag { border-color: var(--brand); color: var(--brand); background: var(--brand-05); }
.g-queue img { height: 100px; }
.g-state { font-size: 11px; }

.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-dates button { height: 28px; padding: 0 11px; border-radius: var(--r-sm); border: 0; background: var(--fill); cursor: pointer; font-size: 12px; color: var(--ink-2); }
.quick-dates button:hover { background: var(--brand-1); color: var(--brand-dd); }
.quick-dates button.on { background: var(--brand); color: #fff; }
.quick-dates .grp { width: 100%; font-size: 11px; color: var(--ink-3); margin-top: 4px; }

/* ---------------- 汇总页 ---------------- */
.daystrip { background: var(--brand); display: flex; gap: 8px; padding: 0 var(--gutter) 30px; overflow-x: auto; }
.day { flex: 0 0 auto; min-width: 118px; border: 0; background: rgba(255, 255, 255, .11); color: #fff; border-radius: var(--r); padding: 12px 16px 12px; cursor: pointer; text-align: left; transition: background .12s; }
.day:hover { background: rgba(255, 255, 255, .2); }
.day .d-w { font-size: 12px; color: rgba(255, 255, 255, .72); }
.day .d-d { font-family: var(--num); font-size: 20px; font-weight: 700; line-height: 1.3; }
.day .d-n { font-size: 12px; color: rgba(255, 255, 255, .72); }
.day .d-n b { font-family: var(--num); color: #fff; font-size: 15px; }
.day.on { background: #fff; color: var(--ink); }
.day.on .d-w, .day.on .d-n { color: var(--ink-3); }
.day.on .d-n b { color: var(--brand); }
.day.custom { display: flex; flex-direction: column; justify-content: center; gap: 6px; cursor: default; }
.day.custom .input { height: 32px; width: 150px; background: #fff; color: var(--ink); }
.sum-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.content > .sum-head { margin-top: 28px; }
.sum-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.sum-head .stat { font-size: 14px; color: var(--ink-2); }
.sum-head .stat b { font-family: var(--num); color: var(--brand); font-size: 22px; margin: 0 2px; vertical-align: -1px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.content > .cards { margin-top: 16px; }
.vcard { background: var(--paper); border-radius: var(--r-lg); display: flex; flex-direction: column; outline: 2px solid transparent; outline-offset: -2px; }
.vcard.active { outline-color: var(--brand); }
.vc-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 12px; }
.vc-head .avatar { width: 40px; height: 40px; border-radius: var(--r); font-size: 16px; }
.vc-name { font-weight: 800; font-size: 18px; line-height: 1.3; cursor: pointer; }
.vc-name:hover { color: var(--brand); }
.vc-sub { font-size: 12px; color: var(--ink-3); }
.vc-head .pill { margin-left: auto; }
.vc-body { padding: 4px 22px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px; font-size: 13px; }
.vc-body .k { color: var(--ink-3); margin-right: 2px; }
.vc-body .full { grid-column: 1 / -1; }
.vc-staff span { display: inline-block; white-space: nowrap; margin-right: 12px; }
.vc-body .note { background: var(--fill); border-radius: var(--r); padding: 8px 12px; color: var(--ink-2); margin-top: 6px; max-height: 68px; overflow: hidden; white-space: pre-wrap; font-size: 12px; }
.vc-times { margin: 0 22px; padding: 12px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-3); }
.vc-times b { font-weight: 600; color: var(--ink); }
.vc-times .hl { color: var(--brand); }
.vc-foot { display: flex; gap: 8px; padding: 4px 22px 22px; margin-top: auto; }
.vc-foot .btn { flex: 1; height: 36px; }
.vc-foot .btn-dark { background: var(--brand); }
.vc-foot .btn-dark:hover { background: var(--brand-d); }

/* ---------------- 工作台 ---------------- */
.hero { background: var(--brand); color: #fff; padding: 34px var(--gutter) 0; }
.hero-top { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero-date { margin: 0 0 8px; font-size: 14px; color: rgba(255, 255, 255, .72); }
.hero h1 { margin: 0; font-size: 44px; line-height: 1.15; font-weight: 800; letter-spacing: 1px; }
.hero .btn { margin-left: auto; height: 44px; padding: 0 22px; font-size: 15px; background: var(--sun); color: var(--ink); font-weight: 700; }
.hero .btn:hover { background: var(--sun-d); }
.hero-nums { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 34px; border-top: 1px solid rgba(255, 255, 255, .2); }
.hn { display: block; color: #fff; padding: 22px 24px 30px 0; border-bottom: 5px solid transparent; }
.hn + .hn { padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, .2); }
.hn:hover { text-decoration: none; border-bottom-color: var(--sun); }
.hn-l { display: flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(255, 255, 255, .8); }
.hn-n { display: block; font-family: var(--num); font-size: 76px; font-weight: 700; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hn.warn .hn-n { color: var(--sun); }
.hn-s { display: block; font-size: 13px; color: rgba(255, 255, 255, .7); }
.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 20px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 104px 1fr 40px; gap: 12px; align-items: center; font-size: 13px; }
a.bar-row { color: inherit; }
a.bar-row:hover { text-decoration: none; }
a.bar-row:hover .l { color: var(--brand); }
.bar-row .l { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { display: block; height: 10px; background: var(--fill); border-radius: 2px; overflow: hidden; }
.bar-row .fill { display: block; height: 100%; background: var(--c, var(--brand)); border-radius: 2px; }
.bar-row .v { text-align: right; font-family: var(--num); font-size: 16px; font-weight: 700; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.recent li:last-child { border-bottom: 0; }
.recent .r-name { font-weight: 700; cursor: pointer; min-width: 4em; }
.recent .r-name:hover { color: var(--brand); }
.recent .r-time { margin-left: auto; font-family: var(--num); color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.legend b { font-family: var(--num); color: var(--ink); font-size: 15px; margin-left: 3px; }

/* ---------------- 设置 ---------------- */
.split { display: grid; grid-template-columns: 232px 1fr; gap: 20px; align-items: start; }
.side-list { background: var(--paper); border-radius: var(--r-lg); padding: 8px; }
.side-list button { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 0; background: transparent; padding: 11px 14px; border-radius: var(--r); cursor: pointer; font-size: 14px; color: var(--ink-2); text-align: left; }
.side-list button:hover { background: var(--fill); }
.side-list button.on { background: var(--brand); color: #fff; font-weight: 700; }
.side-list button small { font-family: var(--num); font-size: 13px; color: var(--ink-3); font-weight: 400; }
.side-list button.on small { color: rgba(255, 255, 255, .8); }
.dict-row { display: grid; grid-template-columns: 28px 1fr 80px 90px 170px; gap: 10px; align-items: center; padding: 10px 24px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.dict-row:last-child { border-bottom: 0; }
.dict-row.head { font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid var(--ink); margin-top: 14px; }
.dict-row .grip { color: var(--ink-4); cursor: grab; display: grid; place-items: center; }
.dict-row.dragging { opacity: .4; }
.dict-row.over { box-shadow: inset 0 3px 0 var(--brand); }
.dict-row .ops { display: flex; gap: 2px; }
.dict-row .ops .btn { background: transparent; color: var(--brand); padding: 0 7px; font-weight: 600; }
.dict-row .ops .btn:hover { background: var(--brand-1); }
.dict-row .ops .btn-danger { color: var(--danger); }
.dict-row .swatch { width: 20px; height: 20px; border-radius: var(--r-sm); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.perm-grid > label { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: var(--fill); border-radius: var(--r); cursor: pointer; font-size: 13px; }
.perm-grid > label:hover { background: var(--fill-2); }
.perm-sec { font-size: 15px; font-weight: 800; margin: 22px 0 10px; }
.cols-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.cols-pick > label { display: flex; gap: 9px; align-items: center; font-size: 14px; cursor: pointer; padding: 4px 0; }

.strength { display: flex; gap: 4px; margin-top: 6px; }
.strength i { flex: 1; height: 4px; background: var(--fill-2); }
.strength.s1 i:nth-child(-n+1) { background: var(--danger); }
.strength.s2 i:nth-child(-n+2) { background: var(--warn); }
.strength.s3 i:nth-child(-n+3) { background: var(--ok); }
.strength.s4 i { background: var(--brand); }

/* ---------------- 登录页 ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(400px, .75fr); background: var(--paper); }
.login-hero { position: relative; overflow: hidden; background: var(--brand); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 48px clamp(28px, 5vw, 80px); }
.login-hero .brand { font-size: 20px; }
.login-quote { position: relative; z-index: 1; }
.login-quote h1 { margin: 0; font-size: clamp(54px, 8.2vw, 132px); line-height: 1.12; font-weight: 800; letter-spacing: .04em; }
.login-quote p { margin: 26px 0 0; font-size: 16px; color: rgba(255, 255, 255, .76); }
.login-hero .foot-note { position: relative; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, .6); }
.login-sun { position: absolute; right: -9vw; top: -9vw; width: 30vw; height: 30vw; border-radius: 50%; background: var(--sun); animation: sunrise 1.1s var(--ease) both; }
@keyframes sunrise { from { transform: translate(8vw, -8vw); } to { transform: none; } }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px clamp(24px, 4vw, 64px); }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { margin: 0; font-size: 34px; font-weight: 800; }
.login-form .sub { color: var(--ink-3); margin: 8px 0 34px; }
.login-form .field { margin-bottom: 18px; }
.login-form .input { height: 52px; font-size: 16px; padding: 0 16px; }
.pw-wrap { position: relative; }
.pw-eye { position: absolute; right: 9px; top: 9px; width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; color: var(--ink-3); border-radius: var(--r); display: grid; place-items: center; }
.pw-eye:hover { background: var(--fill-2); color: var(--ink); }
.captcha-row { display: flex; gap: 10px; }
.captcha-row .input { flex: 1; }
.captcha-row canvas, .captcha-row img { height: 52px; width: 132px; border-radius: var(--r); cursor: pointer; flex: none; background: var(--fill); }
.login-form .switch { margin: 0 0 8px; }
.login-form .err { color: var(--danger); font-size: 13px; min-height: 22px; }
.login-form .btn-primary { width: 100%; height: 54px; font-size: 17px; font-weight: 700; margin-top: 4px; }
.login-form .demo { margin-top: 22px; font-size: 12px; color: var(--ink-3); line-height: 1.8; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1320px) {
  .today { display: none; }
  .masthead { gap: 20px; }
  .nav a { padding: 0 10px; }
  .nav a.active::after { left: 10px; right: 10px; }
}
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hn-n { font-size: 60px; }
  .user-chip .who { display: none; }
}
@media (max-width: 940px) {
  .menu-btn { display: grid; }
  .nav { display: none; position: fixed; inset: var(--mast-h) 0 0 0; background: var(--brand); flex-direction: column; align-items: stretch; padding: 12px var(--gutter) 32px; overflow-y: auto; gap: 0; }
  .app.menu-open .nav { display: flex; }
  .nav a { padding: 18px 0; font-size: 24px; font-weight: 700; border-bottom: 1px solid rgba(255, 255, 255, .16); }
  .nav a.active::after { left: 0; right: auto; top: 22px; bottom: 22px; width: 5px; height: auto; margin-left: -16px; }
  .page-title { font-size: 28px; }
  .hero h1 { font-size: 32px; }
  .hero-nums { grid-template-columns: 1fr 1fr; }
  .hn { padding: 18px 16px 22px 0; border-top: 1px solid rgba(255, 255, 255, .2); margin-top: -1px; }
  .hn + .hn { padding-left: 0; border-left: 0; }
  .hn:nth-child(even) { padding-left: 20px; border-left: 1px solid rgba(255, 255, 255, .2); }
  .hn-n { font-size: 52px; }
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: 300px; padding: 28px; gap: 28px; }
  .login-sun { width: 44vw; height: 44vw; right: -14vw; top: -14vw; }
  .kv { grid-template-columns: 1fr 1fr; }
  .kv > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line-2); }
  .cols-2, .split { grid-template-columns: 1fr; }
  .form-grid > [class*="span-"] { grid-column: span 12; }
  .fgroup { grid-template-columns: 1fr; gap: 4px; }
  .fgroup-t { padding-top: 0; }
  .dt .sr { position: static; border-left: 0 !important; }
  .table-tools .right { margin-left: 0; flex-wrap: wrap; }
  .table-tools .right label { display: none; }
  .journey .all { min-width: 108px; margin-right: 20px; }
  .tbl-scroll { max-height: none; }
  .drawer-head { padding: 18px 16px 0; }
  .drawer-body { padding: 16px; }
  .vd-name { font-size: 22px; }
  .vd-flags .flag { flex: 1 1 45%; }
  .modal-head { padding: 20px 20px 4px; }
  .modal-body { padding: 14px 20px; }
  .modal-foot { padding: 12px 20px 20px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .journey .j-n { font-size: 32px; }
  .dict-row { grid-template-columns: 24px 1fr 150px; }
  .dict-row > :nth-child(3), .dict-row > :nth-child(4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
  .masthead, .filterbar, .journey, .batchbar, .pager, .table-tools, .foot { display: none !important; }
  .tbl-scroll { max-height: none; overflow: visible; }
}

/* 宽表格里的空状态：始终显示在可视区域中间 */
.tbl-scroll td .empty { position: sticky; left: 0; width: calc(100vw - 2 * var(--gutter) - 4px); max-width: 100%; }
@media (min-width: 941px) { .tbl-scroll td .empty { max-width: none; } }
