/* ===== VARIABLES ===== */
:root {
  /* Colors */
  --primary-color: #00F7DA;
  --secondary-color: #9B95C5;
  --bg-primary: #000000;
  --bg-secondary: #293038;
  --text-primary: #FFFFFF;
  --text-secondary: #B8B8B8;
  --text-tertiary: #808080;

  /* Typography */
  --body-font: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --heading-font: 'Space Grotesk', 'Noto Sans TC', sans-serif;
  --logo-font: 'Space Grotesk', 'Noto Sans TC', sans-serif;
  --h1-font-size: 3rem;
  --h2-font-size: 2rem;
  --h3-font-size: 1.5rem;
  --normal-font-size: 1.125rem;
  --small-font-size: 0.875rem;

  /* Font Weight */
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Spacing */
  --mb-0-5: 0.5rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;

  /* Z-index */
  --z-fixed: 100;
  --z-modal: 1000;

  /* Container */
  --container-width: 1200px;
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Skip to Content Link (無障礙性) */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #000;
  padding: 12px 24px;
  text-decoration: none;
  font-weight: var(--font-semibold);
  border-radius: 0 0 8px 0;
  z-index: calc(var(--z-modal) + 1);
  transition: top 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 247, 218, 0.5);
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
}

/* CSS 動畫效能優化: 啟用硬體加速 */
@media (prefers-reduced-motion: no-preference) {
  .nav__menu,
  .post-card,
  .category-card,
  .btn,
  .contact-method,
  .nav__logo {
    will-change: transform;
  }
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  letter-spacing: 0.3px;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--heading-font);
  font-weight: var(--font-bold);
  line-height: 1.2;
}

ul {
  list-style: none;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* 圖片載入優化 */
  content-visibility: auto;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
}

/* ===== REUSABLE CLASSES ===== */
.container {
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section__title {
  font-size: var(--h2-font-size);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--mb-3);
}

.section__title i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-family: var(--heading-font);
  font-weight: var(--font-semibold);
  transition: all 0.3s ease;
  font-size: 1rem;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--bg-primary);
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 247, 218, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(0, 247, 218, 0.6);
  transform: translateY(-2px);
  background: var(--primary-color);
  filter: brightness(1.1);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
  background: rgba(155, 149, 197, 0.1);
  box-shadow: 0 0 20px rgba(155, 149, 197, 0.2);
  border-color: var(--secondary-color);
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(41, 48, 56, 0.95);
  backdrop-filter: blur(10px);
  z-index: var(--z-fixed);
  box-shadow: 0 2px 20px rgba(0, 247, 218, 0.1);
}

.header.menu-open {
  z-index: 200;
}

.nav {
  height: 4.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: opacity 0.3s ease;
}

.nav__logo:hover {
  opacity: 0.8;
}

.nav__logo .logo-img {
  height: 45px;
  width: auto;
  max-width: 280px;
}

.nav__menu {
  display: flex;
  align-items: center;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* 提高選擇器優先級：使用 .nav__menu 或 .nav__list 作為父選擇器 */
.nav__menu .nav__link,
.nav__list .nav__link,
.nav__link {
  color: var(--text-primary);
  font-weight: var(--font-medium);
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
  font-size: 0.95rem;
}

.nav__menu .nav__link:hover,
.nav__list .nav__link:hover,
.nav__menu .nav__link.active,
.nav__list .nav__link.active,
.nav__link:hover,
.nav__link.active {
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(0, 247, 218, 0.5);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

.nav__link:hover::after {
  width: 100%;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 1rem 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown:hover .dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown__menu li {
  padding: 0.75rem 1.5rem;
  transition: background 0.3s ease;
}

.dropdown__menu li:hover {
  background-color: rgba(0, 247, 218, 0.1);
}

.dropdown__menu a {
  color: var(--text-secondary);
}

.dropdown__menu a:hover {
  color: var(--primary-color);
}

/* WordPress Menu Support - 支援 WordPress 預設選單結構 */
.nav__list .menu-item a,
.nav__menu .menu-item a {
  color: var(--text-primary);
  font-weight: var(--font-medium);
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
  font-size: 0.95rem;
  text-decoration: none;
}

.nav__list .menu-item a:hover,
.nav__list .menu-item.current-menu-item a,
.nav__menu .menu-item a:hover,
.nav__menu .menu-item.current-menu-item a {
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(0, 247, 218, 0.5);
}

.nav__search-btn {
  color: var(--text-primary);
  padding: 0.5rem;
  margin-left: 1rem;
  transition: all 0.3s ease;
}

.nav__search-btn:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  padding: 0.5rem;
}

.nav__toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 247, 218, 0.05) 0%, transparent 50%),
    url('../images/hero-bg.png') center/cover no-repeat,
    var(--bg-primary);
  padding-top: 4.5rem;
  overflow: hidden;
}

.hero__container {
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6) 100%);
  z-index: 1;
}

/* Pulse animation background */
.hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 247, 218, 0.15) 0%, rgba(155, 149, 197, 0.1) 30%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
  z-index: 0;
  border-radius: 50%;
}

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

.hero__icon {
  margin-bottom: var(--mb-2);
  position: relative;
}

/* SVG 容器浮動動畫 */
.hero__icon-svg {
  animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-15px) scale(1.02);
  }
}

/* 外層環 - 緩慢旋轉 + 脈衝 */
.ring-outer {
  animation: rotateClockwise 20s linear infinite, pulse 3s ease-in-out infinite;
  transform-origin: center;
}

/* 中層環 - 中速逆時針旋轉 */
.ring-middle {
  animation: rotateCounterClockwise 10s linear infinite;
  transform-origin: center;
}

/* 內層環 - 快速順時針旋轉 */
.ring-inner {
  animation: rotateClockwise 5s linear infinite;
  transform-origin: center;
}


/* 旋轉動畫 */
@keyframes rotateClockwise {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotateCounterClockwise {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}

/* 脈衝動畫 */
@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}


.hero__title {
  font-size: var(--h1-font-size);
  margin-bottom: var(--mb-1);
  background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--mb-2-5);
}

.hero__cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: -6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: var(--small-font-size);
  animation: bounce 2s infinite;
  z-index: 2;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

.hero__scroll svg {
  color: var(--primary-color);
}

/* ===== FEATURED POSTS ===== */
.featured {
  background-color: var(--bg-primary);
}

.featured__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.post-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(0, 247, 218, 0.1);
  position: relative;
}

/* Gradient border effect */
.post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.5s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 40px rgba(0, 247, 218, 0.2);
}

.post-card:hover::before {
  opacity: 0.6;
}

.post-card__image {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image zoom + gradient overlay */
.post-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 247, 218, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.post-card:hover .post-card__image img {
  transform: scale(1.1);
}

.post-card:hover .post-card__image::after {
  opacity: 1;
}

.post-card__category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--primary-color);
  color: var(--bg-primary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: var(--small-font-size);
  font-weight: var(--font-semibold);
}

.post-card__content {
  padding: 1.5rem;
}

.post-card__title {
  font-size: 1.25rem;
  margin-bottom: var(--mb-1);
  color: var(--text-primary);
}

.post-card__excerpt {
  color: var(--text-secondary);
  margin-bottom: var(--mb-1-5);
  line-height: 1.6;
}

.post-card__link {
  color: var(--primary-color);
  font-weight: var(--font-semibold);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s ease;
}

.post-card__link:hover {
  gap: 1rem;
}

/* ===== CATEGORIES ===== */
.categories {
  background-color: var(--bg-primary);
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background-color: var(--bg-secondary);
  padding: 2rem 1.5rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(0, 247, 218, 0.1);
  position: relative;
}

/* Gradient border effect */
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.5s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.category-card:hover {
  box-shadow: 0 0 30px rgba(0, 247, 218, 0.2);
  transform: translateY(-5px);
}

.category-card:hover::before {
  opacity: 0.6;
}

.category-card__icon {
  font-size: 3rem;
  margin-bottom: var(--mb-1);
  color: var(--primary-color);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-card:hover .category-card__icon {
  transform: rotate(360deg) scale(1.1);
}

.category-card__icon i {
  display: block;
}

.category-card__title {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--mb-0-5);
}

.category-card__desc {
  color: var(--text-secondary);
  font-size: var(--small-font-size);
  margin-bottom: var(--mb-1);
}

.category-card__count {
  color: var(--primary-color);
  font-size: var(--small-font-size);
  font-weight: var(--font-semibold);
}

/* ===== LATEST POSTS ===== */
.posts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
}

.post-item {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(0, 247, 218, 0.1);
  position: relative;
  /* Initial animation state - will be set by JS */
}

/* Gradient border effect */
.post-item::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.5s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.post-item:hover {
  box-shadow: 0 5px 20px rgba(0, 247, 218, 0.15);
}

.post-item:hover::before {
  opacity: 0.6;
}

.post-item__thumb {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.post-item__content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-item__title {
  font-size: 1.125rem;
  margin-bottom: var(--mb-0-5);
  color: var(--text-primary);
  line-height: 1.4;
}

.post-item__excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--mb-1);
  flex: 1;
}

.post-item__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: var(--small-font-size);
}

.post-item__category {
  background-color: rgba(0, 247, 218, 0.2);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: var(--font-medium);
}

.post-item__date,
.post-item__read-time {
  color: var(--text-tertiary);
}

/* ===== ABOUT SECTION ===== */
.about {
  background-color: var(--bg-secondary);
}

.about__container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: center;
}

.about__avatar {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about__avatar img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--primary-color);
  box-shadow:
    0 0 40px rgba(0, 247, 218, 0.3),
    0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  animation: avatarGlow 4s ease-in-out infinite;
}

@keyframes avatarGlow {
  0%, 100% {
    box-shadow:
      0 0 50px rgba(0, 247, 218, 0.4),
      0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
  }
  50% {
    box-shadow:
      0 0 80px rgba(0, 247, 218, 0.7),
      0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(155, 149, 197, 0.8);
  }
}

.about__avatar img:hover {
  box-shadow:
    0 0 80px rgba(0, 247, 218, 0.7),
    0 15px 40px rgba(0, 0, 0, 0.6);
  transform: scale(1.05);
  animation: none; /* Stop glow animation on hover */
}

.about__title {
  font-size: var(--h2-font-size);
  margin-bottom: var(--mb-1-5);
  color: var(--primary-color);
}

.about__text {
  color: var(--text-secondary);
  margin-bottom: var(--mb-1-5);
  line-height: 1.8;
}

/* ===== NEWSLETTER ===== */
.newsletter {
  background-color: var(--bg-primary);
}

.newsletter__container {
  background-color: var(--bg-secondary);
  border: 2px solid var(--primary-color);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 247, 218, 0.2);
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 40px rgba(0, 247, 218, 0.3);
    border-color: var(--primary-color);
  }
  50% {
    box-shadow: 0 0 80px rgba(0, 247, 218, 0.6);
    border-color: rgba(0, 247, 218, 0.8);
  }
}

.newsletter__title {
  font-size: var(--h2-font-size);
  margin-bottom: var(--mb-1);
}

.newsletter__subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--mb-2);
}

.newsletter__form {
  display: flex;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto var(--mb-2);
}

.newsletter__input {
  flex: 1;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  background-color: var(--bg-primary);
  border: 2px solid transparent;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.newsletter__input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 247, 218, 0.2);
}

.newsletter__input::placeholder {
  color: var(--text-tertiary);
}

.newsletter__features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: var(--small-font-size);
}

.newsletter__features i {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.newsletter__title i {
  margin-right: 0.5rem;
}

/* ===== FOOTER ===== */
.footer {
  background-color: #1A1A1A;
  padding: 3rem 0 1.5rem;
}

.footer__container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: var(--mb-2);
}

.footer__logo {
  display: flex;
  align-items: center;
  margin-bottom: var(--mb-1);
  max-width: 100%;
}

.footer__logo .footer-logo-img {
  height: 50px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.footer__desc {
  color: var(--text-secondary);
  font-size: var(--small-font-size);
  line-height: 1.6;
}

.footer__title {
  color: var(--text-primary);
  font-size: 1.125rem;
  margin-bottom: var(--mb-1);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__links a {
  color: var(--text-secondary);
  font-size: var(--small-font-size);
  transition: color 0.3s ease;
}

.footer__links a:hover {
  color: var(--primary-color);
}

.footer__social {
  display: flex;
  gap: 1rem;
}

.footer__social a {
  color: var(--text-secondary);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
}

.footer__social a:hover {
  color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 247, 218, 0.3);
}

/* 訂閱電子報按鈕 */
.footer__newsletter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--bg-primary);
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 247, 218, 0.3);
}

.footer__newsletter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 247, 218, 0.5);
}

.footer__newsletter-btn i {
  font-size: 1.125rem;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-tertiary);
  font-size: var(--small-font-size);
}

.footer__copyright {
  margin: 0;
}

.footer__legal {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer__legal a {
  color: var(--text-tertiary);
  transition: color 0.3s ease;
}

.footer__legal a:hover {
  color: var(--primary-color);
}

.footer__legal span {
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 1024px) {
  :root {
    --h1-font-size: 2.5rem;
    --h2-font-size: 1.75rem;
    --h3-font-size: 1.25rem;
  }

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

/* 中等螢幕尺寸 - 修正 footer logo 重疊問題 */
@media screen and (max-width: 900px) {
  .footer__container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .footer__logo .footer-logo-img {
    height: 45px;
    max-width: 100%;
  }
}

@media screen and (max-width: 768px) {
  :root {
    --h1-font-size: 2rem;
    --h2-font-size: 1.5rem;
    --normal-font-size: 1rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .nav__logo .logo-img {
    height: 32px;
    max-width: 200px;
  }

  .nav__menu {
    position: fixed;
    top: 4.5rem;
    left: -100%;
    width: 100%;
    background-color: rgba(41, 48, 56, 0.98);
    padding: 2rem 1.5rem;
    transition: left 0.3s ease;
    z-index: 200;
  }

  .nav__menu.show {
    left: 0;
  }

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

  .nav__toggle {
    display: flex;
  }

  .dropdown__menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
    display: none;
  }

  .dropdown.active .dropdown__menu {
    display: block;
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .about__container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about__avatar img {
    width: 250px;
    height: 250px;
  }

  .newsletter__form {
    flex-direction: column;
  }

  .post-item {
    flex-direction: column;
  }

  .post-item__thumb {
    width: 100%;
    height: 200px;
  }

  .featured__grid,
  .categories__grid {
    grid-template-columns: 1fr;
  }

  .footer__container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer__logo .footer-logo-img {
    height: 40px;
    max-width: 250px;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .hero__cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* ===== LEGAL PAGES (PRIVACY & TERMS) ===== */
.legal-page {
  padding: 3rem 0 5rem;
  background: var(--bg-primary);
}

.legal-content {
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.02);
  padding: 3rem 4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-section h2 {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1.25rem;
  font-weight: var(--font-semi-bold);
  letter-spacing: -0.02em;
}

.legal-section p {
  color: rgba(255, 255, 255, 0.75);
  line-height: 2;
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

.legal-section ul {
  list-style: none;
  margin-left: 0;
  margin-bottom: 1.25rem;
}

.legal-section ul li {
  color: rgba(255, 255, 255, 0.75);
  line-height: 2;
  margin-bottom: 1rem;
  padding-left: 2rem;
  position: relative;
  font-size: 1rem;
}

.legal-section ul li::before {
  content: '•';
  color: rgba(255, 255, 255, 0.4);
  font-weight: normal;
  position: absolute;
  left: 0.5rem;
  font-size: 1.2rem;
}

.legal-section a {
  color: rgba(155, 149, 197, 1);
  text-decoration: none;
  border-bottom: 1px solid rgba(155, 149, 197, 0.3);
  transition: all 0.3s ease;
  padding-bottom: 1px;
}

.legal-section a:hover {
  color: rgba(155, 149, 197, 1);
  border-bottom-color: rgba(155, 149, 197, 0.8);
}

.legal-section strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: var(--font-semi-bold);
}

/* Page Header for Legal Pages */
.legal-page .page-header {
  padding: 3rem 0 2rem;
}

.legal-page .page-header__title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.95);
}

.legal-page .page-header__intro {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.6);
  max-width: 700px;
  margin: 0 auto;
}

@media screen and (max-width: 968px) {
  .legal-content {
    padding: 2.5rem 3rem;
  }
}

@media screen and (max-width: 768px) {
  .legal-content {
    padding: 2rem 1.5rem;
    margin: 0 1rem;
  }

  .legal-section h2 {
    font-size: 1.35rem;
  }

  .legal-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
  }

  .legal-page .page-header__title {
    font-size: 2rem;
  }

  .legal-section ul li {
    padding-left: 1.5rem;
  }
}
