:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #03111f;
  /* 默认使用高不透明度回退；支持模糊时切换为计划指定的玻璃透明度。 */
  --sidebar-glass: rgba(3, 10, 24, .72);
  --panel-glass: rgba(10, 22, 42, .66);
  --input-glass: rgba(5, 15, 32, .76);
  --sidebar-surface: rgba(3, 10, 24, .96);
  --panel: rgba(10, 22, 42, .94);
  --panel-solid: #0a162a;
  --panel-soft: rgba(16, 31, 58, .92);
  --panel-soft-solid: #101f3a;
  --input-surface: rgba(5, 15, 32, .96);
  --line: rgba(125, 211, 252, .24);
  --line-strong: rgba(125, 211, 252, .42);
  --text: #e0f2fe;
  --muted: #93c5fd;
  --brand: #06b6d4;
  --brand-strong: #67e8f9;
  --brand-soft: rgba(6, 182, 212, .14);
  --brand-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 45%, #8b5cf6 100%);
  --on-gradient: #020617;
  --blue: #60a5fa;
  --red: #dc2626;
  --amber: #f59e0b;
  --caution: #92400e;
  --warning-text: #fef3c7;
  --focus: #67e8f9;
  --success: #6ee7b7;
  --shadow: 0 20px 55px rgba(0, 0, 0, .42), 0 0 35px rgba(56, 189, 248, .12);
  --glass-blur: blur(18px) saturate(135%);
  --background-overlay: linear-gradient(rgba(7, 17, 31, .72), rgba(7, 17, 31, .88));
  --button-shadow: 0 8px 20px rgba(56, 189, 248, .2);
  --button-hover: rgba(6, 182, 212, .12);
  --button-danger-hover: #b91c1c;
  --button-caution-hover: #78350f;
  --input-inset: rgba(255, 255, 255, .025);
  --nav-backdrop: rgba(2, 6, 23, .72);
  --sidebar-drawer: rgba(3, 10, 24, .97);
  --pulse-surface: rgba(3, 10, 24, .96);
  --account-shadow: 0 16px 34px rgba(2, 6, 23, .28);
  --account-line-soft: rgba(125, 211, 252, .32);
  --account-selection-surface: linear-gradient(135deg, rgba(14, 116, 144, .28), rgba(109, 40, 217, .2));
  --account-control-surface: rgba(2, 6, 23, .66);
  --danger-divider: rgba(220, 38, 38, .22);
  --danger-soft-border: #f87171;
  --danger-soft-bg: rgba(127, 29, 29, .7);
  --danger-soft-hover-border: #fb7185;
  --danger-soft-hover-bg: #7f1d1d;
  --success-border: #34d399;
  --success-bg: #064e3b;
  --success-text: #d1fae5;
  --error-border: #f87171;
  --error-bg: #7f1d1d;
  --error-text: #fee2e2;
  --warning-border: #f59e0b;
  --warning-bg: #78350f;
  --warning-status-text: #fef3c7;
  --info-border: #60a5fa;
  --info-bg: #1e3a8a;
  --info-text: #dbeafe;
  --neutral-border: #94a3b8;
  --neutral-bg: #334155;
  --neutral-text: #f8fafc;
  --high-bg: #9a3412;
  --high-text: #fff7ed;
  --sold-border: #a78bfa;
  --sold-bg: #4c1d95;
  --sold-text: #ede9fe;
  --heading-glow: 0 1px 18px rgba(56, 189, 248, .08);
  --nav-heading-surface: rgba(16, 31, 58, .72);
  --login-brand-surface: linear-gradient(135deg, rgba(6, 182, 212, .13), rgba(139, 92, 246, .15));
  --logo-shadow: drop-shadow(0 18px 28px rgba(2, 6, 23, .35));
  /* 旧变量名保留成别名，让既有组件继续使用同一套语义色。 */
  --primary: var(--brand);
  --danger: var(--red);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef6fb;
  --sidebar-glass: rgba(255, 255, 255, .78);
  --panel-glass: rgba(255, 255, 255, .74);
  --input-glass: rgba(255, 255, 255, .88);
  --sidebar-surface: rgba(255, 255, 255, .96);
  --panel: rgba(255, 255, 255, .95);
  --panel-solid: #ffffff;
  --panel-soft: rgba(226, 239, 247, .92);
  --panel-soft-solid: #e2eff7;
  --input-surface: rgba(255, 255, 255, .98);
  --line: rgba(14, 116, 144, .25);
  --line-strong: rgba(14, 116, 144, .48);
  --text: #172033;
  --muted: #53677d;
  --brand: #0e7490;
  --brand-strong: #075985;
  --brand-soft: rgba(8, 145, 178, .12);
  --brand-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 45%, #8b5cf6 100%);
  --on-gradient: #020617;
  --blue: #1d4ed8;
  --red: #b91c1c;
  --amber: #b45309;
  --caution: #92400e;
  --warning-text: #78350f;
  --focus: #0e7490;
  --success: #047857;
  --shadow: 0 14px 34px rgba(15, 23, 42, .13), 0 0 24px rgba(14, 116, 144, .08);
  --background-overlay: linear-gradient(rgba(238, 246, 251, .7), rgba(238, 246, 251, .9));
  --button-shadow: 0 8px 18px rgba(37, 99, 235, .18);
  --button-hover: rgba(8, 145, 178, .12);
  --button-danger-hover: #991b1b;
  --button-caution-hover: #78350f;
  --input-inset: rgba(255, 255, 255, .7);
  --nav-backdrop: rgba(15, 23, 42, .45);
  --sidebar-drawer: rgba(255, 255, 255, .98);
  --pulse-surface: rgba(255, 255, 255, .96);
  --account-shadow: 0 12px 28px rgba(15, 23, 42, .12);
  --account-line-soft: rgba(14, 116, 144, .34);
  --account-selection-surface: linear-gradient(135deg, rgba(207, 250, 254, .86), rgba(237, 233, 254, .82));
  --account-control-surface: rgba(255, 255, 255, .78);
  --danger-divider: rgba(185, 28, 28, .25);
  --danger-soft-border: #b91c1c;
  --danger-soft-bg: #fee2e2;
  --danger-soft-hover-border: #991b1b;
  --danger-soft-hover-bg: #fecaca;
  --success-border: #059669;
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --error-border: #dc2626;
  --error-bg: #fee2e2;
  --error-text: #7f1d1d;
  --warning-border: #b45309;
  --warning-bg: #fef3c7;
  --warning-status-text: #78350f;
  --info-border: #2563eb;
  --info-bg: #dbeafe;
  --info-text: #1e3a8a;
  --neutral-border: #64748b;
  --neutral-bg: #e2e8f0;
  --neutral-text: #334155;
  --high-bg: #ffedd5;
  --high-text: #9a3412;
  --sold-border: #7c3aed;
  --sold-bg: #ede9fe;
  --sold-text: #4c1d95;
  --heading-glow: 0 1px 12px rgba(14, 116, 144, .08);
  --nav-heading-surface: rgba(207, 232, 244, .72);
  --login-brand-surface: linear-gradient(135deg, rgba(207, 250, 254, .72), rgba(237, 233, 254, .72));
  --logo-shadow: drop-shadow(0 14px 22px rgba(15, 23, 42, .18));
  --primary: var(--brand);
  --danger: var(--red);
}
* { box-sizing: border-box; }
html { max-width: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh; margin: 0; max-width: 100%;
  background-color: var(--bg);
  background-image: var(--background-overlay), url("../images/theme/site-background.75f9bdbf7d78.webp");
  background-position: center, center; background-size: cover, cover; background-repeat: no-repeat, no-repeat; background-attachment: fixed, fixed;
  color: var(--text); font: 14px/1.55 system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
}
a { color: var(--brand-strong); text-decoration: none; }
h1 { margin: 0 0 8px; font-size: 26px; }
h2 { margin-top: 28px; }
h1, h2, h3, h4, h5, h6 { color: var(--text); }
p { color: var(--muted); }
img, video { max-width: 100%; height: auto; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 8px 12px; border-radius: 6px;
  background: var(--panel); color: var(--brand-strong); font-weight: 700;
  box-shadow: var(--shadow); transform: translateY(calc(-100% - 16px));
  transition: transform .15s ease;
}
.skip-link:focus-visible { transform: translateY(0); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 40px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--panel-soft); color: var(--text); box-shadow: var(--shadow);
  cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}
.theme-toggle:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.theme-toggle:active { transform: translateY(1px); }
.theme-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: block; }
.guest-theme-control {
  position: fixed; top: 14px; right: 14px; z-index: 150;
  display: flex; align-items: center; gap: 8px;
}
/* 「左侧边栏 + 内容区」骨架。app-main 必须 min-width:0，
   否则宽表格会把网格列撑开，整页跟着出现横向滚动条。 */
.app-shell, .guest-shell { width: 100%; max-width: 100%; }
.app-shell { display: grid; grid-template-columns: max-content minmax(0, 1fr); min-height: 100vh; }
/* 保持块级：做成 column flex 的话，.container 的 `margin: 0 auto`
   会在交叉轴上顶掉 stretch，登录卡片被压成 fit-content 宽度。 */
.app-main { min-width: 0; width: 100%; max-width: 100%; min-height: 100vh; }
.sidebar {
  display: flex; flex-direction: column; gap: 12px; padding: 14px 12px;
  margin: 10px 0 10px 10px; max-height: calc(100vh - 20px);
  background: var(--sidebar-surface); border: 1px solid var(--line); border-radius: 16px;
  position: sticky; top: 10px; align-self: start; overflow-y: auto; box-shadow: var(--shadow);
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-lockup { display: flex; align-items: center; gap: 6px; min-width: 0; }
.site-logo { display: block; width: 30px; height: 30px; flex: 0 0 30px; object-fit: contain; }
.sidebar .brand { padding: 0 2px; color: var(--text); font-weight: 700; font-size: 14px; line-height: 1.3; }
.sidebar .brand { flex-shrink: 0; }
.sidebar .brand span { flex-shrink: 0; white-space: nowrap; }
.topbar {
  position: sticky; top: 10px; z-index: 90;
  width: calc(100% - 28px); max-width: 100%; min-height: 52px; margin: 10px 14px 0; padding: 10px 14px;
  display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.topbar-primary, .topbar-tools { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-primary { flex: 1 1 auto; }
/* 长身份与完整品牌会压缩顶部可用宽度；两组及含区服的工具组都需可换行，避免固定控件越界。 */
.topbar-tools { flex: 0 1 auto; flex-wrap: wrap; }
.sidebar-close, .nav-backdrop { display: none; }
.page-back { flex: 0 0 auto; }
.identity { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.brand { color: var(--brand); font-weight: 700; font-size: 17px; white-space: nowrap; }
.user-menu a, .link-button { color: var(--muted); }
.user-menu a:hover, .link-button:hover { color: var(--brand); }
.nav-badge { display: inline-block; min-width: 18px; margin-left: 5px; padding: 1px 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-menu form { margin: 0; }
.region-selector { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.region-selector label { color: var(--muted); }
.region-selector select { width: auto; min-width: 82px; padding: 6px 8px; }
.display-preferences { position: relative; }
.display-preferences > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  list-style: none; cursor: pointer; white-space: nowrap;
}
.display-preferences > summary::-webkit-details-marker { display: none; }
.display-preferences[open] > summary { border-color: var(--brand); background: var(--brand-soft); }
.display-preferences-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 170;
  width: min(320px, calc(100vw - 24px)); padding: 14px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow);
}
.display-preferences-panel form { display: grid; grid-template-columns: minmax(88px, auto) minmax(0, 1fr); align-items: center; gap: 10px; margin: 0; }
.display-preferences-panel label { color: var(--muted); }
.display-preferences-panel select { min-width: 0; width: 100%; }
.display-preferences-panel .button { grid-column: 1 / -1; justify-content: center; width: 100%; }
.display-preferences-status { grid-column: 1 / -1; min-height: 1lh; margin: 0; color: var(--muted); font-size: 13px; }
.display-rate-status {
  display: grid; gap: 8px; min-width: 0; max-width: 100%; margin: 0 0 14px; padding: 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel);
  overflow-wrap: anywhere;
}
.display-rate-status h2 { margin: 0; font-size: 16px; }
.display-rate-status p, .display-rate-status dl, .display-rate-status dd { margin: 0; }
.display-rate-status .display-rate-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 8px 16px;
}
.display-rate-status .display-rate-meta > div { min-width: 0; }
.display-rate-status dt, .display-rate-status .display-rate-disclaimer,
.display-rate-status .display-rate-timezone { color: var(--muted); }
.display-rate-status .display-rate-warning { color: var(--warning-text); }
.display-rate-status time { font-variant-numeric: tabular-nums; }
/* 访客 main 原本横向 flex；仅有汇率区时改为纵向，保留登录组件自身尺寸。 */
.error-page { margin-top: min(12vh, 96px); }
.link-button { border: 0; background: none; cursor: pointer; padding: 0; font: inherit; }
.content { min-width: 0; width: 100%; max-width: 100%; padding: 14px; }
.guest-shell .topbar { justify-content: flex-start; }
.container { min-width: 0; width: 100%; max-width: 1500px; margin: 0 auto; padding: 14px; }
.card, .auth-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.auth-card { width: min(430px, 100%); margin: 80px auto; }
.narrow { max-width: 700px; margin-inline: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.page-heading p { margin: 0; }
.actions, .row-actions, .filter-bar, .search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions { row-gap: 4px; }
.danger-link { color: var(--danger); }
.inline-delete-form { display: inline; margin: 0; }
.inline-delete-form .link-button { color: var(--danger); }
.inline-delete-form .link-button:hover { text-decoration: underline; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 32px;
  border: 1px solid var(--line-strong); background: var(--panel-soft); color: var(--text);
  padding: 6px 11px; border-radius: 8px; cursor: pointer; font: inherit; line-height: 1.35;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, filter .15s ease, transform .15s ease;
}
.button.mobile-nav-toggle { display: none; }
.button.primary { background: var(--brand-gradient); border-color: transparent; color: var(--on-gradient); box-shadow: var(--button-shadow); font-weight: 750; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.caution { background: var(--caution); border-color: var(--caution); color: #fff; }
.button:hover { border-color: var(--brand); background: var(--button-hover); }
.button.primary:hover { background: var(--brand-gradient); border-color: transparent; filter: brightness(1.1); }
.button.danger:hover { background: var(--button-danger-hover); border-color: var(--button-danger-hover); }
.button.caution:hover { background: var(--button-caution-hover); border-color: var(--button-caution-hover); }
.button.small { min-height: 30px; padding: 4px 8px; font-size: 13px; }
.button.disabled, .button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.button:not([disabled]):not(.disabled):active { transform: translateY(1px); }
.table-wrap { max-width: 100%; max-height: 74vh; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.table-scroll-hint { display: none; margin: 8px 0; color: var(--muted); font-size: 13px; }
.mobile-cell-value { display: contents; }
.order-list-view[data-order-list-view-mode="compact"] .order-list-detail-column { display: none; }
.order-list-customer-account { min-width: 190px; white-space: normal; line-height: 1.55; }
.order-list-field-label { color: var(--muted); font-size: 12px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { vertical-align: middle; position: sticky; top: 0; z-index: 2; background: var(--panel-soft-solid); color: var(--muted); font-weight: 650; box-shadow: inset 0 -1px 0 var(--line); }
tbody tr:nth-child(even) td { background: var(--panel-soft); }
tbody tr:hover td { background: var(--brand-soft); }
tbody tr td.empty { background: none; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
input, select, textarea { width: 100%; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--input-surface); color: var(--text); font: inherit; box-shadow: inset 0 1px 0 var(--input-inset); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .82; }
select option { background: var(--panel-solid); color: var(--text); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--input-surface) inset;
}
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; accent-color: var(--brand); }
/* 表头保持原生复选框尺寸，不继承普通输入的最小高度。 */
th input[type="checkbox"] { min-height: 0; margin: 0; vertical-align: middle; }
th .button, th .sort-link, th .sort-direction { vertical-align: middle; }
input[type="range"] { padding: 0; accent-color: var(--brand); cursor: pointer; }
.task-amount-slider { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: center; gap: 12px; margin-top: 9px; }
.task-amount-preview { min-width: 150px; color: var(--brand-strong); font-weight: 700; text-align: right; }
.compensation-preview { display: block; margin-top: 8px; color: var(--brand-strong); font-weight: 700; }
.radio-options { display: grid; gap: 5px; margin-top: 7px; }
.radio-options label {
  display: flex; align-items: center; gap: 8px;
  min-height: 38px; margin: 0; padding: 7px 9px;
  border-radius: 6px; background: var(--panel-soft); cursor: pointer;
}
.field { margin-bottom: 16px; }
.field label, form p label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.full { grid-column: 1 / -1; }
.errorlist { color: var(--danger); padding-left: 18px; }
.employee-update-card .employee-role-descriptions {
  min-width: 0; margin: 24px 0 18px; padding-top: 18px; border-top: 1px solid var(--line);
}
.employee-update-card .field fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.employee-update-card .field legend { margin-bottom: 5px; font-weight: 600; }
.employee-update-card .field .helptext {
  display: block; min-width: 0; margin-top: 6px; color: var(--muted); overflow-wrap: anywhere;
}
.employee-update-card .employee-role-descriptions h2 { margin: 0 0 10px; font-size: 18px; }
.employee-update-card .employee-role-descriptions dl { display: grid; gap: 0; min-width: 0; margin: 0; }
.employee-update-card .employee-role-description {
  min-width: 0; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.employee-update-card .employee-role-description dt { margin: 0 0 4px; color: var(--text); font-weight: 700; }
.employee-update-card .employee-role-description dd {
  min-width: 0; margin: 0; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere;
}
.message { margin-bottom: 14px; border-radius: 8px; padding: 10px 14px; border: 1px solid var(--line); background: var(--panel-soft); color: var(--text); }
.message.success { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.message.error { border-color: var(--error-border); background: var(--error-bg); color: var(--error-text); }
.warning { padding: 12px 14px; border-left: 4px solid var(--warning-border); background: var(--warning-bg); color: var(--warning-status-text); margin: 18px 0; }
.success-text { color: var(--success); }
.details { display: grid; grid-template-columns: 130px 1fr; border-top: 1px solid var(--line); }
.details dt, .details dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--muted); }
.credentials code { font-size: 15px; color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 14px; }
.stat { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.stat span { display: block; color: var(--muted); }
.stat strong { display: block; min-width: 0; margin-top: 5px; overflow-wrap: anywhere; font-size: 25px; }
.dashboard-order-stat { color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.dashboard-order-stat:hover, .dashboard-order-stat:focus-visible { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.filter-bar { margin-bottom: 14px; }
.filter-bar input { max-width: 330px; }
.filter-bar select { max-width: 180px; }
.filter-date { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
.filter-date input { width: auto; }

/* 结算日期长标签与原生控件独立换行，日期值保持浏览器原生自然日格式。 */
.settlement-filter-bar .filter-date { flex-wrap: wrap; min-width: 0; white-space: normal; }
.settlement-filter-bar .filter-date input { min-width: 0; max-width: 100%; }
/* 两页的原生日期边界不同，不能只固定结算框再依赖订单框的字体内在宽度。 */
@media (min-width: 641px) {
  .order-list-view .filter-date input,
  .settlement-filter-bar .filter-date input { width: 139px; }
}
.settlement-filter-help { margin: 0; }
/* 管理结算标签保留原生勾选框；说明换行只发生在其右侧，不影响个人端和其他宽表。 */
.settlement-management-form .account-selection-summary label { display: flex; align-items: center; gap: 6px; }
.settlement-management-form .settlement-selection-description { min-width: 0; }
.settlement-management-form .account-selection-summary input[type="checkbox"],
.settlement-management-form th.select-all-header input[type="checkbox"] { flex: 0 0 auto; min-height: 0; margin: 0; }
.settlement-management-form thead th { vertical-align: middle; }
/* 空结果文字留在宽表初始可见区域，不要求用户先横向滚动才能看到提示。 */
.settlement-management-form .wide-table td.empty { text-align: left; }
.settlement-management-form th.select-all-header { white-space: nowrap; }
.settlement-management-form th.select-all-header label { display: flex; align-items: center; max-width: none; white-space: nowrap; }
.settlement-filter-bar [hidden], [data-studio-notification-badge][hidden] { display: none; }
.search input { min-width: 280px; }
.sort-link { color: var(--muted); }
.sort-link:hover { color: var(--primary); }
.sort-indicator { color: var(--primary); font-weight: 700; }
.sortable-column-header { display: inline-flex; vertical-align: middle; align-items: center; white-space: nowrap; }
.sortable-column-header { gap: 4px; }
.sort-direction { align-items: center; border: 1px solid transparent; border-radius: 3px; display: inline-flex; flex-direction: column; height: 20px; justify-content: center; text-decoration: none; width: 18px; }
.sort-direction.is-inactive { opacity: .65; }
.sort-direction:hover, .sort-direction:focus-visible, .sort-direction.is-active { background: var(--brand-soft); }
.sort-triangle { color: var(--line-strong); display: block; font-size: 8px; height: 7px; line-height: 7px; }
.sort-triangle.is-current { color: var(--primary); }
.badge { border-radius: 99px; padding: 3px 8px; background: var(--panel-soft); border: 1px solid var(--line); color: var(--text); }
.badge.available { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }

/* 订单的三种彩色标签。类名由 studio/templatetags/order_extras.py 吐出，
   **加了状态就要在这里补一条**——有测试拿那边的映射表逐个来这里比对。

   三套刻意不同的视觉语言：优先级是实心填充（深浅 = 紧急程度），状态是淡底
   描边（色相 = 类别），控制标志是小号警示标。这样同一行里都出现橙色也不会
   看混——填充与描边一眼可分。 */

/* 优先级：普通与紧急两档，普通字号文字均满足 4.5:1。 */
.pri { display: inline-block; border-radius: 6px; padding: 2px 9px; font-weight: 600; white-space: nowrap; }
.pri-normal { background: var(--warning-bg); color: var(--warning-status-text); }
.pri-urgent { background: var(--red); color: #fff; }

/* 主流程状态：五组，橙色 = 有人在等你处理 */
.badge.st-waiting { border-color: var(--neutral-border); background: var(--neutral-bg); color: var(--neutral-text); }
.badge.st-active { border-color: var(--info-border); background: var(--info-bg); color: var(--info-text); }
.badge.st-attention { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-status-text); }
.badge.st-done { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.badge.st-void { border-color: var(--line); background: var(--panel-soft); color: var(--muted); text-decoration: line-through; }

/* 控制标志：只在异常时出现，所以可以比状态更扎眼 */
.cf { display: inline-block; border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cf-paused { background: var(--warning-bg); color: var(--warning-status-text); }
.cf-frozen { background: var(--red); color: #fff; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 20px; flex-wrap: wrap; }
.page-numbers { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-number { min-width: 30px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); text-align: center; }
.page-number.current { border-color: transparent; background: var(--brand-gradient); color: var(--on-gradient); font-weight: 750; box-shadow: var(--button-shadow); }
.page-ellipsis { padding: 0 2px; color: var(--muted); }
.page-total { color: var(--muted); }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
pre { max-width: 340px; max-height: 180px; overflow: auto; white-space: pre-wrap; margin: 0; font-size: 12px; }
.import-comparison { margin-bottom: 20px; }
.import-comparison h2 { margin-top: 0; }
.cancel-import-form { margin-top: 10px; }
.progress-label { font-weight: 700; color: var(--primary); white-space: nowrap; }
.import-resolution-actions { margin-top: 18px; }
.help-text { color: var(--muted); margin: 10px 0 0; }
.selection-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.account-selection-summary { display: grid; flex: 1 1 360px; min-width: 0; gap: 10px; }
.account-selection-quick-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.account-selection-quick-controls > [data-selection-status] { flex: 1 1 210px; color: var(--muted); }
.account-selection-count-control { display: inline-flex; align-items: center; gap: 8px; }
.account-selection-count-label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.account-selection-count-label input { width: 88px; }

/* 币号页面使用独立作用域，避免这轮视觉调整改变工作室系统的既有排版。 */
.account-section-content {
  font-size: 15px;
}
.account-section-content > h1,
.account-section-content .page-heading h1,
.account-section-content .card h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.015em;
}
.account-section-content h2 { font-size: 20px; line-height: 1.35; }
.account-section-content p { line-height: 1.65; }
.account-section-content .page-heading { align-items: flex-end; margin-bottom: 18px; }
.account-section-content .page-heading > div:first-child { min-width: 0; }
.account-section-content .page-heading p { max-width: 880px; font-size: 14px; }
.account-section-content .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.account-section-content .button.small { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.account-section-content .button:not(.primary):not(.danger):not(.caution):hover { background: var(--brand-soft); color: var(--brand-strong); }
.account-section-content .button:disabled { opacity: .48; cursor: not-allowed; }
.account-section-content .card { border-radius: 14px; box-shadow: var(--account-shadow); }
.account-page-actions { gap: 10px; }
.account-filter-toolbar {
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--account-shadow);
}
.account-filter-toolbar .account-filter-query { flex: 1 1 340px; width: auto; max-width: none; }
.account-filter-toolbar select { flex: 0 1 190px; width: auto; max-width: 190px; }
.account-selection-toolbar {
  align-items: stretch;
  gap: 18px;
  margin: 14px 0 12px;
  padding: 16px;
  border-color: var(--account-line-soft);
  border-radius: 10px;
  background: var(--account-selection-surface);
  box-shadow: var(--account-shadow);
}
.account-selection-toolbar .account-selection-summary { flex: 1 1 430px; align-content: center; gap: 9px; }
.account-selection-note { margin: 0; color: var(--muted); font-size: 13px; }
.account-selection-toolbar .account-selection-quick-controls { gap: 9px; }
.account-selection-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--account-line-soft);
  border-radius: 7px;
  background: var(--account-control-surface);
  color: var(--brand-strong) !important;
  font-weight: 700;
}
.account-selection-count-control {
  min-height: 36px;
  padding: 3px;
  border: 1px solid var(--account-line-soft);
  border-radius: 8px;
  background: var(--account-control-surface);
}
.account-selection-count-label { padding-left: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
.account-selection-count-label input {
  width: 76px;
  min-height: 30px;
  padding: 4px 7px;
  border-color: var(--account-line-soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.account-selection-count-control .button { min-height: 30px; }
.selection-clear-button { color: var(--muted); }
.selection-toolbar-actions {
  display: flex;
  flex: 1 1 420px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  min-width: 0;
}
.selection-action-group { gap: 7px; }
.selection-danger-actions {
  margin-left: 2px;
  padding-left: 10px;
  border-left: 1px solid var(--danger-divider);
}
.account-table-wrap {
  border-radius: 10px;
  box-shadow: var(--account-shadow);
}
.account-section-content .table-wrap {
  border-radius: 10px;
  box-shadow: var(--account-shadow);
}
.account-section-content .table-wrap table { font-size: 13px; }
.account-section-content .table-wrap th {
  padding: 7px 8px;
  background: var(--panel-soft-solid);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .01em;
}
.account-section-content .table-wrap td { padding: 7px 8px; }
.account-section-content .table-wrap tbody tr:nth-child(even) td { background: var(--panel-soft); }
.account-section-content .table-wrap tbody tr:hover td { background: var(--button-hover); }
.account-status-badge { min-width: 58px; text-align: center; font-size: 13px; font-weight: 650; }
.account-status-badge[data-account-status="AVAILABLE"] { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.account-status-badge[data-account-status="PURCHASE_PENDING"] { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-status-text); }
.account-status-badge[data-account-status="CONSUMED"] { border-color: var(--info-border); background: var(--info-bg); color: var(--info-text); }
.account-status-badge[data-account-status="BANKRUPT"] { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-status-text); }
.account-status-badge[data-account-status="DISABLED"] { border-color: var(--neutral-border); background: var(--neutral-bg); color: var(--neutral-text); }
.account-status-badge[data-account-status="SOLD"] { border-color: var(--sold-border); background: var(--sold-bg); color: var(--sold-text); }
.account-status-badge[data-account-status="DELETED"] { border-color: var(--error-border); background: var(--error-bg); color: var(--error-text); }
.account-section-content .row-actions { gap: 5px; }
.account-section-content .row-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-size: 13px;
}
.account-section-content .row-actions a:hover { border-color: var(--brand); background: var(--brand-soft); }
.account-section-content .row-actions a.danger-link { border-color: var(--danger-soft-border); background: var(--danger-soft-bg); color: var(--error-text); }
.account-section-content .row-actions a.danger-link:hover { border-color: var(--danger-soft-hover-border); background: var(--danger-soft-hover-bg); color: var(--error-text); }
.account-section-content .pagination { margin: 18px 0 0; }
.account-section-content .page-number { min-width: 34px; padding: 5px 9px; border-radius: 7px; }
.wide-table { min-width: 1280px; }
.comparison-table { min-width: 720px; }
.hide-extra .col-extra { display: none; }
.account-exceptions-cell { min-width: 360px; white-space: normal; }
.account-exception-record + .account-exception-record { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.account-exception-record small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.5; }
th.select-all-header { white-space: normal; }
th.select-all-header label { display: inline-flex; vertical-align: middle; align-items: center; gap: 6px; max-width: 140px; }
th.select-all-header.compact-select-all-header { white-space: nowrap; }
th.select-all-header.compact-select-all-header label { align-items: center; max-width: none; }
/* 异常审核详情页的审核条：意见框与两个按钮排一行 */
.review-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.review-form input[type="text"] { flex: 1 1 240px; }
.secret-cell { white-space: nowrap; }
.secret-cell .secret-value { overflow-wrap: anywhere; white-space: pre-wrap; }
.copy-cell { white-space: nowrap; }
.copy-cell .copy-value { overflow-wrap: anywhere; white-space: normal; }
.secret-mask { letter-spacing: 2px; color: var(--muted); }
.copy-cell .link-button,
.secret-cell .link-button { margin-left: 8px; color: var(--primary); font-size: 13px; }
[id^="sec-"] { scroll-margin-top: 12px; }
/* .module-nav 是通用的横排入口条，订单详情页的页内锚点导航也在用它 */
.module-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.page-heading h1, .card h1, .card h2 { text-shadow: var(--heading-glow); }
.order-anchors a { color: var(--muted); }
.order-anchors a:hover { color: var(--primary); }
details.card { margin: 18px 0; }
details.card summary { cursor: pointer; font-size: 19px; font-weight: 700; color: var(--text); }
details.card summary::marker { color: var(--muted); }
details.card > :not(summary) { margin-top: 16px; }
.module-nav a { padding: 6px 10px; border-radius: 5px; }
.module-nav a:hover { background: var(--brand-soft); }
/* 侧边栏里的那条改竖排、去掉卡片外框；作用域必须限定，否则会把详情页的锚点条也竖起来 */
.sidebar .module-nav { flex-direction: column; gap: 2px; margin: 0; padding: 0; border: 0; background: none; }
/* 菜单文字 16px（只放大这一处，表格与说明文字维持原样）；padding 跟着给宽一点，
   否则字变大后行高挤在一起。 */
.sidebar .module-nav a { display: block; padding: 8px 9px; border: 1px solid transparent; border-radius: 7px; color: var(--text); font-size: 14px; }
.sidebar .module-nav a:hover { border-color: var(--line); background: var(--brand-soft); color: var(--brand-strong); }
/* 当前页使用固定赛博渐变；判定仍由 context_processors._active_nav 的最长前缀匹配提供。 */
.sidebar .module-nav a.active { border-color: transparent; background: var(--brand-gradient); color: var(--on-gradient); font-weight: 750; box-shadow: var(--button-shadow); }
/* 分组标题做成带底色的分段头，让「业务」和「币号」一眼看出是两个系统。
   第一个分组不要上边框，否则侧边栏顶部会多一条悬空的线。 */
.nav-group-title {
  margin: 14px -10px 6px; padding: 6px 10px;
  background: var(--nav-heading-surface); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--brand-strong); font-size: 13px; font-weight: 800; letter-spacing: .12em;
}
.nav-group-title:first-of-type { margin-top: 0; border-top: none; }
.section-first { margin-top: 0; }
.studio-details { grid-template-columns: 150px 1fr; }
.studio-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 0; }
.studio-columns .card { min-width: 0; }
.subform { margin: 14px 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 8px; }
.subform legend { padding: 0 8px; font-weight: 700; }
.personnel-rate-section + .personnel-rate-section { margin-top: 20px; }
.personnel-rate-section > h2 { margin: 0 0 6px; }
.personnel-rate-section > p { margin: 0 0 16px; }
.personnel-rate-list { display: grid; gap: 14px; }
.personnel-rate-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.personnel-rate-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; background: var(--panel-soft); border-bottom: 1px solid var(--line);
}
.personnel-rate-card-header strong, .personnel-rate-card-header small { display: block; }
.personnel-rate-card-header small { margin-top: 2px; color: var(--muted); }
.regional-rate-grid, .regional-rate-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.regional-rate-grid { padding: 12px; }
.regional-rate-block, .regional-rate-form-block { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.regional-rate-block h3 { margin: 0 0 8px; color: var(--brand-strong); font-size: 16px; }
.regional-rate-values { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 10px; margin: 0; }
.regional-rate-values dt, .regional-rate-values dd { margin: 0; }
.regional-rate-values dt { color: var(--muted); }
.regional-rate-values dd { text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.regional-rate-values small { color: var(--muted); white-space: nowrap; }
.regional-rate-form-grid { margin: 18px 0; }
.regional-rate-form-block legend { padding: 0 7px; color: var(--brand-strong); font-weight: 700; }
.regional-rate-form-block p { margin: 0 0 12px; }
.regional-rate-form-block p:last-child { margin-bottom: 0; }
.record { padding: 12px 0; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record p { margin: 4px 0; }
.sensitive-actions { margin-top: 18px; }
.sensitive-actions form { margin: 0; }
.cancel-order-form { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.compact { margin-bottom: 10px; }
.image-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; }
.image-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.image-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--line); }
.image-card span, .image-card small { color: var(--muted); overflow-wrap: anywhere; }
.image-picker { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.image-picker:empty { display: none; }
.image-picker li { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.image-picker img, .image-picker .image-picker-blank { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--line); }
.image-picker small { color: var(--muted); overflow-wrap: anywhere; }
.chart-legend { display: flex; gap: 16px; align-items: center; color: var(--muted); margin-bottom: 6px; }
.chart-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
/* 三色跟着主题变量走：收入=青、支出=橙、利润=蓝；亏损覆盖为红。 */
.chart-swatch.income, .chart-bar.income, .chart-value.income { fill: var(--brand); background: var(--brand); }
.chart-swatch.expense, .chart-bar.expense, .chart-value.expense { fill: var(--amber); background: var(--amber); }
.chart-swatch.profit, .chart-bar.profit, .chart-value.profit { fill: var(--blue); background: var(--blue); }
/* 普通统计图继续允许容器内横滚；月度财务图在专用选择器中固定为一屏。 */
.chart-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: var(--shadow); }
.chart { display: block; }
.chart-zero { stroke: var(--line-strong); stroke-width: 1; }
.chart-label { font-size: 11px; fill: var(--muted); }
.chart-value { font-size: 9px; }
.finance-stats { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
.finance-monthly-stats { margin-bottom: 14px; }
.finance-summary-card { position: relative; }
.finance-summary-card::before { content: ""; position: absolute; inset: 8px auto 8px 0; width: 4px; border-radius: 4px; background: var(--blue); }
.finance-summary-card.income::before { background: var(--brand); }
.finance-summary-card.expense::before { background: var(--amber); }
.finance-summary-card.negative::before { background: var(--red); }
.finance-summary-card.negative strong { color: var(--red); }
.statistics-mode-control { display: flex; align-items: flex-start; gap: 10px 14px; flex-wrap: wrap; margin: 24px 0 18px; }
.statistics-mode-switch { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.statistics-mode-switch .button { min-width: 96px; height: 34px; min-height: 34px; }
.statistics-mode-switch .button[aria-current="true"] {
  cursor: default; border-color: transparent; background: var(--brand-gradient);
  filter: none; transform: none; transition: none;
}
.statistics-mode-switch .button[aria-current="true"]:hover,
.statistics-mode-switch .button[aria-current="true"]:active {
  border-color: transparent; background: var(--brand-gradient);
  filter: none; transform: none;
}
.business-month-toolbar { margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.business-month-toolbar input,
.filter-bar.business-month-toolbar .button { height: 34px; min-height: 34px; }
.business-month-navigation { display: flex; align-items: center; gap: 6px; }
.month-navigation-button { min-width: 34px; padding-inline: 8px; font-size: 20px; line-height: 1; }
.business-month-toolbar .button.disabled { cursor: not-allowed; opacity: .55; pointer-events: none; }
.monthly-worker-export-action { display: flex; flex: 1 1 320px; align-items: center; gap: 8px; min-width: 0; }
.filter-bar.business-month-toolbar .monthly-worker-export-button {
  height: auto; min-height: 34px; max-width: 100%; white-space: normal; text-align: center;
}
.monthly-worker-export-help, .monthly-worker-export-empty { margin: 0; font-size: 12px; line-height: 1.35; }
.monthly-worker-export-help { flex: 1 1 180px; min-width: 0; }
.monthly-worker-export-empty { align-self: center; }
.historical-worker-label { color: var(--warning-text); font-size: 12px; font-weight: 700; }
.money-lines { list-style: none; margin: 8px 0 0; padding: 0; }
.money-lines li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.money-lines li:first-child { border-top: 0; }
.money-lines em { font-style: normal; color: var(--muted); }
.money-lines b { font-size: 19px; }
.financial-month-chart-shell { position: relative; width: 100%; min-width: 0; }
.financial-month-chart-wrap { max-width: 100%; padding: 4px; overflow-x: clip; }
.financial-month-chart { width: 100%; height: 300px; min-width: 0; }
.financial-month-chart .chart-label { font-size: 12px; font-weight: 650; }
.chart-profit-segment { stroke: var(--blue); stroke-width: 2px; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.chart-profit-segment.negative { stroke: var(--red); }
.chart-profit-point { fill: var(--blue); stroke: var(--panel-solid); stroke-width: 1.5px; vector-effect: non-scaling-stroke; pointer-events: none; }
.chart-profit-point.negative { fill: var(--red); }
.chart-profit-extreme-ring { fill: none; stroke: var(--blue); stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.chart-profit-extreme-ring.negative { stroke: var(--red); }
.financial-chart-hit-area { fill: transparent; cursor: crosshair; }
.financial-chart-hit-area:focus-visible { outline: none; fill: var(--brand-soft); stroke: var(--focus); stroke-width: 2; }
.financial-chart-tooltip {
  position: absolute; z-index: 8; width: min(230px, calc(100% - 16px));
  padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow);
  line-height: 1.3; pointer-events: none;
}
.financial-chart-tooltip[hidden] { display: none; }
.financial-chart-tooltip strong { display: block; margin-bottom: 4px; color: var(--brand-strong); }
.financial-chart-tooltip dl { display: grid; gap: 4px; margin: 0; }
.financial-chart-tooltip dl div { display: flex; justify-content: space-between; gap: 12px; }
.financial-chart-tooltip [data-chart-tooltip-date-row][hidden] { display: none; }
.financial-chart-tooltip dt { color: var(--muted); white-space: normal; }
/* 金额及负号保持完整单行，较长标签在自己的空间自然换行。 */
.financial-chart-tooltip dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qc-images { margin: 18px 0; }
.qc-images h2 { font-size: 17px; margin: 14px 0 8px; }
.image-viewer { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.image-viewer summary { display: flex; align-items: center; gap: 10px; padding: 8px; cursor: pointer; }
.image-viewer summary img { width: 96px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--line); }
.image-viewer summary span { color: var(--muted); overflow-wrap: anywhere; }
/* display 必须挂在 [open] 上：直接写 .image-viewer-full { display: block }
   会盖掉浏览器“details 关闭时隐藏非 summary 子元素”的默认规则，
   结果就是点开能看、再点却关不上。 */
.image-viewer[open] .image-viewer-full { display: block; width: 100%; margin: 0 0 8px; padding: 0 8px; box-sizing: border-box; }
.timeline { border-left: 2px solid var(--line-strong); margin-left: 8px; padding-left: 20px; }
.timeline article { position: relative; padding: 0 0 18px; display: grid; grid-template-columns: 145px minmax(140px, 220px) 1fr; gap: 8px; }
.timeline article::before { content: ""; position: absolute; left: -26px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline time { color: var(--muted); }
.timeline p { grid-column: 2 / -1; margin: 0; }
.watermarked { position: relative; }
.watermark { position: sticky; top: 8px; z-index: 5; margin: 0 auto 12px; width: fit-content; max-width: 100%; padding: 7px 12px; border-radius: 8px; color: var(--warning-status-text); background: var(--warning-bg); border: 1px solid var(--warning-border); }
.order-compact .detail-full-only { display: none; }
.order-compact .detail-empty { display: none; }
.stage-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 20px; padding: 12px 16px; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.stage-bar li { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 99px; color: var(--muted); }
.stage-bar li:not(:last-child)::after { content: "→"; margin-left: 8px; color: var(--line-strong); }
.stage-dot { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--neutral-bg); color: var(--neutral-text); font-size: 13px; font-weight: 700; }
.stage-bar .stage-current { color: var(--text); font-weight: 700; }
.stage-bar .stage-current .stage-dot { background: var(--brand-gradient); color: var(--on-gradient); }
.stage-bar .stage-done { color: var(--success); }
.stage-bar .stage-done .stage-dot { background: var(--success-bg); color: var(--success-text); }
.notification-list { display: grid; gap: 12px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.notice.unread { border-left: 5px solid var(--primary); }
.notice p { margin: 4px 0; }

input::file-selector-button {
  margin-right: 10px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--panel-soft); color: var(--text); cursor: pointer;
}
pre { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--input-surface); color: var(--text); }

/* 登录页沿用既有模板结构，只改变赛博蓝紫主题和响应式密度。 */
.guest-shell { min-height: 100vh; }
.guest-shell .container { display: flex; min-height: 100vh; max-width: none; padding: 0; }
.login-layout {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 440px);
  align-items: center; gap: clamp(36px, 6vw, 88px);
  width: min(1180px, 100%); min-height: 100vh; margin: auto; padding: 48px;
  background: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.login-brand-panel {
  /* 完整品牌独占一行，避免 Logo 与标题争用双栏登录页的有限宽度。 */
  display: flex; flex-direction: column; align-items: center; gap: 24px; min-width: 0; padding: 30px;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--login-brand-surface);
  box-shadow: var(--shadow);
}
.login-logo { display: block; width: 112px; height: 112px; flex: 0 0 112px; object-fit: contain; filter: var(--logo-shadow); }
.login-brand-panel h1 {
  margin: 0; font-size: clamp(23px, 3vw, 32px); line-height: 1.4; letter-spacing: -.03em;
  white-space: nowrap;
}
.login-layout .auth-card { width: 100%; margin: 0; padding: 28px; }
.login-layout .auth-card h2 { margin: 0 0 20px; font-size: 28px; }
.login-layout .auth-card .button[type="submit"] { width: 100%; min-height: 40px; }

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root,
  html[data-theme="dark"] {
    --sidebar-surface: var(--sidebar-glass);
    --panel: var(--panel-glass);
    --panel-soft: rgba(16, 31, 58, .68);
    --input-surface: var(--input-glass);
  }
  html[data-theme="light"] {
    --sidebar-surface: var(--sidebar-glass);
    --panel: var(--panel-glass);
    --panel-soft: rgba(226, 239, 247, .74);
    --input-surface: var(--input-glass);
  }
  .sidebar, .topbar, .card, .auth-card, .stat, .table-wrap, .selection-bar,
  .account-filter-toolbar, .module-nav, .personnel-rate-card, .chart-wrap,
  .stage-bar, .toast, .notice, .login-brand-panel {
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  }
}
@media (max-width: 1024px) {
  /* 平板与手机使用侧边抽屉；桌面端仍保留原来的常驻侧栏。 */
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 110;
    width: min(360px, calc(100vw - 16px)); max-height: none; height: 100dvh;
    margin: 0; padding: 16px 14px 24px; border-radius: 0 18px 18px 0; overflow-y: auto;
    background: var(--sidebar-drawer);
    transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-header { position: sticky; top: -16px; z-index: 3; margin: -2px -2px 0; padding: 2px 2px 12px; background: var(--sidebar-drawer); flex-direction: column; align-items: flex-start; }
  .sidebar-header .sidebar-close { order: -1; align-self: flex-end; }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border: 0; border-radius: 6px; background: var(--panel-soft); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 105; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--nav-backdrop); cursor: pointer; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .nav-backdrop[hidden] { display: none; }
  .button.mobile-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { top: 10px; width: calc(100% - 24px); min-height: 56px; margin: 10px 12px 0; padding: 10px 14px; gap: 10px 14px; flex-wrap: wrap; }
  .topbar-primary { flex: 1 1 320px; }
  .topbar-tools { flex: 0 1 auto; margin-left: auto; }
  .region-selector { flex-wrap: wrap; }
  .content, .container { padding: 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
  .finance-stats { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
  .studio-columns { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
  .table-scroll-hint { display: block; }
  .dense-table-wrap:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
  .dense-table-wrap .wide-table th:first-child,
  .dense-table-wrap .wide-table tbody th:first-child,
  .dense-table-wrap .wide-table td:first-child { position: sticky; left: 0; z-index: 3; background: var(--panel); box-shadow: 1px 0 0 var(--line); }
  .dense-table-wrap .wide-table th:first-child { z-index: 4; background: var(--panel-soft); }
  .dense-table-wrap .wide-table tbody th:first-child { top: auto; }
  .dense-table-wrap .wide-table tbody tr:nth-child(even) td:first-child { background: var(--panel-soft); }
  .dense-table-wrap .wide-table tbody tr:hover td:first-child { background: var(--brand-soft); }
  .chart-wrap, .table-wrap { max-width: 100%; }
  .financial-month-chart { height: 240px; }
  .page-heading .button, .filter-bar .button, .selection-bar .button, .actions .button { min-height: 40px; }
  .account-section-content .page-heading { align-items: flex-start; }
  .account-filter-toolbar .account-filter-query { flex-basis: min(100%, 360px); }
  .selection-toolbar-actions {
    flex-basis: 100%;
    justify-content: flex-start;
    padding-top: 12px;
    border-top: 1px solid var(--account-line-soft);
  }
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
    gap: 24px; padding: 24px;
  }
  .login-brand-panel { gap: 16px; padding: 20px; }
  .login-logo { width: 80px; height: 80px; flex-basis: 80px; }
  .login-brand-panel h1 { font-size: 32px; }
  .login-layout .auth-card { padding: 24px; }
}

/* 901—1100px 仍保留双栏，但收紧留白和 Logo，避免品牌标题溢出。 */
@media (min-width: 901px) and (max-width: 1100px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
    gap: 24px; padding: 24px;
  }
  .login-brand-panel { gap: 16px; padding: 20px; }
  .login-logo { width: 80px; height: 80px; flex-basis: 80px; }
  .login-brand-panel h1 { font-size: 32px; }
  .login-layout .auth-card { padding: 24px; }
}

@media (max-width: 900px) {
  /* 常用列表转成字段卡片；wide-table 明确保留表格与横向滚动。 */
  .mobile-card-table-wrap { max-height: none; overflow: visible; border: 0; background: transparent; }
  .mobile-card-table { display: block; width: 100%; }
  .mobile-card-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .mobile-card-table tbody { display: grid; gap: 12px; }
  .mobile-card-table tbody tr { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
  .mobile-card-table tbody tr:nth-child(even) td,
  .mobile-card-table tbody tr:hover td { background: transparent; }
  .mobile-card-table tbody td {
    display: flex; align-items: flex-start; gap: 12px;
    width: 100%; padding: 9px 12px; border-bottom: 1px solid var(--line);
    white-space: normal; overflow-wrap: anywhere;
  }
  .mobile-card-table tbody td:last-child { border-bottom: 0; }
  .mobile-card-table tbody td::before {
    content: attr(data-mobile-label); flex: 0 0 108px;
    color: var(--muted); font-weight: 650; overflow-wrap: anywhere;
  }
  .mobile-card-table .mobile-cell-value { display: block; flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .mobile-card-table tbody td.empty { display: block; padding: 24px 12px; text-align: center; color: var(--muted); }
  .mobile-card-table tbody td.empty::before { content: none; }
  .mobile-card-table .row-actions .mobile-cell-value { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  /* 账号卡片在窄屏仍需暴露排序和全选入口，不能随完整表头一起隐藏。 */
  .mobile-card-table.mobile-sort-header-table thead,
  .mobile-card-table.mobile-account-select-all-table thead {
    position: static; display: block; width: auto; height: auto; margin: 0 0 10px; padding: 8px 10px;
    overflow: visible; clip: auto; clip-path: none; white-space: normal;
    border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  }
  .mobile-card-table.mobile-sort-header-table thead tr,
  .mobile-card-table.mobile-account-select-all-table thead tr { display: flex; align-items: center; gap: 16px; }
  .mobile-card-table.mobile-sort-header-table thead th,
  .mobile-card-table.mobile-account-select-all-table thead th { display: none; }
  .mobile-card-table.mobile-sort-header-table thead .mobile-sort-column {
    position: static; display: block; padding: 0; border: 0; background: transparent; box-shadow: none;
  }
  .mobile-card-table.mobile-account-select-all-table thead .compact-select-all-header {
    position: static; display: block; padding: 0; border: 0; background: transparent; box-shadow: none;
  }
  .regional-rate-grid, .regional-rate-form-grid { grid-template-columns: 1fr; }
  .login-layout {
    grid-template-columns: 1fr; align-self: center; gap: 0;
    width: min(560px, 100%); min-height: auto; margin: auto; padding: 24px;
    border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  }
  .login-brand-panel {
    justify-content: flex-start; gap: 16px; padding: 8px 8px 22px;
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .login-logo { width: 72px; height: 72px; flex-basis: 72px; }
  .login-brand-panel h1 { font-size: 28px; }
  .login-layout .auth-card {
    padding: 24px 8px 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

@media (max-width: 640px) {
  h1 { font-size: 22px; line-height: 1.3; }
  h2 { margin-top: 22px; font-size: 19px; }
  .topbar { padding: 10px 12px; }
  .topbar-primary, .topbar-tools { width: 100%; flex-basis: 100%; }
  .topbar-primary { gap: 8px; }
  .topbar-tools { justify-content: space-between; margin-left: 0; flex-wrap: wrap; }
  .identity { flex: 1 1 auto; }
  .region-selector { flex: 1 1 100%; justify-content: space-between; }
  .region-selector select { flex: 1 1 auto; max-width: 180px; }
  .display-preferences-summary { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .display-preferences-panel { position: fixed; top: 72px; right: 12px; left: 12px; width: auto; max-height: calc(100dvh - 84px); overflow-y: auto; }
  .user-menu { margin-left: auto; }
  .content, .container { padding: 12px; }
  .container { width: 100%; }
  .card, .auth-card { padding: 16px; border-radius: 8px; }
  .auth-card { margin: 28px auto; }
  .page-heading { margin-bottom: 14px; }
  .page-heading > .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .page-heading > .actions .button { display: flex; align-items: center; justify-content: center; text-align: center; }
  .personnel-rate-card-header { align-items: stretch; flex-direction: column; }
  .personnel-rate-card-header .button { width: 100%; text-align: center; }
  .regional-rate-grid { padding: 10px; }
  .filter-bar { align-items: stretch; }
  .filter-bar > input, .filter-bar > select, .filter-bar > .search, .filter-date { width: 100%; max-width: none; }
  .filter-date { justify-content: space-between; }
  .filter-date input { flex: 1 1 auto; width: auto; }
  .search input { min-width: 0; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { min-height: 42px; font-size: 16px; }
  .task-amount-slider { grid-template-columns: 1fr; gap: 5px; }
  .task-amount-preview { min-width: 0; text-align: left; }
  .button { min-height: 42px; }
  .button.small { min-height: 42px; }
  .filter-bar.business-month-toolbar .button { min-height: 42px; }
  .selection-bar { align-items: stretch; padding: 12px; }
  .account-selection-summary, .account-selection-quick-controls { width: 100%; }
  .account-selection-quick-controls { display: grid; grid-template-columns: 1fr; }
  .account-selection-quick-controls > [data-selection-status] { width: 100%; }
  .account-selection-count-control { display: grid; grid-template-columns: 1fr; width: 100%; padding: 7px; }
  .account-selection-count-label { justify-content: space-between; width: 100%; }
  .account-selection-count-label input { width: min(120px, 45vw); }
  .account-selection-quick-controls .button { width: 100%; }
  .selection-bar > .actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .selection-bar > .actions .button { width: 100%; white-space: normal; }
  .account-section-content > h1,
  .account-section-content .page-heading h1,
  .account-section-content .card h1 { font-size: 22px; }
  .account-section-content { font-size: 15px; }
  .account-section-content .button,
  .account-section-content .button.small { min-height: 42px; font-size: 14px; }
  .account-section-content .account-page-actions { grid-template-columns: 1fr 1fr; }
  .account-filter-toolbar { display: grid; grid-template-columns: 1fr; padding: 12px; }
  .account-filter-toolbar .account-filter-query,
  .account-filter-toolbar select,
  .account-filter-toolbar .button { width: 100%; max-width: none; }
  .account-selection-toolbar { padding: 12px; }
  .account-selection-status { width: 100%; }
  .selection-toolbar-actions,
  .selection-action-group { display: grid; grid-template-columns: 1fr; width: 100%; }
  .selection-toolbar-actions .button,
  .selection-action-group .button { width: 100%; white-space: normal; }
  .selection-danger-actions { margin-left: 0; padding: 10px 0 0; border-top: 1px solid var(--danger-divider); border-left: 0; }
  .details { display: block; border-top: 0; }
  .details dt { padding: 9px 0 2px; border-bottom: 0; font-size: 13px; font-weight: 650; }
  .details dd { padding: 0 0 9px; overflow-wrap: anywhere; }
  .stat { padding: 14px; }
  .stat strong { font-size: 21px; }
  .consumption-cards, .worker-statistics-cards { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: 1fr; }
  .stage-bar { display: grid; grid-template-columns: 1fr; padding: 10px; }
  .stage-bar li { width: 100%; }
  .stage-bar li:not(:last-child)::after { content: "↓"; margin-left: auto; }
  .order-anchors { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .order-anchors a { flex: 0 0 auto; white-space: nowrap; }
  .timeline { margin-left: 5px; padding-left: 16px; }
  .timeline article { grid-template-columns: 1fr; }
  .timeline p { grid-column: 1; }
  .notice { align-items: stretch; flex-direction: column; padding: 14px; }
  .notice form .button { width: 100%; }
  .pagination { gap: 10px; margin: 16px 0; }
  .page-numbers { justify-content: center; }
  .mobile-card-table tbody td { gap: 9px; padding: 9px 10px; }
  .mobile-card-table tbody td::before { flex-basis: 92px; }
  .chart-legend { flex-wrap: wrap; }
  .finance-stats { grid-template-columns: 1fr; }
  .statistics-mode-control { align-items: stretch; flex-direction: column; }
  .statistics-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .statistics-mode-switch .button { width: 100%; min-width: 0; }
  .business-month-toolbar { display: grid; grid-template-columns: 1fr; width: 100%; gap: 8px; }
  .business-month-toolbar .filter-date { width: 100%; }
  .business-month-navigation { display: grid; grid-template-columns: 1fr 1fr 1.4fr; width: 100%; }
  .business-month-navigation .button { width: 100%; }
  .monthly-worker-export-action { display: grid; width: 100%; gap: 6px; }
  .filter-bar.business-month-toolbar .monthly-worker-export-button { width: 100%; min-height: 42px; }
  .financial-month-chart { height: 160px; }
  .toast-stack { right: 10px; bottom: 10px; left: 10px; max-width: none; }
  .pulse-banner { flex-wrap: wrap; padding: 9px 12px; }
  .watermark { position: static; }
  .topbar { width: calc(100% - 16px); margin: 8px 8px 0; border-radius: 13px; }
  .content { padding: 12px; }
  .guest-shell .container { align-items: center; padding: 12px; }
  .login-layout { width: 100%; padding: 18px; border-radius: 16px; }
  .login-brand-panel { align-items: center; padding-bottom: 18px; }
  .login-logo { width: 60px; height: 60px; flex-basis: 60px; }
  .login-brand-panel h1 { font-size: 23px; }
  .login-layout .auth-card { padding-top: 20px; }
  .login-layout .auth-card h2 { margin-bottom: 18px; font-size: 23px; }
}

/* 英文全名较长，按视口排版；保留单行全文，不截断或省略。 */
html:lang(en) .login-brand-panel h1 { font-size: clamp(15px, 1.8vw, 20px); }

/* 自动更新的提示条。只在「用户正在填表、不能贸然刷新」时出现，
   所以它必须压在最上层且不随页面滚动跑掉。 */
.pulse-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--pulse-surface); color: var(--text);
  border-bottom: 1px solid var(--brand);
  box-shadow: var(--shadow); font-size: 15px;
}
.pulse-banner span { flex: 1; }

/* 个人通知的悬浮提醒。3 秒自动消失，多条纵向堆叠。
   只有 audience=PERSONAL 的通知会走到这里——群发的后端就不返回。 */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
  background: var(--panel); border: 1px solid var(--brand);
  border-left: 4px solid var(--brand); border-radius: 8px;
  padding: 10px 14px; box-shadow: var(--shadow);
  opacity: 1; transition: opacity .3s ease, transform .3s ease;
}
.toast.leaving { opacity: 0; transform: translateY(6px); }
.toast strong { display: block; color: var(--brand-strong); }
.toast p { margin: 4px 0 0; color: var(--text); font-size: 13px; }

/* 全站网络操作提示：固定在视口顶部并保持非模态，允许继续操作背景页面。
   层级高于顶栏、低于自动更新条与抽屉，避免抢占更紧急的系统反馈。 */
.site-notice {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 98;
  width: min(560px, calc(100vw - 24px));
  max-width: 100%;
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--brand);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  /* 非模态只表示没有全屏遮罩；提示表面仍需支持滚动和选择正文。 */
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
  overscroll-behavior: contain;
}
.site-notice[hidden] { display: none; }
.site-notice-title { margin: 0; font-size: 17px; color: var(--brand-strong); }
.site-notice-body {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
}
.site-notice-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 640px) {
  .site-notice {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 148px);
    padding: 12px;
  }
}
@media (max-height: 480px) {
  .site-notice {
    max-height: 45dvh;
  }
}

/* 成员消耗卡片：每人一张，四个数横排。沿用 .stats-grid 的网格与
   .money-lines 的行式排版（收支概览那边已经在用同一套）。 */
.consumption-cards .consumption-card span { display: flex; align-items: center; gap: 6px; }
.consumption-card { color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.consumption-card:hover, .consumption-card:focus-visible { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.consumption-card .money-lines em { color: var(--muted); }
.consumption-card .money-lines b { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.consumption-detail-stats { grid-template-columns: repeat(4, minmax(170px, 1fr)); }
.consumption-detail-stats small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.consumption-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.consumption-chart-grid section { min-width: 0; }
.consumption-chart { min-width: 480px; width: 100%; }
.chart-bar.consumption-count, .chart-value.consumption-count { fill: var(--brand); }
.chart-bar.consumption-assets, .chart-value.consumption-assets { fill: var(--blue); }
.consumption-detail-heading { align-items: flex-end; margin-top: 28px; margin-bottom: 10px; }
.consumption-detail-heading h2 { margin: 0; }
.consumption-detail-heading form { margin: 0; }
.consumption-detail-table { min-width: 2200px; }
/* 保留原列数上限和最小列宽；auto-fill 保留少量项目的空轨道。 */
.stats-grid.worker-statistics-cards { --stat-columns: 6; --stat-min: 150px; }
.stats-grid.studio-order-stats { --stat-columns: 5; --stat-min: 140px; }
.stats-grid.worker-statistics-detail-stats,
.stats-grid.finance-monthly-stats { --stat-columns: 4; --stat-min: 170px; }
[data-financial-breakdown-grid] { --stat-columns: 3; --stat-min: 220px; }
.stats-grid.worker-statistics-cards,
.stats-grid.studio-order-stats,
.stats-grid.worker-statistics-detail-stats,
.stats-grid.finance-monthly-stats,
[data-financial-breakdown-grid] {
  --stat-gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--stat-min), calc((100% - (var(--stat-columns) - 1) * var(--stat-gap)) / var(--stat-columns)))), 1fr));
}
.worker-statistics-card { position: relative; color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.worker-statistics-card:hover, .worker-statistics-card:focus-within { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.worker-statistics-card-link { color: var(--muted); overflow-wrap: anywhere; }
.worker-statistics-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.worker-statistics-card-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 3px; }
.worker-statistics-card .money-display { position: relative; z-index: 1; }
/* 金额始终是不可拆分的内联整体，标签可换行，数字沿用原字号。 */
.studio-money { white-space: nowrap; overflow-wrap: normal; word-break: normal; font-variant-numeric: tabular-nums; }
.stat strong.studio-money { display: block; font-size: 25px; }
.worker-statistics-card .money-lines li,
.worker-period-card .money-lines li,
.finance-stats .money-lines li { flex-wrap: wrap; }
.worker-statistics-card .money-lines b,
.worker-period-card .money-lines b,
.finance-stats .money-lines b { margin-left: auto; text-align: right; }
.worker-statistics-card .money-lines em,
.worker-statistics-card .money-lines > li > span { white-space: normal; overflow-wrap: anywhere; }
.worker-statistics-detail-stats small .studio-money,
.worker-task-category-section .studio-money { display: inline-block; margin: 0; font-size: inherit; }
.worker-statistics-detail-stats small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.worker-statistics-date-toolbar { margin: 0; padding: 4px; }
.worker-statistics-date-toolbar .filter-date { flex: 0 1 auto; min-width: 0; }
.worker-statistics-date-toolbar input[type="date"] { min-width: 148px; }
.worker-statistics-date-toolbar .button { height: 34px; min-height: 34px; }
.worker-statistics-date-toolbar .statistics-date-navigation { flex: 0 0 auto; }
.statistics-date-warning { flex: 1 0 100%; margin: 0; padding: 2px 6px; }
.worker-period-card { display: flex; flex-direction: column; gap: 6px; }
.worker-period-card-header { display: grid; gap: 4px; }
.worker-period-card-header strong { font-variant-numeric: tabular-nums; }
.worker-period-label { display: block; color: inherit; font-weight: 700; }
.worker-period-date { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.worker-task-category-section { margin-top: 20px; }
.worker-task-category-section h3 { margin: 0 0 10px; font-size: 17px; }
.worker-task-category-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.worker-task-category-table { min-width: 680px; table-layout: fixed; }
.worker-task-category-table th:first-child { width: 132px; min-width: 132px; }
.worker-task-category-table th,
.worker-task-category-table td { white-space: normal; overflow-wrap: anywhere; }
.worker-task-category-table tbody th { color: var(--brand-strong); }
.worker-task-category-table td span { display: block; min-width: 0; color: var(--muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.worker-task-category-table td span + span { margin-top: 2px; }
.worker-task-category-mobile { display: none; }
.worker-statistics-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.worker-statistics-chart-grid section { min-width: 0; }
.worker-statistics-chart { min-width: 480px; width: 100%; }
.chart-bar.worker-order-count, .chart-value.worker-order-count { fill: var(--brand); }
.chart-bar.worker-order-amount, .chart-value.worker-order-amount { fill: var(--blue); }
.worker-statistics-detail-heading { align-items: flex-end; flex-wrap: wrap; margin-top: 28px; margin-bottom: 10px; }
.worker-statistics-detail-heading > div { flex: 1 1 320px; min-width: 0; }
.worker-statistics-detail-heading h2 { margin: 0; }
.worker-statistics-detail-heading form { display: grid; flex: 0 1 430px; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; margin: 0; }
.worker-statistics-period-fields { display: flex; align-items: center; gap: 8px; min-width: 0; }
.worker-statistics-period-fields select { flex: 1 1 auto; width: 100%; min-width: 0; max-width: 430px; }
.worker-statistics-period-fields noscript { flex: 0 0 auto; }
.worker-statistics-selected-range { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.worker-statistics-inline-heading { margin-top: 28px; }
.warning-inline { color: var(--warning-text); font-weight: 600; }
@media (pointer: coarse), (max-width: 1024px) {
  .theme-toggle { width: 44px; height: 44px; flex-basis: 44px; }
}
@media (max-width: 1024px) {
  .consumption-detail-stats, .consumption-chart-grid,
  .worker-statistics-chart-grid { grid-template-columns: 1fr; }
  /* 横向布局的 flex-basis 只控制桌面宽度；列布局必须恢复内容高度。 */
  .worker-statistics-detail-heading > div { flex-basis: auto; width: 100%; }
  .worker-statistics-detail-heading form { flex-basis: auto; width: min(430px, 100%); }
}
@media (max-width: 1024px) {
  .stats-grid.worker-statistics-cards, .stats-grid.studio-order-stats,
  .stats-grid.worker-statistics-detail-stats, .stats-grid.finance-monthly-stats,
  [data-financial-breakdown-grid] { --stat-gap: 12px; }
  .stats-grid.worker-statistics-detail-stats, .stats-grid.finance-monthly-stats { --stat-columns: 2; }
}
@media (max-width: 640px) {
  .stats-grid.worker-statistics-cards,
  .stats-grid.worker-statistics-detail-stats,
  .stats-grid.finance-monthly-stats,
  [data-financial-breakdown-grid] { --stat-columns: 1; }
  .stat strong.studio-money { font-size: 21px; }
  .worker-task-category-table-wrap { display: none; }
  .worker-task-category-mobile { display: grid; gap: 18px; }
  .worker-task-category-mobile-period { border-top: 1px solid var(--line); }
  .worker-task-category-mobile-period h4 { margin: 0; padding: 10px 0 6px; color: var(--brand-strong); font-size: 16px; }
  .worker-task-category-mobile-period h4 .worker-period-date { color: var(--muted); }
  .worker-task-category-mobile-row { display: grid; grid-template-columns: minmax(106px, .8fr) minmax(0, 1.2fr); gap: 3px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
  .worker-task-category-mobile-row b { grid-row: 1 / span 3; color: var(--text); overflow-wrap: anywhere; }
  .worker-task-category-mobile-row span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
  .worker-statistics-date-toolbar { display: flex; width: 100%; gap: 8px; }
  .worker-statistics-date-toolbar .filter-date,
  .worker-statistics-detail-heading form { width: 100%; max-width: none; }
  .worker-statistics-date-toolbar .statistics-date-navigation { display: grid; grid-template-columns: 1fr 1fr 1.4fr; width: 100%; }
  .worker-statistics-date-toolbar .statistics-date-navigation .button,
  .worker-statistics-date-toolbar noscript .button { width: 100%; }
  .worker-statistics-date-toolbar noscript { width: 100%; }
  .worker-statistics-date-toolbar input[type="date"] { flex: 1 1 0; width: auto; min-width: 0; max-width: 100%; }
  .worker-statistics-period-fields { width: 100%; }
  .worker-statistics-period-fields select { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .dashboard-order-stat:hover,
  .dashboard-order-stat:focus-visible,
  .consumption-card:hover,
  .consumption-card:focus-visible,
  .worker-statistics-card:hover,
  .worker-statistics-card:focus-within,
  .toast.leaving { transform: none; }
}

@media (forced-colors: active) {
  .sidebar, .topbar, .card, .auth-card, .stat, .table-wrap, .selection-bar,
  .module-nav, .login-layout, .login-brand-panel, .statistics-mode-switch,
  .business-month-toolbar, .financial-chart-tooltip, .site-notice,
  .worker-task-category-table-wrap { border: 1px solid CanvasText; box-shadow: none; }
  .sidebar .module-nav a.active, .button.primary, .page-number.current {
    border: 2px solid Highlight; background: Highlight; color: HighlightText;
  }
  .statistics-mode-switch .button[aria-current="true"],
  .statistics-mode-switch .button[aria-current="true"]:hover,
  .statistics-mode-switch .button[aria-current="true"]:active {
    border: 2px solid Highlight; background: Highlight; color: HighlightText;
    filter: none; transform: none;
  }
  .theme-toggle { border: 1px solid ButtonText; background: ButtonFace; color: ButtonText; box-shadow: none; }
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: Highlight; }
  .financial-chart-hit-area:focus-visible { fill: transparent; stroke: Highlight; }
  .site-logo, .login-logo { forced-color-adjust: none; }
}

/* 金额片段隔离于统计卡和分类表的通用 span 样式。 */
.money-display,
.stat .money-display,
.worker-task-category-table td .money-display {
  display: inline-block; width: auto; min-width: 0; max-width: 100%; margin: 0; padding: 0;
  border: 0; border-radius: 3px; background: transparent; color: inherit;
  font: inherit; line-height: inherit; text-align: inherit; vertical-align: baseline;
  white-space: nowrap; overflow: visible; overflow-wrap: normal; word-break: normal;
}
button.money-display { cursor: pointer; touch-action: manipulation; }
button.money-display:hover { background: var(--brand-soft); }
button.money-display:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.money-display .money-text,
.money-display .money-text span,
.money-display .money-text tspan {
  display: inline; margin: 0; padding: 0; color: inherit; font: inherit;
  white-space: nowrap; overflow-wrap: normal; word-break: normal;
}
.money-display .money-text .money-currency,
.money-display .money-text .money-unit { font-size: min(1em, 14px); }
text[data-money-display] .money-currency,
text[data-money-display] .money-unit { font-size: min(1em, 14px); }
.money-text { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 顶部有边框控件共用区服选择框的响应式高度；只统一尺寸，不改各自形状。 */
:where(.topbar, .guest-theme-control) { --bordered-top-control-height: 34px; }
.topbar .mobile-nav-toggle,
.topbar .page-back,
.topbar .region-selector select,
:where(.topbar, .guest-theme-control) .display-preferences > summary,
:where(.topbar, .guest-theme-control) .display-preferences-panel select,
:where(.topbar, .guest-theme-control) .display-preferences-panel .button,
:where(.topbar, .guest-theme-control) .theme-toggle {
  box-sizing: border-box;
  height: var(--bordered-top-control-height);
  min-height: var(--bordered-top-control-height);
  max-height: var(--bordered-top-control-height);
  align-items: center; justify-content: center;
}
:where(.topbar, .guest-theme-control) .theme-toggle {
  width: var(--bordered-top-control-height);
  flex-basis: var(--bordered-top-control-height);
}
@media (max-width: 640px) {
  :where(.topbar, .guest-theme-control) { --bordered-top-control-height: 42px; }
}

.money-popover {
  position: fixed; z-index: 120; box-sizing: border-box; width: min(26rem, calc(100vw - 16px));
  max-height: calc(100dvh - 16px); display: flex; flex-direction: column;
  padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow);
}
.money-popover[hidden] { display: none; }
.money-popover header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.money-popover h2 { margin: 0; font-size: 16px; }
.money-popover-body { min-height: 0; margin-top: 10px; overflow: auto; overscroll-behavior: contain; }
.money-popover-body dl { margin: 0; }
.money-popover-body dt { color: var(--muted); overflow-wrap: anywhere; }
.money-popover-body dd { margin: 4px 0 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.financial-chart-tooltip dl div { flex-wrap: wrap; }
.financial-chart-tooltip dd { margin-left: auto; }
[data-chart-money-details] { margin-top: 6px; }

/* 汇率保留全部有效位，不能复用业务金额的缩写；窄屏让数字整项换行。 */
.manual-display-rate-management { min-width: 0; }
.manual-display-rate-management .page-heading { align-items: flex-start; }
.manual-display-rate-management .page-heading > div { min-width: 0; }
.manual-display-rate-management .card { min-width: 0; }
.manual-display-rate-management .card + .card { margin-top: 20px; }
.manual-display-rate-management .fx-rate-grid,
.manual-display-rate-management .fx-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px;
  margin: 16px 0;
}
.manual-display-rate-management .fx-rate-grid > div,
.manual-display-rate-management .fx-meta > div { min-width: 0; }
.manual-display-rate-management dt { color: var(--muted); margin-bottom: 4px; }
.manual-display-rate-management dd { margin: 0; overflow-wrap: anywhere; }
.manual-display-rate-management .fx-rate-grid dd {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
}
.manual-display-rate-management .fx-number {
  display: inline-block; white-space: nowrap; overflow-wrap: normal; word-break: normal;
  font-variant-numeric: tabular-nums;
}
.manual-display-rate-management input { min-width: 0; }
.manual-display-rate-management .button { min-height: 44px; white-space: normal; text-align: center; }
.manual-display-rate-management .button:disabled { opacity: .55; cursor: not-allowed; }
.manual-display-rate-management .fx-history-list { list-style: none; margin: 0; padding: 0; }
.manual-display-rate-management .fx-history-list > li { padding: 16px 0; border-top: 1px solid var(--line); }
.manual-display-rate-management .fx-history-list h3 { margin: 0 0 6px; }
.manual-display-rate-management .fx-history-list dd { flex-direction: column; align-items: flex-start; }
.manual-display-rate-management .fx-comparison dd { flex-direction: column; align-items: flex-start; }
.manual-display-rate-management summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: 600; }
.manual-display-rate-management details:not([open]) { padding-block: 10px; }
.manual-display-rate-management [data-fx-restore] { margin-top: 12px; }
.manual-display-rate-management .display-rate-meta { margin: 0; }
.manual-display-rate-management summary:focus-visible,
#fx-errors:focus-visible, #order-form-errors:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.manual-display-rate-management .pagination { margin-inline: 0; gap: 12px; }
.order-entry-form, .order-money-entry { min-width: 0; }
.order-money-entry { margin-block: 16px; }
.order-money-entry input { min-width: 0; width: 100%; font-variant-numeric: tabular-nums; }
.order-money-entry output { display: block; margin-block: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.order-money-entry .help-text { overflow-wrap: anywhere; }
.order-money-entry .help-text p { margin-block: 6px; }
.order-money-entry .order-money-rate { display: inline-flex; flex-wrap: wrap; gap: 0 4px; }
.order-money-entry .order-money-rate span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-money-entry .errornote { color: var(--error-text); overflow-wrap: anywhere; }
.order-entry-form .button { min-height: 44px; white-space: normal; }
.order-entry-form .button:disabled { opacity: .55; cursor: not-allowed; }
.order-entry-form .credential-recognition { min-width: 0; margin-block: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.order-entry-form .credential-recognition .help-text { margin-block: 6px 10px; overflow-wrap: anywhere; }
.order-entry-form .credential-recognition textarea { display: block; min-width: 0; resize: vertical; }
.order-entry-form .credential-recognition .actions { flex-wrap: wrap; margin-block: 10px 0; }
.order-entry-form .credential-recognition [data-credential-status]:empty { margin: 0; }
.order-entry-form .credential-recognition [data-credential-status][data-error] { color: var(--error-text); }
@media (max-width: 640px) {
  .manual-display-rate-management .fx-rate-grid,
  .manual-display-rate-management .fx-meta { grid-template-columns: minmax(0, 1fr); }
}
