/* ==========================================================
   连续黑白 · 数据管理平台
   黑色简约 · 自适应 · 禁止缩放
   ========================================================== */

:root{
  --bg:        #000000;
  --surface:   #0b0b0b;
  --surface-2: #111111;
  --surface-3: #161616;
  --line:      #1f1f1f;
  --line-2:    #2a2a2a;
  --txt:       #ededed;
  --txt-2:     #a0a0a0;
  --txt-3:     #6a6a6a;
  --ok:        #4ade80;
  --warn:      #fbbf24;
  --err:       #f87171;
  --radius:    12px;
  --radius-sm: 8px;
  --gap:       14px;
}

*,*::before,*::after{ box-sizing:border-box; margin:0; padding:0; }

html{
  -webkit-text-size-adjust:100%;
  -moz-text-size-adjust:100%;
  text-size-adjust:100%;
  touch-action:manipulation;
}

body{
  background:var(--bg);
  color:var(--txt);
  font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  overscroll-behavior-y:none;
  min-height:100vh;
  min-height:100dvh;
  touch-action:pan-y;
}

/* 输入框允许选择文字 */
input,textarea{ touch-action:auto; user-select:text; -webkit-user-select:text; }

.view{ min-height:100vh; min-height:100dvh; }
.hidden{ display:none !important; }

/* ---------------- 自适应居中(登录/注册页) ----------------
   用 margin:auto 而非 justify-content:center,
   这样内容超出视口时仍可滚动,顶部不会被截断 */
.view.center{
  display:flex;
  min-height:100vh;
  min-height:100dvh;
  padding:calc(28px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
  box-sizing:border-box;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
.view.center > *{
  margin:auto;
}

/* ---------------- 通用控件 ---------------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  background:var(--surface-2);
  border:1px solid var(--line-2);
  color:var(--txt);
  padding:10px 16px;
  border-radius:var(--radius-sm);
  font:inherit; font-size:14px; font-weight:500;
  cursor:pointer; white-space:nowrap;
  transition:background .15s ease, border-color .15s ease, opacity .15s ease;
  user-select:none; -webkit-user-select:none;
  touch-action:manipulation;
  -webkit-appearance:none; appearance:none;
}
.btn:hover{ background:var(--surface-3); border-color:#333; }
.btn:active{ transform:scale(.985); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn.primary{ background:var(--txt); border-color:var(--txt); color:#000; font-weight:600; }
.btn.primary:hover{ background:#d4d4d4; border-color:#d4d4d4; }
.btn.danger{ color:var(--err); border-color:#3a2020; }
.btn.danger:hover{ background:#1a0f0f; }
.btn.xs{ padding:6px 12px; font-size:13px; border-radius:6px; }

input{
  width:100%;
  background:var(--surface-2);
  border:1px solid var(--line-2);
  color:var(--txt);
  padding:11px 13px;
  border-radius:var(--radius-sm);
  font:inherit; font-size:15px;
  outline:none;
  transition:border-color .15s ease, background .15s ease;
  -webkit-appearance:none; appearance:none;
}
input::placeholder{ color:var(--txt-3); }
input:focus{ border-color:#3a3a3a; background:var(--surface-3); }

code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:.88em;
  background:var(--surface-3);
  border:1px solid var(--line);
  padding:1px 6px;
  border-radius:5px;
  color:var(--txt-2);
}
.mono{ font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.88em; }

/* ---------------- 登录 / 注册 ---------------- */
#authView{ display:flex; align-items:center; justify-content:center; padding:24px 18px; }
.auth-wrap{
  width:100%; max-width:400px;
  flex:0 0 auto;              /* 不被 flex 容器拉伸 */
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:36px 28px 28px;
}
.brand{ text-align:center; margin-bottom:28px; }
.brand-logo{
  width:56px; height:56px; margin:0 auto 14px;
  display:grid; place-items:center;
  background:var(--txt); color:#000;
  border-radius:14px;
  font-size:22px; font-weight:700;
  user-select:none;
}
.brand h1{ font-size:20px; font-weight:600; letter-spacing:1px; }
.brand p{ font-size:13px; color:var(--txt-3); margin-top:5px; }

.seg{
  display:flex;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:3px;
  margin-bottom:22px;
}
.seg-btn{
  flex:1; background:transparent; border:0;
  color:var(--txt-3);
  padding:9px; border-radius:6px;
  font:inherit; font-size:14px; font-weight:500;
  cursor:pointer;
  transition:background .15s ease, color .15s ease;
  touch-action:manipulation;
}
.seg-btn.active{ background:var(--surface-3); color:var(--txt); }

.form{ display:flex; flex-direction:column; gap:16px; }
.field{ display:flex; flex-direction:column; gap:7px; }
.field label{ font-size:13px; color:var(--txt-2); font-weight:500; }
.form .btn{ margin-top:4px; padding:12px; }

.msg{ margin-top:16px; font-size:13px; text-align:center; min-height:20px; color:var(--txt-3); }
.msg.err{ color:var(--err); }
.msg.ok{ color:var(--ok); }

/* ---------------- 滑块验证入口(官方样式) ---------------- */
.cap-btn{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:46px;
  padding:0 14px;
  background:var(--surface-2);
  border:1px solid var(--line-2);
  border-radius:var(--radius-sm);
  cursor:pointer;
  user-select:none;
  -webkit-user-select:none;
  touch-action:manipulation;
  transition:background .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color:transparent;
}
.cap-btn:hover{ background:var(--surface-3); border-color:#333; }
.cap-btn:focus-visible{ outline:none; border-color:#3a3a3a; }
.cap-icon{
  display:flex; align-items:center; justify-content:center;
  width:26px; height:26px;
  color:var(--txt-3);
  flex:0 0 auto;
  transition:color .15s ease;
}
.cap-text{
  flex:1;
  font-size:14px;
  color:var(--txt-2);
  transition:color .15s ease;
}
.cap-arrow{
  flex:0 0 auto;
  font-size:18px;
  line-height:1;
  color:var(--txt-3);
  transition:color .15s ease;
}
.cap-btn.verified{
  border-color:rgba(74,222,128,.38);
  background:rgba(74,222,128,.06);
}
.cap-btn.verified .cap-text{ color:var(--ok); font-weight:500; }
.cap-btn.verified .cap-arrow{ color:var(--ok); font-size:15px; }
.cap-btn.verified .cap-icon{ color:var(--ok); }

@keyframes capShake{
  0%,100%{ transform:translateX(0); }
  20%{ transform:translateX(-5px); }
  40%{ transform:translateX(5px); }
  60%{ transform:translateX(-3px); }
  80%{ transform:translateX(3px); }
}
.cap-btn.shake{ animation:capShake .45s ease; border-color:rgba(248,113,113,.5); }

/* ---------------- 顶栏 ---------------- */
.header{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:0 18px; height:56px;
  background:rgba(0,0,0,.86);
  backdrop-filter:saturate(180%) blur(16px);
  -webkit-backdrop-filter:saturate(180%) blur(16px);
  border-bottom:1px solid var(--line);
}
.header-title{ font-size:15px; font-weight:600; letter-spacing:.5px; }
.header-right{ display:flex; align-items:center; gap:10px; }
.chip{
  font-size:13px; color:var(--txt-2);
  background:var(--surface-2);
  border:1px solid var(--line);
  padding:4px 11px; border-radius:20px;
  max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* ---------------- 标签页 ---------------- */
.tabs{
  position:sticky; top:56px; z-index:19;
  display:flex; gap:4px;
  padding:8px 12px;
  overflow-x:auto;
  background:rgba(0,0,0,.86);
  backdrop-filter:saturate(180%) blur(16px);
  -webkit-backdrop-filter:saturate(180%) blur(16px);
  border-bottom:1px solid var(--line);
  scrollbar-width:none;
}
.tabs::-webkit-scrollbar{ display:none; }
.tab{
  flex:0 0 auto;
  background:transparent; border:0;
  color:var(--txt-3);
  padding:7px 15px; border-radius:7px;
  font:inherit; font-size:14px; font-weight:500;
  cursor:pointer;
  transition:background .15s ease, color .15s ease;
  touch-action:manipulation;
}
.tab:hover{ color:var(--txt-2); background:var(--surface-2); }
.tab.active{ color:#000; background:var(--txt); }
.tab.disabled{ opacity:.35; }

/* ---------------- 主内容 ---------------- */
.main{
  max-width:1080px; margin:0 auto;
  padding:20px 18px calc(40px + env(safe-area-inset-bottom));
}
.page{ display:flex; flex-direction:column; gap:var(--gap); }
.page-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  font-size:16px; font-weight:600; padding:2px 0 4px;
}

/* ---------------- 卡片网格 ---------------- */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
  gap:10px;
}
.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:15px; min-width:0;
}
.card .k{ font-size:12px; color:var(--txt-3); margin-bottom:7px; }
.card .v{
  font-size:20px; font-weight:600; color:var(--txt);
  word-break:break-word; line-height:1.35;
  font-variant-numeric:tabular-nums;
}
.card .v.sm{ font-size:15px; }
.card .extra{ font-size:12px; color:var(--txt-3); margin-top:6px; word-break:break-all; }
.card.ok .v{ color:var(--ok); }
.card.warn .v{ color:var(--warn); }
.card.err .v{ color:var(--err); }

/* ---------------- 区块 ---------------- */
.card-block{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
}
.card-block-title{ font-size:14px; font-weight:600; color:var(--txt-2); margin-bottom:14px; }
.btn-row{ display:flex; flex-wrap:wrap; gap:9px; }
.note{ font-size:13px; color:var(--warn); margin-top:14px; line-height:1.7; }
.note.plain{ color:var(--txt-3); }

/* ---------------- 表格 ---------------- */
.table-wrap{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
}
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
table{ width:100%; border-collapse:collapse; font-size:13.5px; }
th,td{ padding:11px 14px; text-align:left; white-space:nowrap; border-bottom:1px solid var(--line); }
th{ font-size:12px; color:var(--txt-3); font-weight:500; background:var(--surface-2); }
tbody tr:last-child td{ border-bottom:0; }
tbody tr:hover{ background:var(--surface-2); }
td.num{ font-variant-numeric:tabular-nums; }

.tag{
  display:inline-block; padding:2px 9px; border-radius:6px;
  font-size:11.5px; font-weight:500;
  background:var(--surface-3); color:var(--txt-2);
  border:1px solid var(--line-2);
}
.tag.ok{ color:var(--ok); border-color:#1d3a29; background:#0c1a12; }
.tag.warn{ color:var(--warn); border-color:#3a2f14; background:#1a1509; }
.tag.err{ color:var(--err); border-color:#3a1f1f; background:#1a0e0e; }
.tag.info{ color:#93c5fd; border-color:#1e2f47; background:#0b1523; }

/* ---------------- 状态条 ---------------- */
.status{
  font-size:13.5px; color:var(--txt-2);
  background:var(--surface-2);
  border:1px solid var(--line);
  border-left:3px solid var(--txt-3);
  border-radius:var(--radius-sm);
  padding:13px 15px; margin-bottom:16px;
  line-height:1.8; word-break:break-all;
}
.status.bound{ border-left-color:var(--ok); }
.status.unbound{ border-left-color:var(--warn); }

/* ---------------- 折叠说明 ---------------- */
.details{ margin-top:16px; font-size:13.5px; color:var(--txt-3); }
.details summary{
  cursor:pointer; color:var(--txt-2); padding:8px 0; font-weight:500;
  touch-action:manipulation; list-style:none;
}
.details summary::-webkit-details-marker{ display:none; }
.details summary::before{ content:"▸ "; }
.details[open] summary::before{ content:"▾ "; }
.details ol{ margin:6px 0 0 20px; line-height:2; }
.details code{ word-break:break-all; }

/* ---------------- 状态提示 ---------------- */
.loading,.empty{ padding:40px 20px; text-align:center; color:var(--txt-3); font-size:14px; }
.loading::after{
  content:""; display:inline-block;
  width:13px; height:13px; margin-left:8px; vertical-align:-2px;
  border:2px solid var(--line-2); border-top-color:var(--txt-2);
  border-radius:50%; animation:spin .8s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.toast{
  position:fixed; left:50%; bottom:calc(28px + env(safe-area-inset-bottom));
  transform:translate(-50%,140%);
  max-width:calc(100vw - 36px);
  background:var(--surface-3);
  border:1px solid var(--line-2);
  color:var(--txt);
  padding:11px 20px; border-radius:var(--radius-sm);
  font-size:14px; z-index:99; opacity:0;
  transition:transform .25s cubic-bezier(.2,.9,.3,1), opacity .25s ease;
  pointer-events:none;
  box-shadow:0 12px 36px rgba(0,0,0,.7);
}
.toast.show{ transform:translate(-50%,0); opacity:1; }
.toast.ok{ border-color:#1d3a29; }
.toast.err{ border-color:#3a1f1f; }

/* ---------------- 自适应 ---------------- */
@media (max-width:640px){
  :root{ --gap:12px; }
  body{ font-size:14.5px; }
  .main{ padding:16px 14px calc(36px + env(safe-area-inset-bottom)); }
  .header{ padding:0 14px; height:52px; }
  .tabs{ top:52px; padding:7px 10px; }
  .auth-wrap{ padding:30px 20px 24px; }
  .view.center{ padding:calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); }
  .card{ padding:13px; }
  .card .v{ font-size:18px; }
  .grid{ grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:9px; }
  .card-block{ padding:15px; }
  th,td{ padding:10px 12px; font-size:13px; }
}

/* 矮屏(横屏手机/小窗口):减少留白,保证表单完整可见 */
@media (max-height:640px){
  .view.center > *{ margin:10px auto; }
  .auth-wrap{ padding:24px 22px 20px; }
  .brand{ margin-bottom:18px; }
  .brand-logo{ width:44px; height:44px; font-size:18px; margin-bottom:10px; }
  .brand h1{ font-size:17px; }
  .seg{ margin-bottom:16px; }
  .form{ gap:12px; }
}
@media (max-width:380px){
  .grid{ grid-template-columns:1fr 1fr; }
  .card .v{ font-size:16px; }
  .tabs{ gap:2px; }
  .tab{ padding:7px 12px; font-size:13.5px; }
}
@media (min-width:1024px){
  .main{ padding:26px 24px 60px; }
  .grid{ grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; }
}
@media (max-height:480px) and (orientation:landscape){
  .header,.tabs{ position:static; }
}

::-webkit-scrollbar{ width:9px; height:9px; }
::-webkit-scrollbar-track{ background:var(--bg); }
::-webkit-scrollbar-thumb{ background:#242424; border-radius:5px; border:2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover{ background:#333; }

@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
