:root {
  color-scheme: light;
  --bg: #fff8eb;
  --panel: #fffdf8;
  --panel-soft: #fff8ec;
  --text: #17221d;
  --muted: #6c7568;
  --line: #e7d8bd;
  --red: #b4261f;
  --red-soft: #fff0e8;
  --amber: #b7791f;
  --amber-soft: #fff5dc;
  --gold: #d6a642;
  --blue: #1f5f99;
  --green: #0c7a59;
  --green-soft: #eaf8ef;
  --earth: #8a6a3f;
  --shadow: 0 16px 42px rgba(102, 69, 22, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(255, 243, 200, 0.84) 0, rgba(255, 248, 235, 0.18) 230px, transparent 520px),
    linear-gradient(135deg, rgba(214, 166, 66, 0.1) 0 1px, transparent 1px 36px),
    linear-gradient(45deg, rgba(12, 122, 89, 0.055) 0 1px, transparent 1px 40px);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--blue);
  text-decoration: none;
}

.limit-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(14px, 3vw, 34px);
  background: rgba(255, 250, 240, 0.94);
  border-bottom: 1px solid rgba(181, 126, 35, 0.26);
  box-shadow: 0 10px 26px rgba(102, 69, 22, 0.08);
  backdrop-filter: blur(14px);
}

.limit-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #b4261f, #d6a642, #0c7a59, #22577a, #8a6a3f);
  content: "";
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7dc 0%, #fff0e8 100%);
  color: var(--text);
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.header-copy {
  min-width: 0;
}

.kicker {
  display: inline-block;
  color: var(--earth);
  font-size: 12px;
  font-weight: 900;
}

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

h1 {
  margin-top: 2px;
  font-size: 26px;
  line-height: 1.15;
}

.header-copy p,
.subtle {
  color: var(--muted);
  font-size: 13px;
}

.refresh,
.tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.refresh:hover,
.tab:hover {
  border-color: rgba(214, 166, 66, 0.72);
  background: var(--amber-soft);
}

.refresh {
  padding: 0 14px;
}

.limit-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 18px auto 48px;
}

.hero-panel,
.section-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
  border-color: rgba(214, 166, 66, 0.55);
  background:
    linear-gradient(180deg, rgba(255, 246, 220, 0.72), rgba(255, 253, 248, 0.96) 38%),
    var(--panel);
}

.hero-panel h2 {
  color: #7b1e18;
  margin-top: 10px;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.05;
}

.hero-panel p {
  margin-top: 10px;
  max-width: 720px;
  color: var(--muted);
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(180, 38, 31, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.state-pill.good {
  background: var(--green-soft);
  color: var(--green);
}

.state-pill.neutral {
  background: #edf2f7;
  color: #526173;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, var(--panel-soft));
}

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

.metric-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.tab {
  padding: 0 8px;
}

.tab.active {
  border-color: rgba(214, 166, 66, 0.72);
  background: var(--amber-soft);
  color: #7a4d08;
}

.section-block {
  padding: clamp(14px, 2.4vw, 22px);
}

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

.section-head h2 {
  margin-top: 3px;
  font-size: 22px;
}

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

.limit-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff9ef);
  padding: 14px;
}

.limit-card.strong {
  border-color: rgba(214, 166, 66, 0.66);
  background: linear-gradient(180deg, #fff3c8 0%, #fffdf8 34%);
}

.card-top,
.stock-row,
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

.badge.red {
  background: #fff3c8;
  color: #7a4d08;
}

.limit-card h3 {
  margin-top: 10px;
  font-size: 19px;
}

.code {
  color: var(--muted);
  font-size: 12px;
}

.price-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.price-box {
  min-width: 0;
  padding: 9px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, var(--panel-soft));
}

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

.price-box strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.tag-row,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-row span,
.meta-row span {
  min-width: 0;
  border-radius: 999px;
  background: #eef7f1;
  color: #52665a;
  padding: 3px 8px;
  font-size: 12px;
}

.note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.risk-note {
  color: var(--red);
  background: var(--red-soft);
  border-radius: 8px;
  padding: 8px 10px;
}

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

.rule-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 13px;
}

.rule-grid p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: linear-gradient(180deg, #fffdf8, var(--panel-soft));
}

@media (max-width: 960px) {
  .hero-panel,
  .limit-grid,
  .rule-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .limit-header {
    grid-template-columns: 1fr auto;
  }

  .brand {
    display: none;
  }

  h1 {
    font-size: 21px;
  }

  .hero-panel h2 {
    font-size: 30px;
  }

  .metric-grid,
  .price-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
