/* ============================================================
 * 健享社区 — 样式 style.css
 * 设计基调：温暖、可信、专业。主色沿用 antd 蓝 #1677ff，
 * 辅以健康绿/暖橙点缀，圆角卡片 + 柔和阴影。
 * ============================================================ */
:root {
  --blue: #1677ff;
  --blue-soft: #e6f0ff;
  --green: #52c41a;
  --orange: #fa8c16;
  --pink: #eb2f96;
  --red: #ff4d4f;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #8a94a6;
  --line: #eef1f6;
  --shadow: 0 2px 12px rgba(20, 40, 80, .06);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.empty { color: var(--muted); padding: 30px 10px; text-align: center; }

/* ---------- 布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- 左侧栏目栏 + 主内容 双栏布局 ---------- */
.layout { display: flex; gap: 20px; align-items: flex-start; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main-content { flex: 1; min-width: 0; max-width: none; margin: 0; padding: 0 !important; }
.sidebar { width: 240px; flex: none; position: sticky; top: 76px; margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.side-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.side-title { font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 8px 8px; }
.side-col { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--text); text-decoration: none; transition: .15s; }
.side-col:hover { background: #f3f6fc; text-decoration: none; }
.side-col.active { background: var(--blue-soft); }
.side-col.active .side-name { color: var(--blue); }
.side-emoji { font-size: 20px; flex: none; }
.side-text { display: flex; flex-direction: column; min-width: 0; }
.side-name { font-weight: 600; font-size: 14px; }
.side-desc { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-note { font-size: 11.5px; color: var(--muted); padding: 0 6px; line-height: 1.6; }

/* 管理面板 */
.admin-sec { margin-bottom: 16px; }
.admin-sec h3 { margin: 10px 0 6px; font-size: 15px; }
.admin-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.admin-row { display: flex; align-items: center; gap: 8px; background: #f7f9fc; border-radius: 10px; padding: 8px 10px; font-size: 13px; flex-wrap: wrap; }
.admin-row .spacer { flex: 1; }
.admin-post-title { font-weight: 600; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; background: #fff; }
.btn.danger { color: var(--red); }
.admin-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-box { flex: 1; min-width: 220px; background: #f7f9fc; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.admin-box b { font-size: 13.5px; }
.admin-box input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; }
.admin-box input:focus { border-color: var(--blue); }

/* 验证码行 / 微信扫码 */
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; }
.code-row input:focus { border-color: var(--blue); }
.seg-3 button { font-size: 13px; padding: 9px 4px; }
.wx-area { display: flex; flex-direction: column; align-items: center; padding: 8px 0; }
.wx-iframe { width: 300px; height: 400px; border: none; }
.wx-tip { background: #f7f9fc; border-radius: 12px; padding: 16px; font-size: 13px; color: #4a5568; line-height: 1.7; }

/* ---------- 顶部栏 ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.topbar-inner { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.logo { font-size: 22px; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.search { flex: 1; max-width: 460px; display: flex; gap: 6px; }
.search input { flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 20px; padding: 0 16px; background: #fafbfe; outline: none; }
.search input:focus { border-color: var(--blue); background: #fff; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-area { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 10px; border-radius: 20px; background: #f3f6fc; }
.uname { font-weight: 600; }
.bell { position: relative; background: none; border: none; font-size: 20px; cursor: pointer; }
.bell .dot { position: absolute; top: -4px; right: -6px; background: var(--red); color: #fff; font-size: 10px; border-radius: 10px; padding: 0 4px; font-style: normal; }

/* ---------- 按钮 ---------- */
.btn { border: none; border-radius: 10px; padding: 9px 16px; font-size: 14px; cursor: pointer; font-weight: 600; transition: .15s; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0e63e6; }
.btn-ghost { background: #eef2f8; color: var(--text); }
.btn-ghost:hover { background: #e2e8f2; }
.block { display: block; width: 100%; margin-top: 12px; }
.post-btn { white-space: nowrap; }

/* ---------- 头像 ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, #d6e6ff, #ffe6f1); color: #333; flex: none; }

/* ---------- Hero ---------- */
.hero { display: flex; gap: 24px; align-items: center; margin: 22px 0; background: linear-gradient(120deg, #eaf2ff, #fdeef6); border-radius: 20px; padding: 28px; }
.hero-text { flex: 1; }
.hero-text h1 { font-size: 26px; margin: 0 0 10px; line-height: 1.35; }
.hero-text p { color: #4a5568; margin: 0 0 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-card { display: flex; gap: 18px; background: #fff; border-radius: 16px; padding: 18px 26px; box-shadow: var(--shadow); }
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 24px; color: var(--blue); }
.hero-stat span { font-size: 12px; color: var(--muted); }

/* ---------- 公告 ---------- */
.announce { background: #fff8e6; border: 1px solid #ffe2a8; color: #7a5b00; border-radius: 12px; padding: 12px 16px; font-size: 13px; margin-bottom: 8px; }
.announce b { color: #b45309; }

.section-title { font-size: 19px; margin: 26px 0 14px; }

/* ---------- 栏目卡 ---------- */
.cols-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.col-card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: .15s; box-shadow: var(--shadow); }
.col-card:hover { transform: translateY(-2px); border-color: var(--blue); }
.col-emoji { font-size: 28px; }
.col-name { font-weight: 700; }
.col-desc { font-size: 12px; color: var(--muted); }

/* ---------- 帖子网格与卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.post-card { cursor: pointer; transition: .15s; }
.post-card:hover { transform: translateY(-2px); border-color: #cfe0ff; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.author { font-weight: 700; }
.card-col { font-size: 12px; color: var(--blue); margin: 8px 0 2px; }
.post-title { font-size: 16px; margin: 4px 0; line-height: 1.4; }
.post-title.big { font-size: 22px; margin: 10px 0; }
.post-excerpt { color: #5b6677; font-size: 14px; margin: 4px 0; }
.post-body { font-size: 15px; color: #2b3442; margin: 10px 0; white-space: pre-wrap; }

/* 标签 / 徽章 */
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tag { background: #eef4ff; color: #2f6bd8; font-size: 12px; padding: 2px 8px; border-radius: 8px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.badge-featured { background: #fff1d6; color: #b4760a; }
.badge-pending { background: #e9e4ff; color: #6b46c1; }
.badge-latest { background: #e8f7ee; color: #2c9c54; }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mini-badge { font-size: 11px; background: #f1f5fb; color: #55657a; padding: 1px 7px; border-radius: 8px; }

/* 缩略图 */
.thumb-row { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.thumb { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: #f0f3f8; }

/* 操作栏 */
.actions { display: flex; gap: 6px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; }
.actions.big { font-size: 15px; }
.act { border: none; background: #f4f7fb; color: #4a5568; border-radius: 18px; padding: 6px 12px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; transition: .15s; }
.act:hover { background: #e8eefc; color: var(--blue); }
.act.liked { background: #ffe9ec; color: var(--red); }
.act.small { padding: 3px 9px; font-size: 12px; }
.act.more { margin-left: auto; }
.tts-btn { border: 1px solid #d7e3f7; background: #f3f8ff; color: var(--blue); border-radius: 16px; padding: 4px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.tts-btn.on { background: var(--blue); color: #fff; }

/* 帖子详情 */
.crumb { color: var(--muted); font-size: 13px; margin: 16px 0 6px; }
.crumb a { color: var(--muted); }
.col-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 6px 0 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { border: none; background: #eef2f8; color: #5b6677; padding: 8px 18px; border-radius: 20px; cursor: pointer; font-weight: 600; }
.tab.active { background: var(--blue); color: #fff; }
.img-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.post-img { max-width: 100%; max-height: 320px; border-radius: 12px; }

/* 管理员条 */
.admin-bar { background: #f3effe; border: 1px solid #ddd0fb; border-radius: 10px; padding: 10px 14px; margin-top: 12px; font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 回复 */
.reply-box { margin-top: 22px; }
.reply-input { display: flex; gap: 10px; align-items: flex-start; }
.reply-input textarea { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 60px; resize: vertical; outline: none; }
.reply-input textarea:focus { border-color: var(--blue); }
.reply-list { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.reply { display: flex; gap: 10px; }
.reply-main { flex: 1; background: #f7f9fc; border-radius: 12px; padding: 10px 14px; }
.reply-meta { font-size: 13px; }
.reply-text { margin: 4px 0 6px; }

/* 鼓励榜 */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 16px; margin: 18px 0; }
.podium-item { text-align: center; background: var(--card); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); width: 150px; }
.podium-item.rank-1 { transform: scale(1.08); border: 2px solid #ffd666; }
.medal { font-size: 26px; }
.pname { font-weight: 700; margin: 4px 0; }
.pwarm { color: var(--orange); font-weight: 700; }
.plevel { font-size: 12px; color: var(--muted); }
.rank-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rank-row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); cursor: pointer; }
.rank-no { width: 24px; text-align: center; color: var(--muted); font-weight: 700; }
.rname { font-weight: 600; }
.rspacer { flex: 1; }
.rwarm { font-weight: 800; color: var(--orange); }

/* 我的 */
.profile-head { display: flex; gap: 18px; align-items: center; background: var(--card); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); margin-top: 14px; }
.profile-head h1 { margin: 0 0 4px; font-size: 22px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.progress { height: 8px; background: #eef1f6; border-radius: 6px; margin: 8px 0 4px; width: 240px; max-width: 100%; overflow: hidden; }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); }
.stat-row { display: flex; gap: 12px; margin: 16px 0; }
.stat { flex: 1; background: var(--card); border-radius: 12px; padding: 14px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 22px; color: var(--blue); }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 30, 50, .45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { position: relative; background: #fff; border-radius: 18px; padding: 24px; width: 480px; max-width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-sm { width: 380px; }
.modal-lg { width: 560px; }
.modal-close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal h2 { margin: 0 0 14px; font-size: 19px; }
.modal h3 { margin: 14px 0 6px; font-size: 15px; color: #33415c; }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; font-family: inherit; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.seg { display: flex; gap: 8px; margin-bottom: 6px; }
.seg button { flex: 1; border: 1px solid var(--line); background: #f7f9fc; border-radius: 10px; padding: 9px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.agree { font-size: 13px; color: #4a5568; margin: 10px 0; display: flex; align-items: flex-start; gap: 6px; }
.agree input { margin-top: 3px; }
.legal { font-size: 13px; color: #44506a; max-height: 60vh; overflow: auto; }
.legal p { margin: 6px 0; }
.legal ul { padding-left: 18px; }

/* 图片预览 */
.img-preview { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.thumb-wrap { position: relative; }
.thumb-wrap .thumb { width: 72px; height: 72px; }
.thumb-x { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; cursor: pointer; line-height: 1; }
.upload-row { display: flex; align-items: center; gap: 10px; }

/* AI 审核结果 */
.ai-result { margin: 8px 0; min-height: 4px; }
.ai-loading { color: var(--blue); font-weight: 600; }
.ai-ok { background: #eafaf0; border: 1px solid #b7e4c7; color: #1c7a45; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.ai-fail { background: #fdecec; border: 1px solid #f5c2c2; color: #c0392b; border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* 菜单弹窗 */
.modal-menu .menu { display: flex; flex-direction: column; gap: 4px; }
.modal-menu .menu button { text-align: left; border: none; background: none; padding: 12px 10px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.modal-menu .menu button:hover { background: #f3f6fc; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

/* 通知 */
.notify-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow: auto; }
.notify { background: #f7f9fc; border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px); background: rgba(30,40,60,.92); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: 80vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 移动端底部导航 */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 60; }
.bottom-nav a { flex: 1; text-align: center; padding: 8px 0; font-size: 11px; color: #6b7686; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bottom-nav a span { font-size: 11px; }

/* ---------- 页脚（备案公示） ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { padding: 26px 16px 24px; text-align: center; }
.foot-brand { font-weight: 800; font-size: 15px; color: var(--text); margin-bottom: 6px; }
.foot-note { color: #4a5568; font-size: 12.5px; margin-bottom: 12px; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; margin-bottom: 8px; }
.foot-links .foot-link { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.foot-links .foot-link:hover { color: var(--blue); text-decoration: none; }
.foot-todo { color: #b0b8c6 !important; border-bottom: 1px dashed #cfd6e2; cursor: help; }
.foot-beian { margin-top: 8px; }
.foot-beian .foot-link { display: inline-flex; align-items: center; gap: 4px; }
.gongan-badge { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 3px; background: #2b6cb0; color: #fff; font-size: 10px; line-height: 1; flex: none; }
.foot-copy { color: #a9b2c0; font-size: 12px; margin-top: 10px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .hero { flex-direction: column; text-align: center; }
  .cols-grid { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  /* 小屏收起左侧栏，改为顶部横向滚动栏目条 */
  .layout { flex-direction: column; }
  .sidebar { position: static; width: 100%; margin-top: 12px; }
  .side-group { display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .side-title, .side-note { display: none; }
  .side-col { flex: none; }
  .side-text .side-desc { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { height: 54px; gap: 8px; }
  .brand-name { display: none; }
  .search { max-width: none; }
  .search input { height: 34px; }
  .post-btn { padding: 7px 10px; }
  .uname { display: none; }
  .cols-grid { grid-template-columns: 1fr; }
  .hero-card { width: 100%; justify-content: space-around; }
  .podium { flex-direction: column; align-items: center; }
  .podium-item { width: 80%; }
  .bottom-nav { display: flex; }
  main.container { padding-bottom: 70px; }
  /* 避免页脚被固定底部导航遮挡 */
  .site-footer { margin-bottom: 52px; }
  .foot-links { gap: 6px 10px; }
}
