:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17212b;
  --muted: #66727f;
  --line: #dfe4e8;
  --nav: #18232d;
  --nav-hover: #24333f;
  --accent: #16785f;
  --accent-hover: #0f654f;
  --danger: #b33b3b;
  --warning: #a66a12;
  --shadow: 0 12px 36px rgba(24, 35, 45, .12);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "Microsoft YaHei UI", "Segoe UI", sans-serif; letter-spacing: 0; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #edf1f3; }
.login-panel { width: min(390px, 100%); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 34px; border-radius: 8px; }
.login-panel h1 { font-size: 24px; margin: 18px 0 4px; }
.login-panel p { color: var(--muted); margin: 0 0 24px; }
.login-panel label, .form-grid label { display: grid; gap: 7px; font-weight: 600; }
input { width: 100%; border: 1px solid #cbd3d9; border-radius: 5px; padding: 10px 11px; color: var(--text); background: #fff; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 120, 95, .13); }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; border-radius: 6px; }
.brand-mark.small { width: 32px; height: 32px; font-size: 12px; }
.wide { width: 100%; margin-top: 18px; }
.primary, .secondary, .danger-button, .text-button, .icon-button { border: 0; border-radius: 5px; padding: 9px 14px; }
.primary { background: var(--accent); color: #fff; font-weight: 650; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: #fff; color: var(--text); border: 1px solid #cbd3d9; }
.secondary:hover { background: #f4f6f8; }
.danger-button { background: #fff0f0; color: var(--danger); border: 1px solid #e9c3c3; padding: 6px 10px; }
.text-button { background: transparent; color: #b9c4cc; padding: 3px; }
.icon-button { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; background: #fff; border: 1px solid var(--line); font-size: 20px; }
.app-view { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: #dce4e9; padding: 22px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 24px; font-size: 16px; font-weight: 700; }
nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; color: #b9c4cc; background: transparent; border: 0; border-radius: 5px; padding: 11px 12px; text-align: left; }
.nav-item:hover { background: var(--nav-hover); color: #fff; }
.nav-item.active { background: #2a3b47; color: #fff; box-shadow: inset 3px 0 var(--accent); }
.nav-icon { width: 18px; color: #83a99e; text-align: center; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #31404b; padding: 18px 10px 0; display: grid; gap: 10px; color: #b9c4cc; font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: #42b98b; border-radius: 50%; margin-right: 7px; }
main { min-width: 0; padding: 0 32px 42px; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.topbar h1 { margin: 0 0 3px; font-size: 23px; }
.topbar p, .section-heading p { margin: 0; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.metrics article { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; min-height: 130px; }
.metrics span { color: var(--muted); }
.metrics strong { display: block; font-size: 34px; line-height: 1.2; margin: 13px 0 5px; }
.metrics small { color: #87929b; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.section-heading h2 { margin: 0 0 2px; font-size: 17px; }
.table-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { text-align: left; padding: 13px 15px; border-bottom: 1px solid #e8ecef; }
th { background: #f8fafb; color: #596570; font-size: 12px; font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfc; }
.empty { text-align: center; color: var(--muted); padding: 42px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 650; }
.badge.active, .badge.online { color: #176b52; background: #e8f5f0; }
.badge.revoked, .badge.offline, .badge.expired, .badge.mismatch { color: #9c3434; background: #faeaea; }
.badge.unknown { color: #725217; background: #f8f0dc; }
.subtle { color: var(--muted); font-size: 12px; }
.mono { font-family: Consolas, monospace; font-size: 12px; }
.table-actions { display: flex; gap: 7px; }
.actions-col { min-width: 180px; }
.audit-list { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.audit-item { display: grid; grid-template-columns: 155px 190px minmax(0, 1fr); gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.audit-item:last-child { border-bottom: 0; }
.audit-item strong { font-size: 12px; }
dialog { width: min(560px, calc(100% - 32px)); border: 0; border-radius: 7px; padding: 24px; color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 23, 30, .52); }
.dialog-head { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.dialog-head h2 { margin: 0 0 3px; }
.dialog-head p { color: var(--muted); margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid .full-field { grid-column: 1 / -1; }
.form-grid.single-column { grid-template-columns: 1fr; }
.capability-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.capability-grid label { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; }
.capability-grid input { width: auto; margin: 0; accent-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.form-error { min-height: 21px; color: var(--danger); margin-top: 10px; }
.secret-box { background: #f4f6f8; border: 1px solid var(--line); padding: 12px; margin: 10px 0; border-radius: 5px; }
.secret-box label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.secret-box code { overflow-wrap: anywhere; user-select: all; }
.notice { color: var(--warning); font-size: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; transform: translateY(20px); opacity: 0; pointer-events: none; background: #17212b; color: #fff; padding: 11px 16px; border-radius: 5px; box-shadow: var(--shadow); transition: .18s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 960px) { .metrics { grid-template-columns: 1fr 1fr; } .app-view { grid-template-columns: 76px minmax(0,1fr); } .sidebar { padding-inline: 9px; } .brand > span:last-child, .nav-item:not(.active) { font-size: 0; } .nav-item { justify-content: center; } .nav-item.active { font-size: 0; } .nav-icon { font-size: 16px; } .sidebar-footer { display: none; } }
@media (max-width: 640px) { main { padding: 0 14px 28px; } .app-view { grid-template-columns: 1fr; } .sidebar { position: static; width: 100%; height: auto; padding: 10px; flex-direction: row; align-items: center; overflow-x: auto; } .brand { padding: 0; } nav { display: flex; margin-left: auto; } .nav-item, .nav-item.active, .nav-item:not(.active) { width: 42px; font-size: 0; padding: 10px; } .topbar { min-height: 76px; } .topbar p, #lastRefresh { display: none; } .metrics { grid-template-columns: 1fr 1fr; gap: 9px; } .metrics article { min-height: 110px; padding: 14px; } .metrics strong { font-size: 28px; margin-top: 9px; } .form-grid, .capability-grid { grid-template-columns: 1fr; } .audit-item { grid-template-columns: 1fr; gap: 3px; } }
