/* ============================================================
   DSH Manager 官网样式 - 明暗双主题
   ============================================================ */

/* ====== 深色主题（默认） ====== */
:root[data-theme="dark"] {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #818CF8;
  --primary-bg: rgba(79, 70, 229, 0.15);
  --accent: #06B6D4;
  --accent-dark: #0891B2;

  --gradient-1: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%);
  --gradient-2: linear-gradient(135deg, #7C3AED 0%, #4F46E5 50%, #06B6D4 100%);

  --bg-primary: #0B0D17;
  --bg-secondary: #111827;
  --bg-card: #1F2937;
  --bg-elevated: #374151;
  --bg-hover: rgba(255, 255, 255, 0.05);

  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  --border: #374151;
  --border-light: #4B5563;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);

  --navbar-bg: rgba(11, 13, 23, 0.85);
  --code-bg: #0B0D17;
  --hero-grid-opacity: 0.15;
}

/* ====== 浅色主题 ====== */
:root[data-theme="light"] {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #6D28D9;
  --primary-bg: rgba(79, 70, 229, 0.08);
  --accent: #0891B2;
  --accent-dark: #0E7490;

  --gradient-1: linear-gradient(135deg, #4F46E5 0%, #0891B2 100%);
  --gradient-2: linear-gradient(135deg, #7C3AED 0%, #4F46E5 50%, #0891B2 100%);

  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-elevated: #E2E8F0;
  --bg-hover: rgba(15, 23, 42, 0.04);

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-dim: #94A3B8;

  --border: #E2E8F0;
  --border-light: #CBD5E1;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.1);

  --navbar-bg: rgba(248, 250, 252, 0.88);
  --code-bg: #0F172A;
  --hero-grid-opacity: 0.08;
}

/* ====== 基础 ====== */
:root {
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --container: 1200px;
  --nav-height: 72px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  color-scheme: light dark;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border-radius: 4px;
  color: var(--accent);
}
::selection { background: var(--primary); color: white; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ====== 导航栏 ====== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
}
.brand-icon { font-size: 1.5rem; }
.brand-accent {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }

.nav-gh {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-left: 8px;
}
.nav-gh:hover { border-color: var(--border-light); }
.nav-mirror { font-size: 0.85rem; color: var(--text-dim); }
.nav-mirror:hover { color: var(--text-primary); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

/* 主题切换按钮 */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s;
}

/* ====== Hero ====== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 0 80px;
  overflow: hidden;
}
.hero .container { text-align: center; }

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: var(--hero-grid-opacity);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--primary-bg);
  border: 1px solid var(--primary-bg);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--primary-light);
  margin-bottom: 24px;
}
.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22C55E;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}
.gradient-text {
  background: var(--gradient-2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  max-width: 640px;
  margin: 0 auto 40px;
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid transparent;
  font-family: var(--font-sans);
}
.btn-primary {
  background: var(--gradient-1);
  color: white;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(79, 70, 229, 0.4); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--primary); }
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--text-primary); color: var(--text-primary); background: var(--bg-hover); }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-sm { padding: 8px 20px; font-size: 0.9rem; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.9rem; color: var(--text-dim); margin-top: 4px; }

/* ====== 通用区块 ====== */
.section { padding: 100px 0; position: relative; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: var(--primary-bg);
  border: 1px solid var(--primary-bg);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.section-desc {
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ====== 功能特性 ====== */
.features-section { background: var(--bg-secondary); }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-1);
  opacity: 0;
  transition: opacity 0.3s;
}
.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 12px; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

/* ====== 下载区 ====== */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: all 0.3s;
}
.download-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.download-icon { font-size: 2.5rem; margin-bottom: 16px; }
.download-card h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 6px; }
.download-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }
.download-format {
  display: inline-block;
  padding: 3px 12px;
  background: var(--primary-bg);
  border-radius: 100px;
  color: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.download-btn { width: 100%; }
.download-btn-sm { width: 100%; font-size: 0.85rem; padding: 8px 16px; }
.download-channels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.download-channels .btn svg { flex-shrink: 0; }
.download-note {
  text-align: center;
  margin-top: 32px;
  color: var(--text-dim);
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ====== 插件市场 ====== */
.marketplace-section { background: var(--bg-secondary); }
.marketplace-search {
  position: relative;
  max-width: 480px;
  margin: 0 auto 40px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}
.marketplace-search input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.marketplace-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.marketplace-search input::placeholder { color: var(--text-dim); }

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
  min-height: 200px;
}
.plugin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s;
}
.plugin-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.plugin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}
.plugin-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.plugin-name:hover { color: var(--primary-light); }
.plugin-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--warning, #F59E0B);
  font-weight: 600;
  white-space: nowrap;
}
.plugin-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.plugin-meta { display: flex; gap: 12px; font-size: 0.8rem; color: var(--text-dim); flex-wrap: wrap; }
.plugin-tag {
  padding: 2px 8px;
  background: var(--primary-bg);
  border-radius: 4px;
  color: var(--primary-light);
  font-size: 0.75rem;
  font-weight: 500;
}
.plugin-badge-recommended {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-radius: 4px;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
  line-height: 1.6;
}
.plugin-rank {
  display: inline-block;
  margin-right: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
}

/* 骨架屏 */
.skeleton { padding: 20px; }
.skeleton-line {
  height: 14px;
  background: var(--bg-elevated);
  border-radius: 4px;
  margin-bottom: 12px;
  animation: skeleton-loading 1.5s infinite;
}
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }
@keyframes skeleton-loading { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.6; } }

.marketplace-footer { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.marketplace-note { color: var(--text-muted); font-size: 0.9rem; }

/* ====== 文档/上手步骤 ====== */
.docs-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}
.doc-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s;
}
.doc-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.doc-step {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-1);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 16px;
}
.doc-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.doc-card p { color: var(--text-muted); font-size: 0.9rem; flex: 1; }

/* ====== CTA ====== */
.cta-section { background: var(--bg-secondary); text-align: center; }
.cta-content { max-width: 600px; margin: 0 auto; }
.cta-title { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800; margin-bottom: 16px; }
.cta-desc { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 32px; }
.cta-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* ====== 页脚 ====== */
.footer { padding: 60px 0 30px; border-top: 1px solid var(--border); }
.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.footer-brand { max-width: 240px; }
.footer-brand .brand-icon { font-size: 1.8rem; }
.footer-brand .brand-text { font-size: 1.2rem; font-weight: 700; }
.footer-desc { margin-top: 12px; color: var(--text-dim); font-size: 0.9rem; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 16px; }
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 8px;
}

/* ====== 滚动条 ====== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
  }
  .nav-links.active { display: flex; }
  .nav-toggle { display: flex; }
  .hero { padding: 110px 0 60px; }
  .hero-stats { gap: 24px; }
  .section { padding: 60px 0; }
  .features-grid, .download-grid, .docs-steps { grid-template-columns: 1fr; }
  .footer-content { flex-direction: column; gap: 32px; }
  .footer-links { gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ====== 动画 ====== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.section { animation: fadeInUp 0.6s ease-out; }