:root {
  --color-brand: #2f73ff;
  --color-brand-dark: #1f4fba;
  --color-brand-light: #e7f0ff;
  --color-surface: #ffffff;
  --color-page: #f5f7fb;
  --color-page-soft: #f7f8fc;
  --color-text: #1f2933;
  --color-muted: #4f5d75;
  --color-border: rgba(31, 83, 173, 0.12);
  --color-shadow: rgba(31, 83, 173, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --container-width: min(1100px, 92vw);
  --font-display: "Work Sans", "Noto Sans TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: var(--font-display);
  --hero-gradient-start: var(--color-brand);
  --hero-gradient-end: var(--color-brand-dark);
  --accent-soft: var(--color-brand-light);
  --transition-theme: 0.35s;
}

html {
  background: var(--color-page);
  color: var(--color-text);
  transition: background-color var(--transition-theme) ease, color var(--transition-theme) ease;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  margin: 0;
  background: var(--color-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--transition-theme) ease, color var(--transition-theme) ease;
}

html.theme-light,
body.theme-light {
  --color-surface: #ffffff;
  --color-page: #f5f7fb;
  --color-page-soft: #f7f8fc;
  --color-text: #1f2933;
  --color-muted: #4f5d75;
  --color-border: rgba(31, 83, 173, 0.12);
  --color-shadow: rgba(31, 83, 173, 0.08);
  --color-brand-light: #e7f0ff;
  --accent-soft: var(--color-brand-light);
}

html.theme-dark,
body.theme-dark {
  --color-surface: #13203b;
  --color-page: #0b1220;
  --color-page-soft: #0f172a;
  --color-text: #e2e8f0;
  --color-muted: #94a3b8;
  --color-border: rgba(148, 163, 184, 0.24);
  --color-shadow: rgba(5, 10, 30, 0.6);
  --color-brand-light: rgba(63, 122, 224, 0.18);
  --accent-soft: rgba(148, 163, 184, 0.18);
  color: var(--color-text);
  background: var(--color-page);
}

a {
  color: inherit;
}

a:not([class]) {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.layout-container {
  width: var(--container-width);
  margin: 0 auto;
}

.hero {
  position: relative;
  color: #fff;
  background: var(--hero-gradient-start);
  padding: calc(var(--space-xl) + 50px) 0 var(--space-xl);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: grid;
  gap: var(--space-md);
  justify-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.badge-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.98);
  letter-spacing: 0.01em;
}

.section {
  padding: var(--space-xl) 0;
  position: relative;
}

.section:first-of-type {
  margin-top: -30px;
  padding-top: calc(var(--space-xl) + 30px);
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(63, 122, 224, 0.2) 20%, rgba(63, 122, 224, 0.4) 50%, rgba(63, 122, 224, 0.2) 80%, transparent 100%);
}

.section:first-child::before {
  display: none;
}

/* 主題特定的分隔線顏色 */
.theme-senior .section::before {
  background: linear-gradient(90deg, transparent 0%, rgba(38, 166, 154, 0.2) 20%, rgba(38, 166, 154, 0.4) 50%, rgba(38, 166, 154, 0.2) 80%, transparent 100%);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-description {
  max-width: 700px;
  margin: var(--space-xs) auto 0;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.card-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ========================================
   統一卡片微動畫系統
   ======================================== */

/* 基礎卡片樣式 - 所有卡片都應該繼承這個類 */
.card-base {
  position: relative;
  overflow: visible;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  cursor: pointer;
}

/* 確保特定卡片類型使用統一的動畫 */
.curriculum-card.card-base,
.portal-card.card-base,
.revise-card.card-base,
.info-card.card-base {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* 統一的卡片 hover 微動畫效果 */
.card-base:hover {
  transform: translateY(-12px) scale(1.03) !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2) !important;
  border-color: var(--hero-gradient-start) !important;
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(255, 255, 255, 0.1) 100%) !important;
}

/* 卡片標題的微動畫 */
.card-base:hover .card-title,
.card-base:hover h3 {
  color: var(--hero-gradient-start);
  transition: color 0.3s ease;
}

/* 卡片內容的微動畫 */
.card-base:hover .card-eyebrow {
  transform: translateX(2px);
  transition: transform 0.3s ease;
}

/* 深色模式下的卡片 hover 效果 */
body.theme-dark .card-base:hover {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5) !important;
  border-color: var(--hero-gradient-start) !important;
}

/* ========================================
   原有卡片樣式（保持向後兼容）
   ======================================== */

.info-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 30px 60px var(--color-shadow);
  border: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-sm);
  position: relative;
  overflow: visible;
}



.card-eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.card-description {
  color: var(--color-muted);
  margin: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.button {
  background: linear-gradient(135deg, var(--hero-gradient-start), var(--hero-gradient-end));
  color: #fff;
  box-shadow: 0 18px 40px rgba(31, 83, 173, 0.25);
}

.button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 24px 55px rgba(31, 83, 173, 0.35);
  background: linear-gradient(135deg, var(--hero-gradient-end), var(--hero-gradient-start));
}

.button:hover::before {
  left: 100%;
}

.button:active {
  transform: translateY(-1px) scale(1.02);
  transition: all 0.1s ease;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--hero-gradient-start);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.button-secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 1);
}

.pill-list {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--hero-gradient-start);
  font-weight: 600;
  font-size: 0.95rem;
}

.tablet-stack {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.feature-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-weight: 500;
  color: var(--color-muted);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--color-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.testimonial {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 24px 50px rgba(17, 24, 39, 0.08);
  border: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-sm);
}

.testimonial strong {
  font-size: 1.1rem;
}

.footer {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(63, 122, 224, 0.05) 30%, rgba(63, 122, 224, 0.1) 70%, var(--color-surface) 100%);
  color: var(--color-text);
  padding: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(63, 122, 224, 0.1);
}

/* 主題特定的 footer 配色 */
.theme-senior .footer {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(38, 166, 154, 0.05) 30%, rgba(38, 166, 154, 0.1) 70%, var(--color-surface) 100%);
  border-top: 1px solid rgba(38, 166, 154, 0.1);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 20%, rgba(255, 255, 255, 0.08) 50%, transparent 80%);
  animation: footerShimmer 6s ease-in-out infinite;
}

@keyframes footerShimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.footer-content {
  width: var(--container-width);
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-copyright {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  color: var(--color-text);
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 400;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.4s forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-junior {
  --hero-gradient-start: #ff8c42;
  --hero-gradient-end: #e67e22;
  --accent-soft: rgba(255, 140, 66, 0.12);
}

.theme-senior {
  --hero-gradient-start: #26a69a;
  --hero-gradient-end: #006c67;
  --accent-soft: rgba(38, 166, 154, 0.12);
}

.theme-portal {
  --hero-gradient-start: #5c6ac4;
  --hero-gradient-end: #3a4ba3;
  --accent-soft: rgba(92, 106, 196, 0.12);
}

body.theme-dark.theme-junior {
  --hero-gradient-start: #ff9f6b;
  --hero-gradient-end: #e67e22;
  --accent-soft: rgba(255, 140, 66, 0.15);
  --color-brand-light: rgba(255, 140, 66, 0.15);
}

body.theme-dark.theme-senior {
  --hero-gradient-start: #1f8a81;
  --hero-gradient-end: #0e4f4b;
  --accent-soft: rgba(38, 166, 154, 0.22);
  --color-brand-light: rgba(38, 166, 154, 0.24);
}

body.theme-dark.theme-portal {
  --hero-gradient-start: #4a57b9;
  --hero-gradient-end: #2c368f;
  --accent-soft: rgba(92, 106, 196, 0.22);
  --color-brand-light: rgba(92, 106, 196, 0.24);
}

@media (max-width: 768px) {
  body {
    background: var(--color-page-soft);
  }

  .hero {
    padding-top: calc(var(--space-xl) + 30px);
  }

  .info-card {
    padding: var(--space-md);
  }

  .button,
  .button-secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

[data-reveal].is-ready {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.theme-dark .hero-subtitle {
  color: rgba(226, 232, 240, 0.82);
}

body.theme-dark .section-description {
  color: var(--color-muted);
}

body.theme-dark .section::before {
  background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.16) 25%, rgba(148, 163, 184, 0.24) 50%, rgba(148, 163, 184, 0.16) 75%, transparent 100%);
}

body.theme-dark.theme-senior .section::before {
  background: linear-gradient(90deg, transparent 0%, rgba(38, 166, 154, 0.22) 25%, rgba(38, 166, 154, 0.45) 50%, rgba(38, 166, 154, 0.22) 75%, transparent 100%);
}

body.theme-dark.theme-junior .section::before {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 140, 66, 0.18) 25%, rgba(255, 140, 66, 0.28) 50%, rgba(255, 140, 66, 0.18) 75%, transparent 100%);
}

body.theme-dark.theme-portal .section::before {
  background: linear-gradient(90deg, transparent 0%, rgba(92, 106, 196, 0.24) 25%, rgba(92, 106, 196, 0.45) 50%, rgba(92, 106, 196, 0.24) 75%, transparent 100%);
}



body.theme-dark .button {
  box-shadow: 0 24px 52px rgba(5, 10, 30, 0.65);
}

body.theme-dark .button:hover {
  box-shadow: 0 28px 60px rgba(5, 10, 30, 0.72);
}

body.theme-dark .button-secondary {
  background: rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

body.theme-dark .button-secondary:hover {
  background: rgba(148, 163, 184, 0.28);
}

body.theme-dark .pill {
  color: var(--hero-gradient-start);
}

body.theme-dark .feature-icon {
  background: rgba(148, 163, 184, 0.18);
  color: #f8fafc;
}

body.theme-dark .testimonial {
  box-shadow: 0 24px 50px rgba(5, 10, 30, 0.6);
}

body.theme-dark .footer {
  background: linear-gradient(135deg, rgba(19, 32, 59, 0.9) 0%, rgba(38, 63, 110, 0.6) 60%, rgba(19, 32, 59, 0.9) 100%);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

body.theme-dark.theme-senior .footer {
  background: linear-gradient(135deg, rgba(12, 40, 38, 0.9) 0%, rgba(19, 75, 70, 0.65) 60%, rgba(12, 40, 38, 0.9) 100%);
  border-top: 1px solid rgba(38, 166, 154, 0.3);
}

body.theme-dark.theme-junior .footer {
  background: linear-gradient(135deg, rgba(40, 20, 12, 0.7) 0%, rgba(75, 35, 19, 0.4) 60%, rgba(40, 20, 12, 0.7) 100%);
  border-top: 1px solid rgba(255, 140, 66, 0.2);
}

body.theme-dark .footer::before {
  background: linear-gradient(45deg, transparent 20%, rgba(148, 163, 184, 0.08) 50%, transparent 80%);
}

body.theme-dark .footer-tagline {
  color: rgba(226, 232, 240, 0.7);
}

.hero-top-actions {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
}

.hero-link-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero-link-back svg {
  width: 1.2rem;
  height: 1.2rem;
  transition: transform 0.3s ease;
}


.hero-link-back:hover svg {
  transform: scale(1.08);
}

.hero-link-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.hero-link-back:focus-visible {
  outline: 3px solid rgba(113, 169, 250, 0.8);
  outline-offset: 3px;
}

body.theme-dark .hero-link-back {
  background: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 6px 20px rgba(5, 10, 30, 0.6);
}

body.theme-dark .hero-link-back:hover {
  background: rgba(148, 163, 184, 0.32);
  border-color: rgba(226, 232, 240, 0.5);
  box-shadow: 0 8px 24px rgba(5, 10, 30, 0.72);
}

.hero-top-actions--right {
  left: auto;
  right: 1.5rem;
}

@media (max-width: 720px) {
  .hero-top-actions,
  .hero-top-actions--right {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    justify-content: flex-start;
    gap: 0.6rem;
    flex-wrap: wrap;
  }

  .hero-top-actions--right {
    justify-content: flex-end;
  }

  .hero-link-back {
    width: 2.2rem;
    height: 2.2rem;
  }

  .hero-link-back svg {
    width: 1.1rem;
    height: 1.1rem;
  }
}

