/* ============================================================================
   小模王 共用樣式表
   ============================================================================ */

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

:root {
  --bg-cream: #FAF6EE;
  --bg-cream-soft: #F5F0E5;
  --ink-dark: #2A2520;
  --ink-medium: #5A5550;
  --ink-soft: #8B8580;
  --accent: #F5B800;
  --accent-deep: #D49B00;
  --penguin-gray: #8B92A0;
  --penguin-dark: #3A3A40;
  --penguin-soft: #C8CDD5;
  --lan-blue: #C5DDED;
  --lan-blue-dark: #5B86A6;
  --card: #FFFFFF;
  --border: #E8E2D5;
  --error: #D9534F;
  --success: #5CB85C;
  --shadow-soft: 0 2px 12px rgba(42, 37, 32, 0.04);
  --shadow-hover: 0 12px 32px rgba(42, 37, 32, 0.08);
  --shadow-strong: 0 16px 40px rgba(42, 37, 32, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg-cream);
  color: var(--ink-dark);
  line-height: 1.7;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(245, 184, 0, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139, 146, 160, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
}

/* ─── HEADER ─────────────────────────────── */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 238, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--ink-dark);
}
.brand-mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(42, 37, 32, 0.08));
}
@media (min-width: 768px) {
  .brand-mark { width: 72px; height: 72px; }
}
.brand-name {
  font-family: 'Noto Serif TC', serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}
nav.desktop-nav {
  display: none;
  gap: 2rem;
  align-items: center;
}
nav.desktop-nav > a, nav.desktop-nav .dropdown-trigger {
  color: var(--ink-medium);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
nav.desktop-nav > a:hover, nav.desktop-nav .dropdown-trigger:hover { color: var(--ink-dark); }

/* Dropdown */
.nav-dropdown { position: relative; padding: 0.5rem 0; }
.dropdown-arrow { font-size: 0.7em; transition: transform 0.25s; opacity: 0.6; }
.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.65rem;
  min-width: 160px;
  box-shadow: 0 16px 40px rgba(42, 37, 32, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, transform 0.25s;
  transform: translateX(-50%) translateY(-6px);
  pointer-events: none;
  z-index: 60;
}
.nav-dropdown:hover .dropdown-menu, .nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.dropdown-menu a {
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--ink-medium);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  font-weight: 500;
}
.dropdown-menu a:hover {
  background: var(--bg-cream-soft);
  color: var(--accent-deep);
}
.dropdown-menu a.featured {
  color: var(--ink-dark);
  font-weight: 600;
  position: relative;
}
.dropdown-menu a.featured::after {
  content: '熱門';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--accent-deep);
  background: rgba(245, 184, 0, 0.15);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}
.header-cta {
  background: var(--ink-dark);
  color: var(--bg-cream);
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.header-cta:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}
@media (min-width: 768px) {
  nav.desktop-nav { display: flex; }
}

/* ─── BREADCRUMB ─────────────────────────── */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 1.5rem 0;
}
.breadcrumb a {
  color: var(--ink-medium);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent-deep); }
.breadcrumb .sep { margin: 0 0.5rem; opacity: 0.5; }
.breadcrumb .current { color: var(--ink-dark); font-weight: 500; }

/* ─── BUTTONS ─────────────────────────────── */
.btn-primary {
  background: var(--ink-dark);
  color: var(--bg-cream);
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 155, 0, 0.25);
}
.btn-secondary {
  background: transparent;
  color: var(--ink-dark);
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--ink-dark);
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-secondary:hover {
  background: var(--ink-dark);
  color: var(--bg-cream);
}
.btn-yellow {
  background: var(--accent);
  color: var(--ink-dark);
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(245, 184, 0, 0.3);
}
.btn-yellow:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 155, 0, 0.4);
}
.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* ─── SECTION ─────────────────────────────── */
section { padding: 4rem 0; }
.section-header { margin-bottom: 2.5rem; }
.section-eyebrow {
  font-family: 'Klee One', cursive;
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.section-eyebrow::before { content: '— '; }
.section-title {
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.3;
  color: var(--ink-dark);
}

/* Yellow underline highlight */
.highlight {
  position: relative;
  display: inline-block;
  z-index: 1;
}
.highlight::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: -4px;
  right: -4px;
  height: 14px;
  background: var(--accent);
  opacity: 0.45;
  z-index: -1;
  border-radius: 4px;
  transform: skewX(-3deg);
}

/* ─── CARDS ─────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s;
}
.card-link {
  text-decoration: none;
  color: var(--ink-dark);
  display: block;
}
.card-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-yellow {
  background: rgba(245, 184, 0, 0.15);
  color: var(--accent-deep);
}
.tag-blue {
  background: rgba(197, 221, 237, 0.5);
  color: var(--lan-blue-dark);
}
.tag-gray {
  background: var(--bg-cream-soft);
  color: var(--ink-medium);
}

/* ─── ANIMATIONS ─────────────────────────────── */
@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  animation: fade-in-up 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.bounce-mascot {
  animation: gentle-bounce 4s ease-in-out infinite;
}

/* ─── FOOTER ─────────────────────────────── */
footer.site-footer {
  background: var(--ink-dark);
  color: var(--bg-cream);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.footer-brand p {
  color: var(--bg-cream-soft);
  opacity: 0.7;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  line-height: 1.7;
}
.footer-brand .brand .brand-name { color: var(--bg-cream); }
.footer-links h4 {
  font-family: 'Noto Serif TC', serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent);
}
.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-links a {
  color: var(--bg-cream-soft);
  opacity: 0.75;
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}
.footer-links a:hover {
  opacity: 1;
  color: var(--accent);
}
.footer-bottom {
  border-top: 1px solid rgba(250, 246, 238, 0.1);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: var(--bg-cream-soft);
  opacity: 0.5;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ─── UTILITY ─────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ─── 年級下拉選單 ─────────────────────── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  color: var(--ink-medium);
  font-size: 0.95rem;
  font-weight: 500;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s;
}
.nav-dropdown-trigger:hover { color: var(--ink-dark); }
.nav-dropdown-trigger::after {
  content: '▾';
  font-size: 0.7rem;
  opacity: 0.6;
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 12px 32px rgba(42, 37, 32, 0.12);
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 60;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--ink-dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.nav-dropdown-menu a:hover {
  background: var(--bg-cream-soft);
  color: var(--accent-deep);
}
.nav-dropdown-menu a small {
  color: var(--ink-soft);
  font-size: 0.75rem;
}
