:root {
  color-scheme: dark;
  --page: #080908;
  --card: #151513;
  --panel: rgba(22, 22, 19, 0.88);
  --panel-2: rgba(28, 27, 23, 0.92);
  --text: #f7f7f2;
  --muted: #b9b5aa;
  --faint: #77736a;
  --line: rgba(255, 153, 31, 0.28);
  --orange: #ff8200;
  --orange-2: #ffae21;
  --green: #64d928;
  --red: #ff4739;
  --blue: #42a5f5;
  --purple: #804dff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #24211d 0, #090a09 48%, #030403 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.control-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: 0;
}

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

.file-input,
.select,
.button {
  min-height: 42px;
  border-radius: 8px;
}

.file-input,
.select {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 5px 10px;
}

.select {
  min-width: 132px;
}

.select option {
  background: #11120f;
  color: var(--text);
}

.file-input {
  max-width: 300px;
}

.file-input::file-selector-button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: var(--orange);
  color: #111;
  margin-right: 10px;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #111;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.report-card {
  width: min(100%, 1180px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 130, 0, 0.07), transparent 24%),
    linear-gradient(135deg, #10110f, #090a09);
  box-shadow: var(--shadow);
}

.report-hero {
  position: relative;
  min-height: 270px;
  padding: 34px 42px 24px;
  background:
    linear-gradient(180deg, rgba(5, 6, 6, 0.55) 0%, rgba(5, 6, 6, 0) 26%),
    linear-gradient(180deg, rgba(6, 7, 6, 0) 52%, rgba(7, 8, 7, 0.92) 100%),
    linear-gradient(90deg, rgba(5, 7, 7, 0.96) 0%, rgba(7, 8, 8, 0.78) 38%, rgba(7, 8, 8, 0.22) 68%, rgba(7, 8, 8, 0.7) 100%),
    url("/hero-runner.png") center / 100% 100% no-repeat,
    radial-gradient(circle at 75% 38%, rgba(255, 147, 45, 0.72), rgba(255, 147, 45, 0.08) 23%, transparent 34%),
    linear-gradient(165deg, #202323 0%, #111 46%, #050605 100%);
}

.report-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background:
    linear-gradient(7deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 100%),
    linear-gradient(177deg, transparent 0 44%, rgba(255, 255, 255, 0.14) 45% 46%, transparent 47%);
  opacity: 0.5;
}

.hero-shade {
  display: none;
  position: absolute;
  right: 285px;
  bottom: 18px;
  width: 72px;
  height: 170px;
  border-radius: 42px 42px 18px 18px;
  background: linear-gradient(180deg, #1b1b1a, #070707);
  box-shadow: 16px 52px 0 -18px rgba(255, 255, 255, 0.72);
  transform: rotate(9deg);
  opacity: 0.9;
}

.brand {
  position: absolute;
  top: 34px;
  right: 42px;
  display: grid;
  gap: 8px;
  text-align: right;
}

.brand strong {
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 34px;
  font-weight: 500;
}

.brand span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.title-block {
  position: relative;
  z-index: 1;
}

.title-block > span {
  display: block;
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 900;
}

.title-block h2 {
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.title-block h2 b {
  color: var(--orange);
  font-size: 1.55em;
  line-height: 0.8;
}

.title-block p {
  margin-top: 24px;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
}

.title-block p::before,
.title-block p::after {
  color: var(--orange);
  font-size: 34px;
  line-height: 0;
}

.top-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 22px 40px 26px;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.08), rgba(0, 0, 0, 0.28));
}

.metric {
  min-width: 0;
  padding: 0 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.metric:first-child {
  border-left: 0;
  padding-left: 0;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
  color: var(--text);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.metric-value small {
  font-size: 20px;
  font-weight: 700;
}

.metric-delta {
  display: block;
  margin-top: 12px;
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
}

.metric-delta.is-red {
  color: var(--red);
}

.metric-delta.is-neutral {
  color: var(--faint);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 30px 26px;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 36px rgba(0, 0, 0, 0.18);
  padding: 16px 18px;
}

.compact-panel {
  min-height: 248px;
  display: flex;
  flex-direction: column;
}

.panel h3 {
  padding-left: 10px;
  border-left: 2px solid var(--orange);
  font-size: 21px;
  letter-spacing: 0;
}

.panel h3 small {
  color: var(--muted);
  font-size: 15px;
}

.daily-panel {
  grid-column: span 2;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.panel-meta {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.daily-chart {
  display: block;
  width: 100%;
  height: 300px;
  margin-top: 40px;
}

.chart-grid {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-bar {
  fill: url(#barGradient);
}

.chart-bar.is-longest {
  fill: var(--orange-2);
}

.chart-value {
  fill: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.chart-star {
  fill: var(--orange-2);
  font-size: 22px;
}

.highlight-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.highlight-item,
.best-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.highlight-icon {
  color: var(--orange-2);
  font-size: 22px;
}

.highlight-name,
.best-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.highlight-value,
.best-value {
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
}

.highlight-date,
.best-date {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.bar-list,
.zone-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.dist-row,
.zone-row {
  display: grid;
  grid-template-columns: 96px minmax(90px, 1fr) 58px;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.track {
  height: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2463ac, #8cc8ff);
}

.fill.is-hot {
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
  box-shadow: 0 0 20px rgba(255, 130, 0, 0.36);
}

.fill.is-heart-z5 {
  background: linear-gradient(90deg, #e53935, #ff6b54);
}

.fill.is-heart-z4 {
  background: linear-gradient(90deg, #ff7a00, #ffa737);
}

.fill.is-heart-z3 {
  background: linear-gradient(90deg, #d79d14, #f0c12d);
}

.fill.is-heart-z2 {
  background: linear-gradient(90deg, #15a785, #35d1b8);
}

.fill.is-heart-z1 {
  background: linear-gradient(90deg, #2b83c9, #63c7ff);
}

.panel-footer {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.compact-panel .bar-list,
.compact-panel .zone-list {
  flex: 1;
}



.best-panel {
  grid-column: span 2;
}

.best-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
}

.best-item {
  grid-template-columns: 1fr;
  border-bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0 18px;
}

.best-item:first-child {
  border-left: 0;
}

.best-date {
  text-align: left;
}

.quote-panel {
  display: grid;
  place-content: center;
  gap: 16px;
  min-height: 130px;
  background: linear-gradient(135deg, rgba(255, 130, 0, 0.10), rgba(20, 20, 18, 0.94) 38%, rgba(20, 20, 18, 0.96));
}

.quote-panel p {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.65;
}

.quote-panel span {
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

#shareCanvas {
  display: none;
}

@media (max-width: 980px) {
  .control-bar,
  .panel-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-controls {
    justify-content: flex-start;
  }

  .top-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 0;
  }

  .metric:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .daily-panel,
  .best-panel {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 16px, 1240px);
  }

  .report-hero,
  .top-metrics,
  .report-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand {
    position: static;
    margin-bottom: 22px;
    text-align: left;
  }

  .hero-shade {
    display: none;
  }

  .title-block h2 {
    font-size: 40px;
  }

  .top-metrics,
  .best-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .metric:nth-child(odd),
  .best-item {
    border-left: 0;
    padding-left: 0;
  }

  .file-input,
  .select,
  .button {
    width: 100%;
    max-width: none;
  }
}
