﻿:root {
  --ink: #1f2937;
  --muted: #4b5563;
  --paper: #f8f5ef;
  --surface: #ffffff;
  --line: #e5e7eb;
  --forest: #24594b;
  --forest-dark: #153b34;
  --copper: #b86535;
  --mint: #cfeee3;
  --tech: #5ca6a1;
  --blue: #376f9f;
  --amber: #d1923f;
  --clay: #a85538;
  --soft-blue: #e8f2f7;
  --soft-amber: #fff4df;
  --glow: 0 0 0 1px rgba(92, 166, 161, 0.12), 0 14px 34px rgba(31, 41, 55, 0.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, p, li, a, span { overflow-wrap: break-word; }
h1 { max-width: 900px; margin-bottom: 18px; font-size: clamp(38px, 6vw, 72px); line-height: 1.04; letter-spacing: 0; }
h2 { margin-bottom: 12px; font-size: clamp(26px, 4vw, 40px); line-height: 1.14; }
h3 { margin-bottom: 10px; font-size: 22px; }

.container,
.hero-inner,
.site-header,
.site-footer .footer-inner,
.notice,
.cta-strip,
.category-grid,
.section-shell,
.method-band,
.article-shell,
.page-shell,
.review-shell {
  width: min(1100px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
  background: rgba(248, 245, 239, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand, .nav-links, .hero-actions, .card-actions, .byline, .site-footer .footer-inner { display: flex; align-items: center; }
.brand { gap: 10px; font-weight: 900; }
.brand-mark, .avatar { display: grid; place-items: center; border-radius: 8px; background: var(--forest-dark); color: var(--mint); font-weight: 900; }
.brand-mark { width: 36px; height: 36px; }
.avatar { width: 44px; height: 44px; }
.nav-links { gap: 20px; color: var(--muted); font-size: 14px; font-weight: 800; }
.nav-links a:hover, .text-link:hover, .site-footer a:hover { color: var(--forest-dark); text-decoration: underline; }

.hero {
  position: relative;
  min-height: 72vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 0 0 58px;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(18, 31, 28, 0.88), rgba(18, 31, 28, 0.6) 52%, rgba(18, 31, 28, 0.18)); }
.hero-content { width: min(1100px, calc(100vw - 48px)); margin-inline: auto; color: #fffdf8; }
.hero-content { max-width: calc(100vw - 48px); }
.eyebrow, .section-kicker { margin: 0 0 10px; color: var(--copper); font-size: 13px; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
.hero .eyebrow { color: #f4bd7a; }
.hero p, .lede { max-width: 760px; font-size: 18px; }
.hero p { color: rgba(255, 253, 248, 0.9); }
.positioning-note { margin-top: 18px; padding-left: 16px; border-left: 3px solid #f4bd7a; }
.hero-actions, .card-actions { flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.hero-with-visual {
  min-height: 72vh;
  align-items: center;
  padding: 66px 0 58px;
  background:
    radial-gradient(circle at 88% 18%, rgba(209, 146, 63, 0.3), transparent 28%),
    linear-gradient(90deg, var(--forest-dark) 0%, var(--forest) 58%, #f0f7f3 58%, #f8f5ef 100%);
}
.hero-with-visual::after {
  display: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 42px;
  align-items: center;
}
.hero-with-visual .hero-content {
  width: auto;
  max-width: none;
  margin: 0;
}
.hero-visual-card,
.hero-photo-card,
.guide-visual-panel,
.page-visual-banner {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 22px 54px rgba(21, 59, 52, 0.22);
}
.hero-visual-card {
  padding: 24px;
  color: var(--ink);
}
.hero-photo-card {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
}
.hero-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.hero-photo-card figcaption {
  margin: 0;
  padding: 13px 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.hero-visual-card svg,
.guide-visual-panel svg,
.page-visual-banner svg,
.tool-icon svg,
.rank-icon svg,
.contact-icon svg {
  display: block;
  width: 100%;
  height: auto;
}
.hero-visual-caption {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.hero .hero-visual-caption { color: var(--muted); }
.workshop-visual .bench { fill: #d8c8aa; }
.workshop-visual .case { fill: var(--forest); }
.workshop-visual .case-dark { fill: var(--forest-dark); }
.workshop-visual .line { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; stroke-width: 5; }
.workshop-visual .accent { fill: var(--amber); }
.workshop-visual .blue { fill: var(--blue); }
.workshop-visual .soft { fill: var(--soft-blue); }

.button, button { font: inherit; cursor: pointer; }
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
  transition: transform 160ms ease, background 160ms ease;
}
.button:hover, .link-button:hover { transform: translateY(-1px); }
.button.primary { background: var(--forest); color: white; }
.button.primary:hover { background: var(--forest-dark); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--forest-dark); }
.button.ghost { border-color: rgba(255,255,255,.55); color: white; }

.notice {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.notice strong { color: var(--ink); }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 34px 0 8px; }
.category-card, .guide-card, .ranked-card, .testing-box, .review-hero, .related, .content-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--glow);
}
.category-card { min-height: 150px; padding: 22px; }
.category-card > span:not(.tool-icon), .rank-badge, .guide-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(92, 166, 161, 0.16);
  color: var(--forest-dark);
  font-size: 13px;
  font-weight: 900;
}
.category-card strong { display: block; font-size: 20px; line-height: 1.25; }
.tool-icon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.tool-icon-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--glow);
}
.tool-icon,
.rank-icon,
.contact-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--soft-blue), var(--soft-amber));
  color: var(--forest-dark);
}
.category-card .tool-icon {
  width: 58px;
  height: 58px;
  margin: 0 0 16px;
}
.ranked-card .tool-icon.compact {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
}
.tool-icon .stroke,
.rank-icon .stroke,
.contact-icon .stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool-icon .fill,
.rank-icon .fill,
.contact-icon .fill { fill: currentColor; opacity: 0.14; }
.section-shell { padding: 58px 0; }
.section-heading { max-width: 790px; margin-bottom: 26px; }
.section-heading p, .guide-card p, .ranked-card p, .lede, .byline span, .testing-box p, .review-hero p, .related a, .content-card p, .content-card li { color: var(--muted); }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.guide-card { min-height: 250px; padding: 22px; }
.guide-card.featured { grid-column: span 2; display: grid; grid-template-columns: .72fr 1fr; gap: 22px; align-items: center; }
.feature-photo {
  min-height: 230px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
}
.feature-photo img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
}
.guide-card-image {
  width: 100%;
  height: 160px;
  margin: 0 0 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.feature-visual {
  min-height: 230px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(92, 166, 161, 0.2), rgba(209, 146, 63, 0.24)),
    #f4f8f6;
}
.feature-visual svg { width: min(100%, 320px); height: auto; }
.text-link { color: var(--forest-dark); font-weight: 900; }
.method-band { display: grid; grid-template-columns: .8fr 1.6fr; gap: 30px; padding: 58px 0; border-top: 1px solid var(--line); }
.method-grid { display: grid; gap: 12px; }
.method-grid article { padding: 18px 0; border-bottom: 1px solid var(--line); }
.method-grid span { color: var(--tech); font-size: 24px; font-weight: 950; }

.article-shell, .review-shell, .page-shell { padding: 54px 0 74px; }
.article-shell h1, .review-shell h1, .page-shell h1 { color: var(--ink); font-size: clamp(38px, 6vw, 66px); }
.byline { gap: 12px; margin: 18px 0; }
.byline strong, .byline span { display: block; }
.article-hero-image {
  overflow: hidden;
  margin: 28px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--glow);
}
.article-hero-image img {
  width: 100%;
  aspect-ratio: 70 / 41;
  object-fit: cover;
}
.article-hero-image figcaption {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.ranked-list { display: grid; gap: 16px; margin-top: 30px; }
.ranked-card { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 22px; }
.ranked-card-image {
  width: 100%;
  height: clamp(180px, 24vw, 260px);
  margin: 0 0 16px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.rank { display: grid; width: 56px; height: 56px; place-items: center; border-radius: 50%; background: var(--forest-dark); color: var(--mint); font-size: 20px; font-weight: 950; }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pros-cons ul { margin: 0; padding-left: 20px; color: var(--muted); }
.comparison-wrap { margin-top: 44px; overflow-x: auto; }
.comparison-table { min-width: 780px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.table-row { display: grid; grid-template-columns: 1.15fr 1fr .55fr .7fr; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.table-row:last-child { border-bottom: 0; }
.table-head { background: var(--forest-dark); color: white; font-weight: 900; }
.table-row a { color: var(--forest-dark); font-weight: 900; }
.testing-box { margin-top: 36px; padding: 24px; }
.safety-note-box {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 26px;
  padding: 22px;
  border: 1px solid rgba(209, 146, 63, 0.42);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 244, 223, 0.92), rgba(255, 255, 255, 0.94));
  box-shadow: var(--glow);
}
.safety-note-box h2,
.safety-note-box h3,
.safety-note-box p { margin-bottom: 8px; }
.safety-note-box p:last-child { margin-bottom: 0; }
.visual-checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.visual-checklist li,
.comparison-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--glow);
}
.visual-checklist strong,
.comparison-card strong { display: block; margin-bottom: 6px; color: var(--ink); }
.visual-checklist span,
.comparison-card span { color: var(--muted); }
.comparison-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.guide-visual-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: center;
  margin: 26px 0 10px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(232, 242, 247, 0.92), rgba(255, 244, 223, 0.78)),
    var(--surface);
  color: var(--ink);
}
.guide-visual-panel p { color: var(--muted); }
.guide-visual-panel .guide-badge { margin-bottom: 12px; }
.guide-visual-panel svg { max-width: 360px; justify-self: end; }
.page-visual-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 320px);
  gap: 22px;
  align-items: center;
  margin: 20px 0 28px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 242, 247, 0.82)),
    var(--surface);
  box-shadow: var(--glow);
}
.page-visual-banner p { color: var(--muted); }
.page-visual-banner svg { max-width: 300px; justify-self: end; }
.contact-card-icon { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.contact-icon { flex: 0 0 auto; width: 50px; height: 50px; margin: 0; }
.related { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; padding: 22px; }
.related h2 { width: 100%; }
.related a { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; font-weight: 900; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.content-card { padding: 22px; }
.content-card ul { margin: 0; padding-left: 20px; }
.cta-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 42px;
  padding: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--forest-dark), var(--forest));
  color: #fffdf8;
  box-shadow: 0 18px 46px rgba(21, 59, 52, 0.22);
}
.cta-strip h2,
.cta-strip p { margin-bottom: 8px; }
.cta-strip p { color: rgba(255, 253, 248, 0.82); }
.cta-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.cta-links .button.secondary { border-color: rgba(255, 255, 255, 0.42); background: rgba(255, 255, 255, 0.96); }

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}
.site-footer .footer-inner {
  justify-content: space-between;
  gap: 18px;
  padding-block: 20px;
}
.site-footer .footer-inner > * { min-width: 0; }
.site-footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.link-button { border: 0; background: transparent; color: var(--forest-dark); font-weight: 900; }

@media (max-width: 900px) {
  .site-header, .method-band { align-items: start; flex-direction: column; }
  .hero-inner,
  .category-grid,
  .guide-grid,
  .method-band,
  .guide-card.featured,
  .ranked-card,
  .pros-cons,
  .content-grid,
  .tool-icon-grid,
  .visual-checklist,
  .comparison-card-grid,
  .guide-visual-panel,
  .page-visual-banner,
  .cta-strip { grid-template-columns: 1fr; }
  .hero::after { background: linear-gradient(180deg, rgba(18,31,28,.32), rgba(18,31,28,.9)); }
  .hero-with-visual {
    background:
      radial-gradient(circle at 92% 34%, rgba(209, 146, 63, 0.22), transparent 24%),
      linear-gradient(180deg, var(--forest-dark) 0%, var(--forest) 78%, #f0f7f3 78%, #f8f5ef 100%);
  }
  .hero-visual-card { max-width: 520px; }
  .hero-photo-card { max-width: 520px; }
  .guide-visual-panel svg,
  .page-visual-banner svg { justify-self: start; }
  .cta-links { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .container,
  .hero-inner,
  .site-header,
  .site-footer .footer-inner,
  .notice,
  .cta-strip,
  .category-grid,
  .section-shell,
  .method-band,
  .article-shell,
  .page-shell,
  .review-shell,
  .hero-content {
    width: min(1100px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }
  .nav-links, .site-footer .footer-inner { align-items: stretch; flex-direction: column; }
  .footer-links { justify-content: flex-start; }
  h1, h2, h3, p, .byline, .notice, .testing-box, .content-card, .ranked-card, .related {
    max-width: calc(100vw - 32px) !important;
  }
  h1,
  .article-shell h1,
  .review-shell h1,
  .page-shell h1 {
    font-size: 30px;
    line-height: 1.1;
  }
  h2 { font-size: 27px; }
  .hero p, .lede { font-size: 16px; }
  .button { width: 100%; }
  .article-hero-image img { aspect-ratio: 4 / 3; }
  .hero-with-visual { padding-block: 42px; }
  .hero-inner { gap: 24px; }
  .hero-visual-card,
  .hero-photo-card,
  .guide-visual-panel,
  .page-visual-banner,
  .safety-note-box,
  .tool-icon-card,
  .comparison-card,
  .cta-strip { padding: 18px; }
  .safety-note-box { grid-template-columns: 1fr; }
  .feature-visual { min-height: 180px; }
  .feature-photo,
  .feature-photo img { min-height: 180px; }
  .guide-card-image { height: 180px; }
  .cta-links .button { width: 100%; }
}

/* === 图片缺失降级 (images pending generation) === */
.article-hero-image img,
.ranked-card-image {
  background: linear-gradient(135deg, #e8e4db 0%, #dfd9cc 50%, #e8e4db 100%);
  background-size: 200% 200%;
  animation: imgPulse 3s ease-in-out infinite;
  min-height: 120px;
  position: relative;
}
.article-hero-image img::after,
.ranked-card-image::after {
  content: "";
  display: block;
  padding-top: 56.25%;
}
@keyframes imgPulse {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.article-hero-image img[src]:not([src=""]),
.ranked-card-image[src]:not([src=""]) {
  background: var(--surface);
  animation: none;
}


/* ============================================
   OPTIMIZED: Mobile & Interaction Enhancements
   Added: 2026-06-25
   ============================================ */

/* === Dark Mode Support === */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e5e7eb;
    --muted: #9ca3af;
    --paper: #111827;
    --surface: #1f2937;
    --line: #374151;
    --soft-blue: #1e3a4f;
    --soft-amber: #2d2415;
    --glow: 0 0 0 1px rgba(92, 166, 161, 0.2), 0 8px 20px rgba(0, 0, 0, 0.3);
  }
  .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
  .button.secondary:hover { background: var(--line); }
  .related a { background: var(--surface); border-color: var(--line); }
  .related a:hover { background: var(--line); }
  .table-row a { color: var(--tech); }
  .nav-links a:hover, .text-link:hover, .site-footer a:hover { color: var(--mint); }
  .site-header { background: rgba(17, 24, 39, 0.94); }
  .site-footer { background: var(--paper); }
}

.dark-mode {
  --ink: #e5e7eb;
  --muted: #9ca3af;
  --paper: #111827;
  --surface: #1f2937;
  --line: #374151;
  --soft-blue: #1e3a4f;
  --soft-amber: #2d2415;
  --glow: 0 0 0 1px rgba(92, 166, 161, 0.2), 0 8px 20px rgba(0, 0, 0, 0.3);
}
.dark-mode .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.dark-mode .button.secondary:hover { background: var(--line); }
.dark-mode .related a { background: var(--surface); border-color: var(--line); }
.dark-mode .related a:hover { background: var(--line); }
.dark-mode .table-row a { color: var(--tech); }
.dark-mode .nav-links a:hover, .dark-mode .text-link:hover, .dark-mode .site-footer a:hover { color: var(--mint); }
.dark-mode .site-header { background: rgba(17, 24, 39, 0.94); }
.dark-mode .site-footer { background: var(--paper); }

/* === Focus Visible for Keyboard Navigation === */
*:focus-visible {
  outline: 2px solid var(--tech);
  outline-offset: 2px;
  border-radius: 2px;
}
a:focus-visible, button:focus-visible {
  outline-offset: 4px;
}
.nav-links a:focus-visible,
.footer-links a:focus-visible {
  outline-offset: 2px;
}

/* === Skip to Content Link (Accessibility) === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100;
  padding: 12px 24px;
  background: var(--forest-dark);
  color: #fff;
  font-weight: 800;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* === Back to Top Button === */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--forest-dark);
}
.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* === Dark Mode Toggle Button === */
.dark-mode-toggle {
  position: fixed;
  bottom: 24px;
  right: 84px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
  transition: opacity 0.3s, transform 0.2s, background 0.2s;
  font-size: 18px;
}
.dark-mode-toggle:hover {
  background: var(--line);
}
.dark-mode-toggle svg {
  width: 20px;
  height: 20px;
}

/* === Improved Table Scrolling Experience === */
.comparison-wrap {
  margin-top: 44px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.comparison-wrap::-webkit-scrollbar {
  height: 6px;
}
.comparison-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.comparison-wrap::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
.comparison-wrap .scroll-hint {
  display: none;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  text-align: right;
}

@media (max-width: 900px) {
  .comparison-wrap .scroll-hint {
    display: block;
  }
}

/* === Smooth loading animation for images === */
img {
  transition: opacity 0.3s ease;
}
img[data-lazy] {
  opacity: 0;
}
img[data-lazy].loaded {
  opacity: 1;
}

/* === Reduced Motion Preference === */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .back-to-top,
  .dark-mode-toggle,
  img {
    transition: none;
  }
  .article-hero-image img,
  .ranked-card-image {
    animation: none;
  }
  .button:hover, .link-button:hover {
    transform: none;
  }
}

/* === Improve mobile nav spacing === */
@media (max-width: 560px) {
  .nav-links {
    gap: 12px;
    font-size: 13px;
  }
  .nav-links a {
    padding: 8px 0;
    display: inline-block;
  }
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
  .dark-mode-toggle {
    bottom: 16px;
    right: 72px;
    width: 44px;
    height: 44px;
  }
}

/* === Improve button tap targets on mobile === */
@media (max-width: 560px) {
  .button, button, .link-button, .related a, .cta-links .button {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .nav-links a {
    min-height: 44px;
  }
}

/* === Improve ranked-card layout on mobile === */
@media (max-width: 560px) {
  .ranked-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .rank {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  .ranked-card-image {
    height: 200px;
  }
}

/* === Pros/Cons mobile fix === */
@media (max-width: 560px) {
  .pros-cons {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* === Footer links mobile === */
@media (max-width: 560px) {
  .site-footer .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* === CTA strip mobile stack === */
@media (max-width: 560px) {
  .cta-strip {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cta-links {
    justify-content: center;
    flex-direction: column;
  }
}

