:root {
  --fc-bg0: #eef3f6;
  --fc-bg1: #e2ebf0;
  --fc-ink: #14202b;
  --fc-muted: #5a6b7a;
  --fc-line: rgba(20, 32, 43, 0.1);
  --fc-surface: #ffffff;
  --fc-classic: #7a8699;
  --fc-personal: #1f6f8b;
  --fc-baseline: #b08968;
  --fc-accent: #1f6f8b;
  --fc-accent-deep: #155a70;
  --fc-radius: 18px;
  --fc-font: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --fc-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  font-family: var(--fc-font);
  color: var(--fc-ink);
  background:
    radial-gradient(100% 70% at 0% -8%, rgba(127, 184, 198, 0.35) 0%, transparent 52%),
    radial-gradient(80% 55% at 100% 0%, rgba(180, 210, 198, 0.28) 0%, transparent 48%),
    linear-gradient(180deg, var(--fc-bg0) 0%, var(--fc-bg1) 100%);
  -webkit-tap-highlight-color: transparent;
}

body {
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

.fc-root {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px 48px;
}

/* —— 顶栏 —— */
.fc-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

body.fc-wxmp .fc-topbar {
  display: none;
}

body.fc-wxmp .fc-root {
  padding-top: 8px;
}

.fc-back {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 12px;
  background: var(--fc-surface);
  box-shadow: 0 1px 0 var(--fc-line);
  color: var(--fc-ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.fc-back:active {
  transform: scale(0.96);
}

.fc-brand {
  flex: 1;
  min-width: 0;
}

.fc-brand-kicker {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fc-muted);
  margin: 0 0 2px;
}

.fc-brand h1 {
  margin: 0;
  font-family: var(--fc-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

/* —— Hero —— */
.fc-hero {
  margin-bottom: 12px;
  padding: 2px 0 6px;
}

.fc-hero-label {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fc-muted);
}

.fc-hero-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.fc-hero-value {
  font-family: var(--fc-display);
  font-size: clamp(40px, 11vw, 56px);
  font-weight: 700;
  line-height: 1;
  color: var(--fc-accent);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.fc-hero-unit {
  font-size: 17px;
  font-weight: 600;
  color: var(--fc-muted);
}

.fc-hero-sub {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--fc-muted);
}

.fc-insight {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fc-ink);
}

/* —— 面板 —— */
.fc-panel {
  margin-bottom: 20px;
  padding-top: 2px;
}

.fc-panel-head {
  margin-bottom: 10px;
}

.fc-panel-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.fc-panel-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fc-muted);
  word-break: break-word;
}

/* —— 图表 —— */
.fc-chart-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfcfe 0%, #f0f5f8 100%);
  border: 1px solid var(--fc-line);
}

#fcCanvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
  vertical-align: top;
}

.fc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--fc-muted);
}

.fc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fc-legend i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fc-legend .fc-l-classic i {
  background: var(--fc-classic);
}

.fc-legend .fc-l-personal i {
  background: var(--fc-personal);
  box-shadow: 0 0 0 2px rgba(31, 111, 139, 0.2);
}

.fc-legend .fc-l-baseline i {
  background: var(--fc-baseline);
}

/* —— 次级参数 —— */
.fc-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fc-stat {
  min-width: 0;
  padding: 12px 6px;
  text-align: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--fc-line);
}

.fc-stat strong {
  display: block;
  font-family: var(--fc-display);
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 700;
  color: var(--fc-accent);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.fc-stat span {
  display: block;
  font-size: 11px;
  color: var(--fc-muted);
  line-height: 1.35;
}

@media (max-width: 340px) {
  .fc-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fc-stat {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 8px 12px;
    text-align: left;
    padding: 12px 14px;
  }

  .fc-stat strong {
    margin-bottom: 0;
    font-size: 20px;
  }
}

/* —— 关键节点：紧凑对照 —— */
.fc-nodes {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fc-node {
  padding: 10px 0;
  border-bottom: 1px solid var(--fc-line);
}

.fc-node:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.fc-node-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.fc-node-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--fc-ink);
}

.fc-node-personal {
  font-size: 14px;
  font-weight: 700;
  color: var(--fc-personal);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.fc-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fc-bar-row {
  display: grid;
  grid-template-columns: 2.5em minmax(0, 1fr) 3.2em;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fc-muted);
  min-width: 0;
}

.fc-bar-row > span:first-child {
  white-space: nowrap;
}

.fc-bar-track {
  height: 7px;
  border-radius: 4px;
  background: rgba(20, 32, 43, 0.06);
  overflow: hidden;
  min-width: 0;
}

.fc-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.fc-bar-fill--classic {
  background: var(--fc-classic);
}

.fc-bar-fill--personal {
  background: var(--fc-personal);
}

.fc-bar-fill--baseline {
  background: var(--fc-baseline);
}

.fc-bar-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fc-bar-row--personal .fc-bar-pct {
  color: var(--fc-personal);
  font-weight: 700;
}

/* —— CTA —— */
.fc-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-btn {
  appearance: none;
  border: 1px solid var(--fc-line);
  background: var(--fc-surface);
  color: var(--fc-ink);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}

.fc-btn--primary {
  background: var(--fc-accent);
  border-color: var(--fc-accent);
  color: #fff;
}

.fc-btn--primary:active {
  background: var(--fc-accent-deep);
}

.fc-btn:active {
  transform: scale(0.985);
}

@media (min-width: 480px) {
  .fc-actions {
    flex-direction: row;
  }

  .fc-btn {
    width: auto;
    min-width: 140px;
    flex: 1;
  }

  .fc-brand h1 {
    font-size: 24px;
  }

  .fc-insight {
    font-size: 15px;
  }

  .fc-bar-row {
    grid-template-columns: 2.75em minmax(0, 1fr) 3.4em;
    gap: 8px;
  }
}

.fc-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--fc-muted);
  line-height: 1.55;
}

.fc-status {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--fc-muted);
  background: rgba(251, 252, 254, 0.88);
  padding: 24px 16px;
  text-align: center;
}

.fc-status[hidden] {
  display: none;
}

.fc-status--err {
  color: #b42318;
}

/* —— 入场 —— */
@keyframes fc-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fc-reveal {
  animation: fc-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fc-reveal--2 {
  animation-delay: 0.06s;
}

.fc-reveal--3 {
  animation-delay: 0.12s;
}

.fc-reveal--4 {
  animation-delay: 0.18s;
}

.fc-reveal--5 {
  animation-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  .fc-reveal {
    animation: none;
  }

  .fc-bar-fill {
    transition: none;
  }
}
