:root {
  color-scheme: light;
  --ink: #16201c;
  --muted: #5d6862;
  --line: #d7ded8;
  --paper: #fbfbf7;
  --soft: #eef5ef;
  --jade: #0d7c66;
  --red: #bb2737;
  --gold: #b77716;
  --blue: #255f9c;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(25, 37, 30, 0.12);
  --seal: #a92b2b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(251, 251, 247, 0.92), rgba(251, 251, 247, 0.92)),
    repeating-linear-gradient(90deg, rgba(13, 124, 102, 0.08) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(183, 119, 22, 0.07) 0 1px, transparent 1px 44px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.6;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(22, 32, 28, 0.08);
  background: rgba(251, 251, 247, 0.88);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: var(--white);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.bot-link,
.primary-action,
.secondary-action,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 750;
}

.bot-link,
.primary-action,
.icon-button {
  background: var(--jade);
  color: var(--white);
}

.icon-button {
  border: 0;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--white);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 34px;
  max-width: 1180px;
  min-height: calc(100svh - 70px);
  margin: 0 auto;
  padding: 78px 20px 48px;
  align-items: center;
  background:
    linear-gradient(110deg, rgba(13, 124, 102, 0.1), transparent 42%),
    linear-gradient(24deg, rgba(187, 39, 55, 0.09), transparent 36%),
    repeating-linear-gradient(135deg, rgba(169, 43, 43, 0.05) 0 2px, transparent 2px 22px);
  position: relative;
}

.hero::before {
  content: "事件盘";
  position: absolute;
  right: 22px;
  top: 92px;
  writing-mode: vertical-rl;
  color: rgba(169, 43, 43, 0.1);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(58px, 9vw, 132px);
  font-weight: 900;
  pointer-events: none;
}

.eyebrow,
.section-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.lead {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-panel,
.tool-section,
.notes {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
    repeating-linear-gradient(45deg, rgba(183, 119, 22, 0.06) 0 1px, transparent 1px 14px);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
}

.summary-stat {
  padding: 14px 12px;
  border-radius: 8px;
  background: var(--soft);
}

.summary-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 26px;
  line-height: 1;
}

.top-three {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.top-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid rgba(13, 124, 102, 0.16);
  background:
    linear-gradient(90deg, rgba(169, 43, 43, 0.04), transparent 28%),
    var(--white);
}

.method-band,
.cta-band {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 30px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 52px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.method-grid article {
  min-height: 180px;
  padding: 20px;
  border-top: 4px solid var(--jade);
  background: var(--white);
}

.method-grid article:nth-child(2) {
  border-top-color: var(--gold);
}

.method-grid article:nth-child(3) {
  border-top-color: var(--blue);
}

.method-grid span {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--muted);
  font-weight: 850;
}

.method-grid p,
.notes p,
.cta-band p {
  color: var(--muted);
}

.tool-section,
.notes {
  max-width: 1180px;
  margin: 0 auto 28px;
  padding: 22px;
  scroll-margin-top: 86px;
}

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

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

.search-box,
.select-box {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.search-box input,
.select-box select {
  width: 180px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
}

.select-box.wide select {
  width: 230px;
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 64px minmax(180px, 1fr) minmax(260px, 0.9fr) 86px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.rank-no {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-weight: 900;
}

.team-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 18px;
  font-weight: 850;
}

.flag {
  font-size: 29px;
  line-height: 1;
}

.team-meta {
  color: var(--muted);
  font-size: 13px;
}

.player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.player-chip {
  padding: 3px 7px;
  border: 1px solid rgba(13, 124, 102, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(238, 245, 239, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.score-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bar {
  display: grid;
  gap: 4px;
}

.bar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.bar i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.bar i::before {
  content: "";
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--c);
}

.score {
  text-align: right;
  font-size: 24px;
  font-weight: 900;
}

.rank-row.detail {
  grid-template-columns: 64px minmax(180px, 0.7fr) minmax(290px, 1fr) 86px;
}

.rank-row.detail .team-meta::after {
  content: " · 能量 " attr(data-star) " · 风险 " attr(data-transform);
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(280px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.ziwei-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, minmax(84px, 1fr));
  gap: 8px;
  min-height: 430px;
}

.palace {
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.palace.center {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  place-items: center;
  text-align: center;
  background: var(--ink);
  color: var(--white);
}

.palace small {
  color: var(--muted);
  font-weight: 750;
}

.palace.center small {
  color: rgba(255, 255, 255, 0.76);
}

.palace strong {
  font-size: 15px;
}

.reading-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
}

.reading-panel .big-team {
  font-size: 28px;
  font-weight: 900;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.compare-card.winner {
  border-color: rgba(13, 124, 102, 0.5);
  box-shadow: inset 0 0 0 2px rgba(13, 124, 102, 0.14);
}

.compare-score {
  margin: 10px 0;
  font-size: 38px;
  font-weight: 950;
  line-height: 1;
}

.delta {
  color: var(--red);
  font-weight: 850;
}

.share-section {
  overflow: hidden;
}

#shareCanvas {
  display: block;
  width: min(100%, 420px);
  aspect-ratio: 3 / 4;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.cta-band {
  align-items: center;
  margin-top: 12px;
  padding-bottom: 38px;
}

.cta-band .primary-action {
  justify-self: end;
  min-width: 220px;
}

.cta-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.notes {
  box-shadow: none;
}

.notes h2 {
  font-size: 22px;
}

.site-footer {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 44px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 860px) {
  .nav {
    align-items: flex-start;
  }

  .nav-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
  }

  .hero,
  .method-band,
  .cta-band,
  .chart-layout,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 46px;
  }

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: stretch;
  }

  .search-box,
  .select-box,
  .search-box input,
  .select-box select,
  .select-box.wide select {
    width: 100%;
  }

  .rank-row,
  .rank-row.detail {
    grid-template-columns: 54px minmax(0, 1fr) 74px;
  }

  .score-bars {
    grid-column: 1 / -1;
    order: 4;
  }

  .ziwei-board {
    grid-template-rows: repeat(4, minmax(76px, 1fr));
    min-height: 390px;
    gap: 6px;
  }

  .palace {
    padding: 8px;
  }

  .cta-band .primary-action {
    justify-self: stretch;
  }
}

@media (max-width: 560px) {
  .brand span:last-child {
    display: none;
  }

  .nav-actions a:not(.bot-link) {
    display: none;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .rank-row,
  .rank-row.detail {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .score {
    grid-column: 2;
    text-align: left;
  }

  .team-name {
    font-size: 16px;
  }

  .ziwei-board {
    font-size: 12px;
  }
}
