:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #182026;
  --muted: #68727d;
  --line: #d9dfdf;
  --teal: #007f7a;
  --indigo: #3f5f96;
  --amber: #c67a1c;
  --red: #b6453d;
  --green: #3d7a45;
  --shadow: 0 12px 30px rgba(20, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 244, 0.96);
  backdrop-filter: blur(12px);
}

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

h1 {
  font-size: 24px;
  line-height: 1.25;
}

#subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.meta {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 24px 48px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

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

button,
input {
  font: inherit;
}

.segmented button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
}

.segmented button.active {
  border-color: var(--teal);
  background: #e5f3f1;
  color: #005c58;
  font-weight: 700;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search input {
  width: 240px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  outline: none;
  background: #fff;
}

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

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 {
  font-size: 18px;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.tomorrow-panel,
.price-panel {
  margin-bottom: 18px;
}

.tomorrow-grid,
.price-grid {
  padding: 16px 18px;
}

.plan-read {
  border: 1px solid #e5e8e8;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  margin-bottom: 14px;
  color: #33404a;
  font-size: 13px;
  line-height: 1.62;
}

.plan-read p {
  margin-bottom: 6px;
}

.plan-read strong {
  display: block;
  margin: 8px 0 4px;
}

.plan-bucket {
  border-top: 1px solid #edf0f0;
  padding-top: 14px;
  margin-top: 14px;
}

.plan-bucket:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.plan-bucket-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 10px;
}

.plan-bucket-head h3,
.price-head h3 {
  font-size: 16px;
}

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

.plan-stock,
.price-card {
  border: 1px solid #e3e7e7;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}

.plan-stock-top,
.price-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.plan-grade,
.price-grade {
  min-width: 44px;
  text-align: center;
  border-radius: 999px;
  background: #e9f4ef;
  color: var(--teal);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.plan-role,
.price-theme {
  color: var(--indigo);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.plan-stock p,
.price-card p {
  color: #33404a;
  font-size: 13px;
  line-height: 1.58;
  margin-bottom: 7px;
}

.plan-line strong,
.price-line strong {
  color: var(--ink);
}

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

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.source-row a {
  border: 1px solid #dfe5e5;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  text-decoration: none;
  background: #fbfcfb;
}

.rank-list,
.compact-list,
.heat-grid,
.group-list,
.deleted,
.stock-grid {
  padding: 16px 18px;
}

.rank-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f0;
}

.rank-item:last-child,
.compact-item:last-child {
  border-bottom: 0;
}

.rank-no {
  color: var(--amber);
  font-weight: 800;
}

.rank-name {
  font-weight: 800;
}

.rank-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.rank-score {
  text-align: right;
  font-size: 20px;
  font-weight: 900;
  color: var(--teal);
}

.compact-item {
  padding: 11px 0;
  border-bottom: 1px solid #edf0f0;
}

.compact-item strong {
  display: block;
  margin-bottom: 4px;
}

.compact-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.heat-item {
  border: 1px solid #e5e8e8;
  border-radius: 8px;
  padding: 12px;
  min-height: 98px;
  background: #fbfcfb;
}

.heat-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.heat-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.sidebar {
  align-self: start;
  position: sticky;
  top: 92px;
}

.group-button {
  width: 100%;
  text-align: left;
  border: 1px solid #e3e7e7;
  background: #fbfcfb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}

.group-button.active {
  border-color: var(--teal);
  background: #eaf6f4;
}

.group-button strong {
  display: block;
  margin-bottom: 6px;
}

.group-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.deleted {
  border-top: 1px solid var(--line);
}

.deleted h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.deleted p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
}

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

.stock-card {
  border: 1px solid #dfe5e5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.stock-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid #edf0f0;
}

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

.stock-head h3 {
  font-size: 18px;
}

.track {
  margin-top: 6px;
  color: var(--indigo);
  font-size: 13px;
  font-weight: 700;
}

.score-badge {
  min-width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e9f4ef;
  color: var(--teal);
  display: grid;
  place-content: center;
  text-align: center;
  font-weight: 900;
  border: 1px solid #c8e4dc;
}

.score-bars {
  padding: 12px 14px 4px;
}

.bar-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 7px;
}

.bar-bg {
  height: 7px;
  background: #edf0f0;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--teal);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 12px;
}

.pill {
  border-radius: 999px;
  background: #f1f3f1;
  color: #43505a;
  font-size: 12px;
  padding: 5px 8px;
}

.pill.red {
  background: #f8e8e6;
  color: var(--red);
}

.pill.green {
  background: #eaf4e8;
  color: var(--green);
}

details {
  border-top: 1px solid #edf0f0;
  padding: 0 14px;
}

summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 800;
}

.detail-body {
  padding-bottom: 12px;
  color: #33404a;
  font-size: 13px;
  line-height: 1.62;
}

.detail-body p {
  margin: 0 0 8px;
}

.detail-body strong {
  color: var(--ink);
}

a {
  color: var(--indigo);
}

@media (max-width: 1100px) {
  .summary-grid,
  .layout,
  .stock-grid,
  .heat-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .meta {
    align-items: flex-start;
    text-align: left;
  }

  main {
    padding: 16px 12px 32px;
  }

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

  .search input {
    width: 100%;
  }

  .rank-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

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