:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #16233a;
  --muted: #66748b;
  --line: #dfe6ef;
  --brand: #12563a;
  --brand-2: #0e7a52;
  --brand-soft: #e8f4ee;
  --accent: #e8734a;
  --danger: #c0392b;
  --shadow: 0 1px 2px rgba(16, 35, 60, .04), 0 12px 32px rgba(16, 35, 60, .07);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin: 0 auto; padding-left: 22px; padding-right: 22px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 34px; color: var(--brand); flex: none; }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.brand-sub { color: var(--muted); font-size: 12px; line-height: 1.1; }
.privacy-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid #cce5d8;
  border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2bb673; box-shadow: 0 0 0 3px rgba(43, 182, 115, .16);
  display: inline-block; flex: none;
}

/* hero */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px;
  align-items: center; padding-top: 72px; padding-bottom: 56px;
}
.eyebrow {
  color: var(--brand-2); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 1.4px; margin: 0 0 16px;
}
.hero h1 {
  font-size: clamp(30px, 4.1vw, 46px); line-height: 1.14;
  letter-spacing: -1.4px; margin: 0 0 20px; font-weight: 800;
}
.hero h1 span { color: var(--brand-2); }
.lead { color: var(--muted); font-size: 16px; line-height: 1.75; max-width: 620px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 9px;
  padding: 12px 20px; font-size: 14px; font-weight: 650;
  cursor: pointer; text-decoration: none; transition: .16s ease;
  font-family: inherit;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(18, 86, 58, .22); }
.btn-primary:hover { background: #0d4830; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #b9c7d8; background: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 9px 14px; font-size: 13px; }

.hero-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.hero-card-top {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--line);
}
.mini-dot { width: 9px; height: 9px; border-radius: 50%; }
.mini-dot.red { background: #e06b5b; }
.mini-dot.yellow { background: #e5b74e; }
.mini-dot.green { background: #4eb57f; }
.hero-card-name { margin-left: 10px; color: var(--muted); font-size: 12px; }
.hero-card-body { padding: 22px 20px; font-size: 13.5px; line-height: 2.1; }
.fake-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fake-word { color: #3d4a61; }
.fake-hit {
  background: #fde9e3; color: #b0402a; border-radius: 4px;
  padding: 2px 5px; text-decoration: line-through; text-decoration-color: #e5a08c;
}
.fake-safe { background: var(--brand-soft); color: var(--brand); border-radius: 4px; padding: 2px 6px; font-weight: 700; }
.fake-divider { height: 1px; background: var(--line); margin: 12px 0; }
.hero-card-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-top: 1px solid var(--line);
  background: #fbfdfc; color: var(--brand); font-size: 12px; font-weight: 600;
}

/* features */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding-top: 8px; padding-bottom: 64px;
}
.feature {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 14px;
}
.feature-icon svg {
  width: 21px; height: 21px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.feature h3 { margin: 0 0 7px; font-size: 15px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* sections */
.workspace, .results, .about { padding-bottom: 56px; }
.section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.section-head h2 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.5px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.step-pill {
  background: #eef3f9; color: #42536d; border: 1px solid #dde6f1;
  border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 650; white-space: nowrap;
}

.panels { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab {
  border: 0; background: none; font-family: inherit; cursor: pointer;
  padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

textarea {
  width: 100%; min-height: 250px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font: 13.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink); background: #fbfcfe; outline: none;
}
textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(14, 122, 82, .1); }
#outputText { background: #f6fbf8; min-height: 220px; }
.field-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 9px; color: var(--muted); font-size: 12px;
}
.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--brand-2); font: inherit; font-size: 12px; font-weight: 650;
  text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--brand); }
.inline-link { color: var(--brand-2); font-weight: 700; cursor: pointer; text-decoration: underline; }

.dropzone {
  border: 2px dashed #c9d6e6; border-radius: 11px;
  padding: 32px 20px; text-align: center; background: #fbfcfe;
  transition: .15s ease; cursor: pointer;
}
.dropzone.over { border-color: var(--brand-2); background: var(--brand-soft); }
.dropzone svg {
  width: 34px; height: 34px; fill: none; stroke: var(--brand-2);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px;
}
.drop-title { margin: 0 0 2px; font-weight: 650; }
.drop-hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.drop-formats { margin: 0; color: #98a4b6; font-size: 11.5px; }
#fileInput { display: none; }
.file-info {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; margin-top: 14px; background: #fbfcfe;
}
.file-icon {
  width: 34px; height: 34px; border-radius: 8px; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; flex: none;
}
.file-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { color: var(--muted); font-size: 11.5px; }
.file-local { color: var(--brand); font-size: 11px; font-weight: 650; white-space: nowrap; }
.file-note { color: var(--muted); font-size: 12px; margin: 10px 2px 0; }

fieldset { border: 0; margin: 0; padding: 0; }
legend { font-size: 13px; font-weight: 700; color: var(--ink); padding: 0; }
.mode-block { margin-bottom: 18px; }
.mode-block legend { margin-bottom: 10px; }
.radio-row {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 8px 10px; border-radius: 9px; border: 1px solid transparent;
}
.radio-row:hover { background: #f8fafc; }
.radio-row input { margin: 3px 0 0; accent-color: var(--brand); flex: none; }
.radio-row span { display: flex; flex-direction: column; }
.radio-row strong { font-size: 13px; font-weight: 650; }
.radio-row small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }

.trigger-block {
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 14px;
}
.trigger-block label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.trigger-block input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; font: 12.5px/1.4 inherit; color: var(--ink);
  background: #fff; outline: none;
}
.trigger-block input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(14, 122, 82, .1); }
.trigger-block .hint { margin: 7px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }

.cat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px; border-top: 1px solid var(--line); margin-bottom: 10px;
}
.cat-tools { display: flex; gap: 6px; align-items: center; }
.cat-tools .sep { color: var(--line); }
.categories { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.cat-label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 5px 6px; border-radius: 7px; font-size: 12.5px;
}
.cat-label:hover { background: #f8fafc; }
.cat-label input { accent-color: var(--brand); margin: 0; flex: none; }
.cat-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.run-bar {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px; margin-top: 18px;
  box-shadow: var(--shadow);
}
.btn-run { padding: 13px 26px; font-size: 15px; white-space: nowrap; }
.run-note { margin: 0; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }

/* results */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.8px; color: var(--brand); }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.result-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.result-panel textarea { min-height: 300px; }
.result-badge {
  margin-left: auto; background: var(--brand-soft); color: var(--brand);
  border-radius: 999px; padding: 4px 11px; font-size: 11px; font-weight: 700;
}
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.report-wrap { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.report-table th {
  text-align: left; padding: 9px 11px; background: #f8fafc;
  color: var(--muted); font-weight: 650; font-size: 11.5px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
.report-table td { padding: 8px 11px; border-bottom: 1px solid #eef2f7; }
.report-table tr:last-child td { border-bottom: 0; }
.report-table td:nth-child(2) { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand); width: 74px; }
.report-table td:nth-child(3) { color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; }
.empty-row td { text-align: center; color: var(--muted); padding: 22px; }
.preview-block { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.preview-block h4 { margin: 0 0 4px; font-size: 13.5px; }
.preview-hint { margin: 0 0 10px; color: var(--muted); font-size: 11.5px; }
.preview {
  max-height: 230px; overflow: auto; background: #fbfcfe;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 12px; font: 12px/1.75 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.hl { background: #fde9e3; color: #a33a25; border-radius: 3px; padding: 0 2px; }
.disclaimer {
  display: flex; gap: 12px; margin-top: 18px;
  background: #fff8f2; border: 1px solid #f0dfcd; border-radius: 11px; padding: 16px 18px;
}
.disclaimer svg { width: 20px; height: 20px; flex: none; fill: none; stroke: #b4682f; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.disclaimer p { margin: 0; color: #7d5a3c; font-size: 12.5px; }

/* about */
.about { border-top: 1px solid var(--line); padding-top: 48px; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.about-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.about-num { color: var(--brand-2); font-weight: 800; font-size: 12px; letter-spacing: 1px; }
.about-item h3 { margin: 8px 0 6px; font-size: 15px; }
.about-item p { margin: 0; color: var(--muted); font-size: 13px; }
.tech-note {
  margin-top: 18px; background: #f0f4f8; border: 1px solid #dde6ef;
  border-radius: 11px; padding: 16px 18px; color: #4a5a70; font-size: 12.5px;
}
.tech-note code { background: #fff; border: 1px solid #d9e2ec; border-radius: 4px; padding: 1px 5px; font-size: 11.5px; color: #234; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding-top: 22px; padding-bottom: 22px; color: var(--muted); font-size: 12px;
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #16233a; color: #fff; padding: 11px 18px; border-radius: 9px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 50;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 44px; }
  .hero-card { max-width: 620px; }
  .panels, .result-grid { grid-template-columns: 1fr; }
  .features, .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .privacy-badge { font-size: 0; padding: 8px; }
  .privacy-badge .live-dot { margin: 0; }
  .header-inner { min-height: 62px; }
  .brand-title { font-size: 14px; }
  .hero h1 { letter-spacing: -.8px; }
  .panel { padding: 16px; }
  .categories { grid-template-columns: 1fr; }
  .run-bar { flex-direction: column; align-items: stretch; }
  .btn-run { width: 100%; }
  .footer-inner { flex-direction: column; }
}
