/* ============================================================
   tShell 官网设计系统
   风格：Tokyo Night 暗色系 / 开发者工具调性
   ============================================================ */

:root {
  /* 色彩令牌 */
  --bg: #0d1117;
  --bg-elev: #131722;
  --bg-card: #161b28;
  --bg-term: #1a1b26;
  --border: #232a3a;
  --border-soft: #1c2333;
  --text: #e6e9f2;
  --text-dim: #9aa3b8;
  --text-faint: #6b7385;
  --accent: #7aa2f7;
  --accent-2: #bb9af7;
  --green: #9ece6a;
  --cyan: #7dcfff;
  --yellow: #e0af68;
  --red: #f7768e;
  --grad: linear-gradient(135deg, #7aa2f7 0%, #bb9af7 100%);
  /* 尺寸 */
  --nav-h: 64px;
  --radius: 14px;
  --radius-sm: 10px;
  --container: 1160px;
  /* 字体 */
  --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  /* 阴影 */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, .35);
  --shadow-glow: 0 0 40px rgba(122, 162, 247, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(122, 162, 247, .35); }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow { max-width: 820px; }

/* ============ 背景装饰 ============ */
.bg-decor { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(122, 162, 247, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 247, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

.bg-glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .5; }
.bg-glow-1 { width: 560px; height: 560px; top: -200px; right: -120px; background: rgba(122, 162, 247, .22); }
.bg-glow-2 { width: 480px; height: 480px; top: 40vh; left: -200px; background: rgba(187, 154, 247, .16); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-family: var(--font-sans);
  border: none; cursor: pointer; white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 8px 18px; font-size: 14px; }

.btn-primary {
  background: var(--grad); color: #0d1117;
  box-shadow: 0 4px 20px rgba(122, 162, 247, .35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(122, 162, 247, .5); }

.btn-ghost {
  background: rgba(122, 162, 247, .08); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(122, 162, 247, .16); transform: translateY(-2px); }

/* ============ 导航 ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(13, 17, 23, .72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled { border-bottom-color: var(--border-soft); background: rgba(13, 17, 23, .9); }

.nav-inner { display: flex; align-items: center; height: var(--nav-h); gap: 32px; }

.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.nav-logo-img { width: 30px; height: 30px; border-radius: 8px; }
.nav-logo-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links { display: flex; gap: 28px; margin-left: 12px; flex: 1; }
.nav-links a { font-size: 14px; color: var(--text-dim); transition: color .2s; }
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-github {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); transition: color .2s, transform .2s;
}
.nav-github:hover { color: var(--text); transform: translateY(-1px); }

.lang-toggle {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-family: var(--font-sans); transition: all .2s;
}
.lang-toggle:hover { color: var(--text); border-color: var(--accent); }

.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .25s; }

/* ============ Hero ============ */
.hero { padding: calc(var(--nav-h) + 88px) 0 96px; }

.hero-inner {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 64px; align-items: center;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(158, 206, 106, .1); border: 1px solid rgba(158, 206, 106, .3);
  color: var(--green); font-size: 13px; font-weight: 600;
  margin-bottom: 24px;
}
.hero-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hero-title {
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 800; line-height: 1.18;
  letter-spacing: -.02em; margin-bottom: 22px;
}

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub { font-size: 17px; color: var(--text-dim); max-width: 520px; margin-bottom: 36px; }

.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }

.hero-note { font-size: 13px; color: var(--text-faint); }

/* ============ 终端窗口（仿真） ============ */
.term-window {
  background: var(--bg-term);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.term-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--border-soft);
}

.term-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.term-dot-r { background: #f7768e; }
.term-dot-y { background: #e0af68; }
.term-dot-g { background: #9ece6a; }

.term-title {
  margin-left: 10px; font-size: 12px; color: var(--text-faint);
  font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.term-body {
  padding: 20px; min-height: 300px;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.9;
  text-align: left;
}

.term-line { white-space: pre-wrap; word-break: break-all; }
.term-output .term-line { animation: termLineIn .3s ease both; }

@keyframes termLineIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.t-prompt { color: var(--green); font-weight: 700; }
.t-path { color: var(--cyan); }
.t-cmd { color: var(--text); }
.t-cursor {
  display: inline-block; width: 8px; height: 17px;
  background: var(--accent); vertical-align: -3px; margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.t-ok { color: var(--green); }
.t-info { color: var(--cyan); }
.t-warn { color: var(--yellow); }
.t-dim { color: var(--text-faint); }
.t-accent { color: var(--accent); }

/* ============ StatsBar ============ */
.stats { padding: 24px 0 72px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding: 32px 40px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.stat { text-align: center; }
.stat-num {
  font-size: 30px; font-weight: 800; font-family: var(--font-mono);
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ============ 通用版块 ============ */
.section { padding: 96px 0; position: relative; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }

.section-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}

.section-title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }

.section-sub { margin-top: 14px; color: var(--text-dim); font-size: 16px; }

/* ============ 功能网格 ============ */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.feature-card {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 26px 24px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 162, 247, .45);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(122, 162, 247, .12); color: var(--accent);
  font-size: 21px; margin-bottom: 16px;
}

.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 13.5px; color: var(--text-dim); line-height: 1.65; }

/* ============ 截图展示 ============ */
.showcase-row {
  display: grid; grid-template-columns: 1fr 1.25fr;
  gap: 56px; align-items: center;
  margin-bottom: 88px;
}
.showcase-row:last-child { margin-bottom: 0; }
.showcase-row-rev .showcase-copy { order: 2; }
.showcase-row-rev .showcase-shot { order: 1; }

.showcase-copy h3 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 14px; }
.showcase-copy p { color: var(--text-dim); font-size: 15px; margin-bottom: 20px; }

.showcase-list { list-style: none; }
.showcase-list li {
  position: relative; padding-left: 26px; margin-bottom: 10px;
  font-size: 14.5px; color: var(--text);
}
.showcase-list li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  color: var(--green); font-weight: 700;
}

.shot-frame {
  position: relative; border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden; background: var(--bg-elev);
  box-shadow: var(--shadow-card);
  aspect-ratio: 16 / 10;
}
.shot-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shot-placeholder {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(122, 162, 247, .04) 18px 36px),
    var(--bg-elev);
}
.shot-missing .shot-placeholder { display: flex; }

.shot-no {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--accent); letter-spacing: .1em;
  padding: 6px 16px; border: 1px dashed rgba(122, 162, 247, .5); border-radius: 999px;
}
.shot-hint { font-size: 12.5px; color: var(--text-faint); }

/* ============ AI 版块 ============ */
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }

.ai-modes { display: flex; flex-direction: column; gap: 16px; }

.ai-mode-card {
  position: relative;
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 22px 24px 22px 92px;
  transition: border-color .25s ease, transform .25s ease;
}
.ai-mode-card:hover { border-color: rgba(187, 154, 247, .5); transform: translateX(6px); }

.ai-mode-tag {
  position: absolute; left: 24px; top: 22px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--accent-2); background: rgba(187, 154, 247, .12);
  padding: 5px 10px; border-radius: 8px;
}

.ai-mode-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.ai-mode-card p { font-size: 13.5px; color: var(--text-dim); }

.chat-window {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 14px;
}

.chat-bubble { max-width: 88%; padding: 12px 16px; border-radius: 14px; font-size: 13.5px; line-height: 1.7; }
.chat-user { align-self: flex-end; background: var(--grad); color: #0d1117; font-weight: 500; border-bottom-right-radius: 4px; }
.chat-ai { align-self: flex-start; background: rgba(122, 162, 247, .1); border: 1px solid var(--border-soft); border-bottom-left-radius: 4px; }
.chat-ai code {
  display: block; margin: 8px 0; padding: 8px 12px;
  background: var(--bg-term); border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--green);
  overflow-x: auto;
}
.chat-ai span { display: block; }

.chat-typing { display: flex; gap: 5px; padding: 4px 8px; }
.chat-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint);
  animation: typing 1.2s infinite;
}
.chat-typing i:nth-child(2) { animation-delay: .2s; }
.chat-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ============ 主题切换 ============ */
.themes-wrap { max-width: 760px; margin: 0 auto; }

.theme-swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 28px; }

.swatch {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 9px;
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  font-family: var(--font-sans);
  transition: all .2s ease;
}
.swatch:hover { border-color: var(--accent); color: var(--text); }
.swatch.active { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px rgba(122, 162, 247, .18); }

.swatch-dots { display: flex; }
.swatch-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg-card); margin-left: -5px; }
.swatch-dots i:first-child { margin-left: 0; }

.term-window-sm { max-width: 640px; margin: 0 auto; }
.theme-term { min-height: 0; transition: background .3s ease; }

.theme-term .tt-green { color: var(--green); }
.theme-term .tt-blue { color: var(--accent); }
.theme-term .tt-cyan { color: var(--cyan); }
.theme-term .tt-red { color: var(--red); }
.theme-term .tt-yellow { color: var(--yellow); }
.theme-term .tt-purple { color: var(--accent-2); }
.theme-term .tt-dim { color: var(--text-faint); }
.theme-term .tt-fg { color: var(--text); }

/* ============ 安全版块 ============ */
.security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.security-card {
  text-align: center;
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 40px 28px;
  transition: transform .25s ease, border-color .25s ease;
}
.security-card:hover { transform: translateY(-4px); border-color: rgba(158, 206, 106, .4); }

.security-icon {
  width: 56px; height: 56px; margin: 0 auto 18px;
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: rgba(158, 206, 106, .1); color: var(--green); font-size: 26px;
}

.security-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.security-card p { font-size: 14px; color: var(--text-dim); }

/* ============ 下载版块 ============ */
.section-download {
  background:
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(122, 162, 247, .12), transparent 70%);
}

.download-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 860px; margin: 0 auto; }

.download-card {
  text-align: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 18px; padding: 44px 32px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.download-card:hover {
  transform: translateY(-6px);
  border-color: rgba(122, 162, 247, .5);
  box-shadow: 0 16px 48px rgba(122, 162, 247, .2);
}

.download-os { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--text); }
.download-os h3 { font-size: 22px; font-weight: 800; }

.download-desc { color: var(--text-dim); font-size: 14px; margin-bottom: 26px; }

.download-btn { width: 100%; justify-content: center; }

.download-meta { margin-top: 16px; font-size: 12.5px; color: var(--text-faint); }

.download-linux { text-align: center; margin-top: 28px; font-size: 14px; color: var(--text-dim); }
.download-linux a { color: var(--accent); font-weight: 600; border-bottom: 1px dashed rgba(122, 162, 247, .5); padding-bottom: 1px; }
.download-linux a:hover { color: var(--accent-2); }

/* ============ FAQ ============ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: border-color .25s ease;
}
.faq-item[open] { border-color: rgba(122, 162, 247, .4); }

.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 18px 24px; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: color .2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 20px; font-weight: 400; color: var(--accent);
  transition: transform .25s ease; flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent); }

.faq-item p { padding: 0 24px 20px; font-size: 14px; color: var(--text-dim); }

/* ============ 页脚 ============ */
.footer { border-top: 1px solid var(--border-soft); padding: 56px 0 32px; background: rgba(13, 17, 23, .6); }

.footer-inner { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; margin-bottom: 40px; }

.footer-brand { display: flex; gap: 14px; align-items: flex-start; max-width: 320px; }
.footer-logo { width: 40px; height: 40px; border-radius: 10px; }
.footer-name { font-size: 18px; font-weight: 800; }
.footer-tag { font-size: 13.5px; color: var(--text-dim); margin-top: 4px; }

.footer-links { display: flex; gap: 72px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h5 { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: .04em; }
.footer-col a { font-size: 13.5px; color: var(--text-dim); transition: color .2s; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--text-faint);
}

/* ============ 滚动渐显 ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { gap: 44px; }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(13, 17, 23, .97);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-burger { display: flex; }

  .hero { padding-top: calc(var(--nav-h) + 56px); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-sub { max-width: none; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; padding: 28px 24px; }

  .showcase-row, .showcase-row-rev { grid-template-columns: 1fr; gap: 28px; margin-bottom: 64px; }
  .showcase-row-rev .showcase-copy { order: 1; }
  .showcase-row-rev .showcase-shot { order: 2; }

  .ai-grid { grid-template-columns: 1fr; }
  .security-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }

  .section { padding: 72px 0; }
  .footer-inner { flex-direction: column; }
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .term-body { font-size: 12px; padding: 16px; min-height: 240px; }
  .ai-mode-card { padding-left: 24px; padding-top: 56px; }
  .ai-mode-tag { top: 20px; }
  .footer-links { gap: 40px; }
}
