/* === CSS 自定义属性 === */
:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-dark: #1a1a2e;
  --color-text: #333;
  --color-text-secondary: #666;
  --color-text-muted: #999;
  --color-bg: #f8f9fa;
  --color-white: #ffffff;
  --color-border: #e0e0e0;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333; background: #f8f9fa; line-height: 1.7; min-height: 100vh;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 导航栏 */
.top-nav {
  background: var(--color-dark); color: white; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; height: 56px;
  position: sticky; top: 0; z-index: 100; flex-wrap: wrap;
}
.top-nav .brand { font-size: 17px; font-weight: 700; color: white; letter-spacing: 0.5px; }
.top-nav .brand:hover { text-decoration: none; opacity: 0.9; }
.nav-toggle {
  display: none; background: none; border: none; color: white; font-size: 24px;
  cursor: pointer; padding: 4px 8px; line-height: 1;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: #c0c8d8; padding: 8px 14px; border-radius: 6px; font-size: 14px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }

/* 容器 */
.container { max-width: 960px; margin: 0 auto; padding: 40px 20px; }

/* 首页 Hero */
.hero { text-align: center; padding: 60px 20px 40px; }
.hero h1 { font-size: 32px; font-weight: 800; color: #1a1a2e; margin-bottom: 12px; }
.hero p { font-size: 16px; color: #666; max-width: 560px; margin: 0 auto; }

/* 服务卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 32px 0; }
.card {
  background: white; border-radius: 12px; padding: 28px 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s; cursor: pointer; display: block; color: inherit;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); text-decoration: none; }
.card .icon { font-size: 28px; margin-bottom: 12px; }
.card h3 { font-size: 17px; color: #1a1a2e; margin-bottom: 6px; }
.card p { font-size: 13px; color: #777; }

/* CTA按钮 */
.btn {
  display: inline-block; padding: 12px 28px; border-radius: 8px; font-size: 15px;
  font-weight: 600; border: none; cursor: pointer; text-align: center; transition: background 0.2s;
}
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-outline { background: white; color: #2563eb; border: 2px solid #2563eb; }
.btn-outline:hover { background: #f0f4ff; text-decoration: none; }

/* 标签 */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px;
  font-weight: 500; background: #eef2ff; color: #2563eb;
}

/* 列表 */
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-item {
  background: white; border-radius: 10px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s;
}
.doc-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.doc-item h3 { font-size: 16px; margin-bottom: 6px; }
.doc-item h3 a { color: #1a1a2e; }
.doc-item .meta { font-size: 12px; color: #999; margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.doc-item .summary { font-size: 13px; color: #666; }

/* 筛选 tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.tabs button {
  padding: 6px 16px; border-radius: 20px; border: 1px solid #ddd; background: white;
  font-size: 13px; cursor: pointer; color: #666; transition: all 0.15s;
}
.tabs button.active, .tabs button:hover { background: #2563eb; color: white; border-color: #2563eb; }

/* 文章详情 */
.article-content { background: white; border-radius: 12px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.article-content h2 { font-size: 20px; color: #1a1a2e; margin: 24px 0 8px; }
.article-content h3 { font-size: 17px; color: #333; margin: 20px 0 6px; }
.article-content p { margin: 8px 0; }
.article-content ul, .article-content ol { margin: 8px 0; padding-left: 24px; }
.article-content li { margin: 4px 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.article-content th, .article-content td { border: 1px solid #e0e0e0; padding: 8px 12px; text-align: left; }
.article-content th { background: #f5f5f5; font-weight: 600; }
.article-content strong { color: #1a1a2e; }

/* 加载和空状态 */
.loading, .empty { text-align: center; padding: 60px 20px; color: #999; font-size: 14px; }
.loading::before { content: "⏳ "; }
.empty::before { content: "📭 "; }

/* CTA 底栏 */
.cta-bar { text-align: center; padding: 40px 20px; background: #1a1a2e; color: white; margin-top: 40px; border-radius: 12px; }
.cta-bar h3 { font-size: 18px; margin-bottom: 8px; }
.cta-bar p { font-size: 14px; color: #c0c8d8; margin-bottom: 16px; }
.cta-bar .btn-primary { background: white; color: #1a1a2e; }
.cta-bar .btn-primary:hover { background: #e0e0e0; }

/* 页脚 */
.footer { text-align: center; padding: 24px 20px; font-size: 12px; color: #aaa; }
.footer a { color: #666; }

/* 工具页 */
.tool-box { background: white; border-radius: 12px; padding: 28px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); margin-bottom: 20px; }
.tool-box h3 { font-size: 17px; margin-bottom: 12px; color: #1a1a2e; }
.tool-box label { display: block; font-size: 13px; color: #666; margin: 8px 0 4px; }
.tool-box input, .tool-box select {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
}
.tool-box .result { margin-top: 16px; padding: 16px; background: #f0f4ff; border-radius: 8px; font-size: 14px; display: none; }
.tool-box .result.show { display: block; }

/* 联系方式 */
.contact-card { background: white; border-radius: 12px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); text-align: center; }
.contact-card h2 { font-size: 22px; margin-bottom: 16px; }
.contact-card p { color: #666; margin: 8px 0; }

/* === 首页 Demo 组件样式 === */

/* 模块标题 */
.section-title {
  font-size: 18px; font-weight: 700; color: var(--color-dark);
  text-align: center; margin: 40px 0 20px;
}

/* Hero 搜索框 */
.hero-search-wrap {
  max-width: 520px; margin: 20px auto 0; position: relative;
}
.hero-search-wrap input {
  width: 100%; padding: 14px 52px 14px 20px; border: 2px solid var(--color-border);
  border-radius: var(--radius-full); font-size: 15px; outline: none;
  background: var(--color-white); transition: border-color 0.2s;
}
.hero-search-wrap input:focus { border-color: var(--color-primary); }
.hero-search-wrap button {
  position: absolute; right: 4px; top: 4px; bottom: 4px; width: 44px;
  background: var(--color-primary); color: white; border: none;
  border-radius: 50%; font-size: 18px; cursor: pointer; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.hero-search-wrap button:hover { background: var(--color-primary-hover); }

/* Hero 双 CTA */
.hero-cta-row {
  display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap;
}

/* 信任徽章 */
.trust-badges {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px;
}
.trust-badge {
  font-size: 13px; color: var(--color-text-secondary); background: var(--color-white);
  padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}

/* FAQ 折叠面板 */
.faq-list { max-width: 640px; margin: 0 auto; }
.faq-item {
  background: var(--color-white); border-radius: var(--radius-md); margin-bottom: 10px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.faq-question {
  padding: 16px 40px 16px 20px; cursor: pointer; font-size: 15px; font-weight: 500;
  color: var(--color-dark); list-style: none; position: relative;
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--color-primary); transition: transform 0.2s;
  font-weight: 400;
}
details[open] .faq-question::after { content: "−"; }
details[open] .faq-question {
  border-bottom: 1px solid #f0f0f0; color: var(--color-primary);
}
.faq-answer { padding: 0 20px 16px; font-size: 14px; color: var(--color-text-secondary); line-height: 1.8; }

/* 关于 Jason */
.about-card {
  background: var(--color-white); border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow-md); display: flex; gap: 24px; align-items: flex-start;
  flex-direction: column; max-width: 640px; margin: 0 auto;
}
.about-avatar {
  width: 100px; height: 100px; min-width: 100px; border-radius: 50%;
  background: var(--color-dark); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700;
  border: 3px dashed #ccc; align-self: center;
}
.about-text { font-size: 14px; color: var(--color-text-secondary); line-height: 1.9; }
.about-text .text-link { display: inline-block; margin-top: 8px; color: var(--color-primary); font-weight: 500; }

/* 最新文章 */
.article-grid {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  max-width: 640px; margin: 0 auto;
}
.article-card {
  background: var(--color-white); border-radius: var(--radius-md); padding: 20px 24px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.15s;
}
.article-card:hover { box-shadow: var(--shadow-lg); }
.article-card h3 { font-size: 16px; margin: 8px 0 6px; }
.article-card h3 a { color: var(--color-dark); }
.article-card time { font-size: 12px; color: var(--color-text-muted); }

/* AI 助手入口 */
.ai-entry-card {
  text-align: center; background: linear-gradient(135deg, #eef2ff, #f0f4ff);
  border-radius: var(--radius-xl); padding: 36px 24px; margin: 0 auto;
  border: 2px dashed var(--color-primary); max-width: 640px;
}
.ai-entry-card h3 { font-size: 18px; color: var(--color-dark); margin-bottom: 8px; }
.ai-entry-card p { font-size: 14px; color: var(--color-text-secondary); margin-bottom: 16px; }

/* 全局悬浮 CTA 按钮 */
.floating-cta {
  display: none;
  position: fixed; bottom: 24px; right: 20px; z-index: 200;
  background: var(--color-primary); color: white;
  padding: 14px 24px; border-radius: 28px; font-weight: 600; font-size: 15px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  text-decoration: none; white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}
.floating-cta:hover { background: var(--color-primary-hover); transform: translateY(-2px); text-decoration: none; }

/* 响应式 — 移动端 */
@media (max-width: 640px) {
  .hero h1 { font-size: 24px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; width: 100%; flex-direction: column;
    padding: 8px 0 12px; gap: 2px;
  }
  body.nav-open .nav-links { display: flex; }
  body.nav-open .top-nav { height: auto; }
  .nav-links a { padding: 10px 12px; font-size: 14px; width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .container { padding: 20px 16px; }
}

/* 移动端：显示悬浮按钮 */
@media (max-width: 768px) {
  .floating-cta { display: inline-block; }
}

/* 桌面端：增强布局 */
@media (min-width: 768px) {
  /* 容器放宽 */
  .container { max-width: 1120px; }

  /* Hero 左右分栏 */
  .hero { padding: 80px 32px 60px; }
  .hero-inner {
    max-width: 1120px; margin: 0 auto;
    display: flex; align-items: center; gap: 64px;
  }
  .hero-left { flex: 1; text-align: left; }
  .hero-left h1 { font-size: 40px; }
  .hero-left p { margin: 0; font-size: 17px; }
  .hero-left .hero-cta-row { justify-content: flex-start; }
  .hero-left .trust-badges { justify-content: flex-start; }
  .hero-right { flex: 1; display: flex; flex-direction: column; align-items: center; }
  .hero-search-wrap { width: 100%; max-width: 460px; }
  .hero-search-wrap input { padding: 18px 56px 18px 24px; font-size: 16px; }
  .hero-search-wrap button { width: 52px; font-size: 20px; }
  .hero-search-hint {
    margin-top: 12px; font-size: 13px; color: var(--color-text-muted);
  }

  /* 导航栏 */
  .top-nav { padding: 0 32px; }
  .nav-links a { padding: 8px 18px; }

  /* 服务卡片 — 4列 */
  .cards { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .card { padding: 36px 28px; }
  .card .icon { font-size: 36px; margin-bottom: 16px; }
  .card h3 { font-size: 18px; }
  .card p { font-size: 14px; }

  /* FAQ 两列 */
  .faq-list {
    max-width: 960px; display: grid;
    grid-template-columns: 1fr 1fr; gap: 12px;
  }
  .faq-item { margin-bottom: 0; }

  /* 关于 Jason — 宽卡片 */
  .about-card { max-width: 800px; padding: 40px; }
  .about-avatar { width: 120px; height: 120px; min-width: 120px; font-size: 42px; }
  .about-text { font-size: 16px; }

  /* 最新文章 — 三列宽 */
  .article-grid { max-width: 960px; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .article-card { padding: 24px 28px; }

  /* AI 入口 — 宽 */
  .ai-entry-card { max-width: 800px; padding: 52px 40px; }
  .ai-entry-card h3 { font-size: 22px; }

  /* 模块标题 */
  .section-title { font-size: 22px; margin: 56px 0 28px; }

  /* CTA 底栏 */
  .cta-bar { margin: 56px auto 0; max-width: 900px; border-radius: 16px; padding: 52px 32px; }
  .cta-bar h3 { font-size: 22px; }
  .cta-bar p { font-size: 16px; }
}
