/* ================================================================
   寻味长安 · 全局样式表
   ----------------------------------------------------------------
   ★ 想换配色？只需改下面 :root 里的颜色变量即可，整站自动更新。
   ★ 想改结构？去 index.html 里增删 <section> 版块即可。
   ================================================================ */
:root {
  /* —— 主题色 —— */
  --primary: #C3272B;        /* 主色：朱红（按钮、强调、标签） */
  --primary-deep: #8E1B1E;   /* 深主色（悬停、渐变加深） */
  --accent: #C9A227;         /* 点缀色：鎏金（装饰、编号、描边） */
  --accent-light: #E4C86B;   /* 亮金（深色背景上的文字） */

  /* —— 背景与文字 —— */
  --bg: #F7F1E5;             /* 页面底色：宣纸 */
  --bg-soft: #EFE5D0;        /* 次级背景（名吃区） */
  --card: #FFFDF7;           /* 卡片背景 */
  --ink: #2B2320;            /* 主要文字：墨色 */
  --ink-soft: #5A4E46;       /* 次要文字 */
  --line: #E8E4DB;           /* 分割线 */

  /* —— 阴影 —— */
  --shadow: 0 10px 40px rgba(43, 35, 32, .16);
  --shadow-soft: 0 4px 18px rgba(43, 35, 32, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  overflow-x: hidden;
}
.serif { font-family: "Noto Serif SC", "STSong", "SimSun", serif; }
section { padding: 96px 6vw; }
a { color: inherit; }

/* ============ 顶部导航 ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 6vw;
  transition: all .35s ease;
}
.nav.scrolled { background: rgba(247, 241, 229, .92); backdrop-filter: blur(10px); box-shadow: 0 2px 20px rgba(43,35,32,.08); padding: 12px 6vw; }
.nav-logo { font-family: "Noto Serif SC", serif; font-weight: 900; font-size: 1.5rem; letter-spacing: .12em; color: var(--primary); }
.nav-logo .dot { color: var(--accent); }
.nav-links { display: flex; gap: 34px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--ink); font-size: .95rem; letter-spacing: .1em; position: relative; transition: color .25s; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px; background: var(--primary); transition: width .3s ease; }
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }
.nav-user { display: flex; align-items: center; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 6px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--ink); transition: all .3s; }

/* 按钮 */
.btn { border: none; cursor: pointer; font-family: inherit; font-size: 14px; padding: 9px 18px; border-radius: 999px; transition: all .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); }
.btn-coral { background: var(--primary); color: #fff; }
.btn-coral:hover { background: var(--primary-deep); }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* 用户头像（昵称首字） */
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.user-chip { display: flex; align-items: center; gap: 8px; }

/* ============ Hero 首屏 ============ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; text-align: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, rgba(201,162,39,.22), transparent 55%),
              linear-gradient(160deg, #3a0d0e 0%, #5c1214 40%, #2b1410 100%);
  color: #fff;
}
.hero-inner { position: relative; z-index: 2; padding: 0 5vw; }
.hero-kicker { font-size: 1rem; letter-spacing: .5em; color: var(--accent-light); margin-bottom: 22px; opacity: 0; animation: fadeUp 1s ease forwards .2s; }
.hero-title { font-family: "Noto Serif SC", serif; font-weight: 900; font-size: clamp(3.2rem, 10vw, 7rem); letter-spacing: .18em; line-height: 1.15; margin-bottom: 10px; text-shadow: 0 6px 30px rgba(0,0,0,.4); opacity: 0; animation: fadeUp 1s ease forwards .5s; }
.hero-title .accent { color: var(--accent-light); }
.hero-sub { font-size: clamp(1rem, 2vw, 1.3rem); letter-spacing: .35em; color: rgba(255,253,247,.85); margin-bottom: 42px; opacity: 0; animation: fadeUp 1s ease forwards .8s; }
.hero-divider { width: 60px; height: 2px; background: var(--accent); margin: 0 auto 30px; opacity: 0; animation: fadeUp 1s ease forwards 1s; }
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; opacity: 0; animation: fadeUp 1s ease forwards 1.2s; }
.hero-cta { display: inline-block; padding: 15px 46px; border: 1px solid var(--accent); color: var(--accent-light); text-decoration: none; letter-spacing: .25em; font-size: .95rem; border-radius: 2px; transition: all .3s; cursor: pointer; background: transparent; font-family: inherit; }
.hero-cta:hover { background: var(--accent); color: var(--ink); }
.hero-cta-ghost { border-color: rgba(255,253,247,.5); color: rgba(255,253,247,.9); }
.hero-scroll { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); color: rgba(255,253,247,.6); font-size: .75rem; letter-spacing: .3em; animation: float 2.4s ease-in-out infinite; }
.hero-scroll::after { content: ""; display: block; width: 1px; height: 34px; background: rgba(255,253,247,.5); margin: 8px auto 0; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,10px); } }

/* ============ 通用标题 ============ */
.section-head { text-align: center; margin-bottom: 60px; }
.section-tag { display: inline-block; font-size: .8rem; letter-spacing: .4em; color: var(--primary); margin-bottom: 14px; }
.section-title { font-family: "Noto Serif SC", serif; font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: .15em; color: var(--ink); }
.section-line { width: 46px; height: 2px; background: var(--accent); margin: 18px auto 20px; }
.section-desc { max-width: 640px; margin: 0 auto; color: var(--ink-soft); font-size: 1rem; }

/* ============ 缘起 ============ */
.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; max-width: 1100px; margin: 0 auto; }
.intro-text h3 { font-family: "Noto Serif SC", serif; font-size: 1.7rem; font-weight: 700; letter-spacing: .08em; margin-bottom: 20px; }
.intro-text h3 span { color: var(--primary); }
.intro-text p { color: var(--ink-soft); margin-bottom: 16px; }
.intro-quote { border-left: 3px solid var(--accent); padding: 8px 0 8px 22px; margin-top: 26px; font-family: "Noto Serif SC", serif; font-style: italic; color: var(--primary-deep); font-size: 1.05rem; }
.intro-visual { display: flex; justify-content: center; }
.seal { width: 260px; height: 260px; background: linear-gradient(145deg, var(--primary), var(--primary-deep)); display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--accent-light); box-shadow: var(--shadow); transform: rotate(-4deg); position: relative; }
.seal::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(228,200,107,.5); }
.seal .big { font-size: 3rem; font-weight: 900; letter-spacing: .2em; }
.seal .small { font-size: .8rem; letter-spacing: .4em; margin-top: 8px; }

/* ============ 名吃 ============ */
.dishes { background: var(--bg-soft); }
.dish-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; max-width: 1100px; margin: 0 auto; }
.dish-card { background: var(--card); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow-soft); transition: transform .35s ease, box-shadow .35s ease; position: relative; }
.dish-card:hover { transform: translateY(-10px); box-shadow: var(--shadow); }
.dish-img { height: 210px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; font-size: 5rem; }
.dish-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.25), transparent 50%); }
.dish-emoji { position: relative; z-index: 2; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.dish-tag { position: absolute; top: 16px; left: 16px; background: rgba(43,35,32,.72); color: var(--accent-light); font-size: .72rem; letter-spacing: .2em; padding: 5px 12px; border-radius: 2px; z-index: 3; }
.dish-body { padding: 26px 26px 30px; }
.dish-name { font-family: "Noto Serif SC", serif; font-size: 1.4rem; font-weight: 700; letter-spacing: .08em; margin-bottom: 6px; }
.dish-pinyin { font-size: .78rem; color: var(--accent); letter-spacing: .2em; margin-bottom: 14px; }
.dish-desc { color: var(--ink-soft); font-size: .92rem; }

/* ============ 食史时间轴 ============ */
.timeline-wrap { max-width: 820px; margin: 0 auto; position: relative; padding-left: 40px; }
.timeline-wrap::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--primary)); }
.tl-item { position: relative; margin-bottom: 42px; padding: 22px 28px; background: var(--card); border-radius: 6px; box-shadow: var(--shadow-soft); }
.tl-item::before { content: ""; position: absolute; left: -35px; top: 32px; width: 12px; height: 12px; background: var(--primary); border: 3px solid var(--bg); border-radius: 50%; }
.tl-era { font-family: "Noto Serif SC", serif; color: var(--primary); font-weight: 700; letter-spacing: .2em; font-size: 1.05rem; margin-bottom: 6px; }
.tl-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.tl-text { color: var(--ink-soft); font-size: .92rem; }

/* ============ 路线 ============ */
.route { background: linear-gradient(160deg, #2b1410, #4a1716); color: #fff; }
.route .section-title { color: var(--accent-light); }
.route .section-desc { color: rgba(255,253,247,.72); }
.route-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; max-width: 1100px; margin: 0 auto; }
.route-step { text-align: center; padding: 30px 20px; border: 1px solid rgba(228,200,107,.25); border-radius: 6px; transition: all .3s; }
.route-step:hover { background: rgba(228,200,107,.08); border-color: var(--accent); }
.route-num { font-family: "Noto Serif SC", serif; font-size: 2rem; color: var(--accent); font-weight: 900; margin-bottom: 10px; }
.route-name { font-size: 1.1rem; letter-spacing: .15em; margin-bottom: 8px; }
.route-desc { color: rgba(255,253,247,.65); font-size: .85rem; }

/* ============ 社区 ============ */
.community { max-width: 1100px; margin: 0 auto; }
.config-hint { max-width: 640px; margin: -30px auto 34px; text-align: center; background: rgba(195,39,43,.06); border: 1px dashed var(--primary); color: var(--primary); padding: 12px 18px; border-radius: 8px; font-size: .9rem; }
.comm-stats { display: flex; gap: 60px; justify-content: center; text-align: center; margin-bottom: 48px; }
.comm-stat-num { font-size: 2.2rem; font-weight: 800; color: var(--primary); font-family: "Noto Serif SC", serif; }
.comm-stat-label { font-size: .85rem; color: var(--ink-soft); letter-spacing: .1em; }

.feed-header { display: flex; justify-content: center; margin-bottom: 24px; }
.filter-tabs { display: flex; gap: 6px; }
.filter-tab { padding: 6px 22px; border-radius: 999px; font-size: 13px; cursor: pointer; background: transparent; border: 1px solid var(--line); color: var(--ink-soft); transition: all .2s; font-family: inherit; }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.posts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.post-card { background: var(--card); border-radius: 12px; padding: 20px; border: 1px solid var(--line); transition: all .25s; display: flex; flex-direction: column; gap: 12px; }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-meta { display: flex; align-items: center; gap: 10px; }
.post-meta .name { font-weight: 600; font-size: 14px; }
.post-meta .time { font-size: 12px; color: var(--ink-soft); }
.post-meta .dish-badge { margin-left: auto; font-size: 11px; padding: 2px 10px; border-radius: 999px; background: rgba(195,39,43,.08); color: var(--primary); }
.post-content { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.post-img { width: 100%; border-radius: 10px; max-height: 280px; object-fit: cover; display: block; }
.post-actions { display: flex; align-items: center; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); }
.act-btn { background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 13px; display: flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; transition: all .15s; font-family: inherit; }
.act-btn:hover { background: var(--bg-soft); color: var(--primary); }
.act-btn.danger:hover { background: rgba(195,39,43,.08); color: var(--primary-deep); }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.loading { text-align: center; padding: 40px; color: var(--ink-soft); }

/* 悬浮发布按钮 */
.fab { position: fixed; bottom: 30px; right: 30px; z-index: 90; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 28px; border: none; cursor: pointer; box-shadow: 0 8px 24px rgba(195,39,43,.4); transition: all .2s; display: flex; align-items: center; justify-content: center; }
.fab:hover { transform: scale(1.08); }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(43,35,32,.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-mask.show { display: flex; }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 20px; color: var(--ink); margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 16px; outline: none; transition: border .2s; background: var(--bg); color: var(--ink); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); background: #fff; }
.form-group textarea { resize: vertical; min-height: 100px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.auth-header { background: linear-gradient(135deg, var(--primary-deep), var(--primary)); padding: 32px 28px 24px; text-align: center; color: #fff; }
.auth-header h3 { color: #fff; margin: 0; font-size: 20px; }
.auth-header p { color: rgba(255,255,255,.75); font-size: 13px; margin-top: 6px; }
.auth-body { padding: 24px 28px 28px; }
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--line); }
.auth-tab { flex: 1; padding: 10px; border: none; background: none; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: inherit; transition: all .2s; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.upload-zone { border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--ink-soft); font-size: 13px; cursor: pointer; transition: all .2s; }
.upload-zone:hover { border-color: var(--primary); color: var(--primary); }
.img-preview { margin-top: 10px; border-radius: 10px; overflow: hidden; display: none; position: relative; }
.img-preview.show { display: block; }
.img-preview img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.img-remove { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: none; cursor: pointer; font-size: 14px; }

/* 评论 */
.comment-list { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 300px; overflow-y: auto; }
.comment-item { display: flex; gap: 10px; }
.comment-item .c-avatar { width: 28px; height: 28px; font-size: 12px; }
.comment-body { flex: 1; background: var(--bg); padding: 10px 14px; border-radius: 10px; }
.comment-body .c-name { font-size: 13px; font-weight: 600; color: var(--primary); }
.comment-body .c-text { font-size: 13px; margin-top: 2px; }
.comment-body .c-time { font-size: 11px; color: var(--ink-soft); margin-top: 4px; display: flex; justify-content: space-between; align-items: center; }
.comment-del { background: none; border: none; color: var(--primary-deep); font-size: 11px; cursor: pointer; padding: 2px 6px; border-radius: 4px; font-family: inherit; }
.comment-del:hover { background: rgba(195,39,43,.08); }
.comment-input-row { display: flex; gap: 8px; margin-top: 14px; }
.comment-input-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; font-family: inherit; font-size: 16px; outline: none; }
.comment-input-row input:focus { border-color: var(--primary); }

/* 提示气泡 */
.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px); background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 14px; z-index: 300; opacity: 0; transition: all .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 底部 ============ */
footer { background: #1f1512; color: rgba(255,253,247,.6); text-align: center; padding: 56px 6vw 40px; }
footer .f-title { font-family: "Noto Serif SC", serif; font-size: 1.6rem; color: var(--accent-light); letter-spacing: .3em; margin-bottom: 12px; }
footer .f-line { width: 40px; height: 1px; background: var(--accent); margin: 0 auto 20px; }
footer p { font-size: .85rem; letter-spacing: .15em; }
footer a:hover { color: var(--accent-light); }

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

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .intro-grid, .dish-grid, .route-grid { grid-template-columns: 1fr 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 70%; height: 100vh;
    background: var(--bg); flex-direction: column; justify-content: center; align-items: center;
    gap: 34px; transition: right .35s ease; box-shadow: -10px 0 40px rgba(0,0,0,.15);
  }
  .nav-links.open { right: 0; }
  .nav-toggle { display: flex; z-index: 110; }
  .nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .intro-grid, .dish-grid, .route-grid { grid-template-columns: 1fr; }
  section { padding: 72px 6vw; }
  .seal { width: 210px; height: 210px; }
  .comm-stats { gap: 30px; }
}
