:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft-line: #f1f5f9;
  --blue: #3b82f6;
  --blue-soft: #eff6ff;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --red: #ef4444;
  --red-soft: #fff1f2;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --info: #3b82f6;
  --info-soft: #eff6ff;
  --title: #1E3D59;
  --shadow: 0 2px 6px rgba(0, 0, 0, .05);
  --content-left: 3rem;
  --content-right: 3rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }

button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
}
button:hover { box-shadow: var(--shadow); }
button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.primary { color: #fff; background: var(--blue); }
.primary:hover { background: #1765cc; }
.secondary { color: var(--blue); background: #fff; border-color: var(--line); }
.ghost { color: var(--muted); background: #fff; border-color: var(--line); }
.danger { color: #fff; background: var(--red); }
.success { color: #fff; background: var(--green); }
.compact { padding: 7px 10px; }

label { display: grid; gap: 7px; color: #3c4043; font-size: 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  outline: none;
}
textarea { min-height: 86px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, .16);
}

.boot-screen,
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f8fafc;
}
.boot-panel,
.login-panel {
  width: min(420px, calc(100vw - 32px));
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.boot-panel {
  text-align: center;
}
.boot-panel h1 {
  margin: 0 0 8px;
  color: var(--title);
  font-size: 22px;
  font-weight: 500;
}
.boot-panel p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.boot-line {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f0fe;
}
.boot-line span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1a73e8, #34a853);
  animation: boot-loading 1.2s ease-in-out infinite;
}
@keyframes boot-loading {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}
.login-logo {
  display: block;
  width: 250px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 14px;
}
.login-panel h1 {
  margin: 0 0 24px;
  text-align: center;
  color: var(--title);
  font-size: 22px;
  font-weight: 500;
}
.login-panel label { margin-bottom: 14px; }
.login-panel button { width: 100%; margin-top: 6px; }

.app-shell {
  min-height: 100vh;
  display: block;
}
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 var(--content-right) 0 var(--content-left);
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 4px 6px rgba(0,0,0,.02);
}
.load-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  overflow: visible;
  background: transparent;
}
.load-progress-head {
  position: absolute;
  right: var(--content-right);
  bottom: 8px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475569;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1;
}
.load-track {
  width: 100%;
  height: 3px;
  background: #e8f0fe;
}
.load-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #1a73e8, #34a853);
  transition: width .16s ease;
}
.system-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--title);
  white-space: nowrap;
}
.header-logo {
  width: 190px;
  height: 40px;
  object-fit: contain;
  object-position: left center;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dashboard-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
}
.dashboard-scope .scope-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.dashboard-scope select {
  width: auto;
  min-width: 92px;
  height: 30px;
  padding: 4px 24px 4px 9px;
  border-radius: 999px;
  font-size: 13px;
  background-color: #fff;
}
.dashboard-scope button {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
}
#userTag {
  color: var(--muted);
  background: #f1f3f4;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.view-select {
  width: 190px;
  min-height: 38px;
  color: #3c4043;
  background: #fff;
}
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-color: var(--line);
  color: var(--blue);
  font-size: 18px;
  line-height: 1;
  background: #fff;
}

.workbench { min-width: 0; }
.topbar {
  display: none;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px var(--content-right) 14px var(--content-left);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.topbar h2 { margin: 0; font-size: 24px; font-weight: 700; color: #111827; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.search {
  width: min(360px, 28vw);
  min-width: 260px;
  height: 38px;
}

.view {
  max-width: none;
  margin: 0;
  padding: 24px var(--content-right) 36px var(--content-left);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
}
.kpi, .panel, .project-card, .form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.kpi {
  min-height: 112px;
  padding: 14px 16px;
  background: #fff;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  cursor: default;
}
.kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
  border-color: #cbd5e1;
}
.kpi.violet { border-left: 4px solid #8b5cf6; }
.kpi.blue-line { border-left: 4px solid var(--blue); }
.kpi.green-line { border-left: 4px solid var(--green); }
.kpi.red-line { border-left: 4px solid var(--red); }
.kpi.amber-line { border-left: 4px solid var(--amber); }
.kpi.gray-line { border-left: 4px solid #9ca3af; }
.kpi small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.kpi strong { display: block; margin-top: 8px; font-size: 25px; line-height: 1.14; font-weight: 700; }
.kpi em { display: block; margin-top: 7px; color: var(--muted); font-style: normal; font-size: 12px; }
.kpi-help {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1;
}
.kpi-help:hover {
  color: #174ea6;
  border-color: #93c5fd;
  background: var(--blue-soft);
}
.funnel-panel {
  margin-top: 14px;
}

.dashboard-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 16px;
}
.dashboard-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.global-search-panel {
  display: grid;
  gap: 12px;
  align-items: stretch;
}
.tool-controls,
.global-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-controls select {
  width: 130px;
}
.global-search-box input {
  width: min(720px, 100%);
}
.global-search-head {
  display: block;
}
.global-results {
  width: 100%;
  display: grid;
  gap: 12px;
  min-height: 180px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}
.global-result {
  padding: 0;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  overflow: hidden;
}
.global-result summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  cursor: pointer;
}
.global-result[open] summary {
  border-bottom: 1px solid var(--soft-line);
  background: #fbfdff;
}
.global-result b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.global-result span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.global-result em {
  justify-self: end;
  color: #334155;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 9px;
  font-style: normal;
  font-size: 12px;
}
.global-result-detail {
  display: grid;
  gap: 14px;
  padding: 14px;
}
.global-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.global-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}
.global-section h4 {
  margin: 0;
  color: #1f2937;
  font-size: 15px;
}
.global-section.won-process {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.global-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.global-field {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfdff;
}
.global-field span {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}
.global-field b {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #202124;
  font-size: 13px;
  line-height: 1.55;
}
.global-long-field summary,
.global-db-table summary {
  cursor: pointer;
  color: #1f2937;
  font-weight: 600;
}
.global-file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.db-field-table {
  display: grid;
  gap: 0;
  margin-top: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.db-field-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  border-bottom: 1px solid var(--soft-line);
}
.db-field-row:last-child {
  border-bottom: 0;
}
.db-field-row span {
  padding: 10px 12px;
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
  font-size: 13px;
}
.db-field-row span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}
.db-field-row p {
  margin: 0;
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #3c4043;
  font-size: 13px;
  line-height: 1.7;
}
.panel { padding: 16px; }
.panel.wide { grid-column: 1 / -1; }
.panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(160px, 1fr) 72px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--soft-line);
  font-size: 13px;
}
.chart-row:last-child { border-bottom: 0; }
.bar { height: 10px; border-radius: 5px; background: #e8f0fe; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 5px; background: var(--blue); }
.insight-list { display: grid; gap: 10px; }
.insight {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafd;
  border: 1px solid var(--soft-line);
}
.insight b { display: block; margin-bottom: 4px; }
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}
.metric span { color: var(--muted); font-size: 12px; }
.metric b { display: block; margin-top: 6px; font-size: 20px; }
.metric small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.panel-caption {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.tactical-panel {
  border-left: 4px solid #8b5cf6;
}
.tactical-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
}
.tactical-grid .kpi {
  min-height: 106px;
  box-shadow: none;
}
.empty-success {
  padding: 13px 14px;
  color: #047857;
  background: var(--green-soft);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}
.track-table {
  margin-top: 14px;
  border-top: 1px solid var(--soft-line);
  padding-top: 12px;
  max-height: 760px;
  overflow: auto;
}
.track-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.track-head span {
  color: var(--muted);
  font-size: 12px;
}
.track-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px minmax(170px, .62fr) minmax(150px, .5fr) 72px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft-line);
  font-size: 13px;
}
.track-row:last-child { border-bottom: 0; }
.track-row b {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.track-row span,
.track-row small {
  color: var(--muted);
}
.track-row em {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-style: normal;
  font-size: 12px;
}
.tactical-edit-row select,
.tactical-edit-row input {
  min-width: 0;
  height: 36px;
  font-size: 13px;
}
.tactical-edit-row button {
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}
.split-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.sub-panel {
  min-width: 0;
}
.sub-panel h4 {
  margin: 0 0 6px;
  font-size: 15px;
}
.daily-legend {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}
.daily-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.daily-legend i {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 3px;
}
.legend-bar { background: rgba(59, 130, 246, .65); }
.legend-line {
  height: 3px !important;
  background: #10b981;
}
.daily-combo-scroll {
  width: 100%;
  overflow-x: auto;
  padding: 4px 0 12px;
}
.daily-combo-chart {
  position: relative;
  min-width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background:
    linear-gradient(to bottom, rgba(148, 163, 184, .18) 1px, transparent 1px) 0 18px / 100% 56px,
    #fff;
}
.daily-axis-title {
  position: absolute;
  top: 6px;
  z-index: 3;
  font-size: 12px;
  font-weight: 600;
}
.daily-axis-title.left {
  left: 10px;
  color: #2563eb;
}
.daily-axis-title.right {
  right: 10px;
  color: #10b981;
}
.daily-axis-label {
  position: absolute;
  z-index: 3;
  width: 38px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}
.daily-axis-label.left {
  left: 6px;
  text-align: right;
}
.daily-axis-label.right {
  right: 6px;
  text-align: left;
}
.daily-column {
  position: absolute;
  z-index: 2;
  bottom: 44px;
  width: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px 5px 0 0;
  background: rgba(59, 130, 246, .68);
  box-shadow: inset 0 -1px 0 rgba(37, 99, 235, .22);
  cursor: pointer;
  transition: background .12s ease, transform .12s ease;
}
.daily-column:hover {
  background: rgba(37, 99, 235, .82);
  transform: translateY(-2px);
}
.daily-column b {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.daily-x-label {
  position: absolute;
  bottom: 14px;
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.daily-line {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}
.daily-line polyline {
  fill: none;
  stroke: #10b981;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.daily-line circle {
  fill: #10b981;
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.daily-point-hit {
  position: absolute;
  z-index: 4;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.daily-point-hit:hover {
  background: rgba(16, 185, 129, .16);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}
.daily-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .26);
}
.daily-modal {
  position: relative;
  width: min(560px, 100%);
  padding: 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}
.daily-modal h3 {
  margin: 0 36px 14px 0;
  color: #111827;
  font-size: 18px;
}
.daily-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  color: #475569;
  background: #f8fafc;
}
.daily-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.daily-modal-grid div {
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfdff;
}
.daily-modal-grid span,
.daily-modal-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.daily-modal-grid b {
  display: block;
  margin: 6px 0;
  color: #111827;
  font-size: 22px;
}
.daily-modal-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
}
.daily-modal-note p {
  margin: 6px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}
.celebration {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .08);
}
.celebration-card {
  min-width: min(360px, calc(100vw - 48px));
  padding: 22px 26px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
  text-align: center;
}
.celebration-card b {
  display: block;
  color: #0f172a;
  font-size: 26px;
}
.celebration-card span {
  display: block;
  margin-top: 8px;
  color: #475569;
  font-size: 15px;
}
.celebration-bits i {
  position: fixed;
  top: -16px;
  left: calc((var(--i) * 2.37vw) - 4vw);
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: #fbbc04;
  animation: fall-celebration 1.9s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc((var(--i) % 9) * .045s);
}
.celebration.won .celebration-bits i:nth-child(3n) { background: #34a853; }
.celebration.won .celebration-bits i:nth-child(3n + 1) { background: #1a73e8; }
.celebration.lost .celebration-bits i { background: #93c5fd; border-radius: 999px; }
@keyframes fall-celebration {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(105vh) rotate(420deg); opacity: 0; }
}
.geo-metrics {
  margin-bottom: 14px;
}
.compact-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, .55fr) minmax(140px, .55fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--soft-line);
  font-size: 13px;
}
.compact-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
details .compact-row:first-of-type {
  margin-top: 8px;
}
.warning-line {
  margin: 10px 0;
  padding: 10px 12px;
  color: #92400e;
  background: var(--amber-soft);
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 13px;
}
.ai-report {
  margin-top: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}
.ai-report p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  line-height: 1.65;
}
.rescue-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.rescue-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--soft-line);
}
.rescue-row:last-child { border-bottom: 0; }
.rescue-row b {
  display: block;
  margin-bottom: 4px;
}
.rescue-row span,
.rescue-row p {
  color: var(--muted);
  font-size: 13px;
}
.rescue-row p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.filters:empty { display: none; }
.list-kpis {
  width: 100%;
  margin-bottom: 4px;
}
.pending-batchbar {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px;
  margin: 0;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
  backdrop-filter: blur(10px);
}
body[data-view="pending"] .workbench {
  padding-bottom: 72px;
}
.float-action {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border-color: transparent;
  box-shadow: none;
  font-weight: 800;
}
.float-action:hover {
  box-shadow: 0 8px 22px rgba(15, 23, 42, .18);
  transform: translateY(-1px);
}
.float-action::after {
  content: attr(aria-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  min-width: max-content;
  max-width: 260px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1f2937;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  white-space: nowrap;
}
.float-action:hover::after {
  opacity: 1;
  transform: translate(-2px, -50%);
}
.float-action.danger {
  color: #fff;
  background: #ef4444;
}
.float-action.ai-action {
  color: #174ea6;
  background: var(--blue-soft);
  border-color: #bfdbfe;
}
.float-icon {
  line-height: 1;
  font-size: 20px;
}
.ai-action .float-icon {
  font-size: 14px;
  letter-spacing: 0;
}
.float-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #111827;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}
.pending-select input {
  width: 16px;
  height: 16px;
  padding: 0;
}
.bid-stage-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}
.stage-card {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #334155;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
}
.stage-card b {
  color: #111827;
  font-size: 16px;
}
.stage-card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stage-card-label i {
  font-style: normal;
  font-size: 18px;
  line-height: 1;
}
.stage-card.active {
  color: #174ea6;
  border-color: #93c5fd;
  background: var(--blue-soft);
}
.clear-stage {
  margin-top: -4px;
}
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: -2px 0 8px;
}
.abandon-filter-panel {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.abandon-filter-panel label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 14px;
}
.abandon-filter-panel input {
  width: 16px;
  height: 16px;
  padding: 0;
}
.chip {
  color: #3c4043;
  background: #fff;
  border: 1px solid var(--line);
}
.chip.active {
  color: #174ea6;
  background: var(--blue-soft);
  border-color: #aecbfa;
}
.list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.export-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.export-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 126px;
  display: grid;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}
.export-dropdown a {
  padding: 8px 10px;
  border-radius: 6px;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
}
.export-dropdown a:hover {
  color: #174ea6;
  background: var(--blue-soft);
}
.project-list { display: grid; gap: 12px; }
.project-card { overflow: hidden; }
.project-card {
  position: relative;
}
.project-card.resume-focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12), var(--shadow);
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: transparent;
}
.project-card.tone-danger::before { background: var(--red); }
.project-card.tone-warning::before { background: var(--amber); }
.project-card.tone-info::before { background: var(--info); }
.project-card.tone-success::before { background: var(--green); }
.card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 15px 18px 14px 20px;
  border-bottom: 1px solid var(--soft-line);
}
.card-head h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.42;
  font-weight: 600;
}
.pending-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.pending-title-row h3 {
  margin: 0;
}
.pending-select {
  display: inline-flex;
  grid-template-columns: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.2;
  user-select: none;
}
.pending-select:has(input:checked) {
  color: #174ea6;
  border-color: #93c5fd;
  background: var(--blue-soft);
}
.project-card.tone-danger .card-head h3 { color: #be123c; }
.project-card.tone-warning .card-head h3 { color: #92400e; }
.project-card.tone-success .card-head h3 { color: #047857; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.source-badge.yifang {
  color: #92400e;
  background: #fff7ed;
}
.source-badge.zhiliao {
  color: #1d4ed8;
  background: #eff6ff;
}
.source-icon {
  font-size: 14px;
  line-height: 1;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #3c4043;
  background: #f1f3f4;
  font-size: 12px;
  text-decoration: none;
}
.badge.green { color: #047857; background: var(--green-soft); }
.badge.red { color: #be123c; background: var(--red-soft); }
.badge.amber { color: #92400e; background: #fef3c7; }
.badge.blue { color: #1d4ed8; background: var(--blue-soft); }
.risk-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
}
.risk-pill.tone-danger { color: #be123c; background: var(--red-soft); }
.risk-pill.tone-warning { color: #92400e; background: #fef3c7; }
.risk-pill.tone-info { color: #1d4ed8; background: var(--info-soft); }
.risk-pill.tone-success { color: #047857; background: var(--green-soft); }
.risk-pill.tone-neutral { color: var(--muted); background: #f1f5f9; }
.card-detail > summary {
  padding: 10px 18px 12px 20px;
  cursor: pointer;
  font-weight: 500;
}
.card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  padding: 0 18px 18px 20px;
}
.card-main {
  min-width: 0;
}
.summary {
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.88;
  font-size: 15px;
  max-height: 300px;
  overflow: auto;
}
.summary.tone-danger {
  background: var(--red-soft);
  border-color: #fda4af;
  color: #7f1d1d;
}
.summary.tone-warning {
  background: var(--amber-soft);
  border-color: #fcd34d;
  color: #78350f;
}
.summary.tone-info {
  background: var(--info-soft);
  border-color: #93c5fd;
  color: #1e3a8a;
}
.summary.tone-success {
  background: var(--green-soft);
  border-color: #86efac;
  color: #064e3b;
}
.detail-box {
  margin-top: 10px;
  white-space: pre-wrap;
  color: #3c4043;
  background: #fff;
  border: 1px dashed #c9d3df;
  border-radius: 8px;
  padding: 12px;
  line-height: 1.9;
  font-size: 15px;
  max-height: 300px;
  overflow: auto;
}
.card-detail details {
  margin-top: 10px;
}
.outcome-archive {
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}
.outcome-archive h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #1e293b;
}
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.file-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 38px;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 700;
}
.file-link small {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 400;
  opacity: .82;
}
.ranking-box {
  margin-top: 8px;
}
.ranking-box b {
  display: block;
  margin-bottom: 8px;
}
.ranking-box table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ranking-box th,
.ranking-box td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
}
.ranking-box th {
  color: var(--muted);
  background: #f8fafc;
  font-weight: 600;
}
.warning-text {
  color: #be123c;
  font-size: 13px;
}
.actions {
  display: grid;
  align-content: start;
  gap: 10px;
  border-left: 1px solid var(--soft-line);
  padding-left: 16px;
  background: #fff;
}
.actions b {
  font-size: 15px;
}
.actions .success,
.actions .danger,
.actions .primary {
  font-weight: 600;
}
.decision-bid,
.decision-abandon {
  min-height: 40px;
  width: 100%;
  font-weight: 700;
  border-radius: 7px;
}
.decision-bid {
  color: #fff;
  background: #10b981;
}
.decision-bid:hover { background: #059669; }
.decision-abandon {
  color: #fff;
  background: #ef4444;
}
.decision-abandon:hover { background: #dc2626; }
.admin-force {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}
.admin-force b {
  color: #be123c;
}
.archive-form {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}
.sop-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.sop-fields {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfdff;
}
.sop-check {
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.5;
}
.sop-check.ok,
.ok-text {
  color: #047857;
  background: var(--green-soft);
}
.sop-check.warn {
  color: #b45309;
  background: var(--amber-soft);
}
.two-col,
.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.score-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.archive-form[data-disabled="1"] {
  opacity: .72;
}
.analysis-form {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}
.card-main > .analysis-form {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.archive-form[open],
.analysis-form[open] {
  display: grid;
}
.archive-form summary,
.analysis-form summary {
  cursor: pointer;
  font-weight: 700;
}
.analysis-form textarea {
  min-height: 170px;
  line-height: 1.62;
}
.card-main > .analysis-form textarea {
  min-height: 300px;
  line-height: 1.76;
  font-size: 15px;
}
.card-main > .analysis-form .button-row {
  justify-content: flex-start;
}
.ai-progress {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.ai-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #1e40af;
  font-size: 12px;
}
.ai-progress-head b {
  font-size: 12px;
  white-space: nowrap;
}
.ai-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}
.ai-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #10b981);
  transition: width .28s ease;
}
.ai-progress.done {
  border-color: #86efac;
  background: #ecfdf5;
}
.ai-progress.done .ai-progress-head {
  color: #047857;
}
.ai-progress.error {
  border-color: #fecdd3;
  background: #fff1f2;
}
.ai-progress.error .ai-progress-head {
  color: #be123c;
}
.ai-progress.error .ai-progress-track span {
  background: #ef4444;
}
.file-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.file-field input {
  padding: 8px;
}
.ranking-edit {
  display: grid;
  gap: 7px;
}
.ranking-edit b {
  font-size: 13px;
}
.ranking-edit-row {
  display: grid;
  grid-template-columns: 74px 1fr 1fr;
  gap: 6px;
}
.ranking-edit-row input {
  min-width: 0;
  padding: 8px 9px;
}
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.button-row button { flex: 1; }
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.form-card {
  max-width: 920px;
  padding: 18px;
}
.form-card h3 { margin-top: 0; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.user-panel {
  display: grid;
  gap: 14px;
  max-width: 1180px;
}
.compact-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.user-create {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) 150px auto;
  gap: 10px;
  align-items: center;
}
.password-result {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: var(--green-soft);
  color: #064e3b;
}
.password-result code {
  display: inline-block;
  width: max-content;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .4px;
}
.user-list {
  display: grid;
  gap: 8px;
}
.user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, .6fr) 138px 78px 88px 88px 68px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}
.user-row b,
.user-row span,
.user-row small {
  display: block;
}
.user-row span,
.user-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.switch-line {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #3c4043;
  font-size: 13px;
}
.switch-line input {
  width: 16px;
  height: 16px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  color: #fff;
  background: #202124;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
  .main-header { height: auto; flex-direction: column; align-items: stretch; padding: 12px 16px; }
  .system-brand { justify-content: center; }
  .header-actions { justify-content: center; flex-wrap: wrap; }
  .dashboard-scope { order: 3; flex-wrap: wrap; justify-content: center; border-radius: 12px; }
  .dashboard-tools, .global-search-panel { align-items: stretch; flex-direction: column; }
  .tool-controls, .global-search-box { flex-wrap: wrap; }
  .global-search-box input { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .bid-stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tactical-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .card-body, .split-panels, .global-field-grid { grid-template-columns: 1fr; }
  .db-field-row { grid-template-columns: 1fr; }
  .track-row { grid-template-columns: 1fr 170px 1fr; }
  .user-row { grid-template-columns: 1fr 150px 92px; }
  .user-create { grid-template-columns: 1fr 1fr; }
  .actions { border-left: 0; padding-left: 0; border-top: 1px solid var(--soft-line); padding-top: 14px; }
}

@media (max-width: 720px) {
  .header-logo { width: 160px; }
  .system-brand { font-size: 18px; }
  .topbar { align-items: stretch; flex-direction: column; padding: 14px; }
  .top-actions { width: 100%; }
  .search, .view-select { width: 100%; min-width: 0; }
  .view { padding: 14px; }
  .kpi-grid, .form-grid, .metric-row, .tactical-grid, .track-row, .compact-row, .bid-stage-grid, .user-row, .user-create { grid-template-columns: 1fr; }
  .daily-modal-grid { grid-template-columns: 1fr; }
  .track-head { flex-direction: column; }
  .pending-batchbar {
    right: 12px;
    bottom: 12px;
  }
  .float-action::after {
    right: 0;
    top: auto;
    bottom: calc(100% + 8px);
    transform: none;
  }
  .float-action:hover::after {
    transform: none;
  }
}
