/* PTCG 数据中心 · demo 样式
   取色/圆角/间距对齐上游站点（#0d1117 底 + #161b22 卡片 + #58a6ff 强调），
   移动端优先，桌面宽度上限 900px。 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0d1117; --card: #161b22; --border: #30363d; --border2: #21262d;
  --text: #c9d1d9; --bright: #f0f6fc; --muted: #8b949e; --accent: #58a6ff;
  --gold: #ffd700; --silver: #c0c0c0; --bronze: #cd7f32;
  --green: #3fb950; --red: #f85149; --orange: #d29922;
}
html, body { overflow-x: hidden; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
#app { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 12px 90px; }
.card, .act-card, .stat, .board-row { overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; }
.shopbar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  color: var(--muted); font-size: .74em; padding: 10px 2px 2px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 36px 12px; font-size: .88em; }
.muted { color: var(--muted); font-size: .8em; }
.clickable { cursor: pointer; }
.clickable:hover { color: var(--accent); }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 12px 4px; background: rgba(13, 17, 23, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border2);
}
.topbar .back { background: none; border: none; color: var(--muted); font-size: 1.1em; cursor: pointer; padding: 4px 6px; }
.topbar .title { flex: 1; min-width: 0; color: var(--bright); font-weight: 700; font-size: 1em; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .side { width: 30px; }

/* 首页 */
.hero { text-align: center; padding: 40px 16px 22px; border-bottom: 1px solid var(--border2); margin-bottom: 4px; }
.hero h1 { font-size: 1.7em; color: var(--bright); letter-spacing: .5px; }
.hero p { color: var(--muted); font-size: .86em; margin-top: 6px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; padding: 16px 0; }
.store-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px;
  text-align: center; cursor: pointer; transition: .18s; }
.store-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(88,166,255,.14); }
.store-card .logo { font-size: 2em; line-height: 1; }
.store-card .name { color: var(--bright); font-weight: 700; margin: 10px 0 6px; }
.store-card .meta { color: var(--muted); font-size: .8em; line-height: 1.7; }
.store-card .meta b { color: var(--accent); }

/* 通用卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.card h3 { color: var(--bright); font-size: .95em; margin-bottom: 8px; font-weight: 700; }

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 6px; text-align: center; }
.stat .val { font-size: 1.2em; color: var(--accent); font-weight: 700; }
.stat .lbl { font-size: .7em; color: var(--muted); margin-top: 2px; }

/* 过滤器 */
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters select, .filters input {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: 8px; font-size: 16px; flex: 1; min-width: 100px;
}
.filters select:focus, .filters input:focus { outline: none; border-color: var(--accent); }

/* 活动卡 */
.act-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  margin-bottom: 10px; cursor: pointer; transition: border-color .15s; }
.act-card:hover { border-color: var(--accent); }
.act-card h3 { color: var(--bright); font-size: .95em; line-height: 1.5; margin-bottom: 4px; }
.act-card .meta { color: var(--muted); font-size: .78em; }
.champion { margin-top: 8px; padding: 7px 10px; background: var(--bg); border-left: 3px solid var(--gold);
  border-radius: 6px; font-size: .85em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 段位徽章 */
.tier { display: inline-flex; align-items: center; gap: 4px; font-size: .78em; white-space: nowrap; }
.tier .ico { font-size: 1em; line-height: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 18px; font-weight: 700; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: .85em; }
th { color: var(--muted); text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border);
  font-weight: 500; white-space: nowrap; }
td { padding: 8px 6px; border-bottom: 1px solid var(--border2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.rank-badge { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center;
  border-radius: 50%; font-weight: 700; font-size: .75em; background: var(--border2); color: var(--muted); }
.r1 { background: var(--gold); color: #000; } .r2 { background: var(--silver); color: #000; }
.r3 { background: var(--bronze); color: #000; }
.win { color: var(--gold); font-weight: 700; }
.pin { font-family: ui-monospace, Menlo, monospace; font-size: .72em; color: var(--muted); }

/* 榜单 */
.board-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.board-row:hover { border-color: var(--accent); }
.board-row .pos { width: 26px; text-align: center; color: var(--muted); font-weight: 700; font-size: .85em; }
.board-row .who { flex: 1; min-width: 0; }
.board-row .nm { color: var(--bright); font-weight: 600; font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-row .sub { color: var(--muted); font-size: .72em; margin-top: 2px; }
.board-row .score { text-align: right; }
.board-row .score b { color: var(--bright); font-size: 1.05em; }
.board-row .score span { display: block; color: var(--muted); font-size: .68em; }

/* tab 胶囊 */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; padding: 3px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; }
.tabs .tab { flex: 1; text-align: center; padding: 9px 4px; border-radius: 10px; cursor: pointer;
  font-size: .86em; font-weight: 700; color: var(--muted); border: 1px solid transparent; }
.tabs .tab.active { background: rgba(88, 166, 255, .2); color: var(--bright); border-color: rgba(88, 166, 255, .4); }

/* 玩家页 */
.hero-player { border-radius: 14px; padding: 12px 16px 16px; margin-bottom: 12px; text-align: center;
  border: 1px solid var(--border); background: linear-gradient(135deg, #1c2333, #0d1117 58%); }
.hero-player .nm { font-size: 1.7em; color: var(--bright); font-weight: 700; line-height: 1.3; }
.hero-player .progress { max-width: 240px; margin: 10px auto 0; background: var(--border2);
  border-radius: 4px; height: 16px; overflow: hidden; position: relative; }
.hero-player .progress > i { display: block; height: 100%; border-radius: 4px; }
.hero-player .progress > span { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: .72em; color: #fff; text-shadow: 0 0 3px #000; }
.wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wall .cell { position: relative; border-radius: 8px; padding: 10px 8px; text-align: center; border: 1px solid; }
.wall .cell .rarity { position: absolute; top: 3px; left: 5px; font-size: .6em; font-weight: 700;
  border-radius: 999px; padding: 1px 6px; }
.wall .cell .ico { font-size: 1.25em; }
.wall .cell .label { font-weight: 700; font-size: .85em; margin-top: 2px; }
.wall .cell .desc { color: var(--muted); font-size: .68em; margin-top: 3px; }

.log-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border2); font-size: .8em; }
.log-row:last-child { border-bottom: none; }
.log-row .d { color: var(--muted); width: 74px; flex: none; font-family: ui-monospace, Menlo, monospace; font-size: .9em; }
.log-row .opp { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-row .delta { width: 52px; text-align: right; font-weight: 700; }
.up { color: var(--green); } .down { color: var(--red); }

/* PK */
.pk-versus { display: flex; align-items: stretch; gap: 8px; margin-bottom: 12px; }
.pk-side { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 10px; text-align: center; }
.pk-side .nm { color: var(--bright); font-weight: 700; }
.pk-side .num { font-size: 1.8em; font-weight: 700; color: var(--accent); }
.pk-vs { align-self: center; color: var(--muted); font-weight: 700; font-size: .8em; }
.meet { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border2); font-size: .82em; }
.meet:last-child { border-bottom: none; }

/* 底部导航 */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; display: flex;
  background: var(--card); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .35);
  padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav .nav-item { flex: 1; text-align: center; padding: 9px 4px 7px; color: var(--muted);
  font-size: .68em; cursor: pointer; }
.bottom-nav .nav-item .ico { display: block; font-size: 1.25em; margin-bottom: 1px; }
.bottom-nav .nav-item.active { color: var(--accent); }

/* toast */
#toastHost { position: fixed; left: 0; right: 0; bottom: 74px; display: flex; flex-direction: column;
  align-items: center; gap: 8px; z-index: 10050; pointer-events: none; }
.toast { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px;
  font-size: .85em; box-shadow: 0 4px 16px rgba(0, 0, 0, .45); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== 登录 / 我的 / 运营 ===== */
.auth-wrap { max-width: 440px; margin: 16px auto; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: .74em; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--accent); }
.btn {
  display: block; width: 100%; background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 8px; font-size: .9em;
  cursor: pointer; font-family: inherit;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.99); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn.tiny { display: inline-block; width: auto; padding: 5px 10px; font-size: .74em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--border);
  border-radius: 24px; transition: .2s;
}
.switch .slider:before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: var(--muted); border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: rgba(88,166,255,.45); }
.switch input:checked + .slider:before { transform: translateX(20px); background: var(--accent); }

.me-hero {
  text-align: center; padding: 22px 16px; border-radius: 14px; margin-bottom: 12px;
  border: 1px solid var(--border); background: linear-gradient(135deg, #1c2333, #0d1117 58%);
}
.me-name { font-size: 1.8em; font-weight: 700; color: var(--bright); line-height: 1.3; }

.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border2); }
.user-row:last-child { border-bottom: none; }
.user-row .who { flex: 1; min-width: 0; }
.user-row .nm { color: var(--bright); font-weight: 600; font-size: .9em; }
.user-row .sub { color: var(--muted); font-size: .72em; margin-top: 2px; }
.user-row .acts { display: flex; gap: 6px; flex: none; }
.tag-warn { background: rgba(248,81,73,.15); color: var(--red); border: 1px solid var(--red);
  border-radius: 999px; padding: 1px 7px; font-size: .65em; font-weight: 400; }


/* ===== 店铺品牌 ===== */
.store-logo { width: 180px; height: auto; max-height: 86px; border-radius: 12px; background: #fff;
  object-fit: contain; padding: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.shop-brand { display: flex; align-items: center; gap: 12px; padding: 14px 4px 4px; }
.shop-brand img { width: 96px; height: 46px; border-radius: 8px; background: #fff;
  object-fit: contain; padding: 3px; flex: none; }
.shop-brand-name { color: var(--bright); font-weight: 700; font-size: 1.08em; }
.shop-brand-sub { color: var(--muted); font-size: .72em; margin-top: 2px; }
