:root {
  --brand: #1f449b;
  --brand-deep: #122e69;
  --brand-mid: #315ab6;
  --brand-pale: #edf2ff;
  --brand-line: #cfdaf4;
  --risk: #bd1f32;
  --risk-deep: #9f1728;
  --risk-bg: #fff0f1;
  --risk-line: #dd5362;
  --amber: #9b5b00;
  --amber-bg: #fff4dc;
  --amber-line: #d98b16;
  --green: #18794e;
  --green-bg: #e9f7ef;
  --ink: #202a3a;
  --muted: #667187;
  --soft: #8a94a6;
  --line: #e1e7f0;
  --paper: #ffffff;
  --canvas: #f4f6fb;
  --radius: 18px;
  --shadow: 0 14px 38px rgba(28, 50, 92, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.65 "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(31, 68, 155, .24);
  outline-offset: 2px;
}
svg { display: block; }
.container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; padding: 9px 14px; background: #fff; color: var(--brand); border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 80; height: 78px; background: rgba(255,255,255,.96); border-bottom: 1px solid rgba(219,226,238,.9); backdrop-filter: blur(14px); }
.nav-row { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; min-width: 250px; }
.brand-identity { position: relative; display: block; width: 230px; height: 70px; flex: 0 0 230px; overflow: hidden; }
.brand-logo-fallback { position: absolute; left: 0; top: 50%; display: block; width: 228px; max-width: none; height: auto; transform: translateY(-50%); transition: opacity .15s; }
.official-logo-crop { display: none; position: absolute; left: 0; top: 0; width: 150px; height: 70px; overflow: hidden; }
.official-logo-crop img { position: absolute; top: 15px; display: block; max-width: none; height: 40px; }
.brand-product-label { display: none; padding-left: 10px; border-left: 1px solid #dfe5f0; color: #71809b; font-size: 11px; line-height: 1.65; white-space: nowrap; }
.brand.official-logo-loaded .brand-identity { width: 150px; flex-basis: 150px; }
.brand.official-logo-loaded .brand-logo-fallback { opacity: 0; visibility: hidden; }
.brand.official-logo-loaded .official-logo-crop { display: block; }
.brand.official-logo-loaded .brand-product-label { display: block; }
.primary-nav { display: flex; align-items: stretch; align-self: stretch; gap: 5px; margin-left: auto; }
.primary-nav a { position: relative; display: flex; align-items: center; padding: 0 16px; color: #58657b; font-size: 14px; transition: color .18s, background .18s; }
.primary-nav a::after { position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; background: var(--brand); border-radius: 3px 3px 0 0; content: ""; transform: scaleX(0); transform-origin: center; transition: transform .18s; }
.primary-nav a:hover, .primary-nav a.active { color: var(--brand); background: linear-gradient(180deg, transparent 75%, rgba(31,68,155,.04)); }
.primary-nav a.active::after, .primary-nav a:hover::after { transform: scaleX(1); }
.local-badge { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 11px; border: 1px solid #dbe5f6; border-radius: 100px; color: var(--brand); background: #f6f8ff; font-size: 12px; }
.local-dot { width: 7px; height: 7px; border-radius: 50%; background: #2b9b6a; box-shadow: 0 0 0 4px rgba(43,155,106,.10); }

.hero { position: relative; overflow: hidden; background: linear-gradient(112deg, #132e68 0%, #1f449b 56%, #315bb8 100%); color: #fff; }
.hero::before { position: absolute; content: ""; width: 490px; height: 490px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -110px; top: -260px; }
.hero::after { position: absolute; content: ""; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: 70px; bottom: -300px; }
.hero-grid { position: relative; z-index: 1; min-height: 304px; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(310px, .88fr); align-items: center; gap: 35px; padding-top: 30px; padding-bottom: 54px; }
.hero-copy { padding: 8px 0 0; }
.hero-kicker { display: flex; align-items: center; gap: 10px; color: #cbd9ff; font-size: 12px; letter-spacing: 1px; margin-bottom: 13px; }
.kicker-line { display: inline-block; height: 2px; width: 28px; border-radius: 2px; background: #f4a334; }
.hero h1 { margin: 0; font-size: clamp(29px, 3.1vw, 39px); line-height: 1.35; letter-spacing: .2px; font-weight: 800; }
.hero h1 span { color: #f9c36c; }
.hero-copy > p { max-width: 625px; margin: 14px 0 20px; color: #d9e3fa; line-height: 1.9; font-size: 14px; }
.hero-points { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.hero-points span { display: inline-flex; align-items: center; gap: 7px; color: #eef3ff; font-size: 12px; }
.hero-points svg { width: 17px; height: 17px; fill: none; stroke: #a9c3ff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hero-art { display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.hero-art svg { width: min(100%, 465px); height: auto; overflow: visible; }

.workspace { position: relative; z-index: 2; margin-top: -38px; padding-bottom: 27px; }
.surface-card { background: var(--paper); border: 1px solid #e4e9f2; border-radius: var(--radius); box-shadow: var(--shadow); }
.editor-card { padding: 27px 30px 24px; }
.editor-heading, .section-heading-row, .rewrite-heading, .library-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { margin-bottom: 5px; color: var(--brand); font-size: 11px; letter-spacing: 1.3px; font-weight: 800; text-transform: none; }
.editor-heading h2, .section-heading-row h2, .rewrite-heading h3, .library-heading h3, .rules-heading h3 { margin: 0; color: #1d2a40; font-size: 23px; letter-spacing: -.2px; line-height: 1.4; }
.editor-heading p, .section-heading-row p, .library-heading p, .rules-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.editor-tools { display: flex; gap: 8px; padding-top: 10px; flex: 0 0 auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 700; line-height: 1.25; cursor: pointer; white-space: nowrap; transition: background .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.btn-quiet { color: #4f5d73; background: #f7f9fc; border-color: #e6eaf1; }
.btn-quiet:hover:not(:disabled) { color: var(--brand); border-color: #becdf0; background: #f0f4ff; }
.btn-outline { color: var(--brand); background: white; border-color: #c4d1ed; }
.btn-outline:hover:not(:disabled) { background: #f3f6ff; border-color: var(--brand); }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 6px 14px rgba(31,68,155,.18); }
.btn-primary:hover:not(:disabled) { background: #17377f; box-shadow: 0 8px 18px rgba(31,68,155,.23); }
.btn-check { min-height: 45px; padding: 9px 15px 9px 17px; font-size: 14px; border-radius: 11px; }
.btn-check svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-arrow { margin-left: 4px; font-size: 18px; line-height: 1; transition: transform .18s; }
.btn-check:hover .button-arrow { transform: translateX(3px); }
.textarea-frame { margin-top: 21px; overflow: hidden; border: 1px solid #dce4f0; border-radius: 13px; background: #fafbfe; transition: border-color .18s, box-shadow .18s; }
.textarea-frame:focus-within { border-color: #829bd3; box-shadow: 0 0 0 4px rgba(31,68,155,.055); }
#wen { display: block; width: 100%; min-height: 204px; resize: vertical; border: 0; outline: 0; padding: 17px 19px 12px; background: transparent; color: #243047; font-size: 14px; line-height: 1.9; }
#wen::placeholder { color: #a2adbf; }
.textarea-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid #edf0f6; color: #8894a8; font-size: 11px; }
#lenLive { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.editor-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 17px; }
.legend-list, .editor-submit { display: flex; align-items: center; flex-wrap: wrap; gap: 17px; }
.legend-item, .preview-legend span { display: inline-flex; align-items: center; gap: 7px; color: #69758a; font-size: 12px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.legend-dot.banned { background: var(--risk); box-shadow: 0 0 0 3px rgba(189,31,50,.10); }
.legend-dot.sensitive { background: #c47a13; box-shadow: 0 0 0 3px rgba(196,122,19,.12); }
.editor-submit { gap: 15px; }
.privacy-note { display: inline-flex; align-items: center; gap: 6px; color: #7c889b; font-size: 11px; white-space: nowrap; }
.privacy-note svg { width: 15px; height: 15px; fill: none; stroke: #8491a5; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 19px 0 22px; padding: 0; list-style: none; }
.stat-card { position: relative; overflow: hidden; padding: 17px 19px 14px; border: 1px solid #e2e8f1; border-radius: 15px; background: #fff; box-shadow: 0 7px 19px rgba(36,55,92,.035); }
.stat-card::before { position: absolute; content: ""; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 4px 4px 0; background: var(--brand); }
.risk-stat::before { background: var(--risk); }
.sensitive-stat::before { background: #c47a13; }
.state-stat::before { background: #249165; }
.stat-label { color: #6b778c; font-size: 12px; }
.stat-bottom { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; }
.stat-value { color: var(--ink); font-size: 31px; line-height: 1.3; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.6px; }
.stat-value.red, .v.red { color: var(--risk); }
.stat-value.orange, .v.orange { color: #a66207; }
.stat-value.green, .v.green { color: var(--green); }
.stat-value.v { font-size: 17px; letter-spacing: 0; }
.stat-unit { color: #9aa4b4; font-size: 12px; }
.stat-caption { display: block; margin-top: 7px; color: #9aa4b4; font-size: 11px; }

.preview-card { padding: 24px 27px 17px; }
.section-heading-row { align-items: center; }
.section-heading-row h2 { position: relative; padding-bottom: 7px; }
.section-heading-row h2::after { position: absolute; content: ""; left: 0; bottom: 0; width: 38px; height: 3px; border-radius: 3px; background: var(--brand); }
.mini-note { color: #8b96a9; font-size: 11px; }
.highlight-content { min-height: 105px; max-height: 280px; overflow: auto; margin-top: 17px; padding: 16px 18px; border: 1px solid #e8edf5; border-radius: 12px; background: #fbfcff; color: #384459; font-size: 14px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.ph { color: #9aa5b6; }
mark.bad { padding: 1px 3px 2px; border-radius: 4px; background: var(--risk-bg); color: var(--risk-deep); font-weight: 800; border-bottom: 2px solid var(--risk-line); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
mark.sen { padding: 1px 3px 2px; border-radius: 4px; background: var(--amber-bg); color: var(--amber); font-weight: 750; border-bottom: 2px solid var(--amber-line); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
mark.fix { padding: 1px 3px; border-radius: 4px; background: var(--green-bg); color: var(--green); font-weight: 750; border-bottom: 2px solid #50ad80; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.preview-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 13px; }
.preview-legend-note { margin-left: auto; color: #9aa4b4 !important; font-size: 11px !important; }

.content-section { padding: 53px 0 56px; }
.content-section#advice { background: #fff; border-top: 1px solid #e9edf5; border-bottom: 1px solid #e9edf5; }
.section-main-heading { align-items: flex-end; margin-bottom: 20px; }
.section-main-heading h2 { font-size: 27px; }
.section-main-heading h2::after { width: 46px; }
.heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.table-card { overflow: hidden; }
.table-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #ebeff5; }
.table-title { font-size: 15px; font-weight: 800; color: #29364c; }
.table-count { display: inline-flex; align-items: center; color: #79869b; font-size: 11px; font-weight: 600; }
.table-scroll { width: 100%; max-height: 445px; overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tbl thead { position: sticky; top: 0; z-index: 1; }
table.tbl th { padding: 13px 16px; background: #f5f7fc; color: #66748b; font-size: 11px; font-weight: 800; text-align: left; white-space: nowrap; border-bottom: 1px solid #e5eaf3; }
table.tbl td { padding: 13px 16px; vertical-align: top; color: #657187; line-height: 1.75; border-bottom: 1px solid #eef1f6; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: #fafbfe; }
.col-word { width: 20%; }
.col-type { width: 13%; }
.col-replace { width: 23%; }
.col-action { width: 80px; }
table.tbl .w-bad { color: var(--risk-deep); font-weight: 800; }
table.tbl .w-sen { color: var(--amber); font-weight: 800; }
table.tbl .w-fix { color: #227a55; }
table.tbl .del { color: #8d96a5; font-style: italic; }
.tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.tag.r { background: var(--risk-bg); color: var(--risk-deep); }
.tag.o { background: var(--amber-bg); color: var(--amber); }
.tag.g { background: var(--green-bg); color: var(--green); }
.tbl .btn-mini { min-height: 29px; padding: 5px 9px; border: 1px solid #cbd7ef; background: #f8faff; color: var(--brand); border-radius: 7px; font-size: 11px; }
.tbl .btn-mini:hover { border-color: var(--brand); background: #edf2ff; }
.empty-cell { padding: 36px 18px !important; text-align: center; color: #9ba5b5 !important; }
.rewrite-card { margin-top: 20px; padding: 23px 26px 0; }
.rewrite-heading { align-items: center; }
.rewrite-heading h3 { font-size: 19px; margin-bottom: 5px; }
.rewrite-heading .eyebrow { margin-bottom: 4px; }
.rewrite-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.clean-output { min-height: 118px; max-height: 340px; overflow: auto; margin-top: 18px; padding: 16px 18px; border: 1px solid #e6ebf4; border-radius: 12px 12px 0 0; background: #fbfcff; color: #39455a; font-size: 14px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 -26px; padding: 15px 26px 17px; background: #fff9ed; border-top: 1px solid #f5e5c5; border-radius: 0 0 var(--radius) var(--radius); }
.notice-note svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; fill: none; stroke: #a96c12; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notice-note p { margin: 0; color: #89652b; font-size: 12px; line-height: 1.85; }
.notice-note strong { color: #7b5010; }

.library-section { background: #f4f6fb; }
.library-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.library-metric { display: flex; flex-direction: column; min-height: 148px; padding: 17px 19px; border: 1px solid #e0e7f3; border-radius: 15px; background: #fff; box-shadow: 0 7px 19px rgba(36,55,92,.035); }
.library-metric-label { color: #637189; font-size: 12px; }
.library-metric strong { margin-top: 2px; color: var(--risk); font-size: 32px; font-weight: 800; line-height: 1.45; font-variant-numeric: tabular-nums; }
.library-metric strong small { margin-left: 5px; color: #9aa4b4; font-size: 12px; font-weight: 500; }
.library-metric .library-metric-foot { margin-top: auto; color: #909bad; font-size: 11px; }
.library-metric.amber-metric strong { color: #a66207; }
.library-metric.neutral-metric strong { color: var(--brand); }
.library-card { overflow: hidden; }
.library-heading { padding: 21px 24px 17px; border-bottom: 1px solid #edf0f6; align-items: center; }
.library-heading h3 { font-size: 17px; }
.library-heading p { font-size: 12px; }
.library-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 17px 22px 10px; }
.field-label { color: #637189; font-size: 12px; font-weight: 700; }
.search-label { margin-left: 10px; }
.library-controls select, .library-controls input { height: 39px; padding: 0 12px; background: #fbfcff; color: #354158; border: 1px solid #dfe5ef; border-radius: 9px; outline: 0; }
.library-controls select { min-width: 135px; }
.library-controls input { width: min(260px, 100%); }
.library-controls select:focus, .library-controls input:focus { border-color: #829bd3; box-shadow: 0 0 0 3px rgba(31,68,155,.06); }
.library-hint { flex: 1 1 240px; color: #8894a8; font-size: 11px; text-align: right; }
.chips { display: flex; align-content: flex-start; flex-wrap: wrap; gap: 7px; max-height: 310px; overflow: auto; padding: 16px 22px 21px; }
.chips span { display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid #f1c4ca; border-radius: 8px; background: #fff5f6; color: var(--risk-deep); font-size: 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.chips span:hover { border-color: var(--risk-line); background: var(--risk-bg); }
.chips span.o { border-color: #f0d5a6; background: #fff8e9; color: #8d5808; }
.chips span.o:hover { border-color: var(--amber-line); background: #fff1d3; }
.chips span.h { border-color: #dbe2ee; background: #f3f5f9; color: #6f7a8e; cursor: default; }
.chips span.h:hover { border-color: #dbe2ee; background: #f3f5f9; }
.chips > div { flex-basis: 100%; color: #8c97a9 !important; font-size: 11px !important; margin-top: 4px !important; }
.rules-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 33px 0 16px; }
.rules-heading h3 { font-size: 20px; }
.rules-heading p { font-size: 12px; }
.rules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.rules-grid li { padding: 20px 21px; border: 1px solid #e1e7f0; border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(36,55,92,.03); }
.rules-grid li h3 { margin: 0 0 4px; color: #25324a; font-size: 16px; }
.rules-grid li .law { margin-bottom: 9px; color: var(--brand); font-size: 11px; font-weight: 800; }
.rules-grid li p { margin: 0; color: #69758a; font-size: 12px; line-height: 1.85; }
.rules-grid li .words { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.rules-grid li .words em { padding: 3px 7px; border-radius: 6px; background: var(--risk-bg); color: var(--risk-deep); font-size: 11px; font-style: normal; }
.rules-grid li .advice { margin-top: 11px; padding-top: 10px; border-top: 1px solid #edf0f6; color: var(--brand); font-size: 11px; line-height: 1.8; }

.reference-section { background: #fff; border-top: 1px solid #e8edf5; }
.reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; margin-top: 21px; }
.reference-link { display: flex; align-items: center; gap: 13px; padding: 18px 20px; border: 1px solid #e2e8f2; border-radius: 14px; background: #fff; transition: border-color .18s, box-shadow .18s, transform .18s; }
.reference-link:hover { border-color: #bdcbed; box-shadow: 0 8px 22px rgba(31,68,155,.07); transform: translateY(-2px); }
.reference-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: #edf2ff; color: var(--brand); }
.reference-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reference-link > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.reference-link strong { color: #28354c; font-size: 13px; }
.reference-link small { color: #8a96aa; font-size: 11px; }
.reference-arrow { margin-left: auto; color: #9aa6ba; font-size: 18px; }
.site-footer { padding: 26px 0; background: #132956; color: #d6e0f5; }
.footer-inner { display: grid; grid-template-columns: 205px minmax(0,1fr) auto; align-items: center; gap: 25px; }
.footer-brand { display: flex; align-items: center; gap: 9px; }
.footer-brand svg { width: 38px; height: 38px; flex: 0 0 38px; }
.footer-brand span { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { font-size: 14px; color: #fff; }
.footer-brand small { font-size: 10px; color: #9fb3dd; }
.footer-disclaimer { color: #b8c7e4; font-size: 11px; line-height: 1.9; }
.footer-copy { color: #8fa4d0; font-size: 10px; white-space: nowrap; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 28px; max-width: calc(100% - 32px); padding: 11px 18px; border: 1px solid rgba(255,255,255,.13); border-radius: 11px; background: #16254a; box-shadow: 0 10px 30px rgba(8,20,52,.22); color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1020px) {
  .nav-row { gap: 16px; }
  .brand { min-width: 225px; }
  .primary-nav a { padding: 0 10px; }
  .primary-nav a::after { left: 10px; right: 10px; }
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); }
  .editor-card { padding: 24px; }
  .heading-actions { max-width: 48%; }
  .footer-inner { grid-template-columns: 190px minmax(0,1fr); }
  .footer-copy { grid-column: 2; }
}
@media (max-width: 790px) {
  .container { width: min(100% - 30px, 660px); }
  .site-header { height: auto; min-height: 72px; }
  .nav-row { min-height: 72px; flex-wrap: wrap; gap: 0 14px; padding-top: 9px; }
  .brand { min-width: 0; margin-right: auto; }
  .brand-identity { width: 205px; flex-basis: 205px; }
  .brand-logo-fallback { width: 203px; }
  .brand.official-logo-loaded .brand-identity { width: 142px; flex-basis: 142px; }
  .brand.official-logo-loaded .official-logo-crop { width: 142px; }
  .brand-product-label { font-size: 10px; padding-left: 8px; }
  .local-badge { padding: 6px 9px; }
  .primary-nav { order: 3; flex: 1 0 100%; height: 42px; margin: 0 -2px; justify-content: space-between; }
  .primary-nav a { justify-content: center; padding: 0 9px; font-size: 12px; }
  .primary-nav a::after { left: 8px; right: 8px; }
  .hero-grid { min-height: 0; display: block; padding-top: 31px; padding-bottom: 61px; }
  .hero h1 { font-size: clamp(27px, 7vw, 35px); }
  .hero-copy > p { max-width: 570px; font-size: 13px; }
  .hero-art { display: none; }
  .hero-points { gap: 9px 16px; }
  .workspace { margin-top: -32px; }
  .editor-card { padding: 21px 18px 18px; border-radius: 16px; }
  .editor-heading { gap: 10px; }
  .editor-heading h2, .section-heading-row h2 { font-size: 21px; }
  .editor-heading p { max-width: 390px; font-size: 12px; }
  .editor-tools { gap: 5px; }
  .editor-tools .btn { padding: 7px 10px; font-size: 11px; }
  #wen { min-height: 190px; padding: 14px; font-size: 13px; }
  .editor-bottom { align-items: flex-start; flex-direction: column; }
  .editor-submit { width: 100%; justify-content: space-between; }
  .btn-check { min-height: 42px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .stat-card { min-height: 123px; padding: 14px 16px; }
  .stat-value { font-size: 28px; }
  .preview-card { padding: 21px 17px 15px; }
  .mini-note { max-width: 150px; text-align: right; }
  .preview-legend-note { margin-left: 0; flex-basis: 100%; }
  .content-section { padding: 40px 0 44px; }
  .section-main-heading { flex-direction: column; align-items: flex-start; gap: 15px; }
  .section-main-heading h2 { font-size: 24px; }
  .heading-actions { max-width: none; width: 100%; justify-content: flex-start; }
  .heading-actions .btn { font-size: 12px; }
  .rewrite-card { padding: 20px 17px 0; }
  .rewrite-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .rewrite-actions { justify-content: flex-start; }
  .notice-note { margin: 0 -17px; padding: 14px 17px 16px; }
  .library-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .library-metric { min-height: 134px; padding: 14px 16px; }
  .library-metric strong { font-size: 29px; }
  .library-controls { padding: 14px 15px 9px; gap: 8px; }
  .library-controls select { flex: 1 1 150px; }
  .search-label { margin-left: 0; }
  .library-controls input { flex: 1 1 210px; width: auto; }
  .library-hint { flex-basis: 100%; text-align: left; }
  .chips { padding: 13px 15px 18px; }
  .rules-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .rules-grid li { padding: 16px; }
  .reference-grid { grid-template-columns: 1fr; gap: 10px; }
  .footer-inner { grid-template-columns: 1fr; gap: 12px; }
  .footer-copy { grid-column: auto; white-space: normal; }
}
@media (max-width: 520px) {
  .container { width: calc(100% - 24px); }
  .brand-identity { width: 190px; flex-basis: 190px; }
  .brand-logo-fallback { width: 188px; }
  .brand.official-logo-loaded .brand-identity { width: 136px; flex-basis: 136px; }
  .brand.official-logo-loaded .official-logo-crop { width: 136px; }
  .local-badge { font-size: 10px; }
  .hero-grid { padding-top: 28px; padding-bottom: 52px; }
  .hero-kicker { font-size: 10px; }
  .hero h1 { font-size: 28px; }
  .hero-copy > p { margin: 12px 0 16px; line-height: 1.8; }
  .hero-points { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 10px; }
  .hero-points span { font-size: 11px; }
  .editor-heading { display: block; }
  .editor-tools { padding-top: 13px; }
  .textarea-meta { padding: 8px 12px; font-size: 10px; }
  .privacy-note { font-size: 10px; }
  .legend-list { gap: 15px; }
  .stat-card { min-height: 118px; padding: 13px 13px; }
  .stat-value { font-size: 26px; }
  .stat-value.v { font-size: 15px; }
  .stat-caption { font-size: 10px; }
  .section-heading-row { align-items: flex-start; }
  .section-heading-row h2 { font-size: 20px; }
  .mini-note { max-width: 115px; font-size: 10px; }
  .highlight-content { padding: 13px; font-size: 13px; }
  .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .heading-actions .btn { width: 100%; white-space: normal; }
  .table-topline { padding: 15px; }
  .table-scroll { max-height: 440px; }
  table.tbl { min-width: 760px; }
  .rewrite-actions .btn { padding: 8px 10px; font-size: 11px; }
  .library-metrics { gap: 8px; }
  .library-metric { min-height: 126px; padding: 12px; }
  .library-metric-label, .library-metric .library-metric-foot { font-size: 10px; }
  .library-metric strong { font-size: 27px; }
  .rules-grid { grid-template-columns: 1fr; }
  .reference-link { padding: 15px; }
  .footer-disclaimer { font-size: 10px; }
}

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