:root {
  --bg: #eef3ef;
  --card: #ffffff;
  --ink: #2c3a34;
  --muted: #7c8c84;
  --line: #dde7e0;
  --brand: #5e8b76;
  --brand-2: #7fae97;
  --brand-soft: #e3efe8;
  --deep: #3f6353;
  --danger: #c0473f;
  --shadow: 0 6px 22px rgba(44, 58, 52, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; width: 100%; }

/* Header */
.site-header {
  background: linear-gradient(to right, #6f9e86 0%, #8fb6a2 50%, #a7c6b4 100%);
  color: #fff;
  padding: 30px 20px 26px;
}
.detail-header { padding: 30px 20px 26px; }
.header-inner {
  max-width: 880px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-emoji { font-size: 42px; }
.site-header h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.tagline { margin: 4px 0 0; font-size: 14px; opacity: 0.92; }
.back-link { color: #fff; text-decoration: none; font-size: 18px; font-weight: 700; opacity: 0.95; }
.back-link:hover { opacity: 1; }
.back-stack { display: inline-flex; align-items: center; gap: 5px; line-height: 1.25; }
.back-stack .back-arrow { font-size: 18px; opacity: .85; }
.back-stack .back-text { display: flex; flex-direction: column; }
.back-stack .back-main { font-size: 19px; font-weight: 700; }
.back-stack .back-sub { font-size: 13px; font-weight: 400; opacity: .82; margin-top: 1px; }

.mode-badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.mode-badge.online { background: rgba(255,255,255,0.22); color: #fff; border: 1px solid rgba(255,255,255,0.45); }
.mode-badge.local { background: #fff3cd; color: #8a6d00; border: 1px solid #ffe69b; }

/* Layout */
.container { max-width: 880px; margin: -18px auto 0; padding: 0 12px 32px; }
.home-main { padding-left: 0; padding-right: 0; padding-bottom: 88px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* Composer */
.composer { margin-bottom: 18px; }
.composer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.anon-badge { background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.hint { font-size: 12px; color: var(--muted); }

.title-input, .content-input, .search-input, .category-select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-family: inherit; color: var(--ink);
  outline: none; background: #fafdfb; transition: border-color .15s, box-shadow .15s;
}
.title-input { margin-bottom: 10px; }
.content-input { resize: vertical; margin-bottom: 12px; min-height: 72px; }
.title-input:focus, .content-input:focus, .search-input:focus, .category-select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff;
}

.composer-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.select-wrap { position: relative; }
.category-select { width: auto; min-width: 180px; cursor: pointer; appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235e8b76' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.composer-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.char-count { font-size: 12px; color: var(--muted); }

.primary-btn {
  background: var(--brand); color: #fff; border: none; padding: 10px 24px;
  border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .1s, opacity .15s;
}
.primary-btn:hover { opacity: .92; }
.primary-btn:active { transform: scale(.97); }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; }
.composer-msg { margin: 10px 0 0; font-size: 13px; min-height: 18px; }
.composer-msg.ok { color: #2f7d54; }
.composer-msg.err { color: var(--danger); }

/* 提问入口（收起态） */
.ask-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ask-cta-text { display: flex; flex-direction: column; gap: 4px; }
.ask-cta-title { font-size: 18px; font-weight: 700; color: var(--deep); }
.ask-cta-sub { font-size: 13px; color: var(--muted); }
.ask-open-btn {
  background: var(--brand); color: #fff; border: none; padding: 12px 26px;
  border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(94, 139, 118, .35);
  transition: transform .12s, opacity .15s;
}
.ask-open-btn:hover { opacity: .94; }
.ask-open-btn:active { transform: scale(.97); }

/* 提问弹窗 */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(34, 46, 40, .42); backdrop-filter: blur(2px); animation: fadein .18s ease; }
.modal-card {
  position: relative; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  background: var(--card); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(20, 30, 26, .28);
  padding: 22px; animation: modal-pop .2s ease;
}
@keyframes modal-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.modal-close {
  border: none; background: var(--brand-soft); color: var(--brand); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; flex-shrink: 0;
  transition: background .15s;
}
.modal-close:hover { background: #d4e8dc; }
/* 弹窗内的 composer 不再自带外边距 */
.modal-card.composer { margin-bottom: 0; }

/* Toolbar: collapsed search icon + sort */
.toolbar { margin-bottom: 0; padding: 6px 0; position: relative; }
.search-wrap { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.search-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: transparent; color: var(--muted); cursor: pointer; transition: all .15s;
}
.search-toggle:hover { background: rgba(94,139,118,.08); color: var(--brand); }
.search-toggle.active { color: var(--brand); background: rgba(94,139,118,.10); }
.search-input-wrap {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  width: min(320px, calc(100vw - 24px)); display: flex; align-items: center; gap: 6px;
}
.search-toggle .ico { width: 20px; height: 20px; }
.search-input-wrap .search-input { flex: 1; min-width: 0; margin: 0; padding: 9px 12px; font-size: 14px; border-radius: 999px; }
.search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .6; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-all { position: relative; display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.all-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--muted); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.all-pill:hover { border-color: var(--brand-2); color: var(--brand); }
.all-pill.has-value { background: var(--brand); color: #fff; border-color: var(--brand); }
.all-pill.has-value:hover { color: #fff; }
.all-pill .caret { font-size: 10px; opacity: .85; transition: transform .2s; }
.all-pill.open .caret { transform: rotate(180deg); }
.cat-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; min-width: 200px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.cat-dropdown.hidden { display: none; }
.cat-dropdown button {
  border: none; background: var(--brand-soft); color: var(--deep);
  padding: 8px 10px; border-radius: 10px; font-size: 13px; cursor: pointer; text-align: left;
}
.cat-dropdown button:hover { background: #d4e8dc; }
.pill {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.pill:hover { border-color: var(--brand-2); color: var(--brand); }
.pill.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-2); font-weight: 600; }
.featured-pill { margin-left: 8px; }
.featured-pill.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.featured-pill.active:hover { color: #fff; }

/* Feed / cards */
.feed-head { display: flex; align-items: center; justify-content: space-between; margin: 0; position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 12px; border-bottom: none; }
.feed-head h2 { font-size: 16px; margin: 0; }
.ghost-btn.small { background: var(--brand-soft); border: 1px solid var(--line); color: var(--brand); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }

/* feed-head right: sort dropdown */
.feed-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.sort-toggle { position: relative; display: inline-flex; }
.sort-btn-main {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  border: none; background: transparent; color: var(--muted);
  width: 36px; height: 36px; border-radius: 50%; font-size: 13px;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.sort-btn-main:hover { background: rgba(94,139,118,.08); color: var(--brand); }
.sort-btn-main.active { color: var(--brand); background: rgba(94,139,118,.10); }
.sort-btn-main .sort-ico { width: 20px; height: 20px; }
.sort-btn-main .caret { font-size: 9px; opacity: .75; transition: transform .2s; }
.sort-btn-main.open .caret { transform: rotate(180deg); }
.sort-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; min-width: 110px;
}
.sort-dropdown button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  color: var(--ink); padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.sort-dropdown button:hover { background: var(--brand-soft); }
.sort-dropdown button.active { color: var(--brand); font-weight: 600; }

/* Admin */
.admin-btn { background: rgba(255,255,255,0.22); color: #fff; border: 1px solid rgba(255,255,255,0.45); padding: 5px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.admin-btn:hover { background: rgba(255,255,255,0.32); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; }

/* 个人中心入口按钮（纯图标，无填充底） */
.me-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: transparent; border: none;
  color: #fff; text-decoration: none;
  border-radius: 50%; font-size: 14px;
  cursor: pointer; transition: background .15s;
}
.me-btn .ico { width: 22px; height: 22px; }
.me-btn:hover { background: rgba(255,255,255,0.18); }
.me-btn .notif-badge { position: absolute; top: -2px; right: -2px; }

.admin-panel-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; background: #f8faf9; border-radius: 10px;
}
.admin-panel-row.unlocked .admin-input,
.admin-panel-row.unlocked #adminUnlock { display: none; }
.admin-panel-row.locked #adminExit { display: none; }
.admin-panel-row .admin-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.admin-input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; flex: 1; min-width: 90px; outline: none; }
.admin-input:focus { border-color: var(--brand); }
.admin-badge { background: #fff3cd; color: #8a6d00; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid #ffe69b; white-space: nowrap; }
.card-del { margin-left: auto; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 8px; }
.card-del:hover { background: #fdf2f1; color: var(--danger); }
.card-admin {
  margin-left: auto; border: 1px solid var(--line); background: #fff;
  color: var(--brand); cursor: pointer; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.card-admin:hover { background: var(--brand-soft); }
.post-topic.featured { background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-2); font-weight: 600; }

/* 管理员操作弹窗（删除 / 精选 / 取消精选） */
.admin-menu {
  position: absolute; z-index: 90; min-width: 160px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(44,58,52,.18); padding: 6px; overflow: hidden;
}
.admin-menu.hidden { display: none; }
.admin-menu-item {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  color: var(--ink); font-size: 14px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.admin-menu-item:hover { background: var(--brand-soft); }
.admin-menu-item.danger { color: var(--danger); }
.admin-menu-item.danger:hover { background: #fdf2f1; }

/* Manage link box */
.manage-box { margin-top: 12px; background: var(--brand-soft); border: 1px dashed var(--brand-2); border-radius: 12px; padding: 12px; }
.manage-label { font-size: 12.5px; color: var(--deep); margin-bottom: 8px; }
.manage-row { display: flex; gap: 8px; align-items: center; }
.manage-url { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; background: #fff; color: var(--ink); }
.reply-del.admin { color: var(--danger); }

.question-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5px; }
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; grid-column: 1 / -1; }
.question-card {
  background: var(--card); border-radius: 3px; box-shadow: var(--shadow);
  padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 5px;
  position: relative; height: 210px; overflow: hidden;
  transition: transform .12s, box-shadow .15s; border: 1px solid transparent;
  animation: fadein .25s ease;
}
.question-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(44,58,52,.12); border-color: var(--brand-soft); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.q-card-top { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; min-height: 0; }
.post-topic { font-size: 12px; color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
/* 首页卡片精选☆：仅图标，无背景无边框，浅金色 */
.q-feat-star { display: inline-flex; align-items: center; color: #e8c76b; margin-left: 4px; }
.q-feat-star .ico { width: 14px; height: 14px; }
/* 首页卡片话题标签：纯文字，无背景无边框 */
.q-tags { font-size: 12px; color: var(--brand); font-weight: 600; white-space: nowrap; }
.q-card-title { font-size: 16.5px; font-weight: 700; margin: 2px 0 0; }
.q-snippet { font-size: 14.5px; color: #44514b; margin: 0; white-space: pre-wrap; word-break: break-word; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.q-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; padding-right: 52px; font-size: 12.5px; color: var(--muted); min-height: 22px; flex-shrink: 0; }
.q-replies { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 4px; }

/* Detail page */
.detail-container { max-width: 720px; margin-top: 12px; }
.question-view { margin-bottom: 16px; }
.detail-container { padding-bottom: 80px; }
.reply-composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--line);
  padding: 0 16px;
  box-shadow: 0 -4px 20px rgba(44, 58, 52, 0.06);
  display: flex; flex-direction: column; justify-content: center;
}
.reply-composer::after {
  content: ''; display: block;
  height: env(safe-area-inset-bottom);
  flex-shrink: 0;
}
.reply-composer-bar {
  display: flex; align-items: flex-end; gap: 10px;
  max-width: 720px; margin: 6px auto;
  width: 100%;
}
.reply-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 20px;
  padding: 9px 14px; font-size: 15px; font-family: inherit; color: var(--ink);
  outline: none; background: #fafdfb; resize: none;
  min-height: 40px; max-height: 120px; line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
}
.reply-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
.reply-send-btn {
  border: none; background: var(--brand); color: #fff;
  padding: 9px 18px; border-radius: 20px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity .15s; flex-shrink: 0;
}
.reply-send-btn:hover { opacity: .92; }
.reply-send-btn:active { opacity: .85; }
.reply-send-btn:disabled { opacity: .5; cursor: not-allowed; }
.reply-composer .composer-msg { margin: 4px 0 0; font-size: 12px; text-align: center; }
.reply-composer .composer-msg:empty { display: none; }
.reply-composer .reply-quote-preview { margin: 6px 0 4px; }
.q-title-row { display: flex; align-items: center; gap: 10px; }
.q-featured { flex-shrink: 0; }
.q-title { font-size: 19.5px; font-weight: 700; margin: 6px 0 6px; line-height: 1.4; }
.q-date { font-size: 12px; color: var(--muted); margin: 0; }
.q-content { font-size: 15.5px; white-space: pre-wrap; word-break: break-word; margin: 10px 0 0; color: #36433d; line-height: 1.7; }
.q-cat-end { margin-top: 10px; }
.q-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; padding-top: 0;
  border-top: none;
}
.q-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--line);
  background: #fff; border-radius: 50%; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-2); }
.icon-btn.del-icon:hover { background: #fdf2f1; color: var(--danger); border-color: #f0c9c6; }
.icon-btn .ico { width: 1.15em; height: 1.15em; }
.icon-btn.hidden { display: none; }
.del-btn {
  border: 1px solid #f0c9c6; background: #fff; color: var(--danger);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
}
.del-btn:hover { background: #fdf2f1; }
.del-btn.hidden { display: none; }
.edit-btn {
  border: 1px solid var(--line); background: #fff; color: var(--brand);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; gap: 5px;
}
.edit-btn:hover { background: var(--brand-soft); }
.edit-btn.hidden { display: none; }

.replies-title { font-size: 16px; margin: 4px 0 14px; }
.replies-title span { color: var(--brand); }
.reply-list { display: flex; flex-direction: column; }
.reply-item {
  display: flex; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--line); animation: fadein .25s ease;
}
.reply-item:last-child { border-bottom: none; }
.reply-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.reply-body { flex: 1; min-width: 0; }
.reply-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.reply-name { font-size: 13px; font-weight: 600; color: var(--deep); }
.reply-time { font-size: 11px; color: var(--muted); }
.reply-text { font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; margin: 0; color: #36433d; }
.reply-at { font-size: 13px; color: var(--muted); }
.reply-del { margin-left: auto; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.reply-del:hover { color: var(--danger); }

/* Footer：普通流贴底，不覆盖内容，无分隔线 */
.site-footer {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); line-height: 1.7;
  background: var(--bg);
  margin-top: auto;
}
.footer-line1 { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--deep); font-weight: 600; }
.footer-line2 { font-size: 11px; opacity: .8; margin-top: 2px; }
/* 首页：固定输入框条占底部，主内容与页脚均让出空间 */
body.page-home .home-main { padding-bottom: 132px; }
body.page-home .site-footer { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
/* 搜索展开时隐藏固定底部输入框，避免被键盘顶起 */
body.search-open .ask-bar { display: none !important; }
/* 管理员锁图标（仅个人中心页脚） */
.admin-lock-btn {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 18px; height: 18px; margin-left: 5px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; border-radius: 50%; transition: all .15s;
}
.admin-lock-btn:hover { background: rgba(94,139,118,.12); color: var(--brand); }
.admin-lock-btn .ico { width: 12px; height: 12px; }

/* 统一描边图标（无填充，stroke 跟随文字颜色） */
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.2em; flex: none; }
.search-ico .ico { width: 17px; height: 17px; }

/* Notification badge in menu */
.notif-badge {
  background: var(--danger); color: #fff;
  font-size: 10px; min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 700;
}
.notif-badge.hidden { display: none; }

/* Quote (引用回复) */
.reply-quote {
  margin: 6px 0 8px; padding: 8px 12px; background: #f5f8f6; border-left: 3px solid var(--brand-2);
  border-radius: 8px; font-size: 13px; color: var(--muted); font-style: italic;
}
.reply-quote-preview {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px;
  padding: 8px 12px; background: #f5f8f6; border-left: 3px solid var(--brand);
  border-radius: 8px; font-size: 13px; color: #44514b;
}
.reply-quote-preview.hidden { display: none; }
.reply-quote-preview .rq-text { flex: 1; word-break: break-word; }
.rq-cancel {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.rq-cancel:hover { background: #e7ede9; color: var(--danger); }

/* 身份展示（昵称 + 头像） */
.reply-avatar.small { width: 24px; height: 24px; font-size: 13px; }
.q-author { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.q-author-name { font-size: 13px; font-weight: 600; color: var(--deep); }
.q-author-tag { font-size: 11px; color: var(--muted); background: var(--brand-soft); padding: 1px 8px; border-radius: 999px; }
.q-card-author { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.q-card-author .q-author-name { font-size: 13.5px; }

/* 嵌套回复（线程） */
.reply-item.nested { background: transparent; padding: 6px 0; box-shadow: none; border: none; border-radius: 0; }
.reply-children {
  margin-top: 6px; padding-left: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.reply-expand {
  align-self: flex-start; border: none; background: transparent;
  color: var(--brand); padding: 4px 0; font-size: 13px; cursor: pointer;
}
.reply-expand:hover { color: var(--deep); }
.reply-quote .rq-author { font-weight: 600; color: var(--deep); margin-right: 4px; }
.reply-quote.nested { margin-top: 6px; padding: 6px 10px; font-size: 12.5px; color: var(--muted); background: #eef3f0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #2c3a34; color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 60; animation: fadein .2s ease;
}
.toast.hidden { display: none; }

/* 固定底部「我想说」输入框（背景与顶部「欲言信箱」渐变一致） */
.ask-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: linear-gradient(to right, #a7c6b4 0%, #8fb6a2 50%, #6f9e86 100%);
  border-top: none;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(44,58,52,.10);
}
.ask-bar-inner { max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.ask-bar-input {
  flex: 1; min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 999px;
  padding: 0 18px; font-size: 14px; font-family: inherit; color: var(--ink);
  outline: none; background: #fafdfb; transition: border-color .15s, box-shadow .15s;
  height: 44px; line-height: 44px; text-align: center;
}
.ask-bar-input::placeholder { color: var(--muted); }
.ask-bar-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }

@media (max-width: 640px) {
  .site-header { padding: 22px 16px 20px; }
  .site-header h1 { font-size: 22px; letter-spacing: .5px; }
  .tagline { font-size: 12.5px; }
  .brand-emoji { font-size: 34px; }
  .header-inner { flex-wrap: nowrap; }
  .ask-cta { padding: 14px 16px; gap: 12px; flex-direction: row; align-items: center; }
  .ask-cta-title { font-size: 16px; }
  .ask-cta-sub { font-size: 12px; line-height: 1.55; }
  .ask-open-btn { width: auto; padding: 10px 18px; font-size: 14px; white-space: nowrap; }

  .question-list { grid-template-columns: repeat(2, 1fr); gap: 2.5px; }
  .question-card { padding: 11px; gap: 5px; border-radius: 3px; height: 190px; }
  .q-replies { right: 11px; bottom: 11px; }
  .question-card:hover { transform: none; }
  .q-card-author { gap: 6px; margin-bottom: 2px; }
  .q-card-author .reply-avatar.small { width: 22px; height: 22px; font-size: 12px; }
  .q-card-author .q-author-name { font-size: 12px; }
  .post-topic { font-size: 11px; padding: 2px 7px; }
  .q-card-title { font-size: 14px; margin: 0; }
  .q-snippet { font-size: 12.5px; line-height: 1.5; }
  .q-card-foot { font-size: 11px; margin-top: auto; padding-top: 2px; }
  .composer-foot { flex-direction: column; align-items: stretch; }
  .composer-right { margin-left: 0; justify-content: space-between; }
  .category-select { width: 100%; }

  /* 吸顶筛选行：保持与桌面一致的单行 */
  .feed-head { padding: 8px 0; gap: 8px; }
  .feed-head .filter-all { gap: 8px; }
  .feed-head-right { gap: 8px; }
  .feed-head .pill,
  .feed-head .all-pill,
  .feed-head .sort-btn,
  .feed-head .ghost-btn.small { padding: 7px 11px; font-size: 13px; }
  .feed-head .featured-pill { margin-left: 6px; }
  .toolbar { padding: 6px 0; }
  .search-input-wrap { right: 0; }
}

/* 我的身份（跨设备找回） */
.identity-block { padding: 4px 6px 2px; display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
.identity-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.identity-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.uid-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.uid-label { font-size: 12px; color: var(--muted); }
.uid-value { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--deep); background: #f3f7f4; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; word-break: break-all; }
.identity-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.identity-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.identity-form .admin-input { flex: 1; min-width: 120px; }
.identity-msg { font-size: 12px; min-height: 16px; line-height: 1.5; }
.identity-msg.ok { color: #2f7d54; }
.identity-msg.err { color: var(--danger); }
.ghost-btn.tiny { background: #fff; border: 1px solid var(--line); color: var(--brand); padding: 4px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.ghost-btn.tiny:hover { background: var(--brand-soft); }

/* 个人中心 me.html */
.brand.small { align-items: center; }
.brand.small .brand-emoji { font-size: 28px; }
.brand.small h1 { font-size: 18px; }
.me-container { max-width: 720px; padding-top: 24px; padding-bottom: 0; display: flex; flex-direction: column; flex: 1; width: 100%; }
.me-title { font-size: 22px; margin: 0 0 4px; color: var(--deep); }
.me-subtitle { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.identity-hint { font-size: 14px; color: var(--muted); margin: 0; text-align: center; flex: 1; display: flex; align-items: center; justify-content: center; }
/* 痕迹找回面板：身份卡片固定在顶部，提示语在剩余空间中居中 */
#panel-identity { display: flex; flex-direction: column; min-height: 0; }
.me-tabs {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 0; flex-wrap: nowrap; justify-content: space-between;
  background: var(--bg); padding: 10px 0 16px;
  border-bottom: 1px solid var(--line); margin-bottom: 18px;
  flex: 0 0 auto;
}
.me-tab {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.me-tab:hover { border-color: var(--brand-2); color: var(--brand); }
.me-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.me-panel { animation: fadein .25s ease; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.me-panel.hidden { display: none; }
.me-list { display: flex; flex-direction: column; gap: 10px; flex: 1; padding-bottom: 0; }
.me-row {
  display: block; background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 16px;
  color: var(--ink); text-decoration: none; cursor: pointer;
  transition: transform .1s, box-shadow .15s;
}
.me-row:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(44,58,52,.1); }
.me-row-title { color: var(--deep); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.me-row-kind { font-size: 13px; color: var(--brand); font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.me-row-snippet { font-size: 13.5px; color: #44514b; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.me-row-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.me-empty { text-align: center; color: var(--muted); line-height: 1.8; padding: 0 16px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.unread-dot {
  display: inline-flex; align-items: center;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}
.admin-hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

@media (max-width: 640px) {
  .me-tabs { gap: 0; padding: 8px 0 12px; justify-content: space-between; }
  .me-tab { padding: 7px 12px; font-size: 12.5px; }
}

/* 详情浮层（iframe）：进入详情不离开父页，返回不刷新、保留滚动 */
.detail-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #fff; }
.detail-overlay.hidden { display: none; }
.detail-overlay-bar { flex: 0 0 46px; display: flex; align-items: center; padding: 0 8px; background: #fafbfa; border-bottom: 1px solid var(--line); }
.detail-close { border: none; background: transparent; color: #44514b; font-size: 20px; line-height: 1; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.detail-close:active { background: #eef3ef; }
.detail-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
html.no-scroll { overflow: hidden; }
