/* ========== 設計令牌 ========== */
:root {
  --bg-primary: #030712;
  --bg-secondary: #111827;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --brand-green: #00FF66;
  --brand-blue: #3B82F6;
  --border-light: rgba(255, 255, 255, 0.1);
  --border-green: rgba(0, 255, 102, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px rgba(0, 255, 102, 0.1);
  --transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ========== 全域樣式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* ========== 排版 ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.3;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

code, pre {
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-light);
}

/* ========== 容器與佈局 ========== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

@media (min-width: 1200px) {
  .container {
    padding: 0 3rem;
  }
}

.section {
  padding: 4rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 6rem 0;
  }
}

/* ========== 導覽列 ========== */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(3, 7, 18, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand:hover {
  color: var(--brand-blue);
  transition: var(--transition);
}

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

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }
}

.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--brand-green);
}

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--brand-green);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
}

.hamburger span {
  width: 1.5rem;
  height: 2px;
  background-color: var(--text-primary);
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(0.5rem, 0.5rem);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(0.5rem, -0.5rem);
}

/* ========== 按鈕 ========== */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  text-align: center;
}

.btn-primary {
  background-color: var(--brand-green);
  color: var(--bg-primary);
  box-shadow: 0 0 20px rgba(0, 255, 102, 0.3);
  animation: breathing 2s ease-in-out infinite;
}

.btn-primary:hover {
  background-color: #00dd55;
  box-shadow: 0 0 30px rgba(0, 255, 102, 0.6);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--brand-blue);
  color: white;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover {
  background-color: #2563eb;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--brand-green);
  color: var(--brand-green);
}

.btn-outline:hover {
  background-color: var(--brand-green);
  color: var(--bg-primary);
}

@keyframes breathing {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 255, 102, 0.6);
  }
}

/* ========== 卡片 ========== */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 2rem;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--border-green);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* ========== 網格 ========== */
.grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== Hero 區域 ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(0, 255, 102, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
  padding: 2rem 0;
}

.hero-content h1 {
  background: linear-gradient(135deg, var(--brand-green), var(--brand-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

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

/* ========== 表單 ========== */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.2);
}

.checkbox-group {
  display: grid;
  gap: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.checkbox-item label {
  margin: 0;
  cursor: pointer;
}

/* ========== 頁尾 ========== */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: var(--brand-green);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--brand-green);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ========== 成功提示 ========== */
.success-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.success-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

.success-modal {
  background-color: var(--bg-secondary);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  max-width: 400px;
  border: 1px solid var(--border-green);
  box-shadow: var(--shadow-lg);
}

.success-modal .check-icon {
  font-size: 3rem;
  color: var(--brand-green);
  margin-bottom: 1rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========== 響應式設計 ========== */
@media (max-width: 767px) {
  .section {
    padding: 2rem 0;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* ========== 工具類 ========== */
.text-center {
  text-align: center;
}

.text-green {
  color: var(--brand-green);
}

.text-blue {
  color: var(--brand-blue);
}

.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; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ========== 動畫 ========== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: slideInUp 0.6s ease-out;
}
