/* ==================== 变量 ==================== */
:root {
  --blue: #4D6BFE;
  --blue-deep: #1E3A8A;
  --navy: #0F2A5C;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #5b6472;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f6f8ff;
  --card: #ffffff;
  --light: #eef2ff;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(15, 42, 92, .08);
  --shadow-lg: 0 16px 50px rgba(15, 42, 92, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --ink: #e6edff;
  --ink-2: #b9c6e8;
  --muted: #8b96b3;
  --line: #26304a;
  --bg: #0b1226;
  --bg-alt: #101a33;
  --card: #131f3d;
  --light: #16224a;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 50px rgba(0,0,0,.5);
}

/* ==================== 基础 ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  background: var(--light);
  color: var(--blue-deep);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: .86em;
  border: 1px solid var(--line);
}

/* ==================== 导航 ==================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px;
}
.brand { font-weight: 800; font-size: 1.02rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--blue); font-size: 1.1rem; }
.brand-sub {
  font-size: .72rem; font-weight: 600; color: var(--blue);
  border: 1px solid var(--blue); border-radius: 99px; padding: 1px 8px;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink-2); font-size: .9rem; padding: 6px 11px; border-radius: 8px; white-space: nowrap;
}
.nav-links a:hover { background: var(--light); color: var(--blue); text-decoration: none; }
.nav-links a.active { background: var(--light); color: var(--blue); font-weight: 600; }
.theme-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 1rem;
}

/* ==================== Hero ==================== */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: 120px 24px 80px; overflow: hidden;
  background: radial-gradient(1200px 600px at 70% -10%, #6b8bff22, transparent),
              radial-gradient(900px 500px at 10% 110%, #1e3a8a22, transparent),
              linear-gradient(160deg, #0F2A5C 0%, #12306e 45%, #1E3A8A 100%);
  color: #fff;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 34px 34px;
  animation: drift 22s linear infinite;
}
.hero-grid { position: absolute; inset: 0; opacity: .5; }
.hero-content { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; text-align: center; }
.hero-kicker { font-weight: 700; letter-spacing: .18em; color: #c7d2fe; font-size: .95rem; margin-bottom: 18px; }
.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.05;
  background: linear-gradient(120deg, #ffffff, #b7c6ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: clamp(1.15rem, 2.6vw, 1.7rem); font-weight: 600; margin-top: 12px; color: #eef2ff; }
.hero-desc { margin-top: 14px; color: #c7d2fe; font-size: 1.05rem; }
.hero-tags { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.tag {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  padding: 8px 16px; border-radius: 99px; font-size: .92rem; font-weight: 500;
  backdrop-filter: blur(4px);
}
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 34px; }
.btn { padding: 13px 26px; border-radius: 12px; font-weight: 700; font-size: 1rem; transition: .2s; }
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 10px 30px rgba(77,107,254,.45); }
.btn-primary:hover { background: #3d5bf0; }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.hero-meta { margin-top: 26px; color: #9db0e8; font-size: .9rem; }
.hero-scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: #c7d2fe; font-size: 1.4rem; animation: bounce 1.8s infinite;
}

/* ==================== 通用 section ==================== */
.section { padding: 88px 24px; max-width: 1180px; margin: 0 auto; }
.section.alt { background: var(--bg-alt); max-width: none; }
.section.alt > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; text-align: center;
  letter-spacing: -.01em; color: var(--ink);
}
.section-lead { text-align: center; color: var(--muted); margin: 14px auto 40px; max-width: 720px; font-size: 1.02rem; }
.sub-title { text-align: center; margin-top: 56px; font-size: 1.3rem; }

/* ==================== 卡片 ==================== */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; box-shadow: var(--shadow); transition: .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--blue); }
.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card p { color: var(--ink-2); font-size: .96rem; }
.card-emoji { font-size: 2.1rem; margin-bottom: 12px; }

/* ==================== 对比（聊天 vs 办事） ==================== */
.compare { display: flex; align-items: stretch; gap: 18px; justify-content: center; flex-wrap: wrap; }
.compare-box {
  flex: 1 1 260px; max-width: 320px; border-radius: var(--radius); padding: 30px 24px;
  border: 1px solid var(--line); background: var(--card); text-align: center;
}
.compare-box.muted { background: var(--bg-alt); border-style: dashed; }
.compare-box.accent { background: linear-gradient(160deg, var(--light), #fff); border: 2px solid var(--blue); }
.compare-box h3 { font-size: 1.25rem; margin-bottom: 10px; }
.compare-box .big { font-size: 1.7rem; font-weight: 800; }
.compare-box .small { color: var(--muted); margin-top: 6px; }
.compare-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 150px; }
.compare-arrow span { color: var(--blue); font-weight: 700; font-size: .92rem; }
.arrow-line { width: 130px; height: 2px; background: var(--line); position: relative; }
.arrow-line i { position: absolute; right: -1px; top: -4px; border: 6px solid transparent; border-left-color: var(--blue); }
.arrow-line::after {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--blue), transparent);
  animation: dash 1.6s linear infinite;
}

/* ==================== 痛点 ==================== */
.pain { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.pain h3 { margin-bottom: 14px; font-size: 1.15rem; }
.pain ul { list-style: none; }
.pain li { padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--ink-2); }
.pain li:last-child { border-bottom: none; }
.pain.fix { background: linear-gradient(160deg, var(--light), var(--card)); border-color: var(--blue); }
.big-line { font-size: 1.35rem; font-weight: 800; color: var(--blue-deep); margin: 10px 0; }

/* ==================== 设计理念 ==================== */
.principle { display: grid; gap: 22px; }
.principle-main {
  background: linear-gradient(135deg, var(--navy), var(--blue-deep));
  color: #fff; border-radius: var(--radius); padding: 30px 28px; text-align: center;
}
.principle-main h3 { font-size: 1.6rem; }
.principle-main p { color: #c7d2fe; margin-top: 8px; }
.principle-num {
  display: inline-block; background: var(--blue); padding: 3px 14px; border-radius: 99px;
  font-weight: 700; font-size: .85rem; margin-bottom: 12px;
}
.rule {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start;
}
.rule span { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: var(--light); color: var(--blue); font-weight: 800; display: grid; place-items: center; }
.rule p { color: var(--ink-2); font-size: .95rem; }

/* ==================== 图示容器 ==================== */
.diagram {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 16px; box-shadow: var(--shadow); overflow-x: auto; margin-top: 8px;
}
.diagram .mermaid { display: flex; justify-content: center; }
.note {
  background: var(--light); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; color: var(--ink-2); margin-top: 20px; font-size: .98rem;
}
.note b { color: var(--blue-deep); }

/* ==================== 叠胶片 ==================== */
.stack { max-width: 720px; margin: 30px auto 0; display: flex; flex-direction: column; gap: 0; position: relative; }
.stack-layer {
  background: var(--card); border: 1.5px solid var(--blue); border-radius: 12px;
  padding: 14px 18px; display: flex; align-items: center; gap: 14px;
  margin-bottom: -6px; position: relative; z-index: 1; cursor: default;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.stack-layer:hover { transform: translateX(8px) scale(1.02); z-index: 10; box-shadow: var(--shadow-lg); background: var(--light); }
.stack-layer .order {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}
.stack-layer b { display: block; }
.stack-layer i { font-style: normal; color: var(--muted); font-size: .88rem; }
.stack::before {
  content: "↑ 越靠上优先级越高"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; color: var(--blue); font-weight: 700; font-size: .85rem; letter-spacing: .1em;
}

/* ==================== 事件 tabs ==================== */
.tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.tab {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 10px 20px; border-radius: 99px; font-weight: 600; cursor: pointer; font-size: .95rem; transition: .2s;
}
.tab:hover { border-color: var(--blue); color: var(--blue); }
.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.event-stage { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: center; }
.event-desc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.event-desc h3 { font-size: 1.3rem; margin-bottom: 8px; }
.event-desc p { color: var(--ink-2); }
.event-viz {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; min-height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}

/* ==================== 循环动画 ==================== */
.loop { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; position: relative; margin-bottom: 40px; }
.loop-node {
  background: var(--card); border: 1.5px solid var(--blue); border-radius: 12px;
  padding: 14px 16px; text-align: center; font-weight: 600; font-size: .92rem;
  position: relative; transition: .2s;
}
.loop-node span {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff;
  font-size: .75rem; line-height: 22px; margin-right: 4px;
}
.loop-node.done { background: var(--light); border-color: var(--blue-deep); }
.loop-node:hover { transform: scale(1.06); box-shadow: var(--shadow); }
.loop-arrow { color: var(--blue); font-size: 1.4rem; font-weight: 800; }
.loop-back {
  width: 100%; text-align: center; color: var(--blue); font-weight: 700; font-size: .95rem;
  position: relative; margin-top: 4px;
}
.loop-back::before {
  content: "⤴"; display: inline-block; margin-right: 6px;
  animation: loop-up 1.8s ease-in-out infinite;
}

/* ==================== 工具网格 ==================== */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tool {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  transition: .2s;
}
.tool:hover { transform: translateY(-4px); border-color: var(--blue); box-shadow: var(--shadow); }
.tool-ico { font-size: 1.6rem; }
.tool h4 { margin: 10px 0 8px; font-size: 1.05rem; }
.tool p { color: var(--ink-2); font-size: .86rem; line-height: 1.9; }
.tool code { font-size: .78em; }

/* ==================== 表格 ==================== */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: .94rem; }
th { background: var(--light); color: var(--blue-deep); font-weight: 700; white-space: nowrap; }
tbody tr:hover { background: var(--bg-alt); }
td:first-child { font-weight: 600; white-space: nowrap; }
.table-note { color: var(--muted); font-size: .85rem; padding: 12px 16px; }

/* ==================== 参考资料 ==================== */
.refs { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin: 0 auto; }
.refs a {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
  color: var(--ink); font-weight: 600; transition: .2s; display: flex; align-items: center; gap: 8px;
}
.refs a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; transform: translateX(4px); }

/* ==================== 页脚 ==================== */
.footer { background: var(--navy); color: #9db0e8; text-align: center; padding: 40px 24px; }
.footer p { margin: 4px 0; font-size: .9rem; }

/* ==================== 动画 ==================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@keyframes drift { to { background-position: 340px 340px; } }
@keyframes bounce { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,10px); } }
@keyframes dash { to { background-position: -130px 0; } }
@keyframes loop-up { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ==================== 响应式 ==================== */
@media (max-width: 860px) {
  .grid3, .grid2, .event-stage { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .compare-arrow { min-width: auto; flex-direction: row; }
  .loop { gap: 6px; }
  .section { padding: 60px 18px; }
  .stack::before { display: none; }
}

/* Mermaid 深色适配 */
[data-theme="dark"] .mermaid svg .nodeLabel, 
[data-theme="dark"] .mermaid svg .edgeLabel,
[data-theme="dark"] .mermaid svg text { fill: var(--ink) !important; }
[data-theme="dark"] .mermaid svg .node rect, 
[data-theme="dark"] .mermaid svg .node polygon,
[data-theme="dark"] .mermaid svg .node circle { fill: var(--card) !important; stroke: var(--blue) !important; }
[data-theme="dark"] .mermaid svg .edgePath path { stroke: var(--muted) !important; }
[data-theme="dark"] .mermaid svg .cluster rect { fill: var(--bg-alt) !important; stroke: var(--line) !important; }
