*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafbfc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --primary: #06b6d4;
  --primary-dark: #0891b2;
  --accent: #8b5cf6;
  --gradient: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.1);
  --radius: 12px;
  --radius-lg: 20px;
  --nav-h: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.nav-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--primary);
  border-radius: 100px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 24px;
  margin-right: auto;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover { color: var(--text); background: var(--bg-alt); }

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-lg { padding: 12px 28px; font-size: 0.9375rem; border-radius: 10px; }

/* Hero */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 64px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.pulse {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-alt { background: var(--bg-alt); }

.section-header {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 40px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Install */
.install-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.code-block {
  background: #1e293b;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.code-block.dark { margin-bottom: 0; }

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #0f172a;
  font-size: 0.75rem;
  color: #64748b;
}

.copy-btn {
  background: #334155;
  border: none;
  color: #cbd5e1;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}

.script-actions .copy-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.script-actions .copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.copy-btn:hover { background: #475569; }
.script-actions .copy-btn:hover { background: var(--surface); }
.copy-btn.copied { background: #059669 !important; color: #fff !important; border-color: #059669 !important; }

.code-block pre {
  padding: 16px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.875rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
}

.code-block .cmd { color: #06b6d4; }

.install-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.step-num {
  width: 24px;
  height: 24px;
  background: rgba(6, 182, 212, 0.12);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.install-note {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 14px 16px;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.install-note code {
  background: rgba(6, 182, 212, 0.1);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8125rem;
}

/* Scripts */
.script-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.script-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.script-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.script-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.script-icon svg { width: 24px; height: 24px; }
.script-icon.install { background: rgba(6, 182, 212, 0.1); color: var(--primary); }
.script-icon.uninstall { background: rgba(244, 63, 94, 0.1); color: #f43f5e; }

.script-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.script-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.script-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Release table */
.release-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.release-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.release-table th,
.release-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.release-table th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.release-table tr:last-child td { border-bottom: none; }

.release-table code {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.8125rem;
  background: var(--bg-alt);
  padding: 3px 8px;
  border-radius: 4px;
}

.platform-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.platform-tag.linux { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.platform-tag.darwin { background: rgba(100, 116, 139, 0.12); color: #475569; }

.dl-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
}

.dl-link:hover { text-decoration: underline; }

.manual-install h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

/* Requirements */
.req-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.req-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.req-card h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

.req-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.req-card li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.req-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.6;
}

.req-card code {
  font-size: 0.8125rem;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Links */
.links-section { padding: 60px 0 80px; }

.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.link-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.link-icon { font-size: 1.5rem; }

.link-card strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 2px;
}

.link-card small {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  background: var(--text);
  color: #94a3b8;
  padding-top: 56px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 40px;
}

.footer-brand .logo { margin-bottom: 14px; }
.footer-brand .logo-text { color: #fff; }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; }

.footer-links { display: flex; gap: 56px; }

.footer-col h5 {
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 20px 0;
}

.footer-copyright {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.footer-copyright p {
  margin: 0;
  color: #64748b;
  font-size: 0.8125rem;
}

.footer-copyright a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-copyright a:hover { color: #94a3b8; }

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  background: var(--text);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 200;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Customer Service Widget ── */
.cs-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.cs-panel {
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  pointer-events: none;
}

.cs-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cs-panel-header {
  position: relative;
  padding: 18px 20px 14px;
  background: var(--gradient);
  color: #fff;
}

.cs-panel-header h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.cs-panel-header p {
  font-size: 0.75rem;
  opacity: 0.85;
}

.cs-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cs-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.cs-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.cs-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: var(--font);
}

.cs-tab:hover {
  background: var(--bg-alt);
}

.cs-tab.active {
  color: var(--primary);
  background: rgba(6, 182, 212, 0.06);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.cs-tab svg {
  flex-shrink: 0;
}

.cs-body {
  padding: 20px;
}

.cs-content {
  display: none;
  text-align: center;
}

.cs-content.active {
  display: block;
}

.cs-qrcode {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.cs-qrcode img {
  display: block;
  border-radius: 6px;
}

.cs-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.cs-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.cs-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cs-id {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'SF Mono', 'Consolas', monospace;
  text-align: left;
}

.cs-copy {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: var(--font);
}

.cs-copy:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--primary);
}

.cs-copy.copied {
  color: #10b981;
  border-color: #10b981;
}

.cs-qq-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #12b7f5 0%, #0099ff 100%);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.2s, transform 0.2s;
}

.cs-qq-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cs-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  background: var(--gradient);
  color: #fff;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cs-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(6, 182, 212, 0.45);
}

.cs-trigger.open .cs-trigger-icon { display: none; }
.cs-trigger:not(.open) .cs-trigger-close { display: none; }

.cs-trigger-icon,
.cs-trigger-close {
  flex-shrink: 0;
}

/* Animations */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease forwards;
}

.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.2s; }
.fade-up:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 14px;
    box-shadow: var(--shadow);
    margin-right: 0;
  }

  .script-grid,
  .req-grid,
  .links-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; }
  .footer-links { gap: 32px; }
}

@media (max-width: 600px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .install-steps { grid-template-columns: 1fr; }
  .install-card { padding: 20px; }
  .script-actions { flex-direction: column; }
  .script-actions .btn { width: 100%; }
  .nav-badge { display: none; }
  .cs-widget { right: 16px; bottom: 16px; }
  .cs-panel { width: calc(100vw - 32px); max-width: 280px; }
  .cs-trigger-text { display: none; }
  .cs-trigger { padding: 14px; border-radius: 50%; }
}
