/* 池总矿机 DAPP — 深色科技风（CSS变量由宿主注入时优先用宿主的） */
:root {
  --bg: #0b0f14;
  --card: #141a22;
  --card2: #1a2230;
  --line: #243040;
  --fg: #e8eef5;
  --fg-dim: #8b98a9;
  --gold: #f0b90b;
  --green: #2ecc71;
  --red: #e74c3c;
  --blue: #3498db;
  --purple: #9b59b6;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--fg); font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; }
body { padding-bottom: 76px; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: rgba(11,15,20,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.topbar .logo .mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--gold), #d99a00);
  display: flex; align-items: center; justify-content: center; }
.wallet-chip { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 12px; color: var(--fg-dim); cursor: pointer; }
.wallet-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.wallet-chip.on .dot { background: var(--green); }
.wallet-chip.on { color: var(--fg); }

/* 视图容器 */
.view { padding: 14px 14px 20px; max-width: 560px; margin: 0 auto; }
.view-title { font-size: 20px; font-weight: 700; margin: 6px 0 14px; display: flex; align-items: center; gap: 8px; }
.view-title .sub { font-size: 12px; color: var(--fg-dim); font-weight: 400; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card .card-title { font-size: 13px; color: var(--fg-dim); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

/* 资产网格 */
.assets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.asset { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; gap: 10px; align-items: center; }
.asset .ic { flex: 0 0 34px; }
.asset .v { font-size: 16px; font-weight: 700; }
.asset .k { font-size: 11px; color: var(--fg-dim); }

/* 矿机卡 */
.miner-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.miner-card .ic { flex: 0 0 42px; }
.miner-card .info { flex: 1; min-width: 0; }
.miner-card .no { font-weight: 700; font-size: 15px; }
.miner-card .meta { font-size: 11px; color: var(--fg-dim); margin-top: 3px; }
.miner-card .right { text-align: right; }
.progress { height: 5px; background: var(--card2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress .bar { height: 100%; background: var(--gold); border-radius: 3px; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.run { background: rgba(46,204,113,.15); color: var(--green); }
.badge.off { background: rgba(139,152,169,.15); color: var(--fg-dim); }
.badge.due { background: rgba(231,76,60,.15); color: var(--red); }
.badge.pending { background: rgba(240,185,11,.15); color: var(--gold); }
.badge.dead { background: rgba(155,89,182,.15); color: var(--purple); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; cursor: pointer;
  border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 600; color: #10141a;
  background: var(--gold); transition: opacity .15s; }
.btn:active { opacity: .8; }
.btn.ghost { background: var(--card2); color: var(--fg); border: 1px solid var(--line); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 底部导航 */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; display: flex;
  background: rgba(17,23,31,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px;
  color: var(--fg-dim); font-size: 10px; cursor: pointer; border: none; background: none; }
.tabbar .tab.active { color: var(--gold); }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--fg-dim); margin-bottom: 6px; }
.field input, .field select { width: 100%; background: var(--card2); border: 1px solid var(--line); color: var(--fg);
  border-radius: 10px; padding: 11px 12px; font-size: 14px; outline: none; }
.field input:focus { border-color: var(--gold); }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

/* 列表条目 */
.item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item .l { font-size: 13px; }
.item .l .sub { display: block; font-size: 11px; color: var(--fg-dim); margin-top: 2px; }
.item .r { text-align: right; font-size: 13px; font-weight: 600; }
.item .r .sub { display: block; font-size: 11px; color: var(--fg-dim); font-weight: 400; }

/* Toast */
#toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex;
  flex-direction: column; gap: 8px; width: max-content; max-width: 90vw; }
.toast-item { background: var(--card2); border: 1px solid var(--line); color: var(--fg); padding: 10px 16px;
  border-radius: 10px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.4); animation: fadein .2s; }
.toast-item.ok { border-color: rgba(46,204,113,.4); }
.toast-item.err { border-color: rgba(231,76,60,.5); }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Modal */
#modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: none; align-items: flex-end; justify-content: center; }
#modal-mask.show { display: flex; }
#modal { background: var(--card); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; padding: 18px 16px 26px;
  max-height: 82vh; overflow-y: auto; animation: slideup .22s; }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
#modal .m-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
#modal .m-close { cursor: pointer; color: var(--fg-dim); font-size: 18px; padding: 4px; background: none; border: none; }

/* 杂项 */
.empty { text-align: center; color: var(--fg-dim); padding: 30px 0; font-size: 13px; }
.hint { font-size: 11px; color: var(--fg-dim); line-height: 1.6; }
.amount-box { display: flex; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 4px 4px 12px; }
.amount-box input { flex: 1; background: none; border: none; color: var(--fg); font-size: 16px; padding: 8px 0; outline: none; }
.amount-box .unit { color: var(--fg-dim); font-size: 12px; padding: 0 8px; }
.link { color: var(--gold); text-decoration: none; }
.divider { height: 1px; background: var(--line); margin: 10px 0; }
.stat3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center; }
.stat3 .v { font-size: 17px; font-weight: 700; }
.stat3 .k { font-size: 11px; color: var(--fg-dim); }
