/* 苏岩站 - 纯白主题 */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --line: #eceef2;
  --line-2: #e2e5ea;
  --text: #16181d;
  --text-2: #5b626d;
  --text-3: #9aa1ac;
  --brand: #16181d;
  --accent: #2f6bff;
  --like: #ff4d6a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 18, 24, .04), 0 8px 24px rgba(16, 18, 24, .04);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-soft);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans CN", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; height: 58px;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-text { font-size: 19px; font-weight: 700; letter-spacing: .3px; }

/* 搜索框外层：承担布局和下拉面板的定位基准 */
.search-wrap {
  flex: 1; max-width: 420px; position: relative;
}
.search {
  position: relative;
  display: flex; align-items: center;
}
.search .icon { position: absolute; left: 11px; width: 18px; height: 18px; color: var(--text-3); }
.search input {
  width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-soft); padding: 0 12px 0 34px; font-size: 14px; color: var(--text);
  outline: none; transition: .18s;
}
.search input:focus { background: #fff; border-color: #cfd4dc; box-shadow: 0 0 0 3px rgba(47,107,255,.08); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- 搜索下拉：热搜榜 ---------- */
.search-panel {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 8px);
  z-index: 60;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 8px 28px rgba(16, 18, 24, .12);
  overflow: hidden;
  animation: spIn .16s var(--ease-out);
}
.search-panel[hidden] { display: none; }
@keyframes spIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}
.sp-head {
  padding: 10px 14px 7px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .3px;
}
.sp-list { max-height: 420px; overflow-y: auto; padding: 0 6px 6px; }
.sp-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text);
  transition: background .13s;
}
.sp-item:hover { background: var(--bg-soft); }
.sp-rank {
  flex: none;
  width: 19px; height: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
  font-size: 11.5px; font-weight: 700;
  color: var(--text-3);
  background: var(--bg-soft);
  font-variant-numeric: tabular-nums;
}
/* 前三名用不同颜色，视觉上一眼分出热度 */
.sp-item.top .sp-rank { color: #fff; }
.sp-item.top:nth-child(1) .sp-rank { background: #f0473f; }
.sp-item.top:nth-child(2) .sp-rank { background: #f59331; }
.sp-item.top:nth-child(3) .sp-rank { background: #e8b03a; }
.sp-name {
  flex: 1; min-width: 0;
  font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sp-meta { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sp-empty {
  padding: 22px 14px 26px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.9;
}
.sp-empty span { font-size: 12px; opacity: .75; }
.sp-foot {
  display: block;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-3);
  text-decoration: none;
  background: var(--bg-soft);
}
.sp-foot:hover { color: var(--accent); }

/* ---------- 搜索页里的热搜榜卡片 ---------- */
.hot-list { padding: 4px 6px 8px; }
.hot-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background .13s;
}
.hot-item:hover { background: var(--bg-soft); }
.hot-rank {
  flex: none;
  width: 21px; height: 21px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 12px; font-weight: 700;
  color: var(--text-3);
  background: var(--bg-soft);
  font-variant-numeric: tabular-nums;
}
.hot-item.top .hot-rank { color: #fff; }
.hot-item.top:nth-child(1) .hot-rank { background: #f0473f; }
.hot-item.top:nth-child(2) .hot-rank { background: #f59331; }
.hot-item.top:nth-child(3) .hot-rank { background: #e8b03a; }
.hot-name {
  flex: 1; min-width: 0;
  font-size: 14.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hot-meta {
  flex: none;
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-3);
}
.hot-meta em { font-style: normal; font-variant-numeric: tabular-nums; }
.hot-fresh {
  font-style: normal;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(47, 107, 255, .1);
  color: var(--accent);
}
/* 置顶标记 */
.hot-pin {
  font-style: normal;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(240, 71, 63, .1);
  color: #f0473f;
}
.sp-pin {
  font-style: normal;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  background: rgba(240, 71, 63, .1);
  color: #f0473f;
  vertical-align: 1px;
}

.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topnav a {
  position: relative; padding: 7px 11px; border-radius: 9px;
  font-size: 15px; color: var(--text-2); transition: .16s;
}
.topnav a:hover { background: var(--bg-soft); color: var(--text); }
.topnav a.on { color: var(--text); font-weight: 600; }

/* ---------- 顶栏的下载客户端入口 ---------- */
/*
 * 桌面端：图标 + 文字，和其他导航项一样是文字链接。
 * 注意 .icon 是上下文类（.search .icon 之类），没有全局尺寸，
 * 所以这里必须显式限制，否则 SVG 会撑成巨大图标。
 */
.topnav .topnav-dl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.topnav .topnav-dl .icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
}
.topnav .topnav-dl.on .icon { stroke: currentColor; }

.topnav a .dot {
  position: absolute; top: 5px; right: 6px; width: 6px; height: 6px;
  background: var(--like); border-radius: 50%;
}
.nav-user img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; cursor: pointer; transition: .16s;
  background: var(--bg-soft); color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #000; box-shadow: 0 6px 18px rgba(16,18,24,.16); }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--text-2); }
.btn-ghost:hover { border-color: #cfd4dc; color: var(--text); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-danger { background: #fff; border-color: #f0c4cb; color: #d63a56; }
.btn-danger:hover { background: #fff5f6; }

/* ---------- 布局 ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 18px 16px 40px; display: grid; grid-template-columns: 212px minmax(0,1fr) 292px; gap: 20px; align-items: start; }
/* 两栏 / 单栏变体：用 class 而非内联样式，保证响应式规则可覆盖 */
.wrap-2 { grid-template-columns: minmax(0,1fr) 292px; }
.wrap-aside { grid-template-columns: 200px minmax(0,1fr); }
.wrap-1 { grid-template-columns: minmax(0,1fr); }
.col-side { position: sticky; top: 76px; }
.col-right { position: sticky; top: 76px; display: grid; gap: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px; }
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  font-size: 15.5px; font-weight: 700;
}
.card-title .more { font-size: 13px; font-weight: 500; color: var(--text-3); }
.card-title .more:hover { color: var(--text); }
.list { display: grid; }
.list-item { padding: 11px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #fcfcfd; }
.empty { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 14px; }

/* 左侧导航 */
.side-nav { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px; font-size: 15px; color: var(--text-2); transition: .15s;
}
.side-nav a:hover { background: var(--bg-soft); color: var(--text); }
.side-nav a.on { background: var(--brand); color: #fff; font-weight: 600; }
.side-nav .icon { width: 19px; height: 19px; }
.side-user {
  display: flex; align-items: center; gap: 10px; padding: 14px; margin-bottom: 14px;
}
.side-user img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.side-user b { display: block; font-size: 14.5px; }
.side-user span { font-size: 12.5px; color: var(--text-3); }
.side-card { padding: 14px; }
.side-post { display: grid; gap: 8px; }
.side-post textarea {
  width: 100%; height: 68px; resize: none; border: 0; outline: none;
  font: inherit; font-size: 14.5px; color: var(--text); background: transparent;
}
.mention-list { display: none; }
.mention-list.on { display: block; }
.mention-list .mi {
  display: flex; align-items: center; gap: 8px; padding: 7px 6px;
  border-radius: 9px; cursor: pointer; font-size: 13.5px;
}
.mention-list .mi:hover { background: var(--bg-soft); }
.mention-list .mi img { width: 24px; height: 24px; border-radius: 50%; }
.mention-list .mi b { font-weight: 600; }
.mention-list .mi span { color: var(--text-3); font-size: 12.5px; }
.mention-list .mi.empty { color: var(--text-3); cursor: default; justify-content: center; }
.side-post .row { display: flex; align-items: center; justify-content: space-between; }
.counter { font-size: 12.5px; color: var(--text-3); }
.counter.warn { color: #e8a33d; }
.counter.over { color: #d63a56; }
.ico-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; transition: .15s;
}
.ico-btn:hover { background: var(--bg-soft); color: var(--text); }
.ico-btn .icon { width: 18px; height: 18px; }
.file-hidden { display: none; }

/* ---------- 微博 ---------- */
.feed { display: grid; gap: 14px; }
.post { padding: 16px 18px; }
.post-body { display: flex; gap: 12px; }
.avatar-wrap { flex: none; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--bg-soft); }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.5px; }
.post-head .name { font-size: 15.5px; font-weight: 600; color: var(--text); }
.post-head .name:hover { text-decoration: underline; }
/* ---------- 认证徽章 ---------- */
/* 用 inline-block 而不是 inline-flex：徽章和昵称混排在同一个文本流里，
   inline-flex 会把相邻文字卷入弹性布局，导致昵称竖排。 */
.vbadge {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
}
/* V 形认证标识：微博列表、私信等紧凑位置的图标形态 */
.vbadge .vmark {
  width: 15px;
  height: 15px;
  vertical-align: -2.5px;    /* 让 V 的底边和文字基线大致对齐 */
  display: inline-block;
}
.vbadge .vname {
  height: 16px;
  padding: 0 6px;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
/* 金V 加一点金属质感，和蓝黄区分开 */
.vbadge.v3 .vmark {
  filter: drop-shadow(0 0 2px rgba(212,160,23,.45));
}
.vbadge.v3 .vname {
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(212,160,23,.35);
}
.post-head .handle { color: var(--text-3); }
.pill {
  padding: 1px 8px; border-radius: 8px; background: var(--bg-soft);
  color: var(--accent); font-size: 12.5px; font-weight: 500;
}
.post-text { margin: 5px 0 0; font-size: 15.5px; line-height: 1.72; word-break: break-word; }
.post-text a.topic, .post-text a.mention { color: var(--accent); }
.post-text a:hover { text-decoration: underline; }
.post-text img { margin: 6px 0; border-radius: 10px; }

.pics { margin-top: 10px; display: grid; gap: 4px; border-radius: 12px; overflow: hidden; max-width: 460px; }
.pics img { width: 100%; height: 100%; object-fit: cover; background: var(--bg-soft); }
.pics-1 { grid-template-columns: 1fr; max-width: 340px; }
.pics-1 img { max-height: 400px; object-fit: contain; }
.pics-2, .pics-4 { grid-template-columns: repeat(2, 1fr); }
.pics-3 { grid-template-columns: repeat(3, 1fr); }
.pics-2 img, .pics-3 img, .pics-4 img { aspect-ratio: 1 / 1; }
.pics-3 img:first-child { grid-column: span 2; grid-row: span 2; }
.pics-5, .pics-6, .pics-7, .pics-8, .pics-9 { grid-template-columns: repeat(3, 1fr); }
.pics-5 img, .pics-6 img, .pics-7 img, .pics-8 img, .pics-9 img { aspect-ratio: 1 / 1; }

/* ---------- 视频 ---------- */
.vids { margin-top: 10px; max-width: 460px; }
.vid {
  display: block;
  width: 100%;
  max-height: 460px;
  border-radius: 12px;
  background: #000;
  outline: none;
  /* 竖屏视频不至于缩得太小 */
  min-height: 120px;
}

.origin-quote {
  margin-top: 10px; padding: 11px 13px; border-radius: 12px; background: var(--bg-soft);
  font-size: 14.5px; color: var(--text-2);
}
.oq-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.oq-head b { color: var(--text-2); font-size: 13.5px; }
.oq-head .time { font-size: 12px; color: var(--text-3); }
.oq-text { word-break: break-word; }

.post-meta { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.meta-item .icon { width: 14px; height: 14px; }
.post-actions {
  display: flex; align-items: center; gap: 4px; margin-top: 8px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.act {
  display: inline-flex; align-items: center; gap: 5px; flex: 1;
  justify-content: center; padding: 7px 0; border: 0; background: transparent;
  border-radius: 9px; font-size: 13px; color: var(--text-3); cursor: pointer;
  transition: .15s; font-family: inherit;
}
.act .icon { width: 17px; height: 17px; }
.act b { font-weight: 500; font-variant-numeric: tabular-nums; }
.act:hover { background: var(--bg-soft); color: var(--text); }
.act-like.liked { color: var(--like); }
.act-like.liked .icon { fill: var(--like); stroke: var(--like); }
.act-del { flex: none; width: 34px; }
.act-del:hover { color: #d63a56; background: #fff5f6; }

/* ---------- 标签页 ---------- */
.tabs {
  display: flex; gap: 2px; padding: 4px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tabs a {
  flex: 1; text-align: center; padding: 9px 8px; border-radius: 11px;
  font-size: 14.5px; color: var(--text-2); transition: .15s;
}
.tabs a:hover { background: var(--bg-soft); }
.tabs a.on { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------- 右侧 ---------- */
.topic-rank { display: grid; gap: 2px; }
.topic-rank a { display: flex; gap: 10px; padding: 10px 16px; align-items: flex-start; }
.topic-rank a:hover { background: #fcfcfd; }
.tr-no { font-size: 13px; color: var(--text-3); width: 16px; flex: none; font-variant-numeric: tabular-nums; }
.tr-no.hot { color: var(--like); font-weight: 700; }
.tr-body { min-width: 0; }
.tr-title { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-meta { font-size: 12px; color: var(--text-3); }
.hot-tag { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: #fff1f3; color: var(--like); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.news-item { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-item a { display: block; font-size: 14px; line-height: 1.5; }
.news-item a:hover { color: var(--accent); }
.news-item span { font-size: 12px; color: var(--text-3); }
.notice-text {
  padding: 12px 16px; font-size: 13.5px; color: var(--text-2); line-height: 1.6;
  border-radius: 12px; background: var(--bg-soft); margin: 0 16px 14px;
}

/* 用户推荐 */
.rec-user { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.rec-user img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.rec-user .ru-body { flex: 1; min-width: 0; }
.rec-user b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-user span { font-size: 12px; color: var(--text-3); }

/* ---------- 详情页 ---------- */
.detail-post { padding: 20px 22px; }
.detail-head { display: flex; gap: 13px; }
.detail-head .avatar { width: 50px; height: 50px; }
.detail-text { margin: 8px 0 0; font-size: 17px; line-height: 1.78; }
.detail-pics { margin-top: 14px; display: grid; gap: 5px; border-radius: 12px; overflow: hidden; }
.comment-area { display: grid; gap: 12px; }
.comment-box { display: flex; gap: 10px; padding: 14px 16px; }
.comment-box textarea {
  flex: 1; min-height: 40px; max-height: 160px; border: 0; outline: none; resize: none;
  font: inherit; font-size: 14.5px; background: transparent; color: var(--text);
}
.comment-box .cb-foot { display: flex; justify-content: flex-end; }
.comment { display: flex; gap: 10px; padding: 12px 16px; }
.comment img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.c-main { flex: 1; min-width: 0; }
.c-name { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.c-time { font-size: 12px; color: var(--text-3); margin-left: 6px; font-weight: 400; }
.c-text { margin-top: 2px; font-size: 14.5px; line-height: 1.65; word-break: break-word; }
.c-del { margin-left: 8px; font-size: 12.5px; color: var(--text-3); background: none; border: 0; cursor: pointer; }
.c-del:hover { color: #d63a56; }

/* ---------- 用户页 ---------- */
.profile-head { overflow: hidden; }
.profile-cover { height: 132px; background: linear-gradient(120deg, #f2f4f7, #e8ebf0); }
.profile-info { padding: 0 20px 18px; }
.profile-top { display: flex; align-items: flex-end; gap: 14px; margin-top: -34px; }
.profile-top .avatar { width: 82px; height: 82px; border: 4px solid #fff; background: #fff; }
.profile-id { flex: 1; min-width: 0; padding-bottom: 4px; }
.profile-id h1 { margin: 0; font-size: 21px; }
/* 昵称与认证徽章同行；h1 保持普通文本流，否则 inline-flex 的徽章会
   让昵称文字被当成弹性项参与布局，导致竖排 */
.profile-id h1 .vbadge { margin-left: 4px; }
/* 私信 + 关注按钮：桌面端靠右并排，不要挤在一起 */
.profile-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 6px;
  flex: none;
}
.profile-id .ph { font-size: 13.5px; color: var(--text-3); }
/* 所在地：跟在 @用户名 后，带定位小图标，比旁边的灰字稍深一点便于识别 */
.profile-id .ph .loc {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-2);
  white-space: nowrap;
}
.profile-id .ph .loc::before {
  content: '';
  width: 11px;
  height: 11px;
  flex: none;
  background: currentColor;
  opacity: .7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10.5c0 5.5-8 11.5-8 11.5s-8-6-8-11.5a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10.3' r='2.8'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10.5c0 5.5-8 11.5-8 11.5s-8-6-8-11.5a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10.3' r='2.8'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* 个人主页的认证信息行：「平台认证：苏岩站官方账号」
   颜色由 PHP 按认证等级内联，等级本身由昵称后的徽章表示，这里只出文字 */
.vinfo {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.profile-bio { margin-top: 12px; font-size: 14.5px; color: var(--text-2); line-height: 1.65; }
.profile-stats { display: flex; gap: 20px; margin-top: 14px; font-size: 13.5px; color: var(--text-2); }
.profile-stats b { color: var(--text); font-size: 15px; margin-right: 3px; }
.profile-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ---------- 所在地：省 / 市 联动选择 ---------- */
.region-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.region-pick select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm, 9px);
  outline: none;
  cursor: pointer;
  transition: border-color var(--d) var(--ease-out), box-shadow var(--d) var(--ease-out);
}
.region-pick select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,107,255,.1);
}
@media (max-width: 520px) {
  .region-pick { grid-template-columns: 1fr; }
}

/* ---------- 客户端下载 ---------- */
.dl-list { display: grid; gap: 8px; }

.dl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm, 10px);
  background: #fff;
  transition: border-color var(--d) var(--ease-out), background var(--d) var(--ease-out);
}
.dl-item:hover { border-color: #cfd6e0; background: #fcfdff; }
/* 未配置时整体压暗，让「暂未配置」一眼可见 */
.dl-item.off { background: var(--bg-soft); border-style: dashed; }
.dl-item.off .dl-icon { color: var(--text-3); background: #eef0f4; }
.dl-item.off .dl-name { color: var(--text-2); }

.dl-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef3ff;
  color: var(--accent);
}
.dl-icon .icon { width: 21px; height: 21px; }
.dl-icon.dl-apk { background: #eaf7ef; color: #1f9254; }

.dl-body { flex: 1; min-width: 0; }

.dl-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dl-size {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 1px 7px;
}
.dl-sub {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
  margin-top: 2px;
}

.dl-btn { flex: none; min-width: 78px; justify-content: center; }.dl-btn.is-off {
  color: var(--text-3);
  background: transparent;
  border: 1px dashed var(--line-2);
  cursor: not-allowed;
}

/* 后台：已配置 / 未配置 状态标记 */
.dl-status {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 1px 7px;
  margin-left: 6px;
}
.dl-status.on { color: #1f9254; background: #eaf7ef; }

@media (max-width: 560px) {
  .dl-item { flex-wrap: wrap; }
  .dl-body { flex: 1 1 100%; order: 1; }
  .dl-icon { order: 0; }
  .dl-btn { order: 2; width: 100%; }
}

/* ---------- 表单 ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: var(--bg-soft); }
.auth-card { width: 100%; max-width: 396px; }

/* ---------- 邮箱验证码 ---------- */
.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.code-row input {
  flex: 1;
  min-width: 0;
  /* 验证码一般是不等宽字符，用等宽字体更好对齐 */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  letter-spacing: 3px;
  font-weight: 600;
}
.code-send {
  flex: none;
  min-width: 104px;
  white-space: nowrap;
  font-size: 13.5px;
}
.code-send:disabled { opacity: .6; cursor: not-allowed; }
.code-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.code-hint.ok { color: #1f9254; }
.code-hint.err { color: #d63a56; }

.field-line { border-bottom: 1px solid var(--line); }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand .brand-mark { width: 46px; height: 46px; margin: 0 auto 10px; }
.auth-brand h1 { margin: 0; font-size: 22px; }
.auth-brand p { margin: 4px 0 0; font-size: 13.5px; color: var(--text-3); }
.field { display: grid; gap: 6px; padding: 12px 16px; }
.field label { font-size: 12.5px; color: var(--text-3); }
.field input, .field textarea, .field select {
  border: 0; outline: none; background: transparent; font: inherit; font-size: 15px; color: var(--text);
  width: 100%; padding: 0;
}
.field textarea { min-height: 76px; resize: vertical; }
.form-card { padding: 6px 0 18px; }
.form-foot { padding: 16px; border-top: 1px solid var(--line); }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--text-3); margin-top: 14px; }
.auth-alt a { color: var(--accent); font-weight: 500; }
.field-line { border-bottom: 1px solid var(--line); }

/* ---------- 消息 ---------- */
.notice-item { display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.notice-item.unread { background: #fbfcff; }
.notice-item img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.notice-txt { flex: 1; font-size: 14.5px; }
.notice-txt b { font-weight: 600; }
.notice-txt p { margin: 2px 0 0; color: var(--text-2); font-size: 13.5px; }
.notice-txt .t { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---------- 设置 / 后台 ---------- */
.settings-nav { display: grid; gap: 2px; margin-bottom: 14px; }
.settings-nav a { padding: 10px 12px; border-radius: 10px; font-size: 14.5px; color: var(--text-2); }
.settings-nav a:hover { background: var(--bg-soft); }
.settings-nav a.on { background: var(--brand); color: #fff; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.table td img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.table-wrap { overflow-x: auto; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; background: var(--bg-soft); color: var(--text-2); }
.tag-bad { background: #fff1f3; color: #d63a56; }
.tag-ok { background: #eefaf1; color: #1f9254; }

/* ---------- 滑块人机验证（弹窗版） ---------- */
.sy-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 18, 24, .48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .18s var(--ease-out);
}
.sy-mask.on { opacity: 1; }

.sy-modal {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 44px rgba(16, 18, 24, .26);
  overflow: hidden;
  transform: translateY(-8px) scale(.98);
  transition: transform .18s var(--ease-out);
}
.sy-mask.on .sy-modal { transform: none; }

.sy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.sy-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.sy-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background .15s;
}
.sy-close:hover { background: var(--bg-soft); color: var(--text); }

.sy-body { padding: 18px; }

.sy-tip {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

/*
 * 画布：宽度固定 320px，和服务端校验用的坐标系一致。
 * 图片用 object-fit:cover 铺满，避免右侧留白。
 */
.sy-canvas {
  position: relative;
  width: 320px;
  max-width: 100%;
  height: 160px;
  margin: 0 auto;
  border-radius: 11px;
  overflow: hidden;
  background: #eceef2;
}
.sy-canvas img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
/*
 * 缺口：虚线空槽，明确标出「要填到这里」
 */
.sy-hole {
  position: absolute;
  border-radius: 8px;
  background: rgba(20, 24, 34, .28);
  border: 2px dashed rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
  pointer-events: none;
}
/* 缺口里加个箭头，指示要往哪拖 */
.sy-hole::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-right: 2px solid rgba(255,255,255,.9);
  border-top: 2px solid rgba(255,255,255,.9);
  transform: rotate(45deg);
}
/* 填对了：虚线变绿实线 */
.sy-hole.filled {
  border-style: solid;
  border-color: #1f9254;
  background: transparent;
  box-shadow: none;
}
.sy-hole.filled::after { display: none; }

/* 缺口上方的标签，明确告诉用户往哪填 */
.sy-hole-tag {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(20, 24, 34, .78);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

/*
 * 拼图块：可移动的那一块。
 * 背景取自同一张图，所以看起来就是「从图上抠下来的一块」，
 * 拖到缺口处正好严丝合缝填上。
 */
.sy-piece {
  position: absolute;
  left: 0;
  background-repeat: no-repeat;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, .95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  pointer-events: none;
  z-index: 2;
}
.sy-piece.done {
  border-color: #1f9254;
  box-shadow: 0 0 0 2px rgba(31, 146, 84, .55);
}
.sy-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(236, 238, 242, .9);
  color: var(--text-3);
  font-size: 13px;
}

.sy-track {
  position: relative;
  height: 42px;
  margin-top: 12px;
  border-radius: 21px;
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.sy-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(90deg, #2f6bff, #5b8cf5);
  border-radius: 21px 0 0 21px;
}
.sy-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-3);
  pointer-events: none;
}
.sy-btn {
  position: absolute;
  left: 0; top: 0;
  width: 42px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(16, 18, 24, .2);
  color: var(--text-2);
  cursor: grab;
  touch-action: none;
  transition: transform .12s var(--ease-out);
  z-index: 2;
}
.sy-btn.dragging { cursor: grabbing; }
.sy-btn.pass { background: #1f9254; color: #fff; }
.sy-btn.fail { background: #d63a56; color: #fff; }

.sy-msg {
  margin-top: 10px;
  min-height: 18px;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-3);
}
.sy-msg.ok { color: #1f9254; }
.sy-msg.err { color: #d63a56; }

/* 弹窗底部：重试按钮 + 诊断入口 */
.sy-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sy-retry {
  padding: 7px 15px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.sy-retry:hover { border-color: var(--brand); color: var(--brand); }
.sy-retry[style*="display: none"] { display: none !important; }
.sy-diag {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
}
.sy-diag:hover { color: var(--brand); }

/* ---------- 后台配置表单（邮件 / 验证码 / 滑块） ---------- */
.cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.cfg-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cfg-item > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.4;
}
.cfg-item input,
.cfg-item select,
.cfg-item textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  /* 16px 以下 iOS Safari 会自动放大整页 */
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  max-width: 100%;
}
.cfg-item input:focus,
.cfg-item select:focus,
.cfg-item textarea:focus {
  border-color: var(--brand);
  outline: none;
}
.cfg-item textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.cfg-tip {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
}
.cfg-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.cfg-switch input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.cfg-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: var(--bg-soft);
  border-radius: 4px;
  padding: 1px 4px;
}

/* ---------- 登录日志 / 设备标识 ---------- */

/* 导航上的条数徽标 */
.settings-nav a .tab-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 17px;
  vertical-align: 1px;
}
.settings-nav a.on .tab-badge { background: var(--brand); color: #fff; }

/* 设备标识 / IP 的等宽展示 */
.dev-id, .table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: .2px;
}
.table code {
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text-2);
}
.table code.dev-id { color: var(--text-3); }

/* 筛选条 */
.log-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.log-filter input,
.log-filter select {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
}
.log-filter input { flex: 1 1 150px; max-width: 220px; }
.log-filter input:focus,
.log-filter select:focus { border-color: var(--brand); outline: none; }

/* 统计条 */
.log-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}
.log-summary .ls-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 6px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--bg-soft);
}
.log-summary .ls-item b { font-size: 19px; font-weight: 700; line-height: 1.2; }
.log-summary .ls-item span { font-size: 12px; color: var(--text-3); }
.log-summary .ls-item.warn { background: #fff8ec; border-color: #f6dcb4; }
.log-summary .ls-item.warn b { color: #e08c1a; }

.inline-form { display: inline; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13.5px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: #d63a56; }

/* ---------- 提示条 ---------- */
.flash {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%);
  z-index: 200; padding: 10px 18px; border-radius: 11px;
  background: var(--brand); color: #fff; font-size: 14px;
  box-shadow: 0 10px 30px rgba(16,18,24,.16); transition: .3s;
}
.flash.out { opacity: 0; transform: translate(-50%, -8px); }
.flash-err { background: #d63a56; }
.flash-warn { background: #e8a33d; }

/* 图片查看 */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(255,255,255,.94);
  display: none; align-items: center; justify-content: center; padding: 40px;
}
.lightbox.on { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* 页脚 */
.footer { border-top: 1px solid var(--line); background: #fff; margin-top: 20px; }
.footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 18px 16px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 13px; color: var(--text-3);
}
.footer a:hover { color: var(--text); }
.footer .dot { color: var(--line-2); }
.footer-tag { margin-left: auto; padding: 2px 8px; border-radius: 6px; background: var(--bg-soft); }

.pager { display: flex; justify-content: center; gap: 6px; padding: 6px 0; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 10px;
  font-size: 14px; color: var(--text-2);
}
.pager a:hover { background: var(--bg-soft); color: var(--text); }
.pager .on { background: var(--brand); color: #fff; font-weight: 600; }
.pager .off { color: var(--line-2); }

.muted { color: var(--text-3); font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

/* ---------- 移动端底部导航（桌面端隐藏） ---------- */
.mnav { display: none; }

/* 响应式 */
@media (max-width: 1080px) {
  .wrap, .wrap-aside { grid-template-columns: 190px minmax(0,1fr); }
  /* wrap-2 是「主栏 + 右栏」结构，u.php 在用。
     它没有左栏，窄屏下右栏已隐藏，主栏必须占满，否则昵称、正文会被挤成竖排。 */
  .wrap-2 { grid-template-columns: minmax(0,1fr); }
  .wrap-1 { grid-template-columns: minmax(0,1fr); }
  .col-right { display: none; }
}

/* ---------- 平板：略缩间距 ---------- */
@media (max-width: 900px) {
  .wrap { padding: 14px 12px 34px; gap: 16px; }
  .settings-nav a, .side-nav a { padding: 8px 12px; }
}

/* =========================================================
   手机端主断点
   ========================================================= */
@media (max-width: 720px) {
  /* --- 顶栏精简 --- */
  .topbar-inner { height: 52px; padding: 0 12px; gap: 10px; }
  .brand-text { display: none; }

  /*
   * 手机端顶栏只保留：品牌图标、搜索框、下载入口、头像。
   *
   * 注意这里不能用 `.topnav a:not(.btn):not(.nav-user)` 一刀切——
   * 那会把「下载客户端」也一起藏掉，手机上就找不到下载入口了。
   * 所以改成显式列出要隐藏的项。
   */
  .topnav a:not(.btn):not(.nav-user):not(.topnav-dl) { display: none; }

  /* 顶栏在手机端不再承担文字导航，只留搜索和图标 */
  .search-wrap { max-width: none; }
  .search input { height: 34px; }

  /*
   * 手机端的热搜面板：脱离搜索框宽度，铺满整屏。
   *
   * 搜索框在顶栏里只有半屏宽，下拉面板跟着它会很挤。
   * 改成 fixed 定位在顶栏正下方，全宽显示，底部留出滚动空间。
   */
  .search-panel {
    position: fixed;
    left: 0; right: 0;
    top: 52px;                     /* 与移动端顶栏高度一致 */
    max-width: none;
    border-radius: 0;
    border-left: 0; border-right: 0;
    box-shadow: 0 8px 20px rgba(16, 18, 24, .1);
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sp-list { max-height: none; }
  .sp-item { padding: 11px 14px; }   /* 手机上点击区域更大 */
  .sp-name { font-size: 15px; }
  .sp-rank { width: 21px; height: 21px; font-size: 12px; }

  /* --- 顶栏的下载入口：收成一个图标按钮 --- */
  .topnav .topnav-dl {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    flex: none;
    border-radius: 9px;
    color: var(--text-2);
    transition: background var(--d) var(--ease-out), color var(--d) var(--ease-out);
  }
  .topnav .topnav-dl .icon { width: 20px; height: 20px; }
  /* 图标下面的文字在手机上不显示，只留图标 */
  .topnav .topnav-dl-text { display: none; }
  .topnav .topnav-dl.on { background: var(--brand); color: #fff; }
  .topnav .topnav-dl:active { background: var(--bg-soft); }
  .topnav .topnav-dl.on:active { background: var(--brand); }

  /* --- 底部导航栏 --- */
  .mnav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    z-index: 300;
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--line);
    padding: 5px 0 calc(5px + env(safe-area-inset-bottom, 0px));
    animation: mnavIn .35s var(--ease-out) both;
  }
  @keyframes mnavIn {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .mnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 3px 0;
    color: var(--text-3);
    transition: color var(--d) var(--ease-out);
    min-width: 0;
  }
  /*
   * 底部导航项数会随登录状态变化：
   *   未登录：首页 / 发现 / 下载 / 发布 / 登录              = 5 项
   *   已登录：首页 / 发现 / 下载 / 发布 / 私信 / 消息 / 我的 = 7 项
   * 7 项在 390px 宽下每项只有 55px，标签要收窄才不会挤。
   */
  .mnav em {
    font-size: 10px;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: -.2px;
    white-space: nowrap;
  }
  .mnav .mi {
    position: relative;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    transition: transform var(--d) var(--ease-back);
  }
  .mnav .mi svg { width: 23px; height: 23px; fill: currentColor; }
  .mnav .mi img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
  /* .mnav em 的样式已合并到上面的规则里，这里不再重复定义 */
  .mnav a:active .mi { transform: scale(.86); }
  .mnav a.on { color: var(--text); }
  .mnav a.on .mi { transform: translateY(-1px); }
  .mnav a.on::after {
    content: '';
    position: absolute;
    bottom: -1px;
    width: 16px; height: 2.5px;
    border-radius: 2px;
    background: var(--brand);
    animation: mnavBar .3s var(--ease-back);
  }
  @keyframes mnavBar {
    from { width: 0; opacity: 0; }
    to   { width: 16px; opacity: 1; }
  }
  .mnav a { position: relative; }
  .mnav .mb {
    position: absolute;
    top: -3px; right: -7px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--like);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    border: 1.5px solid #fff;
    animation: dotPulse 1.9s var(--ease-in-out) infinite;
  }

  /* --- 为底部导航让出空间 --- */
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .footer { padding-bottom: 10px; }
  .footer-tag { display: none; }

  /* --- 布局单列 --- */
  .wrap, .wrap-2, .wrap-aside, .wrap-1 {
    grid-template-columns: minmax(0,1fr);
    padding: 12px 12px 20px;
    gap: 12px;
  }
  .col-side { display: none; }

  /* --- 卡片与圆角 --- */
  .card { border-radius: 14px; }
  .post, .detail-post { padding: 14px; }
  .card-pad { padding: 14px; }

  /* --- 微博卡片 --- */
  .post-text { font-size: 15.5px; }
  .post-meta { font-size: 12px; }
  /* 动作按钮横向均分，触摸区域够大 */
  .post-actions { gap: 0; }
  .act { flex: 1; justify-content: center; padding: 9px 2px; }
  .act b { font-size: 12.5px; }

  /* --- 详情页 --- */
  .detail-text { font-size: 16.5px; }
  .pics { max-width: 100%; }
  .pics-1 { max-width: 100%; }

  /* --- 表格转卡片（后台列表） --- */
  /* 手机上表格横排会挤成一团、按钮被裁掉，这里把每个 tr 变成一张卡片，
     单元格竖排并用 data-l 显示字段名。用纯 CSS 实现，不改 PHP 结构。 */
  .mtable { overflow-x: visible; }
  .mtable .table { min-width: 0; display: block; }
  .mtable .table thead { display: none; }
  .mtable .table tbody { display: block; }
  .mtable .table tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
    animation: none;   /* 覆盖 style.css 里的逐行动画，避免长列表卡顿 */
  }
  .mtable .table tr:last-child { margin-bottom: 0; }
  .mtable .table td {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    border: 0;
    max-width: none !important;
    text-align: left;
    font-size: 13.5px;
    word-break: break-word;
  }
  /* 字段名 */
  .mtable .table td::before {
    content: attr(data-l);
    flex: none;
    width: 52px;
    color: var(--text-3);
    font-size: 12.5px;
    line-height: 1.55;
  }
  /* 内容区允许换行 */
  .mtable .table td > * { min-width: 0; }
  /* 操作按钮独占一行、右对齐 */
  .mtable .table td.tact {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 9px;
    margin-top: 5px;
    border-top: 1px solid var(--line);
  }
  .mtable .table td.tact::before { display: none; }
  .mtable .inline-form { margin: 0 !important; }
  .mtable .table td img { width: 32px; height: 32px; }

  /* --- 表单控件加大触摸区 --- */
  .field input, .field textarea, .field select,
  .afield input, .afield textarea, .afield select,
  .chat-send textarea {
    font-size: 16px;   /* 16px 以下 iOS 会自动放大页面 */
    padding: 11px 12px;
  }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }

  /* --- 提示条位置避开底部导航 --- */
  .flash { top: 60px; }

  /* --- 弹窗适配 --- */
  .amask { padding: 0; align-items: flex-end; }
  .amodal { max-width: 100%; max-height: 90vh; border-radius: 18px 18px 0 0; }
  .astats { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }

  /* --- 回到顶部按钮上移，避开底部导航 --- */
  .to-top { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: 14px; width: 38px; height: 38px; }
  .toast-wrap { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

  /* --- 用户主页头部：手机上三栏并排太挤，改成上下堆叠 --- */
  .profile-cover { height: 108px; }
  .profile-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      'av  id'
      'act act';
    align-items: center;
    gap: 8px 12px;
    margin-top: -30px;
  }
  .profile-top .avatar { grid-area: av; width: 68px; height: 68px; }
  .profile-id { grid-area: id; padding-bottom: 0; align-self: end; }
  .profile-id h1 { font-size: 19px; }
  .profile-actions-row { grid-area: act; }
  /* 私信 + 关注按钮占满一行 */
  .profile-actions-row { display: flex; gap: 8px; padding-bottom: 0 !important; }
  .profile-actions-row .btn { flex: 1; justify-content: center; }
  /* 关注按钮同时带 .act 类，.act 的样式会盖掉 ghost 的边框，这里补回来 */
  .profile-actions-row .btn-ghost,
  .profile-actions-row .btn.act { border: 1px solid var(--line-2); background: #fff; }
  .profile-actions-row .btn-primary { border: 1px solid var(--brand); }
  .profile-stats { flex-wrap: wrap; gap: 14px; font-size: 13px; }
  .profile-bio { margin-top: 10px; font-size: 14px; }

  /* --- 消息中心 / 详情页的用户信息表：手机上两列够用 --- */
  .profile-info table td { padding: 4px 0; }

  /* --- 发布框工具行：手机上换行铺开 --- */
  .side-post .form-foot, .card-pad > div[style*="display:flex"] { flex-wrap: wrap; }
  .side-post .form-foot > * { flex: 1 1 auto; }

  /* --- 详情页评论区：手机上头像缩小 --- */
  .comment .avatar { width: 32px !important; height: 32px !important; }

  /* --- 分段标签：标签多时改为横向滚动，避免文字被压成竖排 --- */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    padding: 4px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a {
    flex: 0 0 auto;      /* 不再平均分配，改为按内容宽度 */
    white-space: nowrap; /* 关键：禁止换行，「评论」就不会竖排 */
    min-width: 62px;
    padding: 9px 14px;
  }
  .tabs a.on { flex: 0 0 auto; }

  /*
   * 标签多的时候右边还有内容，但纯滚动没有提示，用户容易以为就这几个。
   * 用渐变遮罩：右侧一层白雾盖住「提到我」的边缘，视觉上暗示「还能往右滑」。
   * 靠 mask-image 实现，不会挡住点击。
   */
  .tabs {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent 100%);
  }
  /* 滚到底时撤掉右侧遮罩，避免当前项被淡化 */
  .tabs.at-end {
    -webkit-mask-image: none;
    mask-image: none;
  }
  /* 往右滑时左边也淡出，暗示左侧还有内容 */
  .tabs:not(.at-start) {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22px, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 22px, #000 calc(100% - 26px), transparent 100%);
  }
  /* 同时在两端时只保留右侧渐变 */
  .tabs.at-start.at-end {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 420px) {
  .wrap { padding: 10px 10px 18px; }
  .post { padding: 12px; }
  .mnav em { font-size: 10px; }
  .mnav .mi svg { width: 22px; height: 22px; }
  .act { padding: 8px 0; }
  .act .icon { width: 17px; height: 17px; }
}

/* =========================================================
   手机端适配补充
   ---------------------------------------------------------
   放在文件末尾集中维护，方便后续调整。

   主要解决三类问题：
   1. 顶栏：手机上「登录/注册」按钮和搜索框抢空间，搜索框被压到 200px
   2. 触摸热区：昵称、话题标签、时间戳等小元素点击区域不足 40px
   3. 细节：输入框字号、iOS 聚焦缩放、横向滚动容器
   ========================================================= */
@media (max-width: 720px) {

  /* ---------- 1. 顶栏瘦身 ---------- */

  /*
   * 手机上顶栏不该放「登录 / 注册」文字按钮：
   * 它们会占掉 112px，把搜索框压扁，而且底部导航已有「登录」入口。
   * 这里改成只留图标，搜索框就能拿回完整宽度。
   */
  .topnav a.btn { display: none; }

  /* 搜索框撑满剩余空间 */
  .search-wrap { flex: 1; min-width: 0; }
  .search input { font-size: 16px; }  /* 小于 16px iOS 会自动放大页面 */

  /* 头像点击区域扩大，但视觉大小不变 */
  .topnav .nav-user { padding: 6px; margin: -6px; }
  .topnav .nav-user img { width: 30px; height: 30px; }

  /* ---------- 2. 触摸热区扩大 ---------- */

  /*
   * 这些元素视觉上很小，但在手机上必须好点。
   * 用 ::after 伪元素把可点区域撑到 44px（苹果 HIG 推荐值），
   * 不改变原有布局，避免出现错位。
   */
  .post .name,
  .post .handle,
  .post .meta-item,
  .post .topic-link,
  .detail-post .name {
    position: relative;
  }
  .post .name::after,
  .post .handle::after,
  .post .meta-item::after,
  .post .topic-link::after,
  .detail-post .name::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 40px;
    transform: translateY(-50%);
  }

  /* 话题标签 / 认证徽章：整体加大点，热区更舒服 */
  .post .pill,
  .post .verified {
    min-height: 24px;
    padding: 3px 9px;
  }

  /* 头像链接加大热区 */
  .post .avatar-wrap::after {
    content: '';
    position: absolute;
    inset: -8px;
  }
  .post .avatar-wrap { position: relative; }

  /* ---------- 3. 表单与输入 ---------- */

  /* 「发布」做成凸起的圆形按钮，视觉上从底部导航里跳出来 */
  .mnav .mnav-post .mi {
    width: 38px; height: 38px;
    margin-top: -14px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 3px 10px rgba(47,107,255,.32);
    border: 3px solid #fff;
  }
  .mnav .mnav-post .mi svg { width: 20px; height: 20px; }
  .mnav .mnav-post em { margin-top: 1px; }
  .mnav .mnav-post:active .mi { transform: scale(.9); }
  /* 圆形按钮的标签往下压一点，给凸起的圆留出位置 */
  .mnav .mnav-post { justify-content: flex-start; }
  .mnav .mnav-post em { margin-top: 3px; }

  /* iOS 上输入框字号 < 16px 会触发页面缩放，必须保证 16px */

  input, textarea, select { font-size: 16px; }

  /* 输入框、按钮的触摸高度 */
  .field input,
  .field textarea,
  .field select { min-height: 44px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }

  /* ---------- 4. 表格横向滚动 ---------- */

  /*
   * 后台的用户表、微博表在手机上列很多。
   * 注意：.mtable 已在上面的规则里转成卡片式布局（这是本项目已有的做法，
   * 效果更好，不需要横向滚动）。这里的规则只针对没有 .mtable 的普通表格。
   */
  .table-wrap:not(.mtable) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .table-wrap:not(.mtable) table { min-width: 560px; }

  /* 表格内的操作按钮热区 */
  .table-wrap td a,
  .table-wrap td button { padding: 6px 4px; display: inline-block; }

  /* ---------- 5. 长文本与长链接 ---------- */

  /* 超长单词/网址不撑破布局 */
  .post-text, .detail-text, .card-pad p { overflow-wrap: anywhere; word-break: break-word; }

  /* 头像与昵称在窄屏挤一行时允许换行 */
  .post-head { flex-wrap: wrap; row-gap: 2px; }

  /* ---------- 6. iOS 细节 ---------- */

  /* 去掉输入框聚焦时的默认高亮边框（会盖住圆角） */
  .field input:focus, .field textarea:focus { outline: none; }

  /* 禁止双击缩放，但保留捏合缩放 */
  * { touch-action: manipulation; }

  /* 按钮点击时的背景色，避免点击后残留蓝框 */
  .btn, .act, .mnav a { -webkit-tap-highlight-color: transparent; }

  /*
   * 触屏设备禁用 hover 效果。
   *
   * iOS Safari / Chrome Android 点击后会残留 :hover 状态，
   * 按钮停在 hover 样式上（.btn-ghost 会变深、.btn-primary 会加阴影），
   * 要等用户点了别处才恢复。手机上本来也没有鼠标，hover 没意义。
   *
   * 注意 --brand 是黑色（站点主色），--accent 才是蓝色，别写混。
   */
  @media (hover: none) {
    .btn:hover { transform: none; box-shadow: none; }
    .btn-primary:hover { background: var(--brand); box-shadow: none; }
    .btn-accent:hover { background: var(--accent); }
    .btn-ghost:hover { border-color: var(--line-2); color: var(--text-2); }
    .btn-danger:hover { background: #fff; }
    .act:hover { background: none; }
    .tabs a:hover { background: none; }
    .tabs a.on:hover { background: var(--brand); }
  }
}

/* 极窄屏（iPhone SE / 5 等 320px 宽）再收一档 */
@media (max-width: 360px) {
  .topbar-inner { padding: 0 10px; gap: 8px; }
  .search input { padding: 0 10px 0 32px; }
  .search .icon { left: 9px; }
  .post-text { font-size: 15px; }
  .mnav em { font-size: 9.5px; }
  /* 底部导航最多 7 项，320px 下每项只有 45px，图标和字号都要再收 */
  .mnav .mi { width: 22px; height: 22px; }
  .mnav .mi svg { width: 20px; height: 20px; }
  .mnav .mnav-post .mi { width: 34px; height: 34px; }
  .mnav .mnav-post .mi svg { width: 18px; height: 18px; }
  /* 顶栏的下载图标也收一点，给搜索框留空间 */
  .topnav .topnav-dl { width: 30px; height: 30px; }
  .topnav .topnav-dl .icon { width: 18px; height: 18px; }
}
