/* ===== CSS Variables ===== */
:root {
  /* 色彩系統 — 穩重信賴配色 */
  --primary: #1B4F72;
  --primary-light: #2E86C1;
  --primary-dark: #154360;
  --secondary: #17A589;
  --accent: #D4A017;
  --text: #1A2332;
  --text-mid: #4A5568;
  --text-light: #6B7A8D;
  --bg: #FAFBFC;
  --bg-alt: #F0F4F8;
  --border: #E2E8F0;
  --error: #E74C3C;
  --success: #27AE60;

  /* 字級系統 */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: clamp(1.75rem, 3vw, 2.25rem);
  --fs-3xl: clamp(2.2rem, 5vw, 3.5rem);

  /* 間距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* 圓角 & 陰影 */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 72px;
  }
}

@media (max-width: 360px) {
  html {
    scroll-padding-top: 64px;
  }
}

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ===== Skip Link (A11y) ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--primary);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 9999;
  font-size: var(--fs-sm);
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* ===== Focus Styles (A11y) ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ===== Button ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.btn-lg {
  padding: var(--space-4) 36px;
  font-size: var(--fs-base);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 79, 114, 0.3);
}

.btn-outline-light {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
}

/* Button loading state */
.btn-loading {
  display: none;
}

.btn.loading .btn-text {
  visibility: hidden;
}

.btn.loading .btn-loading {
  display: flex;
  position: absolute;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 251, 252, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: var(--space-2);
}

.nav-links a {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-mid);
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 60%;
  left: 20%;
}

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

.nav-links a.active {
  color: var(--primary);
  font-weight: 500;
}

/* Nav CTA button */
.nav-cta {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: var(--space-2) var(--space-5) !important;
  font-weight: 500 !important;
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  background: var(--primary-dark) !important;
  box-shadow: 0 2px 8px rgba(27, 79, 114, 0.3);
}

/* ===== Language Switcher ===== */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  margin-left: var(--space-4);
  flex-shrink: 0;
}

.lang-btn {
  position: relative;
  z-index: 1;
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.25s ease;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: #fff;
}

.lang-indicator {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: var(--primary);
  border-radius: 4px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.lang-switcher.en-active .lang-indicator {
  transform: translateX(100%);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-radius: 4px;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Hero Banner ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  /* 預設漸層背景（有圖片後可移除） */
  background: linear-gradient(135deg, #0d2137 0%, #1B4F72 40%, #1a6b5a 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    105deg,
    rgba(26, 35, 50, 0.92) 0%,
    rgba(27, 79, 114, 0.75) 40%,
    rgba(23, 165, 137, 0.45) 70%,
    rgba(23, 165, 137, 0.25) 100%
  );
}

.hero .container {
  position: relative;
  z-index: 2;
  padding-top: 80px;
}

.hero-content {
  max-width: 640px;
}

/* -- Hero brand row: icon + tagline -- */
.hero-brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  animation: heroSlideUp 0.8s ease both;
}

.hero-logo-wrap {
  flex-shrink: 0;
}

.hero-logo {
  display: block;
  width: 48px;
  height: 48px;
}

/* Logo SVG stroke flowing light */
.hero-logo-stroke path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.5;
  stroke-linecap: round;
}


.hero-tagline {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.25em;
  color: var(--secondary);
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid rgba(23, 165, 137, 0.35);
  border-radius: 4px;
}

.hero-title {
  margin-bottom: var(--space-6);
}

.hero-title-line {
  display: block;
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.hero-title-accent {
  background: linear-gradient(135deg, #ffffff 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(var(--fs-base), 1.8vw, var(--fs-md));
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.9;
  margin-bottom: var(--space-10);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  z-index: 3;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 80px;
}

/* Hero entrance animation */
@keyframes heroSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title-line:nth-child(1) {
  animation: heroSlideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
}

.hero-title-line:nth-child(2) {
  animation: heroSlideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.55s both;
}

.hero-subtitle {
  animation: heroSlideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.7s both;
}

.hero-actions {
  animation: heroSlideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.85s both;
}

/* ===== Section ===== */
.section {
  padding: var(--space-24) 0;
}

.section-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-4);
  color: var(--text);
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  margin: var(--space-4) auto 0;
}

.section-desc {
  text-align: center;
  color: var(--text-light);
  font-size: var(--fs-md);
  margin-bottom: var(--space-12);
}

/* ===== About ===== */
.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  margin-top: var(--space-12);
}

.about-image-wrapper {
  position: relative;
}

.about-image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
}

.about-image-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--text-light);
}

.about-image-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.about-image-placeholder span {
  font-size: var(--fs-sm);
  opacity: 0.6;
}

.about-image-accent {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 60%;
  height: 60%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  z-index: -1;
  opacity: 0.12;
}

.about-text p {
  color: var(--text-mid);
  font-size: var(--fs-base);
  line-height: 1.9;
  margin-bottom: var(--space-4);
}

.about-values {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.value-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.value-item:hover {
  background: var(--bg-alt);
}

.value-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(27, 79, 114, 0.08), rgba(23, 165, 137, 0.08));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.value-icon svg {
  width: 22px;
  height: 22px;
}

.value-item h3 {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.value-item p {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.6;
}

/* ===== Services ===== */
.services {
  background: var(--bg-alt);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-12);
}

.service-card {
  position: relative;
  background: var(--bg);
  padding: var(--space-10) var(--space-8) 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
  text-align: center;
  overflow: hidden;
}

/* Top color bar on hover */
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:nth-child(1)::before { background: var(--primary); }
.service-card:nth-child(2)::before { background: var(--primary-light); }
.service-card:nth-child(3)::before { background: var(--secondary); }
.service-card:nth-child(4)::before { background: var(--accent); }

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(27, 79, 114, 0.1);
  border-color: transparent;
}

.service-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-6);
  background: linear-gradient(135deg, rgba(27, 79, 114, 0.08), rgba(23, 165, 137, 0.08));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  transform: scale(1.05);
}

.service-icon svg {
  width: 28px;
  height: 28px;
}

.service-card h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--text);
}

.service-card p {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.7;
}

/* Stagger animation */
.service-card:nth-child(1) { transition-delay: 0s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.2s; }
.service-card:nth-child(4) { transition-delay: 0.3s; }

/* ===== Tools ===== */
.tools {
  background: var(--bg);
}

.tools-grid {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: calc(50% - var(--space-4) / 2);
  gap: var(--space-4);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding-bottom: var(--space-2);
}

.tools-grid::-webkit-scrollbar {
  height: 6px;
}

.tools-grid::-webkit-scrollbar-track {
  background: transparent;
}

.tools-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.tools-grid::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.tool-card {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-6) 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
  scroll-snap-align: start;
  min-width: 0;
}

.tool-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  transition: height 0.3s ease;
}

.tool-card:hover::before {
  height: 60%;
}

.tool-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(27, 79, 114, 0.08), rgba(23, 165, 137, 0.08));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: var(--transition);
}

.tool-card:hover .tool-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.tool-icon svg {
  width: 22px;
  height: 22px;
}

.tool-info {
  flex: 1;
}

.tool-info h3 {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text);
}

.tool-info p {
  font-size: var(--fs-sm);
  color: var(--text-light);
}

.tool-arrow {
  flex-shrink: 0;
  color: var(--text-light);
  transition: var(--transition);
}

.tool-card:hover .tool-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

.tool-arrow svg {
  width: 20px;
  height: 20px;
}

/* Stagger */
.tool-card:nth-child(1) { transition-delay: 0s; }
.tool-card:nth-child(2) { transition-delay: 0.08s; }
.tool-card:nth-child(3) { transition-delay: 0.16s; }
.tool-card:nth-child(4) { transition-delay: 0.24s; }

/* ===== Contact ===== */
.contact {
  background: var(--bg-alt);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: var(--space-12);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.contact-item svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--primary);
  margin-top: 2px;
}

.contact-item h4 {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.contact-item p,
.contact-item address {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  font-style: normal;
}

/* Floating label form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: var(--transition);
  outline: none;
}

.form-group label {
  position: absolute;
  left: 18px;
  top: 16px;
  font-size: var(--fs-base);
  color: var(--text-light);
  pointer-events: none;
  transition: all 0.25s ease;
  background: #fff;
  padding: 0 4px;
}

/* Float label up */
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -8px;
  left: 14px;
  font-size: var(--fs-xs);
  color: var(--primary);
  font-weight: 500;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(27, 79, 114, 0.1);
}

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

/* Form error state */
.form-error {
  display: none;
  font-size: var(--fs-xs);
  color: var(--error);
  margin-top: var(--space-1);
  padding-left: var(--space-1);
}

.form-group.error input,
.form-group.error textarea {
  border-color: var(--error);
}

.form-group.error .form-error {
  display: block;
}

.form-group.error input + label,
.form-group.error textarea + label {
  color: var(--error) !important;
}

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

/* ===== Footer ===== */
.footer {
  background: #1A2332;
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-16) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand .logo {
  margin-bottom: var(--space-4);
}

.footer-brand .logo-text {
  color: #fff;
}

.footer-brand > p {
  font-size: var(--fs-sm);
  max-width: 300px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.45);
}

.footer-col h3 {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--space-5);
  letter-spacing: 0.03em;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-col a {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.3s ease;
}

.footer-col a:hover {
  color: var(--secondary);
}

.footer-col address {
  font-style: normal;
  font-size: var(--fs-sm);
  line-height: 2;
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom {
  padding: var(--space-5) 0;
  text-align: center;
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.3);
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top.visible {
  display: flex;
}

/* ===== Language Transition ===== */
.lang-transitioning {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-transitioned {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s;
}

/* ===== Scroll Animations ===== */
.service-card,
.tool-card,
.about-visual,
.about-content,
.value-item,
.contact-item,
.contact-form {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card.visible,
.tool-card.visible,
.about-visual.visible,
.about-content.visible,
.value-item.visible,
.contact-item.visible,
.contact-form.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */

/* ---------- >= 1201px: 桌面版（預設樣式） ---------- */

/* ---------- <= 1200px: 小桌面 / 平板橫式 ---------- */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }

  .services-grid {
    gap: var(--space-5);
  }

  .about-grid {
    gap: 56px;
  }
}

/* ---------- <= 968px: 平板橫式 ---------- */
@media (max-width: 968px) {
  .section {
    padding: var(--space-20) 0;
  }

  .section-desc {
    margin-bottom: var(--space-10);
  }

  /* 經營項目：2 欄，卡片等高 */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
  }

  .service-card {
    display: flex;
    flex-direction: column;
  }

  /* 關於我們：單欄，圖片在上 */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .about-visual {
    max-width: 500px;
    margin: 0 auto;
  }

  .about-image-accent {
    bottom: -12px;
    right: -12px;
  }

  /* 聯絡我們：單欄 */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .contact-form .btn {
    align-self: stretch;
    justify-content: center;
  }

  /* 頁尾：2 欄，品牌橫跨 */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8) var(--space-12);
  }

  .footer-brand {
    grid-column: 1 / -1;
    padding-bottom: var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* ---------- <= 768px: 平板直式 / 大手機 ---------- */
@media (max-width: 768px) {
  /* -- 導覽列 -- */
  .nav-content {
    height: 64px;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
  }

  .hero-logo {
    width: 40px;
    height: 40px;
  }

  .logo-text {
    font-size: var(--fs-base);
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250, 251, 252, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-6);
    overflow-y: auto;
    z-index: 999;
    gap: 0;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
    margin-top: var(--space-4);
  }

  .nav-links a {
    display: block;
    font-size: var(--fs-base);
    padding: var(--space-4) var(--space-2);
    border-radius: 0;
  }

  .nav-links a::after {
    display: none;
  }

  /* 手機版 CTA 按鈕：全寬置中 */
  .nav-cta {
    display: block !important;
    text-align: center !important;
    padding: var(--space-3) var(--space-5) !important;
    border-radius: var(--radius-sm) !important;
  }

  .lang-switcher {
    margin-left: auto;
    margin-right: var(--space-3);
  }

  .lang-btn {
    padding: 3px 10px;
    font-size: 0.7rem;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* -- Hero -- */
  .hero {
    min-height: 85vh;
    min-height: 85svh;
  }

  .hero .container {
    padding-top: 64px;
  }

  .hero-content {
    text-align: center;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(26, 35, 50, 0.82) 0%,
      rgba(27, 79, 114, 0.88) 100%
    );
  }

  .hero-subtitle br {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  .hero-wave svg {
    height: 48px;
  }

  /* -- 區塊共用 -- */
  .section {
    padding: var(--space-16) 0;
  }

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

  .section-desc {
    font-size: var(--fs-base);
    margin-bottom: var(--space-8);
  }

  /* -- 關於我們 -- */
  .about-visual {
    max-width: 100%;
  }

  .about-image-placeholder {
    aspect-ratio: 16/10;
  }

  .about-image-accent {
    display: none;
  }

  .about-values {
    gap: var(--space-3);
    margin-top: var(--space-6);
  }

  .value-item {
    padding: var(--space-3);
  }

  .value-icon {
    width: 40px;
    height: 40px;
  }

  .value-icon svg {
    width: 20px;
    height: 20px;
  }

  /* -- 經營項目：單欄橫向卡片 -- */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .service-card {
    flex-direction: row;
    text-align: left;
    padding: var(--space-5);
    gap: var(--space-4);
    align-items: center;
  }

  /* 色條改為左側 */
  .service-card::before {
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    width: 4px;
    height: 100%;
    transform: scaleY(0);
    transform-origin: top;
  }

  .service-card:hover::before {
    transform: scaleY(1);
  }

  .service-icon {
    width: 52px;
    height: 52px;
    margin: 0;
    flex-shrink: 0;
    border-radius: var(--radius);
  }

  .service-icon svg {
    width: 24px;
    height: 24px;
  }

  .service-card h3 {
    font-size: var(--fs-base);
    margin-bottom: var(--space-1);
  }

  .service-card p {
    font-size: var(--fs-sm);
    line-height: 1.5;
  }

  /* 手機版卡片 hover 改為左移 */
  .service-card:hover {
    transform: translateX(4px);
  }

  /* -- 工具：單排橫向滾動 -- */
  .tools-grid {
    grid-template-rows: auto;
    grid-auto-columns: 80%;
    gap: var(--space-3);
  }

  .tool-card {
    padding: var(--space-5) var(--space-5);
    gap: var(--space-4);
  }

  .tool-icon {
    width: 44px;
    height: 44px;
  }

  .tool-icon svg {
    width: 20px;
    height: 20px;
  }

  .tool-info h3 {
    font-size: var(--fs-sm);
  }

  .tool-info p {
    font-size: var(--fs-xs);
  }

  /* -- 聯絡我們 -- */
  .contact-info {
    gap: var(--space-5);
  }

  .contact-item svg {
    width: 22px;
    height: 22px;
  }

  .contact-form .btn {
    align-self: stretch;
    justify-content: center;
  }

  /* -- 頁尾 -- */
  .footer {
    padding: var(--space-12) 0 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-brand {
    grid-column: auto;
    padding-bottom: var(--space-5);
  }

  .footer-col {
    padding-bottom: var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .footer-col:last-child {
    border-bottom: none;
  }

  /* -- 回到頂部 -- */
  .back-to-top {
    bottom: var(--space-5);
    right: var(--space-5);
    width: 40px;
    height: 40px;
  }

  .back-to-top svg {
    width: 18px;
    height: 18px;
  }
}

/* ---------- <= 480px: 小手機 ---------- */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-4);
  }

  /* Hero 字級縮小 */
  .hero-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .hero-tagline {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .hero-title-line {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: var(--fs-sm);
  }

  .hero-actions {
    max-width: 100%;
  }

  .btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--fs-sm);
  }

  /* 區塊間距再縮 */
  .section {
    padding: var(--space-12) 0;
  }

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

  .section-desc {
    font-size: var(--fs-sm);
    margin-bottom: var(--space-6);
  }

  /* 經營項目卡片 */
  .service-card {
    padding: var(--space-4);
    gap: var(--space-3);
  }

  .service-icon {
    width: 44px;
    height: 44px;
  }

  .service-icon svg {
    width: 20px;
    height: 20px;
  }

  /* 工具卡片 */
  .tools-grid {
    grid-auto-columns: 85%;
  }

  .tool-card {
    padding: var(--space-4);
  }

  .tool-arrow {
    display: none;
  }

  /* 關於我們 */
  .about-grid {
    gap: var(--space-8);
  }

  .about-text p {
    font-size: var(--fs-sm);
    line-height: 1.8;
  }

  .value-item h3 {
    font-size: var(--fs-sm);
  }

  .value-item p {
    font-size: var(--fs-xs);
  }

  /* 聯絡我們 */
  .contact-grid {
    gap: var(--space-8);
  }

  .contact-item h4 {
    font-size: var(--fs-sm);
  }

  .form-group input,
  .form-group textarea {
    padding: 14px 16px;
    font-size: var(--fs-sm);
  }

  .form-group label {
    left: 16px;
    top: 14px;
    font-size: var(--fs-sm);
  }

  /* 頁尾 */
  .footer {
    padding: var(--space-10) 0 0;
  }

  .footer-brand > p {
    font-size: var(--fs-xs);
  }
}

/* ---------- <= 360px: 極小螢幕 ---------- */
@media (max-width: 360px) {
  .lang-switcher {
    margin-right: var(--space-2);
  }

  .lang-btn {
    padding: 2px 8px;
    font-size: 0.65rem;
  }

  .hero-title-line {
    font-size: 1.5rem;
  }

  .nav-content {
    height: 56px;
  }

  .nav-links {
    top: 56px;
  }

  .hero .container {
    padding-top: 56px;
  }

  .logo-text {
    font-size: var(--fs-sm);
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .hero-logo {
    width: 36px;
    height: 36px;
  }

}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-brand,
  .hero-tagline,
  .hero-title-line,
  .hero-subtitle,
  .hero-actions {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .hero-logo-stroke path {
    animation: none;
    stroke-dasharray: none;
  }

  .service-card,
  .tool-card,
  .about-visual,
  .about-content,
  .value-item,
  .contact-item,
  .contact-form {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lang-transitioning,
  .lang-transitioned {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
