/* ============================================================
   HiveCore — 全站樣式（暗色科技感 · 紫青配色）
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

/* ── CSS Variables — HiveCore Brand ────────────────────────── */
:root {
  --bg-primary: #06061A;
  --bg-card: #111128;
  --bg-card-hover: #1a1a3a;
  --bg-input: #0c0c22;
  --border: #1E1E3F;
  --border-glow: rgba(108, 58, 255, 0.5);

  --text-primary: #F0F2FF;
  --text-secondary: #8B8FAE;
  --text-muted: #5A5E7A;

  --accent: #6C3AFF;
  --accent-hover: #5A2DE0;
  --accent-light: #9D7AFF;
  --accent-glow: rgba(108, 58, 255, 0.3);

  --cyan: #00E5FF;
  --cyan-glow: rgba(0, 229, 255, 0.2);

  --green: #39FF85;
  --green-bg: #0D3320;
  --orange: #FFB020;
  --red: #FF3B5C;
  --red-bg: #3D1020;
  --blue: #00E5FF;

  --font-sans: 'Inter', 'Noto Sans TC', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-glow: 0 0 30px var(--accent-glow);
  --shadow-cyan: 0 0 20px var(--cyan-glow);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* ── Utilities ─────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.navbar-logo {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar-links { display: flex; gap: 28px; align-items: center; }
.navbar-links a {
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: color 0.2s;
}
.navbar-links a:hover { color: var(--text-primary); }
.navbar-cta {
  padding: 8px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: white !important;
  -webkit-text-fill-color: white !important;
  transition: background 0.2s, box-shadow 0.2s;
}
.navbar-cta:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 600; border: none; cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white; box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 40px var(--accent-glow);
}
.btn-secondary {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}
.card-glow {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 15px; font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-error { color: var(--red); font-size: 13px; margin-top: 4px; }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ── Hero Section ──────────────────────────────────────────── */
.hero {
  position: relative; padding: 160px 24px 100px;
  text-align: center; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 40%);
  pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.hero h1 {
  font-size: clamp(36px, 5vw, 64px); font-weight: 800;
  line-height: 1.15; max-width: 800px; margin: 0 auto;
  position: relative;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent-light), var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: clamp(16px, 2vw, 20px); color: var(--text-secondary);
  max-width: 600px; margin: 20px auto 0; position: relative;
}
.hero-buttons { margin-top: 36px; display: flex; gap: 16px; justify-content: center; position: relative; }

/* ── Section ───────────────────────────────────────────────── */
.section { padding: 80px 24px; }
.section-title {
  font-size: 36px; font-weight: 700; text-align: center; margin-bottom: 12px;
}
.section-subtitle {
  font-size: 16px; color: var(--text-secondary); text-align: center;
  max-width: 600px; margin: 0 auto 48px;
}

/* ── Feature Grid ──────────────────────────────────────────── */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px; max-width: 1200px; margin: 0 auto;
}
.feature-card {
  padding: 28px; transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 40px var(--accent-glow);
}
.feature-icon {
  width: 64px; height: 64px; border-radius: 14px;
  margin-bottom: 16px; overflow: hidden;
  background: linear-gradient(135deg, rgba(108, 58, 255, 0.15), rgba(0, 229, 255, 0.08));
  border: 1px solid rgba(108, 58, 255, 0.25);
  transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover .feature-icon {
  transform: scale(1.08);
  box-shadow: var(--shadow-cyan);
}
.feature-icon img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 14px;
}
.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ── Comparison Table ──────────────────────────────────────── */
.comparison-table {
  width: 100%; border-collapse: collapse; margin: 0 auto;
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.comparison-table th, .comparison-table td {
  padding: 14px 20px; text-align: center; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.comparison-table th {
  background: #12122a; color: var(--text-secondary);
  font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
}
.comparison-table th:last-child { color: var(--accent-light); }
.comparison-table td:first-child { text-align: left; font-weight: 500; }
.comparison-table tr:last-child td { border-bottom: none; }
.check { color: var(--green); }
.cross { color: var(--red); opacity: 0.6; }
.partial { color: var(--orange); }

/* ── Pricing Cards ─────────────────────────────────────────── */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; max-width: 1100px; margin: 0 auto;
}
.pricing-card { text-align: center; padding: 32px 24px; position: relative; }
.pricing-card.popular {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: white; padding: 4px 16px;
  border-radius: 20px; font-size: 12px; font-weight: 700;
}
.pricing-name { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.pricing-price { font-size: 42px; font-weight: 800; margin: 12px 0 4px; }
.pricing-price span { font-size: 16px; font-weight: 400; color: var(--text-muted); }
.pricing-features { list-style: none; margin: 24px 0; text-align: left; }
.pricing-features li {
  padding: 8px 0; font-size: 14px; color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pricing-features li::before { content: '✓ '; color: var(--green); font-weight: 700; }

/* ── Architecture Diagram ──────────────────────────────────── */
.arch-diagram {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-secondary); white-space: pre; overflow-x: auto;
  line-height: 1.8; text-align: center;
  max-width: 800px; margin: 0 auto;
}

/* ── Auth Pages ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg-primary), #0a0a2e);
  position: relative;
}
.auth-page::before {
  content: ''; position: absolute; inset: 0;
  background: url('../images/auth-bg.png') center/cover no-repeat;
  opacity: 0.08; pointer-events: none;
}
.auth-card {
  width: 100%; max-width: 420px; padding: 40px;
  position: relative; z-index: 1;
}
.auth-card h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.auth-card .subtitle { color: var(--text-secondary); margin-bottom: 32px; font-size: 15px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 24px 0;
  color: var(--text-muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }

/* ── Dashboard ─────────────────────────────────────────────── */
.dash-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 56px;
  background: rgba(10, 10, 26, 0.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.dash-topbar-logo { font-size: 18px; font-weight: 700; color: var(--accent-light); }
.dash-topbar-user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-secondary); }
.dash-content { padding: 80px 24px 40px; max-width: 1100px; margin: 0 auto; }
.dash-welcome { margin-bottom: 32px; }
.dash-welcome h1 { font-size: 24px; font-weight: 600; }
.dash-welcome p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card { text-align: center; }
.stat-card .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 32px; font-weight: 700; margin-top: 8px; }
.stat-card .value.purple { color: var(--accent-light); }
.stat-card .value.green { color: var(--green); }
.stat-card .value.blue { color: var(--blue); }
.stat-card .value.orange { color: var(--orange); }

/* ── API Keys Table ────────────────────────────────────────── */
.keys-table { width: 100%; border-collapse: collapse; }
.keys-table th, .keys-table td {
  padding: 12px 16px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.keys-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

/* ── Code Block ────────────────────────────────────────────── */
.code-block {
  background: #0d0d20; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  color: var(--text-secondary); overflow-x: auto; position: relative;
}
.code-block .keyword { color: var(--accent-light); }
.code-block .string { color: var(--green); }
.code-block .comment { color: var(--text-muted); }
.code-copy {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); padding: 4px 10px; border-radius: 6px;
  font-size: 12px; cursor: pointer;
}
.code-copy:hover { color: var(--text-primary); border-color: var(--accent); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; max-width: 500px; width: 100%; }
.modal h2 { font-size: 20px; margin-bottom: 16px; }

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  padding: 14px 24px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.toast-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border); padding: 40px 24px;
  text-align: center; color: var(--text-muted); font-size: 14px;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.footer-links a { color: var(--text-secondary); }

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.6s ease forwards; opacity: 0; }
@keyframes fadeIn { to { opacity: 1; } }
.fade-up { animation: fadeUp 0.6s ease forwards; opacity: 0; transform: translateY(20px); }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-links { display: none; }
  .hero { padding: 120px 16px 60px; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
  .section { padding: 48px 16px; }
  .comparison-table { font-size: 12px; }
  .comparison-table th, .comparison-table td { padding: 10px 8px; }
}
