/* ============================================================
   Codesign4QC 官网样式 — 深色开发者风
   ============================================================ */

:root {
  --bg: #0b0e14;
  --bg-alt: #0e1219;
  --card: #131722;
  --card-border: #1e2532;
  --text: #d6dae3;
  --text-dim: #8a93a6;
  --accent: #4a9eff;
  --accent-soft: rgba(74, 158, 255, 0.12);
  --ok: #66c47a;
  --warn: #f0c445;
  --err: #f56164;
  --term-bg: rgba(8, 10, 14, 0.96);
  --radius: 12px;
  --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.accent { color: var(--accent); }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo { width: 28px; height: 28px; }

.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.brand-name em { font-style: normal; color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--accent-soft);
  color: var(--accent) !important;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(74, 158, 255, 0.3);
  transition: background 0.2s;
}

.nav-cta:hover { background: rgba(74, 158, 255, 0.2); }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 70px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(74, 158, 255, 0.08), transparent),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(74, 158, 255, 0.3);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 17px;
  margin-bottom: 30px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 34px;
}

.hero-points {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.hero-points li::before {
  content: "✓ ";
  color: var(--ok);
  font-weight: 700;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(74, 158, 255, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(74, 158, 255, 0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1px solid var(--card-border);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-disabled {
  pointer-events: none;
  opacity: 0.55;
  background: var(--text-dim);
  box-shadow: none;
}

/* ---------- 终端卡片 ---------- */
.hero-terminal {
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--term-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-red { background: rgba(245, 98, 100, 0.9); }
.dot-yellow { background: rgba(240, 196, 69, 0.9); }
.dot-green { background: rgba(102, 196, 122, 0.9); }

.term-title {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.term-phase {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
}

.term-body {
  padding: 18px 16px;
  overflow-x: auto;
}

.term-body code {
  background: none;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: #d5dae4;
  white-space: pre;
}

.t-dim { color: #5d6879; }
.t-ok { color: var(--ok); }
.t-warn { color: var(--warn); }
.t-err { color: var(--err); }

/* ---------- 通用 Section ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
}

.section-sub {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 48px;
  font-size: 15.5px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.25s, transform 0.25s;
}

.card:hover { border-color: rgba(74, 158, 255, 0.4); }

/* ---------- 工作流 ---------- */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.step { position: relative; }

.step-num {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step h3 { font-size: 18px; margin-bottom: 8px; }

.step p { font-size: 14px; color: var(--text-dim); }

/* ---------- 双入口 ---------- */
.entries-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.entry-icon { font-size: 30px; margin-bottom: 12px; }

.entry h3 { font-size: 20px; margin-bottom: 4px; }

.entry-tag {
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 14px;
}

.entry ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.entry li {
  font-size: 14px;
  color: var(--text-dim);
  padding-left: 18px;
  position: relative;
}

.entry li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.entries-note {
  margin-top: 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-dim);
}

/* ---------- 功能矩阵 ---------- */
.table-wrap {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.matrix th {
  text-align: left;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 13.5px;
  border-bottom: 1px solid var(--card-border);
}

.matrix th:not(:first-child),
.matrix td:not(:first-child) {
  text-align: center;
  width: 110px;
}

.matrix td {
  padding: 11px 20px;
  border-bottom: 1px solid rgba(30, 37, 50, 0.6);
  color: var(--text-dim);
}

.matrix tr:last-child td { border-bottom: none; }
.matrix tr:hover td { background: rgba(74, 158, 255, 0.04); }

/* ---------- 下载 ---------- */
.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 36px;
}

.download-main h3 { font-size: 21px; margin-bottom: 14px; }

.download-req {
  list-style: none;
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.download-req li {
  font-size: 14px;
  color: var(--text-dim);
  padding-left: 18px;
  position: relative;
}

.download-req li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}

.download-note {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 10px 14px;
}

.download-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.download-version {
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: "SF Mono", ui-monospace, monospace;
}

/* ---------- 安全声明 ---------- */
.security {
  border-color: rgba(240, 196, 69, 0.35);
  background: rgba(240, 196, 69, 0.05);
  padding: 24px 28px;
}

.security h3 { font-size: 16px; margin-bottom: 8px; color: var(--warn); }

.security p { font-size: 14px; color: var(--text-dim); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand { font-weight: 700; font-size: 15px; }

.footer-links { display: flex; gap: 20px; }

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-copy { font-size: 12.5px; color: var(--text-dim); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 34px; }
  .workflow-grid { grid-template-columns: 1fr 1fr; }
  .entries-grid { grid-template-columns: 1fr; }
  .download-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .nav-burger { display: flex; }

  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(11, 14, 20, 0.97);
    border-bottom: 1px solid var(--card-border);
    display: none;
    padding: 8px 0;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 13px 24px;
    font-size: 15px;
  }

  .nav-cta {
    margin: 8px 24px 10px;
    text-align: center;
  }

  .hero { padding: 56px 0 50px; }
  .hero h1 { font-size: 29px; }
  .hero-points { grid-template-columns: 1fr; }
  .workflow-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .section-title { font-size: 24px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ---------- 滚动渐入 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .card, .hero-terminal {
    animation: fade-up 0.6s ease both;
  }

  @keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
