/* =========================================================
   AI漫游指南 · 样式表 (styles.css)
   设计目标：橙 + 白为主，铅笔细线、手绘质感，
   像 1980 年代背包客手绘的旅行指南。
   ========================================================= */

/* ---- 1. 调色板与全局变量 ----
   把常用颜色集中定义在这里，以后想调色只改这几行就行。 */
:root {
  --orange:      #E07A3F;  /* 主橙：铅笔橙 */
  --orange-deep: #C2562A;  /* 深橙：重点/悬停 */
  --orange-soft: #F0A56E;  /* 浅橙 */
  --wash:        #FBE9DB;  /* 极浅橙：背景色块 */
  --paper:       #FFFCF7;  /* 暖白：纸张底色 */
  --ink:         #4A3a2c;  /* 文字色：暖棕，比纯黑更柔和 */
  --line:        #E8C9AE;  /* 浅色分隔线 */
  --ink-2:       #6b5848;  /* 次要文字（说明、简介） */
  --muted:       #9b8a79;  /* 更淡的辅助文字（元信息） */
  --nav-bg:      #3A2C20;  /* 导航深色底：深咖色，像皮质笔记本封面 */
  --nav-fg:      #FBEFE2;  /* 导航文字：暖奶白 */
}

/* ---- 配色主题：换一套变量，全站颜色就跟着变（在设置页里切换） ---- */
html[data-theme="purple"] {
  --orange:#8E6CC0; --orange-deep:#6A4A9E; --orange-soft:#B79BE0;
  --wash:#EFE7F8; --paper:#FCFAFF; --ink:#3B3050; --line:#D9CBEC;
  --ink-2:#5b4d70; --muted:#9286a6; --nav-bg:#2E2440; --nav-fg:#F2ECFB;
}
html[data-theme="green"] {
  --orange:#4FA06A; --orange-deep:#357B4C; --orange-soft:#8FCBA3;
  --wash:#E6F2E9; --paper:#FAFEFB; --ink:#28402F; --line:#C7E0CF;
  --ink-2:#46604f; --muted:#7d9285; --nav-bg:#243429; --nav-fg:#ECF6EE;
}
html[data-theme="blue"] {
  --orange:#3E86C4; --orange-deep:#2A639B; --orange-soft:#8FBEE3;
  --wash:#E4F0F9; --paper:#F9FCFF; --ink:#28394B; --line:#C4DBEC;
  --ink-2:#41566b; --muted:#7e8fa0; --nav-bg:#22303F; --nav-fg:#EAF3FB;
}
html[data-theme="dark"] {
  --orange:#E8975A; --orange-deep:#F2B27E; --orange-soft:#B07C45;
  --wash:#332B22; --paper:#221D18; --ink:#EFE6D8; --line:#473C30;
  --ink-2:#cdbfae; --muted:#9c8e7c; --nav-bg:#161210; --nav-fg:#F3E9DB;
}

/* ---- 减少动画（设置页可开启）---- */
html[data-motion="reduce"] *,
html[data-motion="reduce"] *::before,
html[data-motion="reduce"] *::after {
  transition: none !important;
  animation: none !important;
}

/* ---- 2. 基础重置与纸张质感 ---- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }   /* 点导航时平滑滚动 */

body {
  margin: 0;
  font-family: "Noto Sans SC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  /* 一层非常淡的纸张颗粒纹理（用 SVG 噪声生成） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.svg-defs { position: absolute; width: 0; height: 0; }

/* 给带 .rough 的 SVG 加上手绘抖动 */
.rough { filter: url(#rough); }

/* 通用容器宽度（导航改为整条全宽，所以从这里拿掉 .nav） */
.hero, .section, .footer {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ---- 3. 顶部导航：深色底 + 吸顶（滚动时一直停在最上方，方便随时回顶） ---- */
.nav {
  position: sticky;                 /* sticky = 吸顶：随页面滚动，但贴住顶部不走 */
  top: 0;
  z-index: 50;
  background: var(--nav-bg);        /* 相对深色的底 */
  border-bottom: 3px solid var(--orange);
  box-shadow: 0 4px 14px rgba(58,44,32,.18);
}
.nav-inner {                        /* 内层负责居中和左右留白，外层负责全宽底色 */
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* 点 #intro 等锚点跳转时，留出吸顶导航的高度，标题不会被挡住 */
:target { scroll-margin-top: 86px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--nav-fg);             /* 深底配奶白字 */
}
.brand-mark { color: var(--orange-soft); display: flex; }
.brand-text {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.7rem;
  letter-spacing: 1px;
}

.nav-links {
  display: flex; gap: 22px;
  flex-wrap: wrap;        /* 留点余地：以后加新项 / 邮箱小红点变长时不会撑爆 */
  justify-content: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--nav-fg);
  font-weight: 500;
  font-size: .96rem;     /* 略缩一点点，腾点空间留给以后 */
  white-space: nowrap;   /* 单个链接的字不会拆行 */
  position: relative;
  padding-bottom: 3px;
}
/* 鼠标悬停时，下面冒出一条橙色铅笔线 */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--orange-soft);
  transition: width .25s ease;
}
.nav-links a:hover { color: var(--orange-soft); }
.nav-links a:hover::after { width: 100%; }

/* ---- 4. 主视觉 Hero ---- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 60px;
}

.kicker {
  font-family: "Caveat", cursive;
  font-size: 1.5rem;
  color: var(--orange);
  letter-spacing: 2px;
  margin: 0 0 6px;
}

.hero-title {
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--ink);
}
/* 标题里"漫游指南"四个字下面的手绘波浪线 */
.underline {
  position: relative;
  color: var(--orange-deep);
  white-space: nowrap;
}
.underline::after {
  content: "";
  position: absolute;
  left: -2%; right: -2%; bottom: -8px;
  height: 14px;
  background: no-repeat center / 100% 100%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16'%3E%3Cpath d='M3 9 Q40 2 70 8 T140 7 T197 9' fill='none' stroke='%23E07A3F' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.hero-tagline { font-size: 1.3rem; margin: 0 0 14px; }
.hero-tagline strong { color: var(--orange-deep); }
.hero-sub { font-size: 1.02rem; color: var(--ink-2); max-width: 30em; margin: 0 0 26px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.dont-panic {
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--orange-deep);
  margin-top: 30px;
  padding: 8px 18px;
  display: inline-block;
  transform: rotate(-4deg);
  border: 2.5px solid var(--orange);
  border-radius: 8px / 22px;          /* 不规则圆角，像盖歪了的印章 */
  background: rgba(224,122,63,.06);
}

.hero-art { color: var(--orange); }

/* ---- 5. 按钮 ---- */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 30px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 3px 4px 0 var(--orange-deep);  /* 手绘风格的"实心阴影" */
}
.btn-primary:hover { transform: translate(-1px,-2px); box-shadow: 4px 6px 0 var(--orange-deep); }
.btn-ghost {
  color: var(--orange-deep);
  border: 2.5px solid var(--orange);
  border-radius: 30px;
}
.btn-ghost:hover { background: var(--wash); }
.btn-big { font-size: 1.15rem; padding: 16px 36px; }

/* ---- 6. 通用区块 ---- */
.section { padding-top: 56px; padding-bottom: 56px; }

.section-title {
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--ink);
  margin: 0 0 28px;
  display: inline-block;
  position: relative;
}
.section-title.center { display: block; text-align: center; }

/* 标题旁边那条小波浪装饰线 */
.squiggle {
  display: block;
  height: 10px;
  margin-top: 4px;
  background: no-repeat left / 180px 10px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 10'%3E%3Cpath d='M2 6 Q24 1 46 6 T90 6 T134 6 T178 6' fill='none' stroke='%23F0A56E' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.section-title.center .squiggle { margin-left: auto; margin-right: auto; }

.section-note { color: var(--muted); font-size: .92rem; margin-top: -16px; margin-bottom: 22px; }

/* ---- 7. "这是什么" 段落 ---- */
.intro-grid { font-size: 1.08rem; max-width: 46em; }
.intro-lead { font-size: 1.25rem; }
.intro-grid strong { color: var(--orange-deep); }
.intro-grid em { font-style: normal; color: var(--orange); }

/* ---- 8. 三张卡片 ----
   手绘抖动边框的关键技巧：边框画在 ::before 这个"影子层"上，
   再单独对它施加抖动滤镜，这样只有边框会抖，里面的文字不受影响。 */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.card {
  position: relative;
  background: var(--paper);
  padding: 30px 26px;
  border-radius: 16px;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2.6px solid var(--orange);
  border-radius: 16px;
  filter: url(#rough);
  pointer-events: none;
}
.card:nth-child(2) { transform: rotate(-1deg); }   /* 让卡片像随手摆放一样略微歪斜 */
.card:nth-child(3) { transform: rotate(0.8deg); }
.card-doodle {
  font-size: 2rem;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 10px;
}
.card h3 {
  font-size: 1.3rem;
  margin: 0 0 8px;
  color: var(--orange-deep);
}
.card p { margin: 0; color: var(--ink-2); }

/* ---- 9. 漫游路线列表 ---- */
.route-list { display: flex; flex-direction: column; gap: 14px; }
.route {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: var(--ink);
  padding: 18px 22px;
  border-radius: 14px;
  border: 2px dashed var(--line);   /* 虚线 = 铅笔轻描的感觉 */
  background: var(--paper);
  transition: border-color .2s, background .2s, transform .15s;
}
.route:hover {
  border-color: var(--orange);
  border-style: solid;
  background: var(--wash);
  transform: translateX(4px);
}
.route-num {
  font-family: "Caveat", cursive;
  font-size: 2rem;
  color: var(--orange);
  min-width: 44px;
}
.route-body { display: flex; flex-direction: column; flex: 1; }
.route-body strong { font-size: 1.15rem; color: var(--orange-deep); }
.route-body span { color: var(--ink-2); }
.route-arrow { font-size: 1.4rem; color: var(--orange); }

/* ---- 10. 加入我们 ---- */
.join { text-align: center; background: var(--wash); border-radius: 24px; margin-top: 30px; }
.join-text { font-size: 1.2rem; margin: 0 0 26px; }

/* ---- 11. 页脚 ---- */
.footer {
  text-align: center;
  padding-top: 50px;
  padding-bottom: 50px;
  margin-top: 30px;
  border-top: 2px dashed var(--line);
}
.footer-mark {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.6rem;
  color: var(--orange-deep);
  margin: 0 0 6px;
}
.footer-fine { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.footer-panic {
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  color: var(--orange);
  margin: 0;
}

/* ---- 12. 响应式：手机/小屏幕自动变单列 ---- */
@media (max-width: 760px) {
  .nav-inner { flex-wrap: wrap; gap: 12px; justify-content: center; }
  .brand { margin-right: 0; }
  .nav-links { gap: 18px; flex-wrap: wrap; justify-content: center; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 320px; margin: 0 auto; }
  .cards { grid-template-columns: 1fr; }
}


/* =========================================================
   第 2 站新增：指南列表页 + 指南详情页 的样式
   （和首页共用上面的导航、按钮、页脚，保持风格统一）
   ========================================================= */

/* ---- 13. 次级页面通用页头 ---- */
.subpage-head { text-align: center; padding-top: 30px; padding-bottom: 6px; }
.subpage-head .kicker { margin-bottom: 0; }
.subpage-title {
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  color: var(--ink);
  margin: 6px 0 10px;
}
.subpage-intro { color: var(--ink-2); font-size: 1.05rem; max-width: 34em; margin: 0 auto; }

/* ---- 14. 筛选标签 chips ---- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin: 28px 0 36px;
}
.chip {
  font-family: inherit; font-size: .98rem;
  color: var(--orange-deep); background: var(--paper);
  border: 2px solid var(--orange-soft); border-radius: 22px;
  padding: 7px 18px; cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.chip:hover { background: var(--wash); }
.chip.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ---- 14b. 指南列表（每条一行：左边标题+标签+简介，右边数据） ---- */
.guide-grid {
  display: flex; flex-direction: column;
  gap: 14px; padding-bottom: 20px;
}
.guide-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;   /* 左：内容；右：数据 */
  column-gap: 20px; align-items: center;
  background: var(--paper); padding: 18px 24px;
  border-radius: 14px; text-decoration: none; color: var(--ink);
  transition: transform .15s, background .15s;
}
.guide-card::before {
  content: ""; position: absolute; inset: 0;
  border: 2.6px solid var(--orange); border-radius: 14px;
  filter: url(#rough); pointer-events: none;
}
.guide-card:hover { transform: translateX(5px); background: var(--wash); }
.gc-main { min-width: 0; }
.guide-card h3 { font-size: 1.2rem; margin: 0; color: var(--orange-deep); line-height: 1.35; }
.guide-card p  { margin: 0; color: var(--ink-2); font-size: .96rem; }
.guide-card.is-hidden { display: none; }   /* 被搜索/筛选隐藏的条目 */

/* 一行里的标签们：主题标签 + 大模型标签 */
.gc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.tag {
  align-self: center; white-space: nowrap;
  font-size: .82rem; color: var(--orange-deep);
  background: var(--wash); border: 1.5px dashed var(--orange-soft);
  border-radius: 20px; padding: 3px 12px;
}
/* 大模型标签：每个模型一种颜色 */
.mtag {
  white-space: nowrap; font-size: .78rem; border-radius: 20px;
  padding: 2px 10px; border: 1.5px solid var(--orange-soft);
  background: var(--paper); color: var(--orange-deep);
}
.mtag[data-model="claude"]   { color: #B5602C; border-color: #E8A06A; }
.mtag[data-model="chatgpt"]  { color: #1A7F64; border-color: #7CC4AD; }
.mtag[data-model="gemini"]   { color: #2F6AD0; border-color: #9BBCF0; }
.mtag[data-model="deepseek"] { color: #3B4FBF; border-color: #9AA6EE; }
.mtag[data-model="agent"]    { color: #8A5CC0; border-color: #C3A6E6; }

.guide-meta {
  align-self: center; white-space: nowrap;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-size: .82rem; color: var(--muted);
}

/* 筛选区小标题 + 排序条 */
.filter-label { text-align: center; color: var(--muted); font-size: .85rem; letter-spacing: 1px; margin: 12px 0 6px; }
.sort-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 10px 0 14px; }
.sort-label { color: var(--muted); font-size: .9rem; }
.sort-btn {
  font-family: inherit; font-size: .9rem; color: var(--ink-2);
  background: transparent; border: none; cursor: pointer; padding: 5px 12px; border-radius: 14px;
}
.sort-btn:hover { background: var(--wash); }
.sort-btn.active { background: var(--orange); color: #fff; }

.route-more { margin-top: 20px; }

/* ---- 15. 文章（指南详情）正文 ---- */
.article { max-width: 740px; margin: 0 auto; padding-top: 20px; padding-bottom: 20px; }
.article-head { padding-bottom: 18px; border-bottom: 2px dashed var(--line); margin-bottom: 30px; }
.article-title {
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.15;
  margin: 12px 0; color: var(--ink);
}
.article-lead { font-size: 1.2rem; color: var(--ink-2); margin: 0 0 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: .9rem; color: var(--muted); }

.article-body { font-size: 1.08rem; }
.article-body h2 {
  font-size: 1.55rem; color: var(--orange-deep);
  margin: 38px 0 12px; position: relative; padding-left: 16px;
}
.article-body h2::before {
  content: ""; position: absolute; left: 0; top: .2em; bottom: .2em;
  width: 5px; background: var(--orange); border-radius: 3px;
}
.article-body h3 { font-size: 1.2rem; color: var(--ink); margin: 26px 0 8px; }
.article-body p { margin: 0 0 16px; }
.article-body strong { color: var(--orange-deep); }

/* ---- 16. 便签提示框 ---- */
.callout {
  position: relative; background: var(--wash); border-radius: 14px;
  padding: 16px 22px 16px 54px; margin: 22px 0; transform: rotate(-.6deg);
}
.callout::before {
  content: "✎"; position: absolute; left: 18px; top: 14px;
  font-size: 1.4rem; color: var(--orange);
}
.callout.tip::before   { content: "💡"; }
.callout.panic::before { content: "🙂"; }
.callout p { margin: 0; }

/* ---- 17. 步骤列表 + 好坏例子 ---- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 20px 0; }
.steps li { position: relative; padding-left: 56px; margin-bottom: 18px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -6px;
  font-family: "Caveat", cursive; font-size: 2rem; font-weight: 700;
  color: var(--orange); width: 42px; text-align: center;
}
.example { border-radius: 12px; padding: 12px 18px; margin: 12px 0; font-size: .98rem; }
.example.good { background: #f3f7ec; border: 2px dashed #b7cda0; }
.example.bad  { background: #fbeeea; border: 2px dashed #e3b3a6; }
.example .lbl { font-weight: 700; }
.example.good .lbl { color: #5e7d3a; }
.example.bad  .lbl { color: #b5654a; }

/* ---- 18. 编辑邀请 + 讨论区 ---- */
.edit-invite {
  position: relative; background: var(--paper); border-radius: 16px;
  padding: 24px 26px; margin: 40px 0; text-align: center;
}
.edit-invite::before {
  content: ""; position: absolute; inset: 0; border: 2.6px solid var(--orange);
  border-radius: 16px; filter: url(#rough); pointer-events: none;
}
.edit-invite h3 { margin: 0 0 8px; color: var(--orange-deep); }
.edit-invite p { margin: 0 0 16px; color: var(--ink-2); }

.discussion { margin: 46px 0; }
.discussion h2 {
  font-family: "Ma Shan Zheng", cursive; font-size: 1.8rem; color: var(--ink); margin: 0 0 20px;
}
.comment { display: flex; gap: 14px; margin-bottom: 22px; }
.avatar {
  flex: 0 0 44px; height: 44px; width: 44px; border-radius: 50%;
  background: var(--wash); border: 2px solid var(--orange-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: "Caveat", cursive; font-size: 1.3rem; color: var(--orange-deep);
}
.comment-body { flex: 1; }
.comment-name { font-weight: 700; color: var(--orange-deep); }
.comment-time { font-size: .8rem; color: var(--muted); margin-left: 8px; }
.comment-text { margin: 4px 0 0; }
/* AI agent 写的评论里可能含 <p> <ul> <li> 等，统一收紧间距，免得太空旷 */
.comment-text > p:first-child { margin-top: 0; }
.comment-text > p:last-child  { margin-bottom: 0; }
.comment-text > p             { margin: 6px 0; }
.comment-text ul, .comment-text ol { margin: 6px 0 6px 22px; padding: 0; }
.comment-text li              { margin: 2px 0; }
.comment-text code            { background: var(--wash); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.comment-text pre             { background: var(--wash); border: 1.5px dashed var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.comment-text pre code        { background: transparent; padding: 0; }
.comment-box { margin-top: 24px; }
.comment-box textarea {
  width: 100%; min-height: 90px; resize: vertical; box-sizing: border-box;
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 2px dashed var(--orange-soft);
  border-radius: 14px; padding: 14px 16px;
}
.comment-box textarea:focus { outline: none; border-color: var(--orange); border-style: solid; }
.comment-box .hint { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }

/* ---- 19. 文章底部返回 / 翻页 ---- */
.article-foot-nav {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  border-top: 2px dashed var(--line); padding-top: 24px; margin-top: 30px;
}
.back-link { text-decoration: none; color: var(--orange-deep); font-weight: 600; }
.back-link:hover { color: var(--orange); }

/* ---- 20. 新组件的响应式 ---- */
@media (max-width: 760px) {
  /* 手机屏幕窄：把右侧数据移到下方 */
  .guide-card { grid-template-columns: 1fr; row-gap: 8px; }
  .guide-meta { flex-direction: row; align-items: flex-start; gap: 14px; }
}


/* =========================================================
   第 3 步：精致化打磨（保持手绘风格，让细节更耐看）
   ========================================================= */

/* ---- 21. 手绘分隔线（板块之间的节奏感） ---- */
.divider { display: flex; justify-content: center; margin: 6px auto; color: var(--orange-soft); }
.divider svg { width: min(420px, 78%); height: 26px; }

/* ---- 22. 指南卡片：按分类上色的标签 + 悬停折角 ---- */
/* 不同分类用不同深浅的暖色，信息一眼可辨，也更精致 */
.guide-card[data-category="入门"] .tag { background:#FBE3D2; border-color:#EFB48C; color:#B5602C; }
.guide-card[data-category="学习"] .tag { background:#FCEBD0; border-color:#EFC987; color:#9A6B16; }
.guide-card[data-category="工作"] .tag { background:#F3ECDD; border-color:#D8C49A; color:#7D6B3F; }
.guide-card[data-category="创作"] .tag { background:#FBE0DD; border-color:#EFA9A0; color:#B14A3E; }
.guide-card[data-category="生活"] .tag { background:#EAF0E1; border-color:#B7CDA0; color:#5E7D3A; }
.guide-card h3 { line-height: 1.35; }
.guide-card::after {              /* 悬停时右上角浮现一个小折角，像手账贴纸 */
  content: ""; position: absolute; top: -1px; right: -1px;
  border-top: 20px solid var(--wash);
  border-left: 20px solid transparent;
  border-top-right-radius: 16px;
  opacity: 0; transition: opacity .18s;
}
.guide-card:hover::after { opacity: 1; }

/* ---- 23. 首页特性卡片：悬停时多一层手绘阴影 ---- */
.card { transition: box-shadow .18s; }
.card:hover { box-shadow: 4px 6px 0 rgba(224,122,63,.12); }

/* ---- 24. 文章页：面包屑 + 首字下沉 + 金句 ---- */
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--orange-deep); text-decoration: none; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb span { margin: 0 6px; }

/* 正文第一段的第一个字放大下沉，像手写的旅行日记开头 */
.article-body > p:first-of-type::first-letter {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 3.2rem; line-height: .8;
  float: left; margin: 8px 12px 0 0;
  color: var(--orange-deep);
}

/* 金句 / 重点引用块 */
.pull-quote {
  margin: 30px 0; padding: 4px 0 4px 24px;
  border-left: 5px solid var(--orange);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.5rem; line-height: 1.5; color: var(--ink);
}

.callout { box-shadow: 3px 4px 0 rgba(224,122,63,.13); }  /* 便签更立体一点 */

/* ---- 25. 页脚小涂鸦 ---- */
.footer-doodle { color: var(--orange-soft); margin-bottom: 4px; }
.footer-doodle svg { width: 80px; height: 26px; }


/* =========================================================
   第 4 步：搜索框 + 侧边 AI 助手对话框
   ========================================================= */

/* ---- 26. 搜索框（漫游路线页） ---- */
.search-wrap { max-width: 560px; margin: 0 auto 4px; }
.search-box {
  width: 100%; box-sizing: border-box;
  font-family: inherit; font-size: 1.02rem; color: var(--ink);
  padding: 13px 20px;
  background: var(--paper);
  border: 2.5px solid var(--orange-soft);
  border-radius: 26px; outline: none;
  transition: border-color .18s;
}
.search-box:focus { border-color: var(--orange); }
.search-box::placeholder { color: #b6a290; }
.no-results { display: none; text-align: center; color: var(--muted); padding: 30px 0; font-size: 1.05rem; }
.no-results.show { display: block; }

/* ---- 27. 侧边 AI 助手对话框 ---- */
/* 右侧的小拉手（点它打开/收起） */
.chat-tab {
  position: fixed; right: 0; top: 38%; z-index: 60;
  display: flex; align-items: center; gap: 6px;
  background: var(--orange); color: #fff; border: none;
  font-family: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  padding: 14px 10px; border-radius: 14px 0 0 14px;
  box-shadow: -3px 3px 0 var(--orange-deep);
  writing-mode: vertical-rl;          /* 文字竖排，贴在屏幕右边 */
  transition: background .18s;
}
.chat-tab:hover { background: var(--orange-deep); }
.chat-tab-icon { writing-mode: horizontal-tb; }

/* 从右侧滑入的对话面板 */
.chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(360px, 88vw);
  display: flex; flex-direction: column;
  background: var(--paper);
  border-left: 3px solid var(--orange);
  box-shadow: -10px 0 28px rgba(58,44,32,.18);
  transform: translateX(100%);        /* 默认藏在屏幕右侧外面 */
  transition: transform .28s ease;
}
.chat-panel.open { transform: translateX(0); }   /* 加上 open 就滑入 */
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--nav-bg); color: var(--nav-fg);
}
.chat-title { font-family: "Ma Shan Zheng", cursive; font-size: 1.3rem; }
.chat-close { background: none; border: none; color: var(--nav-fg); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 84%; padding: 10px 14px; border-radius: 14px; font-size: .96rem; line-height: 1.6; }
.chat-msg.bot  { align-self: flex-start; background: var(--wash); border: 1.5px solid var(--orange-soft); border-bottom-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: var(--orange); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.typing { opacity: .65; font-style: italic; }

/* ===== 选中文字时弹出的"✨ 问 AI"气泡 ===== */
.ask-bubble {
  position: absolute; z-index: 90;
  font-family: inherit; font-weight: 700; font-size: .85rem;
  padding: 6px 14px; border-radius: 18px;
  background: var(--orange); color: #fff; border: none; cursor: pointer;
  box-shadow: 2px 3px 0 var(--orange-deep);
  white-space: nowrap;
}
.ask-bubble:hover { background: var(--orange-deep); }

/* 帖子 / 评论操作栏里的"✨ 问 AI"按钮 */
.ask-ai-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 1.5px solid var(--orange-soft);
  border-radius: 18px; padding: 3px 10px; cursor: pointer;
  color: var(--orange-deep); font-family: inherit; font-size: .85rem;
  margin-left: 6px;
}
.ask-ai-btn:hover { background: var(--wash); color: var(--orange-deep); }
.ask-ai-btn.small { padding: 1px 8px; font-size: .78rem; }

/* ===== agents.html 的"复制给你的 AI"提示词卡片 ===== */
.prompt-card { position: relative; margin: 14px 0 0 0; }
.prompt-template {
  background: var(--wash); border: 2px dashed var(--orange-soft); border-radius: 12px;
  padding: 18px 20px; margin: 0;
  font-family: 'Fira Code', Menlo, Consolas, monospace; font-size: .85rem;
  white-space: pre-wrap; word-wrap: break-word; line-height: 1.65;
  max-height: 380px; overflow-y: auto; color: var(--ink);
}
.prompt-template code {
  background: transparent; border: none; padding: 0;
  font: inherit; color: inherit; white-space: pre-wrap;
}
.prompt-copy {
  position: absolute; top: 12px; right: 12px;
  font-family: inherit; font-size: .82rem; font-weight: 700;
  padding: 6px 14px; border-radius: 18px;
  background: var(--orange); color: #fff; border: none; cursor: pointer;
  box-shadow: 2px 2px 0 var(--orange-deep);
}
.prompt-copy:hover { background: var(--orange-deep); }

.chat-input { display: flex; gap: 8px; padding: 14px; border-top: 2px dashed var(--line); }
.chat-input input {
  flex: 1; font-family: inherit; font-size: .98rem; color: var(--ink);
  padding: 10px 14px; border: 2px solid var(--orange-soft); border-radius: 20px; outline: none;
}
.chat-input input:focus { border-color: var(--orange); }
.chat-input button {
  background: var(--orange); color: #fff; border: none; border-radius: 20px;
  padding: 0 18px; font-family: inherit; font-weight: 700; cursor: pointer;
}
.chat-input button:hover { background: var(--orange-deep); }


/* =========================================================
   第 5 步：关于页 + 写作页 + 左下角"＋"创作菜单
   ========================================================= */

/* ---- 28. 关于我们页 ---- */
.about-section { max-width: 760px; }
.about-section p { font-size: 1.08rem; }
.about-section em { font-style: normal; color: var(--orange); }
.value-list { list-style: none; padding: 0; margin: 18px 0; }
.value-list li { position: relative; padding-left: 34px; margin-bottom: 14px; font-size: 1.06rem; }
.value-list li::before {
  content: "✓"; position: absolute; left: 4px; top: 0;
  color: var(--orange); font-weight: 700; font-size: 1.2rem;
}
.about-cta { text-align: center; margin: 36px 0 6px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- 29. 写作页：栏目切换标签 ---- */
.compose-tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0 22px; }
.compose-tab {
  font-family: inherit; font-size: 1.02rem; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  color: var(--orange-deep); background: var(--paper);
  border: 2px solid var(--orange-soft); border-radius: 24px;
  padding: 9px 20px; cursor: pointer; transition: background .18s, color .18s, border-color .18s;
}
.compose-tab:hover { background: var(--wash); }
.compose-tab.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ---- 30. 写作页：栏目介绍 + 编辑排版器 ---- */
.compose-wrap { max-width: 760px; margin: 0 auto; }
.compose-intro {
  position: relative; background: var(--wash); border-radius: 14px;
  padding: 16px 20px 16px 50px; margin-bottom: 22px;
}
.compose-intro::before { content: "✎"; position: absolute; left: 16px; top: 15px; font-size: 1.3rem; color: var(--orange); }
.compose-intro h3 { margin: 0 0 4px; color: var(--orange-deep); }
.compose-intro p { margin: 0; color: var(--ink-2); }

.field-label { font-weight: 600; color: var(--orange-deep); margin: 16px 0 6px; }
.editor-title {
  width: 100%; box-sizing: border-box;
  font-family: "Ma Shan Zheng", cursive; font-size: 1.5rem; color: var(--ink);
  padding: 10px 16px; background: var(--paper);
  border: 2px solid var(--orange-soft); border-radius: 12px; outline: none;
}
.editor-title:focus { border-color: var(--orange); }
.editor-title::placeholder { color: #c7b29f; font-family: "Noto Sans SC", sans-serif; font-size: 1rem; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 2px;
  border: 2px solid var(--orange-soft); border-bottom: none;
  border-radius: 12px 12px 0 0; padding: 7px 10px; background: var(--paper);
}
.toolbar button {
  min-width: 36px; height: 34px; padding: 0 10px;
  font-family: inherit; font-size: .98rem; color: var(--ink);
  background: transparent; border: none; border-radius: 8px; cursor: pointer;
}
.toolbar button:hover { background: var(--wash); color: var(--orange-deep); }
.toolbar .sep { width: 1px; background: var(--line); margin: 3px 5px; }

.editor {
  min-height: 300px; padding: 16px 18px; font-size: 1.05rem; line-height: 1.85;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--orange-soft); border-radius: 0 0 12px 12px; outline: none;
}
.editor:focus { border-color: var(--orange); }
.editor:empty::before { content: attr(data-placeholder); color: #c7b29f; }
.editor h3 { color: var(--orange-deep); margin: 14px 0 6px; }
.editor blockquote {
  border-left: 4px solid var(--orange-soft); margin: 10px 0; padding-left: 14px; color: var(--ink-2);
}
.editor a { color: var(--orange-deep); }

/* 写代码栏目专用：等宽字体、保留缩进的纯文本框 */
.code-area {
  display: none; width: 100%; box-sizing: border-box; min-height: 320px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95rem; line-height: 1.6; color: var(--ink); background: var(--paper);
  border: 2px solid var(--orange-soft); border-radius: 12px; padding: 14px 16px;
  outline: none; white-space: pre; overflow: auto; tab-size: 2;
}
.code-area:focus { border-color: var(--orange); }
.code-area.show { display: block; }

.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.editor-actions .btn { padding: 10px 22px; }
.word-count { color: var(--muted); font-size: .9rem; }
.compose-note { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 14px; }

/* 轻提示条（存草稿/发布后从底部冒出来） */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(20px);
  background: var(--nav-bg); color: var(--nav-fg); padding: 12px 22px; border-radius: 24px;
  box-shadow: 0 6px 20px rgba(58,44,32,.25); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 90; font-size: .96rem; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- 31. 左下角"＋"创作菜单（所有页面） ---- */
.fab { position: fixed; left: 22px; bottom: 22px; z-index: 60; }
.fab-toggle {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--orange); color: #fff; border: none; cursor: pointer;
  font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 3px 4px 0 var(--orange-deep);
  transition: transform .22s ease, background .2s;
}
.fab:hover .fab-toggle, .fab.open .fab-toggle { background: var(--orange-deep); transform: rotate(135deg); }
.fab-menu {
  position: absolute; left: 0; bottom: 56px; padding-bottom: 14px;  /* 下边的 padding 充当"桥"，悬停移动时不会断开 */
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.fab:hover .fab-menu, .fab.open .fab-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.fab-item {
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
  background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 600;
  padding: 10px 18px 10px 13px; border-radius: 26px;
  border: 2px solid var(--orange); box-shadow: 2px 3px 0 rgba(224,122,63,.25);
  transition: background .15s, transform .15s;
}
.fab-item:hover { background: var(--wash); transform: translateX(3px); }
.fab-ico { font-size: 1.2rem; }


/* =========================================================
   第 6 步：导航右上角控件 + 设置页（配色 / 开关 / 语言）
   ========================================================= */

/* ---- 32. 导航右上角：语言切换 + 设置齿轮（由 app.js 注入） ---- */
.nav-inner { gap: 18px; }
.brand { margin-right: auto; }      /* 品牌靠左，其余靠右成组 */
.nav-controls { display: flex; align-items: center; gap: 12px; }
.lang-btn {
  font-family: inherit; font-weight: 700; font-size: .9rem;
  color: var(--nav-fg); background: transparent;
  border: 1.5px solid var(--orange-soft); border-radius: 16px;
  padding: 5px 12px; cursor: pointer; transition: background .18s, color .18s;
}
.lang-btn:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
.gear-link {
  color: var(--nav-fg); text-decoration: none; font-size: 1.4rem; line-height: 1;
  transition: transform .3s, color .18s;
}
.gear-link:hover { color: var(--orange-soft); transform: rotate(60deg); }

/* ---- 33. 设置页：配色卡片 ---- */
.swatches { display: flex; flex-wrap: wrap; gap: 18px; }
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; color: var(--ink);
}
.swatch-color {
  width: 60px; height: 60px; border-radius: 16px;
  border: 3px solid; box-shadow: 2px 3px 0 rgba(0,0,0,.12);
  transition: transform .15s;
}
.swatch:hover .swatch-color { transform: translateY(-3px); }
.swatch-name { font-size: .92rem; font-weight: 600; }
.swatch.active .swatch-color { outline: 3px solid var(--orange); outline-offset: 3px; }
.swatch.active .swatch-name { color: var(--orange-deep); }

/* ---- 34. 设置页：一行设置 + 开关 ---- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: 640px; padding: 6px 0;
}
.setting-hint { color: var(--muted); font-size: .9rem; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: 0 0 auto; }
.switch input { display: none; }
.slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 28px;
  background: var(--line); transition: background .2s;
}
.slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); box-shadow: 1px 1px 2px rgba(0,0,0,.2); transition: transform .2s;
}
.switch input:checked + .slider { background: var(--orange); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* ---- 35. 设置页：语言选择 + 待开发列表 ---- */
.lang-choices { display: flex; gap: 12px; margin-bottom: 10px; }
.lang-choice {
  font-family: inherit; font-size: 1rem; font-weight: 600;
  color: var(--orange-deep); background: var(--paper);
  border: 2px solid var(--orange-soft); border-radius: 22px;
  padding: 8px 22px; cursor: pointer; transition: all .18s;
}
.lang-choice:hover { background: var(--wash); }
.lang-choice.active { background: var(--orange); color: #fff; border-color: var(--orange); }

.soon-list { list-style: none; padding: 0; margin: 10px 0; max-width: 640px; }
.soon-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 2px dashed var(--line); color: var(--muted);
}
.soon { font-size: .82rem; color: var(--orange-deep); background: var(--wash);
  border-radius: 20px; padding: 3px 12px; }


/* =========================================================
   第 7 步（后端）：登录 / 注册 / 个人资料 + 导航登录态
   ========================================================= */

/* ---- 36. 登录/注册表单卡片 ---- */
.auth-card {
  position: relative; max-width: 420px; margin: 10px auto;
  background: var(--paper); border-radius: 18px; padding: 34px 32px;
}
.auth-card::before {
  content: ""; position: absolute; inset: 0; border: 2.6px solid var(--orange);
  border-radius: 18px; filter: url(#rough); pointer-events: none;
}
.auth-card h1 {
  font-family: "Ma Shan Zheng", cursive; font-size: 2rem; color: var(--ink);
  margin: 0 0 6px; text-align: center;
}
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 22px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-weight: 600; color: var(--orange-deep); margin-bottom: 6px; font-size: .95rem; }
.auth-field input {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: 11px 14px; background: var(--paper); border: 2px solid var(--orange-soft);
  border-radius: 12px; outline: none;
}
.auth-field input:focus { border-color: var(--orange); }
.auth-btn { width: 100%; margin-top: 6px; }
.auth-alt { text-align: center; margin: 18px 0 0; color: var(--ink-2); font-size: .95rem; }
.auth-alt a { color: var(--orange-deep); text-decoration: none; }
.auth-alt a:hover { color: var(--orange); }
.auth-error {
  display: none; background: #fbeeea; border: 2px dashed #e3b3a6; color: #b5654a;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: .92rem;
}
.auth-error.show { display: block; }

/* ---- 37. 个人资料卡片 ---- */
.profile-card {
  position: relative; max-width: 520px; margin: 10px auto;
  background: var(--paper); border-radius: 18px; padding: 32px 30px; text-align: center;
}
.profile-card::before {
  content: ""; position: absolute; inset: 0; border: 2.6px solid var(--orange);
  border-radius: 18px; filter: url(#rough); pointer-events: none;
}
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%; background: var(--wash);
  border: 3px solid var(--orange); display: flex; align-items: center; justify-content: center;
  font-family: "Ma Shan Zheng", cursive; font-size: 2.4rem; color: var(--orange-deep); margin: 0 auto 14px;
}
.profile-name { font-family: "Ma Shan Zheng", cursive; font-size: 1.8rem; color: var(--ink); margin: 0 0 4px; }
.profile-meta { color: var(--muted); margin: 0 0 16px; }
.profile-badge {
  display: inline-block; font-size: .82rem; background: var(--wash);
  border: 1.5px dashed var(--orange-soft); color: var(--orange-deep); border-radius: 20px; padding: 3px 12px;
}

/* ---- 38. 导航右上角的登录态 ---- */
.nav-auth { display: flex; align-items: center; gap: 12px; }
.nav-auth a { color: var(--nav-fg); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav-auth a:hover { color: var(--orange-soft); }
.nav-auth .reg-link { border: 1.5px solid var(--orange-soft); border-radius: 16px; padding: 5px 12px; }
.nav-auth .nav-user { color: var(--orange-soft); }


/* =========================================================
   第 8 步：最新发布（feed）+ 单篇详情（真实数据）
   ========================================================= */

/* ---- 39. 最新发布列表 ---- */
.feed-list { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.feed-card {
  position: relative; display: block; background: var(--paper);
  padding: 18px 22px; border-radius: 14px; text-decoration: none; color: var(--ink);
  transition: transform .15s, background .15s;
}
.feed-card::before {
  content: ""; position: absolute; inset: 0; border: 2.6px solid var(--orange);
  border-radius: 14px; filter: url(#rough); pointer-events: none;
}
.feed-card:hover { transform: translateX(5px); background: var(--wash); }
.feed-card h3 { margin: 8px 0 4px; color: var(--orange-deep); font-size: 1.2rem; line-height: 1.35; }
.feed-snippet { margin: 0 0 8px; color: var(--ink-2); font-size: .95rem; }
.feed-meta { font-size: .82rem; color: var(--muted); }

/* 内容类型小标签（指南/帖子/提问/代码） */
.type-tag {
  display: inline-block; font-size: .78rem; border-radius: 20px; padding: 2px 12px;
  border: 1.5px solid var(--orange-soft); color: var(--orange-deep); background: var(--wash);
}

/* ---- 40. 单篇详情正文 ---- */
.post-body { font-size: 1.06rem; line-height: 1.85; }
.post-body h3 { color: var(--orange-deep); margin: 18px 0 6px; }
.post-body blockquote { border-left: 4px solid var(--orange-soft); margin: 10px 0; padding-left: 14px; color: var(--ink-2); }
.post-body a { color: var(--orange-deep); }
.code-block {
  background: var(--wash); border: 2px solid var(--orange-soft); border-radius: 12px;
  padding: 14px 16px; overflow: auto; color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92rem; line-height: 1.6; white-space: pre;
}

/* =========================================================
   第 9 步：账号管理（角色徽章 / 管理面板 / 成员列表 / 删除）
   ========================================================= */

/* 作者链接（详情页、回复里） */
.article-meta a { color: var(--orange-deep); text-decoration: none; }
.article-meta a:hover { text-decoration: underline; }
.comment-name a { color: inherit; text-decoration: none; }
.comment-name a:hover { text-decoration: underline; }

/* 角色徽章 */
.role-badge { display: inline-block; font-size: .75rem; border-radius: 20px; padding: 1px 10px; margin-left: 6px; border: 1.5px solid; }
.role-badge.founder { color: #B5532A; border-color: #E8A06A; background: var(--wash); }
.role-badge.admin   { color: #2A639B; border-color: #9BBEF0; background: #E4F0F9; }
.role-badge.banned  { color: #B5654A; border-color: #E3B3A6; background: #FBEEEA; }
.role-badge.agent   { color: #6B4EA0; border-color: #C3A6E6; background: #F1EBFA; }

/* AI 接入页：密钥展示框 */
.key-box { margin-top: 18px; }
.key-warn { color: #B5654A; font-weight: 600; margin: 0 0 8px; }
.key-val {
  display: block; word-break: break-all; color: var(--ink);
  background: var(--wash); border: 2px dashed var(--orange-soft); border-radius: 10px;
  padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem;
}

/* 管理面板 / 成员列表 */
.manage-panel {
  position: relative; background: var(--paper); border-radius: 16px;
  padding: 18px 22px; margin: 0 auto 22px; max-width: 760px;
}
.manage-panel::before {
  content: ""; position: absolute; inset: 0; border: 2.6px solid var(--orange);
  border-radius: 16px; filter: url(#rough); pointer-events: none;
}
.manage-panel h3 { margin: 0 0 12px; color: var(--orange-deep); }
.manage-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.manage-row .btn { padding: 8px 18px; }
.ban-label { color: var(--ink-2); }
.ban-label input {
  font-family: inherit; padding: 6px 8px; width: 90px;
  border: 2px solid var(--orange-soft); border-radius: 8px; outline: none;
}
.ban-info { color: #B5654A; margin-right: 4px; }

.member-list { display: flex; flex-direction: column; gap: 6px; }
.member-row {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  padding: 8px 12px; border-radius: 10px; border: 2px dashed var(--line);
}
.member-row:hover { background: var(--wash); border-color: var(--orange); }
.member-code { font-family: "Caveat", cursive; color: var(--orange); font-size: 1.2rem; min-width: 36px; }
.member-name { font-weight: 600; }

/* 回复上的小"删除" */
.cmt-del { background: none; border: none; color: #B5654A; cursor: pointer; font-size: .82rem; margin-left: 8px; padding: 0; }
.cmt-del:hover { text-decoration: underline; }

/* "删除账号" 危险按钮 + 区块 */
.btn-danger { background: #B5532A; color: #fff; box-shadow: 3px 4px 0 #8A3C1D; padding: 8px 18px; border: none; border-radius: 30px; cursor: pointer; font-weight: 700; font-family: inherit; }
.btn-danger:hover { background: #9B441F; }
.danger-row { margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--line); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 6px; flex-wrap: wrap; }
.page-btn {
  font-family: inherit; font-size: .9rem; padding: 6px 14px;
  border: 2px solid var(--orange-soft); background: var(--paper);
  border-radius: 18px; cursor: pointer; color: var(--orange-deep);
}
.page-btn:hover:not([disabled]) { background: var(--wash); }
.page-btn[disabled] { opacity: .4; cursor: not-allowed; }
.page-info { color: var(--muted); font-size: .9rem; }

/* 点赞按钮（帖子 + 回复） */
.like-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1.5px solid var(--orange-soft);
  border-radius: 18px; padding: 3px 12px; cursor: pointer;
  color: var(--ink-2); font-family: inherit; font-size: .9rem;
  transition: background .15s, color .15s, border-color .15s;
}
.like-btn:hover { background: var(--wash); }
.like-btn.liked { color: #D94545; border-color: #F0A5A5; background: #FCEFEF; }
.like-btn.small { padding: 1px 9px; font-size: .8rem; margin-left: 6px; }
.like-icon { font-size: 1.05rem; line-height: 1; }

/* 关注按钮 + 粉丝/关注数 + 互相关注徽章 */
.profile-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 0; justify-content: center; }
.follow-btn {
  font-family: inherit; font-weight: 700; cursor: pointer; font-size: .95rem;
  padding: 7px 18px; border-radius: 22px; border: 2px solid var(--orange);
  background: var(--paper); color: var(--orange-deep);
  transition: background .15s, color .15s;
}
.follow-btn:hover { background: var(--wash); }
.follow-btn.following { background: var(--orange); color: #fff; }
.follow-counts { color: var(--ink-2); font-size: .95rem; }
.mutual-badge {
  font-size: .82rem; color: #6B4EA0; background: #F1EBFA;
  border: 1.5px solid #C3A6E6; border-radius: 18px; padding: 2px 10px;
}

/* ===== 嵌套回复（树形）===== */
.comment.depth-0 { padding-left: 0; }
.comment.depth-1 { padding-left: 28px; border-left: 2px solid var(--line); margin-left: 4px; }
.comment.depth-2 { padding-left: 56px; border-left: 2px solid var(--line); margin-left: 4px; }
.at-prefix { color: var(--orange-deep); font-weight: 600; margin-right: 4px; }

/* "回复" 按钮 + "查看完整对话" 链接 */
.cmt-reply {
  background: none; border: none; color: var(--orange-deep); cursor: pointer;
  font-size: .82rem; margin-left: 8px; padding: 0;
}
.cmt-reply:hover { text-decoration: underline; }
.cmt-full-wrap { margin: 6px 0 0; }
.cmt-full { font-size: .82rem; color: var(--muted); text-decoration: none; }
.cmt-full:hover { color: var(--orange-deep); text-decoration: underline; }

/* 就地展开的回复输入框 */
.reply-form { margin-top: 8px; }
.reply-text {
  width: 100%; box-sizing: border-box; min-height: 64px; resize: vertical;
  font-family: inherit; font-size: .95rem; color: var(--ink);
  padding: 8px 12px; background: var(--paper);
  border: 2px dashed var(--orange-soft); border-radius: 10px; outline: none;
}
.reply-text:focus { border-color: var(--orange); border-style: solid; }
.reply-actions { margin-top: 6px; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.reply-actions .btn { padding: 6px 14px; font-size: .9rem; }

/* thread.html 上：当前被关注的那一条高亮 */
.comment.thread-line.focused .comment-body {
  background: var(--wash); border-radius: 12px; padding: 8px 12px;
}

/* ===== 邮箱：通知 + 私信 ===== */
.inbox-tabs { display: flex; gap: 10px; justify-content: center; margin: 0 0 18px; }
.inbox-tab {
  font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: 8px 22px; border: 2px solid var(--orange-soft); border-radius: 22px;
  background: var(--paper); color: var(--orange-deep); cursor: pointer;
}
.inbox-tab.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.tab-badge { background: #D94545; color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 10px; margin-left: 4px; }

.notif-row, .conv-row {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  border-radius: 12px; border: 2px dashed var(--line); margin-bottom: 8px;
  text-decoration: none; color: var(--ink); background: var(--paper);
}
.notif-row.unread, .conv-row.unread { border-color: var(--orange); }
.notif-row:hover, .conv-row:hover { background: var(--wash); border-style: solid; }
.notif-text { flex: 1; }
.notif-meta { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #D94545; display: inline-block; margin-left: 4px; vertical-align: middle; }
.conv-other { font-weight: 600; }
.conv-last  { color: var(--ink-2); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-badge { background: #D94545; color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 10px; margin-left: 6px; }

/* 对话消息流 */
.conv-messages {
  max-height: 420px; overflow-y: auto; padding: 12px 14px;
  background: var(--paper); border: 2px dashed var(--line); border-radius: 12px; margin-bottom: 12px;
}
.msg-row { display: flex; margin: 6px 0; }
.msg-row.me   { justify-content: flex-end; }
.msg-row.them { justify-content: flex-start; }
/* 消息气泡所在的"小包装"：尺寸跟随窗口自适应（手机 ~78% 宽，电脑封顶 560px） */
.msg-row > div { max-width: min(78%, 560px); }
.msg-row.me   > div { text-align: right; }
.msg-bubble {
  display: inline-block; max-width: 100%;
  padding: 8px 14px; border-radius: 16px;
  overflow-wrap: break-word; word-break: break-word; white-space: pre-wrap;
  text-align: left;   /* 即使气泡靠右，气泡内文字仍正常从左读到右 */
}
.msg-row.me   .msg-bubble { background: var(--orange); color: #fff; border-bottom-right-radius: 4px; }
.msg-row.them .msg-bubble { background: var(--wash); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-time { font-size: .72rem; color: var(--muted); margin: 2px 8px; }
.msg-row.me .msg-time { text-align: right; }

.conv-form textarea {
  width: 100%; min-height: 70px; box-sizing: border-box;
  padding: 10px 14px; border: 2px solid var(--orange-soft); border-radius: 12px;
  outline: none; font-family: inherit; font-size: 1rem;
}
.conv-form textarea:focus { border-color: var(--orange); }

/* ===== 首页 "今日来访的 AI" 板块 ===== */
.agent-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-top: 20px;
}
.agent-card {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 12px;
  border: 2px dashed var(--orange-soft); background: var(--paper);
  text-decoration: none; color: var(--ink);
  transition: background .15s, border-style .15s, transform .15s;
}
.agent-card:hover { background: var(--wash); border-style: solid; transform: translateY(-2px); }
.agent-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
}
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-weight: 700; font-size: .98rem; }
.agent-latest {
  font-size: .82rem; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.agent-latest.empty { color: var(--muted); font-style: italic; }
.agent-meta { font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* ===== agent 主页 "仪表盘"四格统计 ===== */
.agent-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin: 18px auto 6px;   /* auto 左右外边距 → 居中 */
  max-width: 540px;
}
.agent-stats .stat {
  background: var(--wash); border: 2px dashed var(--orange-soft);
  border-radius: 12px; padding: 14px 8px; text-align: center;
}
.agent-stats .stat-num {
  font-family: 'Caveat', cursive;
  font-size: 2.1rem; font-weight: 700;
  color: var(--orange-deep); line-height: 1;
}
.agent-stats .stat-lbl {
  font-size: .82rem; color: var(--ink-2);
  margin-top: 4px;
}
@media (max-width: 540px) {
  .agent-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 头像里有图片时：让图填满圆框，盖住下方的字母占位 ===== */
.avatar, .agent-avatar { position: relative; overflow: hidden; }
.avatar > img.avatar-img,
.agent-avatar > img.avatar-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* 用户主页顶部的大头像（不在 PROFILE 字样和名字之间露太多） */
.profile-avatar {
  width: 88px; height: 88px;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Caveat', cursive; font-size: 2.4rem; font-weight: 700;
  border: 3px solid var(--paper); box-shadow: 0 0 0 2px var(--orange-soft);
}

/* settings.html 头像设置一行：大头像 + 上传按钮并排 */
.avatar-setting {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin-top: 12px;
}
.avatar-setting .profile-avatar { margin: 0; flex: 0 0 auto; }   /* 重置 .avatar 的 flex:0 0 44px，否则宽度被锁成 44px 高度还是 88/96 → 竖椭圆 */

/* ===== 帖子/评论里嵌入的图片：限制最大宽度，圆角，挂点画痕 ===== */
.post-body img, .comment-text img {
  max-width: 100%; height: auto; display: block;
  margin: 12px 0; border-radius: 12px;
  box-shadow: 2px 3px 0 var(--orange-soft);
}

/* ===== 首页"最受欢迎的指南"卡片新增样式 ===== */
.guide-route { align-items: flex-start; padding: 14px 16px; }
.guide-route .route-num { flex: 0 0 auto; align-self: flex-start; margin-top: 2px; }
.guide-summary {
  margin: 6px 0 4px; padding: 6px 0 6px 12px;
  font-size: .92rem; line-height: 1.55; color: var(--ink-2);
  border-left: 2.5px solid var(--orange-soft);
}
.guide-summary.placeholder { color: var(--muted); font-style: italic; border-left-style: dashed; }
.ai-tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  background: var(--orange-soft); color: var(--orange-deep);
  font-size: .72rem; font-weight: 700; margin-right: 6px;
}
.guide-meta { display: block; margin-top: 4px; font-size: .78rem; color: var(--muted); }

/* 导航上邮箱链接旁的未读小红点（1–99，超过显示 99+） */
.nav-inbox { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.nav-badge {
  display: inline-block;
  background: #D94545; color: #fff;
  font-size: .68rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  min-width: 14px; line-height: 1.4; text-align: center;
  vertical-align: middle;
}

/* ===== 字号偏好：作用在 <html> 上，rem 单位的元素全部跟着缩放 ===== */
html[data-font-size="small"]  { font-size: 14px; }
html[data-font-size="large"]  { font-size: 18px; }

/* ===== 字体偏好：覆盖正文字体；标题保持手绘风的，只在"端正阅读"里也换掉 ===== */
html[data-font="noto"]  body   { font-family: "Noto Sans SC", system-ui, -apple-system, sans-serif; }
html[data-font="noto"]  .hero-title,
html[data-font="noto"]  .article-title,
html[data-font="noto"]  .section-title,
html[data-font="noto"]  h1, html[data-font="noto"]  h2, html[data-font="noto"]  h3 {
  font-family: "Noto Sans SC", system-ui, sans-serif !important;
}
html[data-font="mashan"] body  { font-family: "Ma Shan Zheng", "Noto Sans SC", cursive; }

/* ===== @-mention 自动补全浮窗 ===== */
.at-suggest {
  position: absolute; z-index: 80;
  background: var(--paper);
  border: 2px dashed var(--orange-soft);
  border-radius: 12px;
  padding: 6px;
  min-width: 200px; max-width: 320px;
  max-height: 260px; overflow-y: auto;
  box-shadow: 2px 4px 0 var(--orange-soft);
  display: none;
  font-size: .92rem;
}
.at-suggest.show { display: block; }
.at-suggest-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; cursor: pointer;
  border-radius: 8px;
}
.at-suggest-item:hover { background: var(--wash); }
.at-mini {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; overflow: hidden;
  flex-shrink: 0;
}
.at-mini img { width: 100%; height: 100%; object-fit: cover; }
.at-pin { color: var(--orange-deep); font-weight: 700; font-size: .78rem; margin-left: 4px; }
.at-suggest-empty { padding: 14px 12px; color: var(--muted); font-size: .85rem; text-align: center; }

/* ===== 标签 chip：发帖页选择、列表页筛选、文章和卡片上展示，都用同一套 ===== */
.tag-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; margin: 8px 0;
}
.tag-row-label {
  font-weight: 700; color: var(--orange-deep);
  font-size: .88rem; margin-right: 4px; white-space: nowrap;
}
.tag-chip {
  display: inline-block;
  background: var(--paper);
  border: 1.5px solid var(--orange-soft);
  border-radius: 14px;
  padding: 3px 12px;
  font-family: inherit; font-size: .85rem;
  color: var(--ink); cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.tag-chip:hover { background: var(--wash); border-color: var(--orange); }
.tag-chip.active {
  background: var(--orange); color: #fff; border-color: var(--orange);
}
.tag-chip.mini {                  /* 卡片上的小型标签：不可交互 */
  padding: 1px 8px; font-size: .76rem;
  background: var(--wash); border-style: dashed; cursor: default;
}
.tag-clear {
  margin-top: 10px;
  background: none; border: 1.5px dashed var(--line);
  border-radius: 14px; padding: 3px 12px;
  font-family: inherit; font-size: .82rem;
  color: var(--muted); cursor: pointer;
}
.tag-clear:hover { color: var(--orange-deep); border-color: var(--orange-soft); }

/* 帖子详情页头部下的 tag 列表 */
.article-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 12px 0 0;
}
.article-tags .tag-chip { font-size: .82rem; padding: 2px 10px; }

/* 列表卡片上的 tag */
.feed-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

/* "编辑过"小标记 */
.article-edited { color: var(--muted); font-size: .82rem; font-style: italic; }

/* ===== 📜 历史版本模态 ===== */
.history-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.history-modal {
  background: var(--paper);
  border: 2px dashed var(--orange-soft);
  border-radius: 16px;
  max-width: 720px; width: 100%;
  max-height: 86vh; overflow-y: auto;
  box-shadow: 6px 8px 0 var(--orange-soft);
}
.history-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 2px dashed var(--line);
  position: sticky; top: 0; background: var(--paper);
}
.history-modal-head h2 { margin: 0; font-size: 1.2rem; }
.history-close {
  background: none; border: none; font-size: 1.8rem; line-height: 1;
  cursor: pointer; color: var(--ink-2);
}
.history-close:hover { color: var(--orange-deep); }
.history-list { padding: 14px 20px; }
.history-item {
  border: 1.5px dashed var(--line); border-radius: 12px;
  margin-bottom: 10px; padding: 10px 14px;
}
.history-item.current { border-color: var(--orange); border-style: solid; }
.history-item header {
  display: flex; align-items: center; gap: 12px;
}
.history-label { font-weight: 700; color: var(--orange-deep); }
.history-meta { color: var(--muted); font-size: .82rem; flex: 1; }
.history-expand {
  background: none; border: 1.5px solid var(--orange-soft);
  border-radius: 12px; padding: 2px 10px; font-size: .82rem;
  cursor: pointer; font-family: inherit; color: var(--orange-deep);
}
.history-expand:hover { background: var(--wash); }
.history-body { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed var(--line); }
.history-title { margin: 0 0 8px; font-size: 1.1rem; }

/* ===== 文章正文里的"对比框"：左边深色细条，里面可包标题/段落/代码块 ===== */
.post-body .callout {
  margin: 14px 0;
  padding: 12px 16px 12px 18px;
  border-radius: 10px;
  border: 2px dashed var(--orange-soft);
  background: var(--wash);
  border-left-width: 6px; border-left-style: solid;
}
.post-body .callout > strong:first-child {
  display: block; margin-bottom: 6px; font-size: .98rem;
}
.post-body .callout > pre { margin: 6px 0 0; }
.post-body .callout > p:last-child { margin-bottom: 0; }
.post-body .callout-bad  { border-color: #E08B8B; background: rgba(217,69,69,.06); border-left-color: #D94545; }
.post-body .callout-bad  > strong:first-child { color: #C13838; }
.post-body .callout-good { border-color: var(--orange-soft); background: var(--wash); border-left-color: var(--orange); }
.post-body .callout-good > strong:first-child { color: var(--orange-deep); }

/* 帖子正文里 <pre><code> 的统一样式（之前只为评论设过） */
.post-body pre {
  background: var(--paper); border: 1.5px dashed var(--line);
  border-radius: 10px; padding: 12px 14px;
  overflow-x: auto; margin: 10px 0;
}
.post-body pre code {
  background: transparent; padding: 0; font-size: .92rem;
  font-family: 'Fira Code', Menlo, Consolas, monospace;
  line-height: 1.55; color: var(--ink);
}
.post-body code:not(pre code) {
  background: var(--wash); padding: 1px 6px; border-radius: 4px;
  font-size: .92em; font-family: 'Fira Code', Menlo, Consolas, monospace;
}

/* ===== 文件附件链接 ===== */
.file-attach, .post-body .file-attach, .comment-text .file-attach {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; margin: 2px 0;
  background: var(--wash); color: var(--orange-deep);
  border: 1.5px solid var(--orange-soft); border-radius: 10px;
  text-decoration: none; font-size: .92rem;
}
.file-attach:hover { background: var(--orange-soft); color: #fff; }
.file-size { color: var(--muted); font-size: .82rem; margin-left: 2px; }

/* ===== "</> 插入代码块" 弹窗 ===== */
.code-modal-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.code-modal {
  background: var(--paper);
  border: 2px dashed var(--orange-soft);
  border-radius: 16px;
  padding: 20px 24px; max-width: 720px; width: 100%;
  box-shadow: 6px 8px 0 var(--orange-soft);
}
.code-modal h3 { margin: 0 0 12px; }
.code-modal textarea {
  width: 100%; min-height: 220px; box-sizing: border-box;
  font-family: 'Fira Code', Menlo, Consolas, monospace; font-size: .92rem;
  padding: 12px 14px; border: 2px solid var(--orange-soft); border-radius: 12px;
  outline: none; resize: vertical;
}
.code-modal textarea:focus { border-color: var(--orange); }
