/* 质押控制台 —— 样式。
 *
 * 中性占位风格：等新的代币合约地址定了再定视觉。
 * 换风格时只改这里的 CSS 变量即可，app.js 与面板不用动。
 */

:root {
  --bg: #0e1116;
  --bg-soft: #151a21;
  --panel: #171d25;
  --panel-2: #1d242e;
  --line: #262e3a;
  --text: #e6edf3;
  --text-dim: #9aa7b4;
  --text-faint: #6b7885;
  --accent: #4c8dff;
  --accent-soft: rgba(76, 141, 255, 0.14);
  --ok: #35c48b;
  --ok-soft: rgba(53, 196, 139, 0.14);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.13);
  --warn: #ffb020;
  --warn-soft: rgba(255, 176, 32, 0.13);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* ⚠️ `hidden` 属性必须真的生效。
 *   作者样式里的 `display: grid` 会盖掉浏览器默认的 `[hidden] { display: none }`
 *   —— 结果是弹窗遮罩**一直盖在页面上**，整页发灰、什么都点不了，
 *   而代码里明明写着 `mask.hidden = true`。
 *   （出资页有这条规则，控制台一开始漏了 —— 真渲染一眼就看出来了。）
 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.92em; }

/* ── 顶栏 ───────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.brand-text { letter-spacing: 0.2px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.net-label {
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.btn-net, .btn-wallet, .btn, .btn-solid, .btn-danger, .max {
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 14px;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.btn-net:hover, .btn-wallet:hover, .btn:hover, .max:hover { filter: brightness(1.25); }

.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-solid:hover { filter: brightness(1.1); }

.btn-danger {
  background: var(--bad-soft);
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--bad);
}

.btn:disabled, .btn-solid:disabled, .btn-danger:disabled, .max:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

/* ── 布局 ───────────────────────────────────────────────────── */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.source-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-dim);
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.idle { background: var(--warn); }

/* ── 面板 ───────────────────────────────────────────────────── */

#panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
}

.panel-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 18px;
  margin-bottom: 12px;
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.kv > span {
  font-size: 12px;
  color: var(--text-faint);
}

.kv > b {
  font-weight: 600;
  font-family: var(--mono);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.bad { color: var(--bad); }

.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid rgba(255, 176, 32, 0.28);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin: 10px 0 0;
}

.ok-note { color: var(--ok); }

.fine {
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 10px 0 0;
}

.fine b { color: var(--text-dim); }

/* ── 表单 ───────────────────────────────────────────────────── */

.field { margin: 12px 0 10px; }

.field input[type="number"],
.field input[type="text"] {
  width: 100%;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  outline: none;
}

.field input:focus { border-color: var(--accent); }

.row-btns { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 10px; }

.cmd {
  margin: 10px 0;
  padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.cmd code { color: var(--accent); font-size: 13.5px; }

/* ── 核对清单 ───────────────────────────────────────────────── */

.checklist {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cl-head {
  padding: 9px 13px;
  background: var(--panel-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}

.cl {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

.cl:last-child { border-bottom: none; }
.cl:hover { background: var(--panel-2); }
.cl input { margin-top: 3px; flex: none; accent-color: var(--accent); }

/* ── 弹窗 ───────────────────────────────────────────────────── */

.mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 8, 11, 0.72);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(560px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 16px 18px 18px; }

.modal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.modal-item:hover { background: var(--panel-2); }
.modal-item span { color: var(--text-faint); font-size: 12.5px; font-family: var(--mono); }

.modal-item .cur {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  font-family: var(--font);
}

.warn-tag {
  color: var(--warn) !important;
  border: 1px solid rgba(255, 176, 32, 0.35);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px !important;
}

/* ── 两步确认 ───────────────────────────────────────────────── */

.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

.confirm-check input { margin-top: 3px; accent-color: var(--accent); }

.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; }

/* ── 提示条 ─────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(14px);
  z-index: 60;
  max-width: min(560px, calc(100vw - 40px));
  padding: 11px 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 窄屏 ───────────────────────────────────────────────────── */

@media (max-width: 720px) {
  #panels { grid-template-columns: 1fr; }
  .wrap { padding: 16px 14px 48px; }
  .net-label { display: none; }
  .topbar { padding: 10px 14px; }
}
