:root {
  --ink: #17324d;
  --muted: #3e5568;
  --navy: #0b3d73;
  --navy-deep: #07284a;
  --blue: #0d6adf;
  --blue-dark: #0b57b8;
  --teal: #0e8f96;
  --green: #157a45;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #e1e9f2;
  --same: #165eae;
  --cross: #7340b8;
  --soft: #e7f1fb;
  --mark: #ffe08a;
  --shadow: 0 10px 30px rgba(16, 48, 84, 0.08);
  --radius: 16px;
  --header-h: 108px;
  --max: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "WenQuanYi Micro Hei", "Noto Sans CJK TC", sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
}
img, svg { display: block; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #e2a308; outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  background: var(--navy-deep);
  color: #d5e4f5;
  font-size: 13px;
  letter-spacing: 0.01em;
}
.topbar-inner, .header-inner, .wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}
.topbar-inner { padding: 6px 0; }

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.sticky-top { position: sticky; top: 0; z-index: 30; }
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy);
  margin-right: auto;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(160deg, #14b3b0, #0c7fbe);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: 0.02em; line-height: 1.2; }
.brand-sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy);
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-link.is-active { background: #e8f2ff; color: var(--navy); }

.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.18), transparent 26%),
    radial-gradient(circle at 72% 120%, rgba(56, 214, 206, 0.35), transparent 32%),
    linear-gradient(165deg, #08356c 0%, #0b5ca6 62%, #0a78aa 100%);
  overflow: hidden;
}
.hero-inner { padding: 48px 0 88px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.lede { margin: 0 0 22px; color: #e5f1fb; font-size: 17px; }

.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(5, 24, 48, 0.16);
}
.search-bar select, .search-bar input {
  border: 0;
  background: transparent;
  min-height: 44px;
}
.search-bar select { padding: 0 8px 0 12px; font-weight: 700; color: var(--navy); }
.search-bar input { flex: 1; min-width: 0; padding: 0 8px; }
.search-bar input::placeholder { color: #8aa0b3; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid #c9d8ea;
}
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14.5px; }
.btn[disabled], .btn.is-disabled {
  background: #d5dee8;
  color: #66788a;
  cursor: not-allowed;
}
.hot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  color: #d7e8f8;
  font-size: 14px;
}
.hot a {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 4px 12px;
}
.hot a:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }

.overlap { margin-top: -52px; position: relative; z-index: 1; }
.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, 1fr);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card h2, .card h3 { margin: 8px 0; line-height: 1.35; }
.icon-blob {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.icon-blob svg { width: 22px; height: 22px; }
.icon-blue { background: #e7f1ff; color: var(--blue); }
.ticks { margin: 8px 0 16px; padding: 0; list-style: none; color: var(--muted); }
.ticks li { padding: 4px 0 4px 22px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
.feature-card {
  display: flex;
  gap: 18px;
  align-items: center;
}
.feature-card h2 { margin-top: 0; }
.feature-card .ticks { margin-bottom: 0; }
.feature-card .btn { margin-left: auto; flex: none; }

.section { margin: 28px auto; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.section-head h2 { margin: 0; font-size: 22px; }
.section-note { color: var(--muted); margin: 0 0 12px; font-size: 14.5px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7fafc; color: #3d5870; font-size: 14px; font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: center; width: 48px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fbfe; }
.name-link { font-weight: 700; text-decoration: none; }
code.pcode { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; color: #245074; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.nowrap { white-space: nowrap; }
.badge-parent { background: var(--navy); color: #fff; }
.badge-sub { background: var(--soft); color: var(--navy); }
.badge-auth { background: #f3eaff; color: #6938a8; }

.callout {
  margin-top: 12px;
  background: #f8fbfe;
  border: 1px dashed #c5d5e6;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
}

.crumb { color: var(--muted); font-size: 14px; margin: 18px 0 6px; }
.crumb a { text-decoration: none; }
.page-title { margin: 0 0 6px; font-size: 32px; line-height: 1.3; }

.parent-banner {
  background: linear-gradient(145deg, #0b3f78, #0d6aae);
  color: #fff;
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-end;
  margin: 14px 0 18px;
}
.parent-banner h2 { margin: 8px 0 0; font-size: 28px; line-height: 1.3; }
.parent-banner a { color: #fff; }
.parent-banner .btn-primary { color: #fff; }
.parent-banner .btn-ghost { color: var(--navy); background: #fff; }
.parent-banner .meta { color: #d6e8f8; margin: 6px 0 0; }
.parent-banner .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.subcard h3 { font-size: 16.5px; min-height: 3.2em; }
.subcard p { margin: 6px 0; color: var(--muted); font-size: 14.5px; }
.subcard .actions { margin-top: auto; }

.law-tools { padding-top: 18px; }
.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.tool-row select, .tool-row input[type="search"] {
  min-height: 44px;
  border: 1px solid #cfdbe8;
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
}
.tool-row select { max-width: 100%; }
.tool-row input[type="search"] { flex: 1; min-width: 180px; }
.scope {
  display: inline-flex;
  background: #fff;
  border: 1px solid #cfdbe8;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.scope a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14.5px;
}
.scope a.is-active { background: var(--navy); color: #fff; }

.law-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: thin;
}
.law-tabs a {
  flex: none;
  text-decoration: none;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14.5px;
  font-weight: 700;
}
.law-tabs a.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

.law-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
  margin: 12px 0 28px;
}
@media (min-width: 1021px) {
  .chapters, .refs {
    position: sticky;
    top: 108px;
    max-height: calc(100vh - 124px);
    overflow: auto;
  }
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.chapters, .refs { padding: 12px; }
.chapters h2, .refs h2 {
  margin: 4px 8px 8px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
}
.chapter-block { margin-bottom: 10px; }
.chapter-block h3 {
  margin: 8px 8px 4px;
  font-size: 13.5px;
  color: #5b7288;
}
.chapter-block a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border-radius: 10px;
  padding: 7px 10px;
  line-height: 1.35;
}
.chapter-block a small { display: block; color: var(--muted); font-weight: 500; }
.chapter-block a.is-active { background: var(--navy); color: #fff; }
.chapter-block a.is-active small { color: #d5e4f5; }

.article { padding: 20px 22px 16px; }
.article-kicker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  background: var(--soft);
  color: var(--navy);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13.5px;
  font-weight: 700;
}
.article h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.35; }
.article-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.origin-block { margin-top: 8px; }
.origin-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.origin-head h2 { margin: 0; font-size: 16px; }
.para { margin: 12px 0; }
.para-label { margin: 0 0 2px; color: #5c7590; font-size: 13.5px; font-weight: 700; }
.para-text { margin: 0; }
.kuan-list, .mu-list { list-style: none; margin: 6px 0 0; padding: 0; }
.kuan-list > li { margin: 4px 0; }
.mu-list { margin-left: 1.2em; }
.mu-list li { margin: 2px 0; }
.para.is-target { background: #fff8e8; border-radius: 8px; }

.cite { text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.cite-same { color: var(--same); text-decoration: underline dashed; }
.cite-cross { color: var(--cross); text-decoration: underline dashed; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pager a { text-decoration: none; font-weight: 700; }

.ref-block { margin: 0 6px 14px; }
.ref-block h3 { margin: 0 0 8px; font-size: 15.5px; }
.ref-empty { color: var(--muted); margin: 0; font-size: 14.5px; }
.ref-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.ref-card:hover { border-color: #b7cbe2; background: #f8fbfe; }
.ref-card strong { display: block; color: var(--navy); }
.ref-card span { display: block; color: var(--muted); font-size: 13.5px; }
.legend { margin: 8px 6px 4px; color: var(--muted); font-size: 13px; }
.legend i { font-style: normal; font-weight: 800; }
.swatch-same { color: var(--same); }
.swatch-cross { color: var(--cross); }

.results { list-style: none; margin: 0; padding: 0; }
.results a {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}
.results a:hover strong { text-decoration: underline; }
.results strong { color: var(--navy); }
.hit-meta { color: var(--muted); font-size: 13.5px; }
.search-banner {
  background: #fff8e8;
  border: 1px solid #f0e0b0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.history { margin-top: 10px; }
.history summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.history pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  background: #f7fafc;
  border-radius: 10px;
  padding: 10px 12px;
}
.attach-list { margin: 8px 0 0; padding-left: 1.1em; }
.attach-list a { overflow-wrap: anywhere; }

.popover {
  position: fixed;
  z-index: 50;
  width: min(360px, calc(100vw - 16px));
  background: #fff;
  border: 1px solid #d5e1ee;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(16, 42, 77, 0.18);
  padding: 12px 14px;
}
.popover-kicker { margin: 0; color: var(--muted); font-size: 12.5px; }
.popover-title { margin: 2px 0 6px; font-weight: 800; color: var(--navy); }
.popover-body {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  color: var(--ink);
  font-size: 14.5px;
  white-space: pre-wrap;
}
.popover-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.popover-date { color: var(--muted); font-size: 12.5px; }

.site-footer {
  background: var(--navy-deep);
  color: #d5e4f4;
  margin-top: 20px;
}
.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
}
.site-footer p { margin: 0; }
.about { padding-bottom: 24px; }
.about h1 { margin-bottom: 8px; }
.about h2 { font-size: 20px; margin-top: 22px; }
.loading, .error { padding: 24px 0; color: var(--muted); }

@media (max-width: 1020px) {
  .law-layout, .card-grid { grid-template-columns: 1fr; }
  .law-layout .article { order: 1; }
  .law-layout .chapters { order: 2; max-height: 320px; overflow: auto; }
  .law-layout .refs { order: 3; }
  .parent-banner { flex-direction: column; align-items: flex-start; }
  .subcard h3 { min-height: 0; }
}
@media (min-width: 721px) and (max-width: 1020px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-burger { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 14px;
  }
  .nav-toggle:checked ~ .nav { display: flex; }
  .header-inner { position: relative; }
  .site-header { position: relative; }
  .hero-inner { padding-top: 32px; }
  .search-bar { flex-wrap: wrap; }
  .search-bar select, .search-bar input, .search-bar .btn { width: 100%; }
  .feature-card { flex-direction: column; align-items: flex-start; }
  .feature-card .btn { margin-left: 0; }
  .footer-inner { flex-direction: column; }
  .article { padding: 16px; }
  .article h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
