:root {
  --blue: #0a4da6;
  --blue-deep: #083a7d;
  --orange: #ff7a18;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1a2332;
  --muted: #5b6b7c;
  --line: #e3eaf2;
  --red: #e23d28;
  --yellow: #f5a623;
  --green: #12a05c;
  --shadow: 0 8px 24px rgba(10, 77, 166, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(10, 77, 166, 0.10), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(255, 122, 24, 0.08), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.6fr;
  gap: 16px;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--blue);
}
.brand-sub { color: var(--muted); font-size: 14px; }

.topbar-center { display: flex; gap: 8px; justify-content: center; }
.company-chip, .period-chip {
  background: #eef4fb;
  color: var(--blue-deep);
  border: 1px solid #d7e4f4;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}

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

.freshness {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.freshness .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(18, 160, 92, 0.15);
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn-accent {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.btn-ghost { background: #fff; }

.subnav {
  display: flex;
  gap: 8px;
  padding: 12px 28px 0;
}
.subnav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}
.subnav a.active, .subnav a:hover {
  background: #fff;
  color: var(--blue);
  box-shadow: var(--shadow);
}

.page { padding: 18px 28px 40px; max-width: 1440px; margin: 0 auto; }
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0 24px;
}

.hero-strip {
  display: grid;
  grid-template-columns: 320px 1.4fr 320px;
  gap: 16px;
  margin-bottom: 20px;
}

.health-card, .lights-panel, .loss-panel, .unit-card, .chart-box, .attr-card, .report-sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.health-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: rise 0.5s ease both;
}
.health-ring { width: 180px; height: 180px; }
.health-label { color: var(--muted); font-size: 13px; }
.health-score {
  font-size: 42px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}
.health-score span { font-size: 16px; margin-left: 4px; color: var(--muted); }
.health-delta { font-weight: 700; margin-top: 4px; }
.health-delta.up { color: var(--green); }
.health-delta.down { color: var(--red); }
.health-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

.lights-panel, .loss-panel { padding: 18px; animation: rise 0.55s ease both; }
.panel-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--blue-deep);
}
.panel-note { color: var(--muted); font-size: 12px; margin: 12px 0 0; }

.lights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.light-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fbfe;
  border: 1px solid var(--line);
  transition: 0.2s ease;
}
.light-item:hover { border-color: var(--blue); }
.light-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--yellow);
}
.light-item.status-green .light-dot { background: var(--green); }
.light-item.status-yellow .light-dot { background: var(--yellow); }
.light-item.status-red .light-dot { background: var(--red); }
.light-name { flex: 1; font-size: 13px; }
.light-score { font-weight: 700; color: var(--blue); }

.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8f0;
  border-left: 3px solid var(--yellow);
  font-size: 13px;
  line-height: 1.45;
}
.alert-row.level-red {
  background: #fff4f2;
  border-left-color: var(--red);
}
.alert-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--yellow);
  border-radius: 4px;
  padding: 2px 6px;
}
.level-red .alert-tag { background: var(--red); }

.loss-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}
.loss-bar-wrap {
  height: 8px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}
.loss-bar { height: 100%; border-radius: 999px; background: var(--blue); }
.loss-bar.status-green { background: var(--green); }
.loss-bar.status-yellow { background: var(--yellow); }
.loss-bar.status-red { background: var(--red); }
.loss-val { text-align: right; color: var(--muted); }

.section-head { margin: 8px 0 14px; }
.section-head h2 { margin: 0 0 4px; font-size: 20px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.unit-card {
  padding: 16px 18px;
  border-top: 4px solid var(--yellow);
  transition: 0.2s ease;
  animation: rise 0.6s ease both;
}
.unit-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(10, 77, 166, 0.12); }
.unit-card.status-green { border-top-color: var(--green); }
.unit-card.status-yellow { border-top-color: var(--yellow); }
.unit-card.status-red { border-top-color: var(--red); }

.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-icon { color: var(--blue); font-weight: 700; }
.card-name { flex: 1; font-weight: 700; }
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff4e5;
  color: #b36b00;
}
.unit-card.status-green .status-pill,
.status-pill.status-green { background: #e8f8ef; color: var(--green); }
.unit-card.status-yellow .status-pill,
.status-pill.status-yellow { background: #fff4e5; color: #b36b00; }
.unit-card.status-red .status-pill,
.status-pill.status-red { background: #fdecea; color: var(--red); }

.card-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}
.card-sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.spark { height: 42px; margin-bottom: 10px; }
.progress-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.progress-track {
  height: 8px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #3d7fd4);
  border-radius: 999px;
}
.card-conclusion {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.overview-charts, .detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.chart-box { padding: 16px 18px; animation: rise 0.65s ease both; }
.chart-box.wide { grid-column: 1 / -1; }
.chart-head h3 { margin: 0 0 4px; font-size: 16px; }
.chart-head p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.chart { width: 100%; height: 280px; }
.chart.tall { height: 320px; }

.detail-hero { margin-bottom: 16px; }
.back-link { color: var(--blue); font-size: 13px; }
.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.detail-title-row h1 { margin: 8px 0 6px; font-size: 28px; }
.detail-lead { margin: 0; color: var(--muted); }
.detail-lead strong { color: var(--text); font-size: 18px; margin-right: 8px; }

.unit-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 520px;
  justify-content: flex-end;
}
.unit-switch a {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}
.unit-switch a.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.attr-card {
  padding: 18px;
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #ffffff, #f7fbff);
}
.attr-card p { margin: 0; line-height: 1.7; }

.table-section { margin-bottom: 22px; }
.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  background: #f7fafc;
  color: var(--muted);
  font-weight: 700;
}
tr:hover td { background: #f9fbff; }
.cell-red { color: var(--red); font-weight: 700; }
.cell-yellow { color: #b36b00; font-weight: 700; }
.cell-green { color: var(--green); font-weight: 700; }

.report-sheet {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 32px 36px;
  animation: rise 0.45s ease both;
}
.report-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--blue);
  margin-bottom: 18px;
}
.report-eyebrow {
  margin: 0;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 1px;
}
.report-header h1 { margin: 6px 0; font-size: 30px; }
.report-meta { margin: 0; color: var(--muted); font-size: 13px; }
.report-score-box {
  min-width: 110px;
  text-align: center;
  background: #f3f7fd;
  border-radius: 12px;
  padding: 12px;
}
.mini-label { color: var(--muted); font-size: 12px; }
.mini-score { font-size: 36px; font-weight: 800; color: var(--blue); }

.report-block { margin-bottom: 22px; }
.report-block h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--blue-deep);
  border-left: 4px solid var(--orange);
  padding-left: 10px;
}
.report-conclusion {
  font-size: 16px;
  line-height: 1.7;
  background: #fff8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0;
}

.change-list, .action-list, .risk-list {
  margin: 0;
  padding-left: 20px;
}
.change-list li, .action-list li, .risk-list li {
  margin-bottom: 12px;
  line-height: 1.6;
}
.change-list li span {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.change-list li em {
  display: inline-block;
  margin-top: 4px;
  font-style: normal;
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
}
.action-btns { display: flex; flex-wrap: wrap; gap: 10px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr; }
  .topbar-center, .topbar-right { justify-content: flex-start; }
  .hero-strip, .cards-grid, .overview-charts, .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-title-row { flex-direction: column; }
  .unit-switch { justify-content: flex-start; }
}

@media print {
  .no-print, .topbar, .subnav, .footer { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .report-sheet, .chart-box, .unit-card, .table-wrap {
    box-shadow: none;
    border-color: #ddd;
  }
  .chart { height: 240px; }
}
