:root {
  color-scheme: light;
  --page: #f5f7f8;
  --card: #fff;
  --soft: #f7f8fa;
  --ink: #232a32;
  --text: #47525d;
  --muted: #65717d;
  --line: #e5e9ed;
  --line-strong: #dce1e7;
  --accent: #4c56ce;
  --accent-ink: #3b47ae;
  --accent-soft: #eef0ff;
  --accent-line: #dce0fb;
  --green: #18785e;
  --green-soft: #eaf5ef;
  --amber: #89581b;
  --amber-soft: #fff2dc;
  --red: #a8343e;
  --red-soft: #fcecee;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2365717d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { opacity: .55; cursor: default; }
:is(a, button, input, select, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-definitions, .screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell { width: min(100% - 72px, 1320px); margin-inline: auto; }
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .shell, .site-links, .brand, .language { display: flex; align-items: center; }
.top .shell { min-height: 60px; justify-content: space-between; gap: 10px; }
.site-links { gap: 14px; }
.brand { gap: 10px; font-size: 15px; font-weight: 680; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
}
.brand-product {
  border-inline-start: 1px solid var(--line-strong);
  padding-inline-start: 14px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.brand-product:hover { color: var(--accent-ink); text-decoration: underline; }
.language { gap: 4px; color: var(--text); }
.language svg { width: 16px; height: 16px; }

main.shell { padding-block: 27px 23px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
h1 { font-size: 31px; line-height: 1.2; letter-spacing: -.5px; font-weight: 680; }
.subtitle { margin-top: 8px; color: var(--muted); font-size: 13px; }
.action-row, .button, .field, .more { display: flex; align-items: center; gap: 8px; }
.action-row { flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.button {
  justify-content: center;
  min-height: 38px;
  padding: 5px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--card);
  font-weight: 590;
  white-space: nowrap;
}
.button svg { width: 16px; height: 16px; }
.button:hover:enabled, .more:hover:enabled { background-color: #f2f4f7; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover:enabled { background: var(--accent-ink); }
.button.plain { border-color: transparent; background: transparent; color: var(--muted); }

.settings {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 57px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}
.field { color: var(--muted); font-size: 12px; }
select {
  appearance: none;
  min-width: 0;
  min-height: 33px;
  padding: 6px 25px 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--card) var(--select-arrow) no-repeat right 8px center;
  color: var(--ink);
  font-size: 12px;
}
.language select {
  min-height: 30px;
  padding: 3px 15px 3px 3px;
  border-color: transparent;
  background-position: right 2px center;
  color: inherit;
}
.field select { max-width: min(240px, 30vw); }
.more {
  justify-content: center;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.more svg { width: 14px; height: 14px; }
.more[aria-expanded="true"] .disclosure-chevron { transform: rotate(180deg); }
.settings .rerun { margin-inline-start: auto; min-height: 33px; font-size: 12px; }
.advanced {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  font-size: 13px;
}
.advanced h2 { font-size: 14px; margin-bottom: 8px; }
.threshold-hint { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.rule-controls { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-block: 8px 12px; }
.rule-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; }
.rule-toggle input { margin: 0; accent-color: var(--accent); }
.threshold-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.threshold-field { display: grid; gap: 4px; min-width: 0; color: var(--text); font-size: 12px; }
.threshold-field input {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--card);
  color: var(--ink);
}
.threshold-field small { color: var(--muted); }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.import-panel { margin-top: 14px; padding: 16px; }
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 210px;
  padding: 14px;
  border: 1px dashed #b6bee4;
  border-radius: 10px;
  background: #f9faff;
  color: var(--accent-ink);
}
.drop-zone:hover, .dragging .drop-zone, .drop-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dragging .workspace { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 12px; }
.import-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 3px;
  border-radius: 10px;
  background: var(--accent-soft);
}
.import-icon svg { width: 22px; height: 22px; }
.import-formats, .import-panel p { color: var(--muted); font-size: 12px; }
.import-panel p { margin-top: 10px; text-align: center; }
.batch-live, .batch-error { margin-block: 8px; color: var(--text); font-size: 12px; }
.batch-live:empty { margin: 0; }
.batch-error {
  padding: 9px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.batch-error.is-error, noscript .batch-error {
  border-color: #f4c6cd;
  background: var(--red-soft);
  color: var(--red);
}

.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-block: 14px; }
.metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27px;
  align-items: center;
  column-gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  text-align: start;
}
.metric:hover, .metric[aria-pressed="true"] { border-color: #babff5; }
.metric[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #d5d9ff; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value {
  grid-row: 2;
  margin-top: 5px;
  font-size: 28px;
  line-height: 1.04;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 675;
}
.metric-icon {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.metric-icon svg { width: 16px; height: 16px; }
.metric[data-filter="clear"] .metric-icon { background: var(--green-soft); color: var(--green); }
.metric[data-filter="review"] .metric-icon { background: var(--amber-soft); color: var(--amber); }
.metric[data-filter="failed"] .metric-icon { background: var(--red-soft); color: var(--red); }

.workspace { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 14px; align-items: start; }
.files, .results { min-height: 550px; }
.panel-head, .result-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 60px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2, .result-head h2 { font-size: 15px; font-weight: 650; line-height: 1.4; }
.panel-head > span { margin-inline-start: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.file-list { padding: 6px; }
.file-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 61px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--card);
  text-align: start;
}
.file-row:hover { background: var(--soft); }
.file-row[aria-current="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.file-icon { display: grid; place-items: center; width: 30px; height: 32px; border-radius: 7px; background: #f0f3f7; color: #67788c; }
.file-icon svg { width: 16px; height: 16px; }
.file-row[aria-current="true"] .file-icon { background: #e2e5ff; color: var(--accent-ink); }
.file-title, .file-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-title { font: 600 12px/1.42 ui-sans-serif, system-ui, sans-serif; }
.file-meta { margin-top: 3px; color: var(--muted); font-size: 11px; }
.file-row em { font-style: normal; }
.review-tint { color: var(--amber); }
.failed-tint { color: var(--red); }
.clear-tint { color: var(--green); }
.chevron { width: 14px; height: 14px; color: #838d99; }

.result-head { padding-inline: 17px; }
.result-head .file-icon { width: 31px; }
.result-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-name, .file-identity { min-width: 0; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.result-meta span { white-space: nowrap; }
.file-language {
  max-width: min(150px, 100%);
  min-height: 27px;
  padding: 1px 15px 1px 3px;
  border-color: transparent;
  background-position: right 2px center;
  color: var(--accent-ink);
}
.file-language:hover { border-color: var(--accent-line); background-color: var(--accent-soft); }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 590;
  text-align: center;
}
.badge.clear { background: var(--green-soft); color: var(--green); }
.badge.failed { background: var(--red-soft); color: var(--red); }
.result-head > .badge, .result-actions { margin-inline-start: auto; }
.result-actions { display: flex; flex-shrink: 0; align-items: center; gap: 6px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
}
.icon-button:hover:enabled { background: var(--soft); color: var(--ink); }
.icon-button svg { width: 16px; height: 16px; }

.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) 352px; min-width: 0; }
.issues { min-width: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 55px; padding: 11px 13px; }
.filters h2 { margin-inline-end: auto; font-size: 13px; font-weight: 650; }
.filters select { max-width: 100%; }
.table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: start; }
.table th, .table td { padding: 10px 11px; vertical-align: middle; text-align: start; }
.table th {
  border-bottom: 1px solid var(--line);
  background: #f5f7fa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 590;
}
.table th:first-child, .table td:first-child { padding-inline-start: 15px; }
.table th:nth-child(1) { width: 86px; }
.table th:nth-child(2) { width: 111px; }
.table th:nth-child(4) { width: 32px; }
.table td { height: 64px; border-bottom: 1px solid var(--line); }
.table tr[data-issue]:hover td, .table tr:has(button:hover) td { background: #f5f6fa; cursor: pointer; }
.table tr[aria-selected="true"] td, .table tr[aria-current="true"] td { background: #f2f3ff; }
.table tr[aria-selected="true"] td:first-child, .table tr[aria-current="true"] td:first-child { box-shadow: inset 2px 0 var(--accent); }
.cue-no { font-size: 13px; font-weight: 620; }
.time {
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.18px;
  white-space: nowrap;
}
.time-two { display: block; margin-top: 2px; color: var(--muted); }
.rule-name { font-size: 13px; font-weight: 620; }
.rule-value { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.table button {
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--accent-ink);
  text-align: start;
}
.table .issue-open svg { width: 14px; height: 14px; }
.table .issue-empty { color: var(--muted); }
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}
.pager button { min-height: 32px; padding-inline: 7px; }
.pager button:disabled { opacity: .55; }

.review-panel {
  position: sticky;
  top: 10px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 490px;
  padding: 13px 14px 14px;
  border-inline-start: 1px solid var(--line);
}
.detail-head, .detail-rule { display: flex; justify-content: space-between; gap: 6px; }
.detail-head { align-items: center; min-height: 25px; }
.detail-head h3 { font-size: 13px; font-weight: 650; }
.detail-rule { align-items: baseline; }
.detail-rule strong { font-size: 15px; font-weight: 645; }
.detail-rule > span { color: var(--amber); font-size: 12px; font-weight: 590; text-align: end; }
.detail-note { margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.timeline { padding: 8px 8px 7px; border: 1px solid #edf0f3; border-radius: 8px; background: #f6f7fa; }
.track { position: relative; display: grid; gap: 4px; }
.track-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-height: 13px;
  color: var(--muted);
  font-size: 10px;
}
.track-line { position: relative; height: 7px; border-radius: 20px; background: #e6eaf0; }
.track-line b { position: absolute; top: 0; height: 7px; border-radius: 20px; }
.bar-prev { background: #8999aa; }
.bar-current { background: #6f79df; }
.wall { position: absolute; top: 0; z-index: 1; height: 7px; border: 1px solid #cb8c38; border-radius: 2px; background: #e0aa5a; }
.time-axis { display: flex; justify-content: space-between; margin-top: 2px; margin-inline-start: 36px; font-size: 10px; }
.context { display: grid; gap: 5px; }
.context-title { margin-block: 1px; color: var(--muted); font-size: 12px; font-weight: 590; }
.caption { min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.caption.current { border-color: var(--accent-line); background: #f2f3ff; }
.caption-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 3px 5px; line-height: 1.35; }
.caption-meta b { color: var(--muted); font-size: 10px; font-weight: 590; }
.caption.current .caption-meta b { color: var(--accent-ink); }
.caption p { margin-top: 3px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.review-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: auto; padding-top: 2px; }
.review-footer .button { min-height: 34px; font-size: 12px; }
.review-footer .mark { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.review-footer .mark:hover:enabled { border-color: #babff5; background: #e6e8ff; }
.empty-detail, .file-message { padding: 28px 18px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.failure-code { margin-block: 6px; color: var(--red); }
.failure-retry { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 10px; }
.failure-retry .button { min-height: 33px; }
.mobile-nav, .mobile-file-back, .mobile-export { display: none; }
.interface-footer { padding: 12px 1px 0; color: var(--muted); font-size: 11px; text-align: end; }

@media (max-width: 1230px) and (min-width: 761px) {
  .shell { width: calc(100% - 40px); }
  .workspace { grid-template-columns: 228px minmax(0, 1fr); }
  .review-grid { grid-template-columns: minmax(0, 1fr) 298px; }
  .table th:nth-child(1) { width: 70px; }
  .table th:nth-child(2) { width: 100px; }
}

@media (max-width: 1040px) and (min-width: 761px) {
  .review-grid { grid-template-columns: minmax(0, 1fr); }
  .review-panel { position: static; min-height: 0; border-inline-start: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(69px + env(safe-area-inset-bottom)); }
  .shell { width: calc(100% - 28px); }
  .top .shell { min-height: 48px; }
  .site-links, .brand { gap: 7px; }
  .site-links { min-width: 0; flex-wrap: wrap; row-gap: 3px; }
  .language { flex: none; }
  .brand { font-size: 13px; }
  .brand-mark { width: 25px; height: 25px; border-radius: 6px; font-size: 12px; }
  .brand-product { padding-inline-start: 7px; font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
  .language { gap: 1px; }
  .language svg { width: 13px; height: 13px; }
  .language select { font-size: 11px; max-inline-size: 28vw; text-overflow: ellipsis; }
  main.shell { padding-top: 17px; }
  .intro { display: block; margin-bottom: 14px; }
  h1 { font-size: 25px; }
  .subtitle { margin-top: 5px; font-size: 12px; }
  .action-row { justify-content: flex-start; margin-top: 12px; }
  .action-row .primary { display: none; }
  .action-row .plain { order: 2; }
  .action-row .button { min-height: 36px; }
  .settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .field { gap: 6px; }
  html[lang="en"] .settings .field { display: grid; gap: 3px; }
  .field select { max-width: 100%; }
  .settings .rerun { margin: 0; }
  .drop-zone { min-height: 176px; }
  .summary { gap: 6px; margin-block: 10px; }
  .metric { display: flex; flex-direction: column; align-items: flex-start; padding: 7px 8px; border-radius: 8px; }
  .metric-label { font-size: 10px; }
  .metric-icon { display: none; }
  .metric-value { margin-top: auto; padding-top: 3px; font-size: 22px; }
  .workspace { display: block; }
  .files, .results { min-height: 0; }
  .panel-head, .result-head { min-height: 52px; padding: 9px 11px; }
  .file-row { min-height: 56px; }
  .review-grid { display: block; }
  .review-panel { position: static; min-height: 0; gap: 9px; padding: 12px; border-inline-start: 0; }
  .filters { padding: 8px; }
  .table th:first-child, .table td:first-child { padding-inline-start: 10px; }
  .table th, .table td { padding-inline: 7px; }
  .table th:nth-child(1) { width: 69px; }
  .table th:nth-child(2) { width: 97px; }
  .table th:nth-child(4) { width: 24px; }
  .table tr:last-child td:first-child { border-end-start-radius: 11px; }
  .cue-no { font-size: 12px; }
  .review-footer .button { min-height: 36px; }
  .interface-footer { display: none; }
  .mobile-nav, .mobile-file-back {
    padding: 2px 0 8px;
    border: 0;
    background: transparent;
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 590;
  }
  .mobile-export {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-strong);
    background: var(--card);
  }
  .report-count { color: var(--muted); font-size: 11px; }
  .mobile-export .button { min-height: 36px; }
  [data-mobile="files"] .results, [data-mobile="issues"] .files, [data-mobile="detail"] .files,
  [data-mobile="issues"] .overview, [data-mobile="detail"] .overview,
  [data-mobile="issues"] .review-panel, [data-mobile="detail"] .issues { display: none; }
  [data-mobile="detail"] .mobile-nav, [data-mobile="issues"] .mobile-file-back { display: inline-flex; align-items: center; gap: 4px; }
  [data-mobile="detail"] .caption { padding: 8px; }
  [data-mobile="detail"] .caption p { font-size: 14px; }
  [data-mobile="detail"] .review-footer { margin-top: 5px; }
}

@media (max-width: 360px) {
  .site-links, .brand { gap: 5px; }
  .brand-product { padding-inline-start: 6px; }
  .field { display: grid; gap: 3px; }
  .result-head { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 0; }
  .result-head .file-icon { grid-area: 1 / 1 / 3 / 2; }
  .result-name { display: contents; }
  .result-head h2 { grid-area: 1 / 2; }
  .result-actions { grid-area: 1 / 3; }
  .result-meta { grid-area: 2 / 2 / 3 / 4; gap: 1px 3px; margin-top: 0; font-size: 11px; }
  .result-head .badge { max-width: 72px; }
  .table th:nth-child(1) { width: 58px; }
  .table th:nth-child(2) { width: 88px; }
  .table th:nth-child(4) { width: 21px; }
  .table .time { font-size: 10px; }
  .rule-name { font-size: 12px; }
}
