:root{
  --ink:#e6edf7;
  --muted:#98a2b3;
  --line:#283142;
  --bg:#0b0f15;
  --card:#111827;
  --card-2:#0f172a;
  --brand:#1f2937;
  --accent:#60a5fa;
  --danger:#ef4444;
  --good:#22c55e;
  --warn:#f59e0b;
  --field:#0f172a;
}
*{box-sizing:border-box}
body{
  margin:0;
  background:linear-gradient(180deg,#0a0f16 0%,#0d121a 100%);
  color:var(--ink);
  font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif
}
.topbar{
  display:flex;align-items:center;gap:28px;padding:14px 24px;
  background:rgba(10,15,22,.88);border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:10;backdrop-filter:blur(8px)
}
.brand{font-size:20px;font-weight:800;color:#f8fafc;text-decoration:none;white-space:nowrap}
.topbar nav{display:flex;gap:18px;flex:1;flex-wrap:wrap}
.topbar nav a,.link-button{
  color:#cbd5e1;text-decoration:none;background:none;border:0;padding:5px;font:inherit;cursor:pointer
}
.topbar nav a:hover,.link-button:hover,.brand:hover{color:#fff}
.container{max-width:1180px;margin:0 auto;padding:30px 22px 60px}
.login-container{max-width:520px;padding-top:90px}
.login-card,.panel,.action-card{
  background:linear-gradient(180deg,rgba(17,24,39,.98),rgba(15,23,42,.98));
  border:1px solid var(--line);border-radius:16px;
  box-shadow:0 12px 40px rgba(0,0,0,.32)
}
.login-card{padding:30px}
.minimal-login{padding:28px}
.login-card h1{margin-bottom:4px}
.stack{display:flex;flex-direction:column;gap:18px}
.stack label{display:flex;flex-direction:column;gap:7px;font-weight:700;color:#e2e8f0;text-transform:none}
input[type=text],input[type=password],input[type=number],input:not([type]),input[type=file]{
  width:100%;padding:12px 13px;border:1px solid #334155;border-radius:10px;
  background:var(--field);color:#f8fafc;font:inherit
}
input:focus{
  outline:none;border-color:#60a5fa;box-shadow:0 0 0 3px rgba(96,165,250,.15)
}
button,.button-look,.small-button{
  display:inline-flex;align-items:center;justify-content:center;border:1px solid #374151;
  border-radius:10px;background:#111827;color:#f8fafc;padding:10px 15px;text-decoration:none;
  font-weight:700;cursor:pointer
}
.primary,.button-look{background:#2563eb;border-color:#2563eb;color:#fff}
.primary:hover,.button-look:hover{background:#1d4ed8;border-color:#1d4ed8}
.small-button{padding:8px 10px;font-size:13px}
.small-button.ghost{background:#0f172a;border-color:#334155;color:#cbd5e1}
.danger{background:var(--danger);border-color:var(--danger);color:#fff}
button:disabled{opacity:.5;cursor:not-allowed}
.muted{color:var(--muted)}
.flash{padding:13px 15px;border-radius:10px;margin-bottom:16px}
.flash.success{background:rgba(34,197,94,.14);color:#86efac;border:1px solid rgba(34,197,94,.35)}
.flash.error{background:rgba(239,68,68,.14);color:#fca5a5;border:1px solid rgba(239,68,68,.35)}
.page-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.page-heading h1,h1{margin:0 0 6px}
.page-heading p{margin:0;color:var(--muted)}
.badge{padding:7px 11px;border-radius:99px;font-weight:700}
.badge.ok{background:rgba(34,197,94,.14);color:#86efac}
.badge.warn{background:rgba(245,158,11,.14);color:#fcd34d}
.action-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}
.action-card{padding:20px;text-decoration:none;color:inherit;display:flex;flex-direction:column;align-items:flex-start}
.action-card h2{font-size:18px;margin:10px 0 6px}
.action-card p{color:var(--muted);line-height:1.5;min-height:70px}
.action-card button,.action-card .button-look{margin-top:auto;width:100%}
.number{font-size:25px;font-weight:900}
.panel{padding:20px;margin:18px 0}
.panel-title{display:flex;justify-content:space-between;align-items:center}
.panel-title h2{margin:0}
.status-grid,.summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:15px}
.status-item,.summary-grid>div{
  border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:6px;
  background:rgba(15,23,42,.65)
}
.summary-grid>div strong{font-size:26px}
.status-item small,.summary-grid>div span{color:var(--muted)}
.good{color:#86efac}.bad{color:#fca5a5}
.file-setting{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:center;padding:14px 0;border-bottom:1px solid var(--line)}
.file-setting p{color:var(--muted);margin:5px 0 0}
.narrow{max-width:260px}
.formula,.notice{background:rgba(15,23,42,.8);border:1px solid var(--line);border-radius:10px;padding:13px;line-height:1.6}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:12px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
th{font-size:13px;color:#94a3b8}
tr:hover td{background:rgba(255,255,255,.02)}
.button-row{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.danger-zone{border-color:rgba(239,68,68,.4)}
.check{flex-direction:row!important;align-items:center}
.check input{width:auto}
.logs summary{cursor:pointer;font-weight:700}
.logs pre{white-space:pre-wrap;overflow:auto;max-height:420px;background:#020617;color:#dbeafe;padding:14px;border-radius:8px;border:1px solid #1e293b}
.scope-list{display:flex;gap:7px;flex-wrap:wrap}
.scope-list code{padding:6px 8px;background:#0f172a;border:1px solid var(--line);border-radius:6px;color:#dbeafe}
.captcha-block{display:flex;flex-direction:column;gap:10px}
.captcha-head{display:flex;justify-content:space-between;align-items:center}
.captcha-head label{font-weight:700;color:#e2e8f0}
.captcha-image{
  width:100%;height:72px;display:block;border:1px solid #334155;border-radius:10px;background:#0f172a
}
@media(max-width:900px){
  .action-grid,.status-grid,.summary-grid{grid-template-columns:repeat(2,1fr)}
  .topbar{align-items:flex-start}.topbar nav{display:none}
}
@media(max-width:600px){
  .action-grid,.status-grid,.summary-grid,.two-col,.file-setting{grid-template-columns:1fr}
  .container{padding:20px 12px}.topbar{padding:13px 14px}.action-card p{min-height:auto}
}


/* Mobile responsive refinements */
.captcha-image{
  overflow:hidden;
}
.captcha-image svg{
  width:100%;
  height:100%;
  display:block;
}
@media(max-width:760px){
  body{font-size:15px}
  .container{
    width:100%;
    max-width:none;
    padding:16px 12px 36px;
  }
  .login-container{
    max-width:none;
    padding:28px 14px 32px;
  }
  .login-card{
    width:100%;
    padding:22px 18px;
    border-radius:14px;
  }
  .topbar{
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px 12px;
    padding:12px 14px;
  }
  .brand{
    font-size:18px;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .topbar nav{
    grid-column:1 / -1;
    display:flex;
    overflow-x:auto;
    flex-wrap:nowrap;
    gap:8px;
    padding-bottom:2px;
    scrollbar-width:none;
  }
  .topbar nav::-webkit-scrollbar{display:none}
  .topbar nav a{
    white-space:nowrap;
    padding:8px 10px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#0f172a;
  }
  .action-grid,.status-grid,.summary-grid,.two-col,.file-setting{
    grid-template-columns:1fr;
  }
  .action-card p{min-height:auto}
  .page-heading{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }
  .button-row{
    flex-direction:column;
  }
  .button-row>*,
  .button-row form,
  .button-row button,
  .button-row a{
    width:100%;
  }
  .panel,.action-card{
    padding:16px;
  }
  .table-wrap{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    border:1px solid var(--line);
    border-radius:10px;
  }
  table{
    min-width:680px;
  }
  th,td{
    padding:10px 9px;
  }
  input[type=text],input[type=password],input[type=number],input:not([type]),input[type=file]{
    font-size:16px;
    min-height:46px;
  }
  button,.button-look,.small-button{
    min-height:44px;
  }
  .captcha-head{
    align-items:center;
  }
  .captcha-image{
    height:78px;
  }
}


/* Captcha hardening: render as an image, not selectable DOM text */
.captcha-image{
  user-select:none;
  -webkit-user-select:none;
  -webkit-user-drag:none;
  pointer-events:none;
}
