:root {
  --paper: #f7f8f3;
  --ink: #171a18;
  --muted: #68706a;
  --line: #dfe4da;
  --panel: #ffffff;
  --panel-strong: #f0f4ed;
  --red: #c83e35;
  --green: #15805a;
  --amber: #b46d12;
  --cyan: #247e93;
  --shadow: 0 18px 48px rgba(23, 26, 24, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(36, 126, 147, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(180, 109, 18, 0.08), transparent 38%),
    var(--paper);
  font-family: Avenir Next, Hiragino Sans GB, PingFang SC, Helvetica Neue, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

select {
  font: inherit;
}

.shell {
  width: min(1760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  border-bottom: 1px solid rgba(23, 26, 24, 0.14);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  font-family: Didot, Songti SC, serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.05;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  padding-bottom: 10px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(23, 26, 24, 0.06);
}

.icon-button:hover {
  border-color: var(--cyan);
}

.db-path {
  max-width: 460px;
  overflow: hidden;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric {
  min-height: 86px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(23, 26, 24, 0.05);
}

.metric span,
.quote-strip span,
.search-panel label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-family: Menlo, Consolas, monospace;
  font-size: 22px;
  line-height: 1.1;
}

.metric.accent {
  border-color: rgba(36, 126, 147, 0.36);
  background: #edf7f7;
}

.contest-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(23, 26, 24, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(23, 26, 24, 0.055), transparent 180px),
    rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.contest-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.contest-head h2 {
  font-family: Didot, Songti SC, serif;
  font-size: 32px;
  line-height: 1.05;
}

.contest-controls {
  display: grid;
  grid-template-columns: minmax(128px, 160px) 110px 150px auto;
  align-items: end;
  gap: 10px;
}

.contest-controls label {
  display: grid;
  gap: 6px;
}

.contest-controls span {
  color: var(--muted);
  font-size: 12px;
}

.contest-controls input,
.contest-controls select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #cfd7ce;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.contest-scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.contest-scoreboard article {
  min-height: 78px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

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

.contest-scoreboard strong {
  display: block;
  margin-top: 9px;
  font-family: Menlo, Consolas, monospace;
  font-size: 18px;
}

.contest-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1.1fr) minmax(520px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.contest-board,
.contest-detail,
.contest-holdings-block,
.contest-trades-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcf8;
}

.contest-block-head,
.contest-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.contest-block-head h3,
.contest-subhead h4 {
  font-size: 16px;
}

.contest-block-head span,
.contest-subhead span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.contest-block-head select {
  min-width: 210px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #cfd7ce;
  border-radius: 8px;
  background: #fff;
}

.contest-chart {
  min-height: 300px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.contest-table-head,
.contest-item {
  display: grid;
  grid-template-columns: 30px 12px minmax(160px, 1fr) repeat(5, minmax(68px, auto));
  align-items: center;
  gap: 10px;
}

.contest-table-head {
  min-height: 36px;
  padding: 0 10px;
  color: var(--muted);
  background: #f6f8f2;
  font-size: 11px;
}

.contest-list {
  display: grid;
  max-height: 430px;
  overflow: auto;
}

.contest-item {
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #edf0ea;
  text-align: left;
  background: transparent;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.contest-item:hover,
.contest-item.active {
  background: #f2f7f1;
}

.contest-item.top-rank {
  background:
    linear-gradient(90deg, rgba(240, 196, 107, 0.16), rgba(255, 255, 255, 0.92));
}

.contest-item.active {
  box-shadow: inset 4px 0 0 var(--cyan);
}

.contest-rank {
  color: var(--muted);
  font-weight: 700;
}

.contest-title {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-family: Avenir Next, PingFang SC, sans-serif;
}

.contest-title strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contest-title em {
  overflow: hidden;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contest-detail-grid {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.contest-trades {
  max-height: 322px;
  overflow: auto;
}

.contest-trade-row {
  display: grid;
  grid-template-columns: 62px minmax(110px, 1fr) 116px 62px 62px 78px;
  align-items: center;
  gap: 8px;
  min-width: 540px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf0ea;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.contest-trade-header {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f6f8f2;
  font-size: 11px;
}

.contest-trade-row em {
  display: block;
  margin-top: 3px;
  font-style: normal;
}

.trade-action {
  display: inline-grid;
  min-width: 44px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
}

.trade-action.buy {
  background: var(--red);
}

.trade-action.sell {
  background: var(--green);
}

.trade-action.rebalance {
  background: var(--amber);
}

.blog-page {
  color: #18201b;
  background:
    linear-gradient(90deg, rgba(36, 126, 147, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(180, 109, 18, 0.1), transparent 42%),
    #f8f7ef;
}

.blog-page a {
  color: inherit;
  text-decoration: none;
}

.blog-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1160px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(24, 32, 27, 0.12);
  background: rgba(248, 247, 239, 0.88);
  backdrop-filter: blur(18px);
}

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

.blog-brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(24, 32, 27, 0.12);
}

.blog-nav nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.blog-nav nav a {
  min-height: 36px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #5f675f;
  font-size: 14px;
}

.blog-nav nav a:hover {
  color: #18201b;
  background: rgba(36, 126, 147, 0.1);
}

.blog-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.blog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 22px;
  align-items: stretch;
  min-height: 430px;
}

.blog-hero-copy {
  display: grid;
  align-content: end;
  min-width: 0;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(24, 32, 27, 0.14);
  border-radius: 8px;
  color: #f8f7ef;
  background:
    linear-gradient(135deg, rgba(24, 32, 27, 0.98), rgba(24, 32, 27, 0.88) 58%, rgba(36, 126, 147, 0.88)),
    #18201b;
  box-shadow: 0 28px 70px rgba(24, 32, 27, 0.16);
}

.blog-kicker {
  margin: 0 0 10px;
  color: #c9972c;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.blog-hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: Didot, Songti SC, serif;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
}

.blog-hero-copy > p:not(.blog-kicker) {
  max-width: 720px;
  margin: 18px 0 0;
  color: rgba(248, 247, 239, 0.78);
  font-size: 17px;
  line-height: 1.9;
}

.blog-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.blog-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #c9972c;
  border-radius: 8px;
  color: #18201b;
  background: #c9972c;
  font-weight: 700;
}

.blog-button.ghost {
  color: #f8f7ef;
  background: transparent;
}

.blog-hero-panel {
  display: grid;
  align-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(24, 32, 27, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 46px rgba(24, 32, 27, 0.08);
}

.blog-hero-panel img {
  width: min(190px, 68%);
  height: auto;
  border-radius: 22px;
  box-shadow: 0 22px 50px rgba(24, 32, 27, 0.16);
}

.blog-hero-panel dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.blog-hero-panel div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(24, 32, 27, 0.12);
}

.blog-hero-panel dt {
  color: #68706a;
  font-size: 13px;
}

.blog-hero-panel dd {
  margin: 0;
  font-weight: 800;
}

.blog-section {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid rgba(24, 32, 27, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 42px rgba(24, 32, 27, 0.06);
}

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

.blog-section h2 {
  margin: 0;
  font-family: Didot, Songti SC, serif;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
}

.blog-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.blog-post {
  display: grid;
  align-content: start;
  min-height: 226px;
  padding: 18px;
  border: 1px solid rgba(24, 32, 27, 0.12);
  border-radius: 8px;
  background: #fbfbf6;
}

.blog-post.featured {
  grid-column: span 2;
  color: #f8f7ef;
  background:
    linear-gradient(145deg, rgba(36, 126, 147, 0.95), rgba(24, 32, 27, 0.92)),
    #247e93;
}

.blog-post-meta {
  margin: 0 0 12px;
  color: #7b837b;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.blog-post.featured .blog-post-meta {
  color: rgba(248, 247, 239, 0.72);
}

.blog-post h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.blog-post p:not(.blog-post-meta) {
  margin: 12px 0 0;
  color: #5f675f;
  line-height: 1.8;
}

.blog-post.featured p:not(.blog-post-meta) {
  color: rgba(248, 247, 239, 0.78);
}

.blog-post span {
  align-self: end;
  margin-top: 18px;
  color: #a36f10;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.blog-post.featured span {
  color: #f0c46b;
}

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

.blog-note-list article {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid rgba(24, 32, 27, 0.1);
}

.blog-note-list article:first-child {
  border-top: 0;
}

.blog-note-list time {
  color: #247e93;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.blog-note-list p,
.blog-about-copy p,
.blog-contact address span {
  margin: 0;
  color: #4f584f;
  line-height: 1.85;
}

.blog-about,
.blog-contact {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}

.blog-about-copy {
  display: grid;
  gap: 12px;
}

.blog-contact address {
  display: grid;
  gap: 10px;
  font-style: normal;
}

.blog-contact address a {
  width: fit-content;
  color: #247e93;
  font-family: Menlo, Consolas, monospace;
  font-weight: 700;
}

.blog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid rgba(24, 32, 27, 0.12);
  color: #6c756c;
  font-size: 13px;
}

.contest-public-page {
  background:
    repeating-linear-gradient(90deg, rgba(23, 26, 24, 0.035) 0 1px, transparent 1px 88px),
    linear-gradient(135deg, rgba(36, 126, 147, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(180, 109, 18, 0.13), transparent 42%),
    var(--paper);
}

.public-shell {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.public-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 168px;
  padding: 24px;
  border: 1px solid rgba(23, 26, 24, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 26, 24, 0.96), rgba(23, 26, 24, 0.82) 52%, rgba(36, 126, 147, 0.88)),
    var(--panel);
  box-shadow: 0 24px 60px rgba(23, 26, 24, 0.16);
  color: #f7f8f3;
}

.public-hero h1 {
  font-family: Didot, Songti SC, serif;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.96;
}

.public-hero .eyebrow {
  color: #f0c46b;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.public-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.public-brand span {
  color: rgba(247, 248, 243, 0.82);
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
}

.public-subtitle {
  margin-top: 10px;
  color: rgba(247, 248, 243, 0.76);
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
}

.public-season-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.public-season-tags span {
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid rgba(247, 248, 243, 0.2);
  border-radius: 8px;
  background: rgba(247, 248, 243, 0.08);
  color: rgba(247, 248, 243, 0.86);
  font-size: 12px;
}

.public-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: min(360px, 100%);
}

.public-actions strong {
  max-width: 100%;
  overflow: hidden;
  color: #f0c46b;
  font-family: Menlo, Consolas, monospace;
  font-size: clamp(18px, 2vw, 24px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-actions .primary-button {
  color: var(--ink);
  background: #f0c46b;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
}

.public-actions span {
  color: rgba(247, 248, 243, 0.68);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.public-scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0 12px;
}

.public-scoreboard article {
  min-height: 92px;
  padding: 15px 16px;
  border: 1px solid rgba(23, 26, 24, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 246, 0.92));
  box-shadow: 0 14px 34px rgba(23, 26, 24, 0.07);
}

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

.public-scoreboard strong {
  display: block;
  margin-top: 10px;
  font-family: Menlo, Consolas, monospace;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.05;
}

.public-podium {
  display: grid;
  grid-template-columns: 0.92fr 1.16fr 0.92fr;
  gap: 12px;
  margin-bottom: 14px;
}

.public-podium-card {
  display: grid;
  align-content: end;
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(23, 26, 24, 0.16);
  border-radius: 8px;
  text-align: left;
  background: #fff;
  box-shadow: 0 16px 40px rgba(23, 26, 24, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.public-podium-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(23, 26, 24, 0.12);
}

.public-podium-card.rank-1 {
  min-height: 148px;
  border-color: rgba(180, 109, 18, 0.38);
  background:
    linear-gradient(180deg, rgba(240, 196, 107, 0.24), rgba(255, 255, 255, 0.96));
}

.public-podium-card.rank-2 {
  margin-top: 18px;
  background:
    linear-gradient(180deg, rgba(36, 126, 147, 0.13), rgba(255, 255, 255, 0.96));
}

.public-podium-card.rank-3 {
  margin-top: 34px;
  background:
    linear-gradient(180deg, rgba(200, 62, 53, 0.12), rgba(255, 255, 255, 0.96));
}

.public-podium-card span {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.public-podium-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.1;
}

.public-podium-card em {
  display: block;
  margin-top: 10px;
  color: var(--red);
  font-family: Menlo, Consolas, monospace;
  font-size: 24px;
  font-style: normal;
}

.public-podium-card small {
  margin-top: 7px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
}

.public-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1.04fr) minmax(520px, 0.96fr);
  gap: 14px;
  align-items: start;
}

.public-board,
.public-detail {
  min-width: 0;
  border: 1px solid rgba(23, 26, 24, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(23, 26, 24, 0.08);
}

.public-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, #f1f5ee, #fbfcf8);
}

.public-block-head h2 {
  font-size: 18px;
}

.public-block-head span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.public-block-head select {
  min-width: 210px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #cfd7ce;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.public-board .compare-dot {
  background: var(--cyan);
}

.public-chart {
  min-height: 330px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.public-detail-grid {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.league-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(23, 26, 24, 0.14);
  border-radius: 8px;
  background: rgba(247, 248, 243, 0.94);
  box-shadow: 0 12px 34px rgba(23, 26, 24, 0.08);
  backdrop-filter: blur(18px);
}

.league-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.league-brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(23, 26, 24, 0.12);
}

.league-brand span {
  font-family: Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
}

.league-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.league-cache {
  overflow: hidden;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-count {
  display: inline-flex;
  align-items: center;
  color: #3f4842;
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.rss-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #cfd7ce;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

.rss-menu {
  position: relative;
}

.rss-menu summary {
  list-style: none;
  cursor: pointer;
}

.rss-menu summary::-webkit-details-marker {
  display: none;
}

.rss-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  width: min(290px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(23, 26, 24, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(23, 26, 24, 0.16);
}

.rss-popover a {
  display: block;
  overflow: hidden;
  padding: 11px 12px;
  border-bottom: 1px solid #edf0ea;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rss-popover a:last-child {
  border-bottom: 0;
}

.rss-popover a:hover {
  background: #eef5f2;
}

.rss-button {
  padding: 0 12px;
  color: #7c4d0a;
  border-color: rgba(180, 109, 18, 0.32);
  background: #fff8e8;
  font-size: 12px;
  font-weight: 700;
}

.rss-button:hover {
  border-color: var(--amber);
  background: #fff2d1;
}

.public-board-wide,
.public-detail-wide {
  width: 100%;
}

.public-board-wide {
  margin-bottom: 14px;
}

.ranking-head {
  min-height: 76px;
}

.ranking-head h1 {
  margin: 0;
  font-family: Didot, Songti SC, serif;
  font-size: 32px;
  line-height: 1;
}

.board-kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-family: Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.public-board-wide .public-chart {
  height: 240px;
  min-height: 240px;
  background:
    linear-gradient(180deg, rgba(36, 126, 147, 0.025), transparent 60%),
    #fcfdf9;
}

.public-board-wide .contest-table-head,
.public-board-wide .contest-item {
  grid-template-columns: 52px 12px minmax(240px, 1fr) repeat(5, minmax(100px, 0.55fr));
  gap: 14px;
  padding-right: 18px;
  padding-left: 18px;
}

.public-board-wide .contest-table-head {
  min-height: 42px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f1f4ee;
  font-size: 11px;
  font-weight: 700;
}

.public-board-wide .contest-item {
  min-height: 58px;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.public-board-wide .contest-item:hover {
  background: #eef5f2;
}

.public-board-wide .contest-item.top-rank {
  background:
    linear-gradient(90deg, rgba(240, 196, 107, 0.2), rgba(255, 255, 255, 0.96) 34%);
}

.public-board-wide .contest-item.active {
  background: #eaf4f3;
  box-shadow: inset 4px 0 0 var(--cyan);
}

.public-board-wide .contest-title strong {
  font-size: 14px;
}

.public-ranking-list {
  max-height: 640px;
  scrollbar-color: #c8d1c7 transparent;
  scrollbar-width: thin;
}

.public-detail-wide .public-detail-grid {
  grid-template-columns: minmax(640px, 1.25fr) minmax(480px, 0.75fr);
  align-items: start;
}

.public-detail-wide .holding-table,
.public-detail-wide .contest-trades {
  max-height: 470px;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(640px, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.sidebar,
.main-panel,
.rank-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.sidebar,
.rank-panel {
  overflow: hidden;
}

.search-panel {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.search-panel input {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid #cfd7ce;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.search-panel input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(36, 126, 147, 0.12);
}

.stock-list,
.rank-list {
  display: grid;
  max-height: 686px;
  overflow: auto;
}

.stock-item,
.rank-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #edf0ea;
  text-align: left;
  background: transparent;
}

.stock-item:hover,
.rank-item:hover,
.stock-item.active {
  background: #f2f7f1;
}

.stock-title,
.rank-title {
  min-width: 0;
}

.stock-title strong,
.rank-title strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-title span,
.rank-title span,
.rank-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.stock-price,
.rank-price {
  min-width: 70px;
  text-align: right;
}

.stock-price strong,
.rank-price strong {
  display: block;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
}

.stock-price span,
.rank-price span {
  display: block;
  margin-top: 4px;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.up {
  color: var(--red);
}

.down {
  color: var(--green);
}

.flat {
  color: var(--muted);
}

.main-panel {
  min-width: 0;
  padding: 18px;
}

.stock-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
}

.stock-code {
  color: var(--cyan);
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

.stock-head h2 {
  margin-top: 3px;
  font-family: Didot, Songti SC, serif;
  font-size: 34px;
  line-height: 1.05;
}

.range-tabs,
.rank-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7f3;
}

.range-tab,
.rank-tab {
  min-width: 42px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.range-tab.active,
.rank-tab.active {
  color: #fff;
  background: var(--ink);
}

.quote-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}

.quote-strip div {
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.quote-strip strong {
  display: block;
  margin-top: 8px;
  font-family: Menlo, Consolas, monospace;
  font-size: 18px;
}

.chart-stack {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chart-frame {
  position: relative;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fcfdf9;
}

.price-frame {
  min-height: 430px;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.rank-panel {
  min-height: 760px;
}

.rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.rank-header h3 {
  font-size: 16px;
}

.rank-header span {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.rank-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 12px;
}

.financial-panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(23, 26, 24, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(23, 26, 24, 0.055), transparent 150px),
    rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.financial-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.financial-head h2 {
  font-family: Didot, Songti SC, serif;
  font-size: 32px;
  line-height: 1.05;
}

.financial-meta {
  display: grid;
  gap: 5px;
  text-align: right;
}

.financial-meta strong {
  font-size: 14px;
}

.financial-meta span {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.financial-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}

.financial-source-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid #d9dfd4;
  border-radius: 8px;
  background: #fbfcf8;
}

.financial-source-pill strong {
  font-size: 12px;
}

.financial-source-pill em {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  font-style: normal;
}

.financial-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.financial-kpi {
  min-height: 96px;
  padding: 13px 14px;
  border: 1px solid #dfe4da;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff, #f8faf4);
}

.financial-kpi span,
.financial-kpi em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.financial-kpi strong {
  display: block;
  margin-top: 10px;
  font-family: Menlo, Consolas, monospace;
  font-size: 22px;
  line-height: 1.05;
}

.financial-kpi em {
  margin-top: 8px;
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
}

.financial-grid {
  display: grid;
  grid-template-columns: minmax(460px, 0.9fr) minmax(640px, 1.1fr);
  gap: 12px;
  align-items: stretch;
}

.financial-trend,
.financial-table-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcf8;
}

.financial-block-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #f1f5ee;
}

.financial-block-head h3 {
  font-size: 16px;
}

.financial-block-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
}

.financial-trend-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 420px;
}

.financial-trend-tab {
  height: 28px;
  padding: 0 9px;
  border: 1px solid #cfd7ce;
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
}

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

.financial-chart {
  min-height: 332px;
  border: 0;
  border-radius: 0;
}

.financial-table {
  max-height: 395px;
  overflow: auto;
}

.financial-row {
  display: grid;
  grid-template-columns: 128px repeat(11, minmax(92px, 1fr));
  align-items: center;
  gap: 8px;
  min-width: 1180px;
  min-height: 44px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf0ea;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.financial-header-row {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 36px;
  color: var(--muted);
  background: #f6f8f2;
  font-size: 11px;
}

.financial-period {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-family: Avenir Next, PingFang SC, sans-serif;
}

.financial-period strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financial-period em {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  font-style: normal;
}

.backtest-panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

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

.backtest-head h2 {
  font-family: Didot, Songti SC, serif;
  font-size: 32px;
  line-height: 1.05;
}

.backtest-actions {
  display: flex;
  gap: 10px;
}

.primary-button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 28px rgba(23, 26, 24, 0.16);
}

.secondary-button {
  height: 40px;
  padding: 0 14px;
  border: 1px solid #cfd7ce;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.backtest-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.backtest-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.backtest-controls span,
.bt-metrics span,
.positions-head span {
  color: var(--muted);
  font-size: 12px;
}

.backtest-controls input,
.backtest-controls select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #cfd7ce;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.backtest-controls input:focus,
.backtest-controls select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(36, 126, 147, 0.12);
}

.factor-filter {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.factor-filter-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.factor-filter-head h3 {
  font-size: 16px;
}

.factor-filter-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.factor-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.factor-group {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 8px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid #edf0ea;
  border-radius: 8px;
  background: #fff;
}

.factor-group input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--cyan);
}

.factor-group strong,
.factor-group em {
  display: block;
}

.factor-group strong {
  font-size: 13px;
}

.factor-group em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.factor-group.disabled {
  color: var(--muted);
  background: #f4f5f0;
}

.backtest-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 360px;
  gap: 12px;
  align-items: stretch;
}

.backtest-main {
  min-width: 0;
}

.bt-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.bt-metrics article {
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.bt-metrics strong {
  display: block;
  margin-top: 8px;
  font-family: Menlo, Consolas, monospace;
  font-size: 17px;
}

.backtest-chart {
  min-height: 330px;
}

.positions-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcf8;
}

.positions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.positions-head h3 {
  font-size: 16px;
}

.positions-list {
  display: grid;
  max-height: 420px;
  overflow: auto;
}

.position-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid #edf0ea;
}

.position-item strong,
.position-item em {
  display: block;
  font-style: normal;
}

.position-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.position-item em {
  text-align: right;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
}

.compare-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.compare-head h3 {
  font-size: 17px;
}

.compare-head span {
  color: var(--muted);
  font-size: 12px;
}

.compare-head strong {
  color: var(--ink);
}

.compare-chart {
  min-height: 390px;
}

.compare-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.compare-table-head,
.compare-item {
  display: grid;
  grid-template-columns: 30px 12px minmax(170px, 1fr) repeat(4, minmax(76px, auto));
  align-items: center;
  gap: 10px;
}

.compare-table-head {
  margin-top: 12px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
}

.compare-item {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #edf0ea;
  border-radius: 8px;
  background: #fbfcf8;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.compare-item:hover,
.compare-item.active {
  border-color: rgba(36, 126, 147, 0.42);
  background: #f4faf8;
}

.compare-item.active {
  transform: translateX(2px);
}

.compare-rank {
  color: var(--muted);
}

.compare-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.compare-title {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-family: Avenir Next, PingFang SC, sans-serif;
}

.compare-title strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-title span {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
}

.holdings-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.holdings-head h3 {
  font-size: 17px;
}

.holdings-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.holdings-head strong {
  color: var(--ink);
}

.holdings-head select {
  min-width: min(320px, 100%);
  height: 40px;
  padding: 0 10px;
  border: 1px solid #cfd7ce;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.holdings-head select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(36, 126, 147, 0.12);
}

.holdings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.holding-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcf8;
}

.holding-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.holding-block-head h4 {
  font-size: 14px;
}

.holding-block-head span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.holding-table {
  max-height: 420px;
  overflow: auto;
}

.holding-row {
  display: grid;
  grid-template-columns: 34px minmax(116px, 1fr) 58px 58px 68px 62px 62px 78px 68px;
  align-items: center;
  gap: 8px;
  min-width: 720px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf0ea;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.holding-header {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f6f8f2;
  font-size: 11px;
}

.holding-stock {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-family: Avenir Next, PingFang SC, sans-serif;
}

.holding-stock strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holding-stock em {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  font-style: normal;
}

.holding-empty {
  padding: 24px 14px;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  padding: 12px 14px;
  border: 1px solid rgba(23, 26, 24, 0.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(23, 26, 24, 0.92);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1260px) {
  .blog-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-detail-wide .public-detail-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 280px 1fr;
  }

  .contest-layout {
    grid-template-columns: 1fr;
  }

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

  .public-podium {
    grid-template-columns: 1fr;
  }

  .public-podium-card.rank-2,
  .public-podium-card.rank-3 {
    margin-top: 0;
  }

  .rank-panel {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .rank-list {
    grid-template-columns: repeat(2, 1fr);
    max-height: 360px;
  }
}

@media (max-width: 860px) {
  .public-shell {
    width: min(100% - 16px, 760px);
    padding-top: 8px;
  }

  .league-toolbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .league-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .league-cache {
    flex: 1;
  }

  .ranking-head {
    align-items: flex-start;
  }

  .public-board-wide .public-chart {
    height: 220px;
    min-height: 220px;
  }

  .public-board-wide .contest-table-head,
  .public-board-wide .contest-item {
    grid-template-columns: 42px 10px minmax(150px, 1fr) 82px;
    gap: 8px;
    min-width: 0;
    padding-right: 12px;
    padding-left: 12px;
  }

  .public-board-wide .contest-table-head > span:nth-child(n + 5),
  .public-board-wide .contest-item > span:nth-child(n + 5) {
    display: none;
  }

  .blog-nav {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 20px, 760px);
    padding: 12px 0;
  }

  .blog-nav nav {
    justify-content: flex-start;
  }

  .blog-shell {
    width: min(100% - 20px, 760px);
    padding-top: 16px;
  }

  .blog-hero,
  .blog-post-grid,
  .blog-about,
  .blog-contact {
    grid-template-columns: 1fr;
  }

  .blog-hero-copy {
    min-height: 420px;
    padding: 26px;
  }

  .blog-post.featured {
    grid-column: auto;
  }

  .blog-note-list article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .blog-footer {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 20px, 760px);
  }

  .shell {
    width: min(100% - 20px, 760px);
    padding-top: 14px;
  }

  .topbar,
  .stock-head {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 30px;
  }

  .metrics,
    .workspace,
    .contest-controls,
    .contest-scoreboard,
    .contest-layout,
    .public-scoreboard,
    .public-grid,
    .public-podium,
    .quote-strip,
    .chart-row,
    .backtest-controls,
  .backtest-grid,
  .financial-grid,
  .bt-metrics {
    grid-template-columns: 1fr;
  }

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

  .contest-head,
  .contest-block-head,
  .contest-subhead,
  .public-hero,
  .public-block-head {
    align-items: stretch;
    flex-direction: column;
  }

  .contest-table-head,
  .contest-item {
    grid-template-columns: 24px 10px minmax(0, 1fr) repeat(2, minmax(62px, auto));
  }

  .contest-table-head > span:nth-last-child(-n + 3),
  .contest-item > span:nth-last-child(-n + 3) {
    display: none;
  }

  .backtest-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

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

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

  .financial-head,
  .financial-block-head {
    align-items: stretch;
    flex-direction: column;
  }

  .financial-meta {
    text-align: left;
  }

  .financial-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .financial-trend-tabs {
    justify-content: flex-start;
    max-width: none;
  }

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

  .compare-item {
    grid-template-columns: 24px 10px minmax(0, 1fr) repeat(2, minmax(64px, auto));
  }

  .compare-table-head {
    grid-template-columns: 24px 10px minmax(0, 1fr) repeat(2, minmax(64px, auto));
  }

  .compare-item > span:nth-last-child(-n + 2) {
    display: none;
  }

  .compare-table-head > span:nth-last-child(-n + 2) {
    display: none;
  }

  .stock-list,
  .rank-list {
    max-height: 320px;
  }

  .price-frame {
    min-height: 360px;
  }

  .chart-frame {
    min-height: 210px;
  }

  .range-tabs {
    width: 100%;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-flow: row;
  }
}

/* Public contest workspace */
.contest-public-page {
  height: 100dvh;
  min-height: 680px;
  overflow: hidden;
}

.contest-public-page .public-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: min(1840px, calc(100% - 24px));
  height: 100dvh;
  margin: 0 auto;
  padding: 12px 0;
}

.contest-public-page .league-toolbar {
  position: static;
  min-height: 58px;
  margin: 0;
  padding: 8px 12px;
}

.league-workspace {
  display: grid;
  grid-template-columns: minmax(315px, 0.26fr) minmax(780px, 0.74fr);
  gap: 12px;
  min-height: 0;
}

.league-ranking-panel,
.analysis-chart-panel,
.analysis-detail-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 26, 24, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 46px rgba(23, 26, 24, 0.08);
}

.league-ranking-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.workspace-panel-head,
.analysis-panel-head,
.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workspace-panel-head {
  min-height: 82px;
  padding: 16px 18px;
  color: #f7f8f3;
  background:
    linear-gradient(112deg, rgba(36, 126, 147, 0.42), transparent 58%),
    #171a18;
}

.workspace-panel-head .board-kicker {
  color: #f0c46b;
}

.workspace-panel-head h1 {
  font-family: Didot, Songti SC, serif;
  font-size: 30px;
  line-height: 1;
}

.workspace-panel-head > span,
.analysis-panel-head > span {
  color: rgba(247, 248, 243, 0.7);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  text-align: right;
}

.league-ranking-panel .contest-table-head,
.league-ranking-panel .contest-item {
  grid-template-columns: 42px 8px minmax(120px, 1fr) 72px;
  gap: 8px;
  min-width: 0;
  padding-right: 12px;
  padding-left: 12px;
}

.league-ranking-panel .contest-table-head > span:nth-child(5),
.league-ranking-panel .contest-table-head > span:nth-child(6),
.league-ranking-panel .contest-item > span:nth-child(5),
.league-ranking-panel .contest-item > span:nth-child(6) {
  display: none;
}

.league-ranking-panel .contest-table-head {
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  background: #eff3ed;
  font-weight: 700;
}

.league-ranking-panel .public-ranking-list {
  display: grid;
  grid-template-rows: repeat(10, minmax(0, 1fr));
  max-height: none;
  min-height: 0;
  overflow: hidden;
}

.league-ranking-panel .contest-item {
  min-height: 0;
  height: 100%;
  padding-top: 5px;
  padding-bottom: 5px;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.league-ranking-panel .contest-item:hover {
  background: #eef5f2;
}

.league-ranking-panel .contest-item.top-rank {
  background: linear-gradient(90deg, rgba(240, 196, 107, 0.22), rgba(255, 255, 255, 0.98) 52%);
}

.league-ranking-panel .contest-item.active {
  background: #e7f2f1;
  box-shadow: inset 4px 0 0 var(--cyan);
}

.league-ranking-panel .contest-title strong {
  font-size: 12px;
}

.ranking-pagination {
  display: grid;
  grid-template-columns: 36px auto 36px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  border-top: 1px solid var(--line);
  background: #f8faf6;
}

.ranking-pagination button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #cfd7ce;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.ranking-pagination button:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
}

.ranking-pagination button:disabled {
  cursor: default;
  opacity: 0.35;
}

.ranking-pagination span {
  min-width: 56px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  text-align: center;
}

.league-analysis-panel {
  display: grid;
  grid-template-columns: minmax(600px, 2.5fr) minmax(280px, 0.85fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.analysis-chart-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.analysis-panel-head {
  min-height: 70px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #f0f5f2, #fffaf0);
}

.analysis-panel-head h2,
.detail-player h2 {
  font-family: Didot, Songti SC, serif;
  font-size: 22px;
  line-height: 1.1;
}

.analysis-panel-head > span {
  color: var(--muted);
}

.analysis-chart-panel .public-chart {
  height: auto;
  min-height: 0;
  border: 0;
  background:
    linear-gradient(180deg, rgba(36, 126, 147, 0.035), transparent 64%),
    #fcfdf9;
}

.analysis-chart-panel .public-chart canvas {
  width: 100%;
  height: 100%;
}

.analysis-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.analysis-detail-panel .detail-toolbar {
  align-items: stretch;
  flex-direction: column;
  min-height: 158px;
}

.analysis-detail-panel .detail-controls {
  width: 100%;
  justify-content: space-between;
}

.analysis-detail-panel .detail-controls select {
  width: min(178px, 58%);
}

.detail-toolbar {
  min-height: 76px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f9f4;
}

.detail-player {
  min-width: 0;
}

.detail-player .board-kicker {
  margin-bottom: 3px;
}

.detail-player h2 {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-player > span {
  display: block;
  overflow: hidden;
  max-width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-explain {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 8px;
  color: #3f4842;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.detail-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.detail-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf1eb;
}

.detail-tabs button {
  min-width: 54px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.detail-tabs button.active {
  color: #fff;
  background: var(--ink);
}

.detail-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.detail-view[hidden] {
  display: none;
}

.detail-view .contest-subhead {
  min-width: 0;
  min-height: 36px;
  padding: 7px 12px;
}

.detail-view .contest-subhead h4 {
  font-size: 13px;
}

.detail-view .contest-subhead span {
  overflow: hidden;
  max-width: 70%;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-detail-panel .holding-table,
.analysis-detail-panel .contest-trades {
  width: 100%;
  min-width: 0;
  max-height: none;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.analysis-detail-panel .holding-row,
.analysis-detail-panel .contest-trade-row {
  padding-top: 7px;
  padding-bottom: 7px;
}

.analysis-detail-panel .holding-row {
  grid-template-columns: 24px minmax(86px, 1fr) 52px 58px;
  gap: 6px;
  min-width: 0;
  padding-right: 9px;
  padding-left: 9px;
  font-size: 11px;
}

.analysis-detail-panel .holding-header {
  position: static;
}

.analysis-detail-panel .holding-stock {
  display: grid;
  gap: 2px;
}

.analysis-detail-panel .holding-stock strong {
  font-size: 12px;
}

.analysis-detail-panel .holding-stock em {
  font-size: 9px;
}

.analysis-detail-panel .holding-row > span:last-child em,
.analysis-detail-panel .contest-trade-row > span:last-child em {
  display: block;
  margin-top: 2px;
  font-style: normal;
}

.holding-day-group,
.trade-day-group {
  border-bottom: 1px solid #edf0ea;
}

.holding-day-head,
.trade-day-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  background: #f6f8f2;
}

.holding-day-head strong,
.trade-day-head strong {
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.holding-day-head span,
.trade-day-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holding-day-head {
  align-items: stretch;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 10px 12px;
}

.holding-day-head > strong {
  font-size: 12px;
  line-height: 1.2;
}

.holding-day-head > .holding-day-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  width: 100%;
  overflow: visible;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: clip;
}

.holding-day-metrics > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  overflow: visible;
  min-width: 0;
  font-size: 11px;
  text-overflow: clip;
  white-space: nowrap;
}

.holding-day-metrics b {
  color: var(--ink);
  font-weight: 700;
}

.holding-day-metrics b.up {
  color: var(--red);
}

.holding-day-metrics b.down {
  color: var(--green);
}

.analysis-detail-panel .contest-trade-row {
  grid-template-columns: 52px minmax(88px, 1fr) 62px;
  gap: 7px;
  min-width: 0;
  padding-right: 9px;
  padding-left: 9px;
  font-size: 11px;
}

@media (max-width: 1120px) {
  .contest-public-page {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .contest-public-page .public-shell {
    display: grid;
    width: min(100% - 20px, 980px);
    height: auto;
    min-height: 100dvh;
    padding: 10px 0 24px;
  }

  .league-workspace {
    grid-template-columns: 1fr;
  }

  .league-ranking-panel {
    min-height: 680px;
  }

  .league-analysis-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 420px minmax(300px, auto);
  }
}

@media (max-width: 680px) {
  .contest-public-page .league-toolbar {
    align-items: center;
    flex-direction: row;
  }

  .league-brand span,
  .league-cache {
    display: none;
  }

  .league-actions {
    width: auto;
    margin-left: auto;
  }

  .rss-popover {
    right: -48px;
  }

  .league-ranking-panel {
    min-height: 630px;
  }

  .workspace-panel-head {
    min-height: 72px;
  }

  .workspace-panel-head h1 {
    font-size: 26px;
  }

  .league-ranking-panel .contest-table-head,
  .league-ranking-panel .contest-item {
    grid-template-columns: 40px 9px minmax(128px, 1fr) 76px;
    gap: 7px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .league-ranking-panel .contest-table-head > span:nth-child(5),
  .league-ranking-panel .contest-table-head > span:nth-child(6),
  .league-ranking-panel .contest-item > span:nth-child(5),
  .league-ranking-panel .contest-item > span:nth-child(6) {
    display: none;
  }

  .league-analysis-panel {
    grid-template-rows: 360px auto;
  }

  .analysis-panel-head {
    min-height: 64px;
  }

  .analysis-panel-head h2 {
    max-width: 230px;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .analysis-panel-head > span {
    display: none;
  }

  .detail-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-controls {
    justify-content: space-between;
  }

  .detail-controls select {
    width: min(220px, 58vw);
  }

  .detail-view {
    min-height: 280px;
  }
}
