/* ===================== Reset & Base ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-50: #F0F7EF;
  --primary-100: #DCEEDB;
  --primary-200: #B8DAB5;
  --primary-500: #5B8C5A;
  --primary-600: #4D7A4C;
  --primary-700: #3D663C;
  --primary-800: #2D4F2C;

  --bg: #F8F7F4;
  --bg-card: #FFFFFF;
  --text: #1E1E1E;
  --text-secondary: #787878;
  --text-tertiary: #B0B0B0;
  --border: #EDEDED;
  --accent: #F5A623;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.07);
  --max-width: 1080px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  width: 100%;
  padding: 56px 0 0;
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

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

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

/* ===================== Header (Sticky Top Nav) ===================== */
.site-header {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none !important;
  flex-shrink: 0;
}
.logo-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #4A7A49;
  letter-spacing: -0.3px;
}

.footer-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: #4A7A49;
}

.site-nav {
  display: flex;
  gap: 4px;
  font-size: 14px;
}
.site-nav a {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.15s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--primary-600) !important;
  background: var(--primary-50);
}

.lang-switch select {
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  outline: none;
}
.lang-switch select:focus {
  border-color: var(--primary-500);
}

/* ===================== Breadcrumb ===================== */
.breadcrumb {
  font-size: 13px;
  margin: 0 auto 16px;
  padding: 12px 0 4px;
  color: var(--text-tertiary);
  line-height: 1.6;
  max-width: var(--max-width);
}
.breadcrumb a {
  color: #999;
  text-decoration: none;
  font-weight: 400;
}
.breadcrumb a:hover {
  color: var(--primary-600);
  text-decoration: underline;
}
.bc-sep {
  margin: 0 7px;
  color: #C5C5C5;
  font-size: 11px;
  vertical-align: middle;
}
.bc-current {
  color: #777;
  font-weight: 500;
}

/* ===================== Article Detail ===================== */
.article-detail {
  max-width: 1080px;
  margin: 0 auto 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2rem;
}
.article-detail h1 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.3px;
}
.static-related {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.static-related a {
  color: var(--primary-600);
  font-weight: 600;
}
.static-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
}
.static-content strong {
  color: var(--text);
  font-weight: 700;
}
.static-content p {
  margin-bottom: 16px;
}
.static-content ul,
.static-content ol {
  margin: 8px 0 20px;
  padding-left: 24px;
}
.static-content li {
  margin-bottom: 8px;
}

/* ===================== Article List Cards ===================== */
.article-list h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
.article-list-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.article-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  text-decoration: none !important;
  transition: all 0.15s;
}
.article-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.article-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text) !important;
  line-height: 1.4;
}
.article-card:hover .article-card-title {
  color: var(--primary-600) !important;
}
.article-card-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===================== Related Articles Cards ===================== */
.static-related-articles {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 4px;
}
.static-related-articles h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.related-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.related-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow);
  color: var(--primary-600) !important;
  transform: translateY(-1px);
}

/* ===================== Pest Header Card ===================== */
.static-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.pest-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: transform 0.15s;
}
.gallery-thumb:hover {
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .pest-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}
@media (max-width: 400px) {
  .pest-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Image lightbox */
#lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.92);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}
#lightbox.open {
  display: flex;
}
#lightbox-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  line-height: 1;
  z-index: 100001;
  transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }
.static-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
}
.static-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}
.static-alias {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-left: 6px;
}
.static-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.static-meta a {
  color: var(--primary-600);
  font-weight: 500;
}
.static-meta a:hover {
  text-decoration: underline;
}

/* ===================== Action Buttons (Card Style) ===================== */
.static-nav {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary-500);
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(91,140,90,0.25);
}
.btn-primary:hover {
  background: var(--primary-600);
  box-shadow: 0 4px 12px rgba(91,140,90,0.3);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text) !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow);
  color: var(--primary-600) !important;
  transform: translateY(-1px);
}

/* ===================== Footer ===================== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding: 32px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.footer-about {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--primary-600);
  text-decoration: underline;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding: 16px 24px;
  text-align: center;
}
.footer-bottom .disclaimer {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
}
@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ===================== Back to Top ===================== */
#back-to-top {
  display: none;
  position: fixed;
  bottom: 32px;
  right: 24px;
  z-index: 500;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-500);
  color: #fff;
  font-size: 20px;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.15s;
  font-family: inherit;
  line-height: 1;
}
#back-to-top:hover {
  background: var(--primary-600);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

/* ===================== Static Icon (legacy, for gallery-less pages) ===================== */

/* ===================== Responsive ===================== */
@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  main {
    padding: 20px 0 48px;
  }
  .container {
    padding: 0 16px;
  }

  h1 {
    font-size: 23px;
  }
  h2 {
    font-size: 19px;
  }

  .site-header .container {
    padding: 0 14px;
    height: 52px;
  }
  .logo-icon {
    height: 28px;
    width: auto;
  }
  .site-nav {
    gap: 0;
    font-size: 12px;
  }
  .site-nav a {
    padding: 5px 8px;
  }

  .static-page,
  .static-content {
    padding: 18px 14px;
    border-radius: var(--radius);
  }

  .static-header {
    gap: 14px;
  }
  .static-icon {
    width: 56px;
    height: 56px;
  }
  .static-title {
    font-size: 24px;
  }

  .static-content ol > li {
    padding-left: 32px;
  }
  .static-content ol > li::before {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .static-nav {
    flex-direction: column;
  }
  .btn-primary,
  .btn-secondary {
    justify-content: center;
    padding: 12px 20px;
  }

  /* Pest grid mobile */
  .pest-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .pest-card {
    padding: 10px 5px 7px;
  }
  .pest-card img {
    max-width: 68px;
  }
}


@media (max-width: 480px) {
  .pest-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .pest-card {
    padding: 8px 4px 6px;
  }
  .pest-card img {
    max-width: 56px;
  }
}

/* Identify page mobile */
@media (max-width: 640px) {
  .identify-step {
    padding: 14px;
  }
  .tag-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
  .identify-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* ===================== Pest Detail A & B - Enhanced Lists ===================== */
.pest-detail-a section ol,
.pest-detail-b section ol {
  counter-reset: li-counter;
  margin-bottom: 20px;
}
.pest-detail-a section ol > li,
.pest-detail-b section ol > li {
  position: relative;
  background: var(--bg);
  border-left: 3px solid var(--primary-200);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px 14px 44px;
  margin-bottom: 16px;
  list-style: none;
  counter-increment: li-counter;
  min-height: 28px;
  line-height: 1.75;
}
.pest-detail-a section ol > li::before,
.pest-detail-b section ol > li::before {
  content: counter(li-counter);
  position: absolute;
  left: 10px;
  top: 13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary-200);
  color: var(--primary-600);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 1;
}

/* Step title: green background block (防治方法 only) */
.pest-detail-b section ol > li > strong:first-child {
  display: block;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 15px;
  font-weight: 700;
  padding: 10px 16px 10px 44px;
  margin: -14px -16px 10px -44px;
  border-radius: 0 var(--radius-sm) 0 0;
}

/* Section card — white rounded rectangle */
.pest-detail-a section,
.pest-detail-b section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* Section title: green tag block */
.pest-detail-a section h2,
.pest-detail-b section h2 {
  display: inline-block;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 16px;
  font-weight: 700;
  padding: 8px 14px;
  margin: 0 0 14px;
  border-radius: var(--radius-sm);
  border: none;
}

/* Prevention section title: orange tag to match card */
.pest-detail-b .prevention-section h2 {
  background: #FFEDD5;
  color: #8B6914;
}

/* Prevention callout card */
.pest-detail-a .prevention-card,
.pest-detail-b .prevention-card {
  background: #FFF8F0;
  border-radius: var(--radius-sm);
  padding: 20px;
  border-left: 3px solid var(--accent);
  line-height: 1.8;
}
.pest-detail-a .prevention-card p,
.pest-detail-b .prevention-card p {
  margin: 0;
  color: #5A4A2A;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .pest-detail-a section ol > li,
  .pest-detail-b section ol > li {
    padding: 12px 12px 12px 38px;
  }
  .pest-detail-a section ol > li::before,
  .pest-detail-b section ol > li::before {
    left: 7px;
    top: 11px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .pest-detail-b section ol > li > strong:first-child {
    padding: 8px 12px 8px 38px;
    margin: -12px -12px 8px -38px;
  }
  .pest-detail-a .prevention-card,
  .pest-detail-b .prevention-card {
    padding: 16px;
  }
}

/* ===================== Seasonality Table ===================== */
.pest-detail-a .seasonality-summary {
  color: #555;
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.pest-detail-a .habitat-text {
  background: #FFF8F0;
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: #5A4A2A;
}
.pest-detail-a .habitat-text strong {
  color: #8B6914;
}
.pest-detail-a .seasonality-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}
.pest-detail-a .seasonality-table thead th {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 2px solid var(--primary-200);
}
.pest-detail-a .seasonality-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
.pest-detail-a .seasonality-table tbody tr:last-child td {
  border-bottom: none;
}
.pest-detail-a .seasonality-table tbody tr:nth-child(even) {
  background: var(--bg);
}
.pest-detail-a .seasonality-table .note-cell {
  color: #666;
  font-size: 13px;
}

@media (max-width: 640px) {
  .pest-detail-a .seasonality-table {
    font-size: 13px;
  }
  .pest-detail-a .seasonality-table thead th,
  .pest-detail-a .seasonality-table tbody td {
    padding: 8px 6px;
  }
}

/* ===================== Subspecies Cards ===================== */
.subspecies-section {
  margin-bottom: 32px;
}
.subspecies-intro {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}
.subspecies-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .subspecies-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.subspecies-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow 0.15s;
}
.subspecies-card:hover {
  box-shadow: var(--shadow);
}
.subspecies-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
  padding: 0;
  border: none;
  color: var(--text);
}
.subspecies-latin {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.subspecies-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

/* ===================== Pest List All (按分类分组) ===================== */
.pest-list-all .pest-category-section {
  margin-bottom: 32px;
}
.pest-list-all .pest-category-section:last-child {
  margin-bottom: 0;
}
.pest-category-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-600);
  margin: 0 0 16px;
  padding: 0;
  border: none;
  background: none;
  line-height: 1;
}
.pest-category-divider {
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--primary-200);
  border-radius: 2px;
  flex-shrink: 0;
}
.pest-category-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: auto;
}

/* ===================== Pest Grid (大图列表) ===================== */
.pest-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.pest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 6px 10px;
  text-decoration: none !important;
  border: 1px solid var(--border);
  transition: all 0.15s;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.pest-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-200);
  transform: translateY(-2px);
}
.pest-card img {
  width: 100%;
  max-width: 100px;
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 6px;
  background: #fff;
  flex-shrink: 0;
}
.pest-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.pest-card-alias {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.3;
}

/* ===================== Identify Page ===================== */
.identify-page h1 {
  margin-bottom: 4px;
}
.identify-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.identify-step {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.identify-step h2 {
  font-size: 16px;
  margin: 0 0 4px;
  padding: 0;
  border: none;
  background: none;
  font-weight: 700;
}
.step-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 6px;
}
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tag-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
  line-height: 1.4;
}
.tag-btn:hover {
  border-color: var(--primary-200);
  color: var(--primary-600);
  background: var(--primary-50);
}
.tag-btn.active {
  border-color: var(--primary-500);
  background: var(--primary-500);
  color: #fff;
}
#identify-results {
  margin-top: 12px;
}
#identify-results h2 {
  font-size: 16px;
  margin: 0 0 14px;
  padding: 0;
  border: none;
  background: none;
}
.identify-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.identify-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-decoration: none !important;
  transition: all 0.15s;
}
.identify-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-200);
}
.identify-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.identify-card-body {
  display: flex;
  flex-direction: column;
}
.identify-card-body strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.identify-card-body span {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 1px;
}
.identify-placeholder,
.identify-no-match {
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 20px 0;
}
.identify-none {
  font-size: 14px;
  color: var(--text-secondary);
  display: none;
}

/* ===================== Language Home ===================== */
.language-home {
  text-align: center;
  padding: 48px 20px;
}
.language-home h1 {
  font-size: 28px;
  margin-bottom: 4px;
}
.home-tagline {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}
.home-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}
.lang-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.lang-chip {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}
.lang-chip:hover {
  border-color: var(--primary-200);
  color: var(--primary-600);
  text-decoration: none;
}

/* ===================== 404 Page ===================== */
.not-found-page {
  text-align: center;
  padding: 80px 20px;
}
.not-found-icon {
  color: var(--primary-200);
  margin-bottom: 20px;
}
.not-found-page h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.not-found-desc {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 15px;
  line-height: 1.7;
}
.not-found-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ===================== Print ===================== */
@media print {
  .site-header,
  .site-footer,
  .static-nav {
    display: none;
  }
  main {
    padding: 0;
  }
  .static-page,
  .static-content {
    box-shadow: none;
    padding: 0;
  }
}

/* ═══════════════════════════════════════════════════════
   Shared Page Chrome (title / desc / buttons)
   ═══════════════════════════════════════════════════════ */
.static-page {
  padding-top: 0.5rem;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}
.page-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: var(--primary-600);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0;
  transition: color 0.15s;
}
.btn-back:hover { color: var(--primary-700); }

/* ═══════════════════════════════════════════════════════
   Home Page
   ═══════════════════════════════════════════════════════ */
.home-page {
  max-width: 520px;
  margin: 0 auto;
}
.home-hero {
  text-align: center;
  padding: 2rem 0 0.75rem;
}
.home-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}
.home-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.home-search-entry { width: 480px; max-width: 100%; margin: 1rem auto 1.5rem; }
.home-search-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  text-decoration: none;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.home-search-link svg { flex-shrink: 0; }
.home-search-link:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text-secondary);
}

/* Quick ID CTA — prominent green button */
.home-cta-btn {
  display: block;
  text-align: center;
  background: var(--primary-500);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.8rem 1.5rem;
  margin: 0 auto 1rem;
  max-width: 320px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(91,140,90,0.25);
  transition: background 0.15s, transform 0.15s;
}
.home-cta-btn:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

/* Feature cards — horizontal rows, one per line, centered */
.home-features {
  text-align: center;
  margin-bottom: 1.5rem;
}
.feature-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 480px;
  max-width: 100%;
  margin: 0 auto 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.feature-card:hover {
  border-color: var(--primary-100);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}
.feature-icon { flex-shrink: 0; display: flex; align-items: center; }
.feature-icon svg { display: block; }
.feature-label { font-size: 0.9rem; font-weight: 600; flex: 1; }
.feature-arrow { flex-shrink: 0; display: flex; align-items: center; }
.feature-arrow svg { display: block; }

/* Random pest gallery */
.random-gallery {
  max-width: min(1080px, calc(100% - 2rem));
  margin: 1.5rem auto 2rem;
  background: #fff;
  border: 1px solid var(--border)/50;
  border-radius: 14px;
  padding: 1.2rem 1rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.random-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.random-gallery-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.random-gallery-refresh {
  font-size: 0.75rem;
  color: var(--primary);
  background: var(--primary)/10;
  border: none;
  border-radius: 14px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  font-weight: 600;
}
.random-gallery-refresh:hover { background: var(--primary)/18; }
.random-gallery-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.random-gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  transition: transform 0.15s;
}
.random-gallery-item:hover { transform: scale(1.03); }
.random-gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg);
}
.random-gallery-item span {
  font-size: 0.65rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.3rem 0.4rem;
  text-align: center;
  line-height: 1.2;
}



/* ═══════════════════════════════════════════════════════
   Article List Page
   ═══════════════════════════════════════════════════════ */
.article-list-page { max-width: 560px; margin: 0 auto; }
.article-list-tabs {
  display: flex;
  margin-bottom: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 3px;
  gap: 3px;
}
.tab-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  border: none;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}
.tab-btn:not(.active):hover { color: var(--text); }
.article-search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.search-input {
  flex: 1;
  padding: 0.7rem 0.9rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary-200); }
.search-btn {
  padding: 0.7rem 1.25rem;
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.search-btn:hover { background: var(--primary-600); }
.article-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.article-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.article-card:hover {
  border-color: var(--primary-100);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}
.article-card-star {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: transform 0.15s;
  border-radius: 4px;
}
.article-card-star:hover {
  transform: scale(1.25);
  background: var(--primary-50);
}
.article-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.article-card-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.35rem;
}
.article-card-pest {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--primary-50);
  color: var(--primary-600);
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
}
.static-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 0.75rem;
}
.static-fav-btn:hover {
  border-color: var(--primary-200);
  color: var(--text);
}
.static-fav-btn.is-fav {
  border-color: var(--accent);
  color: var(--accent);
  background: #FFF3E0;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary-200);
  color: var(--primary-600);
}
.page-btn.active {
  background: var(--primary-500);
  color: #fff;
  border-color: var(--primary-500);
  font-weight: 700;
}
.page-btn:disabled { opacity: 0.3; cursor: default; }
.page-ellipsis { padding: 0 0.15rem; color: var(--text-tertiary); font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   Select / Pest Identifier Page
   ═══════════════════════════════════════════════════════ */
.select-page {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
/* search bar */
.select-search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.select-search-bar .search-input {
  flex: 1;
  padding: 0.7rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.select-search-bar .search-input:focus { border-color: var(--primary-300); }
.select-search-bar .search-btn {
  padding: 0.7rem 1.3rem;
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.select-search-bar .search-btn:hover { background: var(--primary-600); }

/* two choice buttons — match .feature-card size */
.select-choice-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 480px;
  max-width: 100%;
  margin: 0 auto 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select-choice-card > div {
  text-align: left;
}
.select-choice-card:hover {
  border-color: var(--primary-100);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.choice-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.choice-icon svg { display: block; }
.choice-text {
  flex: 1;
  text-align: left;
  min-width: 0;
}
.choice-label {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  color: var(--text);
  margin-bottom: 0.1rem;
}
.choice-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
}

/* category grid — 2 columns, image cards */
.category-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 1rem 0 0.85rem;
}
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 0.65rem 0.9rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-100);
  text-decoration: none;
  color: var(--text);
}
.cat-image { width: 52px; height: 52px; object-fit: contain; border-radius: 6px; }
.cat-name { font-size: 0.9rem; font-weight: 700; text-align: center; }
.cat-desc {
  font-size: 0.73rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* search results */
.select-results { margin-bottom: 1.25rem; }
.select-result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.4rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}
.select-result-card:hover { border-color: var(--primary-100); text-decoration: none; }
.result-name { font-size: 0.9rem; font-weight: 700; }
.result-cat { font-size: 0.74rem; color: var(--text-secondary); font-weight: 500; }
.results-count { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.results-empty { text-align: center; color: var(--text-secondary); padding: 2rem 0; font-size: 0.9rem; }

/* recent pests */
.select-recent { margin-top: 1.5rem; }
.recent-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.55rem;
}
.recent-grid { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.recent-pest-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s;
}
.recent-pest-card:hover { transform: translateY(-1px); text-decoration: none; color: var(--primary-600); }

/* ═══════════════════════════════════════════════════════
   Question / Decision Tree Page
   ═══════════════════════════════════════════════════════ */
.question-page {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.question-container {
  padding: 2rem 0;
  text-align: center;
}
#js-start-question {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem auto;
  display: inline-block;
}
.question-step { padding: 0.5rem 0; text-align: center; }
.question-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary-500);
  border-radius: 99px;
  transition: width 0.35s ease;
}
.question-progress span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.question-text {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.2px;
}
.question-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 320px;
  margin: 0 auto;
}
.question-option {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.question-option.yes { border-color: var(--primary-200); }
.question-option.yes:hover { border-color: var(--primary-500); background: var(--primary-50); color: var(--primary-700); }
.question-option.no:hover { border-color: var(--text-tertiary); background: var(--bg); }
.question-error { color: var(--text-secondary); padding: 2rem 0; font-size: 0.95rem; }
.question-error a { color: var(--primary-600); font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   Search Page
   ═══════════════════════════════════════════════════════ */
.search-page { max-width: 520px; margin: 0 auto; }
.search-bar {
  display: flex;
  gap: 0.5rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}
.search-input-lg {
  flex: 1;
  padding: 0.85rem 1.15rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.search-input-lg:focus { border-color: var(--primary-200); }
.search-btn-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.search-btn-lg svg { display: block; }
.search-btn-lg:hover { background: var(--primary-600); }
.search-results { max-width: 560px; margin: 0 auto; }
.search-results-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1.5rem 0 0.6rem;
}
.search-result-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.45rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-result-card:hover {
  border-color: var(--primary-100);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}
.search-result-title { font-size: 0.92rem; font-weight: 700; display: block; margin-bottom: 0.15rem; }
.search-result-summary { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }
.search-no-results { text-align: center; color: var(--text-secondary); padding: 2rem 0; font-size: 0.95rem; }

/* ═══════════════════════════════════════════════════════
   Guide Page
   ═══════════════════════════════════════════════════════ */
.guide-page { max-width: 560px; margin: 0 auto; }
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 580px;
  margin: 0 auto 2rem;
}
.guide-step {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}
.guide-step:hover { border-color: var(--primary-100); }
.step-number {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.step-number svg { display: block; }
.step-content { flex: 1; padding-top: 0.25rem; }
.step-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text); }
.step-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; }
.guide-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 580px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .home-page, .select-page, .question-page, .search-page, .guide-page,
  .article-list-page, .article-detail,
  .legal-page, .about-page {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-sm);
  }
}
@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .page-title { font-size: 1.9rem; }
}
@media (max-width: 480px) {
  .home-title { font-size: 1.65rem; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .question-text { font-size: 1.15rem; }
}

.about-page h1 { font-size:1.5rem; font-weight:800; margin-bottom:0.5rem; color:var(--text); letter-spacing:-0.3px; }
.about-divider { border:none; border-top:1px solid var(--border); margin:1rem 0 1.5rem; }
.about-text { line-height:1.9; color:var(--text-secondary); font-size:0.95rem; }
.about-text p { margin-bottom:1.15rem; }
.about-text p:last-child { margin-bottom:0; }

/* ── Legal Pages (privacy, terms, contact) ── */
.legal-page h1 { font-size:1.5rem; font-weight:800; margin-bottom:0.5rem; color:var(--text); }
.legal-page h2 { font-size:1.4rem; font-weight:700; color:#333; margin-bottom:8px; }
.legal-page h3 { font-size:1.05rem; font-weight:600; color:#555; margin:20px 0 8px; }
.legal-page p { font-size:0.95rem; line-height:1.8; color:#555; margin-bottom:12px; }

/* ═══════════════════════════════════════════════════════
   Unified white card layout (overrides individual widths)
   ═══════════════════════════════════════════════════════ */
.home-page,
.select-page,
.question-page,
.search-page,
.guide-page,
.article-list-page,
.article-detail,
.legal-page,
.about-page {
  max-width: min(1080px, calc(100% - 2rem)) !important;
  margin: 1.5rem auto 2rem !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2rem;
}
