:root {
  --bg: #f7f8fa;
  --card: #fff;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-ink: #fff;
  --accent-soft: #eff4ff;
  --safe: #15803d;
  --safe-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fff8eb;
  --info: #475569;
  --info-soft: #f3f4f6;
  --old: #fee2e2;
  --new: #dcfce7;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.muted { color: var(--ink-2); font-size: 13px; margin: 2px 0 0; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.brand-name { font-size: 16px; }
.privacy-pill { font-size: 13px; color: var(--ink-2); }
.top-right { display: flex; align-items: center; gap: 16px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: 0; background: var(--card); color: var(--ink-2); font: 500 13px var(--font); padding: 5px 10px; cursor: pointer; }
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }

main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px 28px 40px; }

.landing { max-width: 720px; margin: 40px auto 0; text-align: center; }
.landing h1 { font-size: 36px; line-height: 1.2; }
.sub { color: var(--ink-2); font-size: 17px; margin: 10px 0 28px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 24px; border: 2px dashed #c7d2fe; border-radius: 16px; background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus-visible, body.dragging .drop { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop-icon { font-size: 28px; color: var(--accent); }
.drop-title { font-size: 20px; font-weight: 600; }
.drop-or { color: var(--ink-3); font-size: 13px; }
.drop-hint { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.steps { list-style: none; display: flex; justify-content: center; gap: 24px; padding: 0; margin: 24px 0 0; color: var(--ink-2); font-size: 14px; flex-wrap: wrap; }
.steps b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 12px; margin-right: 4px; }
.try { color: var(--ink-2); font-size: 14px; margin-top: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #cbd5e1; background: #f9fafb; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: #1d4ed8; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; height: 42px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.work { display: flex; flex-direction: column; gap: 16px; }

.file-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.file-icon { font-size: 22px; }
.file-meta { flex: 1; min-width: 200px; }
.file-name { font-weight: 600; word-break: break-all; }
.file-stats { color: var(--ink-2); font-size: 13px; }
.file-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
select { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: #fff; font: 13px var(--font); color: var(--ink); max-width: 260px; }
.notices { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notices:empty { display: none; }
.notice { font-size: 13px; padding: 7px 10px; border-radius: 8px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--info-soft); color: var(--info); }

.cols { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 16px; align-items: start; }
.issues-card { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.issues-card h2 { margin-bottom: 10px; }
#issues { overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px; }
.empty { color: var(--ink-2); font-size: 14px; padding: 12px 0; margin: 0; }
.group { margin-bottom: 14px; }
.group-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.group-head span { text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.group.safe .group-head b { color: var(--safe); }
.group.review .group-head b { color: var(--warn); }
.group.info .group-head b { color: var(--info); }
.issue { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; transition: border-color .15s, background .15s; }
.issue.on { border-color: #bfdbfe; background: #f8fbff; }
.issue.info { background: #fafafa; }
.issue-head { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.issue.info .issue-head { cursor: default; }
.issue-head input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.mark { color: var(--info); width: 16px; text-align: center; flex-shrink: 0; }
.issue-title { font-weight: 600; font-size: 14px; flex: 1; }
.fix { font-size: 12px; color: var(--accent); white-space: nowrap; margin-top: 2px; }
.issue.safe .issue-title::before { content: "✓ "; color: var(--safe); }
.issue.review .issue-title::before { content: "⚠ "; color: var(--warn); }
.issue-detail { margin: 4px 0 0 24px; font-size: 13px; color: var(--ink-2); word-break: break-word; white-space: pre-wrap; }
.issue-opts { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0 24px; }
.issue-opts .ctl { justify-content: space-between; }
.issues-actions { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.hint { font-size: 12px; color: var(--ink-2); margin: 6px 0 0; text-align: center; min-height: 18px; }

.data-card { min-width: 0; }
.data-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.grid-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: 8px; }
.grid-wrap.short { max-height: 50vh; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.grid th, .grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 10px; text-align: left; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.grid thead th { position: sticky; top: 0; background: #f3f4f6; z-index: 2; font-weight: 600; cursor: pointer; vertical-align: bottom; }
.grid.cmp thead th { cursor: default; }
.grid th .col-letter { display: block; font-size: 10px; color: var(--ink-3); font-weight: 500; }
.grid th .col-name.blank { color: var(--ink-3); font-style: italic; font-weight: 400; }
.grid th:hover, .grid th.focus { background: #e0e7ff; }
.grid .rn { position: sticky; left: 0; background: #f9fafb; color: var(--ink-3); font-size: 11px; text-align: right; min-width: 44px; z-index: 1; font-variant-numeric: tabular-nums; }
.grid thead .rn { z-index: 3; }
.grid td.nil { background: repeating-linear-gradient(-45deg, #fff, #fff 4px, #f8f8f8 4px, #f8f8f8 8px); }
.grid .hl { background: var(--accent-soft) !important; }
.grid td.old { background: var(--old); }
.grid td.chg, .grid th.chg { background: var(--new); font-weight: 500; }
.grid tr.gone td { background: var(--old); text-decoration: line-through; color: #991b1b; }
.grid tr.gone-after td { background: #f9fafb; color: var(--ink-3); font-style: italic; }
.col-info { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 13px; }
.ci-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.col-info dl { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; margin: 0; }
.col-info dt { color: var(--ink-2); }
.col-info dd { margin: 0; word-break: break-word; }

.compare { border-color: #bfdbfe; box-shadow: 0 4px 24px rgba(37, 99, 235, .08); }
.compare-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.compare-actions { display: flex; gap: 8px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp-side { min-width: 0; }
.removed-cols { font-size: 13px; background: var(--old); color: #991b1b; padding: 6px 10px; border-radius: 8px; margin: 0 0 10px; }

.download { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.dl-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.busy { position: fixed; inset: 0; background: rgba(255, 255, 255, .7); display: grid; place-items: center; z-index: 50; font-size: 15px; color: var(--ink-2); grid-auto-flow: column; gap: 10px; align-content: center; justify-content: center; }
.spinner { width: 20px; height: 20px; border: 3px solid #c7d2fe; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; max-width: min(560px, calc(100vw - 32px)); }

.doc { max-width: 720px; }
.doc h1 { font-size: 28px; margin-bottom: 4px; }
.doc h2 { margin: 24px 0 6px; }
.doc p { color: var(--ink-2); }
.doc a, .foot a { color: var(--accent); }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 28px; color: var(--ink-3); font-size: 12px; border-top: 1px solid var(--line); background: var(--card); }

@media (max-width: 960px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .issues-card { position: static; max-height: none; }
  .cmp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top { padding: 12px 16px; }
  .privacy-pill { display: none; }
  main { padding: 16px; }
  .landing { margin-top: 12px; }
  .landing h1 { font-size: 26px; }
  .drop { padding: 36px 16px; }
  .foot { padding: 14px 16px; }
  .fix { display: none; }
  .ctl { width: 100%; justify-content: space-between; }
  .ctl select { flex: 1; min-width: 0; max-width: none; }
  .issue-opts .ctl { flex-wrap: wrap; }
  .download, .dl-actions, .dl-actions .btn { width: 100%; }
}
