:root {
  color-scheme: light;
  --canvas: #f3f5f7;
  --surface: #fff;
  --text: #20262d;
  --muted: #78818c;
  --line: #e5e9ed;
  --accent: #167b58;
  --tint: #eaf5ef;
  --danger: #c63d45;
  font: 14px/1.5 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--canvas); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 34px; padding: 6px 15px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap; }
button:hover { filter: brightness(.96); }
button:disabled { cursor: wait; opacity: .55; }
button.secondary, .button.secondary { background: var(--surface); border-color: #d7dde3; color: var(--text); }
button.link { padding: 0 5px; min-height: 28px; color: var(--accent); background: transparent; border-color: transparent; }
button.danger { color: var(--danger); }
.icon-button { width: 34px; padding: 0; font-size: 20px; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid #d8dee5; border-radius: 4px; background: var(--surface); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--tint); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
textarea { resize: vertical; }
label { display: grid; gap: 7px; font-size: 13px; min-width: 0; }
label.switch { display: flex; align-items: center; min-height: 36px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
small, .muted { color: var(--muted); font-size: 12px; }
code { font: 12px/1.5 Consolas, monospace; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.workspace { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
.product-sidebar { position: sticky; top: 0; height: 100vh; padding: 0 14px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: auto; }
.wordmark { height: 72px; min-height: 72px; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--text); }
.wordmark img { width: 32px; height: 32px; object-fit: contain; }
.wordmark strong { font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.wordmark small { display: block; font-size: 10px; margin-top: 4px; }
.nav-label { display: block; font-size: 11px; color: var(--muted); margin: 22px 13px 7px; }
.product-sidebar nav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 13px; color: #5d6772; border-radius: 4px; font-size: 13px; margin: 3px 0; }
.product-sidebar nav a.active { background: var(--tint); color: var(--accent); font-weight: 600; }
.product-sidebar nav a:hover { background: #f4f6f8; }
.nav-icon { width: 19px; height: 19px; opacity: .65; }
.sidebar-footer { margin-top: auto; padding: 24px 10px; display: grid; gap: 9px; font-size: 12px; }
.product-main { min-width: 0; }
.product-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 10px 26px; border-bottom: 1px solid var(--line); background: var(--surface); }
.product-topbar .account { display: flex; align-items: center; gap: 14px; min-width: 0; }
.account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.product-content { padding: 22px 26px 32px; max-width: 2000px; margin: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.page-head > div { min-width: 0; }
.page-head small { display: block; margin-bottom: 3px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions > select { width: auto; max-width: 170px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); background: var(--surface); margin-bottom: 20px; }
.metric { min-width: 0; padding: 18px 22px; border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 8px; }
.metric strong { font: 600 26px/1.2 Arial, "Microsoft YaHei", sans-serif; display: block; overflow-wrap: anywhere; }
.metric small { display: block; margin-top: 7px; }
.two-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.section { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 20px; min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.section-body { padding: 18px; }
.service-stat { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.service-stat:last-child { border: 0; }
.service-stat b { font-weight: 500; }
.chart-wrap { height: 232px; position: relative; padding: 15px; }
canvas { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.table-wrap { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { height: 42px; background: #fafbfc; color: #747e89; font-weight: 500; white-space: nowrap; }
th, td { padding: 11px 16px; border-bottom: 1px solid var(--line); }
td { max-width: 360px; overflow-wrap: anywhere; }
td .cell-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; background: #eaf5ef; color: #24805c; border-radius: 3px; font-size: 12px; white-space: nowrap; }
.badge.warn { background: #fff3dc; color: #aa7416; }
.badge.bad { background: #fce9eb; color: #b53643; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.filter-bar input { flex: 1; max-width: 320px; min-width: 160px; }
.filter-bar select { width: auto; max-width: 230px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 56px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }
.pager button { min-height: 30px; min-width: 30px; }
.empty { text-align: center; padding: 48px 15px; color: var(--muted); }
.notice { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 100; background: #eef9f3; color: #246e4f; border: 1px solid #b4d7c5; padding: 11px 20px; border-radius: 4px; box-shadow: 0 8px 30px #25364415; max-width: min(640px, calc(100vw - 32px)); overflow-wrap: anywhere; }
.notice.error { background: #fff2f2; border-color: #e9b5bb; color: #ac303f; }
.inline-error { padding: 18px; background: #fff5f5; color: #ac303f; border: 1px solid #f2d4d8; margin-bottom: 15px; }
.initial-loading { padding: 20vh 30px; text-align: center; color: #7c8591; }
dialog { width: min(840px, calc(100vw - 32px)); max-height: calc(100dvh - 50px); border: 1px solid var(--line); border-radius: 6px; padding: 0; color: var(--text); background: var(--surface); box-shadow: 0 20px 90px #18253430; }
dialog::backdrop { background: #17222e66; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); gap: 12px; }
.dialog-form { padding: 20px 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-two { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 0 0; }
.dialog-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); padding: 0 15px; }
.dialog-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); border-radius: 0; height: 44px; padding: 8px 14px; }
.dialog-tabs button.active { border-color: var(--accent); color: var(--accent); }
.form-error { color: #b53643; margin-top: 14px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-list { display: grid; gap: 12px; padding: 20px; }
.detail-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.diagnostic-results { padding: 16px 20px; display: grid; gap: 12px; }
.login-layout { min-height: 100dvh; display: grid; place-items: center; padding: 30px 16px; background: #f0f4f5; background-size: cover; background-position: center; }
.login-box { width: min(420px, 100%); background: var(--surface); padding: 40px 36px 28px; border: 1px solid #e1e6e8; box-shadow: 0 8px 44px #1825340c; border-radius: 6px; }
.login-box .wordmark { height: auto; min-height: 0; padding: 0 0 28px; }
.login-box .wordmark strong { font-size: 28px; }
.login-box .wordmark img { width: 44px; height: 44px; }
.login-box form { display: grid; gap: 19px; margin-top: 25px; }
.login-box footer { text-align: center; margin-top: 28px; color: var(--muted); font-size: 12px; }
.login-box button { min-height: 42px; }
body[data-product="high-defense"] { --accent: #d34d45; --tint: #fdf0ed; }
body[data-product="high-defense"] .workspace { grid-template-columns: 222px minmax(0, 1fr); }
body[data-product="high-defense"] .product-sidebar { background: #23262c; border: 0; }
body[data-product="high-defense"] .product-sidebar .wordmark { color: #fff; }
body[data-product="high-defense"] .product-sidebar nav a { color: #bec2c9; }
body[data-product="high-defense"] .product-sidebar nav a.active { color: #fff; background: #3b3436; box-shadow: inset 3px 0 #ee7563; }
body[data-product="high-defense"] .product-sidebar nav a:hover { background: #30333b; }
body[data-product="high-defense"] .nav-label { color: #777e89; }
body[data-product="high-defense"] .product-sidebar .nav-icon { filter: brightness(0) invert(1); opacity: .65; }
body[data-product="high-defense"] .product-sidebar .sidebar-footer { color: #aaaeb6; }
body[data-product="high-defense"] .metrics { border-top: 3px solid #da685d; }
body[data-product="high-defense"] .two-columns { grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); }
body[data-product="high-defense"] .login-layout { background-color: #e9ebee; }
@media (min-width: 1600px) { .product-content { padding: 26px 34px; } }
@media (max-width: 1000px) {
  .workspace, body[data-product="high-defense"] .workspace { grid-template-columns: 180px minmax(0, 1fr); }
  .two-columns, body[data-product="high-defense"] .two-columns { grid-template-columns: minmax(0, 1fr); }
  .metric { padding: 15px; }
  .metric strong { font-size: 23px; }
}
@media (max-width: 680px) {
  .workspace, body[data-product="high-defense"] .workspace { display: block; }
  .product-sidebar { position: relative; height: auto; padding: 0 12px; border-bottom: 1px solid var(--line); }
  .wordmark { height: 58px; min-height: 58px; }
  .product-sidebar nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 8px; }
  .product-sidebar nav a { flex: 0 0 auto; padding: 0 10px; height: 34px; }
  .nav-icon, .nav-label, .sidebar-footer { display: none; }
  .product-topbar { min-height: 48px; padding: 8px 16px; font-size: 12px; }
  .product-topbar .account { gap: 6px; }
  .account-name { max-width: 120px; }
  .product-content { padding: 18px 14px; }
  .page-head { align-items: flex-start; }
  .page-head .actions { justify-content: flex-end; }
  h1 { font-size: 19px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 15px; border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(3) { border-bottom: 0; }
  .metric strong { font-size: 22px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-two { grid-column: auto; }
  .dialog-form { padding: 18px 16px; }
  .filter-bar { gap: 8px; padding: 12px; }
  .filter-bar input, .filter-bar select { max-width: 100%; min-width: 0; flex: 1 1 140px; }
  .detail-row { grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
}
