:root {
  color-scheme: light;
  --paper: #f2eee4;
  --ink: #153c3b;
  --muted: #64736f;
  --line: rgba(21, 60, 59, 0.18);
  --accent: #a94424;
  --ok: #176c56;
  --warn: #966513;
  --bad: #a12f2f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 10%, rgba(218, 173, 95, 0.18), transparent 33%), var(--paper); }
button, a { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 10px 14px; background: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.diagnostic-header { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; }
.brand span { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-family: Georgia, serif; font-size: 22px; }
.back-link { text-underline-offset: 4px; }
main { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 70px; }
.intro { max-width: 820px; }
.kicker { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.2em; }
h1 { margin: 10px 0 16px; font: 400 clamp(40px, 7vw, 76px)/1 Georgia, "Noto Serif SC", serif; }
.intro > p:not(.kicker, .action-status) { max-width: 720px; color: var(--muted); line-height: 1.75; }
.overall { margin: 28px 0 16px; padding: 18px 20px; display: flex; gap: 13px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.5); }
.overall div { display: grid; gap: 4px; }
.overall small { color: var(--muted); line-height: 1.45; }
.status-dot { flex: 0 0 auto; width: 13px; height: 13px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 6px rgba(150, 101, 19, 0.12); }
.overall[data-status="pass"] .status-dot { background: var(--ok); box-shadow: 0 0 0 6px rgba(23, 108, 86, 0.12); }
.overall[data-status="degraded"] .status-dot { background: var(--warn); box-shadow: 0 0 0 6px rgba(176, 112, 34, 0.12); }
.overall[data-status="fail"] .status-dot { background: var(--bad); box-shadow: 0 0 0 6px rgba(161, 47, 47, 0.12); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
button { min-height: 44px; padding: 9px 15px; color: #fff; background: var(--ink); border: 1px solid var(--ink); border-radius: 999px; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button:focus-visible, a:focus-visible { outline: 3px solid #d57848; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: 0.62; }
button.danger { color: var(--bad); background: transparent; border-color: rgba(161, 47, 47, 0.45); }
.text-button { min-height: 36px; padding: 4px 0; color: var(--ink); background: transparent; border: 0; border-radius: 0; text-decoration: underline; text-underline-offset: 3px; }
.action-status { min-height: 1.5em; color: var(--muted); }
.diagnostic-grid { margin-top: 42px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.diagnostic-grid article { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.54); }
h2 { margin: 0 0 16px; font: 500 24px/1.2 Georgia, "Noto Serif SC", serif; }
dl { margin: 0; }
dl div { padding: 9px 0; display: grid; grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.4fr); gap: 16px; border-bottom: 1px solid var(--line); }
dl div:last-child { border-bottom: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; text-align: right; }
.check-list, .probe-list { display: grid; gap: 8px; }
.check-row, .probe-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child, .probe-row:last-child { border-bottom: 0; }
.check-row small, .probe-row small { color: var(--muted); }
.badge { padding: 3px 8px; border-radius: 999px; color: var(--ok); background: rgba(23, 108, 86, 0.1); font-size: 12px; font-weight: 800; }
.badge.warn { color: var(--warn); background: rgba(150, 101, 19, 0.1); }
.badge.fail { color: var(--bad); background: rgba(161, 47, 47, 0.1); }
.cache-list { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.privacy-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.error-list { max-height: 220px; margin: 10px 0; padding-left: 22px; overflow: auto; }
.error-list li { padding: 4px 0; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.boundary { margin-top: 20px; padding: 22px; border-left: 4px solid var(--accent); background: rgba(169, 68, 36, 0.06); }
.boundary p { margin: 7px 0 0; color: var(--muted); line-height: 1.65; }

@media (max-width: 720px) {
  .diagnostic-header, main { width: min(100% - 24px, 1100px); }
  main { padding-top: 36px; }
  .diagnostic-grid { grid-template-columns: 1fr; }
  .diagnostic-grid article { padding: 18px; }
  dl div { grid-template-columns: 1fr; gap: 3px; }
  dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
