:root {
  color-scheme: light;
  --ink: #17222c;
  --muted: #65717c;
  --soft: #8a949d;
  --line: #e7e9e7;
  --paper: #ffffff;
  --canvas: #f4f6f3;
  --navy: #123a4a;
  --navy-2: #0b2e3b;
  --orange: #f26a2e;
  --orange-2: #ff8b53;
  --blue: #2e6f95;
  --green: #23866f;
  --yellow: #d69a1f;
  --red: #c84e46;
  --shadow: 0 14px 38px rgba(18, 58, 74, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  background:
    radial-gradient(circle at 10% 12%, rgba(242,106,46,.18), transparent 25%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 72%);
  color: #fff;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark {
  width: 39px; height: 39px; border-radius: 12px; position: relative;
  background: linear-gradient(145deg, var(--orange), #ff9a56);
  box-shadow: 0 8px 24px rgba(242,106,46,.32);
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 5px; border-radius: 5px; background: #fff;
}
.brand-mark::before { top: 12px; transform: skewX(-28deg); }
.brand-mark::after { top: 22px; left: 14px; transform: skewX(-28deg); }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .04em; }
.brand-sub { display: block; color: rgba(255,255,255,.58); font-size: 10px; font-weight: 500; letter-spacing: .12em; margin-top: 1px; }
.nav-caption { color: rgba(255,255,255,.42); font-size: 10px; letter-spacing: .16em; margin: 11px 12px 8px; }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  border: 0; color: rgba(255,255,255,.72); background: transparent;
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px; text-align: left;
  transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 var(--orange); }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.nav-badge { margin-left: auto; font-size: 11px; color: #fff; background: var(--orange); border-radius: 20px; min-width: 21px; padding: 1px 6px; text-align: center; }
.sidebar-bottom {
  margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 17px 8px 0;
  color: rgba(255,255,255,.64); font-size: 12px;
}
.sidebar-bottom strong { color: #fff; display: block; margin-bottom: 3px; }
.version-chip { display: inline-block; margin-top: 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 99px; padding: 3px 8px; font-size: 10px; }

.main-shell { min-width: 0; }
.topbar {
  height: 76px; background: rgba(255,255,255,.9); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px;
  padding: 0 30px; position: sticky; top: 0; z-index: 15;
}
.mobile-menu { display: none; }
.top-title { min-width: 0; }
.top-title h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.top-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.role-switch {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 8px 30px 8px 10px; font-weight: 650;
}
.icon-button {
  width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 10px; display: grid; place-items: center; position: relative;
}
.icon-button .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); position: absolute; right: 7px; top: 6px; border: 2px solid white; }
.profile { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue), var(--navy)); font-weight: 800; }
.profile strong { display: block; font-size: 13px; }
.profile small { color: var(--muted); font-size: 11px; }

.content { padding: 26px 30px 42px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.eyebrow { font-size: 11px; color: var(--orange); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-head h2 { font-size: 27px; margin: 3px 0 3px; letter-spacing: -.04em; }
.page-head p { margin: 0; color: var(--muted); }
.action-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button {
  border: 0; border-radius: 10px; min-height: 39px; padding: 9px 14px; font-weight: 750;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--orange); box-shadow: 0 9px 22px rgba(242,106,46,.22); }
.button.dark { color: #fff; background: var(--navy); }
.button.secondary { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.button.soft { color: var(--navy); background: #e9f1f3; }
.button.danger { color: var(--red); background: #fff0ef; }
.button.small { min-height: 31px; padding: 6px 10px; font-size: 12px; }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }

.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 25px 28px;
  background: linear-gradient(118deg, #123a4a 0%, #195168 72%, #22647d 100%); color: #fff;
  box-shadow: var(--shadow); margin-bottom: 19px;
}
.hero::after {
  content: ""; position: absolute; width: 360px; height: 360px; right: -100px; top: -220px;
  border: 52px solid rgba(255,255,255,.055); border-radius: 50%;
}
.hero-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 25px; position: relative; z-index: 1; }
.hero h2 { margin: 4px 0 7px; font-size: 25px; letter-spacing: -.035em; }
.hero p { color: rgba(255,255,255,.68); max-width: 670px; margin: 0; }
.hero .eyebrow { color: #ffae78; }
.flow-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 20px; }
.flow-step { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: 6px 9px; font-size: 11px; font-weight: 700; }
.flow-arrow { color: rgba(255,255,255,.35); }
.hero-aside { border-left: 1px solid rgba(255,255,255,.14); padding-left: 24px; display: grid; align-content: center; }
.hero-aside .label { font-size: 11px; color: rgba(255,255,255,.55); }
.hero-aside .big { font-size: 29px; font-weight: 850; letter-spacing: -.04em; margin: 2px 0; }
.hero-aside .hint { font-size: 11px; color: #a9e0cf; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 19px; }
.metric-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px;
  box-shadow: 0 5px 18px rgba(18,58,74,.035); min-width: 0;
}
.metric-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.metric-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: #edf4f6; color: var(--blue); }
.metric-card.orange .metric-icon { background: #fff0e9; color: var(--orange); }
.metric-card.green .metric-icon { background: #eaf7f2; color: var(--green); }
.metric-card.yellow .metric-icon { background: #fff7e3; color: var(--yellow); }
.metric-value { font-size: 27px; font-weight: 850; letter-spacing: -.045em; margin: 8px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-note { color: var(--soft); font-size: 11px; }
.trend-up { color: var(--green); font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 17px; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(18,58,74,.04); overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 18px 19px; }
.empty { text-align: center; color: var(--muted); padding: 42px 20px; }
.empty-icon { font-size: 34px; margin-bottom: 8px; opacity: .5; }

.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th {
  color: var(--muted); background: #fafbfa; font-size: 11px; letter-spacing: .02em;
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 750;
}
td { padding: 12px 14px; border-bottom: 1px solid #f0f1ef; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfb; }
.cell-main { font-weight: 700; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.link { color: var(--blue); font-weight: 700; cursor: pointer; }
.status {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 3px 8px;
  font-size: 11px; font-weight: 700; background: #eef1f2; color: #5e6972;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.green { color: var(--green); background: #e9f7f1; }
.status.orange { color: #c35d21; background: #fff0e8; }
.status.blue { color: var(--blue); background: #eaf3f8; }
.status.yellow { color: #9a6b0e; background: #fff6db; }
.status.red { color: var(--red); background: #fff0ef; }
.status.gray { color: #68737b; background: #f0f2f2; }
.three-status { display: flex; gap: 5px; align-items: center; }

.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px;
}
.sync-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; margin-bottom: 12px; border: 1px solid #f0d9bd;
  border-radius: 12px; background: #fffaf3; color: #704d2e;
}
.sync-banner strong { display: block; font-size: 12px; }
.sync-banner span { display: block; color: #9a7251; font-size: 11px; margin-top: 2px; }
.product-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.product-thumb {
  width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 9px; background: #f6f8f6; font-size: 20px;
}
.money-stack { display: grid; gap: 1px; min-width: 135px; }
.money-stack > span { font-size: 11px; color: var(--muted); }
.money-stack > span:first-child { color: var(--blue); font-weight: 800; font-size: 13px; }
.money-stack strong { font-size: 11px; }
.search {
  display: flex; align-items: center; gap: 7px; background: #f5f7f6; border: 1px solid transparent;
  border-radius: 9px; padding: 0 10px; min-width: 250px; flex: 1;
}
.search:focus-within { border-color: #b9d0d9; background: #fff; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; height: 38px; min-width: 80px; }
.filter-select { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 29px 8px 10px; color: var(--ink); }
.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 12px; background: #e9edeb; width: fit-content; margin-bottom: 14px; overflow: auto; max-width: 100%; }
.tab { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; color: var(--muted); white-space: nowrap; font-weight: 650; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(18,58,74,.08); }

.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 43px 13px 1fr; gap: 8px; min-height: 53px; }
.activity-time { color: var(--soft); font-size: 10px; padding-top: 1px; }
.activity-track { position: relative; }
.activity-track::after { content: ""; position: absolute; width: 1px; background: var(--line); top: 12px; bottom: -3px; left: 5px; }
.activity-item:last-child .activity-track::after { display: none; }
.activity-dot { width: 11px; height: 11px; border-radius: 50%; border: 3px solid #d9e7ec; background: var(--blue); }
.activity-dot.green { background: var(--green); border-color: #d8eee6; }
.activity-dot.orange { background: var(--orange); border-color: #ffe0d1; }
.activity-text { font-size: 12px; color: #40505a; padding-bottom: 15px; }

.scan-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 18px; }
.scan-card { padding: 24px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, var(--navy), #1e627a); position: relative; overflow: hidden; }
.scan-card::after { content: "||||||||"; position: absolute; right: 18px; top: 14px; font-size: 34px; letter-spacing: -5px; color: rgba(255,255,255,.07); transform: rotate(90deg); }
.scan-card h3 { margin: 0 0 4px; font-size: 18px; }
.scan-card p { margin: 0 0 18px; color: rgba(255,255,255,.6); font-size: 12px; }
.scan-input-row { display: grid; grid-template-columns: 1fr 110px 90px; gap: 8px; }
.scan-input-row input {
  height: 48px; border: 0; outline: 0; border-radius: 11px; padding: 0 13px; background: #fff; color: var(--ink); font-size: 16px;
}
.scan-input-row .weight { min-width: 0; }
.scan-result { margin-top: 17px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); border-radius: 13px; padding: 14px; }
.scan-result strong { display: block; margin-bottom: 2px; }
.scan-result small { color: rgba(255,255,255,.6); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.warehouse-card, .integration-card, .exception-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 17px; box-shadow: 0 5px 18px rgba(18,58,74,.035);
}
.warehouse-code { color: var(--orange); font-weight: 850; font-size: 11px; letter-spacing: .08em; }
.warehouse-card h3, .integration-card h3 { margin: 5px 0 4px; font-size: 16px; }
.warehouse-card p, .integration-card p { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 10px; background: #f0f3f2; color: #52606a; padding: 3px 7px; border-radius: 6px; }
.warehouse-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-top: 13px; margin-top: 13px; border-top: 1px solid var(--line); }
.warehouse-meta span { color: var(--soft); font-size: 10px; display: block; }
.warehouse-meta strong { font-size: 11px; }
.integration-top { display: flex; justify-content: space-between; gap: 10px; }
.integration-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--navy); font-weight: 850; }
.integration-card.warning { border-color: #f0dfbd; background: #fffdf8; }
.api-note { border-left: 3px solid var(--orange); background: #fff6f1; padding: 10px 12px; border-radius: 0 9px 9px 0; color: #745343; font-size: 11px; margin-top: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 10px; outline: 0; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8db4c4; box-shadow: 0 0 0 3px rgba(46,111,149,.09); }
.field textarea { resize: vertical; min-height: 72px; }
.field-hint { color: var(--soft); font-size: 10px; margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(8,27,34,.53); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 28px 80px rgba(8,27,34,.28); }
.modal.small { width: min(500px, 100%); }
.modal-head { padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.modal-close { border: 0; background: #f1f3f2; width: 32px; height: 32px; border-radius: 9px; color: var(--muted); font-size: 18px; }
.modal-body { padding: 21px 22px; }

.order-detail { display: grid; gap: 17px; }
.detail-summary { background: var(--navy); color: #fff; border-radius: 15px; padding: 17px; display: flex; justify-content: space-between; gap: 20px; }
.detail-summary small { color: rgba(255,255,255,.55); display: block; }
.detail-summary strong { font-size: 17px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.detail-cell { background: #f7f8f7; border-radius: 10px; padding: 10px; }
.detail-cell span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.detail-cell strong { font-size: 12px; }
.status-lanes { display: grid; gap: 10px; }
.status-lane { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; }
.status-lane > span { color: var(--muted); font-size: 11px; }
.lane-track { height: 5px; background: #e9eceb; border-radius: 5px; overflow: hidden; }
.lane-track i { display: block; height: 100%; border-radius: 5px; background: var(--green); }

.exception-card { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: start; margin-bottom: 10px; }
.severity { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: #fff0ef; color: var(--red); font-weight: 850; }
.severity.mid { background: #fff6df; color: var(--yellow); }
.exception-card h3 { margin: 0 0 3px; font-size: 14px; }
.exception-card p { margin: 0; color: var(--muted); font-size: 12px; }
.exception-meta { margin-top: 8px; display: flex; gap: 12px; color: var(--soft); font-size: 10px; }

.price-result { background: #edf5f6; border: 1px solid #d7e7ea; border-radius: 13px; padding: 14px; margin-top: 14px; }
.price-total { display: flex; justify-content: space-between; align-items: end; }
.price-total strong { font-size: 24px; color: var(--navy); }
.price-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.price-breakdown div { background: rgba(255,255,255,.65); border-radius: 8px; padding: 8px; }
.price-breakdown span { display: block; font-size: 10px; color: var(--muted); }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 270px; max-width: 400px; background: #163846; color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 16px 36px rgba(8,27,34,.2); animation: toast-in .25s ease; font-size: 12px; }
.toast.success { border-left: 4px solid #55c6a2; }
.toast.error { border-left: 4px solid #ff7e75; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.mobile-backdrop { display: none; }
.muted { color: var(--muted); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.text-right { text-align: right; }
.mt-14 { margin-top: 14px; }
.notice { padding: 11px 13px; border-radius: 10px; color: #6f581e; background: #fff7df; border: 1px solid #f4e5b5; font-size: 11px; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .scan-layout { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-aside { border-left: 0; border-top: 1px solid rgba(255,255,255,.14); padding: 16px 0 0; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .22s ease; width: 258px; box-shadow: 15px 0 50px rgba(8,27,34,.24); }
  .sidebar.open { transform: translateX(0); }
  .mobile-backdrop { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(8,27,34,.45); }
  .topbar { height: 66px; padding: 0 15px; gap: 10px; }
  .mobile-menu { display: grid; }
  .top-title p, .profile div, .icon-button { display: none; }
  .role-switch { max-width: 126px; }
  .content { padding: 19px 14px 32px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h2 { font-size: 23px; }
  .metric-grid, .grid-equal, .card-grid { grid-template-columns: 1fr; }
  .hero { padding: 21px; }
  .hero h2 { font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .scan-input-row { grid-template-columns: 1fr; }
  .search { min-width: 100%; }
  .toolbar > * { flex: 1; }
  .sync-banner { align-items: flex-start; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .exception-card { grid-template-columns: auto 1fr; }
  .exception-card > .button { grid-column: 1 / -1; }
  .price-breakdown { grid-template-columns: 1fr; }
  .toast-region { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}
