:root {
  --primary: #2b6cb0;
  --primary-dark: #2c5282;
  --primary-light: #ebf4ff;
  --bg: #f2f5f8;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #2d3748;
  --muted: #718096;
  --green: #38a169;
  --red: #e53e3e;
  --orange: #dd6b20;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* 顶部栏 */
.topbar {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #fff;
}
.topbar .inner {
  max-width: 1100px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.logo:hover { text-decoration: none; color: #fff; }
.logo .mark {
  width: 38px; height: 38px; border-radius: 8px; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.logo .name { font-size: 20px; }
.logo .slogan { font-size: 12px; opacity: .8; font-weight: 400; }

.topbar .search {
  flex: 1; max-width: 360px; margin: 0 24px; position: relative;
}
.topbar .search input {
  width: 100%; padding: 8px 12px; border-radius: 18px; border: none; outline: none; font-size: 13px;
}
.topbar .userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.topbar .userbox a { color: #fff; }
.topbar .userbox .btn-login {
  border: 1px solid rgba(255,255,255,.6); padding: 5px 14px; border-radius: 16px;
}
.topbar .userbox .btn-login:hover { background: rgba(255,255,255,.12); text-decoration: none; }

/* 导航 */
.navbar {
  background: #fff; border-bottom: 2px solid var(--primary);
}
.navbar .inner {
  max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px;
}
.navbar a {
  padding: 11px 16px; color: var(--text); font-weight: 500; border-bottom: 2px solid transparent;
}
.navbar a:hover, .navbar a.active { color: var(--primary); border-bottom-color: var(--primary); text-decoration: none; }

/* 容器 */
.container { max-width: 1100px; margin: 16px auto; padding: 0 16px; display: flex; gap: 16px; }
.main { flex: 1; min-width: 0; }
.sidebar { width: 280px; flex-shrink: 0; }

/* 面板 */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 16px; overflow: hidden; }
.panel-head {
  background: var(--primary-light); padding: 10px 14px; font-weight: 600; color: var(--primary-dark);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
}
.panel-body { padding: 12px 14px; }

/* 板块网格 */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.cat-item { background: #fff; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.cat-item .icon {
  width: 44px; height: 44px; border-radius: 8px; background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.cat-item .meta h3 { font-size: 15px; margin-bottom: 2px; }
.cat-item .meta .desc { font-size: 12px; color: var(--muted); }
.cat-item .meta .stat { font-size: 12px; color: var(--muted); margin-top: 4px; }
.cat-item .meta .stat b { color: var(--primary); }

/* 帖子列表 */
.thread-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: #fafcff; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px;
}
.thread-row .mid { flex: 1; min-width: 0; }
.thread-row .mid .title { font-size: 14px; font-weight: 500; }
.thread-row .mid .sub { font-size: 12px; color: var(--muted); }
.tag-pin { background: var(--red); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; margin-right: 5px; }
.thread-row .nums { text-align: center; font-size: 12px; color: var(--muted); flex-shrink: 0; width: 64px; }
.thread-row .nums b { display: block; color: var(--text); font-size: 14px; }

/* ===== 友情链接 ===== */
.footer-links {
  background:#fff; border:1px solid var(--border); border-radius:6px; padding:10px 14px;
  font-size:13px; display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:12px;
}
.footer-links a { color:var(--primary); }
.footer-links a.more { margin-left:auto; color:var(--muted); }

.link-list { list-style:none; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.link-list li {
  border:1px solid var(--border); border-radius:6px; padding:10px 12px; background:#fafcff;
}
.link-list li a { font-weight:600; font-size:14px; }
.link-list li .url { display:block; font-size:12px; color:var(--muted); margin-top:2px; word-break:break-all; }
.link-list li .desc { display:block; font-size:12px; color:#4a5568; margin-top:4px; }

@media (max-width:700px){ .link-list { grid-template-columns:1fr; } }

/* ===== 购买页 ===== */
.buy-grid { display:flex; gap:24px; flex-wrap:wrap; }
.buy-info { flex:1.4; min-width:260px; }
.buy-qr {
  flex:1; min-width:240px; max-width:320px; text-align:center;
  background:#f8fafc; border:1px solid var(--border); border-radius:8px; padding:16px;
}
.buy-qr img { max-width:100%; border-radius:6px; }
.buy-qr .qr-tip { margin-top:10px; font-weight:600; color:var(--primary-dark); }

/* ===== 侧栏排行 ===== */
.rank-list { list-style: none; }
.rank-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.rank-list li:last-child { border-bottom: none; }
.rank-no { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-list li:nth-child(1) .rank-no { background: var(--red); }
.rank-list li:nth-child(2) .rank-no { background: var(--orange); }
.rank-list li:nth-child(3) .rank-no { background: var(--green); }
.rank-list .pts { margin-left: auto; font-size: 12px; color: var(--orange); }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  border-radius: 8px; padding: 16px; text-align: center; }
.stat-card .num { font-size: 24px; font-weight: 700; }
.stat-card .label { font-size: 12px; opacity: .85; }

/* 帖子详情 */
.thread-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.post { display: flex; gap: 14px; padding: 16px 14px; border-bottom: 1px solid var(--border); }
.post .avatar { width: 48px; height: 48px; font-size: 18px; }
.post .body { flex: 1; min-width: 0; }
.post .body .content { margin-top: 8px; white-space: pre-wrap; word-break: break-word; }
.post .floor { font-size: 12px; color: var(--muted); }
.post .author { font-weight: 600; }
.post .badge-admin { background: var(--red); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; margin-left: 6px; }

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 5px; font-size: 14px;
  font-family: inherit; outline: none;
}
.input:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.input { min-height: 140px; resize: vertical; }

.btn {
  display: inline-block; padding: 9px 20px; background: var(--primary); color: #fff; border: none;
  border-radius: 5px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #c53030; }

/* 提示 */
.flash { padding: 10px 14px; border-radius: 5px; margin-bottom: 12px; font-size: 13px; }
.flash.success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.flash.warning { background: #fffaf0; color: #744210; border: 1px solid #feebc8; }
.flash.danger { background: #fff5f5; color: #9b2c2c; border: 1px solid #fed7d7; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
table.tbl th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
table.tbl tr:hover td { background: #fafcff; }

/* 分页 */
.pager { display: flex; gap: 6px; justify-content: center; padding: 12px; }
.pager a, .pager span { padding: 5px 12px; border: 1px solid var(--border); border-radius: 4px; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 广告版式 ===== */
.adzone-top { padding-top:12px; }
.adzone-top, .adzone-bottom { max-width:1100px; margin:0 auto; padding-left:16px; padding-right:16px; }

.ad-full { margin:0 0 12px; }
.ad-row { display:flex; gap:12px; margin-bottom:12px; }
.ad-half { flex:1; min-width:0; }

/* 有内容时干净展示，不再画虚线占位框 */
.ad-slot {
  position:relative; text-align:center; line-height:0;
  max-width:100%; overflow:hidden;
}
/* 图片广告：铺满容器宽度，高度自适应 */
.ad-slot img {
  width:100%; height:auto; display:block; border-radius:4px;
}
/* 自定义 HTML：不强行改宽度（改了会把横幅里的字挤成一团），
   交给 JS 用 zoom 等比缩放保留原始比例；万一 zoom 不生效，
   .ad-slot 的 overflow:hidden 兜底裁掉溢出部分，不会撑破页面 */
.ad-slot .ad-raw { display:block; line-height:1.4; }
.ad-slot a.ad-link { display:block; }
.ad-slot a.ad-link:not(:has(img)) {
  line-height:1.6; padding:10px 14px; background:#fff; border:1px solid var(--border);
  border-radius:4px; font-weight:600;
}
/* 纯文字、无链接、无图 */
.ad-slot > span.ad-text {
  display:block; line-height:1.6; padding:10px 14px; background:#fff;
  border:1px solid var(--border); border-radius:4px; font-weight:600;
}
.ad-flag {
  position:absolute; top:2px; right:4px; z-index:2;
  font-size:10px; line-height:1.4; color:#a0aec0; background:rgba(255,255,255,.8);
  padding:0 4px; border-radius:2px; letter-spacing:.5px;
}

/* ===== 后台广告位卡片 ===== */
.ad-card {
  border:1px solid var(--border); border-radius:6px; padding:12px 14px; margin-bottom:14px;
  background:#fafcff;
}
.ad-card:last-child { margin-bottom:0; }
.ad-card-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:4px; }
.ad-card-head .name { font-weight:700; font-size:15px; color:var(--primary-dark); }
.ad-size {
  font-size:12px; padding:2px 8px; border-radius:4px; font-weight:600;
  background:var(--primary-light); color:var(--primary-dark); border:1px solid #cfe3f7;
}
.ad-card-desc { font-size:12px; color:var(--muted); margin-bottom:10px; }
.ad-fields { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.ad-preview { margin-top:8px; }
.ad-preview img { max-width:320px; max-height:110px; border:1px solid var(--border); border-radius:4px; }

@media (max-width:820px){
  .ad-fields { grid-template-columns:1fr; }
  .ad-row { flex-direction:column; }
}

/* ===== 未读角标 ===== */
.badge {
  display:inline-block; min-width:16px; padding:0 5px; margin-left:3px;
  background:var(--red); color:#fff; border-radius:9px;
  font-size:11px; line-height:16px; text-align:center; vertical-align:middle;
}
.navbar .badge { background:var(--red); }
.badge-admin { background: var(--red); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; margin-left: 6px; }

/* ===== 私信 ===== */
.msg-list { list-style:none; }
.msg-list li {
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  border-bottom:1px solid var(--border);
}
.msg-list li:last-child { border-bottom:none; }
.msg-list li:hover { background:#fafcff; }
.msg-list .mid { flex:1; min-width:0; }
.msg-list .mid .title { font-weight:600; }
.msg-list .mid .sub { font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.msg-list .right { text-align:right; flex-shrink:0; }
.msg-list .right .time { font-size:12px; color:var(--muted); margin-top:2px; }

.chat { display:flex; flex-direction:column; gap:14px; }
.bubble-row { display:flex; gap:10px; align-items:flex-start; }
.bubble-row.me { flex-direction:row-reverse; }
.bubble {
  max-width:76%; background:#f1f5f9; border:1px solid var(--border);
  border-radius:8px; padding:8px 12px; font-size:14px;
}
.bubble-row.me .bubble { background:var(--primary-light); border-color:#cfe3f7; }
.bubble .time { font-size:11px; color:var(--muted); margin-top:4px; }
.bubble .md-body p:last-child { margin-bottom:0; }

/* ===== 提醒列表 ===== */
.notice-list { list-style:none; }
.notice-list li {
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  border-bottom:1px solid var(--border); font-size:13px;
}
.notice-list li:last-child { border-bottom:none; }
.notice-list li.unread { background:#fffaf0; }
.notice-list .ico {
  width:26px; height:26px; border-radius:50%; background:var(--primary-light);
  color:var(--primary-dark); display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700; flex-shrink:0;
}
.notice-list .mid { flex:1; min-width:0; }
.notice-list .mid .sub { font-size:12px; color:var(--muted); }

/* ===== 附件 ===== */
.attach-box {
  margin-top:10px; border:1px solid var(--border); border-radius:6px; background:#fafcff; overflow:hidden;
}
.attach-head { padding:7px 12px; font-size:13px; font-weight:600; color:var(--primary-dark); background:var(--primary-light); }
.attach-item {
  display:flex; align-items:center; gap:10px; padding:8px 12px; border-bottom:1px dashed var(--border);
}
.attach-item:last-of-type { border-bottom:none; }
.attach-item .ico { font-size:18px; }
.attach-item .mid { flex:1; min-width:0; }
.attach-item .mid .name { font-weight:600; word-break:break-all; }
.attach-item .mid .meta { display:block; font-size:12px; color:var(--muted); }
.attach-item .price { color:var(--orange); font-weight:600; font-size:13px; flex-shrink:0; }
.attach-item .price.free { color:var(--green); }
.attach-tip { padding:7px 12px; font-size:12px; color:var(--muted); border-top:1px solid var(--border); }

/* ===== 举报 ===== */
.report-link { color:var(--muted); font-size:12px; }
.report-link:hover { color:var(--red); }
.quote-box {
  background:#f8fafc; border-left:4px solid var(--muted); border-radius:4px;
  padding:10px 12px; margin-bottom:14px; font-size:13px; color:#4a5568; word-break:break-all;
}

/* ===== @提及 ===== */
a.mention { color:var(--primary); background:var(--primary-light); padding:0 3px; border-radius:3px; }

/* ===== 头像尺寸 ===== */
.avatar-sm  { width:36px; height:36px; border-radius:50%; flex-shrink:0; }
.avatar-lg  { width:56px; height:56px; border-radius:50%; flex-shrink:0; }
.avatar-xl  { width:72px; height:72px; border-radius:50%; flex-shrink:0; }
.avatar-xs  { width:20px; height:20px; border-radius:50%; flex-shrink:0; }

/* ===== 等级徽章 ===== */
.lvl {
  display:inline-block; margin-top:4px; font-size:11px; padding:1px 7px; border-radius:10px;
  background:var(--primary-light); color:var(--primary-dark); border:1px solid #cfe3f7;
}
.lv-badge {
  display:inline-flex; align-items:center; gap:3px; vertical-align:middle;
  font-size:11px; line-height:1.6; padding:1px 8px; border-radius:10px;
  border:1px solid #d3dae2; background:#f6f8fa; color:#6b7683; white-space:nowrap;
}
.lv-badge b { font-weight:600; }
.lv-badge.lv-1 { color:#26734a; border-color:#a8d9bd; background:#eaf7f0; }
.lv-badge.lv-2 { color:#1a6ba8; border-color:#a9cfe8; background:#e9f3fb; }
.lv-badge.lv-3 { color:#4c3fc4; border-color:#b9b1ee; background:#efedfd; }
.lv-badge.lv-4 { color:#a06812; border-color:#e3c07a; background:#fdf5e4; }
.lv-badge.lv-5 { color:#b8391f; border-color:#ecab98; background:#fdedE8; }
/* 高档位：金/紫渐变 + 微光，一眼看出身份 */
.lv-badge.lv-6 {
  color:#7a5410; border-color:#d9b45c;
  background:linear-gradient(180deg,#fdf6e0,#f3e0a6);
  box-shadow:0 0 7px rgba(214,168,60,.4);
}
.lv-badge.lv-7 {
  color:#fff; border-color:#a26bf0;
  background:linear-gradient(180deg,#a06bf8,#7c3aed);
  box-shadow:0 0 9px rgba(155,92,246,.5);
}

/* h1 语义化：保留视觉，不影响原有排版 */
h1.page-h1 {
  font-size:19px; font-weight:700; color:var(--text);
  margin:0 0 12px; line-height:1.5;
}
h1.idcard-name { margin:0; }
.panel-head h1 {
  display:inline; font-size:inherit; font-weight:inherit;
  margin:0; line-height:inherit; color:inherit;
}
h1.thread-title { margin:0; }

/* 用户名配色：越高越"贵气" */
.uname { font-weight:600; }
.uname.u-lv-0 { color:#5b6673; }
.uname.u-lv-1 { color:#2f8a4e; }
.uname.u-lv-2 { color:#1f7fc4; }
.uname.u-lv-3 { color:#5a4bd6; }
.uname.u-lv-4 { color:#b8771f; }
.uname.u-lv-5 { color:#c9432b; }
.uname.u-lv-6, .uname.u-lv-7 {
  background:linear-gradient(92deg,#a97b1e,#d9a94a 38%,#f2d684 52%,#c8962b);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow:0 0 10px rgba(216,170,70,.22);
}
.uname.u-lv-7 { background:linear-gradient(92deg,#7c4ddb,#b47cf0 42%,#eedcff 58%,#9b5cf6); }
/* 管理员：金色流光 */
.uname.u-admin {
  background:linear-gradient(92deg,#b8332a,#e08a2e 42%,#f7cf4a 55%,#b8332a);
  background-size:220% 100%;
  -webkit-background-clip:text; background-clip:text; color:transparent;
  animation:uname-shine 4.5s linear infinite;
  text-shadow:0 0 12px rgba(224,138,46,.28);
}
@keyframes uname-shine { to { background-position:220% 0; } }
.uname.u-mod {
  background:linear-gradient(92deg,#0f8a8a,#2ac9c9);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}

/* ===== 名片 / 等级进度 ===== */
.idcard { display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap; }
.idcard-main { flex:1; min-width:220px; }
.idcard-name { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:18px; }
.idcard-bio  { margin-top:8px; color:#4a5568; font-size:13px; line-height:1.7; }
.lv-line { margin-top:8px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.lv-bar  { flex:1; min-width:110px; max-width:360px; height:7px; background:#e8edf3;
           border-radius:4px; overflow:hidden; }
.lv-bar i { display:block; height:100%; border-radius:4px;
            background:linear-gradient(90deg,#4a9ee0,#2f6fd0); }
.lv-txt { font-size:12px; color:var(--muted); }
.lv-legend { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }

/* 表单横排 + 说明文字 */
.form-inline { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.form-inline .input { flex:1; min-width:180px; max-width:320px; }
.hint { font-size:12px; color:var(--muted); margin-top:8px; line-height:1.75; }
.tag-pin    { background:var(--red);    color:#fff; font-size:11px; padding:1px 6px; border-radius:3px; margin-right:5px; }
.tag-digest { background:var(--orange); color:#fff; font-size:11px; padding:1px 6px; border-radius:3px; margin-right:5px; }
.tag-lock   { background:var(--muted);  color:#fff; font-size:11px; padding:1px 6px; border-radius:3px; margin-right:5px; }

/* ===== 公告 ===== */
.notice {
  background:#fffaf0; border:1px solid #feebc8; color:#744210;
  padding:10px 14px; border-radius:6px; margin-bottom:12px; font-size:13px;
}

/* ===== 帖子左右结构 ===== */
.post { display:flex; gap:14px; padding:16px 14px; border-bottom:1px solid var(--border); }
.post .post-side {
  width:88px; flex-shrink:0; text-align:center; font-size:13px; word-break:break-all;
}
.post .post-side a { display:block; margin-top:6px; font-weight:600; }
.post .body { flex:1; min-width:0; }
.post .floor { margin-top:10px; color:var(--muted); font-size:12px; }

/* ===== Markdown 正文 ===== */
.md-body { word-break:break-word; line-height:1.75; font-size:14px; }
.md-body p { margin:0 0 10px; }
.md-body h1,.md-body h2,.md-body h3 { margin:14px 0 8px; font-weight:700; }
.md-body h1 { font-size:20px; } .md-body h2 { font-size:17px; } .md-body h3 { font-size:15px; }
.md-body ul,.md-body ol { margin:0 0 10px 22px; }
.md-body li { margin:2px 0; }
.md-body blockquote {
  margin:10px 0; padding:8px 12px; border-left:4px solid var(--primary);
  background:var(--primary-light); color:#4a5568;
}
.md-body code {
  background:#f1f5f9; color:#c7254e; padding:1px 5px; border-radius:3px;
  font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace; font-size:13px;
}
.md-body pre {
  background:#1e2430; color:#e6edf3; padding:12px 14px; border-radius:6px;
  overflow-x:auto; margin:10px 0; line-height:1.6;
}
.md-body pre code { background:none; color:inherit; padding:0; font-size:13px; }
.md-body table { border-collapse:collapse; margin:10px 0; font-size:13px; width:auto; }
.md-body th,.md-body td { border:1px solid var(--border); padding:6px 10px; }
.md-body th { background:var(--primary-light); }
.md-body img { max-width:100%; height:auto; border-radius:6px; margin:6px 0; }
.md-body a { text-decoration:underline; }
.md-body hr { border:none; border-top:1px solid var(--border); margin:14px 0; }

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

/* ============================================================
   移动端适配：手机打开不再需要横向拉伸
   ============================================================ */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, table, pre, iframe, video { max-width: 100%; }

/* 平板 / 大手机 */
@media (max-width: 820px) {
  .container { flex-direction: column; gap:0; padding: 0 10px; margin: 12px auto; }
  .sidebar { width: 100%; }
  .cat-grid { grid-template-columns: 1fr; }

  /* 顶栏换行，搜索框独占一行（不再隐藏） */
  .topbar .inner { height:auto; flex-wrap:wrap; padding:8px 12px; gap:8px; row-gap:8px; }
  .topbar .search { order:3; flex:1 0 100%; max-width:none; margin:0; }
  .logo .name { font-size:17px; }
  .logo .slogan { font-size:11px; }
  .topbar .userbox { gap:10px; font-size:12px; flex-wrap:wrap; }

  /* 导航项很多：手机上直接换行铺开，不用横向滑动也能看全 */
  .navbar .inner { flex-wrap:wrap; padding:0 8px; row-gap:0; }
  .navbar a { padding:10px 11px; white-space:nowrap; font-size:13px; }

  /* 超宽通栏广告（比如 7040x576）按原比例在手机上会缩成一条细线，
     给它一个最小高度并按比例裁切显示中间部分，保证看得清 */
  .ad-slot img { width:100%; height:auto; min-height:52px; object-fit:cover; object-position:center; }

  /* 帖子：左右结构改上下 */
  .post { flex-direction:column; gap:8px; padding:12px 10px; }
  .post .post-side {
    width:100%; display:flex; align-items:center; gap:8px; text-align:left;
  }
  .post .post-side img.avatar-lg { width:34px !important; height:34px !important; }
  .post .post-side a { display:inline; margin-top:0; }
  .post .post-side .lvl { margin-top:0; }
  .thread-title { font-size:18px; }

  /* 列表 */
  .thread-row { padding:10px; gap:8px; }
  .thread-row .nums { width:52px; font-size:11px; }
  .thread-row .mid .title { font-size:13.5px; word-break:break-word; }

  /* 表格横向滚动，不再撑宽页面 */
  table.tbl { display:block; overflow-x:auto; white-space:nowrap; -webkit-overflow-scrolling:touch; }
  table.tbl th, table.tbl td { white-space:nowrap; }

  /* 广告：半宽位上下堆叠，图片铺满 */
  .ad-row { flex-direction:column; gap:12px; }
  .adzone-top, .adzone-bottom { padding-left:10px; padding-right:10px; }

  /* 统计卡两列、分页换行 */
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .pager { flex-wrap:wrap; }
  .ad-fields { grid-template-columns:1fr; }
  .buy-grid { gap:16px; }
  .buy-qr { max-width:none; }
  .md-body pre { font-size:12.5px; padding:10px 12px; }
  .footer { padding:16px 12px; }
}

/* 手机 */
@media (max-width: 520px) {
  .container { padding:0 8px; margin:10px auto; }
  .adzone-top, .adzone-bottom { padding-left:8px; padding-right:8px; }
  .logo .slogan { display:none; }
  .logo .mark { width:32px; height:32px; font-size:17px; }
  .topbar .userbox a { font-size:12px; }
  .logo { gap:8px; }

  .panel-head { padding:9px 11px; font-size:13.5px; }
  .panel-body { padding:10px 11px; }
  .thread-title { font-size:16.5px; }
  .md-body { font-size:13.5px; }
  .md-body h1 { font-size:18px; } .md-body h2 { font-size:16px; }

  .stat-cards { grid-template-columns: repeat(2, 1fr); gap:8px; }
  .stat-card { padding:12px; }
  .stat-card .num { font-size:20px; }

  /* iOS 聚焦输入框时不会自动放大页面 */
  .input, textarea.input, select.input { font-size:16px; }

  .cat-item { padding:10px; gap:10px; }
  .cat-item .icon { width:36px; height:36px; font-size:18px; }
  .cat-item .meta h3 { font-size:14px; }

  .btn { padding:8px 14px; font-size:13.5px; }
  .btn-sm { padding:5px 10px; font-size:12px; }

  .footer-links { font-size:12px; gap:8px; padding:9px 11px; }
  .link-list { grid-template-columns:1fr; }

  /* 后台按钮条换行 */
  .panel-head { flex-wrap:wrap; gap:6px; }
  .ad-card { padding:10px 11px; }
  .ad-card-head { gap:6px; }
  .msg-list li, .notice-list li { padding:9px 10px; }
  .bubble { max-width:86%; }

  .attach-item { flex-wrap:wrap; gap:6px; }
  .attach-item .mid { flex:1 1 100%; order:2; }
  .attach-item .ico { order:1; }
  .attach-item .price { order:3; margin-left:auto; }
  .attach-item a.btn, .attach-item form { order:4; }
}

/* 超窄屏 */
@media (max-width: 380px) {
  .stat-cards { grid-template-columns:1fr; }
  .topbar .userbox { gap:7px; font-size:11.5px; }
  .navbar a { padding:9px 10px; font-size:12.5px; }
}
