/* ============================================================
   饭记 MealLog · 演示站
   设计方向：深夜食堂手账 —— 暖黑底、橘色火气、手写体、胶片颗粒
   全部使用系统字体栈，不依赖任何外部字体 / CDN，方便直接静态部署
   ============================================================ */

:root {
  /* 底色：不是纯黑，偏一点点暖 */
  --bg:        #08080a;
  --bg-soft:   #0d0d10;
  --card:      #15151a;
  --card-hi:   #1d1d23;
  --line:      rgba(255, 255, 255, 0.07);
  --line-hi:   rgba(255, 255, 255, 0.14);

  /* 文字：暖白，不用死白 */
  --text:      #f2ede6;
  --muted:     #8a8a92;
  --dim:       #5c5c64;

  /* 品牌：和 App 里 Ember 一致 */
  --ember:      #f26b3a;
  --ember-lite: #ff8f5e;
  --ember-deep: #8c3a16;
  --ember-wash: rgba(242, 107, 58, 0.10);

  /* App 里的语义色 */
  --green: #34c759;
  --amber: #ff9500;
  --gray:  #8e8e93;

  --hand: "Xingkai SC", "STXingkai", "华文行楷", "Kaiti SC", "KaiTi",
          "楷体", "楷体_GB2312", cursive, serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC",
          "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, ui-monospace, monospace;

  --wrap: 1180px;
  --r-lg: 26px;
  --r-md: 16px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* 胶片颗粒 —— 放在最上层但不吃点击 */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 1%); }
  40% { transform: translate(1%, -2%); }
  60% { transform: translate(-1%, -1%); }
  80% { transform: translate(2%, 2%); }
}

/* 顶部暖光晕，营造灶火气 */
body::before {
  content: "";
  position: fixed;
  top: -30vh;
  left: 50%;
  width: 120vw;
  height: 70vh;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(242, 107, 58, 0.16) 0%,
    rgba(242, 107, 58, 0.05) 35%,
    transparent 70%
  );
}

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

/* ---------------- 通用容器 ---------------- */

.wrap {
  width: min(var(--wrap), calc(100% - 48px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ---------------- 顶部导航 ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 8, 10, 0.75);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  width: min(var(--wrap), calc(100% - 48px));
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--hand);
  font-size: 21px;
  letter-spacing: 0.02em;
}
.brand b { color: var(--ember); font-weight: 400; }
.brand small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-left: 2px;
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.on { color: var(--text); }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(160deg, var(--ember-lite), var(--ember) 55%, #d84e21);
  color: #fff;
  box-shadow: 0 8px 26px -8px rgba(242, 107, 58, 0.65);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px rgba(242, 107, 58, 0.8);
}

.btn-ghost {
  border-color: var(--line-hi);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover {
  border-color: rgba(242, 107, 58, 0.5);
  background: var(--ember-wash);
  transform: translateY(-2px);
}

.btn-sm { padding: 9px 18px; font-size: 13.5px; }

/* ---------------- Hero ---------------- */

.hero {
  padding: 86px 0 40px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  padding: 6px 14px;
  border: 1px solid rgba(242, 107, 58, 0.32);
  border-radius: 999px;
  background: var(--ember-wash);
  margin-bottom: 28px;
}
.kicker i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 10px var(--ember);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero h1 {
  font-family: var(--hand);
  font-size: clamp(2.7rem, 6.2vw, 5rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 26px;
}
.hero h1 .hl {
  color: var(--ember);
  position: relative;
  white-space: nowrap;
}
/* 手绘下划线 */
.hero h1 .hl::after {
  content: "";
  position: absolute;
  left: 0; right: -4px;
  bottom: 0.02em;
  height: 0.34em;
  background: linear-gradient(90deg, rgba(242,107,58,.34), rgba(242,107,58,.06));
  border-radius: 40% 60% 55% 45%;
  z-index: -1;
}

.hero p.lead {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.95;
  max-width: 30em;
  margin-bottom: 38px;
}
.hero p.lead em {
  color: var(--text);
  font-style: normal;
  border-bottom: 1px dashed rgba(242, 107, 58, 0.5);
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.hero-meta {
  display: flex;
  gap: 30px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.hero-meta div { display: flex; flex-direction: column; gap: 3px; }
.hero-meta b {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}
.hero-meta span { font-size: 12px; color: var(--dim); letter-spacing: 0.05em; }

/* ---------------- 手机壳（全局组件） ---------------- */

.phone {
  position: relative;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  aspect-ratio: 1080 / 2340;
  border-radius: 42px;
  padding: 3px;
  background: linear-gradient(160deg, #3a3a42, #121216 30%, #26262c 70%, #0e0e11);
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.phone-screen {
  position: absolute;
  inset: 3px;
  border-radius: 39px;
  overflow: hidden;
  background: #000;
}
.phone-screen img,
.phone-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* 屏幕反光 */
.phone::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 39px;
  pointer-events: none;
  background: linear-gradient(
    116deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.02) 18%,
    transparent 42%
  );
}

/* 灵动岛 */
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 24px;
  background: #000;
  border-radius: 999px;
  z-index: 3;
  pointer-events: none;
}

.phone-glow {
  position: absolute;
  inset: -14% -22%;
  z-index: -1;
  background: radial-gradient(circle at 50% 45%, rgba(242, 107, 58, 0.22), transparent 62%);
  filter: blur(28px);
  pointer-events: none;
}

/* 倾斜的展示用手机 */
.phone-tilt {
  transform: perspective(1400px) rotateY(-13deg) rotateX(4deg) rotateZ(1.5deg);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.phone-tilt:hover {
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg) rotateZ(0deg) scale(1.015);
}

/* ---------------- 小结 / 卖点 ---------------- */

.section { padding: 96px 0; }
.section-head { margin-bottom: 54px; max-width: 44em; }
.section-head h2 {
  font-family: var(--hand);
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 16px;
}
.section-head p { color: var(--muted); font-size: 15.5px; line-height: 1.95; }

.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi) 18%, var(--line-hi) 82%, transparent);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  position: relative;
  background: linear-gradient(180deg, var(--card), rgba(21, 21, 26, 0.4));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 26px 28px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.35s, background 0.3s;
}
.feature:hover {
  border-color: rgba(242, 107, 58, 0.34);
  transform: translateY(-4px);
}
.feature::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 107, 58, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}
.feature:hover::before { opacity: 1; }

.feature .no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ember);
  margin-bottom: 18px;
}
.feature h3 {
  font-family: var(--hand);
  font-size: 25px;
  font-weight: 400;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}
.feature p { font-size: 14px; color: var(--muted); line-height: 1.9; }
.feature p b { color: var(--text); font-weight: 500; }

/* ---------------- 截图墙 ---------------- */

.shots {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 10px 0 30px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.shots::-webkit-scrollbar { height: 4px; }
.shots::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 999px; }
.shots::-webkit-scrollbar-track { background: transparent; }

.shot {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: start;
}
.shot .frame {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  transition: border-color 0.3s, transform 0.35s;
}
.shot:hover .frame {
  border-color: rgba(242, 107, 58, 0.4);
  transform: translateY(-5px);
}
.shot .frame img { width: 100%; aspect-ratio: 1080/2340; object-fit: cover; }
.shot figcaption {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.6;
}
.shot figcaption b { display: block; color: var(--muted); font-weight: 500; font-size: 13px; margin-bottom: 2px; }

/* ---------------- 架构 ---------------- */

.arch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.arch-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
  background: var(--card);
}
.arch-item .tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--dim);
  text-transform: uppercase;
}
.arch-item h4 {
  font-size: 16px;
  font-weight: 500;
  margin: 10px 0 8px;
}
.arch-item p { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.arch-item code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ember-lite);
  background: var(--ember-wash);
  padding: 1px 6px;
  border-radius: 5px;
}

/* ---------------- 页脚 ---------------- */

.foot {
  padding: 54px 0 66px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.foot-in {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
}
.foot .brand { font-size: 19px; }
.foot p { font-size: 12.5px; color: var(--dim); margin-top: 8px; line-height: 1.8; }
.foot a:hover { color: var(--ember); }

/* ---------------- 滚动入场 ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 46px; }
  .hero { padding: 46px 0 20px; }
  /* 手机上让文字先出现 —— 评委要先知道这是什么，再看长什么样 */
  .hero .phone-wrap { order: 0; }
  .hero .phone-wrap .phone { max-width: 268px; }
  .hero-meta { gap: 22px; }
  .features { grid-template-columns: 1fr; }
  .arch { grid-template-columns: 1fr; }
  .section { padding: 66px 0; }
  .nav-links a:not(.btn) { display: none; }
  .wrap, .nav-in { width: calc(100% - 36px); }
  .shot { width: 178px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 2.35rem; }
  .hero p.lead { font-size: 15.5px; }
  .btn { padding: 12px 20px; font-size: 14px; }
}

/* ============================================================
   下载页
   ============================================================ */

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--ember-lite);
  background: var(--ember-wash);
  padding: 1px 6px;
  border-radius: 5px;
}

.dl-head { padding: 74px 0 34px; max-width: 40em; }
.dl-head h1 {
  font-family: var(--hand);
  font-size: clamp(2.3rem, 5.2vw, 3.9rem);
  font-weight: 400;
  line-height: 1.22;
  margin-bottom: 20px;
}
.dl-head .lead { font-size: 16px; color: var(--muted); line-height: 1.95; }

/* 微信内提示 */
.dl-warn {
  border: 1px solid rgba(242, 107, 58, 0.42);
  background: linear-gradient(100deg, rgba(242, 107, 58, 0.16), rgba(242, 107, 58, 0.05));
  border-radius: var(--r-md);
  padding: 15px 20px;
  font-size: 14px;
  line-height: 1.8;
  color: #ffd9c8;
  margin-bottom: 26px;
}
.dl-warn b { color: #fff; }
.wx-dots {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  padding: 1px 6px;
  letter-spacing: 1px;
}

/* 下载卡 */
.dl-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--card-hi), var(--card) 60%);
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.dl-card::before {
  content: "";
  position: absolute;
  top: 0; left: 30px; right: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 107, 58, 0.55), transparent);
}
.dl-file { display: flex; align-items: center; gap: 22px; }
.dl-icon {
  width: 62px; height: 62px;
  flex: 0 0 auto;
  border-radius: 18px;
  display: grid; place-items: center;
  font-size: 26px;
  color: #fff;
  background: linear-gradient(155deg, var(--ember-lite), #d84e21);
  box-shadow: 0 12px 28px -10px rgba(242, 107, 58, 0.8);
}
.dl-meta h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
  font-family: var(--mono);
}
.dl-specs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 28px;
  max-width: 540px;
}
.dl-specs li { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; }
.dl-specs span { color: var(--dim); min-width: 2.4em; }
.dl-specs b { color: var(--muted); font-weight: 400; }
.dl-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* 现状说明 */
.dl-note {
  margin-top: 22px;
  border-left: 3px solid var(--ember);
  background: linear-gradient(90deg, rgba(242, 107, 58, 0.09), transparent 65%);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 24px 26px;
}
.dl-note-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 10px;
}
.dl-note h3 {
  font-family: var(--hand);
  font-size: 23px;
  font-weight: 400;
  margin-bottom: 12px;
}
.dl-note p { font-size: 14px; color: var(--muted); line-height: 1.95; margin-bottom: 10px; }
.dl-note p:last-child { margin-bottom: 0; }
.dl-note b { color: var(--text); font-weight: 500; }
.dl-note a { color: var(--ember); border-bottom: 1px solid rgba(242, 107, 58, 0.4); }

/* 安装步骤 */
.dl-steps { padding: 66px 0 0; }
.dl-steps h2, .dl-qr h2 {
  font-family: var(--hand);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 400;
  margin-bottom: 26px;
}
.dl-steps ol {
  list-style: none;
  counter-reset: s;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.dl-steps li {
  counter-increment: s;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 22px;
  background: var(--card);
  position: relative;
}
.dl-steps li::before {
  content: "0" counter(s);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ember);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 12px;
}
.dl-steps b { display: block; font-size: 15.5px; font-weight: 500; margin-bottom: 8px; }
.dl-steps p { font-size: 13px; color: var(--muted); line-height: 1.85; }

/* 扫码区 */
.dl-qr {
  padding: 66px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.dl-qr > div:first-child { max-width: 30em; }
.dl-qr p { font-size: 14px; color: var(--muted); line-height: 1.95; }
.qr-box {
  width: 168px; height: 168px;
  flex: 0 0 auto;
  border: 1.5px dashed var(--line-hi);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--dim);
  font-size: 13px;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.014) 0 8px,
    transparent 8px 16px
  );
}
.qr-box small { font-size: 10.5px; color: var(--dim); opacity: 0.75; }

/* 二维码放进去以后：去掉虚线占位感，白底 + 内边距，保证扫码识别率 */
.qr-box--filled {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.12);
  background: #fff;
  padding: 10px;
  gap: 0;
}
.qr-box--filled img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 900px) {
  .dl-head { padding: 44px 0 26px; }
  .dl-card { padding: 24px; }
  .dl-steps ol { grid-template-columns: 1fr; }
  .dl-qr { justify-content: center; text-align: center; }
  .dl-qr > div:first-child { max-width: 100%; }
}
