/* ============================================
   JustClaw 1.4 - 主样式表（优化版）
   蓝紫主题 | 响应式 | 暗色/亮色双模式
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --theme-primary: #6366f1;
  --theme-secondary: #8b5cf6;
  --bg: #0f0f14;
  --bg-light: #16161d;
  --bg-lighter: #1c1c24;
  --card-bg: rgba(22, 22, 29, 0.7);
  --text: #f9fafb;
  --text-muted: #a1a1aa;
  --text-dimmer: #777777;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);
  --shadow: rgba(0, 0, 0, 0.3);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 20px;
  --radius-sm: 12px;
  --blur: 12px;
}
:root.light {
  --bg: #fcfcfc;
  --bg-light: #ffffff;
  --bg-lighter: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.7);
  --text: #111111;
  --text-muted: #555555;
  --text-dimmer: #888888;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.15);
  --shadow: rgba(0, 0, 0, 0.1);
  --blur: 8px;
}

/* ---------- 基础重置 ---------- */
*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 5rem;
  position: relative;
  overflow-x: hidden;
  opacity: 0;
  animation: pageFadeIn 1s ease forwards 0.2s;
  transition: background 0.5s ease, color 0.5s ease;
}

@keyframes pageFadeIn { to { opacity: 1; } }

/* ---------- 无障碍：跳过导航 ---------- */
.skip-nav {
  position: absolute; top: -100%; left: 1rem; z-index: 10000;
  padding: 0.6rem 1.2rem; background: var(--theme-primary); color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: top 0.2s;
}
.skip-nav:focus { top: 0; outline: 2px solid var(--theme-primary); outline-offset: 2px; }

/* ---------- 滚动进度条 ---------- */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  width: 0%; z-index: 9999; transition: width 0.2s ease;
}

/* ---------- 鼠标跟随光效 ---------- */
#mouse-glow {
  position: fixed; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(45,126,255,0.1), transparent 70%);
  pointer-events: none; z-index: 0; transform: translate(-50%, -50%);
  border-radius: 50%; will-change: transform;
}
.light #mouse-glow { background: radial-gradient(circle, rgba(45,126,255,0.05), transparent 70%); }

/* ---------- 顶栏导航 ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; background: var(--card-bg);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border); padding: 0.7rem 0;
  box-shadow: 0 4px 20px var(--shadow); z-index: 990;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1); contain: layout style;
}
.nav-container { max-width: 1000px; margin: 0 auto; padding: 0 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-logo {
  font-size: 1.25rem; font-weight: 700;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; cursor: pointer; transition: transform 0.3s ease; border: none; padding: 0;
}
.nav-logo:hover { transform: scale(1.05); }
.nav-links { display: flex; gap: 1rem; }
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  position: relative; padding: 0.3rem 0; white-space: nowrap; transition: color 0.3s ease;
}
.nav-links a::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: 0%; height: 2px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary)); transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--text); }
.nav-controls { display: flex; gap: 0.6rem; align-items: center; }
.theme-btn,.lang-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg-light);
  border: 1px solid var(--border); color: var(--text); font-size: 0.85rem;
  font-family: inherit; font-weight: 600; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); padding: 0; line-height: 1; white-space: nowrap;
}
.theme-btn:hover,.lang-btn:hover {
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  color: #fff; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(45,126,255,0.2);
}

/* ---------- 容器与 Logo ---------- */
.container { max-width: 1000px; margin: 0 auto; padding: 0 1.2rem; position: relative; z-index: 1; }
.logo-container { text-align: center; margin: 2.5rem auto 1rem; padding-top: 0.5rem; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.logo { width: 120px; height: 120px; max-width: 90%; display: inline-block; vertical-align: middle; }



/* ---- Hero CSS 已移至 hero-animation.css ---- */

/* ---------- 内容区块 ---------- */

.version-badge {
  display: inline-block; margin-top: 1rem; padding: 0.4rem 1rem; border-radius: 999px;
  background: var(--card-bg); backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur)); color: var(--theme-primary);
  font-size: 0.85rem; font-weight: 600; border: 1px solid var(--border);
}

/* ---------- 内容区块 ---------- */
.section { margin: 1.5rem 0; opacity: 1; }
.section.visible { opacity: 1; transform: translateY(0); }
.section h2 { font-size: clamp(1.4rem, 5vw, 1.8rem); text-align: center; margin-bottom: 1.8rem; color: var(--text); position: relative; }
.section h2::after {
  content: ""; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary)); border-radius: 3px;
}

/* ---------- 卡片盒 ---------- */
.box {
  background: var(--card-bg); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--radius); padding: clamp(1.5rem, 5vw, 2.2rem);
  border: 1px solid var(--border); box-shadow: 0 8px 30px var(--shadow); transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.box:hover { box-shadow: 0 12px 40px var(--shadow); border-color: rgba(45,126,255,0.2); }
.box ol,.box ul { padding-left: 1.6rem; color: var(--text-muted); line-height: 1.8; }

/* ---------- 命令行区块 ---------- */
.cmd-line {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-light); padding: 1rem 1.2rem;
  border-radius: var(--radius-sm); margin-top: 1.2rem; border: 1px solid var(--border);
  gap: 1rem; transition: border-color 0.3s ease;
}
.cmd-line:hover { border-color: var(--theme-primary); }
.cmd-code { font-family: Consolas, "Courier New", monospace; color: var(--theme-primary); font-size: 0.95rem; word-break: break-all; position: relative; }
.cmd-code::after { content: "|"; position: absolute; right: -8px; animation: blink 1s infinite; color: var(--theme-primary); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.copy-btn {
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  color: #fff; border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 500; transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap; position: relative; overflow: hidden; font-family: inherit; font-size: 0.9rem;
}
.copy-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(45,126,255,0.2); }
.copy-btn:active { transform: translateY(0); }

/* ---------- 特性网格 ---------- */
.features,.model-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 1.5rem; margin: 2rem 0;
}
.feature-card,.model-card {
  background: var(--card-bg); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--radius); padding: clamp(1.4rem, 5vw, 1.8rem); border: 1px solid var(--border);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  position: relative; overflow: hidden; box-shadow: 0 5px 15px var(--shadow); contain: layout style;
}
.feature-card::before,.model-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary)); opacity: 0; transition: opacity 0.3s ease;
}
.feature-card:hover::before,.model-card:hover::before { opacity: 1; }
.feature-card:hover,.model-card:hover {
  transform: translateY(-6px); border-color: rgba(45,126,255,0.2); box-shadow: 0 12px 25px var(--shadow);
}
.feature-card h3,.model-card h3 { font-size: 1.1rem; margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.5rem; }
.feature-card p,.model-card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
.model-tag {
  display: inline-block; padding: 0.2rem 0.7rem; border-radius: 6px; font-size: 0.75rem;
  background: var(--bg-light); color: var(--theme-primary); margin-top: 0.8rem; font-weight: 500; border: 1px solid var(--border);
}

/* ---------- 系统要求网格 ---------- */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.spec-item {
  color: var(--text-muted); font-size: 0.95rem; padding: 0.8rem; background: var(--bg-light);
  border-radius: var(--radius-sm); border: 1px solid var(--border); transition: border-color 0.3s ease, transform 0.3s ease;
}
.spec-item:hover { border-color: var(--theme-primary); transform: translateY(-2px); }
.spec-item strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 0.3rem; }
.spec-item.success { border-left: 3px solid var(--success); }
.spec-item.warning { border-left: 3px solid var(--warning); }

/* ---------- FAQ 手风琴 ---------- */
.faq-item {
  margin-bottom: 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: padding-left 0.3s ease, border-left-color 0.3s ease;
}
.faq-item:hover { padding-left: 8px; border-left: 3px solid var(--theme-primary); }
.faq-q { font-weight: 600; margin-bottom: 0.5rem; color: var(--text); display: flex; justify-content: space-between; align-items: center; font-size: 1rem; user-select: text; }
.faq-a { color: var(--text-muted); max-height: 0; overflow: hidden; transition: max-height 0.4s ease; font-size: 0.95rem; line-height: 1.7; user-select: text; }
.faq-a.open { max-height: 150px; }
.faq-arrow { transition: transform 0.3s ease; font-size: 0.8rem; color: var(--theme-primary); flex-shrink: 0; }
.faq-arrow.open { transform: rotate(180deg); }

/* ---------- 下载区域 ---------- */
.download-wrap { text-align: center; margin: 2rem 0; }
.download-btn {
  display: inline-flex; align-items: center; gap: 0.8rem;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  color: #fff; font-weight: 600; padding: 1.1rem 2.5rem; border-radius: var(--radius-sm);
  text-decoration: none; transition: transform 0.3s ease, box-shadow 0.3s ease;
  font-size: 1rem; box-shadow: 0 8px 20px rgba(45,126,255,0.15); position: relative; overflow: hidden;
}
.download-btn::before {
  content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transition: left 0.6s ease;
}
.download-btn:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(45,126,255,0.25); }
.download-btn:hover::before { left: 100%; }
.download-btn:active { transform: translateY(-1px); }
.download-btn i { font-style: normal; font-size: 1.2rem; }

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; text-align: center;
  color: var(--text-muted); font-size: 0.9rem; margin-top: 2rem; background: var(--card-bg);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--radius) var(--radius) 0 0; margin-left: -1.2rem; margin-right: -1.2rem;
  padding-left: 1.2rem; padding-right: 1.2rem; opacity: 0; animation: fadeInUp 0.8s ease forwards 1s;
}
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.3s ease, transform 0.3s ease; font-size: 0.9rem; }
.footer-links a:hover { color: var(--theme-primary); transform: translateY(-2px); }

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed; bottom: 2rem; right: 1.5rem; width: 45px; height: 45px; border-radius: 50%;
  background: var(--card-bg); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border); color: var(--text); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  opacity: 0; pointer-events: none; z-index: 900; box-shadow: 0 4px 15px var(--shadow);
}
.back-top.show { opacity: 1; pointer-events: all; }
.back-top:hover { background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary)); color: #fff; transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 20px rgba(45,126,255,0.2); }
.back-top:focus-visible { outline: 2px solid var(--theme-primary); outline-offset: 3px; }

/* ---------- 水波纹动画 ---------- */
.ripple { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.25); transform: scale(0); animation: rippleAnim 0.6s linear forwards; pointer-events: none; }
@keyframes rippleAnim { to { transform: scale(5); opacity: 0; } }

/* ---------- 无障碍：焦点样式 ---------- */
:focus-visible { outline: 2px solid var(--theme-primary); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: rgba(45,126,255,0.3); color: var(--text); }

/* ---------- 响应式：平板/手机 ---------- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .theme-btn,.lang-btn { width: 36px; height: 36px; font-size: 0.8rem; }
  .logo { width: 100px; height: 100px; }
  .logo-container { margin: 2rem 0 1rem; }
  .cmd-line { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .copy-btn { align-self: flex-end; }
  .features,.model-grid { gap: 1.2rem; }
  .cmd-code::after { display: none; }
  .chat-container { width: calc(100% - 40px); height: 70vh; bottom: 80px; }
}
@media (max-width: 480px) { .nav-logo{font-size:1.1rem} .download-btn{padding:1rem 2rem;font-size:0.95rem} }

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--theme-primary); }

/* ---------- 无障碍：减少动画 ---------- */
@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; }
  #mouse-glow { display: none; }
  .logo { animation: none; }
}

/* ---------- 无障碍：高对比度模式 ---------- */
@media (prefers-contrast: more) {
  .feature-card,.model-card,.box { border-width: 2px; border-color: var(--border-strong); }
  .back-top,.theme-btn,.lang-btn { border-width: 2px; }
}

/* ---------- 飞书语音助手区块 ---------- */
#voice-assistant {
  background: var(--card-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1rem, 4vw, 2rem);
  margin: 2rem auto;
  max-width: 680px;
  text-align: center;
}
#voice-assistant h2 { font-size: clamp(1.3rem, 4vw, 1.7rem); margin-bottom: 0.8rem; color: var(--text); }
#voice-assistant .va-subtitle { color: var(--text-muted); margin-bottom: 0.5rem; }
#voice-assistant .va-desc { color: var(--text-dimmer); font-size: 0.9rem; margin-bottom: 1.2rem; }
#voice-assistant .va-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 1.2rem; text-align: left; }
#voice-assistant .va-feat-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
#voice-assistant .va-feat-icon { color: var(--theme-primary); flex-shrink: 0; }
#voice-assistant .va-pricing { font-size: 1.1rem; font-weight: 700; color: var(--theme-primary); margin-bottom: 0.6rem; }
#voice-assistant .va-cta {
  display: inline-block; padding: 0.6rem 1.5rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  color: #fff; text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s; margin-bottom: 0.4rem;
}
#voice-assistant .va-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.3); }
#voice-assistant .va-hint { font-size: 0.78rem; color: var(--text-dimmer); }

/* ---------- 打印样式 ---------- */
@media print {
  .navbar,.back-top,.chat-float-btn,.chat-window,#progress-bar,#mouse-glow { display: none !important; }
  body { background: #fff; color: #000; }
  .container { max-width: 100%; }
}
