/* =============================================
   Site Template — Universal Styles
   Colors are injected via CSS variables in HTML
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-wrap: break-word; }
body { overflow-x: hidden; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.7; font-size: 16px;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5em; }

/* --- Container --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Header --- */
.site-header {
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.15rem; color: var(--text);
  text-decoration: none; white-space: nowrap;
  min-width: 0; overflow: hidden;
}
.logo-icon { font-size: 1.5rem; }
.logo:hover { color: var(--primary); }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link {
  padding: 8px 12px; border-radius: 8px; font-size: .9rem; font-weight: 500;
  color: var(--text); transition: background .2s, color .2s; white-space: nowrap;
}
.nav-link:hover { background: rgba(37,99,235,.06); color: var(--primary); }
.mobile-menu-btn {
  display: none; background: none; border: 1px solid var(--border);
  font-size: 1.4rem; padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
/* Dropdown */
.nav-dropdown { position: relative; display: inline-block; }
.dropdown-toggle {
  background: none; border: none; cursor: pointer;
  font: inherit; color: inherit; padding: 8px 12px;
  border-radius: 8px; transition: background .2s;
}
.dropdown-toggle:hover { background: rgba(0,0,0,.05); }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: 100%;
  min-width: 240px; max-height: 70vh; overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.12);
  padding: 8px 0; z-index: 1000;
}
.nav-dropdown::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-item {
  display: block; padding: 10px 20px; color: var(--text);
  text-decoration: none; font-size: .95rem; transition: background .15s;
  white-space: nowrap;
}
.dropdown-item:hover { background: rgba(37,99,235,.06); color: var(--primary); }

/* --- Breadcrumbs --- */
.breadcrumbs {
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 10px 0; font-size: .85rem;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumb-sep { margin: 0 8px; color: var(--border); }
.breadcrumb-current { color: var(--text-muted); }

/* --- Hero (Homepage) --- */
.th-home { }
.th-hero-panel {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--bg)),
    color-mix(in srgb, var(--primary-light) 6%, var(--bg)), var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 48px 0 40px; position: relative; overflow: hidden;
}
.th-hero-panel::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 10%, transparent) 0%, transparent 70%);
  border-radius: 50%;
}
.th-hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: center; position: relative; z-index: 1;
}
.th-command-copy {}
.th-kicker {
  text-transform: uppercase; letter-spacing: .08em; font-size: .78rem;
  font-weight: 600; color: var(--primary); margin-bottom: 12px;
}
.th-command-copy h1 {
  font-size: 2.2rem; font-weight: 800; line-height: 1.2;
  margin-bottom: 16px; color: var(--text);
}
.th-lead {
  font-size: 1.05rem; color: var(--text-muted); line-height: 1.6;
  margin-bottom: 24px;
}
.th-fast-routes {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.th-fast-routes a {
  padding: 8px 16px; border-radius: 20px;
  background: rgba(255,255,255,.8); border: 1px solid var(--border);
  color: var(--text); font-size: .85rem; font-weight: 500;
  transition: all .25s;
}
.th-fast-routes a:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
  transform: translateY(-1px); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 25%, transparent);
}
/* Hero image card */
.th-visual-card {
  margin: 0; border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
.th-visual-card img {
  width: 100%; height: 300px; object-fit: cover;
}
.th-visual-card figcaption {
  background: var(--card-bg); padding: 16px 20px;
  border-top: 3px solid var(--primary);
}
.th-visual-card figcaption strong { display: block; font-size: .95rem; }
.th-visual-card figcaption span { font-size: .82rem; color: var(--text-muted); }

/* --- Search --- */
.th-search-console, .search-hero { position: relative; z-index: 100; }
.search-hero { max-width: 520px; margin-bottom: 20px; }
.search-hero input, .sidebar-search-box input {
  width: 100%; padding: 14px 20px 14px 44px;
  border: 2px solid var(--border); border-radius: 14px;
  font-size: 1rem; font-family: 'Inter', sans-serif;
  background: #fff; color: var(--text);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.search-hero input:focus, .sidebar-search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent);
}
.search-hero input::placeholder, .sidebar-search-box input::placeholder { color: #94a3b8; }
.search-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%); font-size: 1.1rem; color: #94a3b8;
}
.search-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  margin-top: 6px; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.1);
  z-index: 1000; max-height: 380px; overflow-y: auto; display: none;
}
.sd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; text-decoration: none; color: var(--text);
  transition: background .15s; border-bottom: 1px solid #f1f5f9;
}
.sd-item:last-child { border-bottom: none; }
.sd-item:hover, .sd-item.sd-active { background: color-mix(in srgb, var(--primary) 6%, #fff); }
.sd-icon {
  width: 36px; height: 36px; border-radius: 8px; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  flex-shrink: 0;
}
.sd-info { flex: 1; min-width: 0; }
.sd-title {
  font-size: .92rem; font-weight: 500; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sd-item:hover .sd-title { color: var(--primary); }
.sd-slug {
  font-size: .75rem; color: #94a3b8; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sd-empty { padding: 20px 16px; text-align: center; color: #94a3b8; font-size: .9rem; }

/* --- Main content area --- */
.site-main { flex: 1; padding: 32px 0; }

/* --- Dashboard (homepage) --- */
.th-dashboard {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
  margin-bottom: 48px; opacity: 0; transform: translateY(24px);
  transition: opacity .6s, transform .6s;
}
.th-dashboard.visible { opacity: 1; transform: translateY(0); }
.th-live-card {
  grid-column: 1 / -1; display: block; text-decoration: none;
  background: linear-gradient(135deg, var(--text) 0%, #334155 100%);
  color: #fff; border-radius: 14px; padding: 24px 28px;
  transition: transform .3s, box-shadow .3s;
}
.th-live-card:hover {
  transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.15);
  color: #fff;
}
.th-live-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--primary-light); margin-bottom: 8px;
}
.th-live-card strong {
  display: block; font-size: 1.15rem; line-height: 1.4; margin-bottom: 6px;
}
.th-live-card span:last-child { font-size: .88rem; color: #94a3b8; }
.th-metrics {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.th-metrics > div {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; text-align: center;
}
.th-metrics strong { display: block; color: var(--primary); font-size: 1.1rem; }
.th-metrics span { font-size: .8rem; color: var(--text-muted); }
.th-note {
  grid-column: 1 / -1; background: color-mix(in srgb, var(--primary) 5%, var(--bg));
  border: 1px solid var(--border); border-radius: 12px; padding: 20px;
}
.th-note > span { font-weight: 700; display: block; margin-bottom: 6px; }
.th-note p { font-size: .9rem; color: var(--text-muted); }

/* --- Category Scenario Map --- */
.th-scenario-map {
  margin-bottom: 48px; opacity: 0; transform: translateY(24px);
  transition: opacity .6s, transform .6s;
}
.th-scenario-map.visible { opacity: 1; transform: translateY(0); }
.th-section-head { margin-bottom: 24px; }
.th-section-head p:first-child {
  text-transform: uppercase; letter-spacing: .08em; font-size: .75rem;
  font-weight: 600; color: var(--primary); margin-bottom: 4px;
}
.th-section-head h2 { font-size: 1.5rem; font-weight: 700; }
.th-section-head-row {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
}
.th-scenario-shell {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px;
}
.th-scenario {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; text-decoration: none;
  color: var(--text); transition: all .25s; position: relative; overflow: hidden;
}
.th-scenario::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0); transition: transform .3s;
}
.th-scenario:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: var(--primary-light);
}
.th-scenario:hover::before { transform: scaleX(1); }
.th-scenario > span { font-size: 2rem; }
.th-scenario strong { font-size: .95rem; }
.th-scenario em { font-style: normal; font-size: .82rem; color: var(--text-muted); }
.th-scenario-large { grid-column: span 2; }
.th-scenario-wide { grid-column: span 2; }
.th-scenario-tall { grid-row: span 2; }

/* --- Image Gallery (homepage) --- */
.th-gallery {
  margin-bottom: 48px; opacity: 0; transform: translateY(24px);
  transition: opacity .6s, transform .6s;
}
.th-gallery.visible { opacity: 1; transform: translateY(0); }
.th-gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px;
}
.th-gallery-card {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); transition: all .3s;
  background: var(--card-bg);
}
.th-gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.th-gallery-card img { width: 100%; height: 200px; object-fit: cover; }
.th-gallery-card figcaption {
  padding: 14px 16px; font-size: .9rem; font-weight: 500;
  color: var(--text);
}

/* --- Editorial Strip --- */
.th-editorial-strip {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  align-items: center; margin-bottom: 48px;
  opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s;
}
.th-editorial-strip.visible { opacity: 1; transform: translateY(0); }
.th-editorial-image { border-radius: 16px; overflow: hidden; }
.th-editorial-image img { width: 100%; height: 280px; object-fit: cover; }
.th-editorial-copy p:first-child {
  text-transform: uppercase; letter-spacing: .08em; font-size: .75rem;
  font-weight: 600; color: var(--primary); margin-bottom: 4px;
}
.th-editorial-copy h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; }
.th-editorial-copy p:last-child { color: var(--text-muted); line-height: 1.6; }

/* --- Article Cards --- */
.th-flow, .th-popular-block {
  margin-bottom: 48px; opacity: 0; transform: translateY(24px);
  transition: opacity .6s, transform .6s;
}
.th-flow.visible, .th-popular-block.visible { opacity: 1; transform: translateY(0); }
.recent-scroll {
  display: flex; gap: 16px; overflow-x: auto;
  padding-bottom: 12px; scroll-snap-type: x mandatory;
}
.recent-scroll::-webkit-scrollbar { height: 4px; }
.recent-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.recent-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.recent-card {
  flex: 0 0 280px; scroll-snap-align: start;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; text-decoration: none;
  color: var(--text); transition: all .2s;
}
.recent-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 6%, transparent);
  transform: translateY(-2px);
}
.recent-badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; margin-bottom: 8px;
}
.recent-title {
  font-weight: 600; font-size: .95rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.recent-card:hover .recent-title { color: var(--primary); }
.recent-cat {
  display: inline-block; margin-top: 10px; font-size: .72rem;
  color: var(--primary-dark); background: color-mix(in srgb, var(--primary) 8%, #fff);
  padding: 2px 8px; border-radius: 12px;
}
.articles-home-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px;
}
.article-home-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 24px; text-decoration: none;
  color: var(--text); transition: all .2s; display: flex; flex-direction: column;
}
.article-home-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 6%, transparent);
  transform: translateY(-2px);
}
.article-home-title { font-weight: 600; font-size: 1rem; line-height: 1.4; margin-bottom: 8px; }
.article-home-card:hover .article-home-title { color: var(--primary); }
.article-home-desc { font-size: .88rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.article-home-tag {
  display: inline-block; margin-top: 12px; font-size: .75rem;
  font-weight: 500; color: var(--primary-dark);
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  padding: 3px 10px; border-radius: 20px; align-self: flex-start;
}

/* --- People & FAQ (homepage) --- */
.th-people, .th-faq {
  margin-bottom: 48px; opacity: 0; transform: translateY(24px);
  transition: opacity .6s, transform .6s;
}
.th-people.visible, .th-faq.visible { opacity: 1; transform: translateY(0); }
.th-people-lanes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px;
}
.th-people-lanes article {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.th-people-lanes strong { display: block; margin-bottom: 4px; }
.th-people-lanes span { font-size: .85rem; color: var(--text-muted); }
.th-faq details {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 8px;
}
.th-faq summary {
  padding: 16px 20px; cursor: pointer; font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.th-faq summary::before { content: '▸'; transition: transform .2s; }
.th-faq details[open] summary::before { transform: rotate(90deg); }
.th-faq details p { padding: 0 20px 16px; color: var(--text-muted); font-size: .95rem; }

/* --- Final CTA --- */
.th-final-console {
  background: linear-gradient(135deg, var(--text), #334155);
  border-radius: 16px; padding: 40px 32px; text-align: center;
  color: #fff; margin-bottom: 48px;
  opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s;
}
.th-final-console.visible { opacity: 1; transform: translateY(0); }
.th-final-console strong { font-size: 1.4rem; display: block; margin-bottom: 8px; }
.th-final-console span { color: #94a3b8; font-size: .95rem; }

/* --- Buttons --- */
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: 10px;
  border: 2px solid var(--border); background: var(--card-bg);
  color: var(--text-muted); font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: all .2s; font-family: 'Inter', sans-serif;
}
.btn-outline:hover {
  border-color: var(--primary); color: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 10%, transparent);
}

/* =============================================
   Article Page
   ============================================= */
.article-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 40px;
}
.article-main { min-width: 0; }

/* Article body content */
.article-body h2 {
  font-size: 1.4rem; font-weight: 700; margin: 32px 0 16px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 1.15rem; font-weight: 600; margin: 24px 0 12px;
  scroll-margin-top: 80px;
}
.article-body p { margin-bottom: 16px; line-height: 1.7; }
.article-body ul, .article-body ol { margin-bottom: 16px; }
.article-body li { margin-bottom: 6px; line-height: 1.6; overflow-wrap: break-word; }
.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }
.article-body mark {
  background: color-mix(in srgb, var(--accent) 25%, #fff);
  padding: 1px 4px; border-radius: 3px;
}
.article-body code {
  background: #f1f5f9; color: #e11d48; padding: 2px 6px;
  border-radius: 4px; font-size: .9em; font-family: 'Fira Code', monospace;
}
.article-body pre {
  background: #1e293b; color: #e2e8f0; padding: 20px;
  border-radius: 10px; overflow-x: auto; margin-bottom: 16px;
  font-size: .88rem; line-height: 1.5;
}
.article-body pre code { background: none; color: inherit; padding: 0; }

/* Tables */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 20px;
}
.table-scroll table { margin-bottom: 0; }
.article-body table {
  width: max-content; min-width: 100%; border-collapse: collapse; margin-bottom: 20px;
  font-size: .9rem; background: var(--card-bg);
  border: 2px solid var(--border); border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.article-body thead { background: color-mix(in srgb, var(--primary) 8%, #f1f5f9); }
.article-body th {
  padding: 12px 16px; font-weight: 600; text-align: left;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.article-body td {
  padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:hover td { background: color-mix(in srgb, var(--primary) 3%, #fff); }

/* Blockquotes (warnings) */
.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  padding: 16px 20px; border-radius: 0 10px 10px 0;
  margin-bottom: 16px; font-size: .95rem;
}
.article-body blockquote p { margin-bottom: 0; }

/* Attention boxes */
.attention-box {
  border-radius: 12px; padding: 20px; margin: 20px 0;
  border: 2px solid var(--border);
  display: flex; align-items: flex-start; gap: 14px;
}
.attention-box .attention-icon {
  font-size: 1.4rem; flex-shrink: 0; line-height: 1.4; min-width: 1.4em;
}
/* Support both <div class="attention-content"> wrapper and bare <p>/<ul> siblings */
.attention-box .attention-content,
.attention-box > p,
.attention-box > div:not(.attention-icon):not(.attention-content) { flex: 1; min-width: 0; }
.attention-box p { margin-bottom: 0; }
.attention-box ul { margin: 8px 0 0; padding-left: 1.2em; }
.attention-box li { margin-bottom: 4px; }
.attention-info {
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  border-color: color-mix(in srgb, var(--primary) 35%, #e2e8f0);
}
.attention-tip {
  background: color-mix(in srgb, #10b981 10%, #fff);
  border-color: color-mix(in srgb, #10b981 35%, #e2e8f0);
}
.attention-warning {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  border-color: color-mix(in srgb, var(--accent) 40%, #e2e8f0);
}

/* Checklist blocks */
.checklist-block {
  background: var(--card-bg); border: 2px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: 12px; padding: 20px; margin: 20px 0;
}
.checklist-block h3,
.checklist-block h4 { margin-bottom: 12px; font-size: 1rem; }
/* Support both .check-item (real articles) and .checklist-item (alt markup) */
.check-item,
.checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; cursor: pointer; font-size: .95rem;
}
.check-item input[type="checkbox"],
.checklist-item input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--primary);
  cursor: pointer; flex-shrink: 0;
}
.check-item span,
.checklist-item span { line-height: 1.4; min-width: 0; overflow-wrap: break-word; }
.check-progress {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: .85rem; color: var(--text-muted); font-weight: 500;
}

/* FAQ items */
.faq-item, .article-body > details {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; margin: 12px 0; overflow: hidden;
}
.faq-item summary, .article-body > details > summary {
  padding: 14px 20px; cursor: pointer; font-weight: 600;
  font-size: .95rem; list-style: none;
}
.faq-item summary::-webkit-details-marker,
.article-body > details > summary::-webkit-details-marker { display: none; }
.faq-answer, .article-body > details > p,
.article-body > details > div { padding: 0 20px 16px; }
.article-body > details > p { color: var(--text-muted); }

/* --- Sidebar --- */
.article-sidebar { position: sticky; top: 80px; align-self: start; }
.sidebar-search { margin-bottom: 20px; }
.sidebar-search-box { position: relative; }
.sidebar-toc {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 20px;
}
.sidebar-toc h3 { font-size: .95rem; margin-bottom: 12px; }
.sidebar-toc ul, .sidebar-toc ol { list-style: none; padding: 0; }
.sidebar-toc li { margin-bottom: 6px; }
.sidebar-toc a {
  font-size: .88rem; color: var(--text-muted);
  display: block; padding: 4px 0; line-height: 1.4;
  border-left: 2px solid transparent; padding-left: 12px;
  transition: all .2s;
}
.sidebar-toc a:hover, .sidebar-toc a.active {
  color: var(--primary); border-left-color: var(--primary);
}
.sidebar-related {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.sidebar-related h3 { font-size: .95rem; margin-bottom: 12px; }
.sidebar-related ul { list-style: none; padding: 0; }
.sidebar-related li { margin-bottom: 8px; }
.related-card {
  font-size: .88rem; color: var(--text); display: block;
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); transition: all .2s;
}
.related-card:hover {
  background: color-mix(in srgb, var(--primary) 5%, #fff);
  border-color: var(--primary-light); color: var(--primary);
}

/* Mobile TOC */
.mobile-toc { display: none; margin: 16px 0; }
.mobile-toc details {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px;
}
.mobile-toc summary {
  padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: .95rem;
}
.mobile-toc ul, .mobile-toc ol { padding: 0 16px 16px; list-style: none; }
.mobile-toc li { margin-bottom: 6px; }
.mobile-toc a { font-size: .9rem; color: var(--text-muted); }
.mobile-toc a:hover { color: var(--primary); }

/* --- Related Bottom --- */
.related-bottom { padding: 40px 0; background: #f1f5f9; }
.related-bottom-heading {
  font-size: 1.3rem; font-weight: 700; margin-bottom: 20px;
}
.related-bottom-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px;
}
.related-bottom-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; text-decoration: none;
  color: var(--text); transition: all .2s; display: block;
}
.related-bottom-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  border-color: var(--primary-light);
}
.related-bottom-title { font-weight: 600; display: block; margin-bottom: 8px; }
.related-bottom-card:hover .related-bottom-title { color: var(--primary); }
.related-bottom-desc {
  font-size: .88rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- Footer --- */
.site-footer-premium {
  margin-top: auto; padding: 40px 0 0;
  background: var(--footer-bg); color: var(--footer-text);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
  padding-bottom: 32px; border-bottom: 1px solid #334155;
}
.footer-brand { font-size: 1.2rem; font-weight: 700; color: #f1f5f9; margin-bottom: 12px; }
.footer-about { font-size: .9rem; line-height: 1.6; margin-bottom: 8px; }
.footer-col h4 { color: #f1f5f9; font-size: .95rem; margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #94a3b8; font-size: .9rem; transition: color .2s; }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom { padding: 20px 0; text-align: center; font-size: .85rem; }

/* --- Cookie Popup --- */
.cookie-popup {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--footer-bg); color: #fff;
  padding: 16px; z-index: 9999;
  border-top: 2px solid var(--primary);
  transform: translateY(100%);
  transition: transform .5s ease;
}
.cookie-popup.visible { transform: translateY(0); }
.cookie-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; font-size: .9rem;
}
.cookie-btn {
  background: var(--primary); color: #fff; border: none;
  padding: 8px 20px; border-radius: 8px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.cookie-btn:hover { background: var(--primary-dark); }

/* --- Photo Gallery on homepage --- */
.th-gallery { margin: 32px 0; }
.th-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  border-radius: 14px;
  overflow: hidden;
}
.th-gallery-item {
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 4 / 3;
}
.th-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.th-gallery-item:hover img { transform: scale(1.05); }
@media (max-width: 768px) {
  .th-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Animations --- */
[data-animate] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
[data-animate].visible { opacity: 1; transform: translateY(0); }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .mobile-toc { display: block; }
}
@media (max-width: 768px) {
  body { font-size: 17px; }
  .container { padding: 0 16px; }
  .header-inner { padding: 10px 16px; }
  .article-body p, .article-body li { font-size: 1.02rem; line-height: 1.75; }
  .logo span:not(.logo-icon) { overflow: hidden; text-overflow: ellipsis; }
  .main-nav { display: none; flex-direction: column; gap: 0; }
  .main-nav.open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--card-bg); border-bottom: 1px solid var(--border);
    padding: 12px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
  }
  .main-nav > .nav-link { padding: 10px 0; }
  .mobile-menu-btn { display: block; }
  .dropdown-toggle { display: none; }
  .dropdown-menu {
    display: block !important; position: static;
    box-shadow: none; border: none; border-radius: 0;
    min-width: auto; max-height: none; padding: 0; background: transparent;
  }
  .dropdown-item { padding: 8px 0; font-size: 1rem; }

  .th-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .th-command-copy h1 { font-size: 1.6rem; }
  .th-visual-card img { height: 200px; }
  .th-dashboard { grid-template-columns: 1fr; }
  .th-metrics { grid-template-columns: 1fr; }
  .th-scenario-shell { grid-template-columns: 1fr 1fr; }
  .th-scenario-large, .th-scenario-wide { grid-column: span 1; }
  .th-editorial-strip { grid-template-columns: 1fr; }
  .articles-home-grid { grid-template-columns: 1fr; }
  .th-gallery-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .cookie-inner { flex-direction: column; text-align: center; }
  .related-bottom-grid { grid-template-columns: 1fr; }
  .th-section-head-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .th-scenario-shell { grid-template-columns: 1fr; }
  .th-gallery-grid { grid-template-columns: 1fr; }
  .th-fast-routes { flex-direction: column; }
  .th-hero-panel { padding: 32px 0 28px; }
  .pagination { gap: 4px; }
  .pagination-link { min-width: 34px; padding: 6px 8px; font-size: .85rem; }
  .pagination-prev, .pagination-next { padding: 6px 10px; }
  .checklist-block { padding: 14px; }
  .poll-widget { padding: 14px; }
  .attention-box { padding: 14px; gap: 10px; }
  .poll-widget-option { padding: 10px 12px; gap: 8px; }
}

/* --- Performance: skip rendering off-screen cards --- */
.article-home-card,
.recent-card,
.related-bottom-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 140px;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
  padding: 16px 0;
  flex-wrap: wrap;
}
.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  text-decoration: none;
}
.pagination-link:hover:not(.active):not(.disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg);
}
.pagination-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  cursor: default;
}

/* --- Poll Widget --- */
.poll-widget {
  background: var(--card-bg);
  border: 2px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.poll-widget-question {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 14px;
  display: block;
  line-height: 1.4;
}
.poll-widget-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  overflow: hidden;
  user-select: none;
  font-size: .92rem;
  line-height: 1.4;
}
.poll-widget-option:last-of-type { margin-bottom: 0; }
.poll-widget-option:hover { border-color: var(--primary-light); background: color-mix(in srgb, var(--primary) 4%, var(--card-bg)); }
.poll-widget-option.voted { cursor: default; pointer-events: none; }
.poll-widget-option .poll-widget-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-radius: 8px 0 0 8px;
  transition: width .6s ease;
  z-index: 0;
}
.poll-widget-option .poll-widget-label {
  position: relative;
  z-index: 1;
  font-size: .92rem;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}
.poll-widget-option .poll-widget-pct {
  position: relative;
  z-index: 1;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 40px;
  text-align: right;
  opacity: 0;
  transition: opacity .3s;
}
.poll-widget-option.voted .poll-widget-pct { opacity: 1; }
.poll-widget-option.voted.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card-bg)); }
.pagination-link.disabled {
  opacity: .4;
  cursor: default;
  pointer-events: none;
}
.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  color: var(--text-muted);
  font-size: 1rem;
  user-select: none;
}
.pagination-prev,
.pagination-next {
  font-weight: 600;
  padding: 8px 16px;
}
