



* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 8px 0 28px;
}

.sticky-toolbar {
  position: relative;
  z-index: 1;
  padding: 8px 0 6px;
}

.sticky-toolbar.is-quality-open {
  z-index: 40;
}

.sticky-toolbar,
.toolbar-card,
.filter-shell {
  min-width: 0;
}

.toolbar-card,
.filter-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.toolbar-card {
  position: relative;
  padding: 8px;
}

.filter-shell {
  position: sticky;
  top: 8px;
  z-index: 18;
  padding: 7px;
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  scroll-margin-top: 8px;
}

.mobile-filter-toggle {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  margin-bottom: 7px;
  padding: 2px 3px 5px;
}

.title-cluster {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
}

.title-cluster > div {
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 2px solid var(--seal);
  border-radius: 6px;
  background: color-mix(in srgb, var(--seal) 5%, transparent);
  color: var(--seal);
  box-shadow: inset 0 0 4px color-mix(in srgb, var(--seal) 20%, transparent), 0 0 6px color-mix(in srgb, var(--seal) 16%, transparent);
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  font-size: 22px;
  font-weight: 600;
  transform: rotate(-5deg);
  margin-right: 2px;
}

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

h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar p {
  overflow: hidden;
  max-width: min(760px, 72vw);
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button,
select,
input {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

button {
  min-height: 36px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  min-height: 36px;
  padding: 0;
}

.toolbar-icon {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.toolbar-icon[hidden] {
  display: none;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  overflow: hidden;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.mode-tab {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.mode-tab.is-active {
  background: var(--panel-solid);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

:root:not([data-theme="dark"]) .mode-tab.is-active {
  box-shadow: inset 0 -2px 0 var(--accent), var(--shadow-sm);
}

.mode-tab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.filters {
  display: grid;
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(180px, 1.35fr) 40px;
  gap: 7px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-field {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-caption {
  line-height: 1.2;
}

.filter-action-field {
  display: flex;
  align-items: end;
  justify-content: center;
  min-width: 40px;
}

.filter-action-field button {
  display: grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.filter-action-field button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  transform: none;
}

.filter-action-field svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.filter-action-field[hidden] {
  display: none !important;
}

.filters.is-change-mode {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.filters.is-guild-compare-mode {
  grid-template-columns: minmax(180px, 0.8fr) repeat(2, minmax(150px, 1fr)) 40px;
}

.change-range-field {
  min-width: 0;
}

.change-range-quick {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 2;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.change-range-field[hidden],
.change-range-quick[hidden] {
  display: none !important;
}

.change-range-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.change-range-mobile-select {
  display: none;
}

.change-range-buttons button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-solid);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.change-range-buttons button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.change-range-buttons .range-reset-button {
  margin-left: 4px;
  border-style: dashed;
  color: var(--muted);
}

.date-status {
  position: absolute;
  top: 0;
  right: 0;
  min-height: 14px;
  color: var(--bad);
  font-size: 11px;
  line-height: 1.15;
}

select,
input {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.62) inset;
  font-size: 13px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  display: block;
  background: transparent;
  bottom: 0;
  color: transparent;
  cursor: pointer;
  height: auto;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
  z-index: 1;
}

input[type="date"] {
  position: relative;
}

.date-field::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 9px;
  width: 16px;
  height: 16px;
  background-color: var(--muted);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat center;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat center;
  mask-size: contain;
  -webkit-mask-size: contain;
  pointer-events: none;
  z-index: 2;
  transition: background-color 0.2s;
}

.date-field:hover::after {
  background-color: var(--accent);
}

.search-field {
  grid-column: span 1;
}

.ranking-panel {
  position: relative;
  min-height: 120px;
  margin-top: 9px;
  overflow-x: clip;
  overflow-y: visible;
}

.ranking-busy {
  position: sticky;
  top: calc(var(--sticky-filter-height, 0px) + 8px);
  z-index: 24;
  display: flex;
  width: max-content;
  max-width: calc(100% - 24px);
  min-height: 32px;
  margin: 0 auto -32px;
  padding: 6px 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 94%, var(--soft));
  box-shadow: var(--shadow);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.ranking-busy[hidden] {
  display: none;
}

.ranking-busy-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-spin 0.8s linear infinite;
}

.ranking-list.is-refreshing {
  opacity: 0.52;
  pointer-events: none;
  transition: opacity var(--motion-fast) ease;
}

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

.ranking-item {
  position: relative;
  display: grid;
  min-width: 0;
}

.ranking-item > .ranking-card {
  width: 100%;
}

.ranking-item > .player-card {
  padding-right: 48px;
}

.ranking-item.is-expanded > .ranking-card {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.ranking-card {
  display: grid;
  position: relative;
  grid-template-columns: 46px minmax(150px, 1.18fr) minmax(108px, 0.66fr) minmax(120px, 0.72fr) minmax(220px, 1fr);
  gap: 7px;
  align-items: center;
  scroll-margin-top: calc(var(--sticky-filter-height, 0px) + 12px);
  min-height: var(--card-row-height);
  padding: var(--card-padding-y) var(--card-padding-x);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ranking-card::before {
  content: none;
}

.ranking-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

.ranking-card[role="button"] {
  cursor: pointer;
}

.ranking-card[role="button"]:focus-visible,
.daily-change-row:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-lg);
  z-index: 3;
}

.archive-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.archive-icon svg {
  color: var(--muted);
  transition: color 0.2s;
}
.ranking-card:hover .archive-icon svg {
  color: var(--accent);
}

.ranking-card.is-private {
  background: transparent;
  opacity: 1;
}

.ranking-card.is-private .power-block strong {
  color: var(--muted);
  font-weight: 600;
}

.guild-card {
  grid-template-columns: 46px minmax(150px, 1.18fr) minmax(118px, 0.66fr) minmax(292px, 1.25fr) 108px;
}

.archive-card {
  grid-template-columns: 46px minmax(150px, 1.18fr) minmax(108px, 0.66fr) minmax(132px, 0.78fr) minmax(184px, 0.92fr);
  cursor: pointer;
}

.archive-aliases {
  grid-column: 2 / -1;
  overflow: hidden;
  margin-top: -2px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-cool);
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-rank {
  color: var(--rank);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rank-main {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.rank-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.player-block,
.guild-block,
.power-block,
.card-action {
  min-width: 0;
}

.player-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duplicate-role-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-cool);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.detail-name-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.player-meta span:not(.class-badge):not(.privacy-pill) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-badge,
.privacy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.privacy-pill {
  min-width: 34px;
  background: var(--surface-cool);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* 门派徽章颜色：背景淡染 + 文字与主题墨色混合，明暗主题自动适配 */
.class-badge {
  background: color-mix(in srgb, var(--class-color, #64748b) 10%, transparent);
  color: color-mix(in srgb, var(--class-color, #64748b) 60%, var(--text));
}

.guild-rename-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--accent-warm) 32%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent-warm) 9%, var(--panel));
  color: color-mix(in srgb, var(--accent-warm) 85%, var(--text));
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.guild-former-name {
  max-width: 180px;
  color: var(--muted);
}

/* 门派色源：一行一个门派；改色/加门派只动这里 */
.class-wanxiang { --class-color: #2563eb; }
.class-gaibang { --class-color: #16a34a; }
.class-wudu { --class-color: #4f46e5; }
.class-conglong { --class-color: #b45309; }
.class-tangmen { --class-color: #9333ea; }
.class-tianxiang { --class-color: #db2777; }
.class-taibai { --class-color: #0284c7; }
.class-shaolin { --class-color: #ca8a04; }
.class-zhenwu { --class-color: #1e40af; }
.class-shendao { --class-color: #dc2626; }
.class-shenwei { --class-color: #ea580c; }
.class-yihua { --class-color: #475569; }
.class-changsheng { --class-color: #ca8a04; }
.class-xueyi { --class-color: #e11d48; }
.class-default { --class-color: #64748b; }

.power-block {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.power-block strong {
  display: block;
  color: var(--power-num);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.power-block span,
.guild-block span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.guild-block strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-block span {
  text-align: center;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-cool);
}

.card-metric {
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.card-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.card-metric strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px;
  align-items: baseline;
  text-align: left;
}

.compact-metric span,
.compact-metric strong {
  display: inline;
  margin: 0;
}

.card-action {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.inline-trend-toggle {
  display: inline-grid;
  position: relative;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.ranking-item > .inline-trend-toggle {
  position: absolute;
  top: 14px;
  right: 9px;
  z-index: 4;
}

.inline-trend-toggle svg {
  width: 17px;
  height: 17px;
}

.inline-trend-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.inline-trend-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.inline-trend-panel {
  min-width: 0;
  overflow: hidden;
  margin-top: -1px;
  border: 1px solid var(--line);
  border-top-color: var(--line-strong);
  border-radius: 0 0 10px 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.inline-trend-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 190px;
  color: var(--muted);
  font-size: 12px;
}

.change-action {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 68px;
  min-height: 30px;
  padding: 0 7px;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: none;
}

.change-action svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
}

.change-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

:root[data-theme="dark"] .change-action {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line-strong));
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: color-mix(in srgb, var(--accent-strong) 72%, var(--text-secondary));
  box-shadow: none;
}

:root[data-theme="dark"] .change-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

:root[data-theme="dark"] .change-action:active {
  transform: translateY(0);
  background: var(--accent-soft);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .change-action:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.card-note {
  grid-column: 2 / -1;
  overflow: hidden;
  height: 24px;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
}

.player-card-aside {
  display: contents;
}

.player-card-aside .player-metrics {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.player-card-aside .card-note {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  height: 22px;
  margin: 0;
  line-height: 18px;
}

.player-card-aside:not(.has-metrics) .card-note {
  grid-column: 1 / -1;
}

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

.delta-up {
  color: var(--good);
}

.delta-down {
  color: var(--bad);
}

.card-metric .delta-up {
  color: var(--good);
}

.card-metric .delta-down {
  color: var(--bad);
}

.card-metric .muted {
  color: var(--muted);
}

.empty {
  padding: 48px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.empty-error {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.empty-error strong {
  color: var(--text-secondary);
  font-size: 15px;
}

.empty-error button {
  min-height: 36px;
  padding-inline: 16px;
}

.guild-period-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.guild-period-metrics .compact-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-height: 42px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-cool);
  text-align: center;
}

.guild-period-metrics .compact-metric > span,
.guild-period-metrics .compact-metric > strong {
  display: block;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-gap-value,
.guild-summit {
  color: var(--text-secondary);
}

.guild-summit {
  font-weight: 800;
}

.mobile-guild-change-action {
  display: none;
}

.ranking-error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--bad) 7%, var(--panel-solid));
  color: var(--text-secondary);
  font-size: 13px;
}

.ranking-error-banner[hidden] {
  display: none;
}

.ranking-error-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.ranking-error-actions button {
  min-height: 30px;
  padding: 0 10px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: var(--muted);
  gap: 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spinner-spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  font-weight: 500;
}

/* 全局动效降级：用户偏好减少动态时，关停全部过渡/动画/平滑滚动 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

