:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #171717;
  --muted: #595959;
  --line: #e5e5e5;
  --quiet: #f6f6f6;
  --selection: #f2f2f2;
  --error: #a42323;
  --font: "Noto Sans SC Web", -apple-system, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font: 400 15px/1.6 var(--font);
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(28px, 3.2vw, 42px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
strong, b, label { font-weight: 500; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
input:not([type=checkbox], [type=radio]), select, textarea {
  width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #c9c9c9;
  border-radius: 8px; background: var(--paper);
}
input[type=file] { padding: 7px; }
input::placeholder { color: var(--muted); }
textarea { display: block; min-height: 110px; resize: vertical; line-height: 1.65; }
small, .small { font-size: 13px; }
.skip-link { position: fixed; z-index: 10; top: 6px; left: 6px; padding: 8px; background: var(--paper); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100dvh; padding: 28px 16px; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand strong { font-size: 18px; font-weight: 600; }
.brand-mark { width: 37px; height: 37px; display: inline-flex; align-items: end; justify-content: center; gap: 3px; padding-bottom: 9px; border-radius: 10px; background: var(--ink); }
.brand-mark i { width: 4px; height: 8px; border-radius: 3px 3px 1px 1px; background: var(--paper); }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 19px; }
.rail .brand { padding: 0 8px 30px; }
.nav-group + .nav-group { margin-top: 26px; }
.nav-group > p { padding: 0 12px 7px; font-size: 12px; color: var(--muted); }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 6px 12px; border-radius: 8px; text-decoration: none; color: #404040; }
.nav-link:hover, .nav-link[aria-current=page] { color: var(--ink); background: var(--selection); }
.nav-link[aria-current=page] { font-weight: 500; }
.module-icon { display: inline-block; flex: 0 0 auto; width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 4px; position: relative; }
.module-icon::before { content: ""; position: absolute; inset: 4px 3px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.nav-link[data-module=workbench] .module-icon::before { inset: 0 5px; border: 0; border-right: 1px solid currentColor; }
.nav-link[data-module=opportunities] .module-icon { border-radius: 50%; }
.nav-link[data-module=customers] .module-icon::before { inset: 3px 4px; border: 1px solid currentColor; }
.nav-link[data-module=products] .module-icon { transform: rotate(12deg); }
.nav-link[data-module=people] .module-icon, .nav-link[data-module=operations] .module-icon { border-radius: 50%; }
.workspace-content { min-width: 0; }
.topbar { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px clamp(16px, 3vw, 46px); border-bottom: 1px solid var(--line); }
.global-search { display: flex; align-items: center; width: min(370px, 55vw); gap: 7px; }
.global-search input { background: var(--quiet); border-color: var(--line); min-height: 36px; font-size: 13px; }
.global-search .btn { min-height: 36px; font-size: 13px; }
.account, .mobile-menu { position: relative; }
.account summary { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.account-menu, .mobile-menu nav {
  position: absolute; z-index: 4; top: calc(100% + 8px); min-width: 190px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--paper); box-shadow: 0 8px 25px #0000000e;
}
.account-menu { right: 0; text-align: left; display: grid; gap: 8px; }
.avatar { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--selection); }
.mobile-menu, .quick-nav { display: none; }
main { max-width: 1510px; margin: auto; padding: 30px clamp(16px, 3.1vw, 48px) 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head > div { min-width: 0; }
.page-head h1 { margin-block: 3px; overflow-wrap: anywhere; }
.page-head .muted { margin-top: 5px; }
.eyebrow { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.panel { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.panel + .panel, .grid-2 + .panel { margin-top: 15px; }
.panel h2 + .muted, .panel h3 + .muted { margin-top: 5px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar, .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar { margin-bottom: 15px; }
.toolbar > label { min-width: 115px; }
.toolbar > input, .toolbar > select { width: auto; max-width: 100%; }
.toolbar input[type=search] { flex: 1 1 175px; }
.row.end { justify-content: end; }
.stack { display: grid; gap: 12px; min-width: 0; }
.grid-2, .fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; align-items: start; }
.grid-2 > .panel { margin: 0; }
.grid-2 > *, .fields > * { min-width: 0; }
.fields .wide { grid-column: 1 / -1; }
.fields label, .stack > label { display: grid; gap: 5px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 5px; min-height: 39px;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  background: var(--quiet); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #ededed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #333; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .52; }
.btn.secondary { background: var(--paper); }
.btn.secondary:hover { background: var(--quiet); }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--selection); }
.badge.pending, .badge.error { border: 1px solid var(--line); background: var(--paper); }
.text-link { font-weight: 500; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.text-link:hover { text-decoration: underline; }
.empty, .loading { color: var(--muted); text-align: center; padding: 30px 14px; }
.empty h1, .empty h2 { color: var(--ink); }
.empty .btn { margin-top: 12px; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 500; background: var(--quiet); }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 13px; min-height: 65px; padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; }
a.list-row:hover { background: var(--quiet); }
.list-row > * { min-width: 0; overflow-wrap: anywhere; }
.list-row .badge { flex: none; }
.list-row small { display: block; margin-top: 4px; color: var(--muted); }
.kv { display: grid; grid-template-columns: minmax(80px, .5fr) minmax(0, 1fr); gap: 8px 14px; }
.kv dt { color: var(--muted); }
.kv dd { overflow-wrap: anywhere; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-error { color: var(--error); font-size: 13px; }
.inline-error:empty { display: none; }
.notice { position: fixed; z-index: 8; bottom: 16px; right: 16px; max-width: min(370px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; box-shadow: 0 5px 20px #00000017; }
.notice[data-kind=error] { color: var(--error); }
.session { min-height: 100dvh; display: grid; justify-items: center; align-content: center; padding: 22px; }
.session-card { width: min(100%, 410px); border: 1px solid var(--line); border-radius: 18px; padding: clamp(19px, 5vw, 35px); }
.session-card .brand { margin-bottom: 22px; }
.session-card h1 { font-size: 28px; margin-bottom: 12px; }
.session-card .stack, .login-alternative { margin-top: 18px; }
.login-alternative { width: 100%; }
.first-use { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.first-use h2 { font-size: 16px; }
.first-use .btn { margin-top: 4px; text-align: center; }
.verify-again { margin-top: 12px; width: 100%; }
.pairing-code { padding: 11px 15px; border-radius: 10px; background: var(--quiet); text-align: center; font-size: clamp(26px, 8vw, 37px); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .15em; }
.pager { display: flex; justify-content: end; align-items: center; gap: 8px; margin-top: 14px; }
.pager .muted { font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stat-grid > * { display: block; padding: 12px; border-bottom: 1px solid var(--line); min-width: 0; text-decoration: none; }
.stat-grid > :nth-child(2n) { border-left: 1px solid var(--line); }
.stat-grid > :nth-last-child(-n+2) { border-bottom: 0; }
a.stat:hover, a.stat:focus-visible { background: var(--quiet); }
.stat span, .stat small { display: block; color: var(--muted); }
.stat b { display: block; margin-top: 4px; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-grid { grid-template-columns: minmax(0,1.65fr) minmax(245px,1fr); }
.overview-money { background: var(--quiet); border-radius: 9px; margin-top: 13px; padding: 12px; }
.overview-money b { display: block; font-size: 22px; font-weight: 600; }
.report-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.report-grid > :nth-child(2n) { border-left: 0; }
.report-grid > :not(:nth-child(4n+1)) { border-left: 1px solid var(--line); }
.report-grid > :nth-last-child(-n+4) { border-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 3px 7px; margin: 10px 0; }
.tabs a, .tabs button { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 6px; border: 0; background: var(--paper); color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.tabs a:hover, .tabs button:hover, .tabs [aria-current=true] { color: var(--ink); background: var(--selection); }
.section-gap { margin-top: 15px; }
audio { width: 100%; }
dialog { width: min(720px, calc(100% - 26px)); max-height: 90dvh; border: 1px solid var(--line); border-radius: 15px; padding: 20px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #0005; }
@media (max-width: 1020px) {
  .shell { grid-template-columns: 173px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .report-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-grid > :nth-child(odd) { border-left: 0; }
  .report-grid > :nth-child(even) { border-left: 1px solid var(--line); }
  .report-grid > :nth-last-child(n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 800px) {
  .overview-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .rail { display: none; }
  .topbar { min-height: 55px; padding: 6px 10px; gap: 8px; }
  .mobile-menu { display: block; white-space: nowrap; font-size: 12px; }
  .mobile-menu nav { left: 0; }
  .account summary > span:last-child { display: none; }
  .account summary { list-style: none; }
  .account summary::-webkit-details-marker { display: none; }
  .global-search { flex: 1; min-width: 0; }
  .global-search .btn { display: none; }
  main { padding: 21px 12px calc(72px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; }
  .panel { padding: 14px; }
  .panel-head { margin-bottom: 10px; }
  .grid-2, .fields { grid-template-columns: minmax(0,1fr); }
  .quick-nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); position: fixed; z-index: 5; inset: auto 0 0; padding: 3px 4px calc(3px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
  .quick-nav .nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 45px; padding: 3px; font-size: 12px; }
  .notice { bottom: calc(61px + env(safe-area-inset-bottom)); }
  .pager { flex-wrap: wrap; }
  .table-wrap th, .table-wrap td { min-width: 64px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
