:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --text: #1e2a2f;
  --muted: #607077;
  --line: #dbe4e6;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --danger: #b42318;
  --good: #087443;
  --shadow: 0 12px 30px rgba(22, 40, 44, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfc;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.filters button,
#refreshButton {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.filters button.active {
  background: #dff3ef;
  color: #075e58;
  border-color: #9ad5ca;
  font-weight: 700;
}

.panel,
.table-panel,
.status-panel,
.detail-panel,
.history-panel,
.intraday-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.compact {
  padding: 14px;
}

.panel-title {
  font-weight: 800;
  margin-bottom: 12px;
}

.legal-sidebar {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-sidebar a {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin-top: 8px;
  padding: 0 11px;
  border: 1px solid #d8e4df;
  border-radius: 8px;
  color: #173136;
  background: #fbfcfc;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.legal-sidebar a:hover {
  border-color: #9ad5ca;
  background: #e7f5f2;
  color: #075e58;
}

.admin-entry-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.admin-entry-panel a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d8e4df;
  border-radius: 8px;
  color: #0b5f58;
  background: #fbfcfc;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.legal-footer {
  margin-top: 0;
}

.legal-footer .panel-title {
  margin-bottom: 10px;
}

.legal-footer a {
  display: inline-flex;
  min-height: 34px;
  margin: 0 8px 0 0;
  padding: 0 12px;
}

.member-switch-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.member-current {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.member-switch-actions {
  display: grid;
  gap: 8px;
}

.member-switch-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfc;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.member-switch-actions button.active {
  border-color: #f2c94c;
  background: #fff6cf;
  color: #c01818;
  font-weight: 900;
}

.legal-consent-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #f2c94c;
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: var(--shadow);
}

.legal-consent-panel.accepted {
  border-color: #9ad5ca;
  background: #f2fbf8;
}

.legal-consent-panel p {
  margin: 0 0 10px;
  color: #8a4b0f;
  font-size: 13px;
  line-height: 1.6;
}

.legal-consent-panel.accepted p {
  color: #087443;
  font-weight: 800;
}

.legal-consent-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #40565d;
  font-size: 13px;
  line-height: 1.55;
}

.legal-consent-check input {
  margin-top: 4px;
}

.legal-consent-check a {
  color: #075e58;
  font-weight: 800;
  text-decoration: none;
}

.legal-consent-check a:hover {
  text-decoration: underline;
}

.legal-consent-panel button {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.legal-consent-panel button:disabled {
  border-color: #9ad5ca;
  background: #dff3ef;
  color: #075e58;
  cursor: default;
}

.legal-consent-panel.needs-check {
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.32), var(--shadow);
}

.notification-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notification-panel.premium {
  border-color: #9ad5ca;
  background: #f2fbf8;
}

.notification-panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.notification-actions {
  display: grid;
  gap: 8px;
}

.notification-actions button {
  border: 1px solid #0f766e;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  min-height: 36px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
}

.notification-actions button + button {
  border-color: #d8e4df;
  background: #fbfcfc;
  color: #173136;
}

.notification-events {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notification-events div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.notification-events strong {
  color: #075e58;
}

.notification-events span {
  color: var(--muted);
}

.status-grid {
  display: grid;
  gap: 10px;
}

.status-card {
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
}

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

.status-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.utility-panels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.strategy-disclaimer {
  padding: 18px 20px;
  border: 1px solid #d8e4df;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f3f8f6);
  box-shadow: var(--shadow);
}

.disclaimer-kicker {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #dff3ef;
  color: #075e58;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.member-notice {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  border: 2px solid #f2c94c;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff6cf;
  color: #c01818;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.45;
}

.strategy-disclaimer h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.45;
  color: #173136;
}

.strategy-disclaimer p {
  margin: 7px 0 0;
  color: #40565d;
  font-size: 13px;
  line-height: 1.75;
}

.hero {
  min-height: 170px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #113f3a, #235f5c 58%, #8aa13f);
  color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.global-market-head {
  align-items: flex-start;
}

.global-market-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.global-market-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.global-market-card {
  display: grid;
  gap: 7px;
  min-height: 126px;
  padding: 13px;
  border: 1px solid #d8e4df;
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.global-market-card:hover,
.global-market-card.active {
  border-color: #9ad5ca;
  background: #e7f5f2;
}

.global-market-card.active {
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.16);
}

.global-market-card span,
.global-market-card small {
  color: var(--muted);
  font-size: 12px;
}

.market-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.market-flag {
  width: 20px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 49, 54, 0.14);
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(22, 40, 44, 0.08);
}

.global-market-card strong {
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.global-market-card b {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

.global-market-card em {
  color: var(--danger);
  font-style: normal;
}

.global-market-summary {
  display: grid;
  grid-template-columns: 1.4fr minmax(0, 1fr);
  gap: 10px;
  padding: 0 14px 14px;
}

.global-market-summary div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #d8e4df;
  border-radius: 8px;
  background: #fbfcfc;
}

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

.global-market-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.global-market-table {
  width: 470px;
  min-width: 470px;
  table-layout: fixed;
}

.global-market-table th,
.global-market-table td {
  padding: 7px 8px;
  font-size: 12px;
  text-align: center;
}

.global-market-table th:nth-child(1),
.global-market-table td:nth-child(1) {
  width: 48px;
}

.global-market-table th:nth-child(2),
.global-market-table td:nth-child(2) {
  width: 120px;
  text-align: center;
}

.global-market-table th:nth-child(3),
.global-market-table td:nth-child(3),
.global-market-table th:nth-child(4),
.global-market-table td:nth-child(4) {
  width: 76px;
}

.global-market-table th:nth-child(5),
.global-market-table td:nth-child(5) {
  width: 120px;
}

.global-rank-primary-row td {
  border-bottom: 0;
}

.global-rank-action-row td {
  padding: 0 8px 10px;
  background: #fbfdfc;
}

.global-rank-action-row td,
.global-rank-return-row td,
.global-rank-record-row td {
  text-align: center;
}

.global-rank-return-row td {
  padding: 0 8px 6px;
  background: #fbfdfc;
  border-bottom: 0;
}

.global-rank-record-row td {
  padding: 0 8px 12px;
  background: #fbfdfc;
}

.rank-rotation-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 190px;
  margin-right: calc(10px + 1cm);
  padding: 5px 9px;
  border: 1px solid #e1ece9;
  border-radius: 6px;
  background: #ffffff;
  vertical-align: middle;
}

.rank-rotation-return span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.rank-rotation-return strong {
  font-size: 12px;
}

.global-rank-action-row .rank-rotation-return {
  transform: translateX(1cm);
}

.global-rank-action-row .rank-record-button {
  transform: translateX(2cm);
}

.global-rank-return-row .rank-rotation-return,
.global-rank-record-row .rank-record-button {
  margin-right: 0;
  transform: none;
}

.global-etf-code,
.global-etf-name {
  display: block;
}

.global-etf-code {
  font-weight: 700;
}

.global-etf-name {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-record-button {
  padding: 5px 8px;
  border: 1px solid #b6d8d1;
  border-radius: 6px;
  background: #eef8f6;
  color: #0b5f58;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.rank-record-button:hover {
  border-color: #6bb7ab;
  background: #dff2ee;
}

.global-rank-records {
  padding: 0 14px 14px;
}

.global-rank-record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
}

.global-rank-record-head strong {
  font-size: 15px;
}

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

.global-rank-record-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.global-rank-record-table {
  min-width: 560px;
}

.global-rank-record-table th,
.global-rank-record-table td {
  text-align: center;
}

.global-rank-record-table th:nth-child(1),
.global-rank-record-table td:nth-child(1) {
  width: 210px;
}

.global-rank-record-table th:nth-child(4),
.global-rank-record-table td:nth-child(4) {
  text-align: left;
  padding-left: 12px;
}

.record-date-range,
.record-date-separator {
  display: inline-block;
  white-space: nowrap;
}

.record-date-separator {
  margin: 0 5px;
  color: var(--muted);
  font-size: 11px;
}

.page-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.global-record-hero {
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 13px;
  opacity: 0.82;
  margin-bottom: 8px;
}

.hero h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.15;
}

.top-meta {
  margin-top: 10px;
  opacity: 0.84;
}

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

.metric-strip div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.metric-strip span {
  display: block;
  font-size: 12px;
  opacity: 0.75;
}

.metric-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

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

.rank-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.rank-card.featured {
  background: rgba(255, 255, 255, 0.14);
}

.rank-card span {
  display: block;
  font-size: 12px;
  opacity: 0.75;
}

.rank-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rank-card p {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
}

.rank-metrics {
  display: grid;
  gap: 8px;
}

.rank-metrics div {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.rank-metrics b {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.rank-action {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  padding: 10px 12px;
  cursor: pointer;
  text-align: center;
}

.rank-action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-wrap {
  flex: 1;
}

.search-wrap input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--surface);
}

#refreshButton {
  text-align: center;
  min-width: 112px;
  background: #0f766e;
  color: white;
  border-color: #0f766e;
}

#intradayButton {
  border: 1px solid #7dbdb6;
  border-radius: 8px;
  background: #e7f5f2;
  color: #075e58;
  min-width: 112px;
  padding: 10px 12px;
  cursor: pointer;
}

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

.intraday-card {
  min-height: 118px;
  border: 1px solid var(--line);
  background: #fbfcfc;
  border-radius: 8px;
  padding: 14px;
}

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

.intraday-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

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

#rebuildHistoryButton {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.table-panel,
.status-panel,
.detail-panel,
.history-panel,
.intraday-panel {
  overflow: hidden;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.detail-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.detail-head span:not(.pill) {
  color: var(--muted);
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  padding: 16px;
}

.chart-card {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
}

#historyChart {
  width: 100%;
  height: 280px;
  display: block;
}

#equityChart {
  width: 100%;
  height: 280px;
  display: block;
}

#equityChart2,
#equityChart3 {
  width: 100%;
  height: 280px;
  display: block;
}

.chart-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 2px 0 8px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
  padding: 16px;
}

.segments-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segments-table {
  min-width: 520px;
}

.segments-table th,
.segments-table td {
  padding: 10px 12px;
}

.detail-metrics {
  display: grid;
  gap: 10px;
}

.detail-metrics div {
  min-height: 62px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
}

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

.detail-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.table-head h3 {
  margin: 0;
  font-size: 16px;
}

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

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  background: #f8faf9;
  font-weight: 700;
}

td {
  font-size: 13px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover td {
  background: #f5faf9;
}

tbody tr.selected td {
  background: #e7f5f2;
}

.premium-only-text,
.premium-only-cell {
  color: #c01818;
  font-weight: 800;
}

.premium-only-text {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid #f2c94c;
  border-radius: 6px;
  padding: 2px 8px;
  background: #fff8db;
}

.premium-only-cell {
  background: #fff8db;
  box-shadow: inset 0 0 0 1px #f2c94c;
  text-align: center;
}

.member-locked-row:hover .premium-only-cell,
.rank-record-table tbody tr:hover .premium-only-cell {
  background: #fff1b8;
}

th:nth-child(2),
th:nth-child(3),
th:nth-child(4),
td:nth-child(2),
td:nth-child(3),
td:nth-child(4) {
  text-align: left;
}

.rank {
  font-weight: 800;
}

.positive {
  color: var(--danger);
  font-weight: 700;
}

.negative {
  color: var(--good);
  font-weight: 700;
}

.risk-alert {
  color: var(--danger);
  font-weight: 700;
}

.risk-ok {
  color: var(--good);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf1f2;
  color: #385159;
  font-size: 12px;
}

.status-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px;
}

.source-item {
  border: 1px solid var(--line);
  background: #fbfcfc;
  border-radius: 8px;
  padding: 12px;
}

.source-item strong {
  display: block;
  margin-bottom: 6px;
}

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

.disclaimer {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 16px;
}

.rank-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.rank-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
  gap: 14px;
  align-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(17, 63, 58, 0.96), rgba(35, 95, 92, 0.94) 58%, rgba(138, 161, 63, 0.92)),
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.16), transparent 32%);
  color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.rank-page-hero h1 {
  margin: 10px 0 6px;
  font-size: 30px;
  line-height: 1.2;
}

.rank-page-hero p {
  margin: 0;
  opacity: 0.86;
}

.rank-page-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.rank-page-metrics div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.rank-page-metrics span {
  display: block;
  font-size: 12px;
  opacity: 0.75;
}

.rank-page-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  padding: 8px 12px;
  cursor: pointer;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.rank-detail-chart {
  padding: 12px 14px 16px;
}

#rankEquityChart {
  width: 100%;
  height: 340px;
  display: block;
}

.server-chart {
  width: 100%;
  height: 340px;
  display: block;
}

.server-chart .grid line {
  stroke: var(--line);
  stroke-width: 1;
}

.server-chart text {
  fill: var(--muted);
  font-size: 12px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.empty-chart {
  height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.rank-record-table {
  min-width: 680px;
}

.rank-record-table th,
.rank-record-table td {
  padding: 7px 10px;
  text-align: left;
  line-height: 1.35;
}

.rank-record-table th:nth-child(1),
.rank-record-table th:nth-child(2),
.rank-record-table td:nth-child(1),
.rank-record-table td:nth-child(2) {
  text-align: left;
}

.rank-record-table th:nth-child(3),
.rank-record-table th:nth-child(4),
.rank-record-table td:nth-child(3),
.rank-record-table td:nth-child(4) {
  text-align: right;
}

.rank-record-table td {
  font-size: 12px;
}

.rank-record-table tbody tr {
  cursor: default;
}

.rank-record-table tbody tr:hover td {
  background: #fbfcfc;
}

.legal-page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.legal-hero {
  position: relative;
  padding: 24px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, #113f3a, #235f5c 62%, #8aa13f);
  box-shadow: var(--shadow);
}

.legal-hero .disclaimer-kicker {
  background: rgba(255, 255, 255, 0.16);
  color: white;
  margin-top: 36px;
}

.legal-hero h1 {
  margin: 8px 0 8px;
  font-size: 32px;
  line-height: 1.2;
}

.legal-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

.legal-back {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  padding: 8px 12px;
  cursor: pointer;
}

.legal-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.legal-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.legal-tab.active,
.legal-tab:hover {
  border-color: #9ad5ca;
  background: #dff3ef;
  color: #075e58;
}

.legal-document {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-document h1 {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1.25;
}

.legal-document h2 {
  margin: 26px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 19px;
  line-height: 1.35;
}

.legal-document p,
.legal-document li {
  color: #40565d;
  font-size: 14px;
  line-height: 1.9;
}

.legal-document p {
  margin: 0 0 12px;
}

.legal-document ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.legal-document li + li {
  margin-top: 6px;
}

.admin-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-hero h1 {
  margin: 6px 0;
  font-size: 28px;
}

.admin-hero p {
  margin: 0;
  color: var(--muted);
}

.admin-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.admin-register-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto minmax(160px, auto);
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.admin-register-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-register-form input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.admin-register-form button {
  height: 40px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.admin-register-form strong {
  color: var(--muted);
  font-size: 13px;
}

.admin-table {
  min-width: 980px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  white-space: nowrap;
}

.admin-user-agent {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filters {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .global-market-cards,
  .global-market-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .top-runners {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .rank-page {
    padding: 14px;
  }

  .rank-page-hero,
  .rank-page-metrics {
    grid-template-columns: 1fr;
  }

  .legal-page {
    width: min(100% - 24px, 1040px);
    padding-top: 12px;
  }

  .legal-hero,
  .legal-document {
    padding: 18px;
  }

  .legal-back {
    position: static;
    margin-bottom: 12px;
  }

  .legal-hero .disclaimer-kicker {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  body {
    background: #f7faf9;
  }

  .sidebar {
    padding: 16px 18px;
    background: var(--surface);
  }

  .brand {
    margin-bottom: 0;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 8px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .brand p {
    font-size: 12px;
  }

  .content {
    padding: 12px;
    gap: 12px;
  }

  .strategy-disclaimer {
    padding: 14px;
    border-left-width: 4px;
  }

  .member-notice {
    width: 100%;
    padding: 9px 11px;
    font-size: 16px;
  }

  .strategy-disclaimer h2 {
    font-size: 15px;
  }

  .strategy-disclaimer p {
    font-size: 12px;
  }

  .legal-sidebar,
  .member-switch-panel,
  .legal-consent-panel,
  .notification-panel {
    margin-top: 12px;
    box-shadow: none;
  }

  .hero {
    padding: 0;
    gap: 10px;
    background: transparent;
    box-shadow: none;
    color: var(--text);
  }

  .global-market-panel {
    box-shadow: none;
  }

  .global-market-cards,
  .global-market-summary {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .utility-panels {
    grid-template-columns: 1fr;
  }

  .global-market-summary {
    padding-top: 0;
  }

  .global-table-wrap {
    overflow-x: auto;
  }

  .global-market-table {
    min-width: 470px;
  }

  .global-market-table thead {
    display: table-header-group;
  }

  .global-market-table tbody {
    display: table-row-group;
    padding: 0;
  }

  .global-market-table tbody tr {
    display: table-row;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .global-market-table td,
  .global-market-table th {
    display: table-cell;
    padding: 6px 7px;
    white-space: nowrap;
    font-size: 12px;
    text-align: center;
  }

  .global-market-table td::before {
    content: none;
  }

  .rank-card {
    gap: 8px;
    padding: 14px;
    background:
      linear-gradient(135deg, rgba(17, 63, 58, 0.98), rgba(35, 95, 92, 0.95) 62%, rgba(138, 161, 63, 0.9));
    color: white;
    box-shadow: var(--shadow);
  }

  .rank-card.featured {
    background:
      linear-gradient(135deg, rgba(13, 76, 68, 0.98), rgba(31, 111, 101, 0.95) 62%, rgba(128, 153, 55, 0.92));
  }

  .rank-card strong {
    font-size: 22px;
  }

  .rank-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .rank-metrics div {
    min-height: 66px;
    padding: 8px;
  }

  .rank-metrics span {
    font-size: 11px;
  }

  .rank-metrics b {
    font-size: 16px;
  }

  .rank-action {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
  }

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

  #refreshButton {
    width: 100%;
    min-height: 42px;
  }

  .table-panel,
  .status-panel {
    box-shadow: none;
  }

  .table-head {
    padding: 12px 14px;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
    cursor: default;
  }

  tbody tr:hover td,
  tbody tr.selected td {
    background: transparent;
  }

  td {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
    text-align: left;
    white-space: normal;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
  }

  td:nth-child(1),
  td:nth-child(2),
  td:nth-child(3) {
    grid-column: span 2;
  }

  td:nth-child(1) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }

  td:nth-child(1)::before {
    font-size: 12px;
  }

  td:nth-child(3) {
    font-size: 18px;
    font-weight: 800;
  }

  .pill {
    width: fit-content;
  }

  .status-list {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .disclaimer {
    padding: 0 2px 12px;
    line-height: 1.6;
  }

  .rank-record-table {
    min-width: 560px;
  }

  .rank-record-table thead {
    display: table-header-group;
  }

  .rank-record-table tbody {
    display: table-row-group;
    padding: 0;
  }

  .rank-record-table tbody tr {
    display: table-row;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .rank-record-table th,
  .rank-record-table td {
    display: table-cell;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    font-size: 12px;
  }

  .rank-record-table td::before {
    content: none;
  }

  .rank-record-table td:nth-child(1),
  .rank-record-table td:nth-child(2),
  .rank-record-table td:nth-child(3) {
    grid-column: auto;
  }

  .rank-record-table td:nth-child(1) {
    display: table-cell;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }

  .rank-record-table td:nth-child(3) {
    font-size: 12px;
    font-weight: 400;
  }
}

@media (max-width: 380px) {
  .rank-metrics {
    grid-template-columns: 1fr;
  }

  .rank-metrics div {
    min-height: 58px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }
}
