/* ==========================================================
   地平线6工具 · 移动端全局样式
   深色为默认，浅色完整可用；主色只有 --accent 一处
   ========================================================== */

:root {
  --accent: #22d3ee;
  --accent-press: #0fb6d1;
  --accent-weak: rgba(34, 211, 238, .10);
  --accent-text: #041014;
  --accent-2: #ff8a3d;
  --accent-2-weak: rgba(255, 138, 61, .12);

  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-2: #e3e9ee;
  --border: #cfd8df;
  --text: #0c1116;
  --muted: #56636e;
  --ok: #0891a6;
  --warn: #b45309;
  --danger: #c2410c;
  --shadow: 0 8px 24px rgba(8, 15, 22, .10);

  --radius: 6px;
  --radius-sm: 4px;
  --page-x: clamp(16px, 5vw, 72px);
  --shell: 1760px;
  --topbar-h: 72px;
  --hdr: calc(var(--topbar-h) + 1px);
}

body.dark-mode {
  color-scheme: dark;
  --accent-weak: rgba(34, 211, 238, .16);
  --bg: #080a0d;
  --surface: #0e1218;
  --surface-2: #151b24;
  --border: #232b36;
  --text: #eef6f8;
  --muted: #8fa0ad;
  --ok: #22d3ee;
  --warn: #ffb020;
  --danger: #ff7a45;
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
}

/* ---------- 基础 ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

.ico {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-sm {
  width: 16px;
  height: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 页面骨架 ---------- */

.app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  padding-bottom: 48px;
}

.container {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--page-x);
}

.footer {
  margin-top: auto;
  padding: 30px var(--page-x) calc(26px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer p + p {
  margin-top: 4px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: var(--shell);
  height: var(--topbar-h);
  margin: 0 auto;
  padding: 0 var(--page-x);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: none;
}

.topbar-logo {
  height: 34px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
}

.brand-mark .ico {
  width: 21px;
  height: 21px;
}

.topbar-site {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-nav {
  display: none;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.topbar-link.on {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
}

.icon-btn:hover {
  background: var(--surface-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.topbar-menu .i-x {
  display: none;
}

body.drawer-open .topbar-menu .i-menu {
  display: none;
}

body.drawer-open .topbar-menu .i-x {
  display: flex;
}

/* 主题按钮：深色时藏月亮、浅色时藏太阳 */
.theme-toggle .ico-sun { display: none; }
body.dark-mode .theme-toggle .ico-sun { display: block; }
body.dark-mode .theme-toggle .ico-moon { display: none; }

/* ---------- 通用块 ---------- */

.section {
  margin-top: 38px;
}

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

.section-title {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: .3px;
}

.section-more {
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.section-more:hover {
  color: var(--text);
}

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

.pad {
  padding: 14px;
}

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

.small {
  font-size: 12px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.btn:active {
  background: var(--surface-2);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:active {
  background: var(--accent-press);
  border-color: var(--accent-press);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: .55;
  pointer-events: none;
}

/* ---------- 标签 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .3px;
  white-space: nowrap;
}

.tag-level {
  color: var(--text);
}

.tag-level[data-level="X"]  { background: rgba(147, 51, 234, .18); color: #a855f7; }
.tag-level[data-level="S2"] { background: rgba(239, 68, 68, .16); color: #ef4444; }
.tag-level[data-level="S1"] { background: var(--accent-weak); color: var(--accent); }
.tag-level[data-level="A"]  { background: rgba(59, 130, 246, .16); color: #3b82f6; }
.tag-level[data-level="B"]  { background: rgba(34, 197, 94, .16); color: #22c55e; }
.tag-level[data-level="C"]  { background: rgba(148, 163, 184, .18); color: #94a3b8; }
.tag-level[data-level="D"]  { background: rgba(148, 163, 184, .12); color: #94a3b8; }

.tag-drive {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tag-on {
  background: var(--accent-weak);
  color: var(--accent);
}

/* 状态小圆点 */
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: 1px;
}

.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-danger { background: var(--danger); }

/* ---------- 首页：Banner ---------- */

.banner-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.banner-track::-webkit-scrollbar {
  display: none;
}

.banner {
  position: relative;
  flex: 0 0 88%;
  aspect-ratio: 5 / 2;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  scroll-snap-align: start;
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  color: #fff;
}

.banner-name {
  font-size: 17px;
  font-weight: 700;
}

.banner-sub {
  margin-top: 2px;
  font-size: 12px;
  opacity: .82;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}

.banner-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.banner-dots i.on {
  width: 14px;
  border-radius: 3px;
  background: var(--accent);
}

/* ---------- 首页：宫格 ---------- */

.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 8px;
  margin-top: 24px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--text);
}

.nav-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
}

.nav-item:active .nav-icon {
  background: var(--surface-2);
}

.nav-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 760px) {
  .nav-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    min-height: 64px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
  }

  .nav-item:hover {
    border-color: var(--muted);
  }

  .nav-icon {
    width: 36px;
    height: 36px;
    border: 0;
    background: var(--accent-weak);
  }

  .nav-icon .ico {
    width: 20px;
    height: 20px;
  }
}

/* ---------- 筛选 ---------- */

.filter {
  padding: 12px 0 2px;
}

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

.filter-row + .filter-row {
  margin-top: 8px;
}

.filter-label {
  width: 34px;
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.chip.on {
  border-color: var(--accent);
  background: var(--accent-weak);
  color: var(--accent);
  font-weight: 600;
}

.brand-strip {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.brand-strip::-webkit-scrollbar {
  display: none;
}

.brand-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-chip img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.brand-initial {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.brand-chip.on {
  border-color: var(--accent);
  background: var(--accent-weak);
  color: var(--accent);
}

.brand-chip.on .brand-initial {
  background: var(--accent);
  color: var(--accent-text);
}

@media (min-width: 900px) {
  .brand-strip {
    flex-wrap: wrap;
    overflow: visible;
  }
}

/* ---------- 车辆列表 ---------- */

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

@media (min-width: 620px) {
  .car-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .car-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1500px) {
  .car-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.car-card {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.car-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.car-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.car-thumb .tag-level {
  position: absolute;
  left: 8px;
  top: 8px;
}

.car-info {
  padding: 11px 13px 12px;
}

.car-brand {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-name {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.car-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.car-foot .spacer {
  flex: 1;
}

/* ---------- 车辆详情 ---------- */

.hero {
  position: relative;
  margin: 16px var(--page-x) 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.hero img {
  width: 100%;
  height: clamp(200px, 26vw, 440px);
  object-fit: cover;
}

.hero-tags {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  gap: 6px;
}

.car-title {
  margin-top: 14px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.car-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.spec-item {
  text-align: center;
  border-left: 1px solid var(--border);
}

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

.spec-k {
  color: var(--muted);
  font-size: 11px;
}

.spec-v {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ---------- 调校卡片 ---------- */

.tune-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

@media (min-width: 900px) {
  .tune-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

.tune {
  padding: 16px 18px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tune-shot {
  margin: -16px -18px 14px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}

.tune-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tune-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tune-who {
  min-width: 0;
  flex: 1;
}

.tune-name {
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tune-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.tune-like {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.tune-title {
  margin-top: 9px;
  font-size: 14px;
  font-weight: 600;
}

.tune-comment {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tune-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tune-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.tune-code b {
  font-size: 16px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.copy-btn:active {
  background: var(--accent-press);
}

.copy-btn.done {
  background: var(--ok);
}

/* ---------- 赛季 ---------- */

.season-hero {
  margin-top: 12px;
  padding: 16px;
}

.season-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .6px;
}

.season-name {
  margin-top: 3px;
  font-size: 21px;
  font-weight: 700;
}

.countdown {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.countdown .cd-cell {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.countdown .cd-num {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.countdown .cd-k {
  color: var(--muted);
  font-size: 11px;
}

.progress {
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-2);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.reward-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.reward-thumb {
  width: 78px;
  height: 50px;
  flex: none;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.reward-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 折叠面板 ---------- */

.acc {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.acc-item + .acc-item {
  border-top: 1px solid var(--border);
}

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  text-align: left;
}

.acc-head .chev {
  margin-left: auto;
  color: var(--muted);
  transform: rotate(0deg);
}

.acc-item.open .chev {
  transform: rotate(90deg);
}

.acc-title {
  font-size: 14px;
  font-weight: 600;
}

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

.acc-body {
  display: none;
  padding: 0 14px 14px;
}

.acc-item.open .acc-body {
  display: block;
}

.event-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}

.event-row .spacer {
  flex: 1;
}

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

.event-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}

.event-code button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- 积分榜 ---------- */

.tabs {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.tab.on {
  border-color: var(--accent);
  background: var(--accent-weak);
  color: var(--accent);
  font-weight: 650;
}

.rank-head,
.rank-row {
  display: grid;
  grid-template-columns: 40px 1fr 72px 64px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.rank-head {
  height: 34px;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}

.rank-row {
  height: 48px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

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

.rank-no {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.rank-row:nth-child(2) .rank-no { color: #f5c518; }
.rank-row:nth-child(3) .rank-no { color: #c0c6d4; }
.rank-row:nth-child(4) .rank-no { color: #c98b5e; }

.rank-player {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-points,
.rank-change {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-points {
  font-weight: 650;
}

.rank-change.up { color: var(--ok); }
.rank-change.down { color: var(--danger); }
.rank-change.flat { color: var(--muted); }

/* ---------- 文章列表 ---------- */

.art-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

@media (min-width: 760px) {
  .art-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

.art {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.art-thumb {
  width: 128px;
  height: 82px;
  flex: none;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.art-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.art-title {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

/* ---------- 空态 / 骨架 / 失败 ---------- */

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty .btn {
  margin-top: 12px;
}

.skeleton {
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
  transform: translateX(-100%);
  animation: sk 1.4s infinite;
}

@keyframes sk {
  to { transform: translateX(100%); }
}

.sk-card {
  height: 150px;
}

/* ---------- 表单（后台共用基础） ---------- */

.field {
  margin-bottom: 12px;
}

.field > label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}

/* ---------- 复制提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 8px;
  background: rgba(20, 20, 26, .94);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
}

/* ---------- 响应 ---------- */

@media (max-width: 1179px) {
  :root {
    --topbar-h: 56px;
  }

  .topbar-logo {
    height: 30px;
  }

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

  .topbar-site {
    font-size: 16px;
  }
}

@media (min-width: 1180px) {
  .topbar-nav {
    display: flex;
    justify-content: center;
  }

  .topbar-menu {
    display: none;
  }
}

@media (max-width: 359px) {
  .nav-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .rank-head,
  .rank-row {
    grid-template-columns: 34px 1fr 62px 56px;
    padding: 0 10px;
  }
}

/* ---------- 抽屉 ---------- */

.drawer {
  position: fixed;
  top: var(--hdr);
  bottom: 0;
  left: 0;
  z-index: 50;
  width: min(78vw, 300px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px 0 18px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

.drawer-link:active {
  background: var(--surface-2);
}

.drawer-link.on {
  background: var(--accent-weak);
  color: var(--accent);
  font-weight: 650;
}

.drawer-foot {
  margin-top: auto;
  padding: 12px 16px 0;
  color: var(--muted);
  font-size: 12px;
}

.scrim {
  position: fixed;
  top: var(--hdr);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  background: rgba(10, 10, 16, .45);
}

.footer-custom {
  margin-top: 6px;
}

/* ---------- 页头与工具条 ---------- */

.page-intro {
  padding: 18px 0 4px;
}

.page-intro h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.page-intro p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
}

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

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-box input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.home-banner {
  margin-top: 22px;
}

@media (min-width: 900px) {
  .banner-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    overflow: visible;
  }

  .banner {
    flex: none;
    aspect-ratio: 16 / 9;
  }

  .banner-dots {
    display: none;
  }
}

/* ---------- 首页统计与赛季小卡 ---------- */

.mini-stats {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.mini-stats span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.mini-stats b {
  color: var(--text);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.season-mini {
  display: block;
  overflow: hidden;
}

.season-cover {
  margin-bottom: 14px;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.season-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-media {
  max-width: 440px;
  margin: 12px 0 6px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.event-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.season-dates {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mini-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.progress-label + .progress {
  margin-top: 6px;
}

.reward-name {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 650;
}

.reward-name a {
  color: var(--accent);
}

/* ---------- 车辆详情 ---------- */

.car-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.car-head-main {
  min-width: 0;
}

.fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 12px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.fav-btn.on {
  border-color: var(--accent);
  background: var(--accent-weak);
  color: var(--accent);
}

.car-intro {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- 创作者榜 ---------- */

.creator-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.creator-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.creator-rank {
  width: 22px;
  flex: none;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.creator-rank.top {
  color: var(--accent);
}

.creator-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.creator-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}

.creator-bio {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.creator-nums {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.creator-nums b {
  color: var(--text);
  font-size: 13px;
}

.creator-row .chev {
  color: var(--muted);
}

/* ---------- 文章 ---------- */

.article {
  margin-top: 8px;
}

.article-title {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
}

.article-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.article-cover {
  margin-top: 14px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-lead {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-weak);
  font-size: 14px;
  line-height: 1.6;
}

.prose {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.8;
  word-break: break-word;
}

.article-foot {
  margin-top: 20px;
}

.art-summary {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 赛事与筛选 ---------- */

.level-row,
.month-row {
  margin-top: 12px;
}

.rank-card {
  margin-top: 12px;
  overflow: hidden;
}

/* ---------- 手机加宽适配 ---------- */

@media (min-width: 480px) {
  .creator-row {
    padding: 13px 14px;
  }
}

/* ---------- 公告 ---------- */

.notice-bar {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notice-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  font-size: 13px;
}

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

.notice-line-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-line .ico {
  flex: none;
  color: var(--muted);
}

.notice-level {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.notice-level-notice {
  background: var(--accent-weak);
  color: var(--accent);
}

.notice-level-update {
  background: rgba(59, 130, 246, .14);
  color: #3b82f6;
}

.notice-level-event {
  background: rgba(245, 158, 11, .16);
  color: var(--warn);
}

.notice-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 900px) {
  .notice-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

.notice-item {
  display: block;
  padding: 14px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notice-cover {
  margin-bottom: 12px;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.notice-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notice-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notice-pin {
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
}

.notice-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.notice-title {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notice-excerpt {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 涂装图库 ---------- */

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

@media (min-width: 620px) {
  .livery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .livery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1500px) {
  .livery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.livery-card {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.livery-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}

.livery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.livery-thumb .tag-level {
  position: absolute;
  left: 8px;
  top: 8px;
}

.livery-info {
  padding: 9px 10px 10px;
}

.livery-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.livery-car {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.livery-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.livery-foot > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.livery-likes {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.livery-hero {
  margin-top: 8px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.livery-hero img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.livery-likes-lg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.livery-code {
  margin-top: 14px;
}

.livery-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.livery-links .btn {
  flex: 1;
}

.livery-author {
  margin-top: 14px;
}

/* ---------- 2.0 平台层：搜索、用户中心、绑定、车库、拍卖、榜单 ---------- */

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.topbar-search input {
  width: 210px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 40px;
  height: 40px;
  color: var(--text);
}

.topbar-user img,
.topbar-user-initial {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
}

.topbar-user-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.drawer-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px;
  padding: 0 10px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.drawer-search input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.drawer-user {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}

.tabbar {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 26px 0 18px;
}

.page-title {
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

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

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex: none;
  margin: 0 4px;
}

.btn-row,
.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.input-sm {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.form-rows {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.form-row > label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.form-actions {
  justify-content: flex-end;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.check-row > span {
  display: grid;
  gap: 3px;
}

.check-row b {
  font-size: 14px;
}

.file-input {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
}

.code-block {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
}

.notice-pin.urgent {
  color: var(--accent-2);
  background: var(--accent-2-weak);
}

.panel {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

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

.panel-head h2 {
  font-size: 16px;
}

.panel-body {
  padding: 16px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

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

.stat-v {
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.empty-inline {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-inline a {
  color: var(--accent);
}

.text-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.text-link.danger {
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

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

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

.empty-cell {
  color: var(--muted);
  text-align: center !important;
  padding: 24px 12px !important;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.actions form {
  display: inline-flex;
  margin: 0;
}

.tag-danger,
.rarity-limited {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
  background: var(--accent-2-weak);
}

.rarity-rare {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-weak);
}

.rarity-legendary {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}

.auth-wrap {
  display: flex;
  justify-content: center;
  padding-top: 36px;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 32px;
  align-items: center;
  width: min(980px, 100%);
}

.auth-panel-single {
  grid-template-columns: minmax(320px, 440px);
  justify-content: center;
}

.auth-copy {
  display: grid;
  gap: 14px;
  align-content: center;
}

.auth-title {
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.18;
  letter-spacing: -.02em;
}

.auth-points {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

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

.auth-card-title {
  font-size: 20px;
  margin-bottom: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form .field {
  display: grid;
  gap: 6px;
}

.auth-form .field > span {
  color: var(--muted);
  font-size: 13px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-err {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-size: 13px;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-or::before,
.auth-or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.auth-oauth {
  display: grid;
  gap: 8px;
}

.auth-oauth-btn {
  width: 100%;
}

.auth-oauth-btn.xbox {
  border-color: #107c10;
  color: #6bcf6b;
}

.auth-oauth-btn.steam {
  border-color: #1b6ca8;
  color: #7cc4ff;
}

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

.auth-switch a {
  color: var(--accent);
}

.user-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-top: 26px;
}

.user-side {
  position: sticky;
  top: calc(var(--hdr) + 16px);
  display: grid;
  gap: 16px;
}

.user-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 700;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-card-name {
  font-weight: 700;
}

.user-card-meta {
  color: var(--muted);
  font-size: 12px;
}

.user-nav {
  display: grid;
  gap: 2px;
}

.user-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
}

.user-nav-link:hover,
.user-nav-link.on {
  background: var(--surface-2);
  color: var(--text);
}

.user-nav-link.on {
  box-shadow: inset 2px 0 0 var(--accent);
}

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

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

.user-title {
  font-size: 26px;
}

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

.user-flash {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
}

.user-flash-ok {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  color: var(--ok);
}

.user-flash-err {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.user-stats {
  margin-bottom: 14px;
}

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

.quick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.quick:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.bind-mini-list,
.sync-log {
  display: grid;
  gap: 8px;
}

.bind-mini,
.sync-log-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  font-size: 13px;
}

.bind-mini > div {
  display: grid;
  flex: 1;
}

.bind-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.bind-dot.bind-active {
  background: var(--ok);
}

.bind-dot.bind-error,
.bind-dot.bind-expired {
  background: var(--accent-2);
}

.rank-mini {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.rank-mini b {
  font-size: 34px;
  color: var(--accent);
}

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

.bind-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.bind-profile img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.career-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

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

.career-who img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
}

.career-name {
  font-size: 20px;
  font-weight: 700;
}

.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.garage-card {
  overflow: hidden;
}

.garage-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.garage-body {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.garage-name {
  font-weight: 700;
}

.sell-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: end;
  margin-top: 6px;
}

.sell-form label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.sell-form .input {
  width: 76px;
  height: 32px;
  padding: 0 8px;
}

.wish-card {
  display: grid;
  gap: 6px;
}

.wish-remove {
  text-align: right;
}

.auction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.auction-card {
  overflow: hidden;
}

.auction-thumb {
  position: relative;
}

.auction-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.auction-thumb .tag {
  position: absolute;
  top: 10px;
  left: 10px;
}

.auction-body {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.auction-title {
  font-weight: 700;
}

.auction-meta,
.auction-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.auction-meta .accent {
  color: var(--accent);
}

.auction-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  padding-top: 24px;
}

.auction-main {
  overflow: hidden;
}

.auction-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.auction-copy {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.auction-price-row {
  display: flex;
  gap: 28px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.auction-price-row div {
  display: grid;
  gap: 2px;
}

.auction-price-row b {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.auction-side {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
}

.auction-bid-form {
  display: grid;
  gap: 10px;
}

.board {
  overflow: hidden;
}

.board-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

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

.board-row.top {
  background: linear-gradient(90deg, var(--accent-weak), transparent 60%);
}

.board-rank {
  font-size: 20px;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.board-row.top .board-rank {
  color: var(--accent);
}

.board-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.board-who img,
.board-who .avatar-text {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 700;
}

.board-who b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-score {
  display: grid;
  justify-items: end;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.perf-bars {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.perf-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.perf-track {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.perf-track i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.perf-row b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.search-big {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-big input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

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

.avatar-edit img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width: 1300px) {
  .topbar-search {
    display: none;
  }
}

@media (max-width: 1020px) {
  .topbar-search {
    display: none;
  }

  .topbar-user-name {
    display: none;
  }

  .user-shell {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
  }

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

  .auction-detail {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 760px) {
  .input,
  .select,
  .textarea {
    font-size: 16px;
  }

  .topbar-search {
    display: none;
  }

  .topbar-login {
    display: none;
  }

  .main {
    padding-bottom: 72px;
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .tabbar-link {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 0 7px;
    color: var(--muted);
    font-size: 10px;
  }

  .tabbar-link.on {
    color: var(--accent);
  }

  .tabbar-link .ico {
    width: 21px;
    height: 21px;
  }

  .page-head,
  .user-top,
  .career-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .page-actions,
  .user-actions {
    width: 100%;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-copy {
    display: none;
  }

  .auth-card {
    padding: 18px;
  }

  .user-shell {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 16px;
  }

  .user-side {
    position: static;
  }

  .user-card {
    display: none;
  }

  .user-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .user-nav::-webkit-scrollbar {
    display: none;
  }

  .user-nav-link {
    flex: none;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    background: var(--surface);
  }

  .user-grid,
  .bind-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

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

  .board-row {
    grid-template-columns: 40px minmax(0, 1fr) 96px;
    padding: 10px 12px;
  }

  .board-score {
    font-size: 15px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .btn {
    flex: 1;
  }

  .garage-grid,
  .auction-grid {
    grid-template-columns: 1fr;
  }
}
