/* ==========================================================================
   Hiddle Design System — Linear/Vercel 极简深色风
   引用: <link rel="stylesheet" href="/static/css/hiddle.css">
   命名空间: 全部以 .h- 开头, 不与现有 .aimg-* / .bgr-* / .wf-* 冲突
   ========================================================================== */

:root {
  /* === 颜色 === */
  --h-bg-base:      #0a0a0a;        /* 页面底色 */
  --h-bg-elevated:  #111111;        /* 二级面板 (hero / 大区块) */
  --h-bg-card:      #161616;        /* 卡片 */
  --h-bg-card-hover:#1c1c1c;        /* 卡片 hover */
  --h-bg-overlay:   rgba(255,255,255,0.04);
  --h-bg-input:     #0e0e0e;        /* 输入框背景 */
  --h-bg-active:    rgba(167,139,250,0.10); /* 选中态 */

  --h-border-subtle:   rgba(255,255,255,0.06);
  --h-border-default:  rgba(255,255,255,0.10);
  --h-border-strong:   rgba(255,255,255,0.18);
  --h-border-accent:   rgba(167,139,250,0.50);

  --h-text:        #e5e5e5;          /* 正文 */
  --h-text-muted:  #a1a1aa;          /* 次要 */
  --h-text-dim:    #71717a;          /* 弱 */
  --h-text-faint:  #52525b;          /* 最弱, 装饰用 */
  --h-text-bright: #fafafa;          /* 标题 */

  --h-accent:        #a78bfa;        /* 主色: 柔紫 */
  --h-accent-hover:  #c4b5fd;
  --h-accent-dim:    rgba(167,139,250,0.16);
  --h-accent-text:   #1a0a2e;        /* 紫色 button 上的字 */

  --h-blue:    #60a5fa;
  --h-success: #4ade80;
  --h-warn:    #fbbf24;
  --h-error:   #f87171;

  /* === 圆角 === */
  --h-r-sm: 6px;
  --h-r-md: 10px;
  --h-r-lg: 14px;
  --h-r-xl: 20px;
  --h-r-full: 9999px;

  /* === 阴影 === */
  --h-shadow-sm:  0 1px 2px rgba(0,0,0,.6);
  --h-shadow-md:  0 4px 12px rgba(0,0,0,.5);
  --h-shadow-lg:  0 12px 32px rgba(0,0,0,.55);
  --h-shadow-glow:0 0 0 1px rgba(167,139,250,.30), 0 8px 24px rgba(167,139,250,.15);

  /* === 字体 === */
  --h-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, system-ui, sans-serif;
  --h-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Monaco, Consolas, monospace;

  /* === 过渡 === */
  --h-trans-fast: 120ms ease-out;
  --h-trans:      180ms ease-out;
  --h-trans-slow: 320ms ease-out;
}

/* === 全局基线 === */
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body.h-body {
  margin: 0;
  background: var(--h-bg-base);
  color: var(--h-text);
  font-family: var(--h-font);
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
.h-body * { box-sizing: border-box; }

/* 选区颜色 */
.h-body ::selection { background: var(--h-accent-dim); color: var(--h-text-bright); }

/* 链接 */
.h-body a { color: inherit; text-decoration: none; transition: color var(--h-trans-fast); }
.h-body a:hover { color: var(--h-accent); }

/* ==========================================================================
   顶部导航 .h-nav
   ========================================================================== */
.h-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
  background: rgba(10,10,10,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--h-border-subtle);
}
.h-nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: var(--h-text-bright);
  letter-spacing: -0.01em;
}
.h-nav-logo .dot {
  width: 18px; height: 18px; border-radius: 4px;
  background: linear-gradient(135deg, var(--h-accent), var(--h-blue));
  box-shadow: 0 0 16px rgba(167,139,250,.45);
}
.h-nav-links { display: flex; gap: 4px; flex: 1; }
.h-nav-link {
  padding: 6px 12px; border-radius: var(--h-r-md);
  font-size: 13px; color: var(--h-text-muted); font-weight: 500;
  transition: all var(--h-trans-fast);
}
.h-nav-link:hover { background: var(--h-bg-overlay); color: var(--h-text); }
.h-nav-link.is-on { color: var(--h-text-bright); background: var(--h-bg-overlay); }

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

/* ==========================================================================
   按钮 .h-btn
   ========================================================================== */
.h-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border: 1px solid var(--h-border-default);
  background: var(--h-bg-overlay);
  color: var(--h-text);
  font-family: inherit; font-size: 13px; font-weight: 500;
  border-radius: var(--h-r-md);
  cursor: pointer;
  transition: all var(--h-trans-fast);
  white-space: nowrap;
  text-decoration: none;
}
.h-btn:hover { background: rgba(255,255,255,0.07); border-color: var(--h-border-strong); color: var(--h-text-bright); }
.h-btn:active { transform: translateY(1px); }
.h-btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.h-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--h-border-accent); }

.h-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.h-btn-lg { height: 44px; padding: 0 22px; font-size: 14px; }

.h-btn-primary {
  background: var(--h-text-bright);
  color: #000;
  border-color: transparent;
}
.h-btn-primary:hover { background: #fff; color: #000; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 8px 24px rgba(255,255,255,.08); }

.h-btn-accent {
  background: var(--h-accent);
  color: var(--h-accent-text);
  border-color: transparent;
  font-weight: 600;
}
.h-btn-accent:hover { background: var(--h-accent-hover); color: var(--h-accent-text); box-shadow: 0 0 0 1px rgba(167,139,250,.5), 0 8px 24px rgba(167,139,250,.20); }

.h-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--h-text-muted);
}
.h-btn-ghost:hover { background: var(--h-bg-overlay); color: var(--h-text); border-color: var(--h-border-default); }

/* ==========================================================================
   输入框 / 文本域 .h-input .h-textarea .h-select
   ========================================================================== */
.h-input, .h-textarea, .h-select {
  width: 100%;
  background: var(--h-bg-input);
  border: 1px solid var(--h-border-default);
  border-radius: var(--h-r-md);
  padding: 10px 12px;
  color: var(--h-text);
  font-family: inherit; font-size: 14px; line-height: 1.5;
  outline: none;
  transition: border-color var(--h-trans-fast), box-shadow var(--h-trans-fast);
  box-sizing: border-box;
}
.h-input::placeholder, .h-textarea::placeholder { color: var(--h-text-dim); }
.h-input:hover, .h-textarea:hover, .h-select:hover { border-color: var(--h-border-strong); }
.h-input:focus, .h-textarea:focus, .h-select:focus {
  border-color: var(--h-border-accent);
  box-shadow: 0 0 0 3px rgba(167,139,250,.12);
}
.h-textarea { resize: vertical; min-height: 80px; font-family: inherit; }

.h-input-group {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--h-border-default);
  border-radius: var(--h-r-md);
  background: var(--h-bg-input);
  transition: border-color var(--h-trans-fast), box-shadow var(--h-trans-fast);
}
.h-input-group:focus-within { border-color: var(--h-border-accent); box-shadow: 0 0 0 3px rgba(167,139,250,.12); }
.h-input-group .h-input, .h-input-group .h-select {
  border: none; background: transparent; box-shadow: none;
}
.h-input-group .h-input:focus, .h-input-group .h-select:focus { box-shadow: none; }
.h-input-group .h-divider { width: 1px; align-self: stretch; background: var(--h-border-subtle); margin: 4px 0; }
.h-input-group .h-btn-primary { margin: 4px; height: 32px; }

/* ==========================================================================
   卡片 .h-card / .h-panel
   ========================================================================== */
.h-card {
  background: var(--h-bg-card);
  border: 1px solid var(--h-border-subtle);
  border-radius: var(--h-r-lg);
  padding: 20px;
  transition: border-color var(--h-trans-fast), background var(--h-trans-fast), transform var(--h-trans-fast);
}
.h-card.is-link { cursor: pointer; display: block; text-decoration: none; color: inherit; }
.h-card.is-link:hover { border-color: var(--h-border-strong); background: var(--h-bg-card-hover); transform: translateY(-1px); }

.h-panel {
  background: var(--h-bg-elevated);
  border: 1px solid var(--h-border-subtle);
  border-radius: var(--h-r-xl);
  padding: 32px;
}

/* ==========================================================================
   芯片 / 标签 .h-chip .h-badge
   ========================================================================== */
.h-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: var(--h-r-full);
  background: var(--h-bg-overlay);
  border: 1px solid var(--h-border-subtle);
  color: var(--h-text-muted);
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.h-chip-accent { background: var(--h-accent-dim); color: var(--h-accent); border-color: var(--h-border-accent); }
.h-chip-success { background: rgba(74,222,128,.08); color: var(--h-success); border-color: rgba(74,222,128,.30); }
.h-chip-warn { background: rgba(251,191,36,.08); color: var(--h-warn); border-color: rgba(251,191,36,.30); }
.h-chip-mute { background: var(--h-bg-overlay); color: var(--h-text-dim); border-color: var(--h-border-subtle); }

.h-badge-new {
  display: inline-block; padding: 2px 8px;
  background: linear-gradient(135deg, var(--h-accent), var(--h-blue));
  color: #0a0a0a; font-size: 10px; font-weight: 700;
  border-radius: var(--h-r-full); letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================================================
   栅格 / 容器
   ========================================================================== */
.h-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.h-container-narrow { max-width: 920px; margin: 0 auto; padding: 0 24px; }
.h-container-wide { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

.h-grid { display: grid; gap: 16px; }
.h-grid-2 { grid-template-columns: repeat(2, 1fr); }
.h-grid-3 { grid-template-columns: repeat(3, 1fr); }
.h-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
  .h-grid-4 { grid-template-columns: repeat(3, 1fr); }
  .h-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .h-grid-4, .h-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .h-grid-2 { grid-template-columns: 1fr; }
  .h-container, .h-container-narrow, .h-container-wide { padding: 0 16px; }
}

/* ==========================================================================
   Hero / 大标题
   ========================================================================== */
.h-hero {
  position: relative;
  padding: 64px 24px 56px;
  text-align: center;
  overflow: hidden;
}
.h-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(167,139,250,.18) 0%, transparent 60%),
    radial-gradient(40% 30% at 80% 20%, rgba(96,165,250,.10) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.h-hero > * { position: relative; z-index: 1; }

.h-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: var(--h-r-full);
  background: var(--h-bg-overlay);
  border: 1px solid var(--h-border-default);
  color: var(--h-text-muted);
  font-size: 12px; margin-bottom: 20px;
}
.h-hero-eyebrow .h-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--h-success); box-shadow: 0 0 10px var(--h-success);
  animation: h-pulse 2s ease-in-out infinite;
}
@keyframes h-pulse { 50% { opacity: .4; } }

.h-hero h1, .h-h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--h-text-bright);
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.h-hero p, .h-lead {
  margin: 0 auto 32px;
  max-width: 640px;
  font-size: 16px; line-height: 1.65;
  color: var(--h-text-muted);
}

/* ==========================================================================
   分区标题
   ========================================================================== */
.h-section { padding: 40px 0; }
.h-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}
.h-section-title {
  margin: 0; font-size: 20px; font-weight: 600;
  color: var(--h-text-bright); letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.h-section-sub { color: var(--h-text-dim); font-size: 13px; }

/* ==========================================================================
   工具卡片 (用于 AI 工具网格)
   ========================================================================== */
.h-tool {
  display: flex; flex-direction: column;
  background: var(--h-bg-card);
  border: 1px solid var(--h-border-subtle);
  border-radius: var(--h-r-lg);
  overflow: hidden;
  text-decoration: none; color: inherit;
  transition: all var(--h-trans);
  position: relative;
}
.h-tool::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 30%, rgba(167,139,250,.4) 70%, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity var(--h-trans);
  pointer-events: none;
}
.h-tool:hover { transform: translateY(-2px); background: var(--h-bg-card-hover); border-color: var(--h-border-strong); }
.h-tool:hover::after { opacity: 1; }
.h-tool-thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--h-bg-elevated);
  position: relative;
}
.h-tool-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--h-trans-slow);
}
.h-tool:hover .h-tool-thumb img { transform: scale(1.05); }
.h-tool-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10,10,10,.65) 100%);
  pointer-events: none;
}
.h-tool-body { padding: 14px 16px 16px; }
.h-tool-name {
  font-size: 14px; font-weight: 600; color: var(--h-text-bright);
  margin-bottom: 4px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.h-tool-desc {
  font-size: 12px; color: var(--h-text-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 36px;
}
.h-tool-foot {
  margin-top: 10px;
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--h-text-dim);
}

/* ==========================================================================
   工具栏 / 状态行
   ========================================================================== */
.h-status {
  padding: 8px 14px;
  background: var(--h-bg-elevated);
  border: 1px solid var(--h-border-subtle);
  border-radius: var(--h-r-md);
  font-size: 13px; color: var(--h-text-muted);
  display: flex; align-items: center; gap: 8px;
}
.h-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--h-text-dim); flex-shrink: 0;
}
.h-status.is-loading .dot { background: var(--h-warn); animation: h-pulse 1.2s infinite; }
.h-status.is-ready .dot { background: var(--h-success); }
.h-status.is-err .dot { background: var(--h-error); }

/* ==========================================================================
   Loading / Spinner
   ========================================================================== */
.h-spin {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(167,139,250,.18);
  border-top-color: var(--h-accent);
  animation: h-spin .8s linear infinite;
  display: inline-block;
}
.h-spin-lg { width: 44px; height: 44px; border-width: 3px; }
@keyframes h-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Footer
   ========================================================================== */
.h-footer {
  padding: 48px 24px 32px;
  border-top: 1px solid var(--h-border-subtle);
  color: var(--h-text-dim);
  font-size: 13px;
  text-align: center;
  margin-top: 64px;
}

/* ==========================================================================
   工具类
   ========================================================================== */
.h-mono { font-family: var(--h-mono); font-size: .9em; }
.h-text-muted { color: var(--h-text-muted); }
.h-text-dim { color: var(--h-text-dim); }
.h-text-bright { color: var(--h-text-bright); }
.h-text-accent { color: var(--h-accent); }
.h-text-success { color: var(--h-success); }
.h-text-error { color: var(--h-error); }

.h-divider { height: 1px; background: var(--h-border-subtle); margin: 24px 0; border: 0; }
