/* finesse · register=product · shell=V2.8.1 sidebar · palette=pure white, deep red to burgundy · V2.8.3 */
:root {
  color-scheme: light;
  --page: #ffffff;
  --paper: var(--page);
  --panel: var(--page);
  --sidebar: var(--page);
  --sidebar-text: #32242b;
  --ink: #282128;
  --muted: #685b63;
  --line: #e9e0e4;
  --accent: #7c2140;
  --accent-hover: #59142d;
  --accent-light: #f8eef2;
  --soft: #b86d86;
  --red-deep: #68162e;
  --red-wine: #882744;
  --accent-gradient: linear-gradient(105deg, var(--red-deep), var(--red-wine));
  --success: #235747;
  --success-bg: #e6f2ec;
  --warn: #784a26;
  --warn-bg: #f7ebdb;
  --info: #544765;
  --info-bg: #eee8f4;
  --shadow: 0 1px 3px rgba(59, 33, 46, .035);
  --radius: 17px;
  --small-radius: 10px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:active, .button:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3, p, dl { margin: 0; }
h1, h2, h3 { line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: 31px; letter-spacing: -.025em; font-weight: 750; }
h2 { font-size: 18px; font-weight: 720; }
h3 { font-size: 15px; font-weight: 680; }
small, .muted { font-size: 12px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { display: block; position: fixed; top: 8px; left: 8px; z-index: 10; padding: 8px; background: var(--paper); }

.workspace { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { min-height: 100vh; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  gap: 34px; padding: 24px 16px 16px; background: var(--sidebar); color: var(--sidebar-text); overflow-y: auto;
  box-shadow: inset -1px 0 var(--line); }
.brand { display: flex; gap: 12px; align-items: center; font-size: 15px; font-weight: 720; letter-spacing: .01em; }
.brand-mark { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center;
  background: var(--accent-gradient); color: var(--paper); border-radius: 11px; font-size: 16px; font-family: "Songti SC", "SimSun", serif; }
.sidebar .brand { margin-inline: 6px; }
.brand small, .profile small { display: block; color: var(--muted); font-weight: 400; }
.navigation { display: grid; gap: 5px; }
.navigation a { display: flex; justify-content: space-between; align-items: center; color: var(--sidebar-text);
  padding: 10px 12px; border-radius: var(--small-radius); min-height: 42px; white-space: nowrap; position: relative; }
.navigation a span { color: var(--muted); }
.navigation a:hover { background: var(--accent-light); text-decoration: none; }
.navigation a[aria-current=page] { color: var(--accent-hover); box-shadow: inset 0 0 0 1px var(--line); font-weight: 680; }
.navigation a[aria-current=page]::before {
  content: ""; position: absolute; inset: 9px auto 9px 0; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--red-deep), var(--red-wine)); }
.profile { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  border-top: 1px solid var(--line); padding: 14px 6px 4px; }
.profile button { border: 0; background: transparent; color: var(--sidebar-text); padding: 10px 6px; border-radius: 6px; white-space: nowrap; }
.profile button:hover { background: var(--accent-light); }
.main { min-width: 0; }
.topbar { min-height: 62px; border-bottom: 1px solid var(--line); padding: 12px clamp(18px, 4.1vw, 55px);
  background: var(--paper); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topbar a { font-weight: 650; white-space: nowrap; }
.global-search { display: flex; align-items: center; flex: 1 1 auto; max-width: 565px; min-width: 0; gap: 7px; }
.global-search input { flex: 1 1 auto; width: 100%; min-width: 0; padding: 8px 11px; min-height: 38px;
  border: 1px solid var(--line); border-radius: var(--small-radius); background: var(--panel); color: var(--ink); }
.content { display: grid; gap: 18px; max-width: 1470px; margin: 0 auto; padding: 27px clamp(18px, 4.1vw, 55px) 50px; min-width: 0; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.heading > .button { flex: 0 0 auto; white-space: nowrap; }
.heading p { margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; }
.crumb { display: inline-block; margin-bottom: 6px; font-size: 12px; }
.panel, .metric { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); min-width: 0; }
.panel { padding: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }
.section-head a { font-size: 13px; font-weight: 670; }
.panel > p { margin-block: 9px; }
.panel-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }

.assistant { display: grid; grid-template-columns: minmax(0,1fr) minmax(152px,30%); position: relative; overflow: clip;
  background: var(--paper); padding: 22px 6px 0 27px;
  border: 1px solid var(--line); border-radius: 20px; isolation: isolate; }
.assistant::before {
  content: ""; position: absolute; top: 0; left: 27px; width: 54px; height: 1px;
  background: var(--accent-gradient); }
.assistant-body { display: grid; align-content: center; gap: 10px; padding: 2px 0 18px; min-width: 0; }
.assistant-identity { display: flex; gap: 8px; align-items: center; color: var(--accent-hover); font-size: 13px; font-weight: 720; }
.signal { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); }
.assistant h2 { font-size: clamp(21px,3vw,30px); letter-spacing: -.02em; }
.portrait { min-width: 0; min-height: 0; display: flex; align-items: end; justify-content: center; }
.portrait img { display: block; width: min(100%, 225px); height: auto; max-height: 263px; object-fit: contain; object-position: bottom; }
.compose { background: var(--paper); border: 1px solid #e0d2d9; border-radius: 13px; padding: 10px 10px 8px; min-width: 0; }
.compose > textarea { resize: vertical; min-height: 54px; display: block; border: 0; padding: 6px; width: 100%; background: transparent; color: var(--ink); }
.compose-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.compose-actions .check { font-size: 12px; margin: 0; }
.prompt-row { display: flex; gap: 7px; flex-wrap: wrap; }
.prompt-row button { border: 1px solid #e4c5cf; border-radius: 30px; padding: 5px 10px; min-height: 32px;
  color: var(--accent-hover); background: var(--paper); font-size: 12px; }
.prompt-row button:hover { background: var(--accent-light); }
.assistant-result > p { margin: 8px 0 13px; }
.draft-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); gap: 7px; margin-bottom: 14px; }
.draft-facts > span { padding: 9px; min-width: 0; background: var(--panel); border-radius: var(--small-radius); color: var(--muted); }
.draft-facts strong { display: block; overflow-wrap: anywhere; color: var(--ink); }
.linked-list { display: grid; }
.linked-list a { padding: 9px 2px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.linked-list a > span:last-child { margin-left: auto; }
.result-links a { min-height: 46px; justify-content: space-between; overflow-wrap: anywhere; }
.result-links strong, .result-links small { display: block; }
.result-links small { margin-top: 2px; }
.result-meta { color: var(--muted); font-size: 12px; text-align: right; min-width: 20px; }
.workbench > .section-head { margin-bottom: 8px; }
.workdesk-shortcuts { margin: 10px 0 14px; }
.queue-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.queue-panel .section-head { margin-bottom: 8px; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); gap: 9px; }
.brief-grid article { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 11px 12px;
  border-radius: var(--small-radius); border: 1px solid var(--line); background: var(--panel); overflow-wrap: anywhere; }
.brief-grid h3 { font-size: 13px; color: var(--muted); }
.brief-grid a { font-size: 12px; font-weight: 650; }
.brief-note { color: var(--muted); font-size: 12px; }
.assistant-steps { display: grid; gap: 7px; margin: 0 0 14px; padding: 0; list-style: none; }
.assistant-steps > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 6px 12px;
  border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--small-radius); background: var(--panel); }
.assistant-steps p { overflow-wrap: anywhere; }
.assistant-steps .tag-list { flex-basis: 100%; }
.assistant-steps a { flex-shrink: 0; }
.order-navigation { margin-bottom: 0; }
.more-tabs { flex: 0 1 auto; }
.more-tabs[open] { flex-basis: 100%; }
.more-tabs summary { padding: 7px 11px; border-radius: 7px; background: var(--panel); color: var(--accent); cursor: pointer; }
.more-tabs > div { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.service-cases { margin-top: 12px; }
:target { scroll-margin-top: 16px; }
.batch-card:target, .disclosure:target { outline: 2px solid var(--soft); outline-offset: 3px; }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.metric { display: grid; grid-template-columns: 1fr auto; align-items: start; padding: 12px 15px; color: var(--muted); gap: 2px; }
.metric strong { grid-column: 1; grid-row: 2; color: var(--ink); font-size: 23px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.metric .arrow { grid-column: 2; grid-row: 1; color: var(--accent); }
.metric:hover { border-color: #cfacb7; text-decoration: none; }

.table-scroll { max-width: 100%; overflow: auto; border-radius: var(--small-radius); }
table { border-collapse: collapse; width: 100%; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--panel); font-size: 12px; color: var(--muted); white-space: nowrap; }
td small { display: block; margin-top: 3px; overflow-wrap: anywhere; }
tbody tr:hover { background: #fbf7f9; }
.report-scroll td { min-width: 105px; vertical-align: top; overflow-wrap: anywhere; }
.report-scroll th { white-space: normal; min-width: 96px; }
.row-link { font-weight: 680; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 50px;
  background: var(--panel); color: var(--muted); white-space: nowrap; font-size: 12px; }
.badge.released, .badge.shipped, .badge.approved { background: var(--success-bg); color: var(--success); }
.badge.review, .badge.pending, .badge.returned, .badge.planned { background: var(--warn-bg); color: var(--warn); }
.badge.partial, .badge.info { background: var(--info-bg); color: var(--info); }
.notice { border-radius: var(--small-radius); padding: 10px 12px; }
.notice.success { background: var(--success-bg); color: var(--success); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.info { background: var(--info-bg); color: var(--info); }
.empty { padding: 22px 10px; text-align: center; color: var(--muted); }
.empty strong { color: var(--ink); }
.empty p { margin-top: 5px; }
.pager { margin-top: 12px; display: flex; align-items: center; gap: 9px; justify-content: flex-end; }

.stack, .form-grid, .line-rows { display: grid; gap: 13px; }
.form-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); }
.line-fields { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,.7fr) minmax(0,1fr) minmax(0,1fr); gap: 9px;
  background: var(--panel); padding: 9px; border-radius: var(--small-radius); }
.field { display: grid; gap: 4px; color: var(--ink); font-weight: 600; min-width: 0; }
.field > span, .field-caption { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.field > input, .field > select, .field > textarea { min-width: 0; width: 100%; min-height: 38px; padding: 8px;
  border: 1px solid #dccdc9; border-radius: 8px; background: var(--paper); color: var(--ink); font-weight: 400; }
.field textarea { resize: vertical; }
.button { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 37px;
  padding: 7px 11px; border-radius: 8px; border: 1px solid transparent; font-weight: 680; font-size: 13px; white-space: normal; }
.button:hover { text-decoration: none; }
.button.primary { color: var(--paper); background: var(--accent-gradient); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { background: var(--paper); border-color: #e2ced4; color: var(--accent-hover); }
.button.secondary:hover { background: var(--accent-light); }
.button.add-line { justify-self: start; }
.actions { gap: 8px; display: flex; flex-wrap: wrap; align-items: center; }
.filter { display: flex; gap: 9px; flex-wrap: wrap; align-items: end; padding-bottom: 12px; }
.filter > .field { flex: 1 0 130px; max-width: 230px; }
.customer-filters { margin: 13px 0 19px; }
.customer-filters .amount-filters { padding-bottom: 4px; }
.customer-filters .field-caption { margin: 0 0 10px; }
.customer-pick { display: grid; gap: 6px; }
.customer-pick .filter { padding-bottom: 0; }
.customer-pick .field { max-width: none; }
.spaced { margin-top: 14px; }
.check { display: flex; align-items: center; gap: 7px; color: var(--muted); min-height: 29px; }
.check input { margin: 0; accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.check-grid { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin-block: 8px 12px; }
.tag-list li { background: var(--panel); color: var(--muted); border-radius: 7px; padding: 4px 7px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,156px),1fr)); gap: 9px 15px; margin-block: 0 13px; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 3px 0 0; font-weight: 620; overflow-wrap: anywhere; }
.batch-card { border: 1px solid var(--line); border-radius: 13px; padding: 13px; margin-bottom: 10px; }
.batch-operation { margin: 9px 0; }
.disclosure { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 6px; }
.disclosure > summary { cursor: pointer; padding: 6px 0; color: var(--accent); font-weight: 680; }
.disclosure > form { margin-block: 9px 2px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs a { display: inline-block; padding: 7px 11px; border-radius: 7px; background: var(--panel); }
.tabs a[aria-current=page] { background: var(--accent-light); color: var(--accent-hover); font-weight: 670; }
.dossier-tabs { padding: 8px; margin-bottom: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--small-radius); }
.dossier-tabs > a { min-height: 40px; }
.dossier-entry { padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.disclosure { min-width: 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--small-radius); }
.disclosure summary { cursor: pointer; font-weight: 650; color: var(--accent-hover); }
.disclosure[open] summary { margin-bottom: 12px; }
.preserve-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.dossier-entry blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--line); background: var(--panel); }
.wide-facts dd { white-space: pre-wrap; }
.source-cells td { overflow-wrap: anywhere; vertical-align: top; }
.source-cells td:last-child { min-width: min(35vw,210px); }
.directory-table td:first-child { min-width: 155px; }
.timeline > div { padding: 8px 0; border-top: 1px solid var(--line); display: grid; gap: 3px;
  grid-template-columns: minmax(130px,1fr) minmax(0,2fr) auto; }
.timeline span, .timeline time { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

.authentication { min-height: 100vh; display: grid; padding: 18px; place-items: center; }
.auth-content { width: min(100%,700px); }
.login-grid { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1fr); border-radius: 21px;
  overflow: clip; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.login-identity { display: grid; padding: 18px 16px 0; background: var(--paper); box-shadow: inset -1px 0 var(--line); }
.login-identity img { display: block; max-height: 234px; width: auto; height: auto; margin: 0 auto; align-self: end; }
.login-card { padding: 28px; min-width: 0; align-self: center; }
.login-card h1 { margin-bottom: 13px; }
.login-card > p { margin-bottom: 10px; }

@media (max-width: 1050px) { .workspace { grid-template-columns: 185px minmax(0,1fr); } }
@media (max-width: 760px) {
  .workspace { display: block; }
  .sidebar { display: grid; grid-template-columns: minmax(0,1fr) auto; height: auto; min-height: 0;
    padding: 11px 12px 5px; position: static; gap: 6px 12px; box-shadow: inset 0 -1px var(--line); }
  .sidebar .brand { margin: 0; }
  .navigation { grid-column: 1/-1; grid-row: 2; display: flex; width: 100%; overflow-x: auto; padding: 4px 1px 2px; }
  .navigation a { min-height: 44px; padding-inline: 9px; }
  .navigation a span, .profile small { display: none; }
  .profile { margin: 0; padding: 0; border: 0; }
  .profile strong { display: none; }
  .topbar { min-height: 48px; }
  .global-search input { min-height: 44px; font-size: 16px; }
  .content { padding-top: 16px; padding-inline: 12px; gap: 13px; }
  h1 { font-size: 25px; }
  .panel { padding: 13px; }
  .metrics { gap: 7px; }
  .metric { padding: 9px; font-size: 12px; }
  .metric strong { font-size: 18px; }
  .button, .field > input, .field > select, .field > textarea, .check { min-height: 44px; }
  .field > input, .field > select, .field > textarea, .compose > textarea { font-size: 16px; }
  .panel-grid { grid-template-columns: 1fr; }
  .queue-grid { grid-template-columns: 1fr; }
  .assistant { grid-template-columns: minmax(0,1fr) minmax(80px,25%); padding: 14px 4px 0 13px; }
  .assistant::before { left: 13px; }
  .assistant h2 { font-size: 19px; }
  .assistant-body { padding-bottom: 12px; }
  .prompt-row button { min-height: 40px; }
  .facts { gap: 6px 8px; }
  .line-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .timeline > div { grid-template-columns: minmax(0, 1fr); }
  table { min-width: 440px; }
  .report-scroll table { min-width: max-content; }
}
@media (max-width: 430px) {
  .topbar { gap: 8px; padding-inline: 12px; }
  .topbar .button { padding-inline: 8px; }
  .topbar a { font-size: 12px; }
  .heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .assistant { grid-template-columns: minmax(0,1fr) 80px; }
  .portrait { align-self: start; padding-top: 4px; }
  .portrait img { max-height: 65px; }
  .compose { margin-right: -70px; margin-top: 10px; }
  .prompt-row { margin-right: -60px; }
  .login-grid { grid-template-columns: 1fr; }
  .login-identity { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 0; box-shadow: inset 0 -1px var(--line); }
  .login-identity img { max-height: 74px; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  button:active, .button:active { transform: none; }
}
