/* ============================================================
   Aurent App — 组件层
   ============================================================ */

/* ---------- 玻璃面板 ---------- */
.panel {
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  background: linear-gradient(166deg, var(--glass), rgba(255,255,255,.015));
  backdrop-filter: blur(8px);
  padding: 16px;
}
.panel + .panel { margin-top: 12px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 12px; }
.panel-hd h3 { font-size: 15px; }
.panel-hd .more { font-size: 12.5px; color: var(--brand-2); }

/* ---------- 余额卡（首页/资产） ---------- */
.balance {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  padding: 22px 20px;
  background: linear-gradient(148deg, #16213a, #0d1119 62%);
  border: 1px solid rgba(79,140,255,.22);
  box-shadow: var(--sh-2);
}
.balance::after {
  content: ""; position: absolute; right: -70px; top: -90px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,140,255,.26), transparent 66%);
}
.balance .bl-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-3); }
.balance .bl-val { margin-top: 8px; font-family: var(--font-mono); font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.balance .bl-val small { font-size: .48em; color: var(--fg-2); margin-left: 6px; }
.balance .bl-sub { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--fg-2); }
.balance .bl-actions { margin-top: 18px; display: flex; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600;
  transition: transform .14s ease, background-color .16s ease, border-color .16s ease, opacity .16s ease;
}
.btn:active { transform: scale(.975); }
.btn-primary { color: #04121f; background: linear-gradient(140deg, var(--brand), var(--brand-2)); }
.btn-ghost { color: var(--fg); border: 1px solid var(--edge); background: var(--glass); }
.btn-accent { color: #04140f; background: linear-gradient(140deg, var(--accent), #7ff3e0); }
.btn-sell { color: #24060c; background: linear-gradient(140deg, #fb7185, #fda4af); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; border-radius: 9px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- 分段控制 ---------- */
.seg {
  display: inline-flex; padding: 3px; gap: 3px;
  border: 1px solid var(--edge); border-radius: 11px; background: rgba(255,255,255,.02);
}
.seg button {
  padding: 7px 14px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--fg-3);
  transition: background-color .16s ease, color .16s ease;
}
.seg button.on { background: var(--glass-2); color: var(--fg); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

/* ---------- 列表 ---------- */
.list { margin: 0 -16px; }
.list-it {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--edge-2);
  transition: background-color .14s ease;
}
.list-it:last-child { border-bottom: 0; }
.list-it.tap:active { background: var(--glass); }
.li-icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--glass-2);
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--fg);
}
.li-icon.brand { background: linear-gradient(140deg, rgba(79,140,255,.3), rgba(45,212,191,.22)); color: var(--brand-2); }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; font-size: 14.5px; font-weight: 600; }
.li-main small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--fg-3); }
.li-val { text-align: right; font-family: var(--font-mono); font-size: 14px; }
.li-val small { display: block; margin-top: 2px; font-size: 11.5px; }

/* ---------- 表格 ---------- */
.tbl { width: 100%; font-size: 13.5px; }
.tbl th {
  padding: 9px 0; text-align: left;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3);
  border-bottom: 1px solid var(--edge-2);
}
.tbl td { padding: 11px 0; border-bottom: 1px solid var(--edge-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- 键值行 ---------- */
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--edge-2); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--fg-2); }
.kv dd { margin: 0; font-family: var(--font-mono); }

/* ---------- 进度 ---------- */
.prog { height: 6px; border-radius: 3px; background: var(--edge-2); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .5s cubic-bezier(.22,.72,.24,1); }
.prog.warn i { background: linear-gradient(90deg, var(--warn), #fcd34d); }

/* ---------- 统计网格 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-cell { border: 1px solid var(--edge-2); border-radius: var(--r-md); padding: 13px 14px; background: rgba(255,255,255,.018); }
.stat-cell span { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--fg-3); }
.stat-cell b { display: block; margin-top: 7px; font-family: var(--font-mono); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 图表容器 ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart-box { margin: 0 -4px; }
.chart-box svg { display: block; width: 100%; }
.grid-line { stroke: rgba(255,255,255,.05); stroke-width: 1; }
.axis-txt { fill: var(--fg-3); font-family: var(--font-mono); font-size: 9px; }
.donut-seg { transition: stroke-dashoffset .6s cubic-bezier(.22,.72,.24,1); }

/* ---------- 订单簿 ---------- */
.ob { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ob-side { font-size: 12.5px; }
.ob-hd { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); padding-bottom: 7px; }
.ob-row { position: relative; display: flex; justify-content: space-between; padding: 4.5px 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ob-row .bg { position: absolute; inset: 0 auto 0 0; border-radius: 2px; }
.ob-ask .bg { background: rgba(251,113,133,.14); }
.ob-bid .bg { background: rgba(52,211,153,.14); }
.ob-ask .p { color: var(--down); }
.ob-bid .p { color: var(--up); }
.ob-row span { position: relative; }

/* ---------- 徽标 / 标签 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--edge);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  color: var(--fg-2);
}
.pill.ok { border-color: rgba(52,211,153,.4); color: var(--up); }
.pill.warn { border-color: rgba(251,191,36,.4); color: var(--warn); }
.pill.brand { border-color: rgba(79,140,255,.42); color: var(--brand-2); }

/* ---------- 输入 ---------- */
.field {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--edge); border-radius: var(--r-md);
  background: rgba(255,255,255,.02);
  font-size: 14px;
}
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; }
.field input::placeholder { color: var(--fg-3); }
.field .suffix { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-3); }

/* ---------- 头像 ---------- */
.avatar {
  width: 54px; height: 54px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand), #7dd3fc);
  color: #04121f;
  font-family: var(--font-disp); font-size: 20px; font-weight: 700;
}

/* ---------- 任务卡 ---------- */
.task { border: 1px solid var(--edge-2); border-radius: var(--r-md); padding: 14px; background: rgba(255,255,255,.018); }
.task + .task { margin-top: 10px; }
.task-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-hd b { font-size: 14.5px; }
.task-hd small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--fg-3); }
.task-rw { font-family: var(--font-mono); font-size: 13px; color: var(--accent); white-space: nowrap; }
.task-foot { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.task-foot .prog { flex: 1; }

/* ---------- 空态 ---------- */
.empty { padding: 34px 16px; text-align: center; color: var(--fg-3); }
.empty svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 10px; }

/* ---------- 骨架 ---------- */
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--glass) 25%, var(--glass-2) 37%, var(--glass) 63%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel.line { height: 11px; margin: 8px 0; }

/* ---------- 底部弹层 ---------- */
.sheet-mask { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); animation: fadeIn .2s ease both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 56;
  max-width: 460px; margin: 0 auto;
  padding: 8px 16px calc(20px + var(--safe-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(168deg, var(--bg-2), var(--bg-1));
  border-top: 1px solid var(--edge);
  box-shadow: var(--sh-2);
  animation: sheetUp .3s cubic-bezier(.22,.72,.24,1) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 38px; height: 4px; margin: 6px auto 14px; border-radius: 2px; background: var(--edge); }
.sheet h3 { font-size: 16px; }
.sheet-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.sheet-it { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--edge-2); font-size: 14px; }
.sheet-it:last-child { border-bottom: 0; }
