:root {
  --ink: #20323b;
  --muted: #687b82;
  --line: #dce9e8;
  --canvas: #f7fbfb;
  --panel: #ffffff;
  --soft: #e1f8f6;
  --green: #43c68a;
  --red: #e3505b;
  --yellow: #eab645;
  --gray: #c9d5d4;
  --teal: #168b7d;
}
* { box-sizing: border-box; }
html { font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header-inner { width: 100%; max-width: 1220px; min-height: 64px; padding: 0 24px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; flex: none; gap: 9px; color: var(--ink); line-height: 1.05; }
.brand:hover { text-decoration: none; }
.brand-icon { display: block; width: 36px; height: 36px; flex: none; border-radius: 50%; }
.brand-label { display: grid; gap: 3px; }
.brand-label strong { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.brand-label small { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
nav a, .nav-button { color: #52666d; }
.inline-form { display: inline; margin: 0; }
.nav-button, .link-button { border: 0; background: none; padding: 0; color: var(--teal); }
.page { width: 100%; max-width: 1220px; margin: 0 auto; padding: 32px 24px 56px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .12em; margin: 0 0 8px; }
h1 { font-size: clamp(25px, 3vw, 34px); line-height: 1.2; margin: 0 0 10px; letter-spacing: -.03em; }
h2, h3 { margin-top: 0; }
.subtle, .updated, .no-data { color: var(--muted); }
.subtle { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.updated { font-size: 12px; white-space: nowrap; }
.toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 18px; }
.filter-form { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
select, input { border: 1px solid #cddcdb; border-radius: 8px; padding: 9px 11px; min-height: 39px; background: #fff; color: var(--ink); }
select:focus, input:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.filter-form select { min-width: 210px; }
.legend { display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 13px; border-radius: 3px; display: inline-block; }
.up { background-color: var(--green); }
.down { background-color: var(--red); }
.retrying { background-color: var(--yellow); }
.empty { background-color: var(--gray); }
.route-list { display: grid; gap: 15px; }
.route-card { min-width: 0; border: 1px solid #c8eeeb; background: #dcfaf7; border-radius: 16px; overflow: hidden; box-shadow: 0 3px 12px rgba(25,100,91,.035); }
.route-main { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 17px 19px 13px; }
.route-ident { display: flex; align-items: center; gap: 16px; min-width: 270px; }
.uptime-pill { background: var(--green); color: #fff; border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: 13px; white-space: nowrap; min-width: 68px; text-align: center; }
.route-ident h2 { font-size: 17px; margin: 0; font-weight: 700; }
.route-ident h2 a { color: var(--ink); }
.route-ident p { margin: 4px 0 0; color: #5a797b; font-size: 12px; }
.route-divider { color: #7bb7b0; padding: 0 2px; }
.segments-wrap { min-width: 0; max-width: 100%; text-align: right; }
.segments { display: flex; justify-content: flex-end; align-items: center; gap: 5px; min-height: 22px; }
.segment { display: inline-block; flex: 0 0 5px; width: 5px; height: 19px; border-radius: 3px; transition: transform .12s ease; }
a.segment:hover, a.segment:focus-visible { transform: scaleY(1.35); }
.segments-caption { font-size: 10px; color: #6c9493; display: block; margin-top: 4px; }
.metric-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; border-top: 1px solid #c5eeea; background: rgba(255,255,255,.66); }
.metric-strip-candy { grid-template-columns: repeat(5,minmax(0,1fr)); }
.metric { min-width: 0; padding: 12px 18px 13px; display: grid; gap: 3px; border-right: 1px solid #d4efeb; }
.metric:last-child { border-right: 0; }
.metric span, .stat-box span { color: #63777c; font-size: 11px; }
.metric strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .identity-result, .stat-box .identity-result, .comparison-table .identity-result, .candy-metric .candy-answer { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.metric small, .stat-box small { color: #819397; font-size: 11px; overflow-wrap: anywhere; }
.tone-success { color: #12825c; }
.tone-warning { color: #9b6c00; }
.tone-danger { color: #c63f49; }
.tone-muted { color: #74888a; }
.method-note { margin-top: 25px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.method-note h2 { font-size: 15px; margin: 0 0 8px; }
.method-note p { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0; }
.method-note p + p { margin-top: 8px; }
.empty-state { text-align: center; background: #fff; border: 1px dashed #bbd8d5; padding: 60px 20px; border-radius: 15px; color: var(--muted); }
.empty-state h2 { color: var(--ink); }
.breadcrumbs { display: flex; gap: 10px; color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.stat-box { display: grid; gap: 7px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.stat-box strong { font-size: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 21px; margin-bottom: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 13px; padding-bottom: 10px; }
.panel-heading h2 { font-size: 17px; margin: 0; }
.panel-heading span { color: var(--muted); font-size: 12px; }
.chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.chart-panel svg { width: 100%; height: auto; display: block; }
.chart-axis { stroke: #d9e8e5; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-caption { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.history-list { display: grid; gap: 6px; }
.history-item { border: 1px solid var(--line); border-radius: 8px; background: #fcfefe; scroll-margin-top: 20px; }
.history-item summary { display: grid; grid-template-columns: 90px minmax(160px,1fr) 190px minmax(160px,1fr); gap: 12px; align-items: center; padding: 10px 14px; font-size: 12px; cursor: pointer; }
.history-item summary::marker { color: var(--muted); }
.attempt-list { padding: 0 18px 12px 28px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.status-tag { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; font-size: 11px; font-weight: 750; padding: 4px 9px; background: #edf1f1; color: #6b7c7d; }
.status-tag.up, .status-tag.match { background: #daf8e8; color: #158358; }
.status-tag.down, .status-tag.mismatch { background: #ffe5e6; color: #bd3f4a; }
.status-tag.retrying, .status-tag.insufficient, .status-tag.skipped, .status-tag.budget { background: #fff4d7; color: #966600; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 12px; }
th { color: #677f82; font-weight: 700; text-align: left; background: #f5fafa; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e5eeee; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-note { margin: 13px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.table-sub { display: block; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.comparison-table { min-width: 870px; }
.comparison-table td strong { display: block; }
.comparison-current { background: #f1fbf9; }
.mini-trend { display: block; width: 145px; height: 29px; margin-top: 5px; }
.table-actions { white-space: nowrap; }
.table-actions form { display: inline; margin-left: 10px; }
.delete-button { color: #bd3f4a; }
.break-all { overflow-wrap: anywhere; }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; align-items: start; }
.admin-grid > .panel { min-width: 0; }
.edit-form { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
.edit-form h3 { font-size: 15px; margin: 0 0 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.form-grid label, .login-panel label { display: grid; min-width: 0; gap: 6px; color: #526c70; font-size: 12px; font-weight: 700; }
.form-grid input, .form-grid select { width: 100%; min-width: 0; }
.span-2 { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #557075; margin-top: 13px; }
.check-row input { min-height: auto; }
.form-actions { display: flex; gap: 9px; margin-top: 18px; }
.button { border: 1px solid #c6dcd8; border-radius: 8px; background: #fff; padding: 9px 14px; font-size: 13px; font-weight: 700; display: inline-block; color: var(--ink); }
.button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.button:hover { filter: brightness(.97); text-decoration: none; }
.login-panel { width: min(420px,100%); margin: 8vh auto; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.login-panel form { display: grid; gap: 13px; }
.login-panel .button { width: 100%; margin-top: 7px; }
.flash-stack { margin-bottom: 20px; display: grid; gap: 8px; }
.flash { border-radius: 8px; padding: 11px 14px; font-size: 13px; }
.flash-success { background: #dff7e9; color: #13734f; }
.flash-error { background: #ffe6e7; color: #ad3943; }
.site-footer { max-width: 1220px; margin: 0 auto; padding: 20px 24px 30px; border-top: 1px solid var(--line); color: #8aa0a0; display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
@media (max-width: 1050px) {
  .route-main { align-items: flex-start; flex-direction: column; }
  .segments-wrap { width: 100%; text-align: left; overflow-x: auto; }
  .segments { justify-content: flex-start; min-width: max-content; }
  .metric-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-strip-candy > :nth-child(3) { grid-column: 1 / -1; border-right: 0; }
  .admin-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-header-inner { padding: 0 16px; }
  .brand { white-space: nowrap; }
  .brand-icon { width: 32px; height: 32px; }
  .brand-label strong { font-size: 14px; }
  .brand-label small { font-size: 10px; }
  nav { gap: 8px; font-size: 11px; flex-wrap: wrap; justify-content: flex-end; }
  .page { padding: 23px 14px 40px; }
  .page-heading, .toolbar { align-items: flex-start; flex-direction: column; }
  .updated { white-space: normal; }
  .route-main { padding: 16px; }
  .route-ident { min-width: 0; }
  .metric-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { padding: 10px 12px; }
  .metric strong { font-size: 13px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .history-item summary { grid-template-columns: 80px 1fr; }
  .comparison-table { min-width: 0; display: block; }
  .comparison-table thead { display: none; }
  .comparison-table tbody, .comparison-table tr { display: block; }
  .comparison-table tr { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 11px; overflow: hidden; }
  .comparison-table td { display: block; position: relative; min-height: 43px; padding: 9px 10px 9px 124px; }
  .comparison-table td::before { content: attr(data-label); position: absolute; left: 10px; top: 11px; width: 106px; color: var(--muted); font-size: 11px; }
  .comparison-table tr:last-child td { border-bottom: 1px solid #e5eeee; }
  .comparison-table tr td:last-child { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .site-footer { flex-direction: column; padding: 20px 14px 30px; }
}
