/* ==========================================================================
   夕拾 XISHI — design system v3
   原则（taste-skill 适配到移动端）：
   1. 一套系统：一套字阶、一套圆角、一套按钮、一套间距
   2. 靠字重和字距建立层级，不靠把字越放越大
   3. 等边距：左右一律 20px，任何元素不许溢出到一侧
   4. 金色只做唯一强调色：主按钮 + 资产等级，其余用灰阶
   5. 所有可点元素有按压反馈，120ms
   ========================================================================== */

@font-face {
  font-family: 'PuHuiTi';
  src: url('../fonts/puhuiti-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PuHuiTi';
  src: url('../fonts/puhuiti-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PuHuiTi';
  src: url('../fonts/puhuiti-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PuHuiTi';
  src: url('../fonts/puhuiti-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root{
  /* --- colour: 11 values, no more --- */
  --ink:#0A0B0D;
  --surface:#121316;
  --surface-2:#17181C;
  --line:rgba(255,255,255,.065);
  --line-gold:rgba(200,162,104,.22);
  --gold:#C8A268;
  --gold-soft:#E4CFA9;
  /* 兼容旧内联样式 */
  --card:var(--surface);
  --card-2:var(--surface-2);
  --line-2:var(--line);
  --ink-2:var(--surface);
  --warn:#C97C55;
  --ok:#8FBF9C;
  --muted-2:var(--faint);
  --cream:#F4F0E8;
  --text:#EEE9E0;
  --muted:#8B857A;
  --faint:#57534C;

  /* --- space: 4 · 8 · 12 · 16 · 20 · 28 --- */
  --gutter:20px;
  --st:24px;
  --sb:0px;
  --nav:60px;

  /* --- radius: 8 · 14 · 20 · 28 --- */
  --r-s:8px;
  --r-m:14px;
  --r-l:20px;
  --r-xl:28px;

  --ease:cubic-bezier(.22,.61,.36,1);
  --sans:'PuHuiTi',-apple-system,'PingFang SC','Noto Sans SC','Microsoft YaHei',sans-serif;
  --serif:'PuHuiTi',-apple-system,'PingFang SC','Noto Serif SC',serif;
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; }
body{
  margin:0; background:var(--ink); color:var(--text);
  font-family:var(--sans); font-weight:400; font-size:15px; line-height:1.62;
  letter-spacing:.01em;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  overscroll-behavior:none; user-select:none;
}
input,textarea,button{ font-family:inherit; }
input,textarea{ user-select:text; }
button{ border:0; background:none; color:inherit; padding:0; }
a{ color:inherit; text-decoration:none; }
img{ display:block; }

/* ---------- frame ---------- */
#app{ position:fixed; left:0; right:0; top:0; bottom:0; overflow:hidden; background:var(--ink); }
.screen{
  position:absolute; left:0; right:0; top:0; bottom:0;
  display:flex; flex-direction:column;
  padding-top:var(--st);
  background:var(--ink); overflow:hidden;
}
.screen.push{ animation:slideIn .3s var(--ease) both; }
@keyframes slideIn{ from{ transform:translateX(14%); opacity:.5 } to{ transform:none; opacity:1 } }
.fade{ animation:fade .32s var(--ease) both; }
@keyframes fade{ from{ opacity:0; transform:translateY(4px) } to{ opacity:1; transform:none } }

.scroll{ flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding-bottom:calc(var(--sb) + 28px); }
.pad{ padding:0 var(--gutter); }

/* ---------- type scale: 34 · 27 · 21 · 16 · 15 · 13.5 · 12 · 10 ---------- */
.display{ font-weight:300; font-size:34px; line-height:1.08; letter-spacing:-.015em; }
.display b{ font-weight:700; }
.h1{ font-weight:700; font-size:27px; line-height:1.24; letter-spacing:-.012em; }
.h2{ font-weight:700; font-size:21px; line-height:1.3; letter-spacing:-.008em; }
.h3{ font-weight:500; font-size:16px; line-height:1.4; letter-spacing:0; }
.num{ font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.eyebrow{
  font-weight:500; font-size:10px; letter-spacing:.24em; text-transform:uppercase;
  color:var(--gold); opacity:.85;
}
.muted{ color:var(--muted); }
.small{ font-size:13.5px; line-height:1.66; }
.tiny{ font-size:12px; line-height:1.6; }
.micro{ font-size:10.5px; line-height:1.5; letter-spacing:.02em; }
.center{ text-align:center; }
.serif{ font-weight:700; letter-spacing:-.01em; }

/* ---------- nav ---------- */
.nav{ height:var(--nav); display:flex; align-items:center; padding:0 var(--gutter); flex:0 0 auto; position:relative; }
.nav .title{ font-size:16px; font-weight:500; letter-spacing:.01em; }
.nav .right{ margin-left:auto; display:flex; align-items:center; }
.nav .right .txt{ font-size:13.5px; color:var(--gold); padding:10px 2px 10px 10px; font-weight:500; }

.back{
  width:44px; height:44px; display:flex; align-items:center; justify-content:center;
  border-radius:50%; margin-left:-10px; flex:0 0 auto; transition:background .15s;
}
.back svg{ width:20px; height:20px; }
.back:active{ background:rgba(255,255,255,.06); }

.hairline{ height:1px; background:var(--line); }
.hairline.gold{ background:var(--line-gold); }

/* ---------- tab bar ---------- */
.tabbar{
  flex:0 0 auto; height:calc(var(--nav) + var(--sb));
  padding-bottom:var(--sb);
  display:flex; align-items:center;
  background:rgba(10,11,13,.96);
  border-top:1px solid var(--line);
}
.tab{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  width:25%; height:100%; color:var(--faint);
  transition:color .18s var(--ease), transform .12s var(--ease);
  position:relative; padding-top:2px;
}
.tab svg{ width:21px; height:21px; }
.tab span{ font-size:10px; margin-top:4px; letter-spacing:.1em; }
.tab.on{ color:var(--gold-soft); }
.tab.on::after{
  content:''; position:absolute; top:8px; width:3px; height:3px; border-radius:50%;
  background:var(--gold);
}
.tab:active{ transform:scale(.94); }
.tab .dot{
  position:absolute; top:12px; right:50%; margin-right:-15px;
  min-width:16px; height:16px; border-radius:8px; background:var(--gold);
  color:#191309; font-size:9.5px; line-height:16px; padding:0 4px;
  text-align:center; font-weight:700; letter-spacing:0;
}

/* ---------- buttons: one style pair ---------- */
.btn{
  display:flex; align-items:center; justify-content:center;
  height:52px; border-radius:var(--r-xl);
  font-size:15.5px; font-weight:500; letter-spacing:.02em;
  transition:transform .12s var(--ease), opacity .18s, background .18s;
}
.btn:active{ transform:scale(.978); opacity:.92; }
.btn-gold{
  background:var(--gold-soft);
  color:#221A0D;
  box-shadow:0 1px 0 rgba(255,255,255,.14) inset;
}
.btn-ghost{ border:1px solid var(--line-gold); color:var(--gold-soft); }
.btn-dark{ background:var(--surface-2); color:var(--text); border:1px solid var(--line); }
.btn.sm{ height:40px; border-radius:var(--r-m); font-size:13.5px; padding:0 18px; font-weight:500; }
.btn[disabled]{ opacity:.35; }
.btn-full{ width:100%; }

/* ---------- badge / chip ---------- */
.badge{
  display:inline-flex; align-items:center; height:22px; padding:0 9px;
  border-radius:var(--r-s); font-size:11px; font-weight:500; letter-spacing:.02em;
  background:rgba(255,255,255,.03); color:var(--muted);
  border:1px solid var(--line); margin:0 6px 6px 0;
}
.badge .ic{ margin-right:4px; font-size:9px; }
.badge.ok{ color:#A9C7B0; border-color:rgba(127,175,139,.22); background:rgba(127,175,139,.06); }
.badge.ghost{ color:var(--muted); border-color:var(--line); }

.chip{
  display:inline-block; padding:8px 14px; border-radius:var(--r-m);
  font-size:13px; font-weight:400;
  border:1px solid var(--line); color:var(--muted); margin:0 8px 8px 0;
  transition:border-color .15s, color .15s, background .15s, transform .12s;
}
.chip:active{ transform:scale(.97); }
.chip.on{ border-color:var(--gold); color:var(--gold-soft); background:rgba(200,162,104,.07); }

/* asset grade */
.grade{ display:inline-flex; align-items:baseline; color:var(--gold-soft); font-weight:500; letter-spacing:-.01em; }
.grade b{ font-size:15px; font-weight:700; }
.grade i{ font-style:normal; font-size:10px; margin-left:2px; opacity:.55; font-weight:400; }
.grade.lg b{ font-size:26px; }

/* ---------- cards ---------- */
.sec{ margin-top:28px; }
.sec-head{ display:flex; align-items:baseline; margin:0 var(--gutter) 12px; }
.sec-head .t{ font-size:15px; font-weight:500; letter-spacing:.01em; }
.sec-head .m{ margin-left:auto; font-size:12px; color:var(--faint); font-weight:400; }

.panel{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-l); padding:16px; margin:0 var(--gutter);
}
.panel + .panel{ margin-top:10px; }

.row{
  display:flex; align-items:center; padding:15px var(--gutter); min-height:56px;
  border-bottom:1px solid var(--line);
  transition:background .14s var(--ease);
}
.row:last-child{ border-bottom:0; }
.row .k{ font-size:14.5px; font-weight:400; }
.row .v{ margin-left:auto; color:var(--muted); font-size:13.5px; display:flex; align-items:center; }
.row .chev{ margin-left:8px; color:var(--faint); font-size:12px; }
.row:active{ background:rgba(255,255,255,.028); }

/* ---------- deck ---------- */
.deck{ flex:1; position:relative; margin:8px var(--gutter) 0; }
.deck-card{
  position:absolute; left:0; right:0; top:0; bottom:0;
  border-radius:var(--r-xl); overflow:hidden; background:var(--surface);
  border:1px solid var(--line);
  box-shadow:0 18px 46px rgba(0,0,0,.55);
  will-change:transform;
}
.deck-card img{ width:100%; height:100%; object-fit:cover;
  filter:brightness(1.1) contrast(1.02) saturate(1.03); }
.deck-card .veil{
  position:absolute; left:0; right:0; bottom:0; height:60%;
  background:linear-gradient(to top,rgba(6,6,8,.95) 12%,rgba(6,6,8,.6) 46%,rgba(6,6,8,0) 100%);
}
.deck-card .meta{ position:absolute; left:0; right:0; bottom:0; padding:20px; }
.deck-card .quote{
  font-size:13px; line-height:1.62; font-weight:300;
  color:rgba(232,220,200,.78); margin-bottom:12px; max-width:300px;
}
.deck-card .name{ display:flex; align-items:baseline; }
.deck-card .name b{ font-size:26px; font-weight:700; letter-spacing:-.012em; }
.deck-card .name i{ font-style:normal; font-size:18px; margin-left:9px; color:var(--gold-soft);
  font-weight:300; }
.deck-card .sub{ margin-top:7px; font-size:12.5px; color:rgba(244,240,232,.66); letter-spacing:.01em; }
.deck-card .tags{ margin-top:12px; }
.deck-card .top-row{ position:absolute; left:0; right:0; top:0; padding:14px; display:flex; align-items:flex-start; }
.deck-card .anchor{
  margin-left:auto; text-align:right;
  background:rgba(10,11,13,.5); border:1px solid var(--line);
  border-radius:var(--r-m); padding:8px 12px;
}
.deck-card .anchor .lb{ font-size:9px; letter-spacing:.2em; color:var(--gold); font-weight:500; }
.deck-card .anchor .val{ font-weight:700; font-size:19px; color:var(--gold-soft); letter-spacing:-.02em; }

.stamp{
  position:absolute; top:26%; padding:6px 16px; border:1.5px solid; border-radius:var(--r-s);
  font-size:20px; font-weight:700; letter-spacing:.1em; opacity:0; transform:rotate(-11deg);
}
.stamp.like{ left:20px; color:#8FC9A3; border-color:#8FC9A3; }
.stamp.nope{ right:20px; color:#D2825A; border-color:#D2825A; transform:rotate(11deg); }

.deck-actions{ display:flex; align-items:center; justify-content:center; padding:16px 0 8px; flex:0 0 auto; }
.act{
  width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line); margin:0 11px; background:var(--surface);
  transition:transform .14s var(--ease), background .18s;
}
.act:active{ transform:scale(.92); }
.act.big{ width:62px; height:62px; }
.act.gold{ background:var(--gold-soft); border-color:transparent; color:#221A0D; }
.act svg{ width:24px; height:24px; }
.act.big svg{ width:28px; height:28px; }

/* ---------- feed ---------- */
.post{ margin:0 0 4px; padding:0 0 16px; border-bottom:1px solid var(--line); }
.post .who{ display:flex; align-items:center; padding:14px var(--gutter) 10px; }
.post .who .av{ width:36px; height:36px; border-radius:50%; overflow:hidden; margin-right:11px;
  border:1px solid var(--line); flex:0 0 auto; }
.post .who .av img{ width:100%; height:100%; object-fit:cover; }
.post .who .nm{ font-size:14px; font-weight:500; }
.post .who .tm{ font-size:11px; color:var(--faint); margin-top:1px; }
.post .who .g{ margin-left:auto; }
.post .txt{ padding:0 var(--gutter) 12px; font-size:14.5px; line-height:1.7; color:#DCD7CC; font-weight:400; }
.post .imgs{ padding:0 var(--gutter); }
.post .imgs img{ border-radius:var(--r-m); }
.post .imgs .grid{ display:flex; flex-wrap:wrap; margin-right:-6px; }
.post .imgs .it{ position:relative; border-radius:var(--r-s); overflow:hidden; margin:0 6px 6px 0; }
.post .imgs .it::after{ content:''; display:block; padding-bottom:100%; }
.post .imgs .it img{ position:absolute; left:0; top:0; width:100%; height:100%; object-fit:cover; }
.post .foot{ display:flex; padding:12px var(--gutter) 0; color:var(--faint); font-size:12px; }
.post .foot .a{ display:flex; align-items:center; margin-right:22px; padding:4px 0; transition:color .15s, transform .12s; }
.post .foot .a svg{ width:15px; height:15px; margin-right:5px; }
.post .foot .a:active{ transform:scale(.94); }
.post .foot .a.on{ color:var(--gold-soft); }

/* ---------- chat ---------- */
.msgs{ flex:1; overflow-y:auto; padding:16px 16px calc(var(--sb) + 12px); }
.msg{ display:flex; margin-bottom:14px; align-items:flex-end; }
.msg .b{
  max-width:74%; padding:11px 14px; border-radius:var(--r-m);
  font-size:14.5px; line-height:1.55; font-weight:400;
  background:var(--surface-2); border:1px solid var(--line);
}
.msg.me{ flex-direction:row-reverse; }
.msg.me .b{ background:#26201A; border-color:rgba(200,162,104,.18); color:#F2E8D8; }
.msg .sys{ margin:0 auto; font-size:11px; color:var(--faint); background:rgba(255,255,255,.03);
  padding:5px 12px; border-radius:var(--r-s); }
.msg .time{ font-size:10px; color:var(--faint); margin:0 8px 3px; }
.composer{
  flex:0 0 auto; display:flex; align-items:flex-end; padding:10px 14px calc(10px + var(--sb));
  border-top:1px solid var(--line); background:rgba(10,11,13,.98);
}
.composer .box{ flex:1; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-l); padding:9px 14px; }
.composer textarea{ width:100%; background:none; border:0; color:var(--text); font-size:14.5px;
  resize:none; outline:none; max-height:96px; line-height:1.5; font-weight:400; }
.composer .send{ margin-left:10px; width:44px; height:44px; border-radius:50%;
  background:var(--gold-soft); color:#221A0D;
  display:flex; align-items:center; justify-content:center;
  transition:transform .12s var(--ease); }
.composer .send:active{ transform:scale(.92); }
.composer .send svg{ width:17px; height:17px; }

/* ---------- form ---------- */
.field{ padding:0 var(--gutter); margin-top:24px; }
.field .lb{ font-size:10px; letter-spacing:.18em; color:var(--faint); text-transform:uppercase; font-weight:500; }
.field input{
  width:100%; background:none; border:0; border-bottom:1px solid var(--line);
  padding:12px 0; font-size:19px; color:var(--text); outline:none;
  letter-spacing:.01em; font-weight:400;
}
.field input::placeholder{ color:var(--faint); font-size:16px; font-weight:300; }
.field input:focus{ border-bottom-color:var(--gold); }
.field .hint{ font-size:11.5px; color:var(--faint); margin-top:8px; }

.otp{ display:flex; justify-content:space-between; padding:0 var(--gutter); margin-top:26px; }
.otp .cell{
  width:56px; height:62px; border-radius:var(--r-m); background:var(--surface);
  border:1px solid var(--line); display:flex; align-items:center; justify-content:center;
  font-size:25px; font-weight:500; color:var(--gold-soft);
}
.otp .cell.on{ border-color:var(--gold); }

/* ---------- sheet / toast ---------- */
.sheet-mask{
  position:fixed; left:0; right:0; top:0; bottom:0; background:rgba(0,0,0,.62);
  z-index:80; opacity:0; transition:opacity .24s;
}
.sheet-mask.on{ opacity:1; }
.sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:90;
  background:var(--surface); border-radius:var(--r-xl) var(--r-xl) 0 0;
  border-top:1px solid var(--line);
  padding:6px 0 calc(12px + var(--sb));
  transform:translateY(102%); transition:transform .3s var(--ease);
  max-height:80%; display:flex; flex-direction:column;
}
.sheet.on{ transform:none; }
.sheet .handle{ width:36px; height:3px; border-radius:2px; background:rgba(255,255,255,.14);
  margin:8px auto 4px; }

.toast{
  position:fixed; left:50%; bottom:126px; transform:translate(-50%,8px);
  background:rgba(26,27,32,.98); color:var(--text); font-size:13px; font-weight:400;
  padding:11px 18px; border-radius:var(--r-m); border:1px solid var(--line);
  z-index:200; opacity:0; transition:all .24s var(--ease); pointer-events:none;
  max-width:80%; text-align:center;
}
.toast.on{ opacity:1; transform:translate(-50%,0); }

.progress{ height:2px; background:rgba(255,255,255,.06); border-radius:1px; overflow:hidden; }
.progress i{ display:block; height:100%; background:var(--gold); border-radius:1px;
  transition:width .5s var(--ease); }

.ring{ position:relative; width:64px; height:64px; }
.ring svg{ transform:rotate(-90deg); }
.ring .c{ position:absolute; left:0; right:0; top:0; bottom:0; display:flex;
  align-items:center; justify-content:center; font-size:14px; font-weight:500;
  color:var(--gold-soft); letter-spacing:-.01em; }

.empty{ padding:56px 20px; text-align:center; color:var(--faint); font-size:13px; line-height:1.8; }

.list-item{ display:flex; align-items:center; padding:15px var(--gutter); border-bottom:1px solid var(--line);
  transition:background .14s; }
.list-item:active{ background:rgba(255,255,255,.025); }
.list-item .ic{ width:34px; height:34px; border-radius:var(--r-s); background:rgba(200,162,104,.08);
  border:1px solid var(--line-gold); display:flex; align-items:center; justify-content:center;
  margin-right:13px; color:var(--gold); font-size:13px; font-weight:500; }
.list-item .tt{ font-size:14.5px; font-weight:400; }
.list-item .dd{ font-size:11.5px; color:var(--faint); margin-top:3px; }
.list-item .rt{ margin-left:auto; text-align:right; }

/* ---------- splash ---------- */
.splash{
  position:absolute; left:0; right:0; top:0; bottom:0; background:var(--ink);
  display:flex; flex-direction:column; align-items:center; justify-content:center; z-index:120;
}
.splash .mark{
  width:84px; height:84px; border-radius:var(--r-xl); border:1px solid var(--line-gold);
  display:flex; align-items:center; justify-content:center;
  font-size:38px; font-weight:700; color:var(--gold-soft); letter-spacing:0;
}
.splash .n{ margin-top:34px; font-size:21px; font-weight:500; letter-spacing:.44em;
  color:var(--cream); padding-left:.44em; }
.splash .e{ margin-top:10px; font-size:9px; letter-spacing:.34em; color:var(--faint); font-weight:400; }
.splash .foot{ position:absolute; bottom:calc(38px + var(--sb)); font-size:10px;
  letter-spacing:.2em; color:var(--faint); }

/* typing */
.dots{ display:inline-flex; align-items:center; height:16px; }
.dots i{ display:block; width:4px; height:4px; border-radius:50%; background:var(--muted);
  margin-right:4px; opacity:.3; animation:blink 1.2s infinite; }
.dots i:nth-child(2){ animation-delay:.18s; }
.dots i:nth-child(3){ animation-delay:.36s; }
@keyframes blink{ 0%,60%,100%{ opacity:.25 } 30%{ opacity:1 } }
.msg .b{ word-break:break-word; white-space:pre-wrap; }


/* iOS / 刘海屏安全区；Android 壳会用 JS 覆盖这两个变量 */
@supports (padding: env(safe-area-inset-top)) {
  :root {
    --st: env(safe-area-inset-top, 24px);
    --sb: env(safe-area-inset-bottom, 0px);
  }
}
/* PWA 全屏时禁止橡皮筋回弹 */
html { overscroll-behavior: none; }

/* iOS Safari：输入框字号 <16px 会在聚焦时放大页面，只对 iOS 生效 */
@supports (-webkit-touch-callout: none) {
  .composer textarea, .field input, .otp .cell input, textarea {
    font-size: 16px;
  }
}

/* 桌面浏览器：把 App 收成手机宽度居中，避免拉宽变形（手机端不生效） */
@media (min-width: 560px) {
  body { background: #07080A; }
  body::before {
    content: '';
    position: fixed; inset: 0;
    background:
      radial-gradient(720px 480px at 50% 0%, rgba(200,162,104,.07), transparent 70%),
      #07080A;
    z-index: -1;
  }
  #app.desktop-frame {
    left: 50%; right: auto; width: 430px;
    transform: translateX(-50%);
    box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 40px 120px rgba(0,0,0,.7);
  }
}
