@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Geist:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  font-family: 'Geist', 'Microsoft YaHei UI', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  color: #17253c;
  background: #f3f6fb;
  --ink: #17253c;
  --muted: #536580;
  --line: #e3eaf3;
  --surface: white;
  --blue: #2458e0;
  --rail: 224px;
  --radius: 13px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .57; cursor: wait; }
a { text-decoration: none; color: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #4878ff; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; display: block; }
small { font-size: 12px; }
code { font-family: 'Geist', ui-monospace, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 10px; top: 10px; z-index: 90; transform: translateY(-130%); padding: 8px 12px; background: white; color: var(--blue); border-radius: 8px; }
.skip-link:focus { transform: none; }

.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--rail); background: #101d35; color: #edf3ff; display: flex; flex-direction: column; padding: 25px 15px 16px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 6px; padding: 1px 0 25px; border-bottom: 1px solid #26354e; white-space: nowrap; }
.brand img { border-radius: 11px; box-shadow: 0 5px 16px #05132d85; }
.brand strong { font-size: 16px; font-weight: 720; letter-spacing: .015em; }
.nav-list { display: grid; gap: 5px; padding-top: 20px; }
.nav-list a { display: flex; align-items: center; gap: 12px; padding: 11px; min-height: 43px; color: #bac8df; font-size: 14px; border: 1px solid transparent; border-radius: 8px; }
.nav-list a:hover { color: white; background: #1d3050; }
.nav-list a[aria-current='page'] { color: #f9fbff; background: #24477e; border-color: #345990; font-weight: 650; }
.nav-list a[aria-current='page'] svg { color: #adc9ff; }
.nav-list a span { flex: 1; }
.side-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 20px 10px 5px; color: #a5b5d0; font-size: 13px; }
.workspace { margin-left: var(--rail); min-width: 0; }
.topbar { height: 61px; padding: 0 30px; display: flex; justify-content: space-between; align-items: center; background: white; border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.top-mail i { width: 8px; height: 8px; background: #b83142; border-radius: 50%; }
.menu-toggle { display: none !important; }
.scrim { display: none; }

#view { max-width: 1600px; margin: 0 auto; padding: 26px 30px 40px; outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 21px; }
.page-heading h1 { font: 750 30px/1.25 'Geist', 'Microsoft YaHei UI', 'PingFang SC', sans-serif; letter-spacing: -.025em; color: #14223a; }
.page-heading p { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.55; }
.page-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.last-scan { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.last-scan:hover { color: var(--blue); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; min-height: 36px; white-space: nowrap; border-radius: 8px; border: 1px solid transparent; font-weight: 650; font-size: 14px; line-height: 1.35; }
.btn-primary { color: white; background: var(--blue); box-shadow: 0 2px 3px #1b43b021; }
.btn-primary:hover:not(:disabled) { background: #1648c7; }
.btn-secondary { background: white; color: #26477b; border-color: #d7e2f2; }
.btn-secondary:hover { background: #eef4ff; border-color: #c4d3ed; }
.btn-ghost { color: #2453c5; background: transparent; }
.btn-ghost:hover, .icon-btn:hover { background: #edf3ff; color: #1c4ed0; }
.btn-danger { color: #a62a32; border-color: #f6d5d8; background: #fff3f3; }
.btn-danger:hover { background: #ffe5e7; }
.icon-btn { color: #536580; background: transparent; border: 0; width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border-radius: 7px; }
.text-link { display: inline-flex; align-items: center; gap: 3px; color: #2454cb; font-size: 13px; font-weight: 640; white-space: nowrap; }
.text-link:hover { color: #14388b; text-decoration: underline; text-underline-offset: 4px; }

.hero { position: relative; isolation: isolate; min-height: 205px; border-radius: 15px; overflow: hidden; color: #fff; background: #061229; display: flex; align-items: center; margin-bottom: 19px; }
.hero::before, .hero::after { position: absolute; inset: 0; content: ''; z-index: -1; }
.hero::before { background: url('/assets/logistics-hero.webp') right 51% / 61% auto no-repeat; }
.hero::after { background: linear-gradient(90deg, #08152e 0%, #08152e 15%, #08152edc 37%, #0b1d3700 69%); }
.hero-content { padding: 24px 32px; }
.hero h2 { font-size: clamp(27px, 2.4vw, 38px); letter-spacing: -.035em; line-height: 1.22; font-weight: 760; }
.mail-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 13px 0 17px; padding: 0; list-style: none; }
.mail-stages li { display: flex; align-items: center; gap: 7px; color: #dce8ff; font-size: 14px; font-weight: 550; }
.mail-stages li + li::before { content: '›'; color: #8baae7; font-size: 19px; margin-right: 3px; line-height: 1; }
.mail-stages svg { color: #98b8ff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-link { color: white; background: #d7e8ff18; border: 1px solid #a6c3fc60; }
.hero-link:hover { background: #d7e8ff33; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric-card, .panel, .page-metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px #13284a04; min-width: 0; }
.metric-card { display: grid; justify-items: start; padding: 14px 15px 12px; transition: border-color .16s, box-shadow .16s; }
.metric-card:hover { border-color: #aac3f5; box-shadow: 0 4px 12px #133b7f12; }
.metric-top { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 8px; color: #7590af; }
.metric-icon, .mini-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; flex: none; }
.mini-icon { width: 31px; height: 31px; border-radius: 8px; }
.metric-label { font-size: 14px; color: #425874; font-weight: 620; }
.metric-value { font-family: 'DM Sans', 'Geist', sans-serif; font-variant-numeric: tabular-nums; font-weight: 760; font-size: 30px; letter-spacing: -.045em; line-height: 1.22; }
.metric-value span { font: 550 13px 'Geist', 'Microsoft YaHei UI', sans-serif; color: var(--muted); letter-spacing: 0; }
.amber, .orange, .warning { color: #8e5104; background: #fff2dc; }
.red, .danger { color: #b83142; background: #ffeaee; }
.violet, .purple { color: #6745bb; background: #f1ebfd; }
.blue, .info { color: #2256d1; background: #e9f0ff; }
.green, .success { color: #137451; background: #e3f6ed; }
.gray, .neutral { color: #4b5e79; background: #eef2f7; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; gap: 17px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 14px; }
.panel-head h2, .panel-head h3 { color: var(--ink); font-size: 16px; font-weight: 720; }
.panel-head p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.panel-body { padding: 16px 18px; }
.table-wrap { overflow-x: auto; position: relative; }
.data-table { width: 100%; text-align: left; border-collapse: collapse; font-size: 13px; }
.data-table th { font-weight: 650; color: #536880; background: #f5f8fc; font-size: 12px; white-space: nowrap; }
.data-table td, .data-table th { border-bottom: 1px solid #edf1f8; padding: 11px 12px; vertical-align: middle; }
.data-table td:first-child, .data-table th:first-child { padding-left: 18px; }
.data-table td:last-child, .data-table th:last-child { padding-right: 15px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f9fbff; }
.data-table .timestamp { color: #405672; white-space: nowrap; font-variant-numeric: tabular-nums; }
.risk-name { display: flex; align-items: center; gap: 9px; min-width: 165px; }
.risk-name strong, .risk-name small { display: block; }
.risk-name strong { white-space: nowrap; font-size: 13px; font-weight: 680; }
.risk-name small { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; vertical-align: middle; border-radius: 5px; padding: 3px 7px; font-size: 12px; font-weight: 620; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { color: #137451; background: #e3f6ed; }
.badge-amber { color: #8e5104; background: #fff2dc; }
.badge-red { color: #b83142; background: #ffeaee; }
.badge-blue { color: #2256d1; background: #e9f0ff; }
.badge-purple { color: #6745bb; background: #f1ebfd; }
.badge-muted { color: #4b5e79; background: #eef2f7; }
.recent-mail ul { display: grid; margin: 0; padding: 0 10px 8px; list-style: none; }
.recent-mail li + li { border-top: 1px solid #edf1f8; }
.recent-mail li a { display: flex; align-items: center; gap: 9px; padding: 10px 8px; border-radius: 8px; }
.recent-mail li a:hover { background: #f3f7ff; }
.recent-mail li a > svg { color: #7188a7; }
.mail-row-name { flex: 1; min-width: 0; font-size: 13px; }
.mail-row-name > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-name > span { color: var(--muted); }

.page-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px; margin-bottom: 18px; }
.page-metric { padding: 14px 17px; display: grid; gap: 4px; }
.page-metric strong { font-size: 24px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.page-metric small, .muted { color: var(--muted); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.tab-list { display: flex; align-items: center; gap: 5px; overflow-x: auto; }
.tab { flex: none; color: #4e6380; border: 1px solid transparent; background: transparent; text-decoration: none; border-radius: 7px; padding: 6px 9px; font-size: 12px; font-weight: 600; }
.tab:hover { color: var(--blue); background: #f0f5ff; }
.tab.is-active, .tab[aria-selected='true'], .tab[aria-current='page'] { background: #eaf1ff; color: #2255cf; border-color: #dce8ff; }
input, select, textarea { width: 100%; border: 1px solid #d6e1ef; border-radius: 7px; color: var(--ink); background: #fff; padding: 8px 10px; min-height: 36px; font-size: 13px; }
input::placeholder, textarea::placeholder { color: #6c7e97; }
input[type='radio'], input[type='checkbox'] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--blue); }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.field { display: grid; gap: 5px; align-content: start; color: #314765; font-size: 12.5px; font-weight: 600; }
.field small { color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full, .form-grid .wide, .form-grid .field-wide { grid-column: 1 / -1; }
.empty, .initial-loading { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.empty svg { margin: 0 auto 8px; }
.initial-loading > * + * { margin-top: 12px; }
.avatar { display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #edf2fe; color: #2a54b8; font-size: 11px; font-weight: 700; }
.dialog { padding: 0; width: min(640px, calc(100% - 28px)); max-height: calc(100% - 32px); border: 1px solid #d6e2f3; border-radius: 14px; color: var(--ink); background: white; box-shadow: 0 18px 70px #14295340; overflow: auto; }
.dialog::backdrop { background: #081732a0; }
.dialog-header, .dialog-head, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px 18px; }
.dialog-header, .dialog-head { border-bottom: 1px solid var(--line); }
.dialog-header h2, .dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 16px 18px; }
.dialog-actions { justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog p { font-size: 13px; }
.case-layout { display: grid; grid-template-columns: minmax(235px, .55fr) minmax(0, 1.6fr); align-items: start; gap: 16px; }
.customer-guide { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; background: #edf4ff; border: 1px solid #cbdcfa; border-radius: var(--radius); color: #193768; margin-bottom: 17px; padding: 15px 17px; }
.customer-guide > div:first-child { flex: 1 1 240px; }
.customer-guide h2 { font-size: 15px; font-weight: 730; }
.customer-guide p { margin-top: 4px; font-size: 13px; }
.customer-guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.case-list { min-width: 0; }
.case-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 0; border-bottom: 1px solid #e9eff8; padding: 12px 15px; }
.case-row:hover, .case-row.is-active { background: #edf4ff; }
.case-row > * { min-width: 0; }
.case-content { min-width: 0; }
.case-content .panel + .panel { margin-top: 15px; }
.workflow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; gap: 10px; }
.workflow-step { font-size: 12px; color: var(--muted); }
.proposal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.proposal-card { background: #f7faff; border: 1px solid #e0eafc; border-radius: 9px; padding: 12px; font-size: 13px; }
.proposal-card h3 { font-size: 14px; }
.proposal-card p { line-height: 1.65; margin: 8px 0; }
.record-title, .record-id { display: block; min-width: 0; }
.record-title { font-weight: 650; }
.record-id { color: var(--muted); font-size: 11px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.page-metric > span { font-size: 12px; color: var(--muted); }
.text-info, .page-link { color: #2654bf; }
.text-warning { color: #8e5104; }
.text-danger { color: #b83142; }
.text-purple { color: #6745bb; }
.page-link:hover { text-decoration: underline; }
.page-search { position: relative; min-width: 0; flex: 0 1 234px; }
.page-search svg { position: absolute; pointer-events: none; color: #6380a3; left: 9px; top: 10px; }
.page-search input { padding-left: 32px; }
.tab-count { margin-left: 3px; font-size: 10px; color: #496488; }
.order-progress { display: flex; align-items: center; gap: 7px; font-size: 11px; font-variant-numeric: tabular-nums; min-width: 101px; }
.order-progress progress { width: min(70px, 8vw); min-width: 42px; height: 6px; border: 0; border-radius: 9px; appearance: none; }
.order-progress progress::-webkit-progress-bar { background: #e8eef7; border-radius: 9px; }
.order-progress progress::-webkit-progress-value { background: var(--progress, #4e76da); border-radius: 9px; }
.order-progress progress::-moz-progress-bar { background: var(--progress, #4e76da); border-radius: 9px; }
.progress-warning { --progress: #e59b32; }
.progress-danger { --progress: #d95965; }
.progress-success { --progress: #419376; }
.badge-list { display: flex; gap: 4px; flex-wrap: wrap; }
.inline-notice { border: 1px solid #dbe7fa; background: #f1f6ff; color: #275187; padding: 10px 12px; margin: 10px 0; border-radius: 8px; font-size: 12px; }
.inline-notice.error, .form-error { border-color: #f3d3d3; background: #fff3f3; color: #a32938; }
.form-error { padding: 8px 10px; border-radius: 7px; font-size: 12px; }
.case-kicker { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.case-content > .panel-head { border-bottom: 1px solid var(--line); }
.case-content .panel-head h2 { font-size: 19px; }
.case-rows { overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); }
.workflow-step { display: flex; align-items: center; gap: 6px; flex-direction: column; text-align: center; }
.workflow-icon, .proposal-icon { display: inline-grid; place-items: center; border-radius: 8px; width: 31px; height: 31px; background: #eef2f8; color: #607590; }
.workflow-step.is-complete .workflow-icon { background: #e3f6ed; color: #17714e; }
.workflow-step.is-current { font-weight: 700; color: #214cc4; }
.workflow-step.is-current .workflow-icon, .proposal-icon { background: #e8f0ff; color: #2855d0; }
.case-section { border-top: 1px solid #e8eef6; padding-top: 14px; margin-top: 15px; }
.case-section > h3, .section-heading h3 { font-size: 14px; margin-bottom: 8px; }
.case-section > .muted { font-size: 12px; margin: 7px 0; }
.case-message { padding: 11px 12px; margin: 8px 0; border: 1px solid #e2ebf8; background: #f7faff; border-radius: 8px; }
.case-message strong { font-size: 12px; }
.case-message p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; font-size: 12px; }
.case-message small { font-size: 11px; color: var(--muted); }
.mail-heading { margin: 0; font-size: 14px; }
.mail-meta { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 9px 22px; margin: 8px 0 0; }
.mail-meta div { min-width: 0; }
.mail-meta dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.mail-meta dd { margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.case-message .mail-body { font-size: 14px; }
.mail-filter { flex: 0 1 260px; display: flex; align-items: center; white-space: nowrap; gap: 9px; }
.mail-filter select { min-width: 115px; }
.section-heading, .proposal-footer, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.section-heading { margin-bottom: 8px; }
.section-heading h3 { margin: 0; }
.proposal-card { display: flex; flex-direction: column; align-items: flex-start; }
.proposal-card h4 { margin: 7px 0 0; font-size: 14px; }
.proposal-card.is-selected { outline: 2px solid #87aaef; }
.proposal-footer { width: 100%; margin-top: auto; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 14px; }
.detail-grid > div { background: #f6f8fc; padding: 9px 10px; border-radius: 7px; overflow-wrap: anywhere; }
.detail-grid dt { color: var(--muted); margin: 0 0 3px; font-size: 11px; }
.detail-grid dd { margin: 0; font-size: 13px; }
.dialog-lead { margin-bottom: 13px; color: var(--muted); }
.icon-button { display: inline-grid; place-items: center; background: transparent; border: 0; color: var(--muted); border-radius: 7px; width: 32px; height: 32px; padding: 0; }
.icon-button:hover { background: #edf3ff; color: var(--blue); }
.form-actions { margin-top: 14px; }
.run-log { display: grid; gap: 7px; margin: 8px 0; padding: 10px 10px 10px 25px; color: #445674; background: #f4f7fb; border-radius: 7px; font-size: 12px; }
.run-log small { color: var(--muted); margin-right: 5px; }
.toast-region { position: fixed; z-index: 70; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(380px, calc(100vw - 40px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 8px 10px 8px 13px; background: white; border: 1px solid #cce9df; color: #14664c; border-radius: 9px; box-shadow: 0 4px 24px #182f4f1a; font-size: 13px; }
.toast span { flex: 1; }
.toast-error { border-color: #efd0d3; color: #a42c37; }

@media (max-width: 1140px) {
  :root { --rail: 200px; }
  #view, .topbar { padding-left: 21px; padding-right: 21px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.55fr) minmax(278px, 1fr); }
  .data-table td, .data-table th { padding-left: 9px; padding-right: 9px; }
  .hero::before { background-size: 76% auto; }
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .recent-mail { grid-row: 1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: #07162d86; }
  .workspace { margin-left: 0; }
  .topbar { height: 54px; padding: 0 14px; }
  .menu-toggle { display: inline-grid !important; }
  #view { padding: 19px 13px 28px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 25px; }
  .page-heading-actions { gap: 7px; }
  .last-scan { display: none; }
  .hero { min-height: 192px; }
  .hero-content { padding: 21px 17px; }
  .hero::before { background-size: auto 100%; background-position: 85% center; }
  .hero::after { background: linear-gradient(90deg, #08152e 0%, #08152ee8 30%, #08152e5b 85%); }
  .hero h2 { font-size: 28px; }
  .mail-stages { gap: 7px; }
  .mail-stages li { font-size: 13px; gap: 4px; }
  .metrics { gap: 9px; }
  .metric-card { padding: 11px; }
  .panel-head { padding-inline: 13px; }
  .data-table td:first-child, .data-table th:first-child { padding-left: 12px; }
  .proposal-grid, .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .page-heading p { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
