/* ==========================================================================
   cocoduck 品牌官网 - 小鸭星际舱 (Duck Galaxy) 全局核心样式表
   设计系统：深邃星际黑金视觉 | 实体纯正背景 | 响应式移动优先 | 无障碍保障
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-deep-space: #070a12;
  --bg-space-dark: #0c111e;
  --bg-card-solid: #111827;
  --bg-card-elevated: #162035;
  --border-starlight: rgba(255, 255, 255, 0.08);
  --border-starlight-glow: rgba(245, 158, 11, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-body: #cbd5e1;
  --duck-gold-300: #fde047;
  --duck-gold-400: #facc15;
  --duck-gold-500: #eab308;
  --duck-gold-600: #ca8a04;
  --starlight-cyan: #38bdf8;
  --starlight-indigo: #818cf8;
}

/* 基础重置与无水平溢出保证 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-deep-space);
  color: var(--text-body);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #151d36 0%, #070a12 70%);
  background-attachment: fixed;
}

/* 链接无障碍优化 */
a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

/* 触控目标不低于 44px */
button, .btn-action, input[type="radio"] + label, input[type="checkbox"] + label, a.btn-cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 容器定义 */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

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

/* 实用排版与色彩类 */
.text-gold-gradient {
  background: linear-gradient(135deg, #fef08a 0%, #fbbf24 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-cyan-gradient {
  background: linear-gradient(135deg, #e0f2fe 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 实色卡片基底 - 保证任何光影下文字阅读高度清晰 */
.card-solid {
  background-color: var(--bg-card-solid);
  border: 1px solid var(--border-starlight);
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

.card-solid:hover {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 20px 35px -10px rgba(245, 158, 11, 0.12);
}

/* 核心 CTA 黄金按钮 */
.btn-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #090d16;
  font-weight: 700;
  border-radius: 0.75rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  border: none;
  cursor: pointer;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #fde047 0%, #fbbf24 100%);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.btn-gold:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

/* 次要轮廓按钮 */
.btn-outline {
  background: rgba(17, 24, 39, 0.8);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

.btn-outline:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* 导航条固定 */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(7, 10, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-starlight);
}

/* 3D 星际舱 Canvas 容器 */
#duck-galaxy-container {
  width: 100%;
  height: 340px;
  position: relative;
  touch-action: pan-y; /* 允许页面垂直正常滚动，不劫持滚轮 */
}

@media (min-width: 768px) {
  #duck-galaxy-container {
    height: 480px;
  }
}

/* Markdown 文章内表格响应式优化 */
.prose table {
  width: 100%;
  border-collapse: collapse;
}

.prose th, .prose td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-starlight);
}

.prose code {
  font-family: 'JetBrains Mono', monospace;
}

/* 减弱动画设置支持 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
