

/* ==== from resources/regulation-library.html ==== */

:root {
  --primary: #1a56db;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --accent: #0ea5e9;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --radius: 12px;
  --cat-law: #dc2626;
  --cat-reg: #ea580c;
  --cat-rule: #2563eb;
  --cat-doc: #7c3aed;
  --cat-std: #059669;
  --cat-guide: #0891b2;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* Top Nav */
.top-nav {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); font-weight: 600; }
.nav-cta {
  padding: 8px 20px;
  background: var(--primary);
  color: white !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #0f172a 0%, var(--primary-dark) 50%, var(--primary) 100%);
  color: white;
  padding: 56px 24px 48px;
  text-align: center;
}
.page-header h1 { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
.page-header p { font-size: 15px; opacity: 0.85; max-width: 600px; margin: 0 auto; }

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 24px;
  background: white;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-number { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* Category Tabs */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 24px;
  flex-wrap: wrap;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 53px;
  z-index: 90;
}
.cat-tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-light);
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.cat-tab .count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(0,0,0,0.08);
}
.cat-tab.active .count { background: rgba(255,255,255,0.25); }

/* Main Content */
.container { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }

/* Category Section */
.cat-section { margin-bottom: 48px; scroll-margin-top: 120px; }
.cat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}
.cat-icon.law { background: var(--cat-law); }
.cat-icon.reg { background: var(--cat-reg); }
.cat-icon.rule { background: var(--cat-rule); }
.cat-icon.doc { background: var(--cat-doc); }
.cat-icon.std { background: var(--cat-std); }
.cat-icon.guide { background: var(--cat-guide); }
.cat-title { font-size: 22px; font-weight: 700; }
.cat-desc { font-size: 14px; color: var(--text-light); margin-bottom: 20px; padding-left: 48px; }

/* Sub-category */
.subcat-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--border);
}

/* Regulation Grid */
.reg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.reg-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.reg-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}
.reg-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.reg-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.reg-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}
.reg-badge.law { background: #fef2f2; color: var(--cat-law); }
.reg-badge.reg { background: #fff7ed; color: var(--cat-reg); }
.reg-badge.rule { background: #eff6ff; color: var(--cat-rule); }
.reg-badge.doc { background: #f5f3ff; color: var(--cat-doc); }
.reg-badge.std { background: #ecfdf5; color: var(--cat-std); }
.reg-badge.guide { background: #ecfeff; color: var(--cat-guide); }
.reg-card-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.6;
}
.reg-questions {
  list-style: none;
  margin-bottom: 12px;
}
.reg-questions li {
  font-size: 13px;
  color: var(--text);
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.5;
}
.reg-questions li::before {
  content: 'Q';
  position: absolute;
  left: 0;
  top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: #eff6ff;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reg-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.reg-lock {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}
.reg-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, #0f172a, var(--primary-dark));
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  color: white;
  margin-top: 48px;
}
.cta-banner h2 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.cta-banner p { font-size: 14px; opacity: 0.85; margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-banner-btn {
  display: inline-block;
  padding: 12px 32px;
  background: white;
  color: var(--primary);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s;
}
.cta-banner-btn:hover { transform: translateY(-2px); }

/* Footer */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 32px 24px 20px;
  text-align: center;
}
.footer-links { display: flex; gap: 20px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.footer-links a { color: #94a3b8; font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: white; }
.footer-copyright { font-size: 12px; opacity: 0.6; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  border-radius: 16px;
  padding: 36px;
  max-width: 440px;
  width: 90%;
  text-align: center;
}
.modal-icon { font-size: 40px; margin-bottom: 12px; }
.modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--text-light); margin-bottom: 20px; line-height: 1.6; }
.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal-input {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.modal-input:focus { border-color: var(--primary); }
.modal-btn {
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.modal-close {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
}

@media (max-width: 768px) {
  .page-header h1 { font-size: 24px; }
  .reg-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 20px; }
  .stat-number { font-size: 22px; }
  .category-tabs { top: 53px; }
  .cat-tab { font-size: 12px; padding: 6px 12px; }
  .nav-links { gap: 12px; }
  .nav-links a:not(.nav-cta) { display: none; }
}
