:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f7fafd;
  --surface-3: #eef3f9;
  --line: #e3ebf3;
  --line-strong: #ccdae7;
  --text: #16202b;
  --text-2: #33475b;
  --muted: #6f8296;
  --accent: #2f6fd0;
  --accent-strong: #1f5bb8;
  --accent-soft: #eaf2fe;
  --ok: #2f9e6f;
  --ok-soft: #eef7f2;
  --gold: #b8862f;
  --gold-soft: #fdf6e8;
  --danger: #c2556b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lift: 0 10px 26px rgba(20, 40, 70, 0.1);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1520;
  --surface: #151e2a;
  --surface-2: #1a2431;
  --surface-3: #22303f;
  --line: #26333f;
  --line-strong: #35485a;
  --text: #e8eef5;
  --text-2: #c3d1de;
  --muted: #93a4b6;
  --accent: #5b9df0;
  --accent-strong: #7fb4f6;
  --accent-soft: rgba(91, 157, 240, 0.16);
  --ok: #5cc79a;
  --ok-soft: rgba(92, 199, 154, 0.14);
  --gold: #e6b25f;
  --gold-soft: rgba(230, 178, 95, 0.14);
  --danger: #ef8d9d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lift: 0 10px 26px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  font-size: 14px;
}

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

button,
input,
select {
  font-family: inherit;
  font-size: 100%;
}

select option {
  background: var(--surface);
  color: var(--text);
}

/* ------------------------------------------------------------ 外壳 */

.shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
}

.brand-text {
  display: grid;
  line-height: 1.25;
}

.brand-text b {
  font-size: 15px;
  letter-spacing: 0.2px;
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.6px;
}

.topbar .spacer {
  flex: 1;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: 0.15s ease;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.uid-picker select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13px;
}

.page {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

/* ------------------------------------------------------------ 卡片 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

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

.section-head h2,
.block-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.section-head .hint,
.block-head .hint {
  color: var(--muted);
  font-size: 12.5px;
}

.block {
  display: grid;
  gap: 10px;
}

.block > .block-head {
  margin-bottom: 0;
  padding: 0 2px;
}

.block > .block-head h2 {
  font-size: 15px;
}

.link {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 2px;
  white-space: nowrap;
}

.link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* ------------------------------------------------------------ 首屏 */

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
}

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

.kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hero .sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.hero .sub b {
  color: var(--text);
  font-weight: 600;
}

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

.chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
}

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

.hero-thumbs {
  display: flex;
  gap: 12px;
  flex: none;
}

.hero-thumb {
  margin: 0;
  width: 86px;
  text-align: center;
}

.hero-thumb .thumb {
  width: 86px;
  height: 86px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  object-fit: cover;
  display: block;
}

.hero-thumb figcaption {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------ 数字条 */

.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
}

.strip-item {
  padding: 18px 22px;
  border-left: 1px solid var(--line);
}

.strip-item:first-child {
  border-left: 0;
}

.strip-item b {
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

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

/* ------------------------------------------------------------ 卡池概览 */

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

.pool-card {
  padding: 18px 20px;
  display: grid;
  gap: 10px;
}

.pool-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pool-card-head b {
  font-size: 15px;
  font-weight: 600;
}

.tag {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}

.tag.limited {
  color: var(--accent);
  border-color: rgba(47, 111, 208, 0.35);
  background: var(--accent-soft);
}

.tag.standard {
  color: var(--ok);
  border-color: rgba(47, 158, 111, 0.3);
  background: var(--ok-soft);
}

.pool-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pool-line .big {
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.pool-line small {
  color: var(--muted);
  font-size: 12.5px;
}

.pool-line .right,
.pool-pity .right {
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
}

.pool-line .right b {
  color: var(--text);
  font-size: 14px;
}

.pool-pity {
  display: flex;
  align-items: baseline;
  color: var(--muted);
  font-size: 12.5px;
}

.pool-pity b {
  color: var(--text);
  font-weight: 600;
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.85;
}

.pool-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* ------------------------------------------------------------ 最近的五星 */

.five-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.five-strip li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  min-width: 190px;
  flex: 1 1 190px;
  max-width: 260px;
}

.five-strip li.empty {
  border-style: dashed;
  color: var(--muted);
  font-size: 13px;
  justify-content: center;
}

.thumb {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  object-fit: cover;
  flex: none;
  display: block;
}

.thumb.sm {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.thumb-fallback {
  display: grid;
  place-items: center;
  color: var(--gold);
  background: var(--gold-soft);
}

.five-text {
  min-width: 0;
}

.five-text b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.five-text span {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.records-body {
  margin-top: 14px;
}

/* ------------------------------------------------------------ 表格 */

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  max-height: 460px;
}

.table-tall {
  max-height: 640px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: var(--surface-2);
}

.table .num {
  text-align: right;
}

.table.lb td b {
  font-weight: 600;
  color: var(--text);
}

/* 榜单里的「头像 + 名字」：头像排在序号和名字中间 */
.table .who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table .who-text {
  min-width: 0;
}

.table.lb td {
  vertical-align: middle;
}

.table.lb td .sub {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.table.lb .col-rank {
  width: 56px;
  color: var(--muted);
}

.table.lb tbody tr.top1 td {
  background: var(--accent-soft);
}

.table.lb th.hot,
.table.lb td.hot {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

@media (max-width: 760px) {
  .hide-sm {
    display: none;
  }
}

/* ------------------------------------------------------------ 榜单 / 好感度 */

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.tabs button.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.rank-row.top1 {
  border-color: rgba(47, 111, 208, 0.4);
  background: var(--accent-soft);
}

.rank-row .idx {
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rank-row.top1 .idx {
  color: var(--accent);
}

.rank-row .who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.who-text {
  min-width: 0;
}

.rank-row .who b {
  display: block;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row .who span {
  color: var(--muted);
  font-size: 11.5px;
}

.rank-row .val {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.rank-row .val small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.avatar.xs {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--gold);
}

.char-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
}

.char-title small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12.5px;
}

.char-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow: auto;
  padding: 2px;
}

.dash .picker .char-grid {
  max-height: 440px;
}

.char-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12.5px;
  cursor: pointer;
  transition: 0.14s ease;
}

.char-chip small {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.char-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.char-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.char-chip.active small {
  color: var(--accent);
}

.char-chip.more {
  border-style: dashed;
  color: var(--accent);
  border-color: rgba(47, 111, 208, 0.55);
  background: transparent;
}

.char-chip.more:hover {
  background: var(--accent-soft);
}

/* ------------------------------------------------------------ 布局工具 */

.dash {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
}

.picker {
  display: grid;
  align-content: start;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

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

.stat-row-2 {
  grid-template-columns: 1fr 1fr;
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
}

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

.stat b {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.stat.gold b {
  color: var(--gold);
}

.stat.cyan b {
  color: var(--accent);
}

@media (max-width: 1000px) {
  .dash {
    grid-template-columns: 1fr;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-thumbs {
    width: 100%;
    overflow: auto;
    padding-bottom: 2px;
  }
  .pool-grid {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------ 表单 / 按钮 */

.form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: 0.15s ease;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: 0.15s ease;
}

.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.ghost {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--line-strong);
}

.btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn.icon-btn {
  padding: 6px 10px;
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(194, 85, 107, 0.4);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ 登录页 */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-foot {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px 16px;
}

.auth-foot .site-footer {
  margin-top: 0;
}

.auth-card {
  width: min(400px, 100%);
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.auth-card p.sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.switch {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.switch button {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  padding: 0 4px;
  font-weight: 600;
}

/* ------------------------------------------------------------ 分享页 */

.share-preview {
  display: grid;
  place-items: center;
}

.share-preview img {
  width: min(360px, 100%);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
}

.copy-box {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  font-size: 12.5px;
  word-break: break-all;
}

/* ------------------------------------------------------------ 提示 / 空态 */

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 90;
  max-width: min(90vw, 460px);
  text-align: center;
  box-shadow: var(--shadow-lift);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 16px 4px;
  list-style: none;
}

.skeleton {
  height: 88px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3));
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.6;
  }
}

/* ------------------------------------------------------------ 移动端 */

.mobile-nav {
  display: none;
}

@media (max-width: 820px) {
  .shell {
    padding: 10px 10px 96px;
  }
  .topbar {
    position: static;
    padding: 10px 12px;
    gap: 8px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
  }
  .topbar .brand {
    grid-column: 1;
    grid-row: 1;
  }
  .topbar .spacer {
    display: none;
  }
  #import-open {
    grid-column: 2;
    grid-row: 1;
  }
  #theme-toggle {
    grid-column: 3;
    grid-row: 1;
  }
  .uid-picker {
    grid-column: 1 / span 2;
    grid-row: 2;
    min-width: 0;
  }
  .uid-picker select {
    width: 100%;
  }
  #logout {
    grid-column: 3;
    grid-row: 2;
  }
  .nav {
    display: none;
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    z-index: 40;
  }
  .mobile-nav a {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding: 5px 0;
    border-radius: 8px;
  }
  .mobile-nav a.active {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
  }
  .card {
    padding: 14px;
    border-radius: 12px;
  }
  .hero {
    padding: 16px;
    gap: 14px;
  }
  .hero h1 {
    font-size: 22px;
  }
  .hero .sub {
    font-size: 12.5px;
    margin-bottom: 10px;
  }
  .kicker {
    font-size: 10.5px;
    letter-spacing: 1.6px;
    margin-bottom: 6px;
  }
  .chips {
    gap: 6px;
  }
  .chip {
    padding: 3px 9px;
    font-size: 11.5px;
  }
  .hero-thumbs {
    gap: 8px;
  }
  .hero-thumb {
    width: 72px;
  }
  .hero-thumb .thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
  }
  .hero-thumb figcaption {
    font-size: 10.5px;
    margin-top: 4px;
  }
  .strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .strip-item {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 14px;
  }
  .strip-item:nth-child(-n + 2) {
    border-top: 0;
  }
  .strip-item b {
    font-size: 24px;
  }
  .strip-item span {
    font-size: 11.5px;
  }
  .block > .block-head {
    padding: 0;
  }
  .block-head h2 {
    font-size: 14.5px;
  }
  .pool-grid {
    gap: 12px;
  }
  .pool-card {
    padding: 14px 15px;
    gap: 8px;
  }
  .pool-line .big {
    font-size: 30px;
  }
  .pool-foot {
    padding-top: 8px;
  }
  .five-strip {
    gap: 8px;
  }
  .five-strip li {
    max-width: none;
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 8px 10px;
  }
  .five-text b {
    font-size: 12.5px;
  }
  .table th,
  .table td {
    padding: 8px 8px;
    font-size: 12.5px;
  }
  .rank-row {
    grid-template-columns: 32px 1fr auto;
    padding: 9px 10px;
  }
}

/* ------------------------------------------------------------ 账号管理 */

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 13px;
}

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

.uid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.uid-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.uid-main b {
  display: block;
  font-size: 13.5px;
}

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

.uid-nick {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}

.uid-nick:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

@media (max-width: 820px) {
  .uid-row {
    grid-template-columns: 1fr auto auto;
    row-gap: 8px;
  }
  .uid-main {
    grid-column: 1 / -1;
  }
  .uid-nick {
    grid-column: 1;
  }
}

/* ------------------------------------------------------------ QQ 登录 */

.oauth-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.btn.oauth {
  display: block;
  text-align: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  text-decoration: none;
}

.btn.oauth.qq::before {
  content: "QQ ";
  color: #12b7f5;
  font-weight: 700;
}

.btn.oauth:hover {
  border-color: #12b7f5;
  color: #12b7f5;
  background: var(--surface);
}

.oauth-row .hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.qq-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-2);
}

.qq-row b {
  color: var(--text);
}

/* ------------------------------------------------------------ 页脚 / 法务页 */

.site-footer {
  margin-top: 22px;
  padding: 14px 4px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.site-footer .links a {
  color: var(--muted);
}

.site-footer .links a:hover {
  color: var(--accent);
}

.legal {
  max-width: 720px;
}

.legal p {
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.8;
}

.legal .foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: left;
}

@media (max-width: 820px) {
  .site-footer {
    padding-bottom: 4px;
  }
}

/* ------------------------------------------------------------ 独立分享页 */

.share-page {
  padding: 24px 16px 60px;
}

.share-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lift);
}

.share-card .kicker {
  margin: 0;
  color: var(--accent);
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.share-card h1 {
  margin: 6px 0 4px;
  font-size: 24px;
}

.share-card .sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.share-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.share-stats div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.share-stats span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.share-stats b {
  font-size: 19px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.share-image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.share-card h2 {
  font-size: 13.5px;
  margin: 20px 0 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 1px;
}

.five-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.five-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.five-list .nm {
  font-weight: 600;
}

.five-list .meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pool-list {
  display: grid;
  gap: 8px;
}

.share-card .pool {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.share-card .pool span {
  color: var(--muted);
}

.share-card .foot {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

@media (max-width: 560px) {
  .share-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .share-card {
    padding: 18px;
  }
}
