:root {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #172c3d;
  background: #f4f7f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #399fe0; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; background: #fff; padding: 9px 14px; border-radius: 9px; }
.skip-link:focus { top: 12px; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; width: 242px; height: 100vh; flex: none; display: flex; flex-direction: column; padding: 29px 18px 22px; color: #e8f1f1; background: #112c36; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 47px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px 5px 12px 5px; background: #27c2b1; color: #063a3d; font-weight: 900; font-size: 24px; }
.brand strong { display: block; font-size: 17px; letter-spacing: .19em; line-height: 1.1; }
.brand small { display: block; margin-top: 4px; font-size: 9px; letter-spacing: .14em; color: #82a4aa; }
.side-group-label { margin: 0 14px 12px; color: #7298a0; font-size: 11px; font-weight: 700; letter-spacing: .11em; }
.side-link { display: flex; align-items: center; gap: 13px; padding: 12px 14px; margin: 3px 0; border-radius: 10px; text-decoration: none; font-size: 13px; color: #b6cdd1; }
.side-link:hover, .side-link:focus-visible { background: #214450; color: #fff; }
.side-link.active { color: #fff; background: #205c62; font-weight: 700; }
.side-icon { display: inline-grid; place-items: center; width: 18px; font-size: 19px; font-weight: 400; }
.sidebar-spacer { flex: 1; }
.side-note { display: flex; gap: 10px; padding: 16px 11px; border-top: 1px solid #2a4650; color: #d4e5e5; font-size: 11px; line-height: 1.6; }
.side-note small { color: #88a4aa; font-size: 10px; }
.pulse-dot { width: 7px; height: 7px; margin-top: 5px; flex: none; border-radius: 50%; background: #24c7a3; box-shadow: 0 0 0 4px #24c7a323; }
.main-content { width: min(100%, 1500px); min-width: 0; padding: 31px clamp(20px, 3.3vw, 54px) 27px; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 40px; }
.eyebrow, .section-kicker { color: #5d9ca6; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.topbar h1 { margin: 9px 0 5px; color: #102c3a; font-size: clamp(27px, 2.5vw, 35px); font-weight: 800; letter-spacing: -.03em; }
.topbar p { margin: 0; color: #71838e; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 14px; flex-wrap: wrap; }
.connection-status { display: inline-flex; align-items: center; gap: 8px; margin-right: 7px; white-space: nowrap; color: #488274; font-size: 12px; font-weight: 700; }
.connection-status.disconnected { color: #8a9aa4; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2db895; }
.disconnected .status-dot { background: #a0aeb7; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 12px; white-space: nowrap; transition: background .15s, transform .15s, border-color .15s; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button-quiet { background: #fff; border-color: #dce5e8; color: #385365; }
.button-quiet:hover { border-color: #a6c5cb; }
.button-primary { color: #fff; background: #168c83; box-shadow: 0 4px 13px #188f8426; }
.button-primary:hover { background: #0d736c; }
.button-dark { color: #fff; background: #19394a; }
.button-dark:hover { background: #0f2b3b; }
.notice { padding: 11px 15px; margin: -19px 0 23px; border: 1px solid #f5d2be; border-radius: 10px; color: #8c4627; background: #fff6ee; font-size: 12px; }
.notice.info { color: #2f6583; border-color: #b6dbe8; background: #edf8fc; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 6px 0 0; color: #172f40; font-size: 20px; letter-spacing: -.02em; }
.summary-badge { display: inline-block; padding: 4px 7px; margin-left: 5px; border-radius: 5px; background: #fff2d9; color: #936820; font-size: 10px; font-weight: 800; letter-spacing: 0; vertical-align: middle; }
.window-label { color: #76909c; font-size: 12px; white-space: nowrap; }
.filter-panel { margin-bottom: 20px; padding: 19px 21px 13px; border: 1px solid #e3ebed; border-radius: 15px; background: #fff; box-shadow: 0 7px 23px #15394a07; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px; }
.filter-grid label { display: flex; flex-direction: column; gap: 7px; color: #768b98; font-size: 11px; font-weight: 700; }
select, .token-dialog input { width: 100%; min-width: 0; min-height: 36px; padding: 7px 10px; border: 1px solid #dce7ea; border-radius: 8px; background: #fafcfc; color: #294252; font-size: 12px; }
select:hover { border-color: #9ec4c9; }
.filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; color: #91a0a9; font-size: 11px; }
.filter-footer > div { display: flex; gap: 8px; }
.quality-banner { display: flex; align-items: center; gap: 10px; padding: 11px 15px; margin-bottom: 17px; border: 1px solid #e8d9b1; border-radius: 10px; background: #fff9e9; color: #775b25; font-size: 12px; }
.quality-banner > span:first-child { font-size: 17px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric-card { min-width: 0; min-height: 151px; padding: 20px 21px; border: 1px solid #e3ebed; border-radius: 14px; background: #fff; box-shadow: 0 7px 23px #15394a06; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: #687d89; font-size: 12px; font-weight: 700; }
.metric-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; font-size: 18px; }
.metric-icon.blue { color: #287fac; background: #e7f4fa; }
.metric-icon.red { color: #c76a56; background: #fff0ec; }
.metric-icon.amber { color: #c4953c; background: #fff6df; }
.metric-icon.violet { color: #7867ab; background: #f1eefa; }
.metric-card strong { display: block; margin-bottom: 2px; color: #112d3c; font-size: clamp(26px, 2.3vw, 36px); line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric-card small { color: #97a5ae; font-size: 11px; }
.type-breakdown { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -2px 0 18px; color: #7e929a; font-size: 11px; }
.type-breakdown strong { margin-right: 2px; color: #607883; font-size: 11px; }
.type-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #dce9e9; border-radius: 7px; background: #fff; color: #3e6872; font-weight: 700; }
.type-chip b { color: #168c83; font-variant-numeric: tabular-nums; }
.insights-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 17px; }
.panel { min-width: 0; min-height: 301px; padding: 22px 24px 18px; border: 1px solid #e3ebed; border-radius: 14px; background: #fff; box-shadow: 0 7px 23px #15394a06; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-heading h3 { margin: 5px 0 0; font-size: 16px; }
.legend { display: flex; gap: 14px; color: #748791; font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; }
.legend-dot.total { background: #58bdb5; }
.legend-dot.blocked { background: #e79477; }
.trend-chart { display: flex; align-items: flex-end; gap: 4px; height: 194px; margin-top: 24px; border-bottom: 1px solid #e5edef; background: linear-gradient(to top, #f1f5f6 1px, transparent 1px) left bottom / 100% 25%; }
.trend-bar { position: relative; flex: 1; min-width: 3px; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-total { position: relative; width: min(100%, 25px); border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #54beb5, #b8e3de); }
.bar-blocked { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 4px 4px 0 0; background: #e89276; }
.trend-bar:hover .bar-total, .trend-bar:focus-visible .bar-total { filter: brightness(.93); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 9px; color: #9aa8ae; font-size: 10px; }
.panel-count { color: #91a4ae; font-size: 11px; }
.reason-chart { margin-top: 21px; display: grid; gap: 14px; }
.reason-row { display: grid; gap: 6px; }
.reason-row-top { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.reason-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #425967; font-weight: 700; }
.reason-value { color: #718791; font-variant-numeric: tabular-nums; }
.reason-track { height: 6px; border-radius: 99px; background: #eaf0f1; overflow: hidden; }
.reason-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38b6ab, #8cd7cc); }
.placeholder { align-self: center; width: 100%; margin: auto; text-align: center; color: #9aa8ae; font-size: 12px; }
.events-section { margin-top: 42px; }
.event-heading-meta { display: flex; align-items: center; gap: 20px; color: #718994; font-size: 12px; }
.page-size-label { display: flex; align-items: center; gap: 6px; }
.page-size-label select { width: 72px; min-height: 31px; background: #fff; }
.table-panel { border: 1px solid #e2eaec; border-radius: 14px; background: #fff; box-shadow: 0 7px 23px #15394a06; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 15px 18px; border-bottom: 1px solid #e6ecee; color: #81939d; background: #fbfcfc; font-size: 10px; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
td { padding: 18px; border-bottom: 1px solid #edf1f2; color: #455c69; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfdfd; }
.time-cell { white-space: nowrap; color: #69808b; font-variant-numeric: tabular-nums; }
.event-type { display: block; margin-bottom: 4px; color: #263e4c; font-weight: 800; }
.event-subject { display: block; max-width: 200px; color: #93a3ab; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reason-cell { max-width: 315px; color: #5a707b; line-height: 1.4; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 5px 6px; border-radius: 7px; background: #eaf4f4; color: #29867c; font-weight: 800; font-variant-numeric: tabular-nums; }
.score.high { color: #b14f3f; background: #fef0ec; }
.score.unknown { color: #91a0a6; background: #f1f4f5; }
.action-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.action-badge.blocked { color: #b45c49; background: #fff0eb; }
.action-badge.observed { color: #8b742c; background: #fff6dd; }
.action-badge.unknown { color: #71818b; background: #eef2f3; }
.view-button { padding: 5px 7px; border: 0; background: none; color: #148f84; font-size: 11px; font-weight: 800; white-space: nowrap; }
.view-button:hover { text-decoration: underline; }
.table-message { padding: 49px 18px; text-align: center; color: #97a7ae; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 17px; border-top: 1px solid #e6edef; color: #8b9ca5; font-size: 11px; }
.pagination { display: flex; gap: 7px; }
.footer { padding: 30px 0 0; color: #a0afb6; text-align: center; font-size: 10px; }
.token-dialog { width: min(420px, calc(100vw - 32px)); padding: 28px; border: 1px solid #dce7e8; border-radius: 17px; color: #263e4c; box-shadow: 0 24px 80px #0c293d44; }
.token-dialog::backdrop { background: #102b39a8; backdrop-filter: blur(4px); }
.dialog-mark { display: grid; place-items: center; width: 41px; height: 41px; margin-bottom: 18px; border-radius: 11px; background: #e4f6f1; color: #168e83; font-size: 28px; }
.token-dialog h2 { margin: 0 0 6px; font-size: 20px; }
.token-dialog p { margin: 0 0 21px; color: #748892; font-size: 12px; line-height: 1.7; }
.token-dialog label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 800; }
.token-dialog input { min-height: 42px; background: #fff; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 25; background: #10273491; }
.detail-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 26; display: flex; flex-direction: column; width: min(550px, 100vw); background: #fff; box-shadow: -15px 0 50px #1027342b; }
body.drawer-open { overflow: hidden; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 25px 18px; border-bottom: 1px solid #e8eef0; }
.drawer-header h2 { margin: 5px 0 0; font-size: 21px; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #dbe7ea; border-radius: 9px; background: #fff; color: #617784; font-size: 22px; line-height: 1; }
.drawer-content { min-height: 0; padding: 23px 25px 35px; overflow-y: auto; }
.detail-lead { padding: 17px; border-radius: 11px; background: #f4f9f8; color: #264b55; line-height: 1.6; font-size: 13px; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 21px 0; }
.meta-item { min-width: 0; padding: 12px 13px; border: 1px solid #e7eef0; border-radius: 9px; }
.meta-item dt { margin-bottom: 6px; color: #91a1aa; font-size: 10px; }
.meta-item dd { margin: 0; color: #344e5b; font-size: 12px; overflow-wrap: anywhere; }
.detail-section { padding-top: 19px; margin-top: 18px; border-top: 1px solid #e8eef0; }
.detail-section h3 { margin: 0 0 14px; color: #263e4c; font-size: 14px; }
.reason-detail { padding: 13px; margin-bottom: 9px; border: 1px solid #e4ecee; border-radius: 9px; }
.reason-detail-head { display: flex; justify-content: space-between; gap: 9px; margin-bottom: 6px; }
.reason-detail-head strong { color: #344c59; font-size: 12px; }
.reason-detail-head span { color: #2a9c8f; font-size: 11px; font-weight: 800; white-space: nowrap; }
.reason-code { display: block; margin-bottom: 8px; color: #8ca1aa; font: 10px/1.5 Consolas, monospace; overflow-wrap: anywhere; }
.reason-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reason-values > div { padding: 7px 9px; border-radius: 6px; background: #f7fafa; }
.reason-values small { display: block; margin-bottom: 3px; color: #96a5ac; font-size: 10px; }
.reason-values span { color: #506a75; font-size: 11px; overflow-wrap: anywhere; }
.request-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1f2; font-size: 11px; }
.request-item:last-child { border-bottom: none; }
.request-item span:first-child { flex: none; color: #83969f; }
.request-item span:last-child { text-align: right; color: #4e6571; overflow-wrap: anywhere; }
.empty-detail { color: #97a7ae; font-size: 12px; line-height: 1.7; }
@media (max-width: 1250px) {
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .insights-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1000px) {
  .sidebar { width: 74px; align-items: center; padding: 22px 7px; }
  .brand { padding: 0 0 43px; }
  .brand > div, .side-group-label, .side-link:not(.active), .side-link.active { font-size: 0; }
  .side-link { width: 48px; justify-content: center; }
  .side-icon { font-size: 21px; }
  .side-note { display: none; }
  .main-content { padding: 26px 22px; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .main-content { padding: 22px 15px; }
  .topbar { flex-direction: column; margin-bottom: 31px; }
  .topbar-actions { justify-content: flex-start; padding-top: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 132px; padding: 16px; }
  .insights-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-footer { align-items: flex-end; }
  .filter-footer > span { max-width: 150px; }
  th, td { padding: 13px; }
  table { min-width: 680px; }
}
@media (max-width: 480px) {
  .filter-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
  .filter-panel { padding: 16px 13px; }
  .filter-footer { flex-direction: column; align-items: stretch; }
  .filter-footer > span { max-width: none; }
  .filter-footer > div { justify-content: flex-end; }
  .section-heading { align-items: flex-start; }
  .window-label { align-self: flex-end; font-size: 10px; }
  .metric-top { font-size: 11px; }
  .panel { padding: 18px 16px; }
  .event-heading-meta { flex-direction: column; align-items: flex-end; gap: 4px; }
  .detail-meta { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
