:root {
  --primary: #10bfa5;
  --primary-dark: #087d70;
  --ink: #152521;
  --muted: #63746f;
  --line: #dce9e5;
  --paper: #ffffff;
  --page: #f4faf8;
  --notice: #fff8e8;
  --notice-line: #f2b94b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
}

a { color: var(--primary-dark); }

.legal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(220, 233, 229, .9);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}

.legal-nav {
  width: min(1040px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.brand img { width: 34px; height: 34px; border-radius: 9px; }
.legal-nav > a:not(.brand) { color: var(--muted); text-decoration: none; font-size: 14px; }
.legal-nav > a[aria-current="page"] { color: var(--primary-dark); font-weight: 700; }

.legal-shell {
  width: min(900px, calc(100% - 32px));
  margin: 36px auto 64px;
}

.document-head,
.legal-section,
.rule-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(25, 78, 68, .045);
}

.document-head { padding: 30px; margin-bottom: 16px; }
.document-head h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 36px); line-height: 1.35; }
.document-head .summary { margin: 0 0 16px; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.badge { padding: 2px 10px; border-radius: 99px; color: var(--primary-dark); background: #e7f8f4; font-weight: 700; }

.document-tools { display: flex; gap: 10px; margin-top: 18px; }
.document-tools button,
.document-tools a {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.legal-section { padding: 24px 28px; margin: 14px 0; scroll-margin-top: 82px; }
.legal-section h2 { margin: 0 0 10px; font-size: 19px; line-height: 1.5; }
.legal-section h3 { margin: 18px 0 6px; font-size: 16px; }
.legal-section p { margin: 8px 0; }
.legal-section ul { margin: 8px 0; padding-left: 24px; }
.important { border-left: 4px solid var(--notice-line); background: var(--notice); }

.operator {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 7px 14px;
  font-size: 14px;
}
.operator dt { color: var(--muted); }
.operator dd { margin: 0; overflow-wrap: anywhere; }

.rule-search {
  width: 100%;
  height: 48px;
  margin: 4px 0 18px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  outline: none;
}
.rule-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16, 191, 165, .12); }
.rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.rule-card { display: block; padding: 22px; color: var(--ink); text-decoration: none; transition: transform .18s, border-color .18s; }
.rule-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.rule-card h2 { margin: 0 0 6px; font-size: 17px; }
.rule-card p { margin: 0; color: var(--muted); font-size: 13px; }
.rule-card[hidden] { display: none; }

.legal-footer {
  border-top: 1px solid var(--line);
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.legal-footer a { margin: 0 7px; }

@media (max-width: 720px) {
  .legal-nav > a:not(.brand) { display: none; }
  .legal-shell { margin-top: 18px; }
  .document-head, .legal-section { padding: 20px; border-radius: 14px; }
  .rule-grid { grid-template-columns: 1fr; }
  .operator { grid-template-columns: 1fr; gap: 2px; }
  .operator dd { margin-bottom: 8px; }
}

@media print {
  body { background: #fff; }
  .legal-header, .document-tools, .legal-footer, .rule-search { display: none !important; }
  .legal-shell { width: 100%; margin: 0; }
  .document-head, .legal-section { box-shadow: none; break-inside: avoid; }
}
