@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

:root {
  --green: #059669;
  --green-light: #ecfdf5;
  --green-dark: #065f46;
  --green-bg: #d1fae5;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --orange-dark: #c2410c;
  --orange-bg: #fed7aa;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange); }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.stagger-children > .reveal,
.stagger-children > * > .reveal {
  transition-delay: calc(var(--i, 0) * 0.12s);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-scale, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Header ===== */
.header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--green);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-svg {
  width: 28px;
  height: 28px;
  color: var(--orange);
  transition: transform var(--transition);
}
.logo:hover .logo-svg { transform: scale(1.1) rotate(-8deg); }
.logo span { color: var(--orange); }
.nav { display: flex; gap: 32px; }
.nav a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--green);
  transition: width var(--transition);
  border-radius: 1px;
}
.nav a:hover::after,
.nav a.nav-active::after { width: 100%; }
.nav a:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; transition: transform var(--transition); }
.nav-toggle:hover { transform: scale(1.1); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--green-light) 0%, var(--orange-light) 100%);
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(5,150,105,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(234,88,12,0.1) 0%, transparent 50%);
  animation: pulseGlow 4s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(5,150,105,0.06) 0%, transparent 60%);
  animation: pulseGlow 6s ease-in-out infinite 1s;
}
.hero .container { position: relative; z-index: 1; }
.hero-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.65);
  border-radius: 50%;
  padding: 20px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 20px rgba(5,150,105,0.1);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: float 4s ease-in-out infinite;
}
.hero-icon:hover {
  transform: scale(1.05) rotate(4deg);
  box-shadow: 0 6px 30px rgba(5,150,105,0.2);
  animation: none;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--green-dark);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.hero-tagline {
  font-size: 1.15rem;
  color: var(--orange-dark);
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero-tagline svg { width: 20px; height: 20px; }
.hero p {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ===== Sections ===== */
.section { padding: 80px 0; }
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
}
.section-title span { color: var(--green); }
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 48px;
  font-size: 1.05rem;
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  border: 1px solid var(--border);
  display: block;
  color: inherit;
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--green), var(--orange));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
  color: inherit;
}
.card:hover::before { opacity: 1; }
.card-body { padding: 28px; }
.card-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 10px;
  padding: 9px;
  transition: transform var(--transition);
}
.card:hover .card-icon { transform: scale(1.1) rotate(-4deg); }
.card-icon-green { color: var(--green); background: var(--green-light); }
.card-icon-orange { color: var(--orange); background: var(--orange-light); }
.card-icon-blue { color: #2563eb; background: #eff6ff; }
.card-category {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  color: var(--orange);
  background: var(--orange-light);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.4;
}
.card p {
  color: var(--text-light);
  font-size: .92rem;
  line-height: 1.7;
}
.card-meta {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-meta svg { width: 14px; height: 14px; }

/* ===== Categories ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.category-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.category-card:hover::before { transform: scaleX(1); }
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.category-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--green);
  background: var(--green-light);
  border-radius: 14px;
  padding: 12px;
  transition: transform var(--transition);
}
.category-card:hover .category-icon { transform: scale(1.1) rotate(-6deg); }
.category-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.category-card p { color: var(--text-light); font-size: .9rem; line-height: 1.7; }

/* ===== Footer ===== */
.footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 32px 0;
  font-size: .9rem;
}
.footer a { color: rgba(255,255,255,0.9); }
.footer a:hover { color: var(--orange-bg); }

/* ===== Article Page ===== */
.article-hero {
  background: linear-gradient(135deg, var(--green-light) 0%, var(--orange-light) 100%);
  padding: 56px 0 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(234,88,12,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(5,150,105,0.06) 0%, transparent 50%);
}
.article-hero .container { position: relative; z-index: 1; }
.article-hero-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  color: var(--green);
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  padding: 13px;
  backdrop-filter: blur(4px);
  transition: transform var(--transition);
}
.article-hero-icon:hover { transform: scale(1.08) rotate(4deg); }
.article-hero h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--green-dark);
  margin-bottom: 8px;
}
.article-hero p {
  color: var(--text-light);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.article-wrapper {
  display: flex;
  gap: 40px;
  padding: 40px 0;
}
.article-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 88px;
  align-self: start;
}
.article-sidebar .toc {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  font-size: .88rem;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.article-sidebar .toc:hover { box-shadow: var(--shadow-hover); }
.article-sidebar .toc h4 {
  font-size: .9rem;
  margin-bottom: 12px;
  color: var(--green);
  font-weight: 700;
}
.article-sidebar .toc a {
  display: block;
  color: var(--text-light);
  padding: 5px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all var(--transition);
  font-size: .85rem;
  line-height: 1.5;
}
.article-sidebar .toc a:hover,
.article-sidebar .toc a.active {
  color: var(--green);
  border-left-color: var(--green);
  padding-left: 16px;
}
.article-content {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 52px;
  border: 1px solid var(--border);
  font-size: 18px;
  line-height: 1.8;
}
.article-content h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--green-dark);
  margin: 44px 0 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--green-bg);
  position: relative;
}
.article-content h2::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--orange));
  border-radius: 2px;
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 30px 0 12px;
}
.article-content p {
  margin-bottom: 18px;
  color: var(--text);
}
.article-content ul, .article-content ol {
  margin: 0 0 22px 24px;
}
.article-content li { margin-bottom: 10px; line-height: 1.8; }
.article-content strong { color: var(--text); font-weight: 700; }

.article-content blockquote {
  border-left: 4px solid var(--green);
  background: var(--green-light);
  padding: 18px 22px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
  color: var(--text);
  font-style: normal;
  transition: background var(--transition), border-color var(--transition);
}
.article-content blockquote:hover {
  background: #d1fae5;
  border-left-color: var(--orange);
}
.article-content blockquote p { margin-bottom: 0; }

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: .92rem;
  border-radius: 8px;
  overflow: hidden;
}
.article-content th {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: .9rem;
}
.article-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  line-height: 1.7;
}
.article-content tbody tr:nth-child(even) td { background: var(--green-light); }
.article-content tbody tr:hover td { background: #f0fdf4; }

.article-content .faq-item {
  margin-bottom: 20px;
  padding: 18px 20px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid var(--orange);
  transition: background var(--transition), border-color var(--transition);
}
.article-content .faq-item:hover {
  background: var(--orange-light);
  border-left-color: var(--orange-dark);
}
.article-content .faq-item strong {
  display: block;
  color: var(--green-dark);
  margin-bottom: 6px;
  font-size: 1rem;
}
.article-content .faq-item p { margin-bottom: 0; }

.disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: var(--orange-light);
  border-left: 4px solid var(--orange);
  border-radius: 0 8px 8px 0;
  margin-bottom: 24px;
  font-size: .88rem;
  color: var(--orange-dark);
  line-height: 1.6;
}
.disclaimer svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--orange);
}
.disclaimer p { margin-bottom: 0; font-size: .88rem; color: var(--orange-dark); }

.ad-slot {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  margin: 32px 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.related { margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--border); }
.related h3 { font-size: 1.15rem; margin-bottom: 16px; color: var(--text); }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  transition: all var(--transition);
  display: block;
  color: inherit;
}
.related-card:hover {
  border-color: var(--green);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
}
.related-card h4 { font-size: .95rem; margin-bottom: 4px; color: var(--text); }
.related-card span { font-size: .8rem; color: var(--text-light); }

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
  z-index: 99;
  box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}
.back-to-top svg { width: 20px; height: 20px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: rgba(255,255,255,0.98); backdrop-filter: blur(8px); padding: 16px 24px; border-bottom: 1px solid var(--border); gap: 16px; }
  .nav-toggle { display: block; }

  .hero { padding: 60px 0 50px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }

  .section { padding: 48px 0; }
  .section-title { font-size: 1.45rem; }

  .article-hero { padding: 40px 0 32px; }
  .article-hero h1 { font-size: 1.5rem; }
  .article-wrapper { flex-direction: column; }
  .article-sidebar { width: 100%; position: static; }
  .article-content { padding: 24px; font-size: 16px; }

  .category-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }

  .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
}
