:root {
  color-scheme: light;
  --page: #f6f8fb;
  --surface: #ffffff;
  --ink: #182438;
  --muted: #647286;
  --border: #e2e8f0;
  --accent: #315fe8;
  --accent-hover: #254dc4;
  --success: #257356;
  --warning: #8a5a13;
  --error: #b42335;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.65; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #90aaff; outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 3; padding: 10px 16px; border-radius: 8px; background: var(--surface); color: var(--ink); }
.skip-link:focus { top: 12px; }

.site-header { width: min(100% - 64px, 1000px); min-height: 100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 20px; font-weight: 650; letter-spacing: -0.35px; text-decoration: none; white-space: nowrap; }
.brand-suffix { font-size: 17px; font-weight: 500; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid #dce5fd; border-radius: 10px; background: #edf2ff; color: var(--accent); }
.brand-mark svg { width: 23px; height: 23px; }
.header-link { padding: 10px 0 10px 10px; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.header-link:hover { color: var(--ink); }
.header-link span { margin-left: 3px; }
.main-content { flex: 1; width: min(100% - 64px, 1000px); margin: 34px auto 48px; }
.page-heading { margin-bottom: 26px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 1px; margin-bottom: 9px; }
h1 { font-size: 30px; font-weight: 650; line-height: 1.4; letter-spacing: -0.5px; }
.page-heading > p:last-child { color: var(--muted); margin-top: 10px; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.5; }
h3 { font-size: 14px; font-weight: 600; line-height: 1.5; }
h4 { font-size: 13px; font-weight: 600; line-height: 1.6; }
.panel { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 4px 20px #14244104; overflow: hidden; }
.setup-panel { padding: 28px 30px 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.section-heading > div > p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.quiet-label { flex-shrink: 0; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 25px 0 24px; }
.test-targets { border: 1px solid var(--border); border-radius: 10px; background: #f8faff; }
.target-row { display: flex; align-items: flex-start; gap: 15px; padding: 20px; }
.target-row + .target-row { border-top: 1px solid var(--border); }
.target-icon { color: var(--accent); flex-shrink: 0; padding-top: 3px; }
.target-icon svg { display: block; width: 23px; height: 23px; }
.target-label { color: var(--muted); font-size: 12px; }
.target-value { margin-top: 3px; font-size: 19px; font-weight: 600; letter-spacing: -0.25px; }
.target-value span { font-size: 14px; font-weight: 500; white-space: nowrap; margin-left: 4px; }
.target-detail { color: var(--muted); font-size: 11px; margin-top: 4px; }
.field-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #ced7e3; border-radius: 8px; padding: 9px 12px; background: #fff; color: var(--ink); }
select:focus { border-color: var(--accent); }
select:disabled { color: var(--muted); cursor: not-allowed; }
.field-hint { color: var(--muted); font-size: 11px; line-height: 1.75; margin-top: 8px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; cursor: pointer; }
.checkbox-label input { flex-shrink: 0; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; }
.option-title, .option-detail { display: block; }
.option-title { font-size: 13px; line-height: 1.65; }
.option-detail { color: var(--muted); font-size: 11px; margin-top: 2px; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 21px 0 23px; border-top: 1px solid var(--border); }
.action-buttons { display: flex; gap: 10px; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 19px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap; transition: background-color 120ms ease, border-color 120ms ease; }
.button svg { width: 18px; height: 18px; flex-shrink: 0; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover:enabled { background: var(--accent-hover); }
.button-secondary { background: #fff; border-color: #d3dce8; color: #44536a; }
.button-secondary:hover:enabled { background: #f5f8fe; border-color: #b9c9e0; }
.button-small { min-height: 36px; padding: 7px 12px; font-size: 11px; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.action-note { max-width: 350px; color: var(--muted); font-size: 11px; }

.results-panel { margin-top: 22px; padding: 26px 30px 0; }
.run-status { display: flex; align-items: center; gap: 8px; padding-top: 3px; font-size: 12px; color: #4e5d72; }
.status-dot { display: block; width: 7px; height: 7px; border-radius: 50%; background: #8c9aae; flex-shrink: 0; }
.run-status[data-active="true"] .status-dot { background: var(--accent); }
.progress-description { margin-top: 17px; padding: 11px 14px; border: 1px solid #e6ebf4; border-radius: 8px; background: #f8faff; font-size: 12px; color: #586981; overflow-wrap: anywhere; }
.result-section { padding: 24px 0; }
.result-section + .result-section { border-top: 1px solid var(--border); }
.check-list, .findings-list { padding: 0; margin: 13px 0 0; list-style: none; }
.empty-state { color: var(--muted); font-size: 12px; padding: 12px 0 0; }
.check-list > .empty-state { padding-top: 1px; }
.check-item { padding: 12px 0; border-bottom: 1px solid #edf1f6; }
.check-item:last-child { border-bottom: 0; padding-bottom: 0; }
.check-heading { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.check-indicator { display: grid; place-items: center; width: 19px; height: 19px; flex-shrink: 0; border-radius: 50%; color: #78869a; background: #eff3f8; font-size: 11px; font-weight: 600; }
.check-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.state-label { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.check-detail { margin-top: 4px; margin-left: 28px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.check-item[data-state="running"] .check-indicator { background: #edf2ff; color: var(--accent); }
.check-item[data-state="running"] .state-label { color: var(--accent); }
.check-item[data-state="pass"] .check-indicator { background: #eaf6f0; color: var(--success); }
.check-item[data-state="pass"] .state-label { color: var(--success); }
.check-item[data-state="warn"] .check-indicator { background: #fff5e5; color: var(--warning); }
.check-item[data-state="warn"] .state-label { color: var(--warning); }
.check-item[data-state="fail"] .check-indicator { background: #fff0f2; color: var(--error); }
.check-item[data-state="fail"] .state-label { color: var(--error); }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.subsection-heading > p { color: var(--muted); font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.metric-card { padding: 16px 16px 14px; border: 1px solid var(--border); border-radius: 9px; min-width: 0; }
.metric-card dt { color: #586981; font-size: 11px; overflow-wrap: anywhere; }
.metric-card dd { margin-top: 8px; color: var(--ink); font-size: 22px; font-weight: 600; line-height: 1.45; font-variant-numeric: tabular-nums; letter-spacing: -0.4px; overflow-wrap: anywhere; }
.metric-unit { color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; margin-left: 5px; }
.metric-note { color: var(--muted); margin-top: 7px; font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.placeholder-metric dd { color: #94a0b0; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 15px; }
.preview-card { min-width: 0; }
.preview-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid #d6dfed; border-radius: 9px; background: #152033; }
.preview-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #a4b0c3; font-size: 11px; pointer-events: none; }
.preview-placeholder-icon { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid #354259; border-radius: 9px; color: #a0adc2; font-size: 21px; font-weight: 300; }
.preview-frame[data-active="true"] .preview-placeholder { display: none; }
figcaption { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: 11px; }
figcaption strong { font-weight: 500; }
figcaption span { color: var(--muted); }
.findings-heading { align-items: center; }
.finding-item { padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: #f8faff; }
.finding-item + .finding-item { margin-top: 9px; }
.finding-heading { display: flex; align-items: baseline; gap: 10px; }
.finding-label { flex-shrink: 0; font-size: 10px; font-weight: 600; color: #586981; }
.finding-item p { margin-top: 5px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.finding-item[data-level="pass"] { border-color: #d5e9dd; background: #f4faf6; }
.finding-item[data-level="pass"] .finding-label { color: var(--success); }
.finding-item[data-level="warn"] { border-color: #eedfbf; background: #fffbf2; }
.finding-item[data-level="warn"] .finding-label { color: var(--warning); }
.finding-item[data-level="fail"] { border-color: #efd6da; background: #fff7f8; }
.finding-item[data-level="fail"] .finding-label { color: var(--error); }
.findings-section > .field-hint { margin-top: 14px; }
.advanced-section { margin-top: 20px; border: 1px solid var(--border); border-radius: 12px; background: #ffffff80; }
.advanced-section summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 15px 21px; color: #4e5d72; font-size: 13px; font-weight: 500; cursor: pointer; list-style: none; }
.advanced-section summary::-webkit-details-marker { display: none; }
.details-chevron { width: 20px; height: 20px; flex-shrink: 0; }
.advanced-section[open] .details-chevron { transform: rotate(180deg); }
.advanced-content { padding: 1px 21px 21px; }
.advanced-content h3 { font-size: 12px; }
.technical-output { max-height: 260px; margin: 10px 0 0; padding: 13px 15px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: 8px; background: #f8faff; color: #53637a; font: 11px/1.85 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.log-heading { margin-top: 18px; }
.report-log { max-height: 320px; }
.noscript-message { margin-top: 20px; color: var(--error); font-size: 13px; }
.site-footer { padding: 0 24px 26px; color: #7a889d; font-size: 11px; text-align: center; letter-spacing: 0.2px; }

@media (max-width: 850px) {
  .site-header, .main-content { width: calc(100% - 48px); }
  .quiet-label { display: none; }
  .setup-grid { gap: 24px; }
  .target-row { padding: 19px 16px; gap: 12px; }
  .target-value { font-size: 17px; }
  .target-value span { font-size: 12px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-row { align-items: flex-start; }
  .action-note { max-width: 230px; }
}

@media (max-width: 600px) {
  .site-header { width: calc(100% - 40px); min-height: 80px; gap: 12px; }
  .brand { font-size: 18px; gap: 9px; }
  .brand-suffix { font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; }
  .header-link { font-size: 12px; }
  .main-content { width: calc(100% - 40px); margin-top: 28px; margin-bottom: 36px; }
  h1 { font-size: 25px; }
  .page-heading > p:last-child { font-size: 13px; }
  .page-heading { margin-bottom: 22px; }
  .setup-panel { padding: 22px 20px 0; }
  .section-heading { gap: 16px; }
  .section-heading > div > p { font-size: 12px; }
  .setup-grid { grid-template-columns: 1fr; margin-top: 20px; gap: 22px; }
  .target-row { padding: 16px; }
  .target-value { font-size: 18px; }
  .target-value span { font-size: 13px; }
  select { font-size: 16px; min-height: 46px; }
  .action-row { flex-direction: column; gap: 13px; padding: 20px 0; }
  .action-buttons { width: 100%; }
  .action-buttons .button { flex: 1; min-height: 46px; padding-right: 10px; padding-left: 10px; }
  .action-note { max-width: none; }
  .results-panel { padding: 22px 20px 0; }
  .result-heading { flex-direction: column; gap: 12px; }
  .run-status { padding-top: 0; }
  .progress-description { margin-top: 13px; padding: 10px 12px; }
  .result-section { padding: 20px 0; }
  .subsection-heading { flex-wrap: wrap; gap: 5px 10px; }
  .metric-grid { gap: 10px; }
  .metric-card { padding: 13px 12px; }
  .metric-card dd { font-size: 20px; }
  .preview-grid { grid-template-columns: 1fr; gap: 20px; }
  .findings-heading { gap: 12px; }
  .finding-item { padding: 12px; }
  .advanced-section summary { padding-right: 18px; padding-left: 18px; }
  .advanced-content { padding-right: 18px; padding-left: 18px; }
  .site-footer { padding-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
