/* ============================================================
   业务统一管理平台 — Claude 风格样式
   浅色暖纸色系 / OKLCH / 系统字体 + 衬线标题 / 大留白
   ============================================================ */

:root{
  --bg:            oklch(0.973 0.006 90);
  --surface:       oklch(0.999 0.002 90);
  --surface-2:     oklch(0.982 0.006 88);
  --text:          oklch(0.275 0.012 75);
  --text-2:        oklch(0.47 0.014 75);
  --muted:         oklch(0.60 0.012 78);
  --border:        oklch(0.905 0.006 88);
  --border-strong: oklch(0.845 0.010 85);
  --accent:        oklch(0.615 0.155 42);
  --accent-hover:  oklch(0.555 0.155 42);
  --accent-soft:   oklch(0.955 0.022 48);
  --ok:            oklch(0.585 0.125 155);
  --ok-soft:       oklch(0.955 0.030 155);
  --warn:          oklch(0.685 0.135 72);
  --warn-soft:     oklch(0.960 0.040 82);
  --danger:        oklch(0.565 0.185 27);
  --danger-soft:   oklch(0.958 0.028 27);
  --radius:        12px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 2px oklch(0.28 0.02 70 / .05);
  --shadow-md:     0 4px 16px oklch(0.28 0.02 70 / .07), 0 1px 3px oklch(0.28 0.02 70 / .05);
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-serif: "Iowan Old Style", "Songti SC", "Times New Roman", Georgia, ui-serif, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*{ box-sizing:border-box; }

/* display:flex 等作者样式会覆盖 [hidden] 的 UA 默认值，必须显式压回 */
[hidden]{ display:none !important; }

html,body{ height:100%; }

body{
  margin:0;
  font-family:var(--font-sans);
  font-size:14px;
  line-height:1.6;
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3{ font-family:var(--font-serif); font-weight:500; letter-spacing:-0.01em; margin:0; }
h1{ font-size:26px; }
h2{ font-size:22px; }
h3{ font-size:16px; }

p{ margin:0; }
button{ font:inherit; color:inherit; }
input,select{ font:inherit; }

/* ---------- 认证页 ---------- */
.auth-wrap{
  min-height:100vh; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:20px; padding:40px 20px;
}
.auth-card{
  width:100%; max-width:460px; background:var(--surface);
  border:1px solid var(--border); border-radius:16px;
  padding:44px 40px 36px; box-shadow:var(--shadow-md);
}
.auth-brand{ text-align:center; margin-bottom:28px; }
.brand-mark{
  width:40px; height:40px; margin:0 auto 14px; border-radius:11px;
  background:var(--accent); color:oklch(0.99 0.01 60);
  display:flex; align-items:center; justify-content:center; font-size:17px;
}
.auth-sub{ color:var(--muted); font-size:13px; margin-top:8px; }
.auth-notice{
  background:var(--warn-soft); border:1px solid oklch(0.90 0.05 80);
  color:oklch(0.45 0.09 65); border-radius:var(--radius-sm);
  padding:10px 13px; font-size:13px; margin-bottom:20px;
}
.auth-footer{ color:var(--muted); font-size:12px; }

.form-title{ font-size:19px; margin-bottom:12px; }
.form-desc{ color:var(--text-2); font-size:13px; margin-bottom:18px; line-height:1.7; }
.form-foot{ color:var(--muted); font-size:12px; margin-top:14px; text-align:center; }
.pw-strength{ font-size:12px; margin:-4px 0 14px; color:var(--muted); }
.pw-strength.s1{ color:var(--danger); }
.pw-strength.s2{ color:var(--warn); }
.pw-strength.s3{ color:var(--ok); }

.field{ display:block; margin-bottom:16px; }
.field > span{ display:block; font-size:13px; color:var(--text-2); margin-bottom:7px; }

/* ---------- 图形验证码 ---------- */
.captcha-row{ display:flex; gap:10px; align-items:stretch; }
.captcha-row > input{ flex:1 1 auto; min-width:0; }
.captcha-canvas{
  flex:0 0 auto; border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  cursor:pointer; background:var(--surface-2); display:block;
}
.captcha-row .btn{ flex:0 0 auto; }
form code{
  font-family:var(--font-mono); font-size:12px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:4px; padding:1px 5px;
}
.input,.field input,.field select{
  width:100%; padding:10px 13px; border:1px solid var(--border-strong);
  border-radius:var(--radius-sm); background:var(--surface);
  color:var(--text); outline:none; transition:border-color .15s, box-shadow .15s;
}
.field input:focus,.input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px oklch(0.615 0.155 42 / .12);
}
.input::placeholder,.field input::placeholder{ color:oklch(0.72 0.01 80); }

/* ---------- 按钮 ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:9px 16px; border-radius:var(--radius-sm); border:1px solid transparent;
  cursor:pointer; font-size:13.5px; transition:background .15s, border-color .15s, color .15s;
  white-space:nowrap;
}
.btn-primary{ background:var(--accent); color:oklch(0.99 0.01 60); }
.btn-primary:hover{ background:var(--accent-hover); }
.btn-ghost{ background:var(--surface); border-color:var(--border-strong); color:var(--text); }
.btn-ghost:hover{ background:var(--surface-2); border-color:var(--muted); }
.btn-danger-ghost{ background:var(--surface); border-color:oklch(0.88 0.05 27); color:var(--danger); }
.btn-danger-ghost:hover{ background:var(--danger-soft); }
.btn-sm{ padding:6px 11px; font-size:12.5px; }
.btn-block{ width:100%; padding:11px; font-size:14px; }
.btn-file{ position:relative; }
.btn-row{ display:flex; gap:10px; flex-wrap:wrap; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.link-btn{
  background:none; border:none; padding:0; cursor:pointer;
  color:var(--accent); font-size:12.5px;
}
.link-btn:hover{ text-decoration:underline; }
.link-btn.danger{ color:var(--danger); }

/* ---------- 应用布局 ---------- */
.app-wrap{ display:flex; min-height:100vh; }

.sidebar{
  width:236px; flex:0 0 236px; background:var(--surface-2);
  border-right:1px solid var(--border);
  display:flex; flex-direction:column; padding:24px 14px 18px;
  position:sticky; top:0; height:100vh;
}
.side-brand{
  display:flex; align-items:center; gap:10px; padding:0 8px 22px;
  font-family:var(--font-serif); font-size:15px;
}
.side-brand .brand-mark{ width:26px; height:26px; font-size:12px; margin:0; border-radius:8px; }
.side-nav{ display:flex; flex-direction:column; gap:2px; flex:1; }
.nav-item{
  text-align:left; padding:9px 12px; border-radius:var(--radius-sm);
  background:none; border:none; cursor:pointer; color:var(--text-2);
  transition:background .15s, color .15s;
}
.nav-item:hover{ background:oklch(0.955 0.008 88); color:var(--text); }
.nav-item.active{ background:var(--accent-soft); color:oklch(0.46 0.14 42); font-weight:500; }

.side-foot{ border-top:1px solid var(--border); padding-top:14px; }
.session-box{ padding:0 8px 10px; }
.session-label{ font-size:11.5px; color:var(--muted); }
.session-timer{ font-family:var(--font-mono); font-size:15px; color:var(--text); }

.main{ flex:1; min-width:0; padding:0 0 60px; }
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:26px 40px 18px; border-bottom:1px solid var(--border);
  background:oklch(0.98 0.005 90 / .8); position:sticky; top:0; z-index:5;
  backdrop-filter:saturate(1.4) blur(6px);
}
.top-chip{
  font-size:12px; color:var(--text-2); background:var(--surface);
  border:1px solid var(--border); border-radius:999px; padding:5px 12px;
}
.page{ padding:26px 40px 0; max-width:1120px; }

/* ---------- 统计卡 ---------- */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px; }
.stat-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow-sm);
}
.stat-num{ font-family:var(--font-serif); font-size:28px; line-height:1.2; }
.stat-label{ font-size:12.5px; color:var(--muted); margin-top:2px; }

/* ---------- 面板 ---------- */
.panel{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px 22px; margin-bottom:20px;
  box-shadow:var(--shadow-sm);
}
.panel-grid{ display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.panel-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:14px;
}
.panel-head h3{ font-size:15px; }

/* ---------- 表格 ---------- */
.table{ width:100%; border-collapse:collapse; }
.table th{
  text-align:left; font-weight:500; font-size:11.5px; letter-spacing:.04em;
  text-transform:uppercase; color:var(--muted);
  padding:0 12px 10px 0; border-bottom:1px solid var(--border);
}
.table td{
  padding:13px 12px 13px 0; border-bottom:1px solid oklch(0.945 0.005 88);
  vertical-align:top; font-size:13.5px;
}
.table tr:last-child td{ border-bottom:none; }
.th-actions{ text-align:right; }
.td-actions{ text-align:right; white-space:nowrap; }
.td-actions .link-btn{ margin-left:12px; }
.mono{ font-family:var(--font-mono); font-size:12.5px; }
.dim{ color:var(--muted); }
.strong{ font-weight:500; }
.empty{ color:var(--muted); font-size:13px; padding:18px 0 6px; text-align:center; }

/* ---------- 标签 ---------- */
.tag{
  display:inline-block; padding:2px 9px; border-radius:999px;
  font-size:11.5px; line-height:1.7; border:1px solid transparent;
}
.tag-info{ background:var(--surface-2); color:var(--text-2); border-color:var(--border); }
.tag-ok{ background:var(--ok-soft); color:oklch(0.42 0.11 155); }
.tag-warn{ background:var(--warn-soft); color:oklch(0.48 0.11 70); }
.tag-danger{ background:var(--danger-soft); color:oklch(0.47 0.16 27); }
.tag-accent{ background:var(--accent-soft); color:oklch(0.46 0.14 42); }

/* ---------- 工具条 ---------- */
.toolbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:16px; flex-wrap:wrap;
}
.toolbar-group{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.input.search{ width:280px; }
.input.select{ width:auto; padding-right:30px; }

/* ---------- 服务卡片 ---------- */
.svc-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; }
.svc-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow-sm);
}
.svc-card-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.svc-name{ font-size:14.5px; font-weight:500; }
.svc-addr{ font-family:var(--font-mono); font-size:12px; color:var(--text-2); margin-top:4px; word-break:break-all; }
.svc-note{ font-size:12.5px; color:var(--muted); margin-top:10px; }
.svc-foot{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-top:16px; padding-top:12px; border-top:1px solid oklch(0.945 0.005 88);
}
.svc-foot .dim{ font-size:11.5px; }

/* ---------- 列表 ---------- */
.svc-mini{ list-style:none; margin:0; padding:0; }
.svc-mini li{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:9px 0; border-bottom:1px solid oklch(0.945 0.005 88); font-size:13.5px;
}
.svc-mini li:last-child{ border-bottom:none; }
.sec-list{ list-style:none; margin:0; padding:0; }
.sec-list li{
  display:flex; align-items:flex-start; gap:10px;
  padding:8px 0; font-size:13.5px; color:var(--text-2);
}
.sec-list li::before{
  content:"✓"; color:var(--ok); font-weight:600; flex:0 0 auto; font-size:12px; margin-top:2px;
}
.sec-list li.off::before{ content:"○"; color:var(--muted); }
.kv-list{ margin:0; padding:0; }
.kv-list div{
  display:flex; justify-content:space-between; gap:12px;
  padding:8px 0; border-bottom:1px solid oklch(0.945 0.005 88); font-size:13px;
}
.kv-list div:last-child{ border-bottom:none; }
.kv-list dt{ color:var(--muted); }
.kv-list dd{ margin:0; text-align:right; }

/* ---------- 对话框 ---------- */
.dlg{
  border:1px solid var(--border); border-radius:14px; padding:0;
  width:min(520px,92vw); color:var(--text); background:var(--surface);
  box-shadow:0 18px 50px oklch(0.28 0.02 70 / .18);
}
.dlg::backdrop{ background:oklch(0.28 0.02 70 / .28); }
.dlg form{ padding:26px 28px 22px; }
.dlg h3{ font-size:18px; margin-bottom:14px; }
.dlg-msg{ font-size:13px; color:var(--text-2); margin-bottom:16px; line-height:1.7; }
.dlg-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }
.dlg-body .field:last-child{ margin-bottom:0; }
.dlg-body .input + .input{ margin-top:10px; }
.pw-reveal{
  font-family:var(--font-mono); font-size:15px; letter-spacing:.02em;
  background:var(--surface-2); border:1px dashed var(--border-strong);
  border-radius:var(--radius-sm); padding:14px 16px; word-break:break-all;
  min-height:48px;
}
.countdown{ font-size:12px; color:var(--muted); margin-top:10px; }

/* ---------- Toast ---------- */
.toast-box{
  position:fixed; right:22px; bottom:22px; z-index:50;
  display:flex; flex-direction:column; gap:8px; align-items:flex-end;
}
.toast{
  background:var(--text); color:oklch(0.98 0.005 90);
  border-radius:var(--radius-sm); padding:10px 15px; font-size:13px;
  box-shadow:var(--shadow-md); max-width:340px; animation:toast-in .18s ease-out;
}
.toast.ok{ background:oklch(0.42 0.09 155); }
.toast.err{ background:oklch(0.45 0.16 27); }
@keyframes toast-in{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }

/* ---------- 响应式 ---------- */
@media (max-width:1080px){
  .stat-grid{ grid-template-columns:repeat(2,1fr); }
  .panel-grid{ grid-template-columns:1fr; }
}
@media (max-width:820px){
  .app-wrap{ flex-direction:column; }
  .sidebar{
    width:100%; flex:none; height:auto; position:static;
    flex-direction:row; align-items:center; gap:10px; padding:12px 16px;
    border-right:none; border-bottom:1px solid var(--border); overflow-x:auto;
  }
  .side-brand{ padding:0 12px 0 0; }
  .sidebar .side-brand span{ display:none; }
  .side-nav{ flex-direction:row; flex:1; }
  .side-foot{ border-top:none; padding-top:0; display:flex; align-items:center; gap:10px; }
  .session-box{ padding:0; }
  .session-label{ display:none; }
  .topbar{ padding:18px 20px 14px; }
  .page{ padding:20px 20px 0; }
  .input.search{ width:100%; }
}
