:root {
  color-scheme: light;
  --bg: #fff8ed;
  --surface: #fffdf8;
  --surface-muted: #fff1dc;
  --text: #051f4f;
  --muted: #4d5c77;
  --line: #eadcc8;
  --navy: #001f55;
  --navy-strong: #001641;
  --orange: #f06a00;
  --orange-strong: #d94d00;
  --green: #008b5b;
  --green-strong: #006f49;
  --green-soft: #e3f5ec;
  --reference-green: #66b873;
  --reference-yellow: #ffe51f;
  --accent: var(--orange);
  --accent-strong: var(--orange-strong);
  --accent-soft: #ffe6c9;
  --warning: #f06a00;
  --shadow: 0 18px 45px rgba(0, 31, 85, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(240, 106, 0, 0.1), transparent 28%),
    linear-gradient(180deg, #fffaf2 0%, #fff4e2 55%, #fff8ed 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(234, 220, 200, 0.9);
  background: rgba(255, 250, 242, 0.92);
  backdrop-filter: blur(16px);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.language-switcher select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0 34px 0 12px;
}

.language-switcher select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(240, 106, 0, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--reference-green);
  color: var(--reference-yellow);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  border-radius: 8px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  padding: 10px 12px;
}

.top-nav a:hover {
  background: var(--accent-soft);
  color: var(--orange-strong);
}

main {
  padding: 0 clamp(18px, 5vw, 72px) 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 132px);
  margin: 28px calc(clamp(18px, 5vw, 72px) * -1) 28px;
  padding: clamp(42px, 7vw, 86px) clamp(18px, 5vw, 72px);
  background:
    radial-gradient(circle at 82% 18%, rgba(0, 139, 91, 0.18), transparent 28%),
    linear-gradient(135deg, var(--navy-strong), var(--navy) 58%, #00306d);
  color: #ffffff;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 670px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  font-weight: 800;
  padding: 0 18px;
}

.primary-button {
  background: var(--reference-green);
  color: var(--reference-yellow);
  box-shadow: 0 10px 24px rgba(0, 139, 91, 0.24);
}

.primary-button:hover {
  background: var(--green-strong);
  color: var(--reference-yellow);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--navy);
}

.secondary-button:hover {
  border-color: var(--orange);
  background: var(--accent-soft);
  color: var(--orange-strong);
}

.hero .secondary-button {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.hero .secondary-button:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.hero-visual {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  border: 4px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  display: block;
}

.ad-band {
  margin-bottom: 22px;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 110px;
  border: 1px dashed rgba(240, 106, 0, 0.55);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 106, 0, 0.1), rgba(0, 139, 91, 0.12)),
    #fffdf8;
  color: var(--orange-strong);
  text-align: center;
  padding: 18px;
}

.ad-slot span,
.ad-slot small {
  display: block;
}

.ad-slot span {
  font-weight: 800;
}

.ad-slot small {
  margin-top: 6px;
  color: var(--muted);
}

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 0 18px;
}

.keyword-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fffdf8, #fff0d8);
  padding: 18px;
}

.keyword-panel h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  padding: 0 12px;
}

.category-pill {
  min-width: max-content;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
  padding: 0 16px;
}

.category-pill:hover,
.category-pill.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.guide-section,
.task-section,
.faq-section {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 10px 28px rgba(0, 31, 85, 0.05);
}

.guide-section .section-heading,
.task-section .section-heading,
.faq-section .section-heading {
  align-items: start;
}

.guide-section .section-heading > p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.guide-grid,
.task-list {
  display: grid;
  gap: 12px;
}

.guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-card,
.task-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 18px;
}

.guide-card h3,
.task-list h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.guide-card p,
.task-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.tool-panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 31, 85, 0.06);
}

.tool-panel {
  padding: clamp(18px, 3vw, 28px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2,
.side-panel h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.search-field {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--text);
  padding: 0 14px;
}

.search-field input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(240, 106, 0, 0.18);
}

.tool-grid {
  display: grid;
  gap: 12px;
}

.tool-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 16px;
}

.tool-card:hover {
  border-color: rgba(240, 106, 0, 0.5);
  box-shadow: 0 10px 30px rgba(0, 31, 85, 0.1);
}

.tool-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--reference-green);
  color: var(--reference-yellow);
  font-weight: 900;
  font-size: 14px;
}

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: 0;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tool-card > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-strong);
  font-weight: 800;
}

.tool-card > a:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

.ad-card {
  grid-template-columns: 1fr;
  padding: 0;
  overflow: hidden;
}

.ad-slot-card {
  min-height: 132px;
  border: 0;
  border-radius: 0;
}

.sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}

.side-panel {
  padding: 18px;
}

.side-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-list button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf2;
  color: var(--navy);
  cursor: pointer;
  padding: 0 12px;
}

.tag-list button:hover {
  border-color: var(--orange);
  color: var(--orange-strong);
}

.ad-slot-sidebar {
  min-height: 280px;
}

.full-width {
  width: 100%;
}

.adsense-readiness {
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff1dc);
  padding: clamp(18px, 3vw, 28px);
}

.faq-section {
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 16px 18px;
}

.faq-list summary {
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.adsense-readiness .section-heading {
  align-items: start;
}

.adsense-readiness .section-heading > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.policy-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 18px;
}

.policy-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: 0;
}

.policy-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.policy-card a {
  display: inline-flex;
  margin-top: 12px;
  color: var(--green-strong);
  font-weight: 800;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px clamp(18px, 5vw, 72px) 38px;
  background: var(--green);
  color: #ffffff;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.is-hidden {
  display: none;
}

@media (max-width: 980px) {
  .hero,
  .content-grid,
  .keyword-panel {
    grid-template-columns: 1fr;
  }

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

  .guide-grid,
  .task-list {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
  }

  .language-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .language-switcher select {
    min-width: 170px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .policy-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .tool-card > a {
    grid-column: 1 / -1;
    width: 100%;
  }

  .tool-icon {
    width: 48px;
    height: 48px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ══════════════════════════════════════════════
   AdSense Optimization: Cookie Banner
   ══════════════════════════════════════════════ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: var(--navy-strong);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.22);
  transition: transform 0.35s ease;
}

.cookie-banner.is-hidden {
  display: none;
}

.cookie-banner p {
  margin: 0;
  max-width: 680px;
  color: rgba(255,255,255,0.88);
}

.cookie-banner a {
  color: #ffb266;
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-actions .primary-button {
  min-height: 40px;
  font-size: 14px;
  padding: 0 16px;
}

.cookie-actions .secondary-button {
  min-height: 40px;
  font-size: 14px;
  padding: 0 16px;
  border-color: rgba(255,255,255,0.35);
  background: transparent;
  color: rgba(255,255,255,0.88);
}

.cookie-actions .secondary-button:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}

/* ══════════════════════════════════════════════
   AdSense Optimization: Ad Slot Presentation
   - Placeholder styling (removed after AdSense active)
   - aria-label="Advertisement" marks all ad zones
   ══════════════════════════════════════════════ */
.ad-placeholder-label {
  display: block;
  font-weight: 800;
  color: var(--muted);
  font-size: 13px;
}

.ad-placeholder-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.7;
}

/* Override: when AdSense is active, the <ins> takes full width */
.ad-slot ins.adsbygoogle {
  display: block;
  min-height: 90px;
  width: 100%;
}

/* Sidebar ad slot height matches standard 300×250 */
.ad-slot-sidebar {
  min-height: 260px;
}

/* In-list ad card matches tool card height */
.ad-slot-card {
  min-height: 132px;
}
