/* =========================================================
   陕西美食 · 三秦味道（年轻活泼版）
   样式文件：css/style.css
   风格：明亮配色 + 粗描边 + 硬阴影（贴纸感）
   结构顺序：1 变量 → 2 基础 → 3 通用组件 → 4 头部 → 5 首屏
            → 6 条幅 → 7 数据条 → 8 美食列表 → 9 文化
            → 10 一日食单 → 11 页脚 → 12 弹窗 → 13 响应式
   ========================================================= */

/* ---------- 1. 设计变量 ---------- */
:root {
  --paper: #fff8f0;        /* 奶油底色 */
  --ink: #1f1a17;          /* 近黑，代替纯黑更柔和 */
  --muted: #6b6259;
  --orange: #ff6b35;
  --red: #e63946;
  --yellow: #ffc93c;
  --green: #06d6a0;
  --purple: #7b61ff;
  --pink: #ff5d8f;

  --line: 2px solid var(--ink);
  --radius: 22px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --maxw: 1120px;

  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(255, 201, 60, .18), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(255, 107, 53, .12), transparent 40%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.01em;
}

p { margin: 0; }
ul { margin: 0; padding-left: 1.15em; }
img { max-width: 100%; display: block; }

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--orange); }

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  width: min(100% - 44px, var(--maxw));
  margin-inline: auto;
}

/* 键盘跳转链接 */
.skip-link {
  position: absolute;
  left: 12px;
  top: -70px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 800;
  transition: top .2s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- 3. 通用组件 ---------- */
.eyebrow {
  display: inline-block;
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--ink);
  background: var(--yellow);
  border: var(--line);
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 14px;
  transform: rotate(-2deg);
}

.section { padding: 88px 0; }

/* 固定导航会挡住锚点目标，留出偏移 */
section[id] { scroll-margin-top: 92px; }

.section-head { max-width: 640px; margin-bottom: 38px; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
.section-lead { color: var(--muted); margin-top: 12px; font-size: .96rem; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border: var(--line);
  border-radius: 999px;
  font-weight: 900;
  font-size: .95rem;
  box-shadow: var(--shadow);
  transition: transform .16s, box-shadow .16s, background .16s, color .16s;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: #fff;
}
.btn-primary:hover { color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); }

/* 安装到桌面：只有浏览器支持时才由 JS 显示 */
.btn-install {
  background: var(--ink);
  color: var(--paper);
  border: var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-weight: 900;
  font-size: .92rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .16s, box-shadow .16s;
}
.btn-install:hover {
  color: var(--paper);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.btn-install[hidden] { display: none; }

/* iOS 安装步骤 */
.install-steps {
  margin: 14px 0 0;
  padding-left: 1.3em;
  color: #4a423b;
  font-size: .95rem;
}
.install-steps li { margin-bottom: 10px; }
.install-steps strong { color: var(--ink); }

/* ---------- 4. 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 240, .88);
  backdrop-filter: blur(12px);
  border-bottom: var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 70px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--orange);
  color: #fff;
  border: var(--line);
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.15rem;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-4deg);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-weight: 900;
  font-size: 1.05rem;
}
.brand-text small {
  font-size: .58rem;
  letter-spacing: .18em;
  color: var(--muted);
  font-weight: 700;
}

.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 800;
  font-size: .93rem;
  transition: background .16s, color .16s;
}
.site-nav a:hover { background: rgba(255, 107, 53, .14); color: var(--ink); }
.site-nav a.is-active { background: var(--ink); color: var(--paper); }

.header-cta {
  padding: 8px 18px;
  background: var(--yellow);
  color: var(--ink);
  border: var(--line);
  border-radius: 999px;
  font-weight: 900;
  font-size: .88rem;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .16s, box-shadow .16s;
}
.header-cta:hover {
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

/* ---------- 5. 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 0 76px;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  align-items: center;
}

/* 背景色块 */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  pointer-events: none;
}
.blob-1 { width: 420px; height: 420px; background: var(--yellow); top: -140px; left: -90px; }
.blob-2 { width: 380px; height: 380px; background: var(--orange); top: 40px; right: -120px; }
.blob-3 { width: 320px; height: 320px; background: var(--green); bottom: -160px; left: 38%; }

.pill-tag {
  display: inline-block;
  background: #fff;
  border: var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .82rem;
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--ink);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 22px;
}
/* 马克笔高亮 */
.hl {
  display: inline-block;
  background: linear-gradient(180deg, transparent 58%, var(--yellow) 58%);
  padding: 0 .06em;
}

.hero-lead {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 32em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin-top: 26px;
}
.hero-tags li {
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, .8);
  border: 1.5px dashed rgba(31, 26, 23, .35);
  border-radius: 999px;
  padding: 3px 12px;
}

/* 右侧漂浮卡片 */
.hero-art {
  position: relative;
  min-height: 400px;
}
.art-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 22px;
  background: #fff;
  border: var(--line);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(var(--rot));
  animation: float 6s ease-in-out infinite;
}
.art-card span { font-size: 2.6rem; line-height: 1.1; }
.art-card b { font-size: .82rem; font-weight: 900; }
.art-1 { --rot: -7deg; top: 34px; left: 4%; background: #ffdcd3; }
.art-2 { --rot: 6deg; top: 150px; right: 0; background: #ffe9c7; animation-delay: .9s; }
.art-3 { --rot: -3deg; bottom: 24px; left: 26%; background: #d8f5e3; animation-delay: 1.8s; }

.art-sticker {
  position: absolute;
  top: -6px;
  right: 62px;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--purple);
  color: #fff;
  border: var(--line);
  border-radius: 50%;
  font-size: .92rem;
  font-weight: 900;
  line-height: 1.35;
  transform: rotate(12deg);
  box-shadow: 5px 5px 0 var(--ink);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--rot)); }
  50% { transform: translateY(-14px) rotate(var(--rot)); }
}

/* ---------- 6. 滚动条幅 ---------- */
.marquee {
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 0;
  border-block: var(--line);
}
.marquee-track {
  display: flex;
  gap: 30px;
  width: max-content;
  animation: marquee 32s linear infinite;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .06em;
  white-space: nowrap;
}
.marquee-track span:nth-child(even) { color: var(--yellow); }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- 7. 数据条 ---------- */
.stats { padding: 44px 0; }
.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat {
  text-align: center;
  padding: 18px 10px;
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  background: #fff;
  transition: transform .16s;
}
.stat:hover { transform: translate(-2px, -2px); }
.stat b {
  display: block;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 900;
  line-height: 1.1;
}
.stat b sup { font-size: .5em; color: var(--red); }
.stat span { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.s-1 { background: #ffe9c7; }
.s-2 { background: #d8f5e3; }
.s-3 { background: #ffe0e9; }
.s-4 { background: #e4deff; }

/* ---------- 8. 美食列表 ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.filter {
  padding: 8px 20px;
  background: #fff;
  color: var(--ink);
  border: var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .16s, box-shadow .16s, background .16s;
}
.filter:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.filter.is-active {
  background: var(--orange);
  color: #fff;
}
.filter-count { margin-left: auto; font-size: .85rem; font-weight: 800; color: var(--muted); }

.add-btn {
  padding: 8px 18px;
  background: var(--ink);
  color: var(--paper);
  border: var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--orange);
  transition: transform .16s, box-shadow .16s;
}
.add-btn:hover {
  color: var(--paper);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--orange);
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 22px;
}

.dish-card {
  position: relative;
  background: #fff;
  border: var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.dish-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
}
.dish-card:focus-within { outline: 3px solid var(--purple); outline-offset: 4px; }
.dish-card.is-hide { display: none; }

.dish-emoji {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  border: var(--line);
  border-radius: 18px;
  margin-bottom: 14px;
  background: var(--yellow);
}
.dish-card[data-cat="mian"] .dish-emoji { background: #ffe9c7; }
.dish-card[data-cat="mo"] .dish-emoji { background: #ffdcd3; }
.dish-card[data-cat="snack"] .dish-emoji { background: #d8f5e3; }

/* 换成实拍图时，把 <div class="dish-emoji"> 换成
   <img class="dish-photo" src="images/xxx.jpg" alt="菜名"> 即可 */
.dish-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: var(--line);
  border-radius: 16px;
  margin-bottom: 14px;
}

.dish-chip {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: .7rem;
  font-weight: 900;
  padding: 2px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.dish-name { font-size: 1.3rem; }
.dish-open {
  all: unset;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
/* 整张卡片可点：按钮伪元素铺满 */
.dish-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.dish-meta {
  margin-top: 4px;
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted);
}
.dish-summary { margin-top: 10px; font-size: .92rem; color: #4a423b; }

.dish-arrow {
  position: absolute;
  right: 20px;
  bottom: 16px;
  font-size: 1.15rem;
  font-weight: 900;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .2s, transform .2s;
}
.dish-card:hover .dish-arrow { opacity: 1; transform: translateX(0); }

/* 访客添加的卡片：左上角删除按钮 */
.dish-del {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: #fff;
  border: var(--line);
  border-radius: 50%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s, background .16s;
}
.dish-card:hover .dish-del,
.dish-del:focus-visible { opacity: 1; }
.dish-del:hover { background: var(--red); color: #fff; }

/* 触屏没有 hover，删除按钮常显 */
@media (hover: none) {
  .dish-del { opacity: 1; }
}

/* ---------- 11. 页脚 ---------- */
.site-footer {
  background: var(--ink);
  color: #f3e9de;
  padding: 46px 0 26px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { font-size: 1.3rem; font-weight: 900; color: #fff; }
.footer-note { font-size: .82rem; margin-top: 4px; color: #c9bcae; }
.back-top {
  padding: 8px 18px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid #f3e9de;
  border-radius: 999px;
  font-weight: 900;
  font-size: .88rem;
  box-shadow: 3px 3px 0 rgba(243, 233, 222, .9);
}
.back-top:hover { color: var(--ink); transform: translate(-1px, -1px); }
.footer-copy {
  width: min(100% - 44px, var(--maxw));
  margin: 24px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: .76rem;
  color: #9c9084;
}

/* ---------- 12. 详情弹窗 ---------- */
.dish-dialog {
  border: var(--line);
  border-radius: 24px;
  padding: 0;
  width: min(92vw, 620px);
  max-height: 84vh;
  background: #fff;
  color: var(--ink);
  box-shadow: 10px 10px 0 rgba(31, 26, 23, .9);
  overflow: auto;
}
.dish-dialog::backdrop {
  background: rgba(31, 26, 23, .58);
  backdrop-filter: blur(3px);
}
.dialog-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: #fff;
  border-bottom: var(--line);
}
.dialog-head h3 { font-size: 1.45rem; }
.dialog-close {
  all: unset;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: var(--line);
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  background: var(--paper);
  transition: background .16s, transform .16s;
}
.dialog-close:hover { background: var(--yellow); transform: rotate(90deg); }

.dialog-body { padding: 22px 24px 28px; }
.dialog-body p { color: #4a423b; }
.dialog-body .detail-lead { color: var(--ink); }
.dialog-body h4 {
  font-size: .76rem;
  letter-spacing: .16em;
  color: var(--red);
  margin: 20px 0 8px;
}
.dialog-body ul { font-size: .94rem; color: #4a423b; }
.dialog-body li { margin-bottom: 6px; }
.detail-tip {
  margin-top: 20px;
  padding: 14px 16px;
  background: #fff6d8;
  border: 1.5px dashed var(--ink);
  border-radius: 12px 12px 12px 4px;
  font-size: .9rem;
  color: #4a423b;
}

/* ---------- 14. 添加美食表单 ---------- */
.add-form {
  display: grid;
  gap: 14px;
  padding: 22px 24px 26px;
}
.field { display: grid; gap: 6px; }
.field label { font-size: .78rem; font-weight: 900; letter-spacing: .04em; }
.field input[type="text"],
.field select {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  font-family: inherit;
  font-size: .92rem;
}
.field input[type="text"]:focus,
.field select:focus { outline: 3px solid var(--purple); outline-offset: 2px; }
.field input[type="file"] { font-size: .84rem; color: var(--muted); }
.add-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-top: 6px;
  border: var(--line);
  border-radius: 14px;
}
.add-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.btn-sm {
  padding: 9px 20px;
  font-size: .88rem;
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-sm:hover { box-shadow: 4px 4px 0 var(--ink); }

/* ---------- 9. 文化 ---------- */
.culture { background: #fff1d6; border-block: var(--line); }
.culture-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.culture-card {
  position: relative;
  background: #fff;
  border: var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.culture-card:hover { transform: rotate(0) translateY(-4px); box-shadow: var(--shadow-lg); }
.c-1 { transform: rotate(-1.2deg); }
.c-2 { transform: rotate(.8deg); }
.c-3 { transform: rotate(-.6deg); }

.culture-icon { display: block; font-size: 1.9rem; line-height: 1.2; }
.culture-num {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 1.7rem;
  font-weight: 900;
  opacity: .12;
}
.culture-card h3 { font-size: 1.12rem; margin: 8px 0 10px; }
.culture-card p { font-size: .92rem; color: #4a423b; }

/* ---------- 10. 一日食单 ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 800px;
}
.timeline li {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 22px;
  padding: 18px 0;
  border-bottom: 2px dashed #e6d6c2;
  align-items: start;
}
.timeline li:last-child { border-bottom: 0; }
.timeline time {
  justify-self: start;
  font-weight: 900;
  font-size: 1rem;
  background: var(--yellow);
  border: var(--line);
  border-radius: 999px;
  padding: 3px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
.timeline h3 { font-size: 1.06rem; margin-bottom: 4px; }
.timeline p { font-size: .9rem; color: var(--muted); }

/* ---------- 13. 响应式 ---------- */
@media (max-width: 960px) {
  .hero { padding: 64px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { display: none; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .culture-grid { grid-template-columns: 1fr; }
  .c-1, .c-2, .c-3 { transform: none; }
}

@media (max-width: 600px) {
  .section { padding: 60px 0; }
  .header-inner { height: 62px; gap: 10px; }
  .header-cta { display: none; }
  .brand-text small { display: none; }
  .site-nav a { padding: 7px 11px; font-size: .86rem; }
  .hero h1 { font-size: 2.5rem; }
  .hero-actions .btn { flex: 1 1 auto; text-align: center; }
  .filters { gap: 8px; }
  .filter { padding: 7px 15px; font-size: .85rem; }
  .filter-count { width: 100%; margin-left: 0; }
  .add-btn { width: 100%; padding: 9px 16px; }
  .dish-grid { gap: 16px; }
  .timeline li { grid-template-columns: 92px 1fr; gap: 14px; }
  .timeline time { font-size: .9rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .dialog-head { padding: 16px 20px; }
  .dialog-body { padding: 18px 20px 24px; }
}

/* 尊重“减少动态效果”的系统设置 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
