:root {
  --primary: #1f4e79;
  --primary-light: #2e75b6;
  --accent: #d97706;
  --danger: #b91c1c;
  --success: #15803d;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1c2b36;
  --muted: #64748b;
  --border: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
#app { max-width: 1200px; margin: 0 auto; padding: 24px; }
.hero { background: linear-gradient(135deg, var(--primary) 0%, #14324d 100%); color: white; padding: 48px 24px; margin: -24px -24px 32px; border-radius: 0 0 24px 24px; }
.hero-content { max-width: 1200px; margin: 0 auto; }
.hero h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 8px; }
.subtitle { font-size: 1.1rem; opacity: 0.9; margin-bottom: 16px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.badge.decision { background: var(--accent); color: white; }
.badge.score { background: rgba(255,255,255,0.2); color: white; }
.badge.risk { background: var(--danger); color: white; }
.meta { margin-top: 16px; opacity: 0.8; font-size: 0.9rem; }
.meta a { color: #fff; text-decoration: underline; }
.toc { background: var(--card); border-radius: 12px; padding: 24px; margin-bottom: 32px; border: 1px solid var(--border); position: sticky; top: 24px; }
.toc h3 { margin-bottom: 16px; }
.toc ul { list-style: none; columns: 2; column-gap: 40px; }
.toc li { margin: 8px 0; }
.toc a { color: var(--primary); text-decoration: none; font-weight: 500; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.toc-toggle { display: none; background: var(--primary); color: white; border: none; padding: 8px 16px; border-radius: 6px; margin-bottom: 12px; cursor: pointer; }
section { background: var(--card); border-radius: 12px; padding: 32px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(15,36,56,0.06); border: 1px solid var(--border); }
h2 { color: var(--primary); font-size: 1.75rem; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 3px solid var(--primary-light); display: flex; align-items: center; gap: 12px; }
h3 { color: var(--primary); font-size: 1.25rem; margin: 24px 0 12px; }
h4 { color: var(--primary-light); font-size: 1rem; margin: 16px 0 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.card { background: var(--bg); border-radius: 8px; padding: 20px; border: 1px solid var(--border); }
.card h4 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.9rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--primary); color: white; font-weight: 600; }
tr:nth-child(even) td { background: var(--bg); }
.text-right { text-align: right; font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.alert { padding: 16px 20px; border-radius: 8px; margin: 16px 0; }
.alert.critical { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert.warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.alert.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.timeline { position: relative; padding-left: 24px; border-left: 2px solid var(--primary-light); margin: 16px 0; }
.timeline-item { position: relative; padding-bottom: 24px; padding-left: 16px; }
.timeline-item::before { content: ''; position: absolute; left: -33px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary-light); border: 3px solid white; box-shadow: 0 0 0 2px var(--primary-light); }
.timeline-item:last-child::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-date { font-weight: 600; color: var(--primary); font-size: 0.9rem; }
.timeline-title { font-weight: 600; margin: 4px 0; }
.timeline-desc { color: var(--muted); font-size: 0.9rem; }
.map-container { height: 500px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); margin: 16px 0; }
#wmsMap, #cesiumContainer { width: 100%; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; padding: 16px; background: var(--bg); border-radius: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.legend-color { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--border); }
.probability-assessment { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); border-radius: 12px; padding: 24px; margin: 24px 0; border: 1px solid #fcd34d; }
.probability-assessment h3 { margin-top: 0; color: #92400e; }
.factor-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #fcd34d; }
.factor-row:last-child { border-bottom: none; }
.factor-info { flex: 1; }
.factor-label { font-weight: 600; }
.factor-desc { font-size: 0.85rem; color: #92400e; opacity: 0.8; }
.factor-score { text-align: right; min-width: 120px; }
.probability-bar { height: 28px; background: var(--border); border-radius: 14px; overflow: hidden; position: relative; margin: 8px 0; }
.probability-fill { height: 100%; border-radius: 14px; background: linear-gradient(90deg, var(--danger) 0%, var(--accent) 40%, var(--success) 80%); transition: width 1s ease-out; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; color: white; font-weight: 600; font-size: 0.85rem; min-width: 40px; }
.probability-markers { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.75rem; color: var(--muted); }
.download-links { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-weight: 600; text-decoration: none; font-size: 0.9rem; transition: all 0.2s; cursor: pointer; border: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #14324d; }
.btn-secondary { background: var(--accent); color: white; }
.btn-secondary:hover { background: #b45309; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.dl-link { color: #fff; text-decoration: underline; margin-left: 8px; }
.risk-high { background: #fef2f2; border-left: 4px solid var(--danger); padding: 12px 16px; margin: 8px 0; border-radius: 0 8px 8px 0; }
.risk-medium { background: #fffbeb; border-left: 4px solid var(--accent); padding: 12px 16px; margin: 8px 0; border-radius: 0 8px 8px 0; }
.risk-low { background: #f0fdf4; border-left: 4px solid var(--success); padding: 12px 16px; margin: 8px 0; border-radius: 0 8px 8px 0; }
.probability-bar { height: 28px; background: var(--border); border-radius: 14px; overflow: hidden; position: relative; margin: 8px 0; }
.probability-fill { height: 100%; border-radius: 14px; background: linear-gradient(90deg, var(--danger) 0%, var(--accent) 40%, var(--success) 80%); transition: width 1s ease-out; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; color: white; font-weight: 600; font-size: 0.85rem; min-width: 40px; }
.probability-markers { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.75rem; color: var(--muted); }
.download-links { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-weight: 600; text-decoration: none; font-size: 0.9rem; transition: all 0.2s; cursor: pointer; border: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #14324d; }
.btn-secondary { background: var(--accent); color: white; }
.btn-secondary:hover { background: #b45309; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.footer { text-align: center; padding: 32px 24px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border); margin-top: 48px; }
.toc-toggle { display: none; background: var(--primary); color: white; border: none; padding: 8px 16px; border-radius: 6px; margin-bottom: 12px; cursor: pointer; font-weight: 600; }
@media (max-width: 768px) {
  #app { padding: 16px; }
  .hero { padding: 32px 16px; margin: -16px -16px 24px; border-radius: 0 0 16px 16px; }
  .hero h1 { font-size: 1.75rem; }
  section { padding: 20px; }
  .toc ul { columns: 1; }
  .toc-toggle { display: block; }
  .toc ul { display: none; }
  .toc.open ul { display: block; }
}
