/* ============================================================
   MingList — 现代红蓝紫品牌体系
   蓝 = 主色（链接/导航/主按钮）  红 = 强调（价格/CTA）  紫 = 品牌标识（logo/后台）
   ============================================================ */

:root {
  /* 品牌三色 */
  --blue: #2563eb;
  --blue-deep: #1e40af;
  --blue-soft: #eff6ff;
  --red: #dc2626;
  --red-deep: #b91c1c;
  --red-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-deep: #6d28d9;
  --purple-soft: #f5f3ff;

  --link: #1d4ed8;
  --link-visited: #6d28d9;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-soft: #eef2f6;
  --text: #0f172a;
  --text-dim: #475569;
  --text-mute: #94a3b8;
  --green: #059669;
  --amber: #d97706;
  --radius: 8px;
  --maxw: 1080px;
  --mono: 'SF Mono', Monaco, 'Cascadia Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--link-visited); }

img { max-width: 100%; display: block; }

/* ---------- 布局骨架 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 12px; }

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  background-image: linear-gradient(90deg, var(--blue) 0%, var(--purple) 50%, var(--red) 100%);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: bottom;
}
header.site .bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  flex-wrap: wrap;
}
header.site .logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--blue-deep);
}
header.site .logo:visited { color: var(--blue-deep); }
header.site .logo:hover { text-decoration: none; }
header.site .logo .logo-mark { display: block; flex: none; }
header.site .logo .logo-accent { color: var(--red); }
header.site .spacer { flex: 1; }
header.site .navlink { font-size: 13px; white-space: nowrap; }

.langswitch { display: flex; gap: 4px; align-items: center; font-size: 12px; }
.langswitch button {
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
}
.langswitch button.on { background: var(--bg-alt); color: var(--text); font-weight: 600; }

.searchbar { padding: 8px 0 12px; }
.searchbar form { display: flex; gap: 6px; max-width: 640px; }

input[type=text], input[type=email], input[type=number], input[type=search],
select, textarea {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  width: 100%;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid #93c5fd;
  outline-offset: -1px;
  border-color: var(--blue);
}

button.btn, a.btn {
  font: inherit;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  display: inline-block;
}
button.btn:hover, a.btn:hover { background: #e2e8f0; text-decoration: none; }
button.btn.primary, a.btn.primary {
  background: var(--blue); border-color: var(--blue); color: #fff;
  font-weight: 600;
}
button.btn.primary:hover, a.btn.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
button.btn.danger { color: var(--red); border-color: #fecaca; }
button.btn.danger:hover { background: var(--red-soft); }
button.btn:disabled { opacity: .5; cursor: default; }
button.btn.sm, a.btn.sm { padding: 3px 9px; font-size: 12px; }

/* ---------- 首页：分类 × 地区矩阵 ---------- */
.hero { padding: 18px 0 6px; }
.hero h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.3px; }
.hero p.sub { color: var(--text-dim); margin: 0 0 14px; }

/* ---------- 首页：最新信息 ---------- */
.home-latest { margin: 26px 0 8px; }
.home-latest .hl-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border-soft); padding-bottom: 8px;
}
.home-latest h2 { font-size: 17px; margin: 0; letter-spacing: -0.2px; }
.home-latest .hl-more { font-size: 13px; white-space: nowrap; }
.home-latest .hl-list .postrow:last-child { border-bottom: none; }

.matrix { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; }

.catlist { border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.catlist .head {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-mute); padding: 8px 10px; background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
}
.catlist ul { list-style: none; margin: 0; padding: 6px 0; }
.catlist li a {
  display: block; padding: 4px 10px; font-size: 13px;
}
.catlist li a:hover { background: var(--bg-soft); text-decoration: none; }
.catlist li a .count { color: var(--text-mute); font-size: 11px; float: right; }

/* 地区矩阵：CL 的招牌样式 —— 多列紧凑列表 */
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 22px; }
.region-group .rg-title {
  font-size: 12px; font-weight: 700; color: var(--purple);
  border-bottom: 1px solid var(--border-soft); padding-bottom: 3px; margin-bottom: 5px;
}
.region-group ul { list-style: none; margin: 0; padding: 0; }
.region-group li { padding: 1px 0; }
.region-group li a { font-size: 12.5px; }

/* ---------- 列表页 ---------- */
.layout { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; padding: 16px 0 40px; }
.filters { font-size: 12.5px; }
.filters .fgroup { margin-bottom: 16px; }
.filters .fgroup h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-mute); margin: 0 0 6px;
}
.filters ul { list-style: none; margin: 0; padding: 0; }
.filters li { padding: 1.5px 0; }
.filters li a.on { font-weight: 700; color: var(--text); }
.filters form .row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.filters form label { min-width: 44px; color: var(--text-dim); }

.result-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; margin-bottom: 4px;
}
.result-head h2 { font-size: 16px; margin: 0; }
.result-head .count { color: var(--text-mute); font-size: 12px; }
.result-head .sortline { margin-left: auto; font-size: 12px; color: var(--text-dim); }

.postrow {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border-soft); align-items: flex-start;
}
.postrow:hover { background: var(--bg-soft); }
.postrow .thumb {
  width: 68px; height: 52px; flex: 0 0 68px; border-radius: 4px;
  object-fit: cover; background: var(--bg-alt); border: 1px solid var(--border-soft);
}
.postrow .meta { flex: 1; min-width: 0; }
.postrow .title { font-size: 15px; line-height: 1.35; }
.postrow .sub { color: var(--text-mute); font-size: 12px; margin-top: 2px; }
.postrow .right { text-align: right; padding-left: 8px; white-space: nowrap; }
.postrow .price { font-weight: 700; font-size: 14px; color: var(--red); }
.postrow .when { color: var(--text-mute); font-size: 11.5px; margin-top: 2px; }

.empty { padding: 40px 0; text-align: center; color: var(--text-mute); }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 20px 0; font-size: 13px; }
.pager a, .pager span, .pager button {
  padding: 4px 9px; border: 1px solid var(--border-soft); border-radius: 4px;
  font-size: 13px; font-family: inherit; background: var(--bg); color: var(--link);
}
.pager button { cursor: pointer; }
.pager button:hover { background: var(--bg-soft); text-decoration: none; }
.pager span.cur { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

/* ---------- 详情页 ---------- */
.post-detail { padding: 16px 0 48px; max-width: 760px; }
.post-detail h1 { font-size: 22px; margin: 0 0 6px; line-height: 1.3; }
.post-detail .price-big { font-size: 20px; font-weight: 700; color: var(--red); margin: 0 0 10px; }
.post-detail .crumb { font-size: 12px; color: var(--text-mute); margin-bottom: 10px; }
.post-detail .infobar {
  font-size: 12px; color: var(--text-dim); border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft); padding: 7px 0; margin-bottom: 14px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.post-detail .body { white-space: pre-wrap; font-size: 14px; line-height: 1.7; margin-bottom: 18px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.gallery a { border: 1px solid var(--border-soft); border-radius: 4px; overflow: hidden; }
.gallery img { width: 100%; height: 130px; object-fit: cover; }

.contactbox {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; background: var(--bg-soft); margin-bottom: 18px;
}
.contactbox h3 { margin: 0 0 4px; font-size: 14px; }
.contactbox p.note { color: var(--text-dim); font-size: 12px; margin: 0 0 12px; }
.contactbox .field { margin-bottom: 8px; }
.contactbox label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }

.relaybox {
  border: 1px solid #bfdbfe; background: #eef2ff; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; font-size: 12.5px;
}
.relaybox code {
  font-family: var(--mono); font-size: 12.5px; background: #fff;
  padding: 2px 6px; border-radius: 3px; border: 1px solid #bfdbfe;
  display: inline-block; margin-top: 4px; word-break: break-all;
}

/* ---------- 表单页 ---------- */
.formpage { max-width: 620px; padding: 18px 0 48px; }
.formpage h1 { font-size: 20px; margin: 0 0 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }
.field .hint { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; }
.field .err { font-size: 11.5px; color: var(--red); margin-top: 3px; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 18px; text-align: center; color: var(--text-mute);
  cursor: pointer; background: var(--bg-soft); font-size: 12.5px;
}
.dropzone:hover { border-color: var(--blue); color: var(--blue); }
.preview-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.preview-grid .p { position: relative; width: 84px; height: 84px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border-soft); }
.preview-grid .p img { width: 100%; height: 100%; object-fit: cover; }
.preview-grid .p button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff;
  cursor: pointer; font-size: 11px; line-height: 1; padding: 0;
}

/* ---------- 我的帖子 ---------- */
.myrow {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.myrow .m { flex: 1; min-width: 0; }
.myrow .acts { white-space: nowrap; }
.badge {
  display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 10px;
  background: var(--bg-alt); color: var(--text-dim); border: 1px solid var(--border-soft);
}
.badge.active { background: #e8f5e9; color: var(--green); border-color: #c8e6c9; }
.badge.closed { background: #fff3e0; color: var(--amber); border-color: #ffe0b2; }
.badge.removed { background: #fdecea; color: var(--red); border-color: #f5c6c2; }

/* ---------- 消息线程 ---------- */
.thread { border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.thread .thead {
  padding: 9px 12px; background: var(--bg-soft); border-bottom: 1px solid var(--border-soft);
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; cursor: pointer;
}
.thread .thead .who { font-weight: 600; font-size: 13px; }
.thread .thead .when { margin-left: auto; color: var(--text-mute); font-size: 11.5px; }
.thread .msgs { padding: 0; }
.msg { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.msg:last-child { border-bottom: none; }
.msg .mhead { font-size: 11.5px; color: var(--text-mute); margin-bottom: 3px; }
.msg.in { background: #fff; }
.msg.out { background: #f9fafb; }
.msg .mbody { white-space: pre-wrap; line-height: 1.6; }

/* ---------- 通用块 ---------- */
.card {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 16px; background: #fff; margin-bottom: 16px;
}
.notice {
  padding: 10px 12px; border-radius: var(--radius); font-size: 12.5px;
  border: 1px solid var(--border); background: var(--bg-soft); margin-bottom: 14px;
}
.notice.error { border-color: #f5c6c2; background: #fdecea; color: #8a1c13; }
.notice.ok { border-color: #c8e6c9; background: #e8f5e9; color: #1b5e20; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #111; color: #fff; padding: 9px 16px; border-radius: 6px;
  font-size: 13px; z-index: 999; opacity: 0; transition: opacity .2s;
  pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: 1; }

footer.site {
  border-top: 1px solid var(--border); margin-top: 30px; padding: 18px 0 40px;
  color: var(--text-mute); font-size: 12px;
}
footer.site a { color: var(--text-dim); }
footer.site .links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

.skeleton { background: linear-gradient(90deg,#f0f0f1 25%,#e6e6e8 37%,#f0f0f1 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 4px; }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

.usermenu { position: relative; display: inline-block; }
.usermenu .avatar-btn {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  display: inline-flex; align-items: center; line-height: 0; border-radius: 50%;
}
.usermenu .avatar-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.usermenu .avatar { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); vertical-align: middle; }
.usermenu .dropdown {
  display: none; position: absolute; right: 0; top: 30px; min-width: 190px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.1); z-index: 50; overflow: hidden;
}
.usermenu.open .dropdown { display: block; }
.usermenu .dropdown a, .usermenu .dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 12px; font: inherit;
  font-size: 13px; border: none; background: none; cursor: pointer; color: var(--text);
}
.usermenu .dropdown a:hover, .usermenu .dropdown button:hover { background: var(--bg-soft); text-decoration: none; }
.usermenu .dropdown .whoami { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); font-size: 12px; color: var(--text-dim); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .matrix, .layout { grid-template-columns: 1fr; }
  .regions { grid-template-columns: 1fr 1fr; }
  .postrow .thumb { width: 56px; height: 44px; flex-basis: 56px; }
  .grid2 { grid-template-columns: 1fr; }
  header.site .logo { font-size: 18px; }
}
@media (max-width: 420px) {
  .regions { grid-template-columns: 1fr; }
}

/* ---------- 管理后台 ---------- */
#adminTabs button { border-color: var(--border-soft); background: var(--bg-soft); color: var(--text-dim); }
#adminTabs button:hover { background: var(--bg-alt); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }

/* 举报卡片 */
.report-card { border-left: 3px solid var(--amber); }

/* 到期警示条 */
.notice.expiry-warn {
  border-color: #ffe0b2;
  background: #fff8e1;
  color: #8a5a00;
}

/* 表格化列表（管理后台）*/
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-mute); padding: 6px 8px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td { padding: 7px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.admin-table tr:hover td { background: var(--bg-soft); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .title-cell { max-width: 320px; }
.admin-table .title-cell a { font-size: 13.5px; }

@media (max-width: 760px) {
  .admin-table .hide-sm { display: none; }
}
