:root {
  --bg: #EEF1F6; --panel: #FFFFFF; --panel-2: #F1F5F9; --sidebar: #FFFFFF; --border: #DDE3EC; --input-bg: #F8FAFC; --topbar-bg: rgba(238,241,246,0.88);
  --text: #0F172A; --muted: #64748B; --primary: #0F172A; --primary-h: #1E293B;
  --blue: #2563EB; --green: #059669; --red: #DC2626; --yellow: #D97706;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 1px 2px rgba(15,23,42,0.04);
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
code, pre, .terminal, .keydump { font-family: "JetBrains Mono", Consolas, Monaco, monospace; }
body { background: var(--bg); color: var(--text); height: 100vh; display: flex; overflow: hidden; font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "cv11" 1; }
.sidebar { width: 252px; flex: 0 0 252px; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.brand { padding: 18px 16px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand-logo { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.logo-mark { flex: 0 0 auto; }
.brand-title { font-size: 13.5px; font-weight: 700; letter-spacing: .08em; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #EFF6FF; color: #2563EB; }
.badge-ok { background: #ECFDF5; color: #059669; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 8px 8px; }
.nav-section { padding: 14px 10px 6px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; letter-spacing: .03em; }
.nav-group { padding: 0 2px; }
.proj-list { overflow-y: auto; padding: 2px 2px; max-height: 240px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 11px; border-radius: 8px; cursor: pointer; margin-bottom: 3px; color: var(--text); }
.nav-item:hover { background: #F8FAFC; }
.nav-item { position: relative; }
.nav-item.active { background: #F1F5F9; color: #0F172A; font-weight: 700; box-shadow: none; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2.5px; border-radius: 0 2px 2px 0; background: #0F172A; }
.nav-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.nav-item .ic { color: var(--muted); flex: 0 0 auto; }
.nav-item:hover .ic { color: var(--text); }
.nav-item.active .ic { color: #0F172A; }
.ic { display: inline-block; vertical-align: -2px; flex: 0 0 auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #CBD5E1; display: inline-block; margin-right: 8px; flex: 0 0 auto; }
.dot.on { background: var(--green); box-shadow: none; animation: dot-breathe 2.4s ease-in-out infinite; }
.dot.sleep { background: var(--yellow); box-shadow: none; }
.dot.err { background: var(--red); box-shadow: none; animation: dot-breathe-red 1.8s ease-in-out infinite; }
.alert-bar { background: #FEF2F2; border-bottom: 1px solid #FECACA; color: #DC2626; padding: 10px 32px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alert-bar .alert-msg { flex: 1; min-width: 240px; font-weight: 600; }
.sidebar-identity { padding: 12px; border-top: 1px solid var(--border); }
.identity-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: var(--shadow-sm); }
.identity-top { display: flex; align-items: center; gap: 10px; }
.identity-avatar { width: 36px; height: 36px; border-radius: 50%; background: #0F172A; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: 0 0 36px; user-select: none; }
.identity-meta { flex: 1; min-width: 0; }
.identity-actions { display: flex; gap: 8px; margin-top: 10px; }
.identity-actions .btn { flex: 1; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; width: 100%; }
.topbar { height: 58px; padding: 0 32px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--topbar-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); flex: 0 0 auto; position: sticky; top: 0; z-index: 20; }
#topTitle .ic { color: #2563EB; margin-right: 4px; }
.content { flex: 1; overflow-y: auto; width: 100%; max-width: 100%; margin: 0; padding: 24px 32px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 15px; margin-bottom: 14px; color: var(--text); display: flex; align-items: center; justify-content: space-between; }
.card h3 .ic { color: #2563EB; }
.h-title { display: inline-flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); }
input, select, textarea { background: var(--input-bg); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 9px 11px; font-size: 13px; outline: none; width: 100%; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus { background: #FFFFFF; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.btn { border: 1px solid var(--primary); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff; display: inline-flex; align-items: center; gap: 6px; justify-content: center; transition: background .15s ease; }
.btn:hover { background: var(--primary-h); }
.btn .ic { color: currentColor; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { background: #FFFFFF; color: var(--text); border: 1px solid #CBD5E1; }
.btn-ghost:hover { background: #F8FAFC; border-color: #94A3B8; }
.btn-green { background: #059669; border-color: #059669; }
.btn-green:hover { background: #047857; border-color: #047857; }
.btn-red { background: #DC2626; border-color: #DC2626; }
.btn-red:hover { background: #B91C1C; border-color: #B91C1C; }
.btn-pill { border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 500; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.tab { padding: 7px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tab .ic { color: var(--muted); }
.tab.active { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.tab.active .ic { color: #2563EB; }
.terminal { background: #0F172A; color: #E2E8F0; border: 1px solid #1E293B; border-radius: 8px; padding: 14px; height: 480px; overflow-y: auto; font-family: Consolas, Monaco, monospace; font-size: 12.5px; line-height: 1.65; }
.log-INFO { color: #E2E8F0; } .log-SUCCESS { color: #34D399; } .log-WARN { color: #FBBF24; } .log-ERROR { color: #F87171; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #CBD5E1; border-radius: 999px; transition: .2s; }
.slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider:before { transform: translateX(20px); }
.toast { position: fixed; right: 20px; bottom: 20px; background: #FFFFFF; border: 1px solid var(--border); padding: 10px 16px; border-radius: 8px; display: none; z-index: 300; max-width: 480px; box-shadow: var(--shadow-md); }
.muted { color: var(--muted); font-size: 12px; }
.auth-mask { position: fixed; inset: 0; background: #F8FAFC; display: none; align-items: center; justify-content: center; z-index: 250; }
.auth-mask.show { display: flex; }
html[data-theme="dark"] .auth-mask { background: #0B1220; }
body:has(.auth-mask.show) .sidebar,
body:has(.auth-mask.show) .main { display: none !important; }
.auth-box { width: 100%; max-width: 400px; margin: 0 16px; background: #FFFFFF; border: 1px solid #E2E8F0; border-radius: 14px; padding: 32px 28px 24px; box-shadow: 0 10px 30px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.04); }
html[data-theme="dark"] .auth-box { background: var(--panel); border-color: rgba(148,163,184,0.16); box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; display: block; margin: 0 auto 10px; }
.auth-brand-title { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.auth-brand-sub { font-size: 12.5px; color: #64748B; margin-top: 4px; }
.auth-back { text-align: center; margin-top: 18px; font-size: 12.5px; }
.auth-back a { color: #94A3B8; text-decoration: none; }
.auth-back a:hover { color: #64748B; text-decoration: underline; }
.acc-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.acc-card-top { display: flex; align-items: flex-start; gap: 14px; }
.acc-avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: 0 0 52px; background: #E2E8F0; display: flex; align-items: center; justify-content: center; }
.acc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: #E2E8F0; display: block; }
.acc-info { flex: 1; min-width: 0; }
.acc-name { font-weight: 700; color: var(--text); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.acc-info .muted { margin: 2px 0; }
.acc-info code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
.profile-editor { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.profile-editor-row { display: flex; gap: 18px; margin-bottom: 6px; flex-wrap: wrap; }
.profile-fields { flex: 1; min-width: 280px; }
.profile-avatar-box { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.profile-avatar-box input[type=file] { width: 150px; font-size: 11px; padding: 5px; }
.sub-group { border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 14px; }
.sub-title { font-size: 13px; color: #475569; font-weight: 600; margin-bottom: 10px; }
.preset-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.preset-bar .btn-sm { border-radius: 999px; padding: 4px 13px; font-size: 12px; font-weight: 500; }
.humanize-master { display: flex; align-items: center; gap: 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.humanize-master .switch { transform: scale(1.12); }
.humanize-block { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hcard { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.hcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.hcard-title { font-weight: 700; color: var(--text); font-size: 13px; }
.hcard.off { opacity: .5; }
.hcard.off input[type=number] { pointer-events: none; }
.humanize-block.off { opacity: .5; pointer-events: none; }
details.adv-panel { border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; }
details.adv-panel summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--text); font-size: 13px; user-select: none; }
details.adv-panel .adv-body { padding-bottom: 14px; }
.pick-row { display: flex; align-items: center; gap: 10px; }
.pick-chk { width: 16px !important; height: 16px !important; min-width: 16px; flex: 0 0 auto; margin: 0; accent-color: #0F172A; }
.pick-name { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.pick-name .uname { color: var(--muted); font-weight: 400; }
.pick-extra { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.patrol-countdown { color: #2563EB; font-weight: 600; }
.selfcheck-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 260; }
.selfcheck-mask.show { display: flex; }
.selfcheck-box { width: 820px; max-width: 94vw; max-height: 88vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; box-shadow: var(--shadow-md); }
.sc-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.sc-badge.green { background: #ECFDF5; color: #059669; }
.sc-badge.yellow { background: #FFFBEB; color: #D97706; }
.sc-badge.red { background: #FEF2F2; color: #DC2626; }
.sc-badge.gray { background: #F1F5F9; color: #64748B; }
.sc-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: var(--bg); }
.sc-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.sc-title { font-size: 13px; color: #475569; font-weight: 600; margin: 14px 0 6px; }
.metrics-bar { display: flex; align-items: center; gap: 16px; background: #FFFFFF; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.metrics-title { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.metric-cell { display: flex; flex-direction: column; gap: 2px; min-width: 118px; }
.metric-cell .m-label { font-size: 11px; color: var(--muted); }
.metric-cell b { font-size: 16px; color: var(--text); font-weight: 700; }
.metric-cell .m-sub { font-size: 11px; color: var(--muted); }
.metric-cell.hot { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 7px; padding: 6px 9px; }
.metric-cell.hot b { color: #D97706; }
.ch-task-list { max-height: 200px; overflow-y: auto; padding: 2px 2px; }
.ch-comment-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ch-comment-table th, .ch-comment-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ch-disabled-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; margin-bottom: 5px; background: var(--bg); opacity: 0.45; cursor: not-allowed; }
.identity-tenant { font-weight: 700; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-user { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; display: inline-block; }
.tenant-badge.active { background: #ECFDF5; color: #059669; }
.tenant-badge.expiring { background: #FFFBEB; color: #D97706; }
.tenant-badge.inactive { background: #FEF2F2; color: #DC2626; }
.tenant-badge.admin { background: #EFF6FF; color: #2563EB; }
.forbid-bar { background: #FFFBEB; border-bottom: 1px solid #FDE68A; color: #B45309; padding: 10px 32px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.forbid-bar .forbid-msg { flex: 1; min-width: 240px; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.table code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
.keydump { width: 100%; min-height: 150px; font-family: Consolas, Monaco, monospace; font-size: 12.5px; line-height: 1.6; background: #0F172A; color: #E2E8F0; border: 1px solid #1E293B; border-radius: 8px; padding: 12px; resize: vertical; }

/* ---- 全局概览看板 ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; transition: border-color .18s ease; }
.kpi-card:hover { border-color: #CBD5E1; }
.kpi-card.clickable { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.kpi-card.clickable:hover { border-color: #94A3B8; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.kpi-icon.terracotta { background: #EFF6FF; color: #2563EB; }
.kpi-icon.green { background: #ECFDF5; color: #059669; }
.kpi-icon.amber { background: #FFFBEB; color: #D97706; }
.kpi-icon.slate { background: #F1F5F9; color: #64748B; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.kpi-value .kpi-frac { color: var(--muted); font-weight: 600; font-size: 15px; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ov-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ov-head h3 { margin-bottom: 0; }
.ov-legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ov-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.ov-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--bg); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ov-row:hover { border-color: #94A3B8; background: #fff; }
.ov-row .dot, .ov-legend .dot { margin-right: 0; }
.ov-kind { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); flex: 0 0 auto; }
.ov-name { font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-acc { color: var(--muted); font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-status { margin-left: auto; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.ov-empty { padding: 20px; text-align: center; }
.quick-actions { display: flex; flex-direction: column; gap: 10px; }
.quick-btn { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); width: 100%; text-align: left; transition: border-color .15s ease, background .15s ease; }
.quick-btn:hover { background: #fff; border-color: #94A3B8; }
.quick-btn .ic { color: #2563EB; }
.quick-btn .q-hint { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; }

.nav-add { width: 22px; height: 22px; border-radius: 50%; border: none; background: #E2E8F0; color: var(--muted); font-size: 15px; line-height: 1; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 0 1px; transition: background .15s ease, color .15s ease, transform .15s ease; }
.nav-add:hover { background: #0F172A; color: #fff; }

/* ---- Bento 磁贴网格 ---- */
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, auto)); gap: 14px; margin-bottom: 16px; }
.tile-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 20px; min-height: 104px; text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .18s ease; }
.tile-btn:hover { border-color: #94A3B8; }
.tile-btn .ic { color: #2563EB; }
.tile-btn .t-hint { font-size: 11px; font-weight: 400; color: var(--muted); }

@keyframes dot-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,.35); } 50% { box-shadow: 0 0 0 5px rgba(5,150,105,0); } }
@keyframes dot-breathe-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.35); } 50% { box-shadow: 0 0 0 5px rgba(220,38,38,0); } }
@keyframes dot-breathe-amber { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,.35); } 50% { box-shadow: 0 0 0 5px rgba(217,119,6,0); } }
.dot.sleep { animation: dot-breathe-amber 3s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .dot.on, .dot.sleep, .dot.err { animation: none; } .kpi-card:hover, .tile-btn:hover { transform: none; } }

@media (max-width: 900px) {
  .content { padding: 16px 14px; }
  .topbar { padding: 0 18px; }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
}

/* ---- 概览页 Bento 工作台 ---- */
.welcome-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 16px; border-radius: 10px; border: 1px solid #E2E8F0; background: #FFFFFF; box-shadow: var(--shadow-sm); }
.wb-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.wb-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wb-hint { font-size: 12px; color: var(--muted); }
.wb-right { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-value { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 30px; }
.ov-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.overview-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.ov-card-row { padding: 12px 14px; gap: 12px; }
.ov-av { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff; background: #2563EB; }
.ov-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ov-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ov-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #F1F5F9; color: var(--muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-tag .ic { flex: 0 0 auto; }
.ov-ops { display: flex; gap: 6px; flex: 0 0 auto; }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.sum-row span { color: var(--muted); }
.sum-row:last-of-type { border-bottom: none; }
@media (max-width: 900px) { .overview-grid { grid-template-columns: 1fr; } }

.back-link { display: block; padding: 10px 18px; font-size: 12px; color: var(--muted); text-decoration: none; border-top: 1px solid var(--border); transition: color .15s ease, background .15s ease; }
.back-link:hover { color: #0F172A; background: #F8FAFC; }

/* ===== theme toggle ===== */
.theme-toggle { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin-left: 10px; flex: 0 0 auto; transition: background .15s ease; }
.theme-toggle:hover { background: var(--panel-2); }
.theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ic-sun { display: inline; }
.topbar-right { display: flex; align-items: center; }

/* ===== dark theme ===== */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1120; --panel: #111827; --sidebar: #111827; --panel-2: #1E293B; --border: #263244;
  --text: #F1F5F9; --muted: #94A3B8; --primary: #F8FAFC; --primary-h: #E2E8F0;
  --input-bg: #1E293B; --topbar-bg: rgba(11,17,32,0.88);
  --shadow-sm: none; --shadow-md: none;
}
html[data-theme="dark"] .btn { color: #0F172A; }
html[data-theme="dark"] .btn-green, html[data-theme="dark"] .btn-red { color: #fff; }
html[data-theme="dark"] .btn-ghost { background: #1E293B; color: var(--text); border-color: #263244; }
html[data-theme="dark"] .btn-ghost:hover { background: #263244; border-color: #94A3B8; }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { background: #0B1120; border-color: #94A3B8; box-shadow: 0 0 0 3px rgba(148,163,184,.18); }
html[data-theme="dark"] .nav-item:hover { background: #1E293B; }
html[data-theme="dark"] .nav-item.active { background: #1E293B; color: #F8FAFC; }
html[data-theme="dark"] .nav-item.active::before { background: #F8FAFC; }
html[data-theme="dark"] .nav-item.active .ic { color: #F8FAFC; }
html[data-theme="dark"] .identity-avatar { background: #F8FAFC; color: #0F172A; }
html[data-theme="dark"] .badge { background: #1E293B; color: #93C5FD; }
html[data-theme="dark"] .badge-ok { background: #064E3B; color: #6EE7B7; }
html[data-theme="dark"] .alert-bar { background: #3B1219; border-color: #7F1D1D; color: #FCA5A5; }
html[data-theme="dark"] .dot { background: #475569; }

/* ===== config workspace ===== */
.cfg-anchor-bar { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; margin-bottom: 14px; background: #E2E8F0; border-radius: 10px; width: fit-content; max-width: 100%; }
html[data-theme="dark"] .cfg-anchor-bar { background: #1E293B; }
.cfg-anchor-btn { border: 0; background: transparent; color: #475569; border-radius: 8px; padding: 7px 16px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.cfg-anchor-btn:hover { color: #0F172A; }
.cfg-anchor-btn.active { background: #0F172A; color: #fff; font-weight: 700; box-shadow: 0 1px 3px rgba(15,23,42,.3); }
html[data-theme="dark"] .cfg-anchor-btn { color: #94A3B8; }
html[data-theme="dark"] .cfg-anchor-btn:hover { color: #F8FAFC; }
html[data-theme="dark"] .cfg-anchor-btn.active { background: #F8FAFC; color: #0F172A; }
.cfg-pane { display: none; }
.cfg-pane.active { display: block; }
#cfg-sec-5 > .adv-panel > summary { display: none; }
.cfg-workspace { display: flex; align-items: flex-start; gap: 20px; }
.cfg-main { flex: 1; min-width: 0; }
.cfg-rail { position: sticky; top: 16px; align-self: flex-start; width: 220px; flex: 0 0 220px; }
.cfg-rail-card { background: #FFFFFF; border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
html[data-theme="dark"] .cfg-rail-card { background: var(--panel); }
.cfg-rail-card .btn { width: 100%; }
.cfg-rail-card .cfg-save { padding: 11px 14px; font-size: 14px; }
.cfg-rail-title { font-size: 11px; color: var(--muted); letter-spacing: .06em; margin-top: 4px; }
.cfg-rail-sep { height: 1px; background: var(--border); margin: 4px 0; border: 0; }
.cfg-rail-danger { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1099px) {
  .cfg-workspace { flex-direction: column; align-items: stretch; }
  .cfg-rail { position: static; width: 100%; flex: 0 0 auto; }
  .cfg-rail-card { position: static; }
}

/* ===== SaaS auth tabs / trial / top sub bar ===== */
.auth-tabs{display:flex;gap:6px;margin-bottom:14px;background:rgba(127,127,127,.12);padding:4px;border-radius:10px}
.auth-tab{flex:1;border:0;background:transparent;color:inherit;padding:8px 0;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;opacity:.75}
.auth-tab.active{background:#000;color:#fff;opacity:1}
[data-theme="dark"] .auth-tab.active,.dark .auth-tab.active{background:#000;color:#fff;box-shadow:0 0 0 1px rgba(255,255,255,.35)}
.auth-trial-tip{margin-bottom:12px;padding:8px 10px;border-radius:8px;font-size:12.5px;line-height:1.5;background:#ecfdf3;color:#067647;border:1px solid #abefc6}
[data-theme="dark"] .auth-trial-tip,.dark .auth-trial-tip{background:rgba(18,183,106,.15);color:#6ce9a6;border-color:rgba(18,183,106,.4)}
.top-sub-bar{display:flex;align-items:center;gap:6px;margin-right:8px;font-size:12px;white-space:nowrap}
.top-sub-bar .sub-tag{padding:2px 8px;border-radius:999px;font-weight:600;background:rgba(127,127,127,.15)}
.top-sub-bar .sub-tag.warn{background:#fff4e5;color:#b54708}
.top-sub-bar .sub-tag.bad{background:#fee4e2;color:#b42318}
.top-sub-bar .sub-tag.ok{background:#ecfdf3;color:#067647}
[data-theme="dark"] .top-sub-bar .sub-tag.warn,.dark .top-sub-bar .sub-tag.warn{background:rgba(247,144,9,.2);color:#fdb022}
[data-theme="dark"] .top-sub-bar .sub-tag.bad,.dark .top-sub-bar .sub-tag.bad{background:rgba(240,68,56,.2);color:#fda29b}
[data-theme="dark"] .top-sub-bar .sub-tag.ok,.dark .top-sub-bar .sub-tag.ok{background:rgba(18,183,106,.2);color:#6ce9a6}
.top-sub-bar .btn{padding:2px 8px;font-size:12px;line-height:1.6}
.platform-ready-banner{margin-bottom:12px;padding:10px 12px;border-radius:8px;font-size:13px;background:#ecfdf3;color:#067647;border:1px solid #abefc6}
[data-theme="dark"] .platform-ready-banner,.dark .platform-ready-banner{background:rgba(18,183,106,.15);color:#6ce9a6;border-color:rgba(18,183,106,.4)}

/* persona presets */
.persona-preset-title{font-size:12px;color:var(--muted);margin:2px 0 8px;font-weight:600}
.persona-preset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px;margin-bottom:12px}
.persona-preset-card{position:relative;display:flex;flex-direction:column;gap:8px;padding:12px;background:#fff;border:1px solid #dde3ec;border-radius:10px;cursor:pointer;transition:transform .15s,border-color .15s,box-shadow .15s}
.persona-preset-card:hover{transform:translateY(-2px);border-color:var(--blue);box-shadow:0 4px 12px rgba(15,23,42,.08)}
.persona-preset-card.active{border-color:#000;box-shadow:0 0 0 1px #000}
.persona-preset-card .ppc-badge{display:none;position:absolute;top:-1px;right:-1px;padding:1px 8px;font-size:11px;color:#fff;background:#000;border-radius:0 10px 0 8px}
.persona-preset-card.active .ppc-badge{display:block}
.ppc-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding-right:44px}
.ppc-name{font-weight:700;font-size:14px;color:var(--text)}
.ppc-tag{font-size:11px;padding:1px 7px;border-radius:999px;background:#f1f5f9;color:#64748b;border:1px solid #e2e8f0}
.ppc-desc{font-size:12px;line-height:1.5;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ppc-bubble{margin-top:auto;padding:6px 10px;font-size:12px;line-height:1.5;color:#334155;background:#f1f5f9;border-radius:12px 12px 12px 3px}
#p_persona.persona-flash{animation:personaFlash .9s ease}
@keyframes personaFlash{0%{box-shadow:0 0 0 3px rgba(37,99,235,.35);background:#eff6ff}100%{box-shadow:0 0 0 0 rgba(37,99,235,0)}}
[data-theme="dark"] .persona-preset-card{background:#1e293b;border-color:#334155}
[data-theme="dark"] .persona-preset-card:hover{border-color:#60a5fa;box-shadow:0 4px 12px rgba(0,0,0,.4)}
[data-theme="dark"] .persona-preset-card.active{border-color:#f8fafc;box-shadow:0 0 0 1px #f8fafc}
[data-theme="dark"] .persona-preset-card .ppc-badge{background:#f8fafc;color:#0f172a}
[data-theme="dark"] .ppc-tag{background:#0f172a;color:#94a3b8;border-color:#334155}
[data-theme="dark"] .ppc-bubble{background:#0f172a;color:#cbd5e1}
[data-theme="dark"] #p_persona.persona-flash{background:rgba(37,99,235,.15)}


/* fix-checkbox-flex */

input[type='checkbox']:not(.switch input), input[type='radio'] { width: auto !important; min-width: 16px; height: 16px; flex: 0 0 auto !important; margin: 0; cursor: pointer; accent-color: #111827; }

.acc-card-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.acc-card-top .acc-info { flex: 1 1 240px; min-width: 200px; }

.acc-card-top .acc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; flex: 0 1 auto; }

