/* 智能辅助 (2026-11-17): the 大厅's summary card and the sheet it opens - assist.js. Colours from the console's own tokens
 * (style.css), so light and dark follow the page. Quiet when nothing waits: tiles stay grey; blue = waits for your decision,
 * amber = someone should look, red = late. */
.as, .as-sheet {
  --as-bg: var(--surface, #fff);
  --as-bg2: var(--surface-2, #f6f7f9);
  --as-line: var(--border, #dde1e8);
  --as-text: var(--text, #171a21);
  --as-muted: var(--text-3, #626a7a);
  --as-blue: var(--accent, #2f4bd0);
  --as-blue-bg: var(--accent-soft, #e9edfc);
  --as-amber: var(--warn, #935400);
  --as-amber-bg: var(--warn-soft, #fbefd9);
  --as-red: var(--bad, #b42a2a);
  --as-red-bg: var(--bad-soft, #fbe6e6);
  --as-green: var(--ok, #17784a);
  --as-green-bg: var(--ok-soft, #e2f4ea);
  color: var(--as-text);
}
.as-i { flex: none; vertical-align: -3px; }

/* ------------------------------------------------------------------ the gate */
.as-gate { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px; border-radius: 16px; background: var(--as-amber-bg); }
.as-gate-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--as-bg); color: var(--as-amber); }
.as-gate p { margin: 6px 0 12px; }
.as-warn { color: var(--as-amber); }

/* ------------------------------------------------------------------ the 大厅: one card */
.as-card { display: grid; gap: 14px; }
.as-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.as-orb { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums; background: var(--as-bg2); color: var(--as-muted); }
.as-orb.blue { background: var(--as-blue-bg); color: var(--as-blue); box-shadow: 0 0 0 4px var(--as-blue-bg); }
.as-orb.amber { background: var(--as-amber-bg); color: var(--as-amber); box-shadow: 0 0 0 4px var(--as-amber-bg); }
.as-orb.red { background: var(--as-red-bg); color: var(--as-red); box-shadow: 0 0 0 4px var(--as-red-bg); }
.as-orb.green { background: var(--as-green-bg); color: var(--as-green); }
.as-hero-t { display: grid; gap: 3px; min-width: 0; }
.as-hero-t b { font-size: 18px; line-height: 1.3; }
.as-hero-t small { color: var(--as-muted); }
.as-go { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 12px; background: var(--as-blue);
  color: var(--on-accent, #fff); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.as-go:hover { filter: brightness(1.08); }
.as-go:focus-visible, .as-tile:focus-visible, .as-btn:focus-visible, .as-nav button:focus-visible { outline: 2px solid var(--as-blue); outline-offset: 2px; }

.as-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.as-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ic l" "n n" "s s"; gap: 4px 8px; text-align: left;
  padding: 14px; border-radius: 14px; border: 1px solid var(--as-line); background: var(--as-bg2); color: var(--as-text); font: inherit; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease; min-width: 0; }
.as-tile:hover { border-color: var(--as-blue); }
.as-tile:active { transform: scale(.98); }
.as-tile-ic { grid-area: ic; color: var(--as-muted); }
.as-tile-l { grid-area: l; align-self: center; color: var(--as-muted); font-size: 13px; }
.as-tile-n { grid-area: n; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.as-tile-s { grid-area: s; font-size: 12.5px; color: var(--as-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-tile.blue { background: var(--as-blue-bg); border-color: transparent; }
.as-tile.blue .as-tile-ic, .as-tile.blue .as-tile-n { color: var(--as-blue); }
.as-tile.amber { background: var(--as-amber-bg); border-color: transparent; }
.as-tile.amber .as-tile-ic, .as-tile.amber .as-tile-n { color: var(--as-amber); }
.as-tile.red { background: var(--as-red-bg); border-color: transparent; }
.as-tile.red .as-tile-ic, .as-tile.red .as-tile-n { color: var(--as-red); }

/* ------------------------------------------------------------------ the sheet */
.as-sheet { width: min(940px, calc(100vw - 24px)); height: min(720px, calc(100vh - 32px)); padding: 0; border: 1px solid var(--as-line); border-radius: 20px;
  background: var(--as-bg); box-shadow: 0 24px 70px rgb(0 0 0 / .35); }
.as-sheet::backdrop { background: rgb(10 12 16 / .55); }
.as-sheet-in { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.as-sheet-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--as-line); }
.as-sheet-top h2 { margin: 0; font-size: 18px; }
.as-sheet-top small { color: var(--as-muted); }
.as-sheet-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--as-blue-bg); color: var(--as-blue); }
.as-x { border: 0; background: var(--as-bg2); color: var(--as-text); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.as-sheet-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 0; }
.as-nav { display: grid; align-content: start; gap: 4px; padding: 14px 10px; border-right: 1px solid var(--as-line); background: var(--as-bg2); }
.as-nav button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--as-text); font: inherit; text-align: left; cursor: pointer; }
.as-nav button:hover { background: var(--as-bg); }
.as-nav button.on { background: var(--as-bg); box-shadow: 0 1px 2px rgb(0 0 0 / .08); font-weight: 600; }
.as-nav button .as-i { color: var(--as-muted); }
.as-nav button.on .as-i { color: var(--as-blue); }
.as-nav em { font-style: normal; font-size: 12px; min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center; background: var(--as-line); color: var(--as-text); }
.as-nav em.blue { background: var(--as-blue); color: var(--on-accent, #fff); }
.as-nav em.amber { background: var(--as-amber-bg); color: var(--as-amber); }
.as-nav em.red { background: var(--as-red); color: #fff; }
.as-main { overflow: auto; padding: 20px 24px 28px; display: grid; align-content: start; gap: 14px; }
.as-sec-h h3 { margin: 0 0 4px; font-size: 20px; }
.as-sec-h p { margin: 0; color: var(--as-muted); max-width: 62ch; }
.as-sub { margin: 10px 0 0; font-size: 13px; color: var(--as-muted); font-weight: 600; }
.as-empty { padding: 26px; border-radius: 14px; background: var(--as-bg2); color: var(--as-muted); text-align: center; }

/* a proposal */
.as-prop { display: grid; gap: 12px; padding: 18px; border-radius: 16px; border: 1px solid var(--as-line); background: var(--as-bg); }
.as-prop.pending { border-color: var(--as-blue); box-shadow: 0 0 0 3px var(--as-blue-bg); }
.as-prop:not(.pending):not(.later) { background: var(--as-bg2); }
.as-prop h4 { margin: 0; font-size: 17px; line-height: 1.35; }
.as-prop-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.as-tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--as-blue-bg); color: var(--as-blue); }
.as-tag.soft { background: var(--as-bg2); color: var(--as-muted); }
.as-tag.amber { background: var(--as-amber-bg); color: var(--as-amber); }
.as-block { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 10px; align-items: start; }
.as-block p { margin: 0; line-height: 1.55; }
.as-lbl { color: var(--as-muted); font-size: 13px; padding-top: 2px; }
.as-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.as-changes li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; line-height: 1.5; }
.as-changes .as-i { color: var(--as-green); margin-top: 3px; }
.as-evi summary { cursor: pointer; color: var(--as-muted); font-size: 13px; }
.as-evi p { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--as-bg2); color: var(--as-muted); font-size: 13px; line-height: 1.5; }
.as-result { padding: 10px 12px; border-radius: 10px; background: var(--as-bg2); }
.as-result p { margin: 4px 0 0; }
.as-result.green { background: var(--as-green-bg); color: var(--as-green); }
.as-result.red { background: var(--as-red-bg); color: var(--as-red); }
.as-result.amber { background: var(--as-amber-bg); color: var(--as-amber); }
.as-bar { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--as-line); }
.as-btn { padding: 9px 18px; border-radius: 10px; border: 1px solid var(--as-line); background: var(--as-bg); color: var(--as-text); font: inherit; cursor: pointer; }
.as-btn.primary { background: var(--as-blue); border-color: var(--as-blue); color: var(--on-accent, #fff); font-weight: 600; min-width: 96px; }
.as-btn.quiet { border-color: transparent; color: var(--as-muted); margin-right: auto; }
.as-btn:disabled { opacity: .5; cursor: default; }

/* the door: the picture, when and how long, the plate, the answer */
.as-truck { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: var(--as-bg2); }
.as-truck.here { background: var(--as-amber-bg); }
.as-truck-pic { display: block; width: 168px; height: 104px; border-radius: 10px; overflow: hidden; background: var(--as-line); }
.as-truck-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.as-truck-pic.none { display: grid; place-items: center; color: var(--as-muted); font-size: 13px; }
.as-truck-info { display: grid; gap: 8px; min-width: 0; }
.as-truck-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.as-truck-when b { font-size: 18px; font-variant-numeric: tabular-nums; }
.as-truck-when small { color: var(--as-muted); }
.as-truck-plate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.as-truck-plate small { color: var(--as-muted); font-size: 12.5px; }
.as-plate { display: inline-block; padding: 3px 10px; border: 2px solid var(--as-text); border-radius: 6px; background: #fff; color: #111;
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 16px; letter-spacing: .06em; }
.as-plate-pic { display: block; height: 40px; border-radius: 6px; overflow: hidden; border: 1px solid var(--as-line); }
.as-plate-pic img { height: 100%; display: block; }

/* what has to be uploaded */
.as-ledgers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.as-ledger { display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: var(--as-bg2); }
.as-ledger span, .as-ledger small { color: var(--as-muted); font-size: 13px; }
.as-ledger b { font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.as-ledger.red { background: var(--as-red-bg); }
.as-ledger.red b { color: var(--as-red); }
.as-nag { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--as-bg2); color: var(--as-text); text-decoration: none; box-shadow: inset 4px 0 0 var(--as-line); }
.as-nag.amber { box-shadow: inset 4px 0 0 var(--as-amber); }
.as-nag.red { box-shadow: inset 4px 0 0 var(--as-red); }
.as-nag small { color: var(--as-muted); }

/* the live company */
.as-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.as-big-link { display: grid; gap: 4px; padding: 18px; border-radius: 16px; border: 1px solid var(--as-line); color: var(--as-text); text-decoration: none; }
.as-big-link:hover { border-color: var(--as-blue); }
.as-big-link .as-i { color: var(--as-blue); }
.as-big-link small { color: var(--as-muted); }

/* the door: answered or the two buttons */
.as-ans { display: inline-flex; gap: 6px; align-items: center; }
.as-ans em { font-style: normal; font-size: 13px; color: var(--as-muted); }
.as-ans em.ok { color: var(--as-green); }
.as-btn.small { padding: 5px 12px; font-size: 13px; border-radius: 8px; min-width: 0; }

/* tasks and notices (was 我的事) */
.as-note { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 14px; border-radius: 10px;
  color: var(--as-muted); text-decoration: none; }
.as-note:hover { background: var(--as-bg2); }
.as-note.new { color: var(--as-text); font-weight: 500; background: var(--as-bg2); }
.as-note small { font-size: 12px; white-space: nowrap; }
.as-note span { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.as-sub .as-btn { margin-left: 8px; }
.as-bell summary { cursor: pointer; color: var(--as-muted); margin-top: 6px; }
.as-bell { display: grid; gap: 4px; }

/* three places (was 三地总览) */
.as-places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; position: relative; }
.as-place { display: grid; gap: 2px; padding: 16px; border-radius: 16px; background: var(--as-bg2); }
.as-place span { color: var(--as-muted); font-size: 13px; }
.as-place b { font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.as-place small { color: var(--as-muted); }
.as-place em { font-style: normal; font-size: 12.5px; color: var(--as-muted); margin-top: 4px; }
.as-place.red { background: var(--as-red-bg); }
.as-place.red b, .as-place.red em { color: var(--as-red); }

@media (max-width: 720px) {
  .as-places { grid-template-columns: minmax(0, 1fr); }
  .as-hero { grid-template-columns: auto minmax(0, 1fr); }
  .as-go { grid-column: 1 / -1; justify-content: center; }
  .as-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as-sheet { width: 100vw; max-width: 100vw; height: 92vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .as-sheet-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .as-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--as-line); padding: 8px; }
  .as-nav button { flex: none; }
  .as-main { padding: 16px; }
  .as-block { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .as-truck { grid-template-columns: 120px minmax(0, 1fr); }
  .as-truck-pic { width: 120px; height: 80px; }
  .as-truck .as-ans { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .as-tile { transition: none; } }
