:root {
  --bg: #f5f5f7; --card: #fff; --text: #1d1d1f; --muted: #86868b; --border: #e5e5ea;
  --accent: #ff6b3d; --accent-soft: #fff0ea; --ok: #1a9e5a; --danger: #e5484d; --mine: #ff6b3d; --mine-text: #fff; --other: #fff;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --text: #f5f5f7; --muted: #98989d; --border: #2c2c2e; --accent-soft: #3a2118; --other: #2c2c2e; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 顶栏 */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 16px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand b { font-size: 20px; color: var(--accent); letter-spacing: 1px; }
.brand span { font-size: 12px; color: var(--muted); }
.back { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 6px 4px 0; cursor: pointer; color: var(--accent); }
.top-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sub .brand { display: none; }
.top-contact { margin-left: auto; flex: none; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.top-login { flex: none; color: var(--accent); font-size: 14px; font-weight: 600; }
@media (max-width: 420px) { .brand span { display: none; } }   /* 手机上顶栏放不下:去掉「精神小伙小妹 · 同城互助交友」小字 */
.modal-box .ct-field { margin-bottom: 10px; }
.modal-box .ct-mail { font-size: 12px; color: var(--muted); margin: 0 0 12px; }

main { max-width: 640px; margin: 0 auto; padding: 12px 16px 24px; }

/* 底部导航 */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: var(--card); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px; font-size: 11px; color: var(--muted); position: relative; }
.tabs a i { font-style: normal; font-size: 20px; line-height: 24px; }
.tabs a.on { color: var(--accent); }
.badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }

/* 通用 */
.card { display: block; background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }
.err { color: var(--danger); }
h2 { font-size: 17px; margin: 18px 0 8px; }
h2:first-child { margin-top: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 8px 18px; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.block { display: flex; width: 100%; padding: 12px; font-size: 16px; }
.btn.sm { padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* 表单 */
.form label { display: block; margin-bottom: 14px; }
.form label > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  width: 100%; border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 10px 12px; font-size: 16px; outline: none; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.form textarea { min-height: 110px; resize: vertical; }
.form .three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.form .three .street { grid-column: 1 / -1; }   /* 乡镇 / 街道单独一行 */
.form .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.form .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form .agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.form .agree input { margin-top: 3px; }
.form-msg { min-height: 20px; font-size: 13px; margin: 6px 0; color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { margin: 0; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-size: 14px; color: var(--text) !important; margin: 0 !important; }
.pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent) !important; font-weight: 600; }

/* 广场 */
.where { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 8px; }
.where b { font-size: 16px; }
/* 放不下就换行,手机上不用往右拉(站长 2026-10-31 要求) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips button { flex: none; border: 0; background: var(--card); border-radius: 999px; padding: 5px 13px; font-size: 14px; cursor: pointer; color: var(--muted); }
.chips button.on { background: var(--text); color: var(--card); font-weight: 600; }
.chips.cat button.on { background: var(--accent); color: #fff; }
.tip { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 6px 0 10px; }
.post h3 { margin: 6px 0 6px; font-size: 16px; line-height: 1.4; word-break: break-word; }
.post-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.tag.demo { background: var(--bg); color: var(--muted); font-weight: 500; border: 1px solid var(--border); }
.dist { margin-left: auto; color: var(--accent); font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.who { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; }
.av.lg { width: 64px; height: 64px; font-size: 26px; }
.av.md { width: 42px; height: 42px; font-size: 17px; }
.g-m { color: #2f80ed; } .g-f { color: #eb5a8c; }
.more { display: block; margin: 8px auto; }

/* 帖子详情 / 主页 */
.detail h1 { font-size: 20px; margin: 8px 0 12px; line-height: 1.4; word-break: break-word; }
.kv { display: grid; grid-template-columns: 56px 1fr; gap: 6px 10px; font-size: 14px; margin-bottom: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
/* 站长管理里的访客表 */
.tbl { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; }
.body { white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.actions .btn.primary { flex: 1; }
.profile { text-align: center; padding: 22px 16px; }
.profile .name { font-size: 20px; font-weight: 700; margin-top: 8px; }
.profile .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.profile .bio { margin-top: 10px; white-space: pre-wrap; word-break: break-word; }
.profile .actions { justify-content: center; }

/* 消息列表 */
.chat-item { display: flex; gap: 12px; align-items: center; }
.chat-item .mid { flex: 1; min-width: 0; }
.chat-item .last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .right { text-align: right; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-item .right .badge { position: static; }

/* 聊天 */
body.chat main { padding-bottom: 90px; }
body.chat .tabs { display: none; }
body.chat { padding-bottom: 0; }
.msgs { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 16px; background: var(--other); white-space: pre-wrap; word-break: break-word; align-self: flex-start; border-bottom-left-radius: 4px; cursor: default; }
.msg.mine { align-self: flex-end; background: var(--mine); color: var(--mine-text); border-radius: 16px; border-bottom-right-radius: 4px; }
.msg-time { align-self: center; font-size: 11px; color: var(--muted); margin: 6px 0 0; }
.msg-rep { align-self: flex-start; font-size: 12px; margin: -4px 0 0 6px; }
.msg-rep.mine { align-self: flex-end; margin: -4px 6px 0 0; }
.msg.pic { padding: 4px; background: none !important; }
.msg-img { display: block; max-width: 200px; max-height: 260px; border-radius: 12px; cursor: zoom-in; background: var(--bg); margin-bottom: 4px; }
.msg.pic .msg-img { margin-bottom: 0; }
.composer .pic-btn { flex: none; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; border-radius: 50%; }
.composer { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--border); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.composer form { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 18px; padding: 8px 14px; font-size: 16px; max-height: 120px; background: var(--bg); outline: none; }
.notice { text-align: center; font-size: 13px; color: var(--muted); background: var(--card); border-radius: 10px; padding: 8px; margin-bottom: 10px; }

/* 我的 */
.menu a, .menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 13px 16px; border: 0; background: none; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; font-size: 15px; }
.menu > :last-child { border-bottom: 0; }
.menu .card { padding: 0; overflow: hidden; }
details.card > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.card > summary::after { content: '›'; color: var(--muted); transition: transform .2s; }
details.card[open] > summary::after { transform: rotate(90deg); }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 12px; }

/* 管理 */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.stats div { background: var(--card); border-radius: 12px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 20px; }
.stats span { font-size: 12px; color: var(--muted); }
.quote.reply { background: var(--accent-soft); }
/* 头像照片、相册 */
img.av { object-fit: cover; background: var(--bg); }
.who-u { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.album { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.al-item { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg); border: 2px solid transparent; }
/* 「我的」页头像:点了弹出修改头像;右下角小圆标提示能换 */
.av-edit { position: relative; display: inline-block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.av-edit i { position: absolute; right: -4px; bottom: -2px; font-style: normal; font-size: 11px; line-height: 1; padding: 4px 5px; border-radius: 10px; background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* 修改头像弹窗里的相册:现在的头像打个勾 */
.av-pick { margin-top: 0; }
.av-pick .al-item { position: relative; }
.av-pick .al-item.on::after { content: '当前'; position: absolute; left: 4px; top: 4px; font-size: 11px; padding: 1px 5px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; }
.choose label.btn { text-align: center; }

/* 广场:分类方块 */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border-radius: var(--radius); padding: 14px 6px 12px; text-align: center; }
.cat-tile:active { transform: scale(.97); }
.cat-tile b { font-size: 15px; }
.cat-tile small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.cat-ic { width: 46px; height: 46px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 2px; }
.tip.warn { background: #fff4e5; color: #8a4b00; line-height: 1.6; }
@media (prefers-color-scheme: dark) { .tip.warn { background: #3a2a10; color: #ffcf8a; } }

/* 遇见(首页):一叠卡片,左右滑 */
.meet-head { display: flex; align-items: baseline; gap: 8px; margin: 2px 2px 10px; }
.meet-head b { font-size: 20px; }
.meet-stack { position: relative; height: calc(100vh - 290px); height: calc(100dvh - 290px); min-height: 360px; max-height: 640px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.meet-stack .empty { padding-top: 30%; }
.mc { position: absolute; inset: 0; border-radius: 20px; overflow: hidden; background: var(--card); box-shadow: 0 6px 24px rgba(0,0,0,.12); will-change: transform; }
.mc-next { transform: scale(.95) translateY(10px); filter: brightness(.96); }
.mc-top { cursor: grab; touch-action: none; }   /* 别用 .top,那是顶栏的类名;touch-action: none:卡片上的滑动不让浏览器拿去滚页面 */
.mc-ph { position: absolute; inset: 0; background: #ddd center / cover no-repeat; }
.mc-letter { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.92); font-size: 120px; font-weight: 700; }
.mc-dots { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 2; }
.mc-dots i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.45); }
.mc-dots i.on { background: #fff; }
.mc-stamp { position: absolute; top: 34px; z-index: 3; padding: 4px 12px; border: 3px solid; border-radius: 10px; font-size: 22px; font-weight: 800; letter-spacing: 2px; opacity: 0; background: rgba(255,255,255,.75); pointer-events: none; }
.mc-stamp.s-like { right: 18px; color: #ff3d6e; transform: rotate(12deg); }     /* 往左拖时出现在右上角 */
.mc-stamp.s-nope { left: 18px; color: #6b7280; transform: rotate(-12deg); }
.mc-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 56px 16px 16px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.mc-name { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mc-name span { font-size: 18px; font-weight: 500; }
.mc-name em { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 8px; }
.mc-on { background: #1fbf75; color: #fff; }
.mc-sub { font-size: 13px; opacity: .92; margin-top: 2px; }
.mc-bio { font-size: 13px; opacity: .9; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-more { position: absolute; right: 14px; bottom: 18px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.9); color: #333; display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; padding-top: 6px; }
.meet-btns { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 16px 0 6px; }
.mb { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--card); color: var(--muted); box-shadow: 0 3px 12px rgba(0,0,0,.1); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.mb.big { width: 64px; height: 64px; }
.mb.like { color: #ff3d6e; }
.mb.nope { color: #8e8e93; }
.mb:active { transform: scale(.92); }
.meet-hint { text-align: center; font-size: 12px; color: var(--muted); margin: 4px 0 0; line-height: 1.6; }
.match { text-align: center; }
.match-ic { color: #ff3d6e; margin: 4px 0 6px; }
.match-ic svg { width: 56px; height: 56px; }
.meet-f label > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.meet-f > label { display: block; margin-bottom: 14px; }
.al-item img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.al-add { aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--border); display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--muted); cursor: pointer; }
.choose { display: grid; gap: 8px; }
.req-row { padding: 6px 0; }
.audit-row { padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.audit-row:last-child { border-bottom: 0; }
.audit-msgs { margin-top: 10px; }
.fb-in { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 16px; background: var(--bg); }
.quote { background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; }

/* 图片 */
.thumbs { display: flex; gap: 6px; margin-top: 10px; position: relative; }
.th { width: calc((100% - 12px) / 3); aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--bg); cursor: zoom-in; }
.th-more { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 1px 7px; border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--bg); cursor: zoom-in; }
.grid.one { grid-template-columns: 1fr; }
.grid.one img { aspect-ratio: auto; max-height: 70vh; object-fit: contain; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-n { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; opacity: .8; }
.up-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.uploader { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.form .up-add, .up-item { position: relative; aspect-ratio: 1; margin: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.form .up-add { border: 1.5px dashed var(--border); color: var(--muted); font-size: 28px; cursor: pointer; background: var(--card); }
.up-item { background: var(--bg); font-size: 12px; color: var(--muted); overflow: hidden; }
.up-item img { width: 100%; height: 100%; object-fit: cover; }
.up-item.fail { color: var(--danger); }
.up-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 15px; line-height: 22px; padding: 0; cursor: pointer; }
.adm-imgs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.adm-imgs .th { width: 100%; }

/* 协议 */
.terms h2 { font-size: 16px; }
.terms p, .terms li { font-size: 14px; color: var(--text); }
.terms ul { padding-left: 20px; }

/* 弹窗 / 提示 */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal-box { width: 100%; max-width: 480px; background: var(--card); border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .modal { align-items: center; } .modal-box { border-radius: 18px; } }
.modal-box h3 { margin: 0 0 10px; font-size: 17px; }
.modal-box p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.modal-box textarea, .modal-box input { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 16px; background: var(--bg); margin-bottom: 12px; }
.modal-box .row { justify-content: flex-end; }
.ptr { position: fixed; top: -30px; left: 50%; transform: translateX(-50%); z-index: 80; padding: 6px 16px; border-radius: 999px; background: rgba(0,0,0,.75); color: #fff; font-size: 13px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.ptr.show { opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60; background: rgba(0,0,0,.8); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; max-width: 86vw; text-align: center; }

/* 登录页 */
.hero { text-align: center; padding: 28px 0 18px; }
.hero h1 { font-size: 26px; margin: 0 0 6px; }
.hero p { margin: 0; color: var(--muted); }
.hero .cats { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
