/* 房车营地探索网 —— 全站样式（浅色主题） */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #1e2825;
  --ink-2: #3d4a45;
  --muted: #6d7a74;
  --line: #e3e1d9;
  --brand: #0f7b6c;
  --brand-dark: #0a5c50;
  --brand-soft: #e7f2ef;
  --accent: #b45309;
  --accent-soft: #fdf1e0;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 40, 37, .05), 0 8px 24px rgba(30, 40, 37, .06);
  --shadow-sm: 0 1px 2px rgba(30, 40, 37, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 650; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 26px; padding-bottom: 56px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------------- 顶栏 ---------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { display: flex; }
.brand-text strong { display: block; font-size: 17px; letter-spacing: .3px; }
.brand-text small { display: block; color: var(--muted); font-size: 12px; }
.main-nav { display: flex; gap: 4px; margin-left: 10px; flex: 1; flex-wrap: wrap; }
.main-nav a {
  padding: 7px 13px; border-radius: 8px; color: var(--ink-2); font-size: 14.5px;
}
.main-nav a:hover { background: var(--surface-2); color: var(--brand-dark); }
.main-nav a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.user-area { display: flex; align-items: center; gap: 8px; }
.me-chip {
  display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: 14px;
}
.me-chip:hover { border-color: var(--brand); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.avatar-lg { width: 46px; height: 46px; font-size: 20px; }
.inline-form { display: inline; }

/* ---------------- 页脚 ---------------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 52px; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 28px; padding: 32px 20px; flex-wrap: wrap;
}
.footer-inner > div:first-child { max-width: 460px; }
.footer-inner p { margin: 8px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--brand); }
.ga-beian { margin-top: 6px !important; }
.ga-beian a { color: var(--ink-2); }
.ga-beian a:hover { color: var(--brand); }
.copyright {
  padding: 14px 20px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 17px; border-radius: 9px; border: 1px solid transparent;
  font-size: 14.5px; font-family: inherit; cursor: pointer; transition: .15s;
  background: var(--surface-2); color: var(--ink-2); border-color: var(--line);
}
.btn:hover { background: #f1efe9; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: #94430a; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); background: transparent; }
.btn-text { background: transparent; border-color: transparent; color: var(--muted); }
.btn-text:hover { background: transparent; color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border-color: #f0cfcc; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-warn { background: transparent; color: var(--accent); border-color: #f0d9b5; }
.btn-warn:hover { background: var(--accent-soft); }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 卡片 / 栅格 ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 16px; align-items: stretch; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
/* 同一行卡片等高，避免内容长短不一导致排版参差 */
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card { height: 100%; }
.cols { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 34px 0 18px;
}
.section-head:first-child { margin-top: 4px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.section-head .more { font-size: 14px; color: var(--brand-dark); font-weight: 500; }
.section-head .more:hover { color: var(--brand); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------------- 首页 ---------------- */
.hero {
  background: linear-gradient(135deg, #0f7b6c 0%, #0a5c50 55%, #124d45 100%);
  color: #fff; border-radius: 18px; padding: 46px 42px 42px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -70px; width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(255,255,255,.13), transparent 70%);
}
.hero h1 { font-size: 36px; color: #fff; margin-bottom: 12px; font-weight: 700; letter-spacing: -0.3px; }
.hero p { color: rgba(255,255,255,.86); max-width: 640px; line-height: 1.75; }
.hero-search { display: flex; gap: 10px; margin-top: 26px; max-width: 620px; }
.hero-search input {
  flex: 1; padding: 14px 18px; border-radius: 10px; border: 0; font-size: 15px;
  font-family: inherit; background: #fff; color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.hero-search input:focus { outline: 2px solid rgba(255,255,255,.6); }
.hero-search .btn-lg { padding: 13px 26px; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.hero-tags a {
  padding: 5px 13px; border-radius: 999px; background: rgba(255,255,255,.16);
  color: #fff; font-size: 13px; border: 1px solid rgba(255,255,255,.12);
}
.hero-tags a:hover { background: rgba(255,255,255,.28); color: #fff; }
.hero-tags .hero-tag-all { background: rgba(255,255,255,.28); font-weight: 600; }
.hero-tags .hero-tag-all:hover { background: rgba(255,255,255,.4); }
.hero-stats { display: flex; gap: 44px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats div { min-width: 64px; }
.hero-stats div strong { display: block; font-size: 30px; font-weight: 700; }
.hero-stats div span { font-size: 13px; color: rgba(255,255,255,.82); }

.stat-card { padding: 18px 20px; }
.stat-card strong { display: block; font-size: 26px; color: var(--brand-dark); }
.stat-card span { font-size: 13.5px; color: var(--muted); }

/* ---------------- 营地卡片 ---------------- */
.camp-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.camp-thumb { position: relative; display: block; height: 152px; overflow: hidden; }
.camp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.camp-thumb.has-img:hover img { transform: scale(1.04); }
.camp-thumb-ic { position: absolute; inset: 0; display: grid; place-items: center; }
.camp-thumb-ic svg { width: 54px; height: 54px; opacity: .92; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.camp-thumb.t-biz { background: linear-gradient(135deg, #f59e0b, #d97706); }
.camp-thumb.t-pub { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.camp-thumb.t-scenic { background: linear-gradient(135deg, #10b981, #059669); }
.camp-thumb.t-lux { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.camp-thumb.t-supply { background: linear-gradient(135deg, #64748b, #475569); }
.camp-thumb.t-default { background: linear-gradient(135deg, #0f7b6c, #0a5c50); }
.camp-thumb.has-bg-img { background-size: cover; background-position: center; }
.camp-thumb.has-bg-img::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.35));
}
.camp-thumb.has-bg-img .camp-thumb-ic { z-index: 1; }
.camp-cover-placeholder.has-bg-img { background-size: cover; background-position: center; }
.camp-thumb-preview {
  position: relative; height: 90px; border-radius: var(--radius); overflow: hidden;
  background-size: cover; background-position: center;
  display: grid; place-items: center; color: #fff; font-size: 12px;
}
.camp-thumb-preview.t-biz { background: linear-gradient(135deg, #f59e0b, #d97706); }
.camp-thumb-preview.t-pub { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.camp-thumb-preview.t-scenic { background: linear-gradient(135deg, #10b981, #059669); }
.camp-thumb-preview.t-lux { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.camp-thumb-preview.t-supply { background: linear-gradient(135deg, #64748b, #475569); }
.camp-thumb-tags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.camp-thumb-tags .tag { background: rgba(0,0,0,.55); color: #fff; border-color: rgba(255,255,255,.25); backdrop-filter: blur(2px); font-weight: 600; }
.camp-thumb-tags .tag-certified { background: rgba(15,123,108,.92); color: #fff; border-color: transparent; }
.camp-thumb-tags .tag-demo { background: rgba(75,63,168,.92); color: #fff; border-color: transparent; }
.camp-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.camp-body h3 { margin: 0; font-size: 17px; font-weight: 650; }
.camp-body h3 a { color: var(--ink); }
.camp-body h3 a:hover { color: var(--brand-dark); }
.camp-body .row { gap: 6px; }
.camp-body .addr { color: var(--muted); font-size: 13px; }
.camp-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.camp-body .desc {
  font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.65; margin: 2px 0;
}
.facility-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.facility {
  font-size: 12px; padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.facility-more { background: var(--surface); border-style: dashed; }

/* 营地详情页封面图 */
.camp-cover { width: 100%; height: 260px; border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; }
.camp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camp-cover-placeholder { height: 260px; border-radius: var(--radius); margin-bottom: 22px;
  display: grid; place-items: center; color: #fff; }
.camp-cover-placeholder svg { width: 80px; height: 80px; opacity: .9; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  padding: 2px 8px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.tag-certified { background: var(--brand-soft); border-color: #bfded7; color: var(--brand-dark); font-weight: 600; }
.tag-pending { background: var(--accent-soft); border-color: #f0d9b5; color: var(--accent); }
.tag-reject { background: #fdecec; border-color: #f0cfcc; color: var(--danger); }
.tag-rejected { background: var(--danger-soft); border-color: #f0cfcc; color: var(--danger); }
.tag-demo { background: #f1f0ff; border-color: #dcd9f5; color: #4b3fa8; }
.tag-admin { background: #fff3d6; border-color: #f2dfae; color: #8a5a00; font-weight: 600; }
.tag-pin { background: var(--danger-soft); border-color: #f0cfcc; color: var(--danger); }
.tag-official { background: var(--brand-soft); border-color: #bfded7; color: var(--brand-dark); }
.tag-lock { background: #eef0f2; color: #55636b; }
.tag-feature { background: #fff1e6; border-color: #ffd9b3; color: #c2590a; font-weight: 600; }
.tag-subadmin { background: #e7f0ff; border-color: #c5d8fb; color: #1d4ed8; font-weight: 600; }
/* 星标认证：加亮红色五角星 + 称号 */
.tag-star {
  background: linear-gradient(180deg, #ffe3e3 0%, #ffd0d0 100%);
  border-color: #ff9a9a; color: #d11a1a; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(209,26,26,.12) inset;
}
.tag-star.preview { font-size: 14px; padding: 4px 12px; }

/* 会员等级徽标：用户名后显示「Lv.x 称号」。按等级段渐变配色，越高级越亮。 */
.lv-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; line-height: 1;
  padding: 3px 8px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap;
}
/* 低段（1-5）：灰蓝入门 */
.lv-badge.lv-1, .lv-badge.lv-2, .lv-badge.lv-3, .lv-badge.lv-4, .lv-badge.lv-5 {
  background: #eef1f5; border-color: #d7dde6; color: #5b6675;
}
/* 中段（6-10）：青绿成长 */
.lv-badge.lv-6, .lv-badge.lv-7, .lv-badge.lv-8, .lv-badge.lv-9, .lv-badge.lv-10 {
  background: #e3f4ef; border-color: #b6e2d6; color: #0f7b6c;
}
/* 高段（11-15）：天蓝进阶 */
.lv-badge.lv-11, .lv-badge.lv-12, .lv-badge.lv-13, .lv-badge.lv-14, .lv-badge.lv-15 {
  background: #e6f0ff; border-color: #bcd4fb; color: #205bd1;
}
/* 精英段（16-20）：紫金尊贵 */
.lv-badge.lv-16, .lv-badge.lv-17, .lv-badge.lv-18, .lv-badge.lv-19, .lv-badge.lv-20 {
  background: #f1e9ff; border-color: #d8c4fb; color: #6d28d9;
}
/* 顶级段（21-25）：金红传奇，带发光 */
.lv-badge.lv-21, .lv-badge.lv-22, .lv-badge.lv-23, .lv-badge.lv-24, .lv-badge.lv-25 {
  background: linear-gradient(180deg, #fff2cc 0%, #ffd76a 100%);
  border-color: #f0b429; color: #8a4b00;
  box-shadow: 0 0 0 1px rgba(240,180,41,.35) inset, 0 0 8px rgba(240,180,41,.35);
}
/* 个人中心升级进度条 */
.lv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lv-points { font-size: 14px; color: var(--ink-2); }
.lv-points strong { color: var(--brand); font-size: 18px; }
.lv-bar {
  height: 10px; border-radius: 999px; background: var(--surface-2);
  overflow: hidden; border: 1px solid var(--line);
}
.lv-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #0f7b6c, #36c2a6);
  transition: width .3s ease;
}

/* ---------------- 表单 ---------------- */
.form-row { margin-bottom: 16px; }
.form-row > label {
  display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.form-row .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-size: 14.5px; font-family: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 123, 108, .12);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 8px; }
.check {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer;
}
.check input { margin: 0; accent-color: var(--brand); }
.check:hover { border-color: var(--brand); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------------- 草稿箱 ---------------- */
.draft-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-top: 14px; }
.draft-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.draft-head strong { font-size: 15px; color: var(--ink); }
.draft-tip { font-size: 12.5px; color: var(--muted); }
.draft-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.draft-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; transition: background .12s, border-color .12s; }
.draft-row:hover { background: var(--brand-soft); border-color: #bfe0d8; }
.draft-row.draft-active { border-color: var(--brand); background: var(--brand-soft); }
.draft-title { flex: 1 1 auto; font-weight: 600; color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.draft-untitled { color: var(--muted); font-weight: 400; font-style: italic; }
.draft-meta { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.draft-open { flex: 0 0 auto; font-size: 13px; color: var(--brand); background: transparent;
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.draft-open:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.draft-del { flex: 0 0 auto; width: 24px; height: 24px; line-height: 1; font-size: 16px;
  color: var(--muted); background: transparent; border: none; border-radius: 6px; cursor: pointer; }
.draft-del:hover { color: #fff; background: var(--danger); }
.draft-empty { margin-top: 10px; font-size: 13px; color: var(--muted); }
.draft-msg { font-size: 13px; color: var(--brand); opacity: 0; transition: opacity .3s; }
.auth-box { max-width: 460px; margin: 40px auto; }
.auth-box .card-pad { padding: 28px 30px; }
.auth-title { text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--muted); }

/* ---------------- 提示条 ---------------- */
.flash-area { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 11px 15px; border-radius: 10px; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.flash-ok { background: var(--brand-soft); border-color: #bfded7; color: var(--brand-dark); }
.flash-warn { background: var(--accent-soft); border-color: #f0d9b5; color: #7c3d05; }
.flash-error { background: var(--danger-soft); border-color: #f0cfcc; color: var(--danger); }
.notice {
  padding: 13px 16px; border-radius: 10px; font-size: 13.5px; line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.notice-warn { background: var(--accent-soft); border-color: #f0d9b5; color: #7c3d05; }
.notice code {
  background: #fff; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line);
  font-size: 12.5px;
}

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ---------------- 地图页 ---------------- */
.map-layout { display: grid; grid-template-columns: 350px 1fr; gap: 0; height: calc(100vh - 66px); }
.map-side {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.map-side-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.map-search { display: flex; gap: 8px; }
.map-search input { flex: 1; }
.map-hot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.map-hot button {
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  font-family: inherit;
}
.map-hot button:hover { border-color: var(--brand); color: var(--brand-dark); }
.map-result-info { padding: 10px 18px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.map-list { overflow-y: auto; flex: 1; }
.map-item { padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.map-item:hover { background: var(--surface-2); }
.map-item.on { background: var(--brand-soft); }
.map-item h4 { margin: 0 0 4px; font-size: 14.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.map-item p { margin: 0; font-size: 12.5px; color: var(--muted); }
#map { width: 100%; height: 100%; background: #eceae4; }
.map-holder { position: relative; }
.map-mask {
  position: absolute; inset: 0; display: none; place-items: center; padding: 30px;
  background: rgba(246, 245, 241, .96); z-index: 20;
}
.map-mask.show { display: grid; }
.map-mask .inner { max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.map-detail-mini { height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
/* 营地申请页的地图选点：给定固定高度，腾讯 GL JS 才能正常渲染 */
.map-pick { height: 360px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-pick #map { height: 100%; }
.tmap-info { font-size: 13px; line-height: 1.6; max-width: 250px; }
.tmap-info b { font-size: 14px; }
.tmap-actions { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tmap-navi {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: 6px; padding: 7px 14px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; line-height: 1.2;
}
.tmap-navi:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* ---------------- 论坛 ---------------- */
.board-card { padding: 20px 22px; border-top: 3px solid var(--brand); display: flex; flex-direction: column; }
.board-card > div:last-child { margin-top: auto; padding-top: 14px; }
.board-card h3 { display: flex; align-items: center; justify-content: space-between; }
.board-card .cnt { font-size: 13px; color: var(--muted); font-weight: 400; }
.board-latest { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.board-latest a { font-size: 13.5px; color: var(--ink-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-latest a:hover { color: var(--brand-dark); }
.post-row {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: var(--surface-2); }
.post-row.featured { background: #fffaf2; box-shadow: inset 3px 0 0 var(--featured, #ff9d3c); }
.post-row.featured:hover { background: #fff4e6; }
.post-row .main { flex: 1; min-width: 0; }
.post-row .title { font-size: 15.5px; font-weight: 600; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.post-row .title a { color: var(--ink); }
.post-row .title a:hover { color: var(--brand-dark); }
.post-row .sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.post-row .nums { text-align: center; font-size: 12px; color: var(--muted); min-width: 56px; }
.post-row .nums strong { display: block; color: var(--ink-2); font-size: 15px; font-weight: 650; }
.post-row .nums span { display: block; margin-top: 1px; }
.post-row .nums .num-like { color: var(--like, #e8453c); font-weight: 600; }

/* 日志点赞 */
.like-bar { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.like-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  font-size: 15px; font-weight: 600; transition: all .15s ease; text-decoration: none;
}
.like-btn:hover { border-color: var(--like, #e8453c); color: var(--like, #e8453c); }
.like-btn .like-ic { font-size: 18px; line-height: 1; }
.like-btn .like-num { min-width: 14px; text-align: center; }
.like-btn.liked { background: #fff0ee; border-color: var(--like, #e8453c); color: var(--like, #e8453c); }
.like-btn.liked .like-ic { color: var(--like, #e8453c); }
.like-btn:disabled { opacity: .6; cursor: default; }
.like-hint { font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .like-hint { display: none; } .like-bar { justify-content: center; } }
.post-body { font-size: 15px; line-height: 1.85; white-space: pre-wrap; word-wrap: break-word; color: var(--ink); }
.post-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px; }
.post-head h1 { font-size: 23px; }
.post-author { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment .body { flex: 1; }
.comment .who { font-size: 13.5px; font-weight: 600; display: flex; gap: 7px; align-items: center; }
.comment .when { font-size: 12px; color: var(--muted); font-weight: 400; }
.comment .text { margin-top: 5px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.75; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); font-size: 14px; color: var(--ink-2);
}
.pager .on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .dis { color: #b9c2be; }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 18px;
}
.filter-bar .fi { min-width: 150px; }
.filter-bar label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 4px;
}
.chip .muted { font-size: 12px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:hover { border-color: var(--brand); }
.side-title { font-size: 15px; font-weight: 650; margin-bottom: 12px; color: var(--ink); }
aside .card-pad ol { margin: 0; padding-left: 18px; color: var(--ink-2); line-height: 1.9; font-size: 13.5px; }
aside .card-pad ol li { padding-left: 4px; }
aside .card-pad ol a { color: var(--brand-dark); font-weight: 500; }

/* ---------------- 详情页 ---------------- */
.detail-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; font-size: 16px; color: var(--ink-2); margin-bottom: 6px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-plain li:last-child { border-bottom: 0; }
.side-title { font-size: 14px; font-weight: 650; margin-bottom: 10px; color: var(--ink-2); }

/* ---------------- 后台 ---------------- */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tabs a {
  padding: 8px 15px; border-radius: 9px; background: var(--surface);
  border: 1px solid var(--line); font-size: 14px; color: var(--ink-2);
}
.admin-tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.review-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.review-form input[type=text] { width: 190px; }
.cred-box {
  background: #fffbe9; border: 1px dashed #e5c76b; border-radius: 10px;
  padding: 14px 16px; font-size: 14px; margin-bottom: 16px;
}
.cred-box code { background: #fff; padding: 3px 8px; border-radius: 5px; font-size: 15px; border: 1px solid #e8d9a8; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; height: auto; }
  .map-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .map-list { max-height: 320px; }
  #map { height: 60vh; }
}
@media (max-width: 700px) {
  .header-inner { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .main-nav { order: 3; width: 100%; margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 25px; }
  .hero-search { flex-direction: column; }
  .brand-text small { display: none; }
}

/* ---------------- 日志 媒体画廊 ---------------- */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.media-gallery-sm { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 10px; }
.media-cell { position: relative; border-radius: 10px; overflow: hidden; background: #f1f3f4; }
.media-cell img, .media-cell video {
  display: block; width: 100%; height: 150px; object-fit: cover;
}
.media-gallery-sm .media-cell img, .media-gallery-sm .media-cell video { height: 110px; }
.media-cell video { background: #000; }

/* 上传预览（写日志/回复表单内） */
.media-prev {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px; margin-top: 10px;
}
.prev-cell { position: relative; border-radius: 8px; overflow: hidden; background: #f1f3f4; }
.prev-cell img, .prev-cell video {
  display: block; width: 100%; height: 84px; object-fit: cover;
}
.prev-cell .prev-tag {
  position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.55);
  color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px;
}

/* ---- 营地图片 ---- */
.camp-link { display: flex; align-items: center; gap: 12px; overflow: hidden; }
.camp-link-thumb { flex: 0 0 auto; width: 110px; height: 74px; border-radius: 8px; overflow: hidden; }
.camp-link-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.camp-link-body { min-width: 0; }

.photo-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 10px;
}
.photo-item {
  position: relative; display: block; border-radius: 10px; overflow: hidden;
  background: #f1f3f4; border: 1px solid var(--line);
}
.photo-item img { display: block; width: 100%; height: 90px; object-fit: cover; }
.photo-del {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 4px; font-size: 12px; color: var(--ink-2);
  background: var(--bg-2, #fff);
}
.photo-del input { accent-color: #dc2626; }

/* ============================ 游记（作家助手式作品本） ============================ */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px; margin: 18px 0 26px;
}
.stat-card {
  background: var(--card, #fff); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; text-align: center;
}
.stat-num { font-size: 26px; font-weight: 700; color: var(--brand); }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.section-title {
  font-size: 17px; font-weight: 700; margin: 26px 0 12px;
  padding-left: 10px; border-left: 4px solid var(--brand);
}

.empty-box {
  background: var(--card, #fff); border: 1px dashed var(--line);
  border-radius: 14px; padding: 26px; text-align: center; color: var(--muted);
}

/* 我的作品列表 */
.work-list { display: flex; flex-direction: column; gap: 12px; }
.work-card {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  background: var(--card, #fff); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
}
.work-main { min-width: 0; flex: 1; }
.work-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.work-title { font-size: 16.5px; font-weight: 700; color: var(--ink); text-decoration: none; }
.work-title:hover { color: var(--brand); }
.work-meta { font-size: 13px; color: var(--muted); margin: 4px 0; }
.work-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.work-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* 草稿总览 */
.draft-overview { display: flex; flex-direction: column; gap: 8px; }
.draft-chip {
  display: block; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card, #fff); text-decoration: none;
  transition: border-color .15s, background .15s;
}
.draft-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.draft-chip-title { display: block; font-weight: 600; color: var(--ink); }
.draft-chip-meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 作品徽标 */
.work-badge {
  display: inline-block; font-size: 11px; line-height: 1; padding: 3px 6px;
  border-radius: 6px; background: var(--brand); color: #fff; font-weight: 600;
  vertical-align: middle;
}
.work-badge.sm { font-size: 10px; padding: 2px 5px; }

/* 论坛板块中的作品本区块 */
.works-block { margin-bottom: 22px; }
.block-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.block-head h2 { font-size: 16px; margin: 0; }
.board-works { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.board-works-head { font-size: 12.5px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.board-works a {
  display: block; font-size: 13.5px; color: var(--ink-2); text-decoration: none;
  padding: 4px 0; border-radius: 6px;
}
.board-works a:hover { color: var(--brand); }

/* 作品详情：简介 / 大纲 / 章节 */
.work-summary { margin-top: 14px; color: var(--ink-2); line-height: 1.75; }
.outline-text {
  white-space: pre-wrap; font-family: inherit; font-size: 13.5px; line-height: 1.8;
  background: var(--bg-2, #f6f8f7); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin: 0; max-height: 320px; overflow: auto;
}
.chapter-nav { margin: 0; padding-left: 18px; }
.chapter-nav a { color: var(--ink-2); font-size: 13.5px; text-decoration: none; }
.chapter-nav a:hover { color: var(--brand); }

.chapter-list { margin-top: 22px; display: flex; flex-direction: column; gap: 26px; }
.chapter { border-top: 1px solid var(--line); padding-top: 18px; }
.chapter:first-child { border-top: 0; padding-top: 0; }
.chapter-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chapter-title { font-size: 18px; margin: 0; }
.chapter-tools { display: flex; align-items: center; gap: 8px; }
.chapter-wc { font-size: 12.5px; color: var(--muted); }

/* 表单辅助 */
.form-divider {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 6px;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.form-divider::before, .form-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-row input { width: auto; }

/* 私有/仅自己可见 提示与标签 */
.notice-private { background: var(--brand-soft); border-color: #bfded7; color: var(--brand-dark, #0f5a4f); }
.tag-private { background: #eef2ff; border-color: #cdd9ff; color: #3a4fb5; font-weight: 600; }

/* 作品「未发表」草稿态：标签与提示条 */
.tag-draft { background: #f3f4f6; border-color: #d9dce3; color: #5b6472; font-weight: 600; }
.notice-draft { background: #fff8e6; border-color: #f2dfae; color: #7a5b12; }

/* 微信扫码登录 */
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 12px;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.btn-wechat {
  background: #07c160; color: #fff; border-color: #07c160;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-wechat:hover { background: #06ad56; border-color: #06ad56; color: #fff; }
.wx-ico { font-size: 17px; line-height: 1; }

/* 百度账号登录（贴吧用户即用百度账号） */
.btn-baidu {
  background: #4e6ef2; color: #fff; border-color: #4e6ef2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-baidu:hover { background: #3b5bdb; border-color: #3b5bdb; color: #fff; }

/* 第三方登录入口「待配置」态：入口始终可见，未配置时置灰不可点 */
.btn.is-off { opacity: .5; cursor: not-allowed; pointer-events: none; }
.off-tag {
  font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35);
  margin-left: 2px;
}

/* 头像：文字头像与图片头像共用 .avatar 尺寸 */
.avatar { overflow: hidden; }
.avatar img, img.avatar { object-fit: cover; border-radius: 50%; }

/* ================= 手机端适配细化（700px / 480px） ================= */
@media (max-width: 700px) {
  /* 头部：品牌与用户区一行；7 个导航入口改为横向滑动，避免挤成多行 */
  .header-inner { height: auto; flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .user-area { margin-left: auto; }
  .main-nav {
    order: 3; width: 100%; margin-left: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { white-space: nowrap; padding: 9px 12px; font-size: 14px; }

  /* 输入框 ≥16px，防止 iOS Safari 聚焦时自动放大整个页面 */
  input, select, textarea { font-size: 16px; }

  /* 后台表格：横向滚动更顺滑，内边距收紧 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table { font-size: 13.5px; }
  .table th, .table td { padding: 9px 10px; }

  /* 筛选栏：输入项自适应铺满，不再被 min-width 撑出屏幕 */
  .filter-bar { padding: 14px; gap: 8px; }
  .filter-bar .fi { min-width: 0; flex: 1 1 140px; }
  .filter-bar input, .filter-bar select { width: 100%; }

  /* 页脚纵向排列 */
  .footer-inner { flex-direction: column; align-items: stretch; gap: 20px; padding: 26px 20px; }
  .footer-inner > div:first-child { max-width: 100%; }

  /* 登录/注册卡片留白收紧 */
  .auth-box { margin: 20px auto; }

  /* 图片画廊更紧凑 */
  .media-gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .media-cell img, .media-cell video { height: 110px; }

  /* 提升点击热区 */
  .btn { min-height: 38px; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 14px; }
  .hero { padding: 22px 16px; }
  .hero h1 { font-size: 22px; }
  .hero-search { flex-direction: column; gap: 8px; }
  .hero-search input { width: 100%; }
  .hero-search .btn { width: 100%; }
  .hero-stats { gap: 18px; }
  .hero-stats div strong { font-size: 24px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .card-pad { padding: 14px; }
  .section-head h2 { font-size: 17px; }

  /* 列表行在极窄屏折行，避免右侧浏览/点赞数被挤出屏幕 */
  .post-row { flex-wrap: wrap; gap: 8px; }
  .post-row .nums { text-align: left; min-width: 0; }

  .filter-bar .fi { flex-basis: 100%; }
  .chips { gap: 6px; }
  .admin-tabs a { padding: 7px 11px; font-size: 13px; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 8px 9px; }
  .media-gallery { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { padding: 22px 16px; }
  .copyright { padding: 12px 16px; }
}

/* ============================================================
   简洁登录页版式（base_plain.html）
   登录 / 注册 / 找回密码与主页版式彻底分离：不带站点导航与页脚
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 50% -180px, var(--brand-soft) 0%, rgba(231, 242, 239, 0) 70%),
    var(--bg);
}
.auth-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px;
}
.auth-brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink); font-weight: 700; font-size: 15.5px;
}
.auth-brand:hover { color: var(--ink); }
.auth-brand .brand-mark { display: inline-flex; }
.auth-back { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.auth-back:hover { color: var(--brand); }

.auth-flash { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 20px; }
.auth-flash .flash:last-child { margin-bottom: 6px; }

.auth-main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 6px 20px 34px; }
/* 简洁页里卡片自身已居中，去掉主页版式遗留的上边距与宽度限制 */
.auth-main .auth-box { max-width: 100%; margin: 0; }
.auth-main .auth-box .card { box-shadow: var(--shadow); }

.auth-copy {
  text-align: center; color: var(--muted);
  font-size: 12.5px; margin: 0; padding: 0 20px 24px;
}

@media (max-width: 700px) {
  .auth-bar { padding: 12px 14px; }
  .auth-flash { padding: 0 14px; }
  .auth-main { padding: 0 14px 28px; }
  .auth-main .auth-box .card-pad { padding: 20px 17px; }
  .auth-title { font-size: 22px; }
  .auth-copy { padding: 0 14px 18px; }
}

/* ============================================================
   手机版 / 电脑版分流（base.html + app.py current_layout）
   手机版：顶部精简，主导航收进底部标签栏；电脑版维持原有顶部导航
   ============================================================ */
.layout-desktop .tabbar { display: none; }
.layout-switch { color: var(--brand-dark); }

.layout-mobile { padding-bottom: 62px; }          /* 给固定底栏让位 */
.layout-mobile .main-nav { display: none; }        /* 主导航交给底部标签栏 */
.layout-mobile .brand-text small { display: none; }/* 省掉口号 */
.layout-mobile .site-header { position: sticky; top: 0; z-index: 40; }
.layout-mobile .header-inner { gap: 8px; }
.layout-mobile .user-area { gap: 6px; margin-left: auto; }
/* 顶栏只留头像与退出，积分/称号等细节留给「我的」页 */
.layout-mobile .me-chip > *:not(.avatar) { display: none; }
.layout-mobile .me-chip { padding: 4px; }
.layout-mobile .site-footer { margin-top: 28px; }

/* ---------------- 底部标签栏 ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(30, 40, 37, .06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tb {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 7px 2px 6px;
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.tb:hover { color: var(--brand-dark); }
.tb.on { color: var(--brand-dark); }
.tb.on::before {
  content: ""; position: absolute; top: 0; left: 50%; margin-left: -11px;
  width: 22px; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--brand);
}
.tb-i { font-size: 19px; line-height: 1.1; }
.tb-t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-ava { width: 21px; height: 21px; border-radius: 50%; object-fit: cover; }

/* ============================================================
   左侧栏版式（全站统一）
   统计 + 目录固定在正文左侧；手机版收成页面顶部一行，不挤正文
   ============================================================ */
.cols-left { display: grid; grid-template-columns: 288px 1fr; gap: 22px; align-items: start; }
.cols-left > .col-main { min-width: 0; }

/* ---- 左栏：站点统计 ---- */
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-stats a {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); text-align: center;
}
.side-stats a:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.side-stats a:last-child { grid-column: 1 / -1; }   /* 5 项：末尾独占一行，避免半格 */
.side-stats strong { font-size: 19px; line-height: 1.15; font-weight: 700; color: var(--brand-dark); }
.side-stats span { font-size: 11.5px; color: var(--muted); }

/* ---- 左栏：目录 ---- */
.side-links { display: flex; flex-direction: column; gap: 2px; }
.side-links a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; }
.side-links a:hover { background: var(--surface-2); color: var(--brand-dark); }
.side-links a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

@media (max-width: 1120px) {
  .cols-left { grid-template-columns: 248px 1fr; gap: 18px; }
}

/* 窄屏 / 手机版：左栏不占列，只留顶部一行统计，目录与城市交给底部标签栏 */
@media (max-width: 1000px) {
  .cols-left { grid-template-columns: 1fr; }
  /* 手机/窄屏：左栏本来就只剩一行统计，收起开关没意义，隐掉 */
  .sidebar-left > .side-toggle,
  .sidebar-left > .side-head-card,
  .sidebar-left > .side-menu,
  .sidebar-left > .side-cities { display: none; }
  .sidebar-left > .side-stats-card {
    background: transparent; border: 0; box-shadow: none; padding: 0 0 4px;
  }
  .sidebar-left .side-stats-card > .side-title { display: none; }
  .side-stats {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(74px, 1fr);
    gap: 8px; padding: 2px 0 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .side-stats a:last-child { grid-column: auto; }
  .side-stats::-webkit-scrollbar { display: none; }
  .side-stats strong { font-size: 16px; }
}

/* ---- 左栏：当前页标题 + 所属板块（标题与板块名都放左侧）---- */
.side-head-card { background: var(--brand-soft); border-color: #cfe4df; }
.side-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  color: var(--brand-dark); opacity: .75; margin-bottom: 3px;
}
.side-page-title { font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.side-page-sub { font-size: 12.5px; color: var(--brand-dark); margin-top: 5px; }

/* ---- 目录里嵌套的板块名 ---- */
.side-sub {
  display: flex; flex-direction: column; gap: 1px;
  margin: 2px 0 5px 10px; padding-left: 9px;
  border-left: 2px solid var(--line);
}
.side-sub a { display: block; padding: 5px 8px; border-radius: 7px; font-size: 13px; color: var(--muted); }
.side-sub a:hover { background: var(--surface-2); color: var(--brand-dark); }
.side-sub a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* 写作页左栏的章节目录：标出当前正在编辑的一章 */
.chapter-nav li.on a { color: var(--brand-dark); font-weight: 700; }
.chapter-nav li.on::marker { color: var(--brand); }

/* 左栏列表里的次要说明行（作品所属板块、章节数等） */
.side-links a .side-note,
.side-note {
  display: block; margin-top: 2px;
  font-size: 11.5px; font-weight: 400; color: var(--muted);
}
/* 章节目录里跟在标题后面的小操作（编辑） */
.side-mini { margin-left: 5px; font-size: 12px; color: var(--brand-dark); white-space: nowrap; }
.side-mini:hover { text-decoration: underline; }

/* ============================================================
   左侧目录栏：可收起 / 展开
   开关在左栏顶部，状态存 cookie（服务端渲染，刷新不闪）
   ============================================================ */
.side-toggle {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 8px 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
}
.side-toggle:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.side-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.side-toggle .st-ico { font-size: 14px; line-height: 1; }
.side-toggle .st-txt { letter-spacing: .08em; }

/* 左栏吸顶 + 内部滚动：滚到页面下方也能点到开关、看到章节目录 */
@media (min-width: 1001px) {
  .cols-left { transition: grid-template-columns .18s ease; }
  .sidebar-left {
    position: sticky; top: 14px;
    max-height: calc(100vh - 28px);
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .sidebar-left > * { flex-shrink: 0; }

  /* 收起态：左栏缩成一条窄带，只剩开关，正文顺势变宽 */
  body.side-collapsed .cols-left { grid-template-columns: 42px 1fr; }
  body.side-collapsed .sidebar-left > *:not(.side-toggle) { display: none; }
  body.side-collapsed .side-toggle { flex-direction: column; gap: 9px; padding: 12px 3px; }
  body.side-collapsed .side-toggle .st-txt {
    writing-mode: vertical-rl; letter-spacing: .18em; font-size: 12px;
  }
}

/* ============================================================
   章节编辑页：阅读态 / 编辑态原地切换
   平时只显示正文文字，点「编辑正文」编辑窗口才在原地展开
   ============================================================ */
[hidden] { display: none !important; }

.chapter-view-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px;
}
.chapter-view-title { font-size: 20px; margin: 2px 0 0; }
.chapter-view-body { min-height: 70px; }

/* 阅读态与编辑态占据同一位置，不要两份相邻卡片之间的间距 */
.chapter-view + .chapter-form { margin-top: 0; }

/* 有未保存修改时的提示 */
.dirty-hint { font-size: 13px; font-weight: 600; color: var(--accent); }

@media (max-width: 700px) {
  .chapter-view-head { gap: 10px; }
  .chapter-view-title { font-size: 18px; }
}

/* 阅读态整块可单击进入编辑（提示可用） */
.chapter-view { cursor: pointer; }
.chapter-view:hover { border-color: var(--brand); }
.chapter-view-head { pointer-events: none; }   /* 标题区不拦截点击，按钮单独放开 */
.chapter-view-head .btn { pointer-events: auto; }
.chapter-view-tip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
