/* ===== GT-X Design System ===== */
:root {
  --bg: #0a0e1a;
  --bg-soft: #111827;
  --card: #1a2236;
  --card-2: #222c44;
  --border: #2a3654;
  --primary: #00e5a0;
  --primary-dark: #00b882;
  --accent: #3b82f6;
  --warn: #f59e0b;
  --danger: #ef4444;
  --text: #e8edf5;
  --text-soft: #9aa7bd;
  --muted: #6b7894;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }

/* ===== Logo ===== */
.logo { font-size: 48px; font-weight: 800; letter-spacing: -2px; color: var(--primary); }
.logo span { color: #fff; }
.logo-sm { font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: -1px; }
.logo-sm span { color: #fff; }

/* ===== Views ===== */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at top, #13203a 0%, #0a0e1a 70%);
}
.login-shell { width: 100%; max-width: 420px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.tagline { color: var(--text-soft); margin-top: 8px; font-size: 15px; }
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  box-shadow: var(--shadow);
}
.login-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}
.login-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all .2s;
}
.login-tab.active { background: var(--card-2); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.login-pane { display: none; }
.login-pane.active { display: block; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; color: var(--text-soft); margin-bottom: 8px; font-size: 13px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.row { display: flex; gap: 10px; }
.row input { flex: 1; min-width: 0; }
.row .btn { flex-shrink: 0; min-height: 52px; padding: 0 16px; }
.login-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.6; }

/* 扫码登录 */
.qr-wrap {
  position: relative;
  width: 216px;
  height: 216px;
  margin: 2px auto 16px;
  padding: 10px;
  background: #fff;
  border-radius: 16px;
}
.qr-wrap img { display: block; width: 100%; height: 100%; border-radius: 8px; }
.qr-mask {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(10, 14, 26, .88);
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}
.qr-mask.hide { display: none; }
.qr-hint { text-align: center; font-size: 15px; color: var(--text); }
.qr-sub { text-align: center; font-size: 12px; color: var(--muted); margin: 6px 0 16px; line-height: 1.7; }

@media (max-width: 420px) {
  .login-wrap { padding-left: 14px; padding-right: 14px; }
  .login-card { padding: 18px; border-radius: 16px; }
  .login-brand { margin-bottom: 20px; }
  .logo { font-size: 40px; }
  .tagline { font-size: 13px; }
  .qr-wrap { width: 190px; height: 190px; }
}

/* ===== Buttons ===== */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #06231b; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== App Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.top-nav { display: flex; gap: 4px; flex: 1; }
.top-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.top-nav a:hover { color: var(--text); background: var(--card); }
.top-nav a.active { color: var(--primary); background: rgba(0,229,160,0.1); }
.header-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
  transition: background .2s;
}
.icon-btn:hover { background: var(--card-2); }
.badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--card);
  border-radius: 20px;
  font-size: 13px;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #06231b;
  font-weight: 700;
  font-size: 13px;
}
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.md { width: 40px; height: 40px; font-size: 16px; }

/* ===== Main ===== */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 90px;
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-head h3 { font-size: 16px; }
.card-head .sub { color: var(--muted); font-size: 12px; }

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; color: var(--primary); }
.stat .unit { font-size: 13px; color: var(--text-soft); font-weight: 400; }
.stat .delta { font-size: 12px; margin-top: 4px; }
.delta.up { color: var(--primary); }
.delta.down { color: var(--danger); }

/* ===== Section Title ===== */
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===== Charts ===== */
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 160px; }

/* ===== Lists ===== */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg-soft);
  transition: border-color .2s;
}
.list-item:hover { border-color: var(--primary); }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info .title { font-weight: 600; margin-bottom: 2px; }
.list-item .info .meta { color: var(--muted); font-size: 12px; }

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.tag-green { background: rgba(0,229,160,0.15); color: var(--primary); }
.tag-blue { background: rgba(59,130,246,0.15); color: var(--accent); }
.tag-warn { background: rgba(245,158,11,0.15); color: var(--warn); }
.tag-red { background: rgba(239,68,68,0.15); color: var(--danger); }
.tag-gray { background: rgba(107,120,148,0.15); color: var(--muted); }

/* ===== Progress ===== */
.progress {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 4px;
  overflow: hidden;
}
.progress .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width .4s;
}

/* ===== AI Report ===== */
.report-hero {
  background: linear-gradient(135deg, rgba(0,229,160,0.12), rgba(59,130,246,0.12));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.score-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  position: relative;
}
.score-ring .score { font-size: 36px; font-weight: 800; }
.score-ring .label { font-size: 12px; color: var(--text-soft); }
.dim-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}
.dim-row .dim-name { width: 80px; font-size: 13px; color: var(--text-soft); }
.dim-row .progress { flex: 1; }
.dim-row .dim-val { width: 40px; text-align: right; font-weight: 600; font-size: 13px; }

/* ===== Chat ===== */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  max-height: 720px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}
.msg {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.msg.user { flex-direction: row-reverse; }
.msg .bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  line-height: 1.6;
}
.msg.user .bubble { background: var(--primary); color: #06231b; border-color: transparent; }
.msg.ai .bubble { background: var(--card-2); }
.chat-input-row {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.chat-input-row input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--text);
  outline: none;
}
.chat-input-row input:focus { border-color: var(--primary); }
.chat-sessions {
  max-height: 60vh;
  overflow-y: auto;
}
.session-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 6px;
  transition: background .2s;
}
.session-item:hover { background: var(--card-2); }
.session-item .s-title { font-weight: 600; font-size: 13px; }
.session-item .s-time { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ===== Bottom Nav (mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10,14,26,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 50;
  padding: 6px 0 env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a .ic { font-size: 20px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 20px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Empty ===== */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty .ic { font-size: 48px; margin-bottom: 12px; }

/* ===== Grid helpers ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-soft { color: var(--text-soft); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.fs-12 { font-size: 12px; }
.fw-600 { font-weight: 600; }

/* ===== Device binding ===== */
.device-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  margin-bottom: 12px;
}
.device-card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.device-card.bound { border-color: var(--primary); }

/* ===== Dynamic feed ===== */
.dynamic {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.dynamic-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dynamic-head .name { font-weight: 600; }
.dynamic-head .time { color: var(--muted); font-size: 12px; }
.dynamic-text { margin-bottom: 12px; line-height: 1.6; }
.dynamic-data {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}
.dynamic-data .d { text-align: center; }
.dynamic-data .d .v { font-size: 18px; font-weight: 700; color: var(--primary); }
.dynamic-data .d .l { font-size: 11px; color: var(--muted); }
.dynamic-actions { display: flex; gap: 16px; }
.dynamic-actions button { color: var(--text-soft); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.dynamic-actions button.liked { color: var(--danger); }

/* ===== Club ===== */
.club-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}
.club-cover {
  height: 100px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.rank-row:last-child { border-bottom: none; }
.rank-no { width: 24px; font-weight: 700; color: var(--primary); }

/* ===== Two-column layout ===== */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }

/* ===== Bottom Nav ===== */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-soft); border-top: 1px solid var(--border);
  padding: 8px 0; z-index: 100;
}
.bottom-nav .nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 6px 0; color: var(--muted); font-size: 11px; gap: 2px;
}
.bottom-nav .nav-item.active { color: var(--primary); }
.nav-icon { display: flex; }
.nav-icon svg { width: 23px; height: 23px; }
.ic-svg { display: inline-block; vertical-align: -2px; flex-shrink: 0; }

/* ===== Page Head ===== */
.page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.page-head h1 { font-size: 22px; font-weight: 700; }

/* ===== Tabs ===== */
.tab-bar { display: flex; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 8px 0; background: none; border: none; color: var(--muted); font-size: 15px; border-bottom: 2px solid transparent; cursor: pointer; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== Feed Cards ===== */
.feed-list { display: flex; flex-direction: column; gap: 14px; }
.feed-card { padding: 16px; }
.feed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--card-2); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.feed-user .feed-name { font-weight: 600; }
.feed-time { color: var(--muted); font-size: 12px; }
.feed-content { margin-bottom: 10px; line-height: 1.6; white-space: pre-wrap; }
.feed-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 10px; }
.feed-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.detail-img { width: 100%; border-radius: 8px; margin-bottom: 8px; }
.feed-actions { display: flex; gap: 16px; padding-top: 10px; border-top: 1px solid var(--border); }
.act-btn { color: var(--muted); font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.act-btn.liked { color: var(--danger); }
.act-btn:hover { background: var(--card-2); }

/* ===== Sport Card ===== */
.sport-card { background: var(--card-2); border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer; }
.sport-card-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.sport-type { background: var(--primary); color: #000; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.sport-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sport-metrics.big { grid-template-columns: repeat(3, 1fr); }
.metric { text-align: center; }
.metric-val { font-size: 18px; font-weight: 700; color: var(--primary); }
.metric-label { font-size: 11px; color: var(--muted); }
.track-map { background: var(--bg-soft); border-radius: 8px; padding: 16px; text-align: center; color: var(--muted); margin-top: 10px; }

/* ===== Record Card ===== */
.record-card { cursor: pointer; padding: 14px; }
.record-top { display: flex; justify-content: space-between; margin-bottom: 10px; }
.record-foot { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; }
.share-mini { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1px solid var(--border); color: var(--text-2); border-radius: 14px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.share-mini:hover { color: var(--primary); border-color: var(--primary); }
.detail-action-card { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ===== Chat ===== */
.chat-layout { display: flex; gap: 12px; height: calc(100vh - 160px); }
.chat-sessions { width: 140px; flex-shrink: 0; overflow-y: auto; }
.session-item { padding: 10px; border-radius: 8px; margin-bottom: 4px; cursor: pointer; font-size: 13px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-item.active { background: var(--card-2); color: var(--primary); }
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); padding: 12px; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg-bubble { max-width: 80%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; }
.msg.user .msg-bubble { background: var(--primary); color: #000; }
.msg.assistant .msg-bubble { background: var(--card-2); }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; padding: 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }

/* ===== Profile ===== */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.profile-info h2 { font-size: 20px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-val { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--muted); }
.menu-list { display: flex; flex-direction: column; gap: 2px; margin: 16px 0; }
.menu-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--card); border-radius: var(--radius-sm); cursor: pointer; }
.menu-item:hover { background: var(--card-2); }

/* 我的页分组菜单 */
.menu-group { margin-top: 18px; }
.menu-group-title { font-size: 12px; color: var(--muted); letter-spacing: .5px; margin: 0 4px 8px; }
.menu-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text); text-align: left; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.menu-row:last-child { border-bottom: none; }
.menu-row:hover { background: var(--card-2); }
.menu-ic {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-2); color: var(--primary);
}
.menu-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu-txt b { font-size: 14px; font-weight: 600; }
.menu-txt em { font-style: normal; font-size: 12px; color: var(--muted); }
.menu-arrow { color: var(--muted); display: flex; }
.menu-row.danger .menu-ic { color: #ef4444; }
.menu-row.danger .menu-txt b { color: #ef4444; }
.sec-title { font-size: 16px; font-weight: 600; margin: 16px 0 10px; }

/* ===== Bind ===== */
.bind-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.bind-row:last-child { border-bottom: none; }
.bind-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.mode-badge {

  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 8px;
  font-size: 11px; font-weight: 600; vertical-align: 2px;
  background: rgba(245,158,11,0.15); color: var(--warn);
}
.mode-badge.live { background: rgba(0,229,160,0.15); color: var(--primary); }
.prio-badge {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 8px;
  font-size: 11px; font-weight: 700; vertical-align: 2px;
  background: rgba(37,99,235,0.15); color: #2563eb;
}
.prio-btns { display: inline-flex; flex-direction: column; gap: 2px; }
.prio-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  width: 22px; height: 16px; line-height: 1; font-size: 9px; border-radius: 5px; cursor: pointer; padding: 0;
}
.prio-btn:hover { color: var(--primary); border-color: var(--primary); }
.metric-checks { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.mc-item { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.mc-item input { accent-color: var(--primary); }

/* ===== Toggle Switch（自动同步开关） ===== */
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .slider {
  width: 34px; height: 20px; border-radius: 10px; background: var(--border);
  position: relative; transition: background .2s; flex-shrink: 0;
}
.switch .slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { left: 16px; }
.switch em { font-style: normal; font-size: 12px; color: var(--text-soft); }

.log-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--border); }

/* ===== Messages ===== */
.msg-item { display: flex; gap: 12px; align-items: center; }
.msg-type { font-size: 22px; }

/* ===== Comments ===== */
.comment-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.comment-body { flex: 1; }
.comment-name { font-size: 13px; font-weight: 600; }
.comment-input { display: flex; gap: 8px; margin-top: 12px; }
.comment-input input { flex: 1; padding: 8px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }

/* ===== AI ===== */
.ai-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.ai-tab { padding: 8px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; color: var(--text-soft); cursor: pointer; font-size: 13px; }
.ai-tab.active { background: var(--primary); color: #000; border-color: var(--primary); }
.ability-score { font-size: 56px; font-weight: 800; color: var(--primary); }
.ability-level { margin: 8px 0; }
.fatigue-ring { width: 100px; height: 100px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--card-2) 0); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.fatigue-ring span { font-size: 28px; font-weight: 800; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.fs-12 { font-size: 12px; }
.pub-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; margin-right: 6px; }

/* ===== Loading/Empty ===== */
.loading, .empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.back-btn { background: none; border: none; color: var(--primary); font-size: 15px; cursor: pointer; margin-bottom: 12px; }

/* ===== Rich Sport Panel (matches reference design) ===== */
.feed-meta { font-size: 12px; color: var(--muted); }
.sport-panel { margin-top: 10px; cursor: pointer; }
.track-map { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #eef0ea; line-height: 0; }
.track-map svg { width: 100%; display: block; }
.track-map.card svg { height: 200px; }
.track-map.detail svg { height: 280px; }
.track-map.mini { border-radius: 10px; margin-bottom: 10px; }
.track-map.mini svg { height: 110px; }
.track-map.detail { margin-bottom: 4px; }
.track-map.empty-map { height: 140px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.map-badge { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 20px; line-height: 1.4; }
.sport-head { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 2px; }
.sport-type-line { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.sport-icon { font-size: 16px; }
.sport-weather { font-size: 12px; color: var(--muted); }
.sport-distance { font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -1px; margin: 2px 0 10px; }
.sport-distance.small { font-size: 30px; margin: 4px 0 8px; }
.sport-distance .unit { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; padding: 4px 0 6px; }
.metric-grid.compact { gap: 8px; }
.mg-item { min-width: 0; }
.mg-val { font-size: 20px; font-weight: 700; line-height: 1.2; }
.mg-val small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.mg-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.metric-grid.compact .mg-val { font-size: 16px; }
.sport-more { text-align: center; color: var(--primary); font-size: 13px; padding: 8px 0 2px; border-top: 1px dashed var(--border); margin-top: 8px; }

/* Achievement banner */
.achv { display: flex; align-items: center; gap: 10px; background: #fffaf0; border: 1px solid #f3e3bf; border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.achv-icon { font-size: 22px; }
.achv-text { flex: 1; }
.achv-title { font-size: 13px; font-weight: 600; color: #8a6220; }
.achv-sub { font-size: 11px; color: #b08a45; margin-top: 2px; }
.achv-arrow { color: #c9a35c; font-size: 16px; }

/* Analysis toggle & charts */
.analysis-toggle { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; cursor: pointer; background: var(--card-2); }
.analysis-toggle .switch { width: 38px; height: 22px; border-radius: 11px; background: #c9c9c4; position: relative; transition: 0.2s; }
.analysis-toggle .switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: 0.2s; }
.analysis-toggle.open .switch { background: var(--primary); }
.analysis-toggle.open .switch::after { left: 18px; }
.analysis-body { margin-top: 12px; }
.sec-sub { font-size: 14px; font-weight: 600; margin: 14px 0 8px; color: var(--text-soft); }
.param-group { margin-bottom: 12px; }
.param-group-title { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.param-table { width: 100%; border-collapse: collapse; }
.param-table td { padding: 7px 2px; font-size: 13px; border-bottom: 1px solid var(--border); }
.param-table td:first-child { color: var(--muted); }
.param-table td:last-child { text-align: right; font-weight: 600; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.chart-block { background: var(--card-2); border-radius: 10px; padding: 10px 10px 6px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.chart-title { font-size: 12px; font-weight: 600; }
.chart-unit { font-size: 11px; color: var(--muted); }
.line-chart { width: 100%; display: block; }
.chart-axis { font-size: 8px; fill: var(--muted); }
.chart-foot { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ===== Home / Feed redesign (reference style) ===== */
.header-left { display: flex; align-items: center; gap: 10px; }
#header-avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 17px; cursor: pointer; overflow: hidden; }
.avatar { overflow: hidden; flex-shrink: 0; }
.avatar.feed-avatar { width: 44px; height: 44px; font-size: 20px; }
.avatar.rank-avatar { width: 36px; height: 36px; font-size: 16px; }
.avatar-lg { overflow: hidden; }

.home-tabs { display: flex; align-items: flex-end; gap: 22px; margin: 2px 2px 14px; }
.htab { background: none; border: none; font-size: 17px; color: var(--muted); font-weight: 500; padding: 4px 0 6px; position: relative; transition: .15s; }
.htab.active { font-size: 22px; font-weight: 800; color: var(--text); }
.htab.active::after { content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 16px; height: 3px; border-radius: 2px; background: var(--primary); }

.new-msg-chip { display: flex; justify-content: center; margin: 4px 0 14px; }
.new-msg-chip span { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 5px 14px; border-radius: 20px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.04); }

.feed-head { display: flex; justify-content: space-between; align-items: flex-start; }
.feed-head-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.feed-name { font-size: 16px; font-weight: 700; }
.feed-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.feed-icons { display: flex; gap: 4px; }
.feed-icon-btn { background: none; border: none; font-size: 17px; color: var(--muted); padding: 2px 4px; }

.ride-window { font-size: 15px; color: var(--text); margin: 12px 0 10px; }
.ride-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.r3-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.r3-val { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; white-space: nowrap; }
.r3-val span { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }

.act-row { display: flex; justify-content: space-around; align-items: center; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.act-btn { background: none; border: none; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px; }
.act-btn.liked { color: var(--primary); font-weight: 600; }
.act-btn:active { background: var(--card-2); }

.fab { position: fixed; right: 22px; bottom: 96px; width: 54px; height: 54px; border-radius: 50%; background: #111; color: #fff; font-size: 26px; border: none; box-shadow: 0 6px 18px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; z-index: 20; }
@media (min-width: 900px) { .fab { right: calc(50% - 300px); } }

/* Data tab */
.data-hero { background: linear-gradient(135deg,#ff8a3d,#ff5e00); color: #fff; border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 8px 20px rgba(255,94,0,.18); }
.dh-label { font-size: 12px; opacity: .85; }
.dh-val { font-size: 46px; font-weight: 800; line-height: 1.15; letter-spacing: -1px; }
.dh-val span { font-size: 15px; font-weight: 500; margin-left: 5px; opacity: .9; }
.dh-sub { font-size: 12px; opacity: .9; }
.dh-more { display: flex; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.25); font-size: 12px; opacity: .95; }
.data-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.data-cell { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.dc-val { font-size: 22px; font-weight: 800; }
.dc-val small { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.dc-label { font-size: 11px; color: var(--muted); margin-top: 3px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.card-title-row .card-title { margin-bottom: 0; }
.bar-chart svg { width: 100%; display: block; }
.hr-zones { display: flex; flex-direction: column; gap: 8px; }
.zone-row { display: grid; grid-template-columns: 58px 1fr 40px; align-items: center; gap: 8px; font-size: 12px; }
.zone-track { height: 10px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.zone-fill { height: 100%; border-radius: 6px; }
.zone-pct { text-align: right; color: var(--muted); }
.best-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.best-cell { background: var(--card-2); border-radius: 10px; padding: 10px; text-align: center; }
.bc-val { font-size: 20px; font-weight: 800; }
.bc-val small { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.bc-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.club-rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.club-rank-row:last-of-type { border-bottom: none; }
.cr-rank { font-size: 20px; width: 26px; }
.cr-info { flex: 1; }
.cr-name { font-size: 14px; font-weight: 600; }
.cr-sub { font-size: 11px; color: var(--muted); }
.cr-arrow { color: var(--muted); }

/* Radar */
.radar-card .radar-wrap { display: flex; justify-content: center; padding: 4px 0 0; }
.radar-svg { width: 100%; max-width: 280px; height: auto; }
.radar-label { font-size: 11px; fill: var(--text); font-weight: 600; }
.radar-label-val { font-size: 10px; fill: var(--muted); }
.radar-summary { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 12px; }
.radar-score { font-size: 30px; font-weight: 800; color: var(--primary); }
.radar-dims { display: flex; flex-direction: column; gap: 7px; }

/* Clubs */
.club-card { cursor: pointer; }
.club-head { display: flex; align-items: center; gap: 12px; }
.club-badge { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg,#ffb27a,#ff5e00); color: #fff; font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.club-badge.lg { width: 64px; height: 64px; font-size: 28px; border-radius: 16px; }
.club-info { flex: 1; min-width: 0; }
.club-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.club-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.club-week { text-align: right; }
.cw-val { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.cw-label { font-size: 10px; color: var(--muted); }
.club-top3 { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.top3-item { font-size: 11px; color: var(--muted); background: var(--card-2); border-radius: 12px; padding: 3px 9px; }
.club-hero { text-align: center; padding: 16px 0 4px; }
.club-hero .club-badge.lg { margin: 0 auto 10px; }
.club-hero h2 { font-size: 20px; }
.club-hero > p { font-size: 13px; margin: 4px 0; }
.club-meta { font-size: 12px; color: var(--muted); }
.club-actions { margin-top: 10px; }
.range-tabs { display: flex; gap: 8px; margin: 4px 0 12px; }
.range-tabs button { padding: 6px 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: 12px; }
.range-tabs button.active { border-color: var(--primary); color: var(--primary); background: rgba(255,94,0,.06); font-weight: 600; }
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-row.me { background: rgba(255,94,0,.05); border-radius: 8px; }
.rank-no { width: 26px; text-align: center; font-size: 15px; font-weight: 700; color: var(--muted); }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.rank-sub { font-size: 11px; color: var(--muted); }
.rank-dist { text-align: right; }
.rd-val { font-size: 18px; font-weight: 800; line-height: 1.1; }
.rd-label { font-size: 10px; color: var(--muted); }
.form-label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-2); font-size: 14px; color: var(--text); outline: none; }
.input:focus { border-color: var(--primary); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .top-nav { display: none; }
  .bottom-nav { display: flex; }
  .header-inner { padding: 0 14px; }
  .app-main { padding: 16px 14px 90px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dynamic-data { grid-template-columns: repeat(2, 1fr); }
  .chat-wrap { height: calc(100vh - 180px); }
  .section-title { font-size: 18px; }
}

/* ===== Segment / Health ===== */
.seg-search { padding: 0 0 10px; }
.seg-search input { width: 100%; padding: 10px 14px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 14px; outline: none; }
.seg-search input:focus { border-color: var(--primary); }
.sort-chips { display: flex; gap: 8px; margin: 4px 0 12px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text-soft); font-size: 13px; }
.chip.active { background: rgba(0,229,160,.12); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.seg-layout { display: flex; gap: 12px; align-items: flex-start; }
.seg-map-pane { flex: 0 0 40%; position: sticky; top: 0; padding: 0; overflow: hidden; }
.seg-map-pane .track-map { border-radius: var(--radius); }
.seg-map-pane .segmap svg { display: block; width: 100%; }
.seg-list { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.seg-item { display: flex; justify-content: space-between; gap: 10px; padding: 14px; cursor: pointer; transition: .15s; }
.seg-item:active { transform: scale(.99); }
.seg-item-name { font-weight: 700; font-size: 15px; }
.seg-item-sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.seg-star { color: var(--warn); font-weight: 700; }
.seg-item-near { font-size: 12px; color: var(--muted); margin-top: 2px; }
.seg-item-side { text-align: right; flex-shrink: 0; }
.seg-dist { font-size: 22px; font-weight: 800; color: var(--primary); }
.seg-dist .unit { font-size: 12px; color: var(--muted); margin-left: 2px; font-weight: 400; }
.seg-spark { width: 96px; height: 30px; margin-top: 4px; }
.seg-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.seg-title { font-size: 20px; margin-bottom: 2px; }
.fav-btn { font-size: 26px; line-height: 1; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-soft); transition: .15s; }
.fav-btn.active { border-color: var(--warn); background: rgba(245,158,11,.12); }
.rank-tabs { display: flex; gap: 8px; margin: 8px 0 12px; }
.rank-tab { flex: 1; padding: 8px 0; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-soft); font-size: 13px; }
.rank-tab.active { background: rgba(0,229,160,.12); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.rank-row:last-child { border-bottom: none; }
.rank-row.me { background: rgba(0,229,160,.06); border-radius: var(--radius-sm); padding: 10px 8px; }
.rank-no { width: 34px; text-align: center; font-weight: 700; color: var(--text-soft); flex-shrink: 0; }
.rank-nick { font-weight: 600; flex-shrink: 0; }
.rank-info { flex: 1; text-align: right; font-size: 12px; color: var(--muted); }
.rank-time { font-weight: 800; font-size: 15px; min-width: 56px; text-align: right; }
.mybest-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mybest-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.mybest-table td { padding: 9px 4px; border-bottom: 1px solid var(--border); }
.mybest-table tr:last-child td { border-bottom: none; }
.mb-elapsed { font-weight: 800; }
.mb-faster { color: var(--primary); font-weight: 700; }
.mb-slower { color: var(--danger); font-weight: 700; }
.seg-origin { margin-top: 10px; text-align: center; color: var(--primary); font-size: 13px; cursor: pointer; padding: 8px; border-radius: var(--radius-sm); background: var(--bg-soft); }
.seg-effort-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.seg-effort-row:last-child { border-bottom: none; }
.se-name { font-weight: 700; font-size: 14px; }
.se-rank { color: var(--warn); margin-right: 4px; }
.se-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.se-nums { text-align: right; flex-shrink: 0; }
.se-elapsed { display: block; font-weight: 800; font-size: 16px; }
.se-mini { font-size: 11px; color: var(--muted); }
.hsrc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hsrc-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); font-size: 13px; }
.hsrc-chip.bound { border-color: var(--primary); }
.btn-xs { padding: 3px 10px; font-size: 12px; border-radius: 999px; }
.src-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.dim-detail { font-size: 11px; color: var(--muted); margin: -4px 0 8px 80px; }
.bar-warn { background: var(--warn) !important; }
@media (max-width: 640px) {
  .seg-layout { flex-direction: column; }
  .seg-map-pane { position: static; flex: none; width: 100%; }
  .mybest-table { font-size: 12px; }
}

/* ===== Share Poster Studio ===== */
.poster-stage { border-radius: 16px; overflow: hidden; background: #000; margin-bottom: 4px; }
.poster-stage canvas { display: block; width: 100%; height: auto; }
.pc-label { font-size: 12px; color: var(--muted); margin: 16px 0 8px; }
.bg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bg-chip {
  position: relative; width: 62px; height: 44px; border-radius: 10px; border: 2px solid transparent;
  cursor: pointer; padding: 0; overflow: hidden; color: #fff; font-size: 11px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.bg-chip span { padding: 1px 5px; border-radius: 6px; background: rgba(0,0,0,.35); }
.bg-chip.active { border-color: var(--primary); }
.bg-upload { width: auto; padding: 0 12px; gap: 4px; background: var(--card-2); color: var(--text); border: 1px dashed var(--border); }
.bg-upload.active { border-color: var(--primary); color: var(--primary); }
.poster-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.hs-ic { display: inline-flex; }

/* ===== 扁平图标统一细节（2026-11 界面优化） ===== */
.new-msg-chip span .ic-svg { color: var(--primary); vertical-align: -2px; }
.cr-rank { display: flex; align-items: center; }
.cr-rank.r1 { color: #e6a817; }
.cr-rank.r2 { color: #9aa5b1; }
.cr-rank.r3 { color: #b08355; }
.se-medal { display: inline-flex; vertical-align: -2px; margin-right: 2px; }
.se-medal.m1 { color: #e6a817; }
.se-medal.m2 { color: #9aa5b1; }
.se-medal.m3 { color: #b08355; }
.seg-star { display: inline-flex; align-items: center; gap: 2px; }
.map-badge { display: inline-flex; align-items: center; gap: 3px; }
.achv-icon { color: #b97f1f; display: flex; align-items: center; font-size: 0; }
.card h4 .ic-svg { vertical-align: -2px; margin-right: 3px; color: var(--primary); }
.fab .ic-svg { display: block; }
.menu-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--card, #fff); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; cursor: pointer; }

/* ===== 真实地图（Leaflet + 高德瓦片） ===== */
.leaflet-map { position: relative; z-index: 0; width: 100%; height: 300px; border-radius: 12px; overflow: hidden; background: #eef0ea; margin: 10px 0 6px; }
.leaflet-map .map-loading { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: #eef0ea; }
.leaflet-map .leaflet-container { font: inherit; background: #eef0ea; }
.leaflet-map.card-map { height: 190px; margin: 10px 0 0; border-radius: 10px; }
.leaflet-map.card-map .leaflet-control-attribution { display: none; }
.map-fit-btn { width: 34px; height: 34px; padding: 0; border: none; border-radius: 8px; background: #fff; color: #333; font-size: 17px; line-height: 34px; text-align: center; box-shadow: 0 1px 5px rgba(0,0,0,.3); cursor: pointer; }
.map-fit-btn:active { background: #eee; }
.leaflet-control-attribution { font-size: 10px; }

/* ===== 开屏 / 浮窗广告（后台配置） ===== */
.splash-ad{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.86);display:flex;align-items:center;justify-content:center;padding:20px;animation:fadeIn .25s}
.splash-ad.hide{opacity:0;transition:opacity .25s}
.splash-ad-inner{position:relative;width:100%;max-width:360px;border-radius:18px;overflow:hidden;background:var(--card)}
.splash-ad-inner img{width:100%;display:block;max-height:70vh;object-fit:cover}
.splash-ad-textonly{height:280px;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:13px}
.splash-ad-close{position:absolute;top:10px;right:10px;width:32px;height:32px;border-radius:50%;background:rgba(0,0,0,.5);color:#fff;display:flex;align-items:center;justify-content:center}
.splash-ad-foot{padding:16px 18px 20px;background:var(--card)}
.splash-ad-title{font-size:16px;font-weight:700;color:var(--text);margin-bottom:12px}
.splash-ad-btn{display:block;text-align:center;padding:11px;border-radius:10px;background:var(--primary);color:#06231b;font-weight:700;font-size:14px}
.float-ad{position:fixed;right:14px;bottom:86px;width:190px;z-index:900;background:var(--card);border:1px solid var(--border);border-radius:14px;overflow:hidden;box-shadow:0 10px 30px rgba(0,0,0,.45);animation:slideUp .3s}
.float-ad img{width:100%;height:96px;object-fit:cover;display:block}
.float-ad-body{padding:10px 12px 12px}
.float-ad-title{font-size:12.5px;font-weight:600;margin-bottom:8px;line-height:1.4;color:var(--text)}
.float-ad-btn{display:inline-block;padding:5px 12px;border-radius:16px;background:rgba(0,229,160,.14);color:var(--primary);font-size:12px;font-weight:700}
.float-ad-close{position:absolute;top:6px;right:6px;width:22px;height:22px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;display:flex;align-items:center;justify-content:center}

/* ===== AI 额度条 ===== */
.ai-quota{margin-bottom:12px}
.aq-txt{font-size:12px;color:var(--muted)}
.aq-row{display:flex;justify-content:space-between;font-size:12px;color:var(--text-soft);margin-bottom:6px}
.aq-bar{height:6px;background:var(--bg-soft);border-radius:3px;overflow:hidden}
.aq-bar i{display:block;height:100%;background:var(--primary);border-radius:3px}
.aq-bar i.hot{background:var(--danger)}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes slideUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

/* ===== 平台数据传输 ===== */
.tf-tabs{display:flex;gap:8px;margin-bottom:12px;overflow-x:auto}
.tf-tab{flex:1;min-width:120px;display:flex;flex-direction:column;align-items:center;gap:2px;padding:10px 8px;border-radius:12px;border:1px solid var(--border);background:var(--bg-soft);color:var(--muted);font-size:13px;font-weight:600;cursor:pointer}
.tf-tab em{font-style:normal;font-size:11px;font-weight:400;color:var(--muted)}
.tf-tab.active{border-color:rgba(0,229,160,.55);background:rgba(0,229,160,.10);color:var(--text)}
.tf-tab.active em{color:var(--primary)}
.tf-auto-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.tf-auto-row select,.auto-int{background:var(--bg-soft);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:5px 8px;font-size:12px;outline:none}
.auto-int{padding:4px 6px}
.tf-flow{display:flex;align-items:center;justify-content:center;gap:12px;padding:6px 0}
.tf-node{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:12px 8px;border-radius:12px;background:var(--bg-soft);border:1px solid var(--border)}
.tf-node strong{font-size:14px;color:var(--muted)}
.tf-node.ok{border-color:rgba(0,229,160,.45);background:rgba(0,229,160,.08)}
.tf-node.ok strong{color:var(--text)}
.tf-arrow{color:var(--primary);display:flex;align-items:center}
.tf-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border);cursor:pointer}
.tf-row:last-of-type{border-bottom:none}
.tf-row input[type=checkbox]{width:16px;height:16px;accent-color:var(--primary);flex-shrink:0}
.tf-row input[type=checkbox]:disabled{opacity:.35}
.tf-row-main{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.tf-row-main b{font-size:13.5px;font-weight:600;color:var(--text)}
.tf-row-main em{font-style:normal;color:var(--muted);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
