:root {
  --bg: #ffffff;
  --side: #f6f6f5;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --hair: #eeeeee;
  --soft: #f3f3f2;
  --active: #eaeae8;
  --ok: #1f9d55;
  --rest: #b5b5b5;
  --bad: #b42318;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 骨架 ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  flex: 0 0 244px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--side);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.main { flex: 1; min-width: 0; padding: 72px clamp(20px, 4vw, 48px) 64px; }
.col { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.col.wide { max-width: 960px; gap: 36px; }
.col.mid { max-width: 760px; gap: 36px; }
.col.text { max-width: 720px; gap: 36px; }
.col.narrow { max-width: 560px; gap: 36px; }

/* ---------- 侧栏 ---------- */
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; font-size: 16px; font-weight: 600; }
.brand i { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; }
.nav a:hover, .recent a:hover, .account a:hover { background: rgba(0, 0, 0, 0.04); }
.nav a.on { background: var(--active); font-weight: 600; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.recent { display: flex; flex-direction: column; gap: 2px; }
.label { font-size: 14px; font-weight: 500; color: var(--muted); }
.recent .label { padding: 0 12px 6px; font-size: 13px; }
.recent a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; }
.recent a span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent a span:last-child { flex: none; font-size: 12px; color: var(--muted); }
.account { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.account a, .account button.who {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; border-radius: 12px;
  border: 0; background: transparent; text-align: left; width: 100%;
}
.account button.who:hover { background: rgba(0, 0, 0, 0.04); }
.badge { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.account .lines { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.account .lines b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account .lines small { font-size: 12px; color: var(--muted); }
.link { border: 0; background: transparent; padding: 6px 12px; font-size: 12px; color: var(--muted); text-align: left; }
.link:hover { color: var(--ink); }

/* ---------- 文字 ---------- */
.title { font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.lead { font-size: 16px; color: var(--muted); }
.head { display: flex; flex-direction: column; gap: 8px; }
.head.center { text-align: center; }
.muted { color: var(--muted); }
.note { font-size: 14px; }
.note.center { text-align: center; }
.note a, .inline { text-decoration: underline; text-underline-offset: 3px; }
.error { color: var(--bad); }
.empty { padding: 32px 0; text-align: center; color: var(--muted); }

/* ---------- 按钮和小标签 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.round { border-radius: 999px; }
.btn.block { width: 100%; min-height: 52px; border-radius: 14px; font-size: 15px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.send { width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
.send .icon { width: 20px; height: 20px; stroke-width: 2; }
.send:disabled { opacity: 0.45; cursor: default; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills.center { justify-content: center; }
.pill { min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; }
.pill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.square { min-width: 96px; min-height: 44px; border-radius: 12px; font-size: 15px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border-radius: 999px; background: var(--soft); font-size: 13px; }

/* ---------- 委托框 ---------- */
.box {
  border: 1px solid var(--line); border-radius: 24px; background: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
  padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 12px;
}
.box:focus-within { border-color: var(--ink); }
.box textarea { width: 100%; padding: 0; border: 0; outline: none; resize: none; background: transparent; font-size: 16px; line-height: 1.6; }
.box .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.box .row.end { justify-content: flex-end; }
.hint { font-size: 14px; color: var(--muted); }
.budget { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.budget input { width: 96px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.panel h2 { font-size: 16px; font-weight: 600; }
.panel .actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

/* ---------- 数字人 ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 28px 20px; }
.grid.roomy { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 36px 20px; }
.card { display: flex; flex-direction: column; gap: 12px; }
.card .text { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.card b { font-size: 15px; font-weight: 600; }
.card small, .state { font-size: 13px; color: var(--muted); }
.card .text { min-width: 0; }
.card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state { display: flex; align-items: center; gap: 6px; }
.state i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--rest); }
.state.live i { background: var(--ok); }
.portrait { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--soft); }
.portrait img, .portrait svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait svg { fill: rgba(0, 0, 0, 0.09); }
.tint-0 { background: #eceee8; } .tint-1 { background: #f1ece6; } .tint-2 { background: #e8edf1; } .tint-3 { background: #eeebf1; }
.tint-4 { background: #f3eae6; } .tint-5 { background: #e7eeee; } .tint-6 { background: #f1e9ee; } .tint-7 { background: #eeeee6; }
.search { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); }
.search:focus-within { border-color: var(--ink); }
.search input { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; outline: none; background: transparent; font-size: 15px; color: var(--ink); }
.more { align-self: center; }

.back { align-self: flex-start; display: flex; align-items: center; min-height: 44px; color: var(--muted); }
.back:hover { color: var(--ink); }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 36px; }
.person .portrait { flex: 0 0 200px; border-radius: 20px; }
.person .about { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.person h1 { font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.person .meta { font-size: 15px; color: var(--muted); }
.person .bio { font-size: 15px; line-height: 1.7; }
.person .state { font-size: 14px; }
.feed li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); font-size: 15px; }
.feed time { flex: 0 0 104px; font-size: 13px; color: var(--muted); }
.feed span { flex: 1 1 260px; }

/* ---------- 委托详情 ---------- */
.facts { display: grid; grid-template-columns: 96px 1fr; gap: 12px 16px; font-size: 15px; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.proof { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.proof a { display: block; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--soft); }
.proof img { display: block; width: 100%; height: auto; }

/* ---------- 接入 ---------- */
.block { display: flex; flex-direction: column; gap: 10px; }
.block .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.keyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.keyrow code { flex: 1 1 280px; min-width: 0; min-height: 44px; display: flex; align-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; font: 14px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { margin: 0; background: var(--side); border-radius: 16px; padding: 18px 20px; overflow-x: auto; font: 13px/1.9 var(--mono); white-space: pre; }
.mini { flex: none; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; white-space: nowrap; }

/* ---------- 充值 ---------- */
.balance { display: flex; flex-direction: column; gap: 2px; }
.balance b { font-size: 40px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.methods { display: flex; flex-direction: column; gap: 8px; }
.method { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.method span { display: flex; flex-direction: column; line-height: 1.35; }
.method b { font-size: 15px; font-weight: 500; }
.method small { font-size: 12px; color: var(--muted); }
.method i { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--line); }
.method.on { border-color: var(--ink); }
.method.on i { background: var(--ink); }
.btc { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.btc .qr { flex: 0 0 152px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; line-height: 0; }
.btc .qr svg { display: block; width: 100%; height: auto; }
.btc .fields { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
/* 付款地址和金额必须完整显示,放不下就换行,不能省略 */
.btc .keyrow { flex-wrap: nowrap; align-items: center; }
.btc .keyrow code { flex: 1 1 auto; white-space: normal; overflow: visible; overflow-wrap: anywhere; padding: 10px 14px; line-height: 1.5; }
.method:disabled { cursor: default; background: var(--soft); }
.method:disabled b { color: var(--muted); }

/* ---------- 弹窗 ---------- */
dialog { width: min(440px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 20px; color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); }
dialog.long { width: min(640px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog form { display: flex; flex-direction: column; gap: 16px; }
dialog h2 { font-size: 20px; font-weight: 600; }
dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
dialog input { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; font: 14px var(--mono); color: var(--ink); }
dialog input:focus { outline: none; border-color: var(--ink); }
dialog .agreement { max-height: 46vh; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* ---------- 窄屏 ---------- */
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .side { position: static; height: auto; flex: none; gap: 12px; }
  .recent { display: none; }
  .nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .nav a { justify-content: center; gap: 6px; padding: 0 4px; font-size: 13px; }
  .account { margin-top: 0; flex-direction: row; align-items: center; justify-content: space-between; }
  .account a { flex: 1; min-width: 0; }
  .account .btn { width: 100%; }
  .main { padding-top: 32px; }
  .title { font-size: 26px; }
  .pill { min-height: 44px; }
  .grid, .grid.roomy { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .person .portrait { flex-basis: 140px; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 10px; }
}
