/* =========================================================
   心飞外卖 · 项目官网 样式（GitHub Pages）
   品牌金 #ffc200 / 暖橙；明暗双主题；响应式
   ========================================================= */

:root {
  --brand: #ffc200;
  --brand-600: #f0b400;
  --accent: #ff7a1a;
  --bg: #f6f7fb;
  --bg-soft: #eef0f7;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --text: #1f2430;
  --text-2: #4b5563;
  --muted: #8a93a5;
  --border: #e6e9f2;
  --code-bg: #1e2230;
  --code-text: #e6e8ee;
  --shadow: 0 8px 30px rgba(20, 28, 60, .08);
  --shadow-sm: 0 2px 10px rgba(20, 28, 60, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #ffc200;
  --brand-600: #ffcf33;
  --accent: #ff8a3d;
  --bg: #0d0f14;
  --bg-soft: #13161e;
  --surface: #161a23;
  --surface-2: #1c212c;
  --text: #e8ebf2;
  --text-2: #b3bad0;
  --muted: #838ca1;
  --border: #272d3b;
  --code-bg: #10131b;
  --code-text: #e6e8ee;
  --shadow: 0 10px 36px rgba(0, 0, 0, .45);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* 兜底：作者样式（如 .gallery{display:grid}）会覆盖 UA 的 [hidden]{display:none}，
   导致 hidden 属性失效，需显式提权 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ============ 顶部导航 ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; height: 64px; gap: 20px; }
.nav-logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; }
.nav-logo .bowl { font-size: 22px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 7px 12px; border-radius: 8px; font-size: 14.5px; color: var(--text-2);
  transition: .18s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg-soft); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; font-size: 17px; transition: .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--brand); }

.nav-toggle { display: none; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 11px 20px; border-radius: 10px; font-size: 15px; font-weight: 700;
  border: 1px solid transparent; transition: .18s; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #2a2100; }
.btn-primary:hover { background: var(--brand-600); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 194, 0, .35); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); transform: translateY(-2px); }
.btn-dark { background: #24292f; color: #fff; }
.btn-dark:hover { background: #343b44; transform: translateY(-2px); }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* ============ Hero ============ */
.hero {
  position: relative; padding: 138px 0 84px; overflow: hidden;
  background:
    radial-gradient(1100px 480px at 78% -8%, rgba(255, 194, 0, .28), transparent 60%),
    radial-gradient(800px 420px at 8% 10%, rgba(255, 122, 26, .18), transparent 60%),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 54px; align-items: center; }
.hero h1 { font-size: 52px; line-height: 1.12; margin: 0 0 14px; letter-spacing: -.5px; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: 19px; color: var(--text-2); margin: 0 0 22px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.badge {
  font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 34px; }

.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stats .num { font-size: 30px; font-weight: 800; color: var(--text); }
.hero-stats .lab { font-size: 13px; color: var(--muted); }

.hero-shot {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); background: var(--surface);
  transform: perspective(1400px) rotateY(-9deg) rotateX(3deg);
  transition: transform .5s;
}
.hero-shot:hover { transform: perspective(1400px) rotateY(0) rotateX(0); }
.hero-shot img { width: 100%; }
.hero-shot .cap { padding: 12px 16px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--border); }

/* ============ 通用区块 ============ */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 52px; }
.section-head .eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: var(--accent); margin-bottom: 12px; text-transform: uppercase;
}
.section-head h2 { font-size: 36px; margin: 0 0 14px; letter-spacing: -.5px; }
.section-head p { font-size: 17px; color: var(--text-2); margin: 0; }

/* ============ 特性卡 ============ */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; transition: .2s;
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); }
.feature .ico {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  font-size: 24px; margin-bottom: 16px;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
}
.feature h3 { margin: 0 0 8px; font-size: 17.5px; }
.feature p { margin: 0; font-size: 14px; color: var(--text-2); }

/* ============ 界面画廊 ============ */
.gallery-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 34px; flex-wrap: wrap; }
.gallery-tabs button {
  padding: 9px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-weight: 600; cursor: pointer; font-size: 14.5px; transition: .18s;
}
.gallery-tabs button.active { background: var(--brand); color: #2a2100; border-color: var(--brand); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.shot {
  border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border);
  background: var(--surface); cursor: zoom-in; transition: .2s;
}
.shot:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.shot img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top; }
.shot .cap { padding: 11px 14px; font-size: 14px; font-weight: 600; border-top: 1px solid var(--border); }
.shot .cap span { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 6px; }

/* ============ 功能矩阵 ============ */
.matrix { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.mx-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.mx-card h3 { margin: 0 0 16px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.mx-list { display: flex; flex-wrap: wrap; gap: 9px; }
.mx-list span {
  font-size: 13.5px; padding: 6px 13px; border-radius: 8px;
  background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border);
}

/* ============ AI 专区 ============ */
.ai-band {
  border-radius: 20px; padding: 56px; color: #141a2e;
  background: linear-gradient(120deg, #ffe08a, #ffc200 45%, #ff9d3d);
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
}
:root[data-theme="dark"] .ai-band { color: #1a1500; }
.ai-band h2 { font-size: 32px; margin: 0 0 14px; }
.ai-band p { font-size: 16px; margin: 0 0 20px; }
.ai-points { display: grid; gap: 12px; }
.ai-points div { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; font-weight: 600; }
.ai-points b { font-size: 18px; }
.ai-chat {
  background: rgba(20, 26, 46, .93); color: #dfe6f5; border-radius: 16px; padding: 20px;
  font-size: 13.5px; box-shadow: 0 18px 50px rgba(0,0,0,.3);
}
.ai-chat .bubble { padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; max-width: 88%; }
.ai-chat .u { background: rgba(255,255,255,.1); margin-left: auto; }
.ai-chat .a { background: linear-gradient(120deg, var(--brand), var(--accent)); color: #1a1500; font-weight: 600; }
.ai-chat .typing { color: #9fb0d0; }
.ai-chat .typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #9fb0d0; margin-right: 3px; animation: blink 1.2s infinite; }
.ai-chat .typing i:nth-child(2){ animation-delay:.2s } .ai-chat .typing i:nth-child(3){ animation-delay:.4s }
@keyframes blink { 0%,60%,100%{opacity:.25} 30%{opacity:1} }

/* ============ 技术栈 ============ */
.techs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.tech {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  font-weight: 600; font-size: 14.5px;
}
.tech small { color: var(--muted); font-weight: 500; }

/* ============ 架构 ============ */
.arch { display: grid; gap: 12px; max-width: 880px; margin: 0 auto; }
.arch-layer {
  border-radius: 12px; padding: 18px 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
}
.arch-layer .t { font-weight: 800; margin-bottom: 6px; }
.arch-layer .d { font-size: 13.5px; color: var(--text-2); }
.arch-arrow { text-align: center; color: var(--muted); font-size: 18px; }
.arch-layer.l1 { border-top: 3px solid var(--brand); }
.arch-layer.l2 { border-top: 3px solid var(--accent); }
.arch-layer.l3 { border-top: 3px solid #36c275; }
.arch-layer.l4 { border-top: 3px solid #4a90e2; }

/* ============ 快速开始 代码 ============ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step .n {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #2a2100;
  font-weight: 800; display: grid; place-items: center; margin-bottom: 14px;
}
.step h3 { margin: 0 0 8px; font-size: 17px; }
.step p { margin: 0; font-size: 14px; color: var(--text-2); }

.codeblock {
  background: var(--code-bg); color: var(--code-text); border-radius: 12px;
  margin: 0 0 18px; overflow: hidden; border: 1px solid var(--border);
}
.codebar { display: flex; align-items: center; padding: 9px 16px; gap: 7px; border-bottom: 1px solid rgba(255,255,255,.08); }
.codebar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.codebar i:nth-child(2){ background: #febc2e; } .codebar i:nth-child(3){ background: #28c840; }
.codebar .fname { margin-left: 10px; font-size: 12.5px; color: #93a0bd; }
.codebar .copy { margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.18); color: #c6d0e6; padding: 3px 11px; border-radius: 7px; font-size: 12px; cursor: pointer; }
.codebar .copy:hover { border-color: var(--brand); color: var(--brand); }
pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }
.codeblock .cmt { color: #7d8aa8; } .codeblock .kw { color: #ff9d3d; }

/* ============ FAQ ============ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.faq-item summary {
  padding: 17px 22px; cursor: pointer; font-weight: 700; font-size: 15.5px; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; color: var(--muted); transition: .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq-item .body { padding: 0 22px 18px; color: var(--text-2); font-size: 14.5px; }

/* ============ 社区 ============ */
.community { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.comm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; text-align: center; }
.comm-card .ico { font-size: 34px; margin-bottom: 14px; }
.comm-card h3 { margin: 0 0 8px; font-size: 18px; }
.comm-card p { margin: 0 0 14px; font-size: 14px; color: var(--text-2); }
.comm-card .qr { width: 150px; margin: 14px auto 0; border-radius: 10px; border: 1px solid var(--border); }

/* ============ 页脚 ============ */
.footer { border-top: 1px solid var(--border); padding: 46px 0 34px; background: var(--bg-soft); }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: center; }
.footer .logo { font-weight: 800; font-size: 17px; }
.footer .links { display: flex; gap: 18px; font-size: 14px; color: var(--text-2); flex-wrap: wrap; }
.footer .links a:hover { color: var(--accent); }
.footer .copy { width: 100%; margin-top: 20px; font-size: 13px; color: var(--muted); }

/* ============ 灯箱 ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center;
  background: rgba(8, 10, 18, .86); backdrop-filter: blur(4px); padding: 40px;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox .close { position: absolute; top: 22px; right: 28px; color: #fff; font-size: 34px; cursor: pointer; }

/* ============ 滚动显现 ============ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============ 响应式 ============ */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-shot { transform: none; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .ai-band { grid-template-columns: 1fr; padding: 40px; }
  .steps { grid-template-columns: 1fr; }
  .community { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle { display: grid; place-items: center; }
  .hero { padding: 112px 0 60px; }
  .hero h1 { font-size: 38px; }
  .hero .lead { font-size: 16.5px; }
  .section { padding: 60px 0; }
  .section-head h2 { font-size: 28px; }
  .features, .gallery, .matrix { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
}
