/* ============================================================
 * mehhub · 无聊据点 — 样式
 * 调性：克制、松弛、略带反讽的"学术化"幽默
 * ============================================================ */
:root {
  --bg: #f4f1ec;
  --bg-soft: #ece7de;
  --card: #ffffff;
  --ink: #1f1e1b;
  --ink-2: #5f5a50;
  --ink-3: #9a948a;
  --line: #e7e2d8;
  --accent: #ff5c35;
  --accent-soft: #ffe9e2;
  --boring: #6b7280;
  --boring-soft: #eef0f2;
  --fun: #ff5c35;
  --weird: #7c5cff;
  --weird-soft: #f0ecff;
  --ai-bg: #f6f3ff;
  --ai-ink: #5b4bd6;
  --ai-line: #e7e0ff;
  --ok: #2f9e62;
  --danger: #d8432f;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(31, 30, 27, .05);
  --shadow: 0 1px 2px rgba(31, 30, 27, .04), 0 10px 28px rgba(31, 30, 27, .06);
  --maxw: 1080px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(244, 241, 236, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px 22px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: baseline; gap: 9px; font-weight: 800; letter-spacing: -.02em; }
.brand .wordmark { font-size: 22px; }
.brand .wordmark .meh { color: var(--ink-2); }
.brand .wordmark .hub { color: var(--accent); }
.brand .sub {
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  letter-spacing: .04em;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 4px; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.lang-toggle span {
  padding: 3px 12px; border-radius: 999px; line-height: 1.3;
  cursor: pointer; transition: all .15s;
}
.lang-toggle span.active { background: var(--ink); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 14.5px; font-weight: 600;
  transition: all .15s; line-height: 1.2;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 14px;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.user-chip .logout { color: var(--ink-3); font-size: 13px; padding: 4px 6px; border-radius: 8px; border: none; background: transparent; }
.user-chip .logout:hover { background: var(--bg-soft); color: var(--ink); }

/* ---------- 演示模式横幅 ---------- */
.demo-banner {
  background: #fff7e0; color: #8a6d1a; border-bottom: 1px solid #f0e2b6;
  text-align: center; font-size: 13px; padding: 7px 16px;
}

/* ---------- 落地页 ---------- */
.landing {
  min-height: calc(100vh - 66px);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 24px 100px; text-align: center;
}
.landing-inner { max-width: 940px; }
.slogan {
  margin: 0 0 48px;
  font-size: clamp(40px, 8.6vw, 96px);
  font-weight: 900; letter-spacing: -.015em; line-height: 1.04;
  color: var(--ink);
}
.slogan .boring { color: var(--boring); transition: color .25s; }
.slogan .boring:hover { color: var(--accent); }
.landing-cta {
  font-size: 18px; font-weight: 700;
  padding: 17px 46px; border-radius: 999px;
  box-shadow: 0 12px 32px rgba(255, 92, 53, .3);
}
.landing-cta:hover { box-shadow: 0 16px 40px rgba(255, 92, 53, .38); }

/* ---------- 主体布局 ---------- */
.layout {
  max-width: var(--maxw); margin: 0 auto;
  padding: 8px 22px 60px;
}

/* ---------- 发布框 ---------- */
.composer {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow-sm); margin-bottom: 26px;
}
.composer h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.composer .field { margin-bottom: 12px; }
.composer input[type="text"], .composer textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 15px; background: #fbfaf7; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.composer input[type="text"]:focus, .composer textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff;
}
.composer textarea { min-height: 96px; resize: vertical; }

.cat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-row .cat-label { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.cat {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: all .14s;
}
.cat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.cat[data-cat="boring"] .dot { background: var(--boring); }
.cat[data-cat="fun"] .dot { background: var(--fun); }
.cat[data-cat="weird"] .dot { background: var(--weird); }
.cat:hover { border-color: var(--ink-3); }
.cat.active { color: var(--ink); }
.cat.active[data-cat="boring"] { border-color: var(--boring); background: var(--boring-soft); }
.cat.active[data-cat="fun"] { border-color: var(--fun); background: var(--accent-soft); }
.cat.active[data-cat="weird"] { border-color: var(--weird); background: var(--weird-soft); }

.composer-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.composer-actions .spacer { flex: 1; }
.img-preview { position: relative; display: none; margin-top: 12px; }
.img-preview.show { display: inline-block; }
.img-preview img { max-height: 160px; border-radius: 10px; border: 1px solid var(--line); }
.img-preview .rm {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 8px;
  font-size: 12px; padding: 4px 8px;
}

/* ---------- Feed ---------- */
.feed h2 { font-size: 16px; font-weight: 700; margin: 0 0 14px; color: var(--ink-2); }
.feed-empty {
  text-align: center; color: var(--ink-3); padding: 50px 20px;
  border: 1.5px dashed var(--line); border-radius: var(--radius-lg); font-size: 15px;
}

/* ---------- 帖子卡片 ---------- */
.post-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px;
  margin-bottom: 18px; box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s;
}
.post-card:hover { box-shadow: var(--shadow); }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-head .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
  background: var(--bg-soft); color: var(--ink-2);
}
.post-meta { min-width: 0; }
.post-meta .name { font-size: 14px; font-weight: 700; }
.post-meta .time { font-size: 12.5px; color: var(--ink-3); }
.post-head .badge { margin-left: auto; flex: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.boring { background: var(--boring-soft); color: var(--boring); }
.badge.boring .dot { background: var(--boring); }
.badge.fun { background: var(--accent-soft); color: var(--fun); }
.badge.fun .dot { background: var(--fun); }
.badge.weird { background: var(--weird-soft); color: var(--weird); }
.badge.weird .dot { background: var(--weird); }

.post-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.4; }
.post-content { margin: 0; color: var(--ink-2); font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.post-image { margin-top: 14px; }
.post-image img { border-radius: 12px; border: 1px solid var(--line); max-height: 380px; width: 100%; object-fit: cover; }

/* 投票 & 评论工具条 */
.post-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 13px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: all .14s;
}
.vote-btn .n { font-variant-numeric: tabular-nums; }
.vote-btn.boring:hover, .vote-btn.boring.active { border-color: var(--boring); background: var(--boring-soft); color: var(--boring); }
.vote-btn.fun:hover, .vote-btn.fun.active { border-color: var(--fun); background: var(--accent-soft); color: var(--fun); }
.translate-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--ai-line); background: #fff; border-radius: 999px;
  padding: 6px 13px; font-size: 13.5px; font-weight: 600; color: var(--ai-ink);
  transition: all .14s;
}
.translate-toggle:hover { background: var(--ai-bg); border-color: var(--ai-ink); }
.translate-toggle.is-loading { opacity: .55; pointer-events: none; }
.comment-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 600;
  padding: 6px 8px; border-radius: 8px;
}
.comment-toggle:hover { background: var(--bg-soft); color: var(--ink); }

/* 评论区 */
.comments { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.comment {
  display: flex; gap: 10px; padding: 9px 0;
}
.comment .avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--bg-soft); color: var(--ink-2);
}
.comment .body { flex: 1; min-width: 0; }
.comment .body .name { font-size: 13px; font-weight: 700; }
.comment .body .name .time { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 8px; }
.comment .body .text { font-size: 14px; color: var(--ink-2); word-break: break-word; white-space: pre-wrap; }
.comments-empty { color: var(--ink-3); font-size: 13.5px; padding: 6px 0; }

.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 13px; font-size: 14px; background: #fbfaf7; outline: none;
}
.comment-form input:focus { border-color: var(--accent); background: #fff; }
.comment-form .btn { padding: 9px 14px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 28px 22px 40px;
  text-align: center; color: var(--ink-3); font-size: 13px;
}
.footer-links { margin-top: 10px; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-2); transition: color .15s ease; }
.footer-links a:hover { color: var(--accent); }
.footer-links .sep { color: var(--ink-3); opacity: .6; }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(31, 30, 27, .42); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius-lg); width: 100%; max-width: 400px;
  padding: 26px 26px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.18);
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
.modal h2 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.modal .m-sub { margin: 0 0 18px; color: var(--ink-3); font-size: 13.5px; }
.tabs { display: flex; gap: 4px; background: var(--bg-soft); border-radius: 11px; padding: 4px; margin-bottom: 18px; }
.tabs button {
  flex: 1; border: none; background: transparent; border-radius: 8px;
  padding: 8px 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.modal .field { margin-bottom: 14px; }
.modal input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 14.5px; background: #fbfaf7; outline: none;
}
.modal input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; }
.otp-row .btn { flex: none; }
.modal .m-error { color: var(--danger); font-size: 13px; margin: 0 0 10px; min-height: 18px; }
.modal .m-hint { color: #3ba55d; font-size: 12.5px; margin: 6px 0 0; min-height: 0; line-height: 1.5; }
.modal .btn[disabled] { opacity: .55; cursor: not-allowed; }
.m-foot { text-align: center; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.m-foot button { border: none; background: none; color: var(--accent); font-weight: 600; font-size: 13.5px; padding: 0; }
.m-close { position: absolute; top: 16px; right: 16px; border: none; background: none; font-size: 22px; color: var(--ink-3); line-height: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 200; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
