/* =========================================================
   玩家档案 — 全新视觉
   深色仪表盘 / 明暗双主题 / 左资料栏 + 右内容区
   ========================================================= */

:root {
  --radius: 18px;
  --radius-sm: 12px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root[data-theme="dark"] {
  --bg: #070a10;
  --bg-2: #0b1018;
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.07);
  --solid: #0e141d;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #e9eef7;
  --ink-2: #a9b5c7;
  --dim: #77828f;
  --accent: #7dd3fc;
  --accent-soft: rgba(125, 211, 252, 0.13);
  --accent-ink: #041d2b;
  --accent-2: #a78bfa;
  --good: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  --glow: 0 0 0 1px rgba(125, 211, 252, 0.18), 0 18px 50px -20px rgba(125, 211, 252, 0.35);
}

:root[data-theme="light"] {
  --bg: #f3f6fa;
  --bg-2: #eaeff7;
  --card: #ffffff;
  --card-2: #f7f9fc;
  --solid: #ffffff;
  --line: #e3e9f1;
  --line-2: #cdd7e4;
  --ink: #0f1722;
  --ink-2: #46566b;
  --dim: #6d7c8e;
  --accent: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.1);
  --accent-ink: #ffffff;
  --accent-2: #7c3aed;
  --good: #059669;
  --warn: #b45309;
  --danger: #e11d48;
  --shadow: 0 24px 60px rgba(17, 35, 58, 0.12);
  --glow: 0 0 0 1px rgba(2, 132, 199, 0.14), 0 16px 40px -22px rgba(2, 132, 199, 0.4);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

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

/* ---------------- 背景光晕 ---------------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aurora .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}

.orb-1 {
  width: 560px; height: 560px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.5), transparent 68%);
}

.orb-2 {
  width: 520px; height: 520px;
  top: 120px; right: -160px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.42), transparent 68%);
}

.orb-3 {
  width: 620px; height: 620px;
  bottom: -280px; left: 38%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.24), transparent 70%);
}

:root[data-theme="light"] .aurora .orb { opacity: 0.45; }

.aurora .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(127, 160, 200, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 160, 200, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

body.has-result .topbar { border-bottom-color: var(--line); }

.brand { display: inline-flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.brand-mark svg { width: 17px; height: 17px; }
.brand-mark.sm { width: 24px; height: 24px; border-radius: 7px; }
.brand-mark.sm svg { width: 14px; height: 14px; }

.brand-text {
  display: flex; flex-direction: column; line-height: 1.15;
  font-weight: 600; font-size: 14.5px; letter-spacing: 0.01em;
}

.brand-text em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

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

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.icon-btn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.icon-btn svg { width: 17px; height: 17px; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

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

.intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 96px) 24px clamp(40px, 7vh, 80px);
  text-align: center;
}

body.has-result .intro { display: none; }

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}

.intro h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 700;
  background: linear-gradient(180deg, var(--ink) 30%, color-mix(in srgb, var(--ink) 62%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0 auto 34px;
  max-width: 460px;
  color: var(--dim);
  font-size: 14.5px;
}

.lookup {
  display: flex;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}

.lookup-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 56px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.lookup-field:focus-within {
  border-color: var(--accent);
  background: var(--card-2);
  box-shadow: var(--glow);
}

.lookup-tag {
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.lookup-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  letter-spacing: 0.02em;
  font-family: var(--mono);
}

.lookup-field input::placeholder { color: var(--dim); font-family: var(--font); letter-spacing: 0; }

.lookup-kbd {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.go {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--accent-2)));
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 34px -16px color-mix(in srgb, var(--accent) 90%, transparent);
  transition: transform 0.15s var(--ease), filter 0.2s, box-shadow 0.2s;
}

.go svg { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.go:hover { filter: brightness(1.06); }
.go:hover svg { transform: translateX(3px); }
.go:active { transform: translateY(1px); }
.go:disabled { filter: grayscale(0.6) brightness(0.9); cursor: progress; box-shadow: none; }
.go.is-loading svg { animation: spin 0.9s linear infinite; }

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

.quick, .recent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.quick-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.quick-chip {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.quick-chip:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
}

.recent[hidden] { display: none; }
.recent-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------- 吸顶查询条 ---------------- */

.dock {
  position: sticky;
  top: 62px;
  z-index: 30;
  display: none;
  padding: 10px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

body.has-result .dock { display: block; }

.dock-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.dock-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.dock-form {
  flex: 1;
  display: flex;
  gap: 8px;
  max-width: 420px;
}

.dock-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  outline: none;
  font-family: var(--mono);
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.dock-form button {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.dock-form button:hover { filter: brightness(1.06); }

.dock-home {
  margin-left: auto;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
}

.dock-home:hover { color: var(--ink); border-color: var(--line-2); }

/* ---------------- 主舞台 ---------------- */

body:not(.has-result) .stage { display: none; }

.stage {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 60px;
}

.layout {
  display: grid;
  grid-template-columns: 322px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  animation: rise 0.45s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 左：资料卡 ---------------- */

.profile {
  position: sticky;
  top: 132px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.avatar-frame {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card-2);
  border: 1px solid var(--line-2);
}

.avatar-frame::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-top-color: var(--accent);
  transform: rotate(-25deg);
  animation: ring 9s linear infinite;
}

@keyframes ring { to { transform: rotate(335deg); } }

@media (prefers-reduced-motion: reduce) {
  .avatar-frame::after { animation: none; }
}

.lv-badge {
  position: absolute;
  right: -10px;
  bottom: -2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--solid);
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  white-space: nowrap;
}

.p-name {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.uid-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.uid-btn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.uid-btn svg { width: 12px; height: 12px; }

.motto {
  margin: 12px 0 16px;
  padding: 10px 12px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.triple div {
  padding: 10px 6px;
  background: var(--solid);
  text-align: center;
}

.triple b {
  display: block;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.triple span { font-size: 11px; color: var(--dim); }

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
}

.facts div { min-width: 0; }
.facts dt { font-size: 11px; color: var(--dim); letter-spacing: 0.02em; }
.facts dd {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facts dd.hot { color: var(--accent); }

.more {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.more summary {
  list-style: none;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--dim);
  text-align: center;
  user-select: none;
}

.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: " ▾"; font-size: 10px; }
.more[open] summary::after { content: " ▴"; }
.more summary:hover { color: var(--accent); }

.more-grid { display: grid; gap: 10px; margin-top: 12px; }

.mini-card {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card) 60%, transparent);
}

.mini-card h4 {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.mini-card dl { margin: 0; display: grid; gap: 4px; }
.mini-card dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.mini-card dt { color: var(--dim); }
.mini-card dd { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------- 右：内容面板 ---------------- */

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.tab .n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.tab:hover { color: var(--ink); background: var(--card-2); }

.tab[aria-selected="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.tab[aria-selected="true"] .n { color: var(--accent); opacity: 0.8; }

.panel-body { padding: 18px; min-height: 200px; }

.panel-body > * { animation: fade 0.28s var(--ease) both; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 作品网格 */
.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}

.work {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--solid) 70%, transparent);
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.work:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 18px 36px -24px rgba(0, 0, 0, 0.7), 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.work-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 20% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--card-2);
}

.work-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.work:hover .work-cover img { transform: scale(1.05); }

.work-emoji {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  opacity: 0.7;
}

.work-kind {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(6, 12, 20, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eaf3ff;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

.work-kind.mod { border-color: rgba(251, 191, 36, 0.5); color: #fde68a; }

.work-meta { padding: 10px 12px 12px; }

.work-name {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
}

.work-stats span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.work-stats span:last-child { color: color-mix(in srgb, var(--dim) 78%, transparent); }
.work-stats svg { width: 12px; height: 12px; opacity: 0.75; flex: none; }

/* 动态 */
.posts { display: grid; gap: 12px; }

.post {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--solid) 55%, transparent);
}

.post-text { margin: 0 0 10px; font-size: 14px; white-space: pre-wrap; line-height: 1.75; }

.post-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

.post-foot .loc { color: var(--accent); }

/* 简项列表 */
.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 10px;
}

.item {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--solid) 40%, transparent);
  transition: border-color 0.2s, background 0.2s;
}

.item:hover { border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); background: var(--card-2); }

.item-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.item-meta { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.item-meta + .item-meta { margin-top: 2px; }

.more-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.more-btn {
  padding: 7px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
}

.more-btn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* 空态 / 骨架 */
.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

.empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  color: var(--dim);
  font-size: 18px;
}

.skeleton-layout {
  display: grid;
  grid-template-columns: 322px minmax(0, 1fr);
  gap: 20px;
}

.sk {
  border-radius: 12px;
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--card) 70%, transparent) 20%,
    color-mix(in srgb, var(--card-2) 90%, transparent) 40%,
    color-mix(in srgb, var(--card) 70%, transparent) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer { to { background-position: -220% 0; } }

.sk-profile { height: 430px; border-radius: var(--radius); }
.sk-panel { height: 430px; border-radius: var(--radius); }

/* 错误 */
.error-card {
  max-width: 520px;
  margin: 40px auto;
  padding: 26px 24px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 7%, var(--card));
  text-align: center;
}

.error-card .err-icon {
  width: 44px; height: 44px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
  font-size: 20px;
}

.error-card h3 { margin: 0 0 6px; font-size: 16px; }
.error-card p { margin: 0 0 16px; color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }

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

.btn-line {
  padding: 8px 18px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}

.btn-line:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

/* ---------------- 详情弹窗 ---------------- */

.detail {
  width: min(900px, 92vw);
  max-height: 88vh;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--solid);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail[open] {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  animation: pop 0.28s var(--ease) both;
}

@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.985); } }

.detail::backdrop {
  background: rgba(3, 6, 11, 0.7);
  backdrop-filter: blur(6px);
}

.detail-x {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(8, 12, 18, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.detail-x svg { width: 15px; height: 15px; }
.detail-x:hover { background: rgba(8, 12, 18, 0.8); }

.detail-media {
  position: relative;
  background: #0a0f16;
  min-height: 340px;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.detail-media img[hidden] { display: none; }

.media-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.media-empty[hidden] { display: none; }

.detail-info {
  padding: 24px 24px 22px;
  overflow-y: auto;
  max-height: 88vh;
}

.detail-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

.chip {
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  font-size: 11px;
}

.chip.mod {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn);
}

.detail-date { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.detail-title {
  margin: 0 0 12px;
  font-size: 21px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-stats span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}

.detail-h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.detail-desc {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.gallery:empty { display: none; }

.gallery img {
  width: 100%;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.gallery img:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ---------------- 页脚 / 提示 ---------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px 34px;
  color: var(--dim);
  font-size: 11.5px;
}

.foot-dot { opacity: 0.5; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 60;
  transform: translate(-50%, 16px);
  padding: 9px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--solid);
  color: var(--ink);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s var(--ease);
}

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

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

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .profile { position: static; }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .skeleton-layout { grid-template-columns: minmax(0, 1fr); }
  .sk-profile { height: 260px; }
  .detail[open] { grid-template-columns: minmax(0, 1fr); }
  .detail-media { min-height: 200px; max-height: 260px; }
  .detail-info { max-height: none; }
  .detail { max-height: 90vh; overflow-y: auto; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .intro { padding-top: 44px; }
  .intro h1 { font-size: 30px; }
  .lookup { flex-direction: column; }
  .go { width: 100%; height: 50px; }
  .lookup-field { height: 50px; }
  .dock { top: 62px; padding: 8px 12px; }
  .dock-brand { display: none; }
  .dock-form { max-width: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .works { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .panel-body { padding: 14px; }
  .tabs { padding: 8px; }
  .detail-info { padding: 18px 16px; }
  .foot { padding-bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------- 接口文档页 ---------------- */

.doc-page { display: block; }

.doc-back {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all 0.2s var(--ease);
}

.doc-back:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.doc-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(40px, 7vh, 76px) 22px 40px;
}

.doc-h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.6vw, 42px);
  letter-spacing: -0.02em;
}

.doc-lede {
  margin: 0 0 30px;
  max-width: 620px;
  color: var(--dim);
  font-size: 14.5px;
  line-height: 1.8;
}

.doc-card {
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(6px);
}

.doc-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 14px;
}

.doc-endpoint code { color: var(--ink); }

.method {
  padding: 2px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--good) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--good) 40%, transparent);
  color: var(--good);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.doc-h2 {
  margin: 4px 0 12px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.doc-h2 + .doc-pre { margin-top: 0; }

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

.doc-table th,
.doc-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc-table th { color: var(--dim); font-weight: 600; font-size: 11.5px; letter-spacing: 0.06em; }
.doc-table td { color: var(--ink-2); }
.doc-table tr:last-child td { border-bottom: 0; }

.doc-table code,
.doc-tip code,
.doc-list code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

.doc-pre {
  margin: 0 0 14px;
  padding: 14px 16px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, #000 22%, var(--solid));
  color: #cfe3f5;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
}

:root[data-theme="light"] .doc-pre { background: #0f1723; color: #d6e6f5; }

.doc-tip {
  margin-top: 10px;
  padding: 9px 12px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

.doc-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.9; }
.doc-list li { margin-bottom: 4px; }

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

.try-row input[type="text"] {
  flex: 1;
  min-width: 180px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.try-row input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.try-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  user-select: none;
  cursor: pointer;
}

.try-row button {
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s;
}

.try-row button:hover { filter: brightness(1.06); }

.foot a { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
.foot a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .doc-wrap { padding: 28px 16px 30px; }
  .doc-card { padding: 16px; }
  .doc-table { display: block; overflow-x: auto; white-space: nowrap; }
  .try-row button { width: 100%; }
}

/* ---------------- 顶部导航 ---------------- */

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  margin-right: auto;
}

.topnav a {
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s;
}

.topnav a:hover { color: var(--ink); background: var(--card-2); }

.topnav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 760px) {
  .topnav { margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 6px 8px; font-size: 12.5px; }
}

@media (max-width: 560px) {
  .brand-text em { display: none; }
  .topnav a { padding: 6px 7px; }
}

/* ---------------- 主页门户 ---------------- */

.home {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 88px) clamp(16px, 4vw, 34px) 40px;
}

.home-hero { max-width: 720px; }

.home-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5.6vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--ink) 30%, color-mix(in srgb, var(--ink) 60%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-lede {
  margin: 0 0 26px;
  max-width: 560px;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.85;
}

.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 16px 0 26px;
  border-bottom: 1px solid var(--line);
}

.home-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.home-stats span { font-size: 12px; color: var(--dim); }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 16px;
  margin: 28px 0 26px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 20px 40px -28px rgba(0, 0, 0, 0.8);
}

.tool-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.tool-icon svg { width: 20px; height: 20px; }

.tool-card h2 { margin: 0 0 6px; font-size: 16px; }

.tool-card p {
  margin: 0 0 14px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.75;
}

.tool-go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}

.tool-go i { font-style: normal; transition: transform 0.2s var(--ease); }
.tool-card:hover .tool-go i { transform: translateX(4px); }

.home-note {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.home-note h3 { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.home-note p { margin: 0; color: var(--dim); font-size: 13px; line-height: 1.85; }

/* ---------------- ID 查询页 ---------------- */

.ids-page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(30px, 6vh, 60px) clamp(16px, 4vw, 34px) 40px;
}

.ids-head { margin-bottom: 22px; }
.ids-head h1 { margin: 0 0 8px; font-size: clamp(26px, 4.2vw, 36px); letter-spacing: -0.01em; }

.ids-lede { margin: 0; color: var(--dim); font-size: 14px; max-width: 620px; }

.ids-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.ids-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.ids-tabs::-webkit-scrollbar { display: none; }

.ids-tab {
  flex: none;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}

.ids-tab:hover { color: var(--ink); background: var(--card-2); }

.ids-tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.ids-tab.is-loading { color: var(--dim); }

.ids-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 16px 10px;
}

.ids-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.ids-search svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--dim);
  pointer-events: none;
}

.ids-search input {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 36px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.ids-search input::-webkit-search-cancel-button { display: none; }
.ids-search input::placeholder { color: var(--dim); }

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

.ids-clear {
  position: absolute;
  right: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.ids-clear[hidden] { display: none; }

.ids-modes {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}

.ids-modes button {
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.ids-modes button.is-active {
  background: var(--solid);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.ids-meta {
  padding: 0 16px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}

.ids-list { border-top: 1px solid var(--line); }

.ids-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 9px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.ids-row:hover { background: var(--card-2); }
.ids-row:last-child { border-bottom: 0; }

.ids-id {
  flex: none;
  min-width: 74px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ids-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ids-copy-ico { flex: none; color: var(--dim); opacity: 0; transition: opacity 0.15s; }
.ids-row:hover .ids-copy-ico { opacity: 1; }

.ids-row.is-skeleton {
  height: 41px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg, var(--card) 20%, var(--card-2) 40%, var(--card) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
  cursor: default;
}

.ids-empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

.ids-empty-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  font-size: 17px;
}

.ids-retry {
  margin-top: 12px;
  padding: 6px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
}

.ids-retry:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.ids-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

.ids-pager[hidden] { display: none; }

.ids-pager button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.ids-pager button:hover:not(:disabled) { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ids-pager button:disabled { opacity: 0.4; cursor: not-allowed; }

mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--warn) 42%, transparent);
  color: inherit;
}

@media (max-width: 560px) {
  .ids-bar { padding: 12px 12px 8px; }
  .ids-modes { width: 100%; justify-content: space-between; }
  .ids-modes button { flex: 1; }
  .ids-row { padding: 9px 12px; gap: 10px; }
  .ids-id { min-width: 62px; }
}
