/* ============================================
   hunkclaw.fun — Design System
   "暗夜玩具房" — 暗色 + 玻璃拟态 + 渐变 + 微动效
   ============================================ */

:root {
  /* 色彩 — 落日橙主题 🌅 */
  --bg-deep:      #1f0f0a;
  --bg-card:      rgba(60, 30, 20, 0.65);
  --bg-card-solid:#2a1612;
  --border:       rgba(251, 146, 60, 0.25);
  --border-hover: rgba(251, 146, 60, 0.6);

  --primary:      #fb923c;   /* 橙 */
  --secondary:    #f472b6;   /* 粉 */
  --accent:       #a78bfa;   /* 紫 */
  --success:      #4ade80;
  --warning:      #fbbf24;
  --danger:       #f87171;

  --text:         #fff7ed;
  --text-mute:    #d6a78a;
  --text-faint:   #8b5a3c;

  /* 渐变 */
  --grad-brand:   linear-gradient(135deg, #fb923c 0%, #f472b6 100%);
  --grad-warm:    linear-gradient(135deg, #fb923c 0%, #ff5cae 100%);
  --grad-cool:    linear-gradient(135deg, #f472b6 0%, #a78bfa 100%);
  
  /* 字体 */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 
          'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  
  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 32px rgba(251, 146, 60, 0.35);
  
  /* 缓动 */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 动态渐变背景 — 落日余晕 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 10%, rgba(251,146,60,0.22), transparent 60%),
    radial-gradient(ellipse 600px 400px at 80% 90%, rgba(244,114,182,0.20), transparent 60%),
    radial-gradient(ellipse 500px 500px at 50% 50%, rgba(251,191,36,0.10), transparent 70%);
  z-index: -1;
  animation: drift 20s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, -2%) scale(1.1); }
}

/* 排版 */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; }
h3 { font-size: 1.25rem; line-height: 1.3; }
a  { color: var(--primary); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--secondary); }
code { font-family: var(--font-mono); font-size: 0.9em;
       background: rgba(251,146,60,0.18); padding: 2px 6px; border-radius: 4px; color: #fed7aa; }

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 导航栏 */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(10, 10, 20, 0.7);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1200px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; color: var(--text);
}
.brand-logo {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  display: block;
  box-shadow: var(--shadow-glow);
}
.nav-link.active {
  color: var(--text);
  background: rgba(251,146,60,0.18);
  box-shadow: inset 0 0 0 1px var(--border-hover);
}
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
  padding: 8px 14px; border-radius: var(--r-md);
  color: var(--text-mute); font-weight: 500; font-size: 14px;
  transition: all 0.2s var(--ease);
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* 主区 */
main { padding: 48px 0 96px; }

/* 卡片 — 玻璃拟态 */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: all 0.3s var(--ease);
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 32px rgba(251,146,60,0.25);
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border: none; border-radius: var(--r-md);
  font-family: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all 0.2s var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: var(--grad-brand);
  color: #1f0f0a;
  box-shadow: 0 4px 16px rgba(251,146,60,0.45);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(251,146,60,0.65);
  color: #1f0f0a;
}
.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* Tag */
.tag {
  display: inline-block;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: rgba(251,146,60,0.18);
  color: #fed7aa;
  border: 1px solid var(--border);
}

/* 状态点 */
.dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-faint);
}
.dot-online  { background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulse 2s infinite; }
.dot-idle    { background: var(--warning); }
.dot-offline { background: var(--text-faint); }
.dot-error   { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* 网格 */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* 响应式 */
@media (max-width: 640px) {
  .nav-inner { padding: 12px 16px; }
  .container { padding: 0 16px; }
  main { padding: 32px 0 64px; }
}

/* 可访问性 — 减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}