:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #eef3f9;
  --text: #1f2937;
  --muted: #5b6472;
  --primary: #123b74;
  --primary-2: #1b5db5;
  --border: #d8e0ea;
  --shadow: 0 12px 30px rgba(18, 59, 116, 0.08);
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

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

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(760px, 100%); }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  gap: 16px;
}

.brand {
  font-weight: 800;
  color: var(--primary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

/* Nav */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-link {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-link.is-active,
.nav-link:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--primary);
  padding: 4px;
  line-height: 1;
}

/* ── Hero ── */
.hero, .page-hero {
  padding: 56px 0 40px;
}

.hero {
  background: linear-gradient(135deg, #e9f1fb 0%, #f8fbff 100%);
}

.eyebrow {
  color: var(--primary-2);
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

h1, h2, h3, h4 { line-height: 1.2; margin-top: 0; }

h1 {
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  margin-bottom: 18px;
}

h3 { font-size: 1.1rem; }

.lead {
  font-size: 1rem;
  color: var(--muted);
  max-width: 100%;
}

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--border); }

.btn-large {
  padding: 14px 24px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-block { width: 100%; }

/* ── Sections ── */
.section { padding: 40px 0; }
.section-alt { background: #f0f5fb; }

/* ── Card grids ── */
.card-grid { display: grid; gap: 16px; }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ── Cards ── */
.card, .mini-card, .contact-box, .faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.mini-card { padding: 16px; }

/* ── Steps ── */
.steps { display: grid; gap: 14px; }

.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.step span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── FAQ ── */
.faq-list { display: grid; gap: 14px; }

.faq-item {
  cursor: pointer;
  user-select: none;
}

.faq-item summary {
  font-weight: 600;
  color: var(--primary);
  padding-right: 28px;
  position: relative;
  list-style: none;
  display: block;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-weight: 700;
  color: var(--primary-2);
  font-size: 1.2rem;
}

details[open] summary::after { content: '−'; }

.faq-item p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ── Footer ── */
.site-footer {
  margin-top: 48px;
  background: #102844;
  color: rgba(255,255,255,0.88);
  padding: 28px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.site-footer h4 { color: #fff; font-size: 1rem; }
.site-footer p { font-size: 0.9rem; }

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.lang-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn.is-active,
.lang-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ── Apply form ── */
.apply-form-full {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-weight: 600; font-size: 0.88rem; color: var(--primary); }
.form-group input,
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--primary-2); }
.required-note { font-size: 0.8rem; color: var(--muted); margin: 0; }
.back-link { color: var(--primary-2); font-weight: 600; display: inline-block; margin-bottom: 14px; font-size: 0.9rem; }
.back-link:hover { text-decoration: underline; }

/* ── Success ── */
.apply-success-box { text-align: center; padding: 36px 16px; }
.success-icon-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 2.2rem;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}

/* ── Page hero ── */
.page-hero-sm { padding: 28px 0 24px; }

/* ── Contact box ── */
.contact-box p { margin: 6px 0; font-size: 0.95rem; }

/* ── Prose ── */
.prose { font-size: 0.97rem; }
.prose ul { padding-left: 18px; }

/* ══════════════════════════════════════
   RESPONSIVE — Tablet (≤900px)
   ══════════════════════════════════════ */
@media (max-width: 900px) {
  .three-col, .four-col, .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero, .page-hero { padding: 40px 0 32px; }
  .section { padding: 32px 0; }
}

/* ══════════════════════════════════════
   RESPONSIVE — Mobile (≤600px)
   ══════════════════════════════════════ */
@media (max-width: 600px) {
  html { font-size: 15px; }

  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand img { height: 36px; }
  .brand-text { font-size: 0.88rem; }

  .nav-toggle { display: block; }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }

  .nav.is-open { display: flex; }

  .nav-link {
    border-radius: 8px;
    font-size: 0.95rem;
    padding: 9px 12px;
  }

  .hero, .page-hero { padding: 28px 0 24px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.35rem; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }

  .three-col, .four-col, .two-col { grid-template-columns: 1fr; }

  .card, .mini-card, .contact-box, .faq-item { padding: 16px; }

  .steps { gap: 10px; }
  .step {
    grid-template-columns: 40px 1fr;
    gap: 10px;
    padding: 14px;
  }
  .step span {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .section { padding: 28px 0; }

  /* Footer */
  .site-footer { padding: 20px 0; }

  /* Apply form */
  .apply-form-full { padding: 16px; border-radius: 14px; }
  .form-row { grid-template-columns: 1fr; }
  .btn-block { width: 100%; }

  .page-hero-sm { padding: 20px 0 16px; }

  .apply-success-box { padding: 24px 12px; }
}

/* ══════════════════════════════════════
   RESPONSIVE — Very small (≤380px)
   ══════════════════════════════════════ */
@media (max-width: 380px) {
  .brand-text { display: none; }
  .brand img { height: 32px; }
  .step { grid-template-columns: 36px 1fr; }
  .step span { width: 36px; height: 36px; }
}
