*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-text: #2c2c2c;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-border: #e5e7eb;
  --color-accent: #c0392b;
  --color-accent-light: #fdf2f2;
  --color-accent-dark: #962d22;
  --color-warning: #f59e0b;
  --color-warning-light: #fffbeb;
  --color-info: #3b82f6;
  --color-info-light: #eff6ff;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;
  --max-width: 800px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
}

.site-brand:hover {
  text-decoration: none;
  color: var(--color-text);
}

.site-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.site-nav {
  display: flex;
  gap: 20px;
}

.site-nav a {
  font-size: 0.88rem;
  white-space: nowrap;
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: color 0.15s;
}

.site-nav a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--color-text);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b3d 50%, #1a1a2e 100%);
  color: #fff;
  padding: 56px 20px 48px;
  text-align: center;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 24px;
}

.hero-laws {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hero-law-tag {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 6px;
}

/* ===== Main ===== */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Section ===== */
.section {
  padding: 48px 0;
}

.section + .section {
  border-top: 1px solid var(--color-border);
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.4;
}

/* ===== Incident Cards ===== */
.incident-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 0;
}

.incident-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-accent);
  transition: box-shadow 0.2s;
}

.incident-card:hover {
  box-shadow: var(--shadow-md);
}

.incident-card-date {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.incident-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.incident-card-desc {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

.tl-item {
  position: relative;
  padding-bottom: 24px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  border: 2px solid var(--color-bg);
}

.tl-item.tl-critical::before {
  background: var(--color-accent);
  width: 12px;
  height: 12px;
  left: -25px;
  top: 9px;
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.tl-item.tl-outcome::before {
  background: var(--color-warning);
  width: 12px;
  height: 12px;
  left: -25px;
  top: 9px;
  box-shadow: 0 0 0 3px var(--color-warning-light);
}

.tl-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.tl-critical .tl-date {
  color: var(--color-accent);
}

.tl-outcome .tl-date {
  color: var(--color-warning);
}

.tl-content {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
  line-height: 1.7;
}

.tl-content p {
  margin-bottom: 8px;
}

.tl-content p:last-child {
  margin-bottom: 0;
}

.tl-content ul {
  margin: 8px 0 0 20px;
  font-size: 0.88rem;
}

.tl-content li {
  margin-bottom: 4px;
}

.tl-content a {
  font-size: 0.82rem;
}

/* ===== Callout ===== */
.callout {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  border-left: 4px solid var(--color-border);
  font-size: 0.92rem;
  line-height: 1.7;
}

.callout-danger {
  border-left-color: var(--color-accent);
  background: var(--color-accent-light);
}

.callout-warning {
  border-left-color: var(--color-warning);
  background: var(--color-warning-light);
}

.callout-info {
  border-left-color: var(--color-info);
  background: var(--color-info-light);
}

.callout strong {
  color: var(--color-text);
}

.callout-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

/* ===== Resource Links ===== */
.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.resource-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}

.resource-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.resource-btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.resource-btn-primary:hover {
  background: var(--color-accent-dark);
  color: #fff;
}

.resource-btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.resource-btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-light);
}

/* ===== Evidence Gallery ===== */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.evidence-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--color-surface);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}

.evidence-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.evidence-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
}

.evidence-item-label {
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  background: var(--color-surface);
}

/* Modal Lightbox */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  cursor: pointer;
}

.modal-overlay.active {
  display: flex;
}

.modal-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}

.modal-close {
  position: fixed;
  top: 16px;
  right: 20px;
  color: #fff;
  background: none;
  border: none;
  font-size: 2.2rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
  z-index: 1001;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close:hover {
  opacity: 1;
}

/* ===== Details / Collapse ===== */
.collapse-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.collapse-section summary {
  padding: 18px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background 0.15s;
}

.collapse-section summary:hover {
  background: var(--color-bg);
}

.collapse-section summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--color-text-muted);
  transition: transform 0.2s;
}

.collapse-section[open] summary::after {
  content: '-';
}

.collapse-section summary::-webkit-details-marker {
  display: none;
}

.collapse-body {
  padding: 0 24px 24px;
  font-size: 0.92rem;
  line-height: 1.8;
}

.collapse-body p {
  margin-bottom: 12px;
}

.collapse-body ul {
  margin: 0 0 12px 20px;
}

.collapse-body li {
  margin-bottom: 4px;
}

/* ===== Parent Opinions Page ===== */
.opinion-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.opinion-card p {
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.opinion-card p:last-child {
  margin-bottom: 0;
}

.opinion-card ol,
.opinion-card ul {
  margin: 0 0 12px 20px;
  font-size: 0.92rem;
}

.opinion-card li {
  margin-bottom: 6px;
  line-height: 1.7;
}

.opinion-card figure {
  margin-top: 16px;
}

.opinion-card figure img {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.opinion-source {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

/* ===== Page Title (sub-pages) ===== */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
  padding-top: 40px;
}

.page-subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* ===== Schedule Table ===== */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.schedule-table th,
.schedule-table td {
  border: 1px solid var(--color-border);
  padding: 12px 10px;
  text-align: center;
}

.schedule-table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.schedule-table td:first-child {
  font-weight: 600;
  background: #fafafa;
  white-space: nowrap;
  font-size: 0.85rem;
}

/* ===== Content (generic) ===== */
.content h2 {
  font-size: 1.25rem;
  margin: 32px 0 16px;
  line-height: 1.5;
}

.content h3 {
  font-size: 1.1rem;
  margin: 28px 0 14px;
}

.content p {
  margin-bottom: 14px;
}

.content ul,
.content ol {
  margin: 0 0 14px 24px;
}

.content li {
  margin-bottom: 6px;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 20px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 32px;
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .incident-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero h1 {
    font-size: 2rem;
  }
}

@media (max-width: 639px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .site-title {
    font-size: 0.9rem;
  }

  .hero {
    padding: 40px 20px 36px;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .section {
    padding: 36px 0;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .incident-card {
    padding: 18px;
  }

  .tl-content {
    padding: 14px 16px;
  }

  .evidence-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-title {
    font-size: 1.3rem;
    padding-top: 28px;
  }

  .schedule-table {
    font-size: 0.8rem;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 8px 4px;
  }

  .resource-links {
    flex-direction: column;
  }

  .resource-btn {
    justify-content: center;
  }
}
