:root {
  --bg: #eef1f4;
  --bg-accent: linear-gradient(135deg, #e8f0f2 0%, #f0ebe3 50%, #eef1f4 100%);
  --surface: #ffffff;
  --text: #15202b;
  --muted: #5f6f7f;
  --accent: #0b4f5c;
  --accent-2: #c45c26;
  --accent-light: #e3f2f4;
  --pass: #1a7a4c;
  --partial: #b86e0a;
  --fail: #b83232;
  --na: #8a96a3;
  --border: #d8e0e8;
  --shadow: 0 8px 32px rgba(21, 32, 43, 0.07);
  --font: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Instrument Serif", "Songti SC", serif;
  --mono: "Cascadia Code", "Consolas", monospace;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg-accent);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

header.site-header h1 {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

header.site-header h1 a { color: var(--text); }
header.site-header .sub { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem 0.4rem 0.45rem;
  background: var(--accent-light);
  border-radius: 999px;
  border: 1px solid rgba(11, 79, 92, 0.12);
}

.user-pill strong { display: block; font-size: 0.88rem; }
.user-pill .muted { font-size: 0.75rem; }

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.1rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

@media (max-width: 720px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-light), var(--surface));
}

.stat-num {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1.1;
}

.stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

.tab-nav {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tab-badge {
  display: inline-block;
  margin-left: 0.35rem;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.section-head { margin-bottom: 1rem; }
.section-head h2 { font-size: 1.05rem; font-weight: 700; }
.section-head p { margin-top: 0.25rem; }

.ec-list { display: flex; flex-direction: column; gap: 0.5rem; }

.ec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: inherit;
}

.ec-row:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(11, 79, 92, 0.08);
  text-decoration: none;
}

.ec-title { font-weight: 600; font-size: 0.95rem; }
.ec-meta { font-size: 0.78rem; margin-top: 0.15rem; }
.ec-row-side { display: flex; gap: 0.4rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty-state p:first-child { font-size: 1rem; color: var(--text); margin-bottom: 0.35rem; }

/* Login */
.login-hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .login-hero { grid-template-columns: 1fr; }
}

.login-card { text-align: center; }
.brand-mark {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-brand h2 { font-family: var(--display); font-size: 1.5rem; font-weight: 400; }
.auth-status {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--accent-light);
  color: var(--accent);
}
.auth-status.auth-loading { animation: pulse 1.5s ease infinite; }
.auth-status.auth-error { background: #fdecea; color: var(--fail); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.login-hints {
  text-align: left;
  margin: 1rem 0 1.25rem;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.login-hints li { margin-bottom: 0.4rem; }

.btn-block { display: block; width: 100%; text-align: center; }

.feature-grid { display: grid; gap: 0.85rem; }
.feature-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.feature-item p { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.fi-icon { font-size: 1.25rem; }

.login-aside h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.score-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.score-big {
  font-family: var(--display);
  font-size: 3.75rem;
  color: var(--accent);
  line-height: 1;
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.badge.pass { background: #d8f0e4; color: var(--pass); }
.badge.fail { background: #fde8e6; color: var(--fail); }
.badge.neutral { background: var(--accent-light); color: var(--accent); }
.badge.partial { background: #fff4e0; color: var(--partial); }

.progress-bar { display: flex; gap: 0.2rem; margin: 0.5rem 0; }
.progress-step {
  flex: 1;
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.45rem 0.2rem;
  border-bottom: 3px solid var(--border);
}
.progress-step.active { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.progress-step.done { border-color: var(--pass); color: var(--pass); }

table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th {
  text-align: left;
  padding: 0.6rem 0.7rem;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
table.data td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }

.verdict { font-weight: 600; }
.verdict.pass { color: var(--pass); }
.verdict.partial { color: var(--partial); }
.verdict.fail { color: var(--fail); }
.verdict.na { color: var(--na); }

.dim-group { margin-bottom: 1.25rem; }
.dim-group h3 {
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timeline { border-left: 3px solid var(--border); margin-left: 0.5rem; padding-left: 1.1rem; }
.timeline-item { position: relative; margin-bottom: 1.1rem; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.45rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}
.timeline-item.done::before { background: var(--pass); }

.actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.52rem 1.05rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s, transform 0.1s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
.btn-disabled {
  background: #e8ecef;
  color: var(--muted);
  cursor: not-allowed;
  pointer-events: none;
}
.btn-sm { padding: 0.32rem 0.6rem; font-size: 0.78rem; }

.preview-box {
  background: #f8fafb;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
}

.muted { color: var(--muted); font-size: 0.85rem; }

.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.alert-info { background: var(--accent-light); color: var(--accent); border: 1px solid rgba(11, 79, 92, 0.2); }
.alert-warn { background: #fff8e6; color: #8a5a00; border: 1px solid #e6c200; }

.dispatch-search { position: relative; margin-bottom: 1rem; }
.dispatch-search input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
}
.search-results {
  position: absolute;
  z-index: 10;
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow-y: auto;
}
.search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.85rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
}
.search-item:hover { background: var(--accent-light); }

.selected-list { display: flex; flex-direction: column; gap: 0.5rem; }
.selected-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.7rem;
  background: #f8fafb;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.role-select {
  padding: 0.32rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: inherit;
}
