:root {
  --ink: #252321;
  --muted: #77726c;
  --soft: #9a948c;
  --paper: #f1efea;
  --paper-2: #f8f7f3;
  --card: rgba(255, 255, 255, .66);
  --line: rgba(59, 52, 47, .14);
  --red: #8d2e29;
  --red-2: #a23c35;
  --gold: #bc8144;
  --serif: "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: var(--sans); overflow-x: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.paper-grain { position: fixed; z-index: -1; inset: 0; opacity: .28; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E"); }

.topbar { position: sticky; z-index: 30; top: 0; height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(28px, calc((100vw - 1480px) / 2)); border-bottom: 1px solid rgba(68, 60, 54, .1); background: rgba(241, 239, 234, .9); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: #f4f1ec; background: #242426; font: 500 13px/1 Georgia, serif; letter-spacing: .06em; }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-size: 12px; letter-spacing: .08em; }
.brand-copy small { color: var(--muted); font-size: 7px; letter-spacing: .17em; }
.home-link { min-height: 44px; flex: none; border-radius: 11px; }
.home-link .brand-copy strong { color: var(--red); font-size: 13px; letter-spacing: .03em; }
.home-link .brand-copy small { letter-spacing: .03em; }
.home-link:hover .brand-copy strong { text-decoration: underline; text-underline-offset: 4px; }
.home-link:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions a { padding: 10px 14px; border-radius: 12px; color: #66615c; font-size: 12px; transition: .2s ease; }
.top-actions a:hover { color: var(--red); background: rgba(141, 46, 41, .06); }
.top-actions .download-link { color: #fff; background: linear-gradient(135deg, var(--red-2), #772722); box-shadow: 0 10px 24px rgba(141, 46, 41, .16); }
.download-link span { margin-left: 7px; }

main { width: min(1480px, calc(100% - 56px)); margin: 0 auto; }
.hero { min-height: 460px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(350px, .8fr); align-items: center; gap: 70px; padding: 74px 4vw 60px; border-bottom: 1px solid var(--line); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 26px; color: var(--red); font-size: 9px; font-weight: 600; letter-spacing: .24em; }
.eyebrow i { width: 28px; height: 1px; background: var(--red); }
.hero h1 { margin: 0; font: 500 clamp(58px, 7vw, 108px)/.94 var(--serif); letter-spacing: -.07em; }
.hero h1 em { color: var(--red); font-style: normal; }
.hero-lede { max-width: 720px; margin: 28px 0 0; color: #6d6862; font: 400 clamp(16px, 1.4vw, 20px)/1.85 var(--serif); }
.hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); align-self: stretch; align-content: center; border-left: 1px solid var(--line); }
.hero-meta > div { min-height: 118px; display: grid; align-content: center; gap: 5px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.hero-meta > div + div { border-left: 1px solid var(--line); }
.hero-meta > div strong { font: 500 clamp(30px, 3.5vw, 52px)/1 var(--serif); }
.hero-meta > div span { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.hero-meta > p { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 24px 22px; }
.hero-meta > p span, .hero-meta > p small { color: var(--muted); font-size: 9px; letter-spacing: .13em; }
.hero-meta > p strong { grid-column: 1; font: 500 20px/1.2 var(--serif); }
.hero-meta > p small { grid-column: 2; grid-row: 1 / span 2; align-self: end; }

.research-note { margin: 34px 0 44px; display: flex; align-items: center; gap: 18px; padding: 18px 22px; border: 1px solid rgba(141, 46, 41, .16); border-radius: 17px; background: rgba(255, 255, 255, .38); }
.note-mark { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--red); font: 600 14px/1 Georgia, serif; }
.research-note div { display: flex; align-items: baseline; gap: 18px; }
.research-note strong { flex: none; font: 500 14px/1.4 var(--serif); }
.research-note p { margin: 0; color: var(--muted); font: 400 13px/1.7 var(--serif); }

.comparison-shell { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 28px; align-items: start; }
.chapter-panel { position: sticky; top: 94px; max-height: calc(100vh - 116px); overflow: auto; padding: 20px 14px 20px 0; scrollbar-width: thin; scrollbar-color: rgba(141,46,41,.28) transparent; }
.chapter-heading { display: grid; gap: 6px; margin-bottom: 20px; padding: 0 12px; }
.chapter-heading small { color: var(--red); font-size: 8px; letter-spacing: .2em; }
.chapter-heading strong { font: 500 24px/1.2 var(--serif); }
#chapter-nav { display: grid; gap: 3px; }
#chapter-nav button, .mobile-chapters button { border: 0; color: #716c66; background: transparent; cursor: pointer; }
#chapter-nav button { min-height: 38px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 10px; text-align: left; font: 400 12px/1.4 var(--serif); transition: .18s ease; }
#chapter-nav button:hover { color: var(--red); background: rgba(141, 46, 41, .055); }
#chapter-nav button.active { color: #fff; background: linear-gradient(135deg, var(--red-2), #7b2925); box-shadow: 0 8px 20px rgba(141,46,41,.12); }
#chapter-nav b { min-width: 22px; color: var(--soft); font: 500 9px/1 var(--sans); text-align: right; }
#chapter-nav button.active b { color: rgba(255, 255, 255, .72); }

.comparison-main { min-width: 0; }
.toolbar-wrap { position: sticky; z-index: 20; top: 86px; display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; padding: 10px; border: 1px solid rgba(255,255,255,.65); border-radius: 18px; background: rgba(248, 247, 243, .9); box-shadow: 0 18px 38px rgba(42, 37, 33, .1); backdrop-filter: blur(18px); }
.search-box { min-height: 50px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .58); }
.search-box:focus-within { border-color: rgba(141, 46, 41, .42); box-shadow: 0 0 0 3px rgba(141, 46, 41, .06); }
.search-box label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search-box > span { color: var(--red); font-size: 21px; }
.search-box input { min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #9a958e; }
.search-box button { width: 26px; height: 26px; border: 0; border-radius: 50%; color: #706a65; background: rgba(37,35,33,.06); cursor: pointer; }
.search-box kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--soft); background: #f5f3ef; font: 500 10px/1 var(--sans); box-shadow: 0 1px 0 rgba(37,35,33,.08); }
.view-controls { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(37,35,33,.035); }
.view-controls button { border: 0; border-radius: 9px; padding: 0 14px; color: #77716b; background: transparent; font-size: 11px; white-space: nowrap; cursor: pointer; }
.view-controls button.active { color: #fff; background: #29282a; box-shadow: 0 6px 16px rgba(37,35,33,.12); }
.mobile-chapters { display: none; }

.results-bar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 4px; }
.results-bar p { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.results-bar p strong { color: var(--red); font-size: 14px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 13px; height: 8px; border-radius: 3px; background: rgba(188,129,68,.23); box-shadow: inset 0 -1px rgba(188,129,68,.6); }
.legend b { width: 13px; height: 1px; background: #b5afa8; }

.article-list { display: grid; gap: 17px; padding-bottom: 90px; }
.law-card { scroll-margin-top: 166px; overflow: clip; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 10px 34px rgba(47, 40, 35, .045); transition: border-color .2s, box-shadow .2s; }
.law-card:hover { border-color: rgba(141,46,41,.23); box-shadow: 0 16px 42px rgba(47,40,35,.075); }
.article-head { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 18px 13px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.25); }
.article-title { min-width: 0; display: flex; align-items: center; gap: 14px; }
.article-index { flex: none; width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid rgba(141,46,41,.2); border-radius: 50%; color: var(--red); font: 500 9px/1 var(--sans); }
.article-title h2 { margin: 0; font: 500 17px/1.5 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.article-title small { display: block; margin-top: 3px; color: var(--soft); font-size: 8px; letter-spacing: .09em; }
.copy-link { flex: none; border: 0; border-radius: 9px; padding: 8px 10px; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; transition: .18s; }
.copy-link:hover, .copy-link.copied { color: var(--red); background: rgba(141,46,41,.06); }
.version-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.version-cell { position: relative; min-width: 0; padding: 19px 21px 24px; }
.version-cell + .version-cell { border-left: 1px solid var(--line); }
.version-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.version-label strong { color: #6e6963; font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.version-label span { color: #a19b94; font: 500 8px/1 var(--sans); letter-spacing: .12em; }
.version-cell.current { box-shadow: inset 0 3px #69645f; }
.version-cell.first { box-shadow: inset 0 3px var(--gold); }
.version-cell.second { background: rgba(141,46,41,.026); box-shadow: inset 0 3px var(--red); }
.version-cell.second .version-label strong { color: var(--red); }
.law-text { color: #4e4a46; font: 400 14px/2 var(--serif); text-align: justify; white-space: pre-wrap; overflow-wrap: anywhere; }
.law-text mark { padding: 1px 2px; border-radius: 3px; color: inherit; background: #f4d889; }
.law-text .changed { border-radius: 3px; background: rgba(188,129,68,.16); box-shadow: inset 0 -1px rgba(188,129,68,.52); }
.law-text.empty { min-height: 62px; display: grid; place-items: center; color: #aaa49d; font: 400 12px/1.5 var(--sans); text-align: center; }
.law-text.empty::before, .law-text.empty::after { content: ""; width: 28px; height: 1px; margin: 5px; background: #cbc6c0; }
.comparison-main[data-view="second"] .version-cell.current,
.comparison-main[data-view="second"] .version-cell.first { display: none; }
.comparison-main[data-view="second"] .version-grid { grid-template-columns: 1fr; }
.comparison-main[data-view="second"] .version-cell.second { border-left: 0; padding: 28px clamp(24px, 5vw, 70px) 36px; }
.comparison-main[data-view="second"] .law-text { max-width: 920px; font-size: 16px; line-height: 2.05; }

.empty-state { margin: 12px 0 100px; padding: 72px 24px; border: 1px dashed rgba(141,46,41,.3); border-radius: 20px; text-align: center; }
.empty-state strong { font: 500 26px/1.3 var(--serif); }
.empty-state p { color: var(--muted); font-size: 13px; }
.empty-state button { margin-top: 8px; padding: 11px 16px; border: 0; border-radius: 10px; color: #fff; background: var(--red); cursor: pointer; }

.back-top { position: fixed; z-index: 25; right: max(20px, calc((100vw - 1480px) / 2)); bottom: 24px; width: 45px; height: 45px; display: grid; place-content: center; gap: 1px; border: 1px solid rgba(255,255,255,.5); border-radius: 14px; color: #fff; background: rgba(37,35,33,.88); box-shadow: 0 12px 28px rgba(37,35,33,.18); opacity: 0; transform: translateY(10px); pointer-events: none; cursor: pointer; transition: .2s; backdrop-filter: blur(10px); }
.back-top span { font-size: 6px; letter-spacing: .14em; }
.back-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.site-footer { min-height: 150px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 24px; margin-top: 10px; padding: 30px max(28px, calc((100vw - 1480px) / 2)); border-top: 1px solid var(--line); color: var(--muted); background: #e9e6df; }
.site-footer > div { display: grid; gap: 6px; }
.site-footer strong { color: var(--ink); font: 500 18px/1.2 var(--serif); }
.site-footer span, .site-footer p, .site-footer a { font-size: 9px; letter-spacing: .06em; }
.site-footer p { max-width: 440px; margin: 0; line-height: 1.7; }
.site-footer a:hover { color: var(--red); }
.noscript { position: fixed; z-index: 99; inset: auto 20px 20px; margin: 0; padding: 14px; color: #fff; background: var(--red); text-align: center; }

@media (max-width: 1120px) {
  main { width: min(100% - 36px, 1480px); }
  .hero { grid-template-columns: minmax(0, 1fr) 390px; gap: 30px; padding-inline: 2vw; }
  .comparison-shell { grid-template-columns: 205px minmax(0, 1fr); gap: 18px; }
  .version-cell { padding-inline: 16px; }
  .law-text { font-size: 13px; }
}

@media (max-width: 900px) {
  .topbar { height: 66px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  main { width: min(100% - 28px, 760px); }
  .hero { min-height: 0; grid-template-columns: 1fr; gap: 42px; padding: 66px 2px 46px; }
  .hero h1 { font-size: clamp(54px, 14vw, 88px); }
  .hero-meta { border-left: 0; border-top: 1px solid var(--line); }
  .research-note { align-items: flex-start; margin: 24px 0 30px; }
  .research-note div { display: grid; gap: 5px; }
  .comparison-shell { display: block; }
  .chapter-panel { display: none; }
  .toolbar-wrap { top: 76px; }
  .mobile-chapters { position: sticky; z-index: 19; top: 150px; display: flex; gap: 7px; overflow-x: auto; margin: 10px -12px 0; padding: 5px 12px 10px; background: linear-gradient(var(--paper) 72%, rgba(241,239,234,0)); scrollbar-width: none; }
  .mobile-chapters::-webkit-scrollbar { display: none; }
  .mobile-chapters button { flex: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(248,247,243,.92); font: 400 11px/1 var(--serif); }
  .mobile-chapters button.active { color: #fff; border-color: var(--red); background: var(--red); }
  .results-bar { min-height: 52px; }
  .version-grid { grid-template-columns: 1fr; }
  .version-cell + .version-cell { border-left: 0; border-top: 1px solid var(--line); }
  .version-cell { padding: 18px 20px 23px; }
  .law-text { font-size: 14px; line-height: 1.95; }
  .site-footer { grid-template-columns: 1fr auto; padding: 32px max(18px, env(safe-area-inset-right)) 32px max(18px, env(safe-area-inset-left)); }
  .site-footer p { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 620px) {
  .brand-copy small { display: none; }
  .top-actions { gap: 2px; }
  .top-actions a { padding: 9px 8px; font-size: 10px; }
  .top-actions > a:first-child { display: none; }
  main { width: calc(100% - 24px); }
  .hero { padding-top: 48px; }
  .eyebrow { margin-bottom: 20px; font-size: 8px; letter-spacing: .17em; }
  .hero h1 { font-size: clamp(48px, 16.5vw, 74px); line-height: .98; }
  .hero-lede { margin-top: 22px; font-size: 16px; }
  .hero-meta { grid-template-columns: repeat(3, 1fr); }
  .hero-meta > div { min-height: 90px; padding: 14px 9px; text-align: center; }
  .hero-meta > div strong { font-size: 32px; }
  .hero-meta > div span { font-size: 8px; }
  .hero-meta > p { padding-inline: 10px; }
  .research-note { padding: 16px; }
  .note-mark { width: 28px; height: 28px; }
  .toolbar-wrap { top: 74px; grid-template-columns: 1fr; gap: 8px; padding: 7px; border-radius: 15px; }
  .search-box { min-height: 46px; }
  .search-box kbd { display: none; }
  .view-controls { min-height: 39px; }
  .view-controls button { flex: 1; }
  .mobile-chapters { top: 184px; }
  .results-bar { align-items: flex-start; padding-top: 12px; }
  .legend { display: none; }
  .law-card { border-radius: 16px; scroll-margin-top: 245px; }
  .article-head { min-height: 58px; gap: 10px; padding: 11px 10px 11px 14px; }
  .article-title { gap: 10px; }
  .article-index { width: 28px; height: 28px; }
  .article-title h2 { font-size: 15px; }
  .copy-link { width: 32px; overflow: hidden; white-space: nowrap; padding-inline: 9px; color: transparent; }
  .copy-link::first-letter { color: var(--muted); }
  .version-cell { padding: 17px 16px 21px; }
  .comparison-main[data-view="second"] .version-cell.second { padding: 22px 18px 28px; }
  .comparison-main[data-view="second"] .law-text { font-size: 15px; }
  .back-top { right: 13px; bottom: max(13px, env(safe-area-inset-bottom)); }
  .site-footer { grid-template-columns: 1fr; gap: 14px; }
  .site-footer p, .site-footer a { grid-column: 1; grid-row: auto; }
}

@media print {
  .topbar, .research-note, .chapter-panel, .toolbar-wrap, .mobile-chapters, .results-bar, .copy-link, .back-top, .site-footer { display: none !important; }
  body, html { background: #fff; }
  main { width: 100%; }
  .hero { min-height: 0; padding: 20px 0 30px; }
  .hero h1 { font-size: 42px; }
  .hero-meta { display: none; }
  .comparison-shell { display: block; }
  .article-list { gap: 10px; }
  .law-card { break-inside: avoid; box-shadow: none; }
  .law-text { font-size: 10px; }
}

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