/* ══════════════════════════════════════════════════════════════
   凯鸣文化品牌設計系統 — 共用 CSS 變數
   Brand CIS Shared Variables & Base Styles
   ══════════════════════════════════════════════════════════════ */

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

:root {
  --primary: #E60012;
  --primary-light: #FF2A2A;
  --primary-dark: #B8000E;
  --primary-glow: rgba(230, 0, 18, 0.3);

  --accent: #1B4270;
  --accent-light: #2460A7;
  --accent-dark: #0F2A47;
  --accent-glow: rgba(27, 66, 112, 0.3);

  --bg-cream: #F5F6F8;
  --bg-neutral: #F5F6F8;
  --bg-white: #ffffff;
  --bg-dark: #0F1923;

  --text-dark: #111827;
  --text-medium: #4B5563;
  --text-light: #9CA3AF;

  --border: rgba(0, 0, 0, 0.1);

  --font-sans:
    "Inter",
    "Source Han Sans SC",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;
  --font-display:
    "zihunbiantaoti",
    "Source Han Sans SC",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    sans-serif;

  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.16), 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --superindividual: var(--accent);
  --superindividual-light: var(--accent-light);
  --superindividual-dark: var(--accent-dark);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-cream);
  color: var(--text-dark);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button,
input {
  font: inherit;
}

::selection {
  background: rgba(230, 0, 18, 0.18);
  color: var(--text-dark);
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(245, 246, 248, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  text-decoration: none;
}

.nav-brand img {
  height: 28px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-medium);
  text-decoration: none;
  transition: color 0.2s;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  padding: 100px 0;
}

section:first-of-type {
  padding-top: 140px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-desc {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-medium);
  max-width: 600px;
  line-height: 1.7;
}

.btn-primary {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--bg-white);
  color: var(--text-dark);
  transition: var(--transition);
  text-decoration: none;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 200;
  box-shadow: var(--shadow-elevated);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.code-block {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.8;
  max-width: 100%;
  overflow-x: auto;
  position: relative;
}

.code-block pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: inherit;
  max-width: 100%;
}

.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cdd6f4;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.65rem;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background 0.2s;
}

.code-block .copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-url-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-url-btn:hover {
  background: var(--text-dark);
  color: white;
  border-color: var(--text-dark);
}

.copy-url-btn.copied {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.footer {
  padding: 56px clamp(24px, 4vw, 48px);
  margin: 0 0 56px;
  text-align: left;
  border-top: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(135deg, #121a24 0%, #0f1923 54%, #182437 100%);
  background-size: 36px 36px, 36px 36px, 100% 100%;
  color: rgba(255, 255, 255, 0.86);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  right: clamp(24px, 6vw, 80px);
  bottom: -90px;
  width: min(34vw, 360px);
  aspect-ratio: 1;
  background: url("./assets/km-logo-icon.png") center / contain no-repeat;
  opacity: 0.08;
  transform: rotate(-10deg);
  pointer-events: none;
}

.footer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent));
}

.footer-brand {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.footer-brand img {
  width: 220px;
  max-height: 90px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.25));
}

.footer-title {
  margin-bottom: 8px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 850;
  letter-spacing: -0.02em;
}

.footer p {
  max-width: 560px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.8;
}

.footer a {
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  color: #fff;
}

.footer-links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.42);
}

.bottom-brand-gradient {
  height: clamp(140px, 20vw, 240px);
  pointer-events: none;
  background:
    linear-gradient(rgba(230, 0, 18, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 66, 112, 0.04) 1px, transparent 1px),
    url("./assets/km-logo-icon.png") center 42% / 160px no-repeat,
    linear-gradient(180deg, rgba(245, 246, 248, 0) 0%, rgba(245, 246, 248, 1) 100%);
  background-size: 42px 42px, 42px 42px, 160px 160px, 100% 100%;
  opacity: 0.62;
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .container {
    padding: 0 20px;
  }

  .nav-inner {
    padding: 0 20px;
  }

  .footer-brand {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .footer-brand img {
    width: 180px;
  }
}
