:root {
  --primary: #0a1628;
  --primary-light: #1a2d50;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --gold: #f59e0b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --bg-card: rgba(15, 23, 42, 0.8);
  --border: rgba(59, 130, 246, 0.3);
  --gradient: linear-gradient(135deg, #0a1628 0%, #1e3a5f 50%, #0a1628 100%);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  background: var(--primary);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: background 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-light);
  text-decoration: none;
  letter-spacing: 1px;
}

.nav-logo span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-toggle span {
  width: 25px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 5%;
  position: relative;
  overflow: hidden;
}

/* ===== AI SERVICE PAGE ===== */
.ai-hero {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 5% 5rem;
  position: relative;
  overflow: hidden;
}

.ai-hero .hero-content {
  max-width: 900px;
}

.ai-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 1.25;
  margin-bottom: 1.2rem;
}

.ai-hero p {
  max-width: 760px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.ai-intro,
.ai-comparison {
  padding: 6rem 5%;
}

.ai-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.ai-comparison {
  background: var(--gradient);
}

.ai-scenarios {
  padding: 6rem 5%;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.scenario-card {
  padding: 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.3s, border-color 0.3s;
}

.scenario-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.scenario-icon {
  color: var(--accent-light);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.scenario-card h3 {
  margin-bottom: 0.5rem;
}

.scenario-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.scenario-example {
  display: block;
  color: var(--accent-light);
  font-size: 0.85rem;
}

.comparison-table-wrap {
  max-width: 1100px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.comparison-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--bg-card);
}

.comparison-table th,
.comparison-table td {
  padding: 1rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table thead th {
  color: #fff;
  background: rgba(59, 130, 246, 0.22);
}

.comparison-table thead th:last-child {
  color: var(--accent-light);
}

.comparison-table tbody th {
  width: 18%;
  color: var(--text);
  font-weight: 600;
}

.comparison-table td {
  color: var(--text-muted);
}

.comparison-table td:last-child {
  color: var(--text);
}

.ai-cta {
  padding: 6rem 5%;
  text-align: center;
}

.ai-cta .section-header {
  margin-bottom: 0;
}

.ai-cta .btn {
  display: inline-block;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .ai-feature-grid,
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .ai-hero {
    min-height: 82vh;
  }
}


.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient);
}

.stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--duration) infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--accent-light);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero h1 .highlight {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-card);
}

/* ===== SECTIONS ===== */
section {
  padding: 6rem 5%;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.8rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
}

.about-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.about-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
}

.about-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== SERVICES ===== */
.services {
  background: var(--gradient);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  transition: transform 0.3s, border-color 0.3s;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
}

.service-num {
  font-size: 3rem;
  font-weight: 800;
  color: rgba(59, 130, 246, 0.15);
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.service-detail-link {
  color: inherit;
  text-decoration: none;
}

.service-detail-link::after {
  content: ' →';
  color: var(--accent-light);
  font-size: 0.9em;
}

.service-detail-link:hover {
  color: var(--accent-light);
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-tag {
  padding: 0.3rem 0.8rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--accent-light);
}

/* ===== PROCESS ===== */
.process {
  background: var(--gradient);
}

.process-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.process-timeline::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 60px;
  right: 60px;
  height: 2px;
  background: var(--border);
}

.process-step {
  flex: 1;
  text-align: center;
  padding: 0 0.5rem;
  position: relative;
  z-index: 1;
}

.process-num {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.process-content h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.process-content p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .process-timeline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .process-timeline::before {
    top: 0;
    bottom: 0;
    left: 23px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .process-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
    padding: 1rem 0;
  }

  .process-num {
    margin: 0;
    flex-shrink: 0;
  }
}

/* ===== PORTFOLIO ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.portfolio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
}

.portfolio-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.portfolio-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.6);
}

.portfolio-body {
  padding: 1.5rem;
}

.portfolio-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.portfolio-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ===== CONTACT ===== */
.contact-section {
  background: var(--gradient);
}

.contact-cta {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

.contact-note {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== FOOTER ===== */
.footer {
  padding: 3rem 5%;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer a {
  color: var(--accent-light);
  text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: var(--primary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: right 0.3s;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== REVEAL ANIMATION ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
