:root {
  --bg: #0B0E14;
  --bg-2: #10151D;
  --card: #151B24;
  --card-2: #1B2330;
  --border: #2A3342;
  --text: #D8DEE7;
  --muted: #8A94A6;
  --primary: #3D7EFF;
  --primary-2: #6BA3FF;
  --ok: #3FB950;
  --err: #E5534B;
  --radius: 14px;
  --shadow-card: 0 2px 10px rgba(0,0,0,.28);
  --shadow-pop: 0 10px 34px rgba(0,0,0,.5);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
.view { min-height: 100%; display: flex; flex-direction: column; animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 登录/注册（第一印象：品牌标 + 玻璃卡片） */
#view-auth { align-items: center; justify-content: center; background: radial-gradient(120% 90% at 50% 0%, #131B29 0%, var(--bg) 55%); }
.auth-card {
  width: min(92%, 360px);
  background: rgba(21,27,36,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 24px;
  box-shadow: var(--shadow-pop);
  animation: login-in .3s ease-out;
}
@keyframes login-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; }
.auth-card h1::before { content: "🧠 "; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card input {
  width: 100%;
  background: #0D1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 13px 14px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(61,126,255,.18); }

/* 按钮 */
.btn {
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  user-select: none;
  touch-action: manipulation;
}
.btn:active { transform: scale(.96); filter: brightness(1.15); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(61,126,255,.35);
}
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); }
.btn.block { width: 100%; margin-top: 8px; }

/* 顶栏：半透明毛玻璃 */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 16px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(21,27,36,.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.bar .title { font-size: 17px; font-weight: 600; }

/* 机器列表 */
.list { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-width: 720px; margin: 0 auto; width: 100%; }
.card {
  background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .name { font-size: 16px; font-weight: 600; }
.card .dom { color: var(--muted); font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.card .actions { display: flex; gap: 10px; margin-top: 14px; }
.card .actions .btn { flex: 1; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(63,185,80,.8); }
.dot.off { background: var(--muted); }
.empty, .hint { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 16px; }
.err { color: var(--err); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* 对话框：背板模糊 + 淡入 */
.modal { position: fixed; inset: 0; background: rgba(5,8,13,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; z-index: 20; animation: fade-in .15s ease-out; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(14px + var(--safe-top)) 12px calc(14px + var(--safe-bottom)); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card { margin: auto; width: min(90%, 340px); background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow-pop); animation: pop-in .18s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-card h3 { margin-bottom: 14px; font-size: 15px; }
.code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 26px;
  letter-spacing: 4px;
  text-align: center;
  color: var(--ok);
  background: #0D1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  user-select: all;
}
.modal-actions { display: flex; }
.modal-card img { max-width: 100%; height: auto; }

/* APP 内告警横幅（轮询推送展示） */
.alert-banner {
  position: fixed;
  top: calc(8px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  max-width: 92%;
  background: var(--err);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
  cursor: pointer;
}

/* 对账台（超管） */
.sec { font-size: 14px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.dim { color: var(--muted); font-size: 13px; }
.card .row input { flex: 1; }

/* 应用市场 */
.modal-card.wide { width: min(94%, 560px); }
.app-page { width: 100%; height: 320px; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin: 10px 0; }
.mkt-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.mkt-badge.price { color: #ffd166; border-color: #ffd16655; }
.mkt-badge.free { color: #7ee787; border-color: #7ee78755; }
.mkt-badge.promo { color: #79c0ff; border-color: #79c0ff55; }
.mkt-sec { font-size: 14px; color: var(--muted); margin: 16px 4px 6px; font-weight: 600; }

/* 市场卡片：图标 + 标题徽标行 + 简介 + 元信息 */
.mkt-card { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; transition: border-color .15s; }
.mkt-card:hover { border-color: rgba(126, 99, 242, .5); }
.mkt-ico { font-size: 26px; width: 46px; height: 46px; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(126, 99, 242, .12); border: 1px solid rgba(126, 99, 242, .25); border-radius: 12px; }
.mkt-body { flex: 1; min-width: 0; }
.mkt-line1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mkt-line1 .name { font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-intro { color: var(--muted); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-meta { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* 支付区（充值弹层）：手机端全宽大按钮 + 白底二维码卡，文字绝不换行溢出 */
.modal-card.pay { width: min(94%, 400px); }
.pay-channels { margin: 10px 0 4px; }
.pay-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 15px 16px; margin-top: 10px; border-radius: 14px; border: none; cursor: pointer;
  font-size: 16.5px; font-weight: 700; color: #fff; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; touch-action: manipulation; }
.pay-btn:active { transform: scale(.97); filter: brightness(1.08); }
.pay-btn .p-ico { font-size: 21px; flex: none; }
.pay-btn.wx { background: linear-gradient(135deg, #09bb5c, #07a14f); box-shadow: 0 6px 18px rgba(7,193,96,.35); }
.pay-btn.ali { background: linear-gradient(135deg, #1677ff, #0958d9); box-shadow: 0 6px 18px rgba(22,119,255,.35); }
.pay-qr-card { background: #fff; border-radius: 14px; padding: 14px; margin-top: 14px;
  display: flex; flex-direction: column; align-items: center; }
.pay-qr-card img { max-width: 210px; width: 100%; height: auto; display: block; }
.pay-qr-tip { color: #666; font-size: 12px; margin-top: 10px; text-align: center; line-height: 1.5; }

/* 登录/注册模式辨识（标题+副标题+协议提示） */
.auth-mode { font-size: 19px; margin: 18px 0 4px; color: var(--text); }
.auth-mode-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.auth-terms { color: var(--muted); font-size: 12px; margin-top: 10px; text-align: center; }
.auth-terms a { color: var(--primary); text-decoration: none; }
.auth-mode-in { animation: auth-mode-in .25s ease-out; }
@keyframes auth-mode-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* PC 宽屏美化（≥960px）：内容区加宽、卡片更舒适、hover 有层次。
   手机端布局一律不动（手机优先原则不破）。 */
@media (min-width: 960px) {
  .list { max-width: 860px; padding: 28px 24px; gap: 16px; }
  .card { padding: 20px 24px; border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
  .card:hover { border-color: rgba(126, 99, 242, .35); box-shadow: 0 4px 22px rgba(0,0,0,.25); }
  .card .name { font-size: 17px; }
  .card .dom { font-size: 13px; }
  .card .actions { margin-top: 16px; }
  .card .actions .btn { flex: none; min-width: 108px; padding: 10px 20px; }
  .bar { padding-left: 28px; padding-right: 28px; }
  .bar .title { font-size: 19px; }
  .hint { font-size: 13.5px; }
  .modal-card { width: min(92%, 420px); padding: 26px; }
  .modal-card.wide { width: min(92%, 640px); }
  .mkt-sec { font-size: 15px; margin: 22px 4px 10px; }
}
