/* ============================================================
   以太风投 · 全局样式（黑色简约商务风，参考 OKX）
   ============================================================ */
:root {
  --bg: #0a0a0c;
  --card: #141419;
  --card2: #1b1b22;
  --line: #26262e;
  --text: #f2f2f4;
  --muted: #8f8f9c;
  --accent: #e8b23a;          /* 金色 */
  --accent-soft: rgba(232, 178, 58, .12);
  --up: #ef4444;              /* 红涨（中国习惯） */
  --down: #22c55e;            /* 绿跌 */
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; color: inherit; }
input { font-family: inherit; outline: none; }

/* ---------- 顶部导航 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.brand small { display: block; font-weight: 400; font-size: 10px; color: var(--muted); letter-spacing: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.btn-ghost { padding: 8px 12px; border-radius: 8px; font-size: 14px; border: 1px solid var(--line); color: var(--muted); }
.btn-ghost:active { background: var(--card2); }
.market-link {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.market-link:active { opacity: .8; }

/* ---------- 按钮 ---------- */
.btn {
  background: var(--accent); color: #16130a; font-weight: 700;
  padding: 12px 16px; border-radius: 10px; font-size: 15px; width: 100%;
}
.btn:active { opacity: .85; }
.btn:disabled { opacity: .5; }
.btn-sm { width: auto; padding: 7px 12px; font-size: 13px; border-radius: 8px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; background: var(--card2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 12px; border-radius: 10px; font-size: 15px;
}
.field input:focus { border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.preview { margin-top: 4px; font-size: 13px; color: var(--muted); }
.preview b { color: var(--text); }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }

/* ---------- Toast 提示 ---------- */
.toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%) translateY(-12px);
  background: var(--card2); border: 1px solid var(--accent); color: var(--accent);
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: all .3s; z-index: 99; pointer-events: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 26px; }
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
.login-logo h1 { font-size: 22px; margin-top: 14px; letter-spacing: 3px; }
.login-logo p { color: var(--muted); font-size: 12px; margin-top: 4px; letter-spacing: 1px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }
.err {
  background: rgba(239, 68, 68, .1); color: var(--up); border: 1px solid rgba(239, 68, 68, .3);
  padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; display: none;
}

/* ---------- 客户页 ---------- */
.balance-wrap { padding: 24px 16px; max-width: 520px; margin: 0 auto; }
.balance-card { text-align: center; padding: 34px 20px; }
.greet { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.greet b { color: var(--text); }
.balance-num {
  font-size: 44px; font-weight: 800; letter-spacing: .5px;
  font-variant-numeric: tabular-nums; transition: color .4s;
}
.balance-unit { font-size: 14px; color: var(--muted); margin-top: 6px; letter-spacing: 2px; }
.rate-row { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.rate-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.rate-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.tick-note { margin-top: 14px; font-size: 12px; color: var(--muted); }
.updated { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ---------- 管理后台 ---------- */
.admin-wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-head h2 { font-size: 20px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: 13.5px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
tr:last-child td { border-bottom: none; }
td .remark { color: var(--muted); font-size: 12px; }
.op-cell { display: flex; gap: 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .65);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 22px 20px 26px;
}
.modal h3 { font-size: 17px; margin-bottom: 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.form-actions .btn { width: auto; flex: 1; }
@media (min-width: 600px) {
  .modal-mask { align-items: center; }
  .modal { border-radius: 20px; margin: 0 16px; }
}
@media (max-width: 400px) {
  .balance-num { font-size: 38px; }
}
