/* ============================================================
   摩友爱骑车 · 用户端 H5（小程序同风格）
   三套皮肤：riding（暖橙骑行，默认）/ night（夜骑霓虹）/ mono（极简白）
   ============================================================ */
:root, [data-theme="riding"] {
  --bg: #f6f4f1;
  --bg-2: #fff;
  --card: #ffffff;
  --line: #ece7e1;
  --txt: #1c1a17;
  --txt-2: #6b655c;
  --txt-3: #a49c92;
  --brand: #ff6b1a;
  --brand-2: #ff8f47;
  --brand-soft: rgba(255, 107, 26, .1);
  --accent: #1c1a17;
  --shadow: 0 6px 24px rgba(28, 26, 23, .07);
  --shadow-lg: 0 14px 44px rgba(28, 26, 23, .12);
  --radius: 18px;
  --tab-bg: rgba(255, 255, 255, .92);
  --img-bg: #f2eee9;
  /* color-mix 的等价预计算值：微信 Android X5 / 旧版 Safari 不支持 color-mix，用它兜底 */
  --bar-bg: rgba(246, 244, 241, .88);
  --area-bg: rgba(246, 244, 241, .92);
  --card-88: rgba(255, 255, 255, .8);
  --sk-mid: #e8e1d9;
  --glow-30: rgba(255, 107, 26, .3);
  --glow-35: rgba(255, 107, 26, .35);
  --glow-40: rgba(255, 107, 26, .4);
  --hero-a: rgba(255, 107, 26, .26);
  --hero-b: #f7e6d9;
  --seg-bg: rgba(28, 26, 23, .05);
}
[data-theme="night"] {
  --bg: #080a10;
  --bg-2: #0e1219;
  --card: #121722;
  --line: #1e2634;
  --txt: #eaf0fa;
  --txt-2: #98a4b8;
  --txt-3: #65708a;
  --brand: #37e6ff;
  --brand-2: #b06bff;
  --brand-soft: rgba(55, 230, 255, .12);
  --accent: #37e6ff;
  --shadow: 0 6px 24px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, .6);
  --tab-bg: rgba(12, 16, 24, .92);
  --img-bg: #1a2130;
  --bar-bg: rgba(8, 10, 16, .88);
  --area-bg: rgba(8, 10, 16, .92);
  --card-88: rgba(18, 23, 34, .8);
  --sk-mid: #1f2837;
  --glow-30: rgba(55, 230, 255, .3);
  --glow-35: rgba(55, 230, 255, .35);
  --glow-40: rgba(55, 230, 255, .4);
  --hero-a: rgba(55, 230, 255, .26);
  --hero-b: #0b1019;
  --seg-bg: rgba(234, 240, 250, .05);
}
[data-theme="mono"] {
  --bg: #f4f4f4;
  --bg-2: #fff;
  --card: #ffffff;
  --line: #e2e2e2;
  --txt: #101010;
  --txt-2: #5c5c5c;
  --txt-3: #9a9a9a;
  --brand: #101010;
  --brand-2: #444;
  --brand-soft: rgba(0, 0, 0, .06);
  --accent: #101010;
  --shadow: 0 4px 18px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .12);
  --radius: 12px;
  --tab-bg: rgba(255, 255, 255, .95);
  --img-bg: #ececec;
  --bar-bg: rgba(244, 244, 244, .92);
  --area-bg: rgba(244, 244, 244, .94);
  --card-88: rgba(255, 255, 255, .85);
  --sk-mid: #e4e4e4;
  --glow-30: rgba(0, 0, 0, .22);
  --glow-35: rgba(0, 0, 0, .22);
  --glow-40: rgba(0, 0, 0, .26);
  --hero-a: rgba(0, 0, 0, .05);
  --hero-b: #f0f0f0;
  --seg-bg: rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  transition: background .25s, color .25s;
  overscroll-behavior-y: contain;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 手机容器（电脑端居中） ---------- */
#stage { min-height: 100vh; display: flex; flex-direction: column; }
@media (min-width: 760px) {
  body { background: #23262b; }
  #stage {
    width: 430px; margin: 0 auto; min-height: 100vh; max-height: 100vh;
    background: var(--bg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 90px rgba(0, 0, 0, .45);
    overflow: hidden; position: relative;
  }
}

/* ---------- 顶栏 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 10px;
  background: var(--bar-bg);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
}
.appbar.solid { border-bottom-color: var(--line); }
.appbar .logo {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 16px var(--glow-35);
  overflow: hidden;
}
.appbar .logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.appbar h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .3px; }
.appbar h1 small { font-weight: 400; font-size: 11px; color: var(--txt-3); margin-left: 6px; letter-spacing: .5px; }
.appbar .sp { flex: 1; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--txt-2); display: grid; place-items: center;
  font-size: 15px; cursor: pointer; transition: .18s;
}
.icon-btn:active { transform: scale(.94); }

/* ---------- 主内容 ---------- */
.page { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 14px 84px; -webkit-overflow-scrolling: touch; }
.page::-webkit-scrollbar { width: 0; }

/* ---------- 站点页脚：备案 / 平台公约 ---------- */
.site-foot {
  padding: 20px 6px 10px;
  display: flex; flex-direction: column; gap: 7px; align-items: center;
  font-size: 11.5px; color: var(--txt-3); line-height: 1.7; text-align: center;
}
.site-foot .fl, .site-foot .fl2 {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.site-foot a { color: var(--txt-3); text-decoration: none; }
.site-foot a:hover { color: var(--brand); }
.site-foot .pol img { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.site-foot .lk {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--txt-2); font-size: 11.5px; text-decoration: underline;
}
.site-foot .lk:hover { color: var(--brand); }
.site-foot i { font-style: normal; opacity: .45; }
.site-foot .fl3 {
  font-size: 11.5px; color: color-mix(in srgb, #e0693a 78%, var(--txt-3));
  letter-spacing: .3px;
}
.site-foot .fl4 { font-size: 11px; color: var(--txt-3); opacity: .85; }
.legal-txt {
  max-height: 52vh; overflow: auto; text-align: left;
  font-size: 12.5px; line-height: 1.8; white-space: normal;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 骨架屏 ---------- */
.sk { background: var(--card); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.sk .bar { height: 190px; background: linear-gradient(90deg, var(--img-bg) 25%, var(--sk-mid) 37%, var(--img-bg) 63%); background-size: 400% 100%; animation: shine 1.35s ease infinite; }
.sk .ln { height: 12px; border-radius: 6px; margin: 12px 14px; background: var(--img-bg); animation: shine 1.35s ease infinite; background-size: 400% 100%; }
.sk .ln.s { width: 45%; margin-bottom: 18px; }
@keyframes shine { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* ---------- 作品卡片 ---------- */
.work {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
  animation: rise .34s cubic-bezier(.2,.8,.3,1) both;
}
/* 注意：起始帧不要用 opacity:0 —— 浏览器在后台窗口/部分环境会暂停动画，
   fill-mode: both 会让卡片永远停在 0 变成整页空白。用 .82 起步，视觉几乎一致但绝不空白。 */
@keyframes rise { from { opacity: .82; transform: translateY(10px) } to { opacity: 1; transform: none } }
.work .hd { display: flex; align-items: center; gap: 9px; padding: 12px 14px 6px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 编辑资料 · 头像行 ---------- */
.av-edit {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  padding: 14px 16px; border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.av-edit:active { transform: scale(.99); }
.av-edit .av-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.av-edit .av-txt b { font-size: 14px; font-weight: 650; }
.av-edit .av-txt span { font-size: 11.5px; color: var(--txt-3); }
.av-edit .av-go { color: var(--txt-3); font-size: 18px; }
.work .who { flex: 1; min-width: 0; }
.work .who b { font-size: 14px; font-weight: 650; display: block; }
.work .who span { font-size: 11.5px; color: var(--txt-3); display: flex; gap: 6px; align-items: center; }
.work .follow {
  height: 27px; padding: 0 11px; border-radius: 14px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--brand); color: var(--brand); background: transparent;
}
.work .follow.on { background: var(--brand-soft); border-color: transparent; color: var(--txt-3); }
.work .content { padding: 2px 14px 10px; font-size: 14.5px; line-height: 1.6; word-break: break-word; }
.work .tags { padding: 0 14px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid transparent;
}
.work .imgs { display: grid; gap: 3px; padding: 0 14px 10px; }
.work .imgs.one img { width: 100%; aspect-ratio: 4/3; height: auto; max-height: 460px; object-fit: cover; border-radius: 12px; }
.work .imgs.two { grid-template-columns: 1fr 1fr; }
.work .imgs.three { grid-template-columns: 1fr 1fr 1fr; }
.work .imgs img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; background: var(--img-bg);
  cursor: zoom-in; transition: transform .18s;
}
.work .imgs img:active { transform: scale(.99); }
.work .loc { padding: 0 14px 8px; font-size: 11.5px; color: var(--txt-3); display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.work .loc .mp {
  font-size: 10.5px; line-height: 1; padding: 3px 7px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--txt-2); text-decoration: none; white-space: nowrap;
}
.work .loc .mp:active { background: var(--brand-soft); border-color: transparent; }
.map-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 8px; font-size: 12px; }
.map-links a {
  padding: 6px 12px; border-radius: 10px; background: var(--bg-2); color: var(--brand);
  text-decoration: none; border: 1px solid var(--line);
}
.map-links a:active { background: var(--brand-soft); }
.map-links span { color: var(--txt-3); font-size: 11px; font-family: ui-monospace, monospace; }
.work .acts {
  display: flex; gap: 4px; padding: 8px 8px 10px; border-top: 1px solid var(--line);
}
.act {
  flex: 1; height: 36px; border: none; background: transparent; color: var(--txt-2);
  display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px;
  border-radius: 10px; cursor: pointer; transition: .15s;
}
.act:active { background: var(--brand-soft); }
.act .n { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.act.on { color: var(--brand); }
.act .heart { display: inline-block; transition: transform .25s cubic-bezier(.2,1.6,.4,1); }
.act.on .heart { animation: beat .45s; }
@keyframes beat { 0% { transform: scale(1) } 40% { transform: scale(1.35) } 70% { transform: scale(.92) } 100% { transform: scale(1) } }

/* ---------- 游客拦截 ---------- */
.gate {
  margin: 14px 0 6px; padding: 20px 18px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--brand-soft), transparent 70%), var(--card);
  border: 1px dashed var(--glow-40);
  text-align: center; box-shadow: var(--shadow);
}
.gate .big { font-size: 30px; }
.gate h3 { margin: 8px 0 6px; font-size: 15px; }
.gate p { margin: 0 0 14px; font-size: 12.5px; color: var(--txt-3); line-height: 1.7; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 18px; border-radius: 13px; border: none; cursor: pointer;
  background: var(--card); color: var(--txt); font-size: 14.5px; font-weight: 600;
  border: 1px solid var(--line); transition: .16s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 8px 22px var(--glow-30); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.loading { color: transparent; position: relative; }
.btn.loading::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 12;
  display: flex; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--tab-bg); backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--line);
}
@media (min-width: 760px) {
  .tabbar { position: absolute; left: 0; right: 0; bottom: 0; width: 430px; margin: 0 auto; }
}
.tabbar .t {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 5px; border: none; background: transparent; color: var(--txt-3);
  font-size: 10.5px; cursor: pointer; position: relative; transition: .16s;
}
.tabbar .t .ic { font-size: 19px; line-height: 1; transition: transform .22s cubic-bezier(.2,1.5,.4,1); }
.tabbar .t.on { color: var(--brand); }
.tabbar .t.on .ic { transform: translateY(-2px) scale(1.06); }
.tabbar .t.mid .ic {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  margin-top: -16px; box-shadow: 0 8px 20px var(--glow-40);
  font-size: 20px;
}

/* ---------- 当地页 ---------- */
.area-bar {
  display: flex; gap: 8px; align-items: center; padding: 6px 2px 10px;
  position: sticky; top: 52px; z-index: 9;
  background: var(--area-bg);
  backdrop-filter: blur(10px);
}
.area-bar .pick {
  display: flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--txt);
  box-shadow: var(--shadow); cursor: pointer; white-space: nowrap;
}
.area-bar .pick b { font-weight: 650; }
.area-bar .pick .cv { color: var(--txt-3); font-size: 11px; }
.area-bar .sp { flex: 1; }
.area-bar .map-btn { padding: 7px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 13px; cursor: pointer; }

/* ---------- 关键词搜索（广场 / 当地通用） ---------- */
.search-bar { padding: 2px 0 10px; }
.search-bar .sb-in {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 7px 8px 7px 12px; box-shadow: var(--shadow);
}
.search-bar .sb-in .ico { color: var(--txt-3); font-size: 15px; line-height: 1; }
.search-bar .sb-in input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 13.5px; color: var(--txt); font-family: inherit; padding: 4px 0;
}
.search-bar .sb-in input::placeholder { color: var(--txt-3); }
.search-bar .sb-in button {
  flex: none; padding: 6px 14px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
  transition: filter .16s, transform .16s;
}
.search-bar .sb-in button:hover { filter: brightness(1.05); }
.search-bar .sb-in button:active { transform: scale(.97); }
.search-tip {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--txt-3);
  padding: 0 2px 10px;
}
.search-tip .clr {
  margin-left: auto; padding: 4px 10px; border-radius: 9px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--txt-2); font-size: 12px;
}

/* ---------- 联系管理员（我的 / 设置） ---------- */
.admin-card {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 12px; padding: 14px 15px;
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--card)), var(--card));
  border: 1.5px solid color-mix(in srgb, var(--brand) 55%, transparent);
  box-shadow: var(--shadow);
}
.admin-card .ac-txt { flex: 1; min-width: 0; }
.admin-card .ac-t { font-size: 14px; font-weight: 700; color: var(--txt); letter-spacing: .2px; }
.admin-card .ac-s { font-size: 12.5px; color: var(--txt-2); margin-top: 5px; line-height: 1.6; }
.admin-card .ac-s b { color: var(--brand); font-weight: 700; font-size: 13.5px; letter-spacing: .5px; }
.admin-card .ac-btn {
  flex: none; text-decoration: none; white-space: nowrap;
  padding: 9px 15px; border-radius: 12px;
  background: var(--brand); color: #fff !important;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent);
  transition: transform .16s, filter .16s;
}
.admin-card .ac-btn:hover { filter: brightness(1.06); }
.admin-card .ac-btn:active { transform: scale(.96); }

.map-wrap {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; margin-bottom: 14px; position: relative; overflow: hidden;
}
.map-wrap canvas { width: 100%; height: 190px; display: block; border-radius: 12px; background: var(--img-bg); }
.map-wrap .map-tip {
  position: absolute; left: 18px; top: 18px; font-size: 11px; color: var(--txt-3);
  background: var(--card-88); padding: 3px 9px; border-radius: 8px;
  backdrop-filter: blur(6px);
}
.map-detail {
  position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 10px 12px;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 12.5px; display: none; z-index: 2; border: 1px solid var(--line);
}
.map-detail.show { display: block; animation: rise .25s both; }
.map-detail b { font-size: 13px; }
.map-detail p { margin: 3px 0 0; color: var(--txt-2); }

/* ---------- 拍照 / 发布 ---------- */
.section { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.section .st { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.section .st .req { color: var(--brand); font-size: 11px; font-weight: 500; }

.gps-box { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 13px; background: var(--brand-soft); border: 1px solid transparent; }
.gps-box.ok { background: rgba(23, 185, 120, .12); }
.gps-box.err { background: rgba(255, 59, 48, .12); }
.gps-box .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--txt-3); flex: 0 0 9px; }
.gps-box.ok .dot { background: #17b978; box-shadow: 0 0 0 4px rgba(23,185,120,.18); animation: pulse 1.6s infinite; }
.gps-box.err .dot { background: #ff3b30; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(23,185,120,0); } }
.gps-box .tx { flex: 1; font-size: 12.5px; }
.gps-box .tx b { display: block; font-size: 13px; margin-bottom: 2px; }
.gps-box .tx span { color: var(--txt-3); font-size: 11.5px; }
.gps-box .again { font-size: 12px; color: var(--brand); cursor: pointer; }

.pick-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick-imgs .cell {
  position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; background: var(--img-bg);
  border: 1px dashed var(--line); display: grid; place-items: center; cursor: pointer;
}
.pick-imgs .cell img { width: 100%; height: 100%; object-fit: cover; }
.pick-imgs .cell .del {
  position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; display: grid; place-items: center;
}
.pick-imgs .cell.add { color: var(--txt-3); font-size: 12px; text-align: center; line-height: 1.5; }
.pick-imgs .cell.add .plus { font-size: 24px; line-height: 1; }

textarea.input, input.input {
  width: 100%; border: 1px solid var(--line); background: var(--bg-2); color: var(--txt);
  border-radius: 12px; padding: 11px 12px; font-size: 14.5px; outline: none; resize: none;
  transition: .15s;
}
textarea.input:focus, input.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { min-height: 92px; line-height: 1.6; }
.counter { text-align: right; font-size: 11px; color: var(--txt-3); margin-top: 5px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .c {
  padding: 7px 13px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--txt-2); font-size: 13px; cursor: pointer; transition: .15s;
}
.chips .c.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.radio-row { display: flex; gap: 10px; }
.radio-row .r {
  flex: 1; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2);
  cursor: pointer; transition: .15s;
}
.radio-row .r.on { border-color: var(--brand); background: var(--brand-soft); }
.radio-row .r b { font-size: 13.5px; display: block; }
.radio-row .r span { font-size: 11.5px; color: var(--txt-3); }

/* ---------- 我的 ---------- */
.profile-hero {
  position: relative; padding: 26px 18px 18px; margin: 0 -14px 12px;
  background:
    radial-gradient(400px 200px at 88% -10%, var(--hero-a), transparent 70%),
    linear-gradient(180deg, var(--hero-b), var(--bg));
}
.profile-hero .row { display: flex; align-items: center; gap: 14px; }
.profile-hero .av {
  width: 66px; height: 66px; border-radius: 24px; flex: 0 0 66px; overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 800;
  box-shadow: 0 10px 28px var(--glow-30);
}
.profile-hero .av img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero .info { flex: 1; min-width: 0; }
.profile-hero .info h2 { margin: 0 0 3px; font-size: 20px; letter-spacing: .3px; }
.profile-hero .info .sub { font-size: 12px; color: var(--txt-2); display: flex; gap: 8px; flex-wrap: wrap; }
.profile-hero .info .sub span { display: inline-flex; align-items: center; gap: 3px; }
.profile-hero .edit { position: absolute; right: 16px; top: 22px; font-size: 12px; color: var(--txt-2); border: 1px solid var(--line); padding: 5px 10px; border-radius: 20px; background: var(--card); cursor: pointer; }
.profile-hero .bio { font-size: 12.5px; color: var(--txt-2); margin: 12px 0 0; line-height: 1.6; }

.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 0; }
.stat-row .s { text-align: center; background: var(--card); border-radius: 13px; padding: 9px 4px; box-shadow: var(--shadow); }
.stat-row .s.tap { cursor: pointer; transition: transform .12s, box-shadow .12s; -webkit-tap-highlight-color: transparent; }
.stat-row .s.tap:active { transform: scale(.95); box-shadow: none; }
.stat-row .s b { display: block; font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-row .s span { font-size: 10.5px; color: var(--txt-3); }

.seg { display: flex; gap: 4px; background: var(--seg-bg); padding: 4px; border-radius: 13px; margin-bottom: 12px; }
.seg button {
  flex: 1; height: 34px; border: none; background: transparent; border-radius: 10px;
  color: var(--txt-2); font-size: 13px; cursor: pointer; transition: .16s;
}
.seg button.on { background: var(--card); color: var(--txt); font-weight: 650; box-shadow: var(--shadow); }

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 15px;
  background: var(--card); border-radius: 14px; margin-bottom: 8px; box-shadow: var(--shadow);
  cursor: pointer;
}
.list-row .ic { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 14px; flex: 0 0 30px; }
.list-row .tx { flex: 1; font-size: 14px; }
.list-row .tx small { display: block; color: var(--txt-3); font-size: 11.5px; }
.list-row .cv { color: var(--txt-3); font-size: 12px; }
.list-row.danger .ic { background: rgba(255,59,48,.1); color: #ff3b30; }
.list-row.danger .tx { color: #ff3b30; }

.mini-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.mini-grid .m {
  position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; background: var(--img-bg);
}
.mini-grid .m img { width: 100%; height: 100%; object-fit: cover; }
.mini-grid .m .lk { position: absolute; left: 6px; bottom: 5px; color: #fff; font-size: 10.5px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* ---------- 空态 ---------- */
.empty {
  padding: 54px 20px; text-align: center; color: var(--txt-3);
}
.empty .em { font-size: 40px; opacity: .35; display: block; margin-bottom: 12px; }
.empty p { margin: 0 0 4px; font-size: 13.5px; }
.empty small { font-size: 12px; display: block; }
.empty .btn { display: block; margin: 16px auto 0; max-width: 220px; }

/* ---------- 加载 / 下拉 ---------- */
.loading-more { text-align: center; color: var(--txt-3); font-size: 12.5px; padding: 14px 0 22px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.loading-more .sp-dr { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.pull-tip {
  position: absolute; left: 0; right: 0; top: 0; height: 0; overflow: hidden; display: grid; place-items: center;
  color: var(--txt-3); font-size: 12px; transition: height .2s;
}
.pull-tip.show { height: 46px; }

/* ---------- 弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 30;
  display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.sheet-mask.show { display: flex; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0 } }
.sheet {
  width: 100%; max-width: 430px; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto;
  animation: slideup .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes slideup { from { transform: translateY(30px); opacity: .6 } }
.sheet .grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { font-size: 16px; margin: 0 0 4px; text-align: center; }
.sheet p.tip { text-align: center; color: var(--txt-3); font-size: 12px; margin: 0 0 16px; }

.alert-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: none; place-items: center; padding: 24px; }
.alert-mask.show { display: grid; animation: fadein .18s; }
.alert {
  width: 100%; max-width: 330px; background: var(--card); border-radius: 18px; padding: 22px 20px 16px;
  text-align: center; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { from { transform: scale(.94); opacity: 0 } }
.alert .em { font-size: 30px; }
.alert h4 { margin: 8px 0 6px; font-size: 15.5px; }
.alert p { margin: 0 0 16px; font-size: 12.5px; color: var(--txt-2); line-height: 1.7; }
.alert .acts { display: flex; gap: 8px; }
.alert .acts .btn { flex: 1; height: 40px; font-size: 14px; }

.toast {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.96);
  background: rgba(20,20,22,.9); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 13.5px; z-index: 60; opacity: 0; pointer-events: none; transition: .2s; max-width: 76vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- 图片预览 ---------- */
.viewer { position: fixed; inset: 0; background: #000; z-index: 70; display: none; }
.viewer.show { display: block; animation: fadein .2s; }
.viewer img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.viewer .close { color: #fff; font-size: 26px; cursor: pointer; opacity: .85; line-height: 1; }
/* 多图浏览：横向滑动，一屏一张 */
.viewer .vw-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 52px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  background: linear-gradient(180deg, rgba(0,0,0,.6), transparent);
}
.viewer .vw-idx { color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; opacity: .9; }
.viewer .vw-track {
  position: absolute; inset: 0; overflow: hidden;
}
.viewer .vw-track .vw-item {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: grid; place-items: center;
  transition: transform .3s cubic-bezier(.2,.9,.3,1);
  will-change: transform;
}
.viewer .vw-track .vw-item img {
  max-width: 100%; max-height: 100%; animation: zoomin .26s cubic-bezier(.2,.9,.3,1);
}
.viewer .vw-tip {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.55); font-size: 12px; z-index: 3; pointer-events: none;
}
.viewer .vw-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 42px; height: 68px; border: none; border-radius: 12px; cursor: pointer;
  background: rgba(0,0,0,.3); color: #fff; font-size: 26px; line-height: 1;
  display: none; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.viewer .vw-arrow.left { left: 10px; }
.viewer .vw-arrow.right { right: 10px; }
.viewer.show.multi .vw-arrow { display: flex; }
@media (max-width: 600px) { .viewer .vw-arrow { display: none !important; } }
@keyframes zoomin { from { transform: scale(.92); opacity: .65 } }

/* ---------- 表单页（登录 / 注册 / 编辑） ---------- */
.form-hero { padding: 26px 4px 18px; }
.form-hero h2 { font-size: 25px; margin: 0 0 6px; letter-spacing: .5px; }
.form-hero p { margin: 0; color: var(--txt-3); font-size: 12.5px; }
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12.5px; color: var(--txt-2); margin-bottom: 6px; }
.field > label .req { color: var(--brand); }
.field .hint { font-size: 11.5px; color: var(--txt-3); margin-top: 5px; }
.field .err { font-size: 11.5px; color: #ff3b30; margin-top: 5px; }
.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1; min-width: 0; }
.code-btn { white-space: nowrap; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--brand); background: transparent; color: var(--brand); font-size: 13px; cursor: pointer; }
.code-btn[disabled] { border-color: var(--line); color: var(--txt-3); }
.select3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
select.input { appearance: none; width: 100%; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--txt); font-size: 13px; outline: none; }

.tabs-line { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs-line button { border: none; background: transparent; padding: 8px 0 10px; font-size: 15px; color: var(--txt-3); position: relative; cursor: pointer; }
.tabs-line button.on { color: var(--txt); font-weight: 700; }
.tabs-line button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; border-radius: 3px; background: var(--brand); }

/* ---------- 主题切换 ---------- */
.theme-row { display: flex; gap: 8px; }
.theme-row .th {
  flex: 1; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2);
  cursor: pointer; text-align: center; font-size: 12px;
}
.theme-row .th.on { border-color: var(--brand); color: var(--brand); }
.theme-row .th i { display: block; height: 22px; border-radius: 7px; margin-bottom: 6px; }
.theme-row .th[data-t="riding"] i { background: linear-gradient(135deg,#ff6b1a,#ffb27a); }
.theme-row .th[data-t="night"] i { background: linear-gradient(135deg,#37e6ff,#b06bff); }
.theme-row .th[data-t="mono"] i { background: linear-gradient(135deg,#111,#999); }

/* ---------- 评论 ---------- */
.cmt { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cmt:last-child { border-bottom: none; }
.cmt .av { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-size: 13px; overflow: hidden; }
.cmt .bd { flex: 1; min-width: 0; }
.cmt .bd .nm { font-size: 12.5px; color: var(--txt-2); display: flex; justify-content: space-between; }
.cmt .bd .nm span { color: var(--txt-3); font-size: 11px; }
.cmt .bd .ct { font-size: 13.5px; margin-top: 3px; word-break: break-word; }
.cmt .bd .rp { font-size: 11.5px; color: var(--txt-3); margin-top: 4px; cursor: pointer; }
.cmt .reply { margin-left: 42px; margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); }
.cmt .reply .ct { font-size: 13px; }

/* 纯静态预览模式标记 */
.off-chip{display:inline-flex;align-items:center;height:26px;padding:0 10px;margin-right:8px;border-radius:999px;font-size:12px;font-weight:600;letter-spacing:.3px;color:#ff6b1a;background:rgba(255,107,26,.12);border:1px solid rgba(255,107,26,.35);white-space:nowrap;flex-shrink:0}
[data-theme='night'] .off-chip{color:#8ef0ff;background:rgba(142,240,255,.12);border-color:rgba(142,240,255,.35)}
[data-theme='mono'] .off-chip{color:#333;background:#eee;border-color:#ddd}

/* ============================================================
   移动端 / 微信内置浏览器 / 桌面浏览器 适配层
   ============================================================ */

/* iOS 微信、老版 Safari：避免横屏时字号被自动放大 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 100vh 在手机浏览器里包含地址栏高度，会把底部导航顶出屏幕；
   支持 dvh 的用 dvh，不支持的保持 vh 兜底 */
#stage { min-height: 100vh; min-height: 100dvh; }

/* 刘海屏 / 灵动岛：viewport-fit=cover 时顶栏需要让出状态栏高度 */
.appbar {
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  /* 部分老内核不支持 backdrop-filter，给一层实色兜底，避免顶栏透明穿透 */
  background: var(--bar-bg);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .appbar {
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
  }
}
.area-bar { top: calc(52px + env(safe-area-inset-top, 0px)); }

/* iOS 对 <input> 字号 < 16px 会自动放大整页，导致点输入框后页面“跳一下” */
@media (max-width: 760px) {
  input.input, textarea.input, select.input, .cmt textarea { font-size: 16px; }
  /* 手机上省/市/区三列会挤成一坨、省名被截断，改成整宽竖排 */
  .select3 { grid-template-columns: 1fr; gap: 8px; }
  /* 手指点击区域不小于 40px */
  .icon-btn { width: 36px; height: 36px; }
  .act { height: 40px; }
  .list-row { padding: 14px 15px; }
  /* 横向不溢出：长串英文/链接一律折断 */
  .work .content, .cmt .bd .ct, .list-row .tx { overflow-wrap: anywhere; }
  .toast { max-width: 86vw; }
}

/* 窄屏（iPhone SE 375、安卓小屏 360、极窄 320） */
@media (max-width: 380px) {
  .appbar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .appbar h1 { font-size: 16px; }
  .appbar h1 small { display: none; }
  .page { padding-left: 10px; padding-right: 10px; }
  .stat-row { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .stat-row .s { padding: 8px 2px; }
  .stat-row .s b { font-size: 15px; }
  .stat-row .s span { font-size: 9.5px; }
  .select3 { gap: 5px; }
  select.input { font-size: 12px; padding: 0 6px; }
  .row2 { gap: 8px; }
  /* 手机端与小程序统一：一排 3 张（原先是 1 排 2 张） */
  .work .imgs.three { grid-template-columns: 1fr 1fr 1fr; }
  .profile-hero { padding-left: 12px; padding-right: 12px; }
  .profile-hero .av { width: 56px; height: 56px; flex: 0 0 56px; }
  .profile-hero .info h2 { font-size: 18px; }
  .pick-imgs { gap: 6px; }
}

/* 桌面浏览器：居中手机框，但高度用视口而不是内容撑开 */
@media (min-width: 760px) {
  #stage { height: 100vh; height: 100dvh; }
  .appbar { padding-top: 12px; }
}

/* 横屏手机：别让容器固定 430px 压扁内容 */
@media (min-width: 760px) and (max-height: 480px) {
  #stage { width: 100%; max-width: none; }
  .tabbar { width: 100%; }
}

/* 减少动态效果偏好（部分安卓机开启后动画卡顿） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 文本选中：微信长按复制分享链接时需要有可选中的文本 */
.selectable { user-select: text; -webkit-user-select: text; }

/* 手机端滚动更顺：顶栏 / 底栏去掉实时毛玻璃，改用实色背景，减少 GPU 合成（卡顿主要来源之一） */
@media (max-width: 759px) {
  .appbar, .tabbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .appbar { background: var(--bg); }
  .tabbar { background: var(--bg); }
}
