:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --brand-primary: #0ea5e9;
  --brand-secondary: #0369a1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --divider: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-lg: 22px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.92), rgba(14, 116, 144, 0.88));
  color: #ffffff;
  padding: 18px clamp(16px, 6vw, 40px) 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.35), transparent 58%);
  pointer-events: none;
}

.site-header__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-left img {
  width: clamp(44px, 12vw, 62px);
  height: auto;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.85);
}

.site-title {
  font-size: clamp(1.35rem, 5.2vw, 1.9rem);
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-title__sub {
  display: block;
  margin-top: 4px;
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.95;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.back-link:hover,
.back-link:focus-visible {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.9);
  outline: none;
}

.page-content {
  flex: 1;
  padding: clamp(18px, 6vw, 40px) clamp(16px, 6vw, 40px) 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.hero-note {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

.content-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.law-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.law-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.law-link {
  display: block;
  padding: 16px 18px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.law-link:hover,
.law-link:focus-visible {
  color: var(--brand-primary);
  outline: none;
}

.law-meta {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.law-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.law-row__title {
  min-width: 0;
}

.law-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--brand-secondary);
  font-weight: 700;
  font-size: 0.86rem;
  border: 1px solid rgba(14, 165, 233, 0.22);
  white-space: nowrap;
}

.site-footer {
  padding: 18px 16px 28px;
  text-align: center;
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--brand-secondary);
  font-weight: 700;
  border: 1px solid rgba(14, 165, 233, 0.22);
}

.primary-btn:hover,
.primary-btn:focus-visible {
  background: rgba(14, 165, 233, 0.2);
  outline: none;
}

/* Header variant: higher contrast on gradient background */
.header-btn {
  color: #ffffff;
  background: rgba(3, 105, 161, 0.95);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Force override when used inside the header */
.site-header .primary-btn.header-btn {
  color: #ffffff !important;
  background: rgba(3, 105, 161, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.header-btn:hover,
.header-btn:focus-visible {
  background: rgba(3, 105, 161, 0.8);
}

.site-header .primary-btn.header-btn:hover,
.site-header .primary-btn.header-btn:focus-visible {
  background: rgba(3, 105, 161, 0.8) !important;
}

.muted {
  color: var(--text-muted);
}

.hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: 14px 0;
}

.law-content {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text-main);
  word-break: break-word;
}

.law-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.law-content td,
.law-content th {
  padding: 8px 10px;
  border: 1px solid var(--divider);
  vertical-align: top;
}

.law-content hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: 16px 0;
}
