*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #06080c;
  --panel: rgba(15, 20, 28, .78);
  --panel-solid: #0e141c;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #e7edf7;
  --muted: #8794a8;
  --accent: #55d2ff;
  --accent-soft: rgba(85, 210, 255, .12);
  --green: #3ddc97;
  --amber: #ffb84d;
  --red: #ff6b7a;
  --violet: #b58cff;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(46, 116, 158, .34), transparent 60%),
    radial-gradient(800px 520px at 92% 4%, rgba(84, 62, 156, .22), transparent 65%),
    radial-gradient(1000px 700px at 50% 110%, rgba(20, 70, 96, .22), transparent 60%);
}

.bg-stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .75;
  background-image:
    radial-gradient(rgba(255, 255, 255, .55) 1px, transparent 1px),
    radial-gradient(rgba(160, 210, 255, .38) 1px, transparent 1px);
  background-size: 220px 220px, 380px 380px;
  background-position: 0 0, 40px 120px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.35) 70%, transparent);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: "Consolas", "SFMono-Regular", monospace; letter-spacing: .02em; }

/* ---------------- 顶栏 ---------------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 28px;
  background: rgba(6, 9, 14, .72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 210px; }

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(85, 210, 255, .5);
  transform: rotate(45deg);
  background: linear-gradient(135deg, rgba(85, 210, 255, .18), transparent);
}

.brand-mark span {
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(85, 210, 255, .9);
  transform: rotate(0deg);
}

.brand-mark.big { width: 46px; height: 46px; margin: 0 auto 14px; }
.brand-mark.big span { width: 14px; height: 14px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .02em; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .08em; }

.main-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(85, 210, 255, .22);
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text);
  background: rgba(255, 255, 255, .03);
}
.user-pill::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(61, 220, 151, .8);
}
.user-pill .role-tag { color: var(--muted); }

/* ---------------- 按钮 ---------------- */
.primary-btn,
.ghost-btn,
.link-btn,
.icon-btn {
  font-family: inherit;
  cursor: pointer;
  transition: all .16s ease;
}

.primary-btn {
  border: 1px solid rgba(85, 210, 255, .55);
  background: linear-gradient(180deg, rgba(85, 210, 255, .22), rgba(85, 210, 255, .08));
  color: #dff6ff;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .04em;
}
.primary-btn:hover { background: rgba(85, 210, 255, .3); box-shadow: 0 0 22px rgba(85, 210, 255, .22); }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.ghost-btn {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
}
.ghost-btn:hover { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); }
.ghost-btn.small-btn { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.link-btn {
  border: 0; background: none; color: var(--accent);
  font-size: 12.5px; padding: 4px;
}
.link-btn:hover { text-decoration: underline; }

.icon-btn {
  border: 0; background: transparent; color: var(--muted);
  font-size: 18px; line-height: 1; padding: 6px 8px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.full { width: 100%; }

/* ---------------- 布局 ---------------- */
#content { max-width: 1320px; margin: 0 auto; padding: 26px 28px 60px; }

.auth-view { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; }

.auth-card {
  width: 420px;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 34px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.auth-card.wide { width: 480px; }

.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: .04em; }
.auth-head p { margin: 0; font-size: 12.5px; }
.auth-foot { text-align: center; font-size: 12px; margin: 18px 0 0; }
.eve-login-block { margin-bottom: 2px; }
.eve-login-btn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.eve-login-hint { font-size: 11.5px; line-height: 1.55; margin: 8px 0 0; text-align: center; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 17px 0 15px; color: var(--muted); font-size: 11.5px;
}
.login-divider::before,
.login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-divider span { white-space: nowrap; }
.role-hint {
  font-size: 12px; line-height: 1.6; margin: -2px 0 12px;
  padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: rgba(255, 255, 255, .025);
}

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(8, 12, 18, .85);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(85, 210, 255, .6);
  box-shadow: 0 0 0 3px rgba(85, 210, 255, .1);
}

input::placeholder, textarea::placeholder { color: #5c6a7d; }
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }
select option { background: #0e141c; color: var(--text); }

input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.75); cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.span-2 { grid-column: span 2; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 8px; margin-top: 4px;
}
.form-error {
  color: var(--red); font-size: 12.5px;
  background: rgba(255, 107, 122, .08);
  border: 1px solid rgba(255, 107, 122, .25);
  border-radius: 8px;
  padding: 7px 10px; margin: 0 0 8px;
}

/* ---------------- 页面头 ---------------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.page-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: .03em; }
.page-head p { margin: 0; font-size: 12.5px; }
.head-actions { display: flex; gap: 10px; align-items: center; }

/* ---------------- 工作台 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(85, 210, 255, .35); }
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(85, 210, 255, .16), transparent 70%);
}
.stat-card.warn::after { background: radial-gradient(circle, rgba(255, 107, 122, .18), transparent 70%); }
.stat-label { display: block; font-size: 12px; color: var(--muted); letter-spacing: .1em; margin-bottom: 8px; }
.stat-card strong {
  display: block; font-size: 28px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.stat-card.warn strong { color: var(--red); }
.stat-sub { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: 1.9fr 1fr; gap: 16px; align-items: start; }
.dash-grid > * { min-width: 0; }
.side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  backdrop-filter: blur(14px);
  min-width: 0;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 10px;
}
.panel-head h3 { margin: 0; font-size: 14.5px; letter-spacing: .05em; font-weight: 600; }

.mini-stats { display: flex; flex-direction: column; gap: 14px; }
.mini-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mini-stats span { font-size: 12.5px; color: var(--muted); }
.mini-stats strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.announcement { margin: 0; font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.panel.table-panel { padding: 8px 10px 10px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-weight: 500; color: var(--muted);
  font-size: 11.5px; letter-spacing: .08em; text-transform: none;
  padding: 12px 12px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, .05);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr { transition: background .12s; cursor: pointer; }
.data-table tbody tr:hover { background: rgba(85, 210, 255, .05); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .num.th { text-align: right; }
.data-table.compact td { padding: 10px 12px; font-size: 12.5px; }
.data-table.compact th { padding: 8px 12px; }
.item-name { font-weight: 600; letter-spacing: .02em; }
.order-no { font-family: "Consolas", monospace; font-size: 12px; color: var(--muted); }
.amount { font-variant-numeric: tabular-nums; }
.amount.big { font-weight: 600; }

/* ---------------- 状态徽章 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; letter-spacing: .03em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.badge.pending { color: #ffc46b; background: rgba(255, 184, 77, .1); border-color: rgba(255, 184, 77, .28); }
.badge.accepted { color: #6fdcff; background: rgba(85, 210, 255, .1); border-color: rgba(85, 210, 255, .28); }
.badge.producing { color: #8ea6ff; background: rgba(124, 156, 255, .1); border-color: rgba(124, 156, 255, .3); }
.badge.ready { color: #c39cff; background: rgba(181, 140, 255, .11); border-color: rgba(181, 140, 255, .3); }
.badge.delivered { color: #5fe6ac; background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .28); }
.badge.completed { color: #7c8ba0; background: rgba(124, 139, 160, .12); border-color: rgba(124, 139, 160, .3); }
.badge.cancelled { color: #ff8592; background: rgba(255, 107, 122, .1); border-color: rgba(255, 107, 122, .3); }
.badge.priority-urgent { color: #ff9d6b; background: rgba(255, 157, 107, .1); border-color: rgba(255, 157, 107, .3); }
.badge.priority-normal { color: var(--muted); background: rgba(255, 255, 255, .04); border-color: var(--line); }
.overdue-tag { color: var(--red); font-size: 11.5px; margin-left: 6px; }
.mine-tag {
  font-size: 10.5px; color: var(--accent); border: 1px solid rgba(85, 210, 255, .3);
  border-radius: 4px; padding: 0 4px; margin-left: 6px;
}
.eve-tag {
  font-size: 10px; color: var(--green); border: 1px solid rgba(61, 220, 151, .3);
  border-radius: 4px; padding: 0 4px; margin-left: 6px; letter-spacing: .04em;
}

/* ---------------- 筛选 ---------------- */
.filter-bar { margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }

.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  padding: 7px 14px; border-radius: 999px;
  font-size: 12.5px; cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.active {
  color: var(--accent); border-color: rgba(85, 210, 255, .4);
  background: var(--accent-soft);
}

.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-input { max-width: 340px; }
.select { max-width: 160px; }
.date-input { max-width: 150px; }

/* ---------------- 分页 / 空状态 ---------------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px 4px; gap: 12px; flex-wrap: wrap;
}
.pager-btns { display: flex; gap: 8px; }

.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-icon { font-size: 30px; color: rgba(85, 210, 255, .35); margin-bottom: 8px; }
.empty-state p { margin: 0 0 14px; font-size: 13px; }

/* ---------------- 设置 / 物品 / 成员 ---------------- */
#itemAddPanel { margin-bottom: 14px; }
.settings-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.account-info { display: flex; gap: 40px; margin-bottom: 18px; }
.account-info > div { display: flex; flex-direction: column; gap: 4px; }
.account-info strong { font-size: 15px; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(3, 5, 8, .72);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: 640px; max-width: 100%;
  max-height: 90vh;
  display: flex; flex-direction: column;
  background: #0b1017;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .65);
  animation: modalIn .18s ease;
}
.detail-card { width: 720px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 14px; border-bottom: 1px solid var(--line); gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 17px; letter-spacing: .03em; }
.modal-body { padding: 20px 24px 24px; overflow-y: auto; }

/* ---------------- 订单详情 ---------------- */
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.detail-amount { text-align: right; }
.detail-amount span { display: block; font-size: 11.5px; }
.detail-amount strong { font-size: 22px; font-variant-numeric: tabular-nums; }

.detail-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 18px;
  padding: 16px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}
.detail-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.detail-grid span { font-size: 11.5px; }
.detail-grid b { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }

.detail-notes {
  margin-top: 14px; padding: 12px 16px;
  border-left: 2px solid rgba(85, 210, 255, .5);
  background: rgba(85, 210, 255, .04);
  border-radius: 0 10px 10px 0;
}
.detail-notes span { font-size: 11.5px; }
.detail-notes p { margin: 4px 0 0; font-size: 13px; white-space: pre-wrap; }

.detail-profit {
  margin-top: 14px; padding: 14px 16px;
  border: 1px solid rgba(61, 220, 151, .22);
  background: rgba(61, 220, 151, .05);
  border-radius: 12px;
}
.detail-profit .panel-head { margin-bottom: 10px; }
.detail-profit .panel-head h3 { font-size: 13.5px; }
.profit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; }
.profit-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profit-grid span { font-size: 11.5px; color: var(--muted); }
.profit-grid b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.profit-pos { color: var(--green); }
.profit-neg { color: var(--red); }
.profit-cell { font-variant-numeric: tabular-nums; }
.role-select { width: 110px; padding: 6px 8px; font-size: 12px; }

.quote-hint {
  padding: 9px 12px; margin: -2px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.quote-hint.ok { border-color: rgba(61, 220, 151, .28); background: rgba(61, 220, 151, .05); color: #a9efd0; }
.quote-hint.warn { border-color: rgba(255, 184, 77, .28); background: rgba(255, 184, 77, .05); color: #ffd9a0; }

/* ---------------- 全装配装 ---------------- */
.order-mode {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 4px 0 8px;
}
.mode-btn {
  padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-size: 12.5px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.mode-btn:hover { color: var(--text); border-color: rgba(85, 210, 255, .35); }
.mode-btn.active {
  color: #9fe8ff; border-color: rgba(85, 210, 255, .55);
  background: rgba(85, 210, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(85, 210, 255, .08);
}
.fit-panel {
  padding: 14px; border: 1px solid var(--line);
  border-radius: 12px; background: rgba(255, 255, 255, .02);
  min-width: 0;
}
.fit-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.fit-panel-head > span { font-size: 12px; color: var(--muted); }
.fit-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fit-sets {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.fit-sets input {
  width: 62px; padding: 6px 8px; border-radius: 7px;
  border: 1px solid var(--line); background: rgba(5, 12, 24, .65);
  color: var(--text); font-size: 12.5px; text-align: right;
}
.fit-sets input:focus { outline: none; border-color: rgba(85, 210, 255, .55); }
.fit-panel textarea {
  width: 100%; min-height: 150px; resize: vertical;
  background: rgba(5, 12, 24, .65); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55;
}
.fit-panel textarea:focus { outline: none; border-color: rgba(85, 210, 255, .55); }
.small-btn { padding: 6px 11px; font-size: 12px; }
.fit-status { margin-top: 10px; font-size: 12.5px; line-height: 1.5; }
.fit-status.ok { color: #a9efd0; }
.fit-status.warn { color: #ffd9a0; }
.fit-preview { margin-top: 10px; min-width: 0; }
.fit-summary {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  padding: 9px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 9px;
  background: rgba(85, 210, 255, .04);
  font-size: 12.5px; color: var(--muted);
}
.fit-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.fit-table-wrap { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; min-width: 0; width: 100%; }
.fit-table { min-width: 560px; }
.fit-table tbody tr { cursor: default; }
.fit-table td { padding: 7px 10px; font-size: 12.5px; }
.fit-table th { padding: 7px 10px; }
.fit-role {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 5px; font-size: 10.5px;
  color: #9fe8ff; background: rgba(85, 210, 255, .12);
}
.fit-name-en { display: block; margin-top: 2px; color: #7e91a8; font-size: 10.5px; }
.fit-missing-row td { color: #ff9f9f; background: rgba(255, 92, 92, .05); }
.fit-unmatched {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid rgba(255, 184, 77, .3);
  background: rgba(255, 184, 77, .07);
  color: #ffd9a0; font-size: 12px; line-height: 1.5;
}
.badge.fit-badge { color: #9fe8ff; border-color: rgba(85, 210, 255, .35); background: rgba(85, 210, 255, .1); }
.detail-fit {
  margin-top: 14px; padding: 14px 16px;
  border: 1px solid rgba(85, 210, 255, .2);
  background: rgba(85, 210, 255, .04);
  border-radius: 12px;
}
.detail-fit .panel-head { margin-bottom: 10px; }
.detail-fit .panel-head h3 { font-size: 13.5px; }
.detail-fit .fit-table-wrap { max-height: 260px; background: rgba(0, 0, 0, .12); }
.detail-build {
  margin-top: 14px; padding: 14px 16px;
  border: 1px solid rgba(255, 184, 77, .24);
  background: rgba(255, 184, 77, .05);
  border-radius: 12px;
}
.detail-build .panel-head { margin-bottom: 10px; }
.detail-build .panel-head h3 { font-size: 13.5px; }
.detail-build .fit-table-wrap { max-height: 260px; background: rgba(0, 0, 0, .12); }
.build-table { min-width: 460px; }
.build-role {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  font-size: 10.5px; color: #ffd9a0; background: rgba(255, 184, 77, .12);
}

.detail-actions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin: 18px 0 6px;
}
.detail-actions .ghost-btn,
.detail-actions .primary-btn { padding: 7px 14px; font-size: 12.5px; }
.detail-actions .note-input { max-width: 220px; }
.action-hint { font-size: 12px; color: var(--muted); }

.timeline-block { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.timeline { list-style: none; margin: 0 0 14px; padding: 0 0 0 16px; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 16px; font-size: 12.5px; }
.timeline li::before {
  content: ""; position: absolute; left: -21px; top: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(85, 210, 255, .8); box-shadow: 0 0 8px rgba(85, 210, 255, .5);
}
.timeline .log-action { color: var(--text); font-weight: 600; margin-right: 6px; }
.timeline .log-detail { color: var(--muted); display: block; margin-top: 2px; line-height: 1.6; }
.timeline .log-meta { color: #5d6b7f; font-size: 11px; margin-left: 6px; }

.comment-box { display: flex; gap: 8px; }
.comment-box input { flex: 1; }

/* ---------------- 浮层提示 ---------------- */
.toast-box {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 8px 16px; border-radius: 10px;
  background: rgba(15, 22, 31, .95);
  border: 1px solid rgba(85, 210, 255, .3);
  color: var(--text); font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  animation: toastIn .2s ease;
}
.toast.error { border-color: rgba(255, 107, 122, .5); color: #ffd3d8; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 滚动条 ---------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .2); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  #topbar { height: auto; padding: 10px 14px; gap: 8px 10px; flex-wrap: wrap; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-text strong {
    font-size: 13px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 150px;
  }
  .brand-text span { font-size: 10px; white-space: nowrap; }
  .main-nav { flex: 1 0 100%; order: 3; width: 100%; flex-wrap: wrap; overflow: visible; }
  .nav-item { padding: 6px 10px; font-size: 12px; }
  .topbar-right { gap: 6px; }
  .user-pill { padding: 4px 8px; font-size: 11px; }
  .ghost-btn { padding: 7px 10px; }
  #content { padding: 18px 14px 40px; }
  .page-head { flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 20px; }
  .form-grid, .form-row { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .profit-grid { grid-template-columns: 1fr 1fr; }
  .order-mode { align-items: flex-start; }
  .fit-panel { padding: 11px; }
  .fit-panel-head { align-items: flex-start; flex-direction: column; }
  .fit-head-actions { width: 100%; justify-content: space-between; }
  .fit-summary { gap: 5px 12px; }
  .role-select { width: 96px; }
  .modal { padding: 10px; }
  .modal-card { max-height: 94vh; }
  .modal-body { padding: 16px; }
  .detail-amount strong { font-size: 18px; }
  .search-input, .select, .date-input { max-width: none; }

  /* 手机端：工作台最新订单表隐藏次要列，保证状态可见 */
  .data-table.compact th:nth-child(3), .data-table.compact td:nth-child(3),
  .data-table.compact th:nth-child(5), .data-table.compact td:nth-child(5) { display: none; }
}
