/* ============================================================
   FRP 自建工具 - 现代极简 SaaS 面板 (对标 www.nfrp.cn)
   深色侧栏 #1a1a2e · 主蓝 #2563eb · 背景 #f0f2f5
   ============================================================ */
*{margin:0;padding:0;box-sizing:border-box;}
:root{
  --blue:#2563eb; --blue-h:#1d4ed8; --blue-bg:#eff6ff;
  --indigo:#4361ee;
  --green:#16a34a; --green-bg:#dcfce7;
  --red:#dc2626; --red-bg:#fee2e2;
  --orange:#ea580c; --orange-bg:#ffedd5;
  --gray:#64748b; --gray-bg:#f1f5f9;
  --txt:#1e293b; --txt2:#475569; --muted:#94a3b8;
  --line:#e5e7eb; --line2:#eef0f3; --bg:#f0f2f5;
}
html,body{height:100%;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Microsoft YaHei","PingFang SC",Arial,sans-serif;
  background:var(--bg);color:#333;font-size:14px;
}
a{color:var(--blue);text-decoration:none;}
a:hover{text-decoration:none;}

/* ================= 布局 ================= */
.layout{display:flex;min-height:100vh;}
.main-wrap{flex:1;display:flex;flex-direction:column;min-width:0;}
.container{flex:1;padding:24px 28px;min-width:0;}

/* ================= 深色侧栏 ================= */
.sidebar{
  width:220px;flex-shrink:0;background:#1a1a2e;
  color:rgba(255,255,255,.7);display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh;overflow-y:auto;
}
.sidebar::-webkit-scrollbar{width:6px;}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:3px;}
.sidebar::-webkit-scrollbar-track{background:transparent;}

/* 品牌:圆形徽章 + 白字 */
.brand{display:flex;align-items:center;gap:11px;padding:17px 18px 14px;border-bottom:1px solid rgba(255,255,255,.1);}
.brand-logo{
  width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.08);
  border:2px solid rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:15px;font-weight:700;flex-shrink:0;
}
.brand-text{color:#fff;font-size:16px;font-weight:700;letter-spacing:.4px;display:flex;align-items:center;gap:8px;}
.side-tag{font-style:normal;font-size:9px;letter-spacing:1px;background:rgba(99,102,241,.3);color:#c7d2fe;padding:2px 6px;border-radius:4px;font-weight:600;}

/* 导航菜单 */
.side-nav{flex:1;padding:6px 0 10px;overflow-y:auto;}
.side-link{
  display:flex;align-items:center;gap:9px;color:rgba(255,255,255,.75);
  padding:9px 18px;font-size:14.5px;font-weight:400;
  transition:all .18s ease;-webkit-tap-highlight-color:transparent;
}
.side-link .sic{width:17px;height:17px;flex-shrink:0;color:rgba(255,255,255,.6);}
.side-link:hover{background:rgba(255,255,255,.1);color:#fff;}
.side-link:hover .sic{color:#fff;}
.side-link.active{background:rgba(255,255,255,.12);color:#fff;}
.side-link.active .sic{color:#fff;}
.side-label{flex:1;}

/* 侧栏底部免责 */
.side-foot{padding:12px 16px;font-size:10.5px;color:rgba(255,255,255,.4);line-height:1.7;border-top:1px solid rgba(255,255,255,.1);}

/* ================= 顶栏 ================= */
.topbar{
  background:#fff;height:50px;display:flex;align-items:center;justify-content:space-between;
  padding:0 28px;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50;
}
.topbar-title{font-size:15px;font-weight:600;color:var(--txt);}
.topbar-right{display:flex;align-items:center;gap:10px;}
.topbar-avatar{
  width:29px;height:29px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex:none;
}
.topbar-avatar-admin{background:linear-gradient(135deg,#dc2626,#ea580c);}
.topbar-name{font-size:13px;font-weight:600;color:var(--txt);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.topbar-logout{color:var(--gray);font-size:12px;padding:5px 11px;border-radius:6px;background:rgba(100,116,139,.09);transition:all .15s;}
.topbar-logout:hover{color:var(--red);background:rgba(220,38,38,.1);}

/* ================= 卡片 ================= */
.card{background:#fff;border-radius:10px;padding:19px 22px;margin-bottom:16px;box-shadow:0 1px 3px rgba(0,0,0,.04);border:1px solid var(--line2);}
.card h2,.card h3{font-size:15px;margin-bottom:13px;padding-bottom:11px;border-bottom:1px solid var(--line2);display:flex;justify-content:space-between;align-items:center;gap:10px;}
.card h2 .sub,.card h3 .sub{font-size:12px;color:var(--muted);font-weight:normal;}

/* ================= 统计卡片 ================= */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;margin-bottom:16px;}
.stat{background:#fff;border-radius:10px;padding:17px 19px;border:1px solid var(--line2);box-shadow:0 1px 3px rgba(0,0,0,.04);transition:transform .18s,box-shadow .18s;display:block;color:inherit;}
.stat:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(30,41,59,.1);}
.stat-top{display:flex;align-items:center;gap:9px;color:var(--txt2);}
.stat-ic{width:18px;height:18px;}
.stat-blue .stat-ic{color:var(--blue);} .stat-green .stat-ic{color:var(--green);}
.stat-orange .stat-ic{color:var(--orange);} .stat-red .stat-ic{color:var(--red);}
.stat .lbl{font-size:13px;color:var(--txt2);}
.stat .num{font-size:27px;font-weight:700;color:#111827;margin:7px 0 1px;line-height:1.15;}
.stat-quota{font-size:11.5px;color:var(--muted);}

/* 快捷操作 */
.quick-row{display:flex;gap:10px;flex-wrap:wrap;}

/* ================= 表格 ================= */
.tbl{width:100%;border-collapse:collapse;}
.tbl th{background:#f8fafc;color:var(--txt2);font-weight:600;white-space:nowrap;text-align:left;padding:10px 12px;font-size:12.5px;border-bottom:1px solid #f0f0f0;}
.tbl td{padding:11px 12px;text-align:left;border-bottom:1px solid #f3f4f6;font-size:13px;vertical-align:middle;}
.tbl tr:hover td{background:#fafbff;}
.tbl .note{color:var(--txt2);font-size:12.5px;max-width:230px;line-height:1.6;}
.tbl .ops{white-space:nowrap;font-size:12.5px;}
.tbl .ops a.ok{color:var(--green);font-weight:600;}
.tbl .ops a.danger{color:var(--red);}
.tbl .ops a.danger,.tbl .ops a{margin:0 1px;}
.mini{padding:5px 8px;font-size:12.5px;width:auto;border-radius:6px;}
.secret{user-select:all;font-size:12px;}

/* ================= 按钮 ================= */
.btn{
  display:inline-block;padding:8px 17px;border-radius:6px;border:1px solid transparent;
  background:var(--blue);color:#fff;cursor:pointer;font-size:13.5px;font-weight:500;
  transition:background .15s,border-color .15s,color .15s;white-space:nowrap;line-height:1.3;
}
.btn:hover{background:var(--blue-h);color:#fff;}
.btn.primary{background:var(--blue);} .btn.primary:hover{background:var(--blue-h);}
.btn.ghost{background:#fff;border-color:#cbd5e1;color:var(--txt2);}
.btn.ghost:hover{background:var(--gray-bg);color:var(--txt);border-color:#cbd5e1;}
.btn-out{background:#fff;border-color:#cbd5e1;color:var(--txt2);}
.btn-out:hover{background:var(--gray-bg);color:var(--txt);}
.btn.sm{padding:6px 12px;font-size:12.5px;}
.btn.block{display:block;width:100%;}
.btn:disabled{opacity:.55;cursor:not-allowed;}

/* ================= 表单 ================= */
label{display:block;margin:12px 0 6px;color:#374151;font-size:13px;font-weight:600;}
input,select,textarea{
  padding:8px 12px;border:1px solid #d1d5db;border-radius:6px;font-size:14px;width:100%;
  font-family:inherit;transition:border-color .15s,box-shadow .15s;background:#fff;color:#1f2937;
}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.15);}
textarea{resize:vertical;line-height:1.7;}
.code-row{display:flex;gap:8px;align-items:center;}
.code-row input{flex:1;}
.code-row .btn{white-space:nowrap;}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 16px;}
.f-sec{border:1px solid var(--line2);border-radius:10px;padding:2px 18px 13px;margin-bottom:14px;}
.f-sec h4{font-size:14px;color:var(--blue);margin:12px 0;font-weight:700;}
.chk{display:flex;align-items:flex-start;gap:8px;cursor:pointer;margin:11px 0;font-weight:400;color:var(--txt2);font-size:13px;}
.chk input{width:auto;margin-top:3px;flex-shrink:0;}
.chk-line{display:flex;align-items:center;}
.chk-line.wide{grid-column:1/-1;}
.save-btn{margin-bottom:50px;}

/* ================= 标签(胶囊) ================= */
.tag{display:inline-block;padding:2.5px 11px;border-radius:999px;font-size:12px;font-weight:600;line-height:1.5;white-space:nowrap;}
.tag-green{background:var(--green-bg);color:#15803d;}
.tag-gray{background:var(--gray-bg);color:var(--gray);}
.tag-red{background:var(--red-bg);color:#b91c1c;}
.tag-blue{background:#dbeafe;color:#1d4ed8;}
.tag-orange{background:var(--orange-bg);color:#c2410c;}

/* ================= 提示条 ================= */
.tip{background:var(--blue-bg);color:var(--blue);border-radius:8px;padding:10px 14px;font-size:13px;margin-bottom:14px;line-height:1.6;}
.empty{text-align:center;color:var(--muted);padding:38px 0;font-size:13px;}
.muted{color:var(--muted);font-size:12px;}

/* 页面操作栏 */
.page-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px;flex-wrap:wrap;}
.page-bar h3{font-size:16px;display:flex;align-items:center;gap:9px;}
.search{display:flex;gap:8px;}
.search input{width:210px;}

/* 代码块 */
code,.mono{font-family:Consolas,"Courier New",monospace;font-size:12px;background:#f8fafc;padding:2px 6px;border-radius:4px;color:#334155;}

/* ================= 登录分栏 ================= */
.auth-body{min-height:100vh;background:#e9edf3;display:flex;align-items:center;justify-content:center;padding:24px;}
.auth-wrap{display:flex;width:min(970px,94vw);min-height:566px;border-radius:18px;overflow:hidden;box-shadow:0 20px 60px rgba(15,23,42,.16);background:#fff;}

/* 左:深色渐变品牌栏 */
.auth-side{flex:0 0 45%;background:linear-gradient(160deg,#1e293b 0%,#312e81 58%,#6d28d9 100%);color:#cbd5e1;padding:34px 32px;display:flex;flex-direction:column;position:relative;}
.auth-side-logo{display:flex;align-items:center;gap:10px;color:#fff;font-size:15px;font-weight:700;margin-bottom:30px;}
.as-badge{width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.1);border:2px solid rgba(255,255,255,.25);display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0;}
.as-title{color:#fff;font-size:23px;font-weight:800;line-height:1.45;margin-bottom:9px;}
.as-sub{font-size:13px;color:#c7d2fe;margin-bottom:22px;}
.as-intro{list-style:none;}
.as-intro li{position:relative;padding:8px 0 8px 24px;font-size:13px;color:#cbd5e1;line-height:1.6;}
.as-intro li::before{content:"✓";position:absolute;left:0;top:8px;color:#a5b4fc;font-weight:700;}
.as-brand{margin-top:auto;font-size:11px;color:rgba(255,255,255,.4);letter-spacing:1px;}

/* 右:表单 */
.auth-main{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:36px 34px;min-width:0;}
.auth-card{width:100%;max-width:350px;}
.auth-title{font-size:21px;font-weight:800;color:#0f172a;margin-bottom:3px;}
.auth-sub{font-size:13px;color:var(--muted);margin-bottom:6px;}
.auth-btn{margin-top:20px;padding:11px;font-size:15px;font-weight:700;}
.auth-alt{display:flex;justify-content:space-between;gap:10px;margin-top:16px;font-size:13px;}
.auth-alt a{font-weight:600;}

/* ================= 弹窗 ================= */
.mask{position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:100;display:flex;align-items:center;justify-content:center;padding:20px;animation:fade .18s ease;}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal{background:#fff;border-radius:16px;width:min(560px,100%);max-height:86vh;display:flex;flex-direction:column;box-shadow:0 24px 60px rgba(15,23,42,.28);animation:pop .2s ease;overflow:hidden;}
.modal.wide{width:min(800px,100%);}
@keyframes pop{from{transform:translateY(14px) scale(.97);opacity:0}to{transform:none;opacity:1}}
.modal-h{display:flex;align-items:center;justify-content:space-between;padding:15px 20px;border-bottom:1px solid #f1f5f9;flex-shrink:0;gap:12px;}
.modal-h b{font-size:15px;font-weight:700;color:#0f172a;word-break:break-all;}
.modal-x{border:none;background:#f1f5f9;color:var(--gray);width:30px;height:30px;border-radius:50%;cursor:pointer;font-size:16px;line-height:1;flex-shrink:0;transition:all .15s;}
.modal-x:hover{background:var(--red-bg);color:#b91c1c;}
.modal-b{padding:18px 20px;overflow-y:auto;flex:1;}
.modal-f{padding:13px 20px 16px;display:flex;gap:9px;justify-content:flex-end;border-top:1px solid #f1f5f9;flex-shrink:0;flex-wrap:wrap;}
.modal-b pre{
  background:#0f172a;color:#a7f3d0;padding:15px;border-radius:8px;font-size:12px;line-height:1.7;
  font-family:Consolas,Menlo,monospace;white-space:pre-wrap;word-break:break-all;max-height:400px;overflow-y:auto;
}
.agr-box{background:var(--gray-bg);border-radius:8px;padding:13px 15px;font-size:13px;color:var(--txt2);line-height:1.85;white-space:pre-wrap;max-height:52vh;overflow-y:auto;}

/* ================= Toast(右下角) ================= */
#toast-wrap{position:fixed;right:24px;bottom:24px;z-index:9999;display:flex;flex-direction:column;gap:9px;max-width:88vw;}
.toast{
  padding:12px 19px;border-radius:10px;color:#fff;font-size:13.5px;font-weight:600;
  box-shadow:0 10px 30px rgba(15,23,42,.26);animation:pop .22s ease;line-height:1.5;
}
.toast.ok{background:#15803d;}
.toast.err{background:#b91c1c;}

/* ================= 响应式 ================= */
@media (max-width:900px){
  .layout{flex-direction:column;}
  .sidebar{width:100%;height:auto;position:static;flex-direction:column;}
  .side-nav{display:flex;overflow-x:auto;padding:4px 8px;}
  .side-link{flex:0 0 auto;padding:9px 13px;}
  .side-foot{display:none;}
  .container{padding:16px 14px;}
  .topbar{padding:0 14px;}
  .topbar-name{display:none;}
  .card{overflow-x:auto;}
  .auth-wrap{flex-direction:column;width:min(480px,94vw);min-height:0;}
  .auth-side{flex:none;padding:26px 24px;}
  .as-intro{display:none;}
  .as-brand{margin-top:14px;}
}
@media (max-width:600px){
  .stats{grid-template-columns:repeat(2,1fr);gap:10px;}
  .stat{padding:14px;}
  .stat .num{font-size:21px;}
  .grid2{grid-template-columns:1fr;}
  .auth-main{padding:28px 22px;}
  #toast-wrap{right:14px;bottom:14px;left:14px;}
  .toast{max-width:none;}
  .quick-row .btn{flex:1;}
}
