/* ===== CSS Variables ===== */
:root {
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --accent: #25D366;
  --accent-hover: #1da851;
  --gold: #c9a84c;
  --gold-light: #e8d48b;
  --bg: #f8f9fa;
  --bg-white: #ffffff;
  --text: #2d2d2d;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --header-height: 72px;
  --transition: 0.3s ease;
  --font-main: 'Noto Sans TC', 'Noto Sans SC', 'Segoe UI', Arial, sans-serif;
  --font-heading: 'Noto Serif TC', 'Noto Serif SC', Georgia, serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

/* ===== Language Toggle ===== */
.lang-tc, .lang-sc, .lang-en { display: none; }
body.tc .lang-tc { display: block; }
body.sc .lang-sc { display: block; }
body.en .lang-en { display: block; }

/* Inline language spans */
span.lang-tc, span.lang-sc, span.lang-en { display: none; }
body.tc span.lang-tc { display: inline; }
body.sc span.lang-sc { display: inline; }
body.en span.lang-en { display: inline; }

/* List items */
li.lang-tc, li.lang-sc, li.lang-en { display: none; }
body.tc li.lang-tc { display: list-item; }
body.sc li.lang-sc { display: list-item; }
body.en li.lang-en { display: list-item; }

/* Table display for nav items */
body.tc a.lang-tc, body.sc a.lang-sc, body.en a.lang-en { display: inline; }
a.lang-tc, a.lang-sc, a.lang-en { display: none; }

/* ===== Header ===== */
.site-header {
  background: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  height: var(--header-height);
}

.header-inner,
.site-header > .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* ===== Navigation ===== */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }

.main-nav a {
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--text);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.main-nav a:hover, .main-nav a.active {
  background: var(--primary);
  color: #fff;
}

/* Header actions (lang switcher + mobile toggle wrapper) */
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lang-switcher button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-light);
  font-family: var(--font-main);
}

.lang-switcher button:hover { background: #f0f0f0; }
.lang-switcher button.active { background: var(--primary); color: #fff; }

/* Header WhatsApp */
.header-wa {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 12px;
  white-space: nowrap;
  transition: background var(--transition);
}

.header-wa:hover { background: var(--accent-hover); color: #fff !important; }

.header-wa svg { width: 18px; height: 18px; fill: #fff; }

/* Mobile Menu */
.mobile-toggle,
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-toggle span,
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero .subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.hero .tagline {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font-main);
}

.btn-primary {
  background: var(--gold);
  color: var(--primary);
}
.btn-primary:hover { background: var(--gold-light); color: var(--primary); }

.btn-whatsapp {
  background: var(--accent);
  color: #fff;
}
.btn-whatsapp:hover { background: var(--accent-hover); color: #fff; }

.btn-outline {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); color: #fff; }

.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn svg { width: 20px; height: 20px; }

/* ===== Sections ===== */
/* General container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

.section-alt {
  background: var(--bg-white);
}

.section-alt .section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 12px;
  text-align: center;
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 48px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Service Cards ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.service-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.service-card h3 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 12px;
  font-family: var(--font-heading);
}

.service-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.service-card .card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-link {
  display: inline-block;
  padding: 6px 14px;
  background: #f0f4f8;
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.card-link:hover { background: var(--primary); color: #fff; }

/* ===== Features Grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.feature-item {
  text-align: center;
  padding: 24px;
}

.feature-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg { width: 28px; height: 28px; fill: #fff; }

.feature-item h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.feature-item p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ===== FAQ Accordion ===== */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-white);
}

.faq-question {
  width: 100%;
  padding: 18px 24px;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-main);
  transition: background var(--transition);
}

.faq-question:hover { background: #f8f9fa; }

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.active .faq-question::after {
  content: '-';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 24px;
  color: var(--text-light);
  line-height: 1.8;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 24px 20px;
}

/* ===== Paper Grid ===== */
.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.paper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}

.paper-btn:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* ===== YouTube Section ===== */
.youtube-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.youtube-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.youtube-item h4 {
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* ===== Contact Section ===== */
.contact-section {
  background: var(--primary);
  color: #fff;
  padding: 64px 24px;
}

.contact-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-info h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 24px;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.contact-detail svg {
  width: 20px;
  height: 20px;
  fill: var(--gold-light);
  flex-shrink: 0;
  margin-top: 3px;
}

.office-hours {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.office-hours h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--gold-light);
}

.office-hours p {
  opacity: 0.85;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form input,
.contact-form textarea {
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: border-color var(--transition);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(255,255,255,0.5); }

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.contact-form textarea { min-height: 120px; resize: vertical; }

.contact-form .btn { align-self: flex-start; }

/* ===== Footer ===== */
.site-footer {
  background: #111827;
  color: rgba(255,255,255,0.7);
  padding: 48px 24px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand h3 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.social-links a:hover { background: var(--primary); }
.social-links a svg { width: 20px; height: 20px; fill: #fff; }

.footer-links h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color var(--transition);
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 0.85rem;
}

/* ===== Disclaimer ===== */
.disclaimer {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 40px;
  font-size: 0.9rem;
  color: #856404;
  line-height: 1.7;
}

/* ===== Guarantee Badge ===== */
.guarantee {
  background: linear-gradient(135deg, #f8f4e8, #fff8e1);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-top: 40px;
}

.guarantee h3 {
  color: var(--gold);
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.guarantee .amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 12px 0;
}

.guarantee p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.guarantee-links {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.guarantee-links a {
  color: var(--primary);
  text-decoration: underline;
  font-size: 0.9rem;
}

/* ===== WhatsApp Floating Button ===== */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  z-index: 999;
  transition: transform var(--transition), box-shadow var(--transition);
}

.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,211,102,0.5);
}

.wa-float svg { width: 32px; height: 32px; fill: #fff; }

/* ===== Content Blocks ===== */
.content-block {
  margin-bottom: 48px;
}

.content-block h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.content-block h3 {
  font-size: 1.2rem;
  color: var(--primary);
  margin: 20px 0 10px;
}

.content-block p {
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.8;
}

.content-block ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.content-block ul li {
  color: var(--text-light);
  margin-bottom: 6px;
  line-height: 1.7;
}

/* ===== About Team ===== */
.join-us {
  background: linear-gradient(135deg, #f0f4f8, #e8eef5);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-top: 40px;
}

.join-us h2 {
  border-bottom: none;
  text-align: center;
}

.join-us ul {
  max-width: 500px;
  margin: 16px auto;
}

.join-us p {
  text-align: center;
}

/* ===== Exam Info Cards ===== */
.exam-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

.exam-info-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.exam-info-card h3 {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.exam-info-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 10px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-wa { display: none; }
  .mobile-toggle, .nav-toggle { display: block; }

  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow);
    padding: 16px;
    gap: 4px;
    z-index: 1000;
  }

  .main-nav.open ul { flex-direction: column; gap: 4px; }

  .main-nav.open a { padding: 12px 16px; }

  .lang-switcher { margin-left: 0; margin-top: 8px; align-self: flex-start; }

  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: 1.2rem; }
  .hero { padding: 48px 24px; }

  .contact-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }

  .section-title { font-size: 1.6rem; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .paper-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .exam-info-grid { grid-template-columns: 1fr; }
}
