/* ============================================================
   社区服务网站 · 前台样式（Bootstrap 5.3 之上微调）
   ============================================================ */

:root {
  --brand: #0f766e;
  --brand-dark: #0b5e57;
  --brand-soft: #e6f4f2;
  --ink: #1f2933;
  --ink-soft: #5b6773;
  --line: #e6e9ee;
  --bg: #f6f8fa;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
}

/* ---------------- 导航 ---------------- */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  padding: 0.55rem 0;
}

.site-nav .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--ink);
  font-size: 1.05rem;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  letter-spacing: 0;
}

/* 后台「站点设置」上传的 LOGO：高度锁 36px，宽度按比例，避免大图把页头撑开 */
.brand-logo {
  max-height: 36px;
  max-width: 160px;
  width: auto;
  display: block;
  object-fit: contain;
}

.site-nav .nav-link {
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
  transition: all 0.15s;
}

.site-nav .nav-link:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.site-nav .nav-link.active {
  color: var(--brand);
  font-weight: 600;
  background: var(--brand-soft);
}

.btn-user {
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.btn-user:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.avatar-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}

.text-brand {
  color: var(--brand) !important;
}

/* ---------------- 通用块 ---------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.page-head h1,
.page-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.page-head .sub {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin: 0.25rem 0 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand);
}

.link-more {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.link-more:hover {
  color: var(--brand);
}

/* ---------------- 列表项 ---------------- */
.item-list {
  display: flex;
  flex-direction: column;
}

.item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 0;
  border-bottom: 1px dashed var(--line);
}

.item-row:last-child {
  border-bottom: 0;
}

.item-main {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-title:hover {
  color: var(--brand);
}

.item-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.tag-top {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  margin-right: 0.35rem;
}

/* ---------------- 活动 / 服务 / 设施卡片 ---------------- */
.grid-card {
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
}

.grid-card:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.1);
  transform: translateY(-2px);
}

.grid-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.grid-card .meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.price-tag {
  color: #b45309;
  font-weight: 700;
  font-size: 1.05rem;
}

.price-tag small {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

/* ---------------- 徽标 ---------------- */
.badge-soft {
  display: inline-block;
  font-size: 0.74rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.badge-ok {
  background: #dcfce7;
  color: #166534;
}

.badge-muted {
  background: #f1f5f9;
  color: #64748b;
}

/* ---------------- 详情 ---------------- */
.detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.8rem;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: 0.7rem;
}

.detail-meta {
  font-size: 0.84rem;
  color: var(--ink-soft);
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.4rem;
}

.detail-content {
  font-size: 0.96rem;
  line-height: 1.9;
  color: #374151;
  word-break: break-word;
}

.detail-content img {
  max-width: 100%;
  border-radius: 10px;
}

/* ---------------- 表单 ---------------- */
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  border-color: #dfe4ea;
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.required::after {
  content: ' *';
  color: #dc2626;
}

/* ---------------- 空态 / 骨架 ---------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.empty-icon {
  font-size: 2.2rem;
  opacity: 0.35;
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin: 0;
  font-size: 0.9rem;
}

/* 错误态与空态要一眼分得开：错误用红色感叹号，空态用灰色圆点 */
.empty-icon-error {
  color: #dc2626;
  opacity: 0.6;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-item {
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 37%, #eef1f5 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease infinite;
}

@keyframes sk {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ---------------- Toast ---------------- */
.ui-toast-wrap {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
}

.ui-toast {
  background: #1f2933;
  color: #fff;
  font-size: 0.88rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
  transition: opacity 0.3s, transform 0.3s;
  max-width: 88vw;
}

.ui-toast-ok {
  background: #0f766e;
}

.ui-toast-error {
  background: #b91c1c;
}

.ui-toast-hide {
  opacity: 0;
  transform: translateY(-8px);
}

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.pager button {
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.pager button:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.pager button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.pager button:disabled {
  opacity: 0.45;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: 3.5rem;
  padding: 2.4rem 0 1.2rem;
  font-size: 0.86rem;
}

.footer-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 0.6rem;
}

.footer-desc {
  color: #94a3b8;
  line-height: 1.8;
  margin: 0;
}

.footer-title {
  color: #e2e8f0;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 2;
}

.footer-links a {
  color: #94a3b8;
}

.footer-links a:hover {
  color: #5eead4;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  margin-top: 1.8rem;
  padding-top: 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.8rem;
}

/* ---------------- 登录页 ---------------- */
.auth-wrap {
  max-width: 420px;
  margin: 3rem auto;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}

.auth-card h1 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.auth-card .sub {
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin-bottom: 1.6rem;
}

/* ---------------- 个人中心 ---------------- */
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  text-align: center;
}

.stat-card b {
  display: block;
  font-size: 1.5rem;
  color: var(--brand);
  line-height: 1.2;
}

.stat-card span {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* 个人中心的统计卡可点击跳到对应 Tab，用视觉反馈说明它可点 */
.stat-card[data-goto] {
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.stat-card[data-goto]:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.nav-tabs .nav-link {
  border: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  border-radius: 9px;
  padding: 0.5rem 0.95rem;
}

.nav-tabs .nav-link.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.table > :not(caption) > * > * {
  padding: 0.7rem 0.6rem;
  font-size: 0.88rem;
}

.table thead th {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.82rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

/* ---------------- 小区 / 商铺 ---------------- */

.cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  background: var(--brand-soft);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand);
  background: linear-gradient(135deg, #e6f4f2, #cfe7e2);
  user-select: none;
}

/* 带封面的卡片：去掉内边距让图贴边，内容区自己补 */
.grid-card.has-cover {
  padding: 0;
  overflow: hidden;
}
.grid-card .card-body-pad {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.95rem 1.1rem 1.1rem;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.status-dot.is-open::before { background: #16a34a; }
.status-dot.is-rest::before { background: #f59e0b; }
.status-dot.is-renovation::before { background: #ea580c; }
.status-dot.is-closed::before { background: #dc2626; }

.meta-row {
  display: flex;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.65;
}
.meta-row + .meta-row { margin-top: 0.3rem; }
.meta-row .k { flex: 0 0 auto; color: #94a3b8; }
.meta-row .v { flex: 1 1 auto; word-break: break-all; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.filter-bar .form-select,
.filter-bar .form-control {
  width: auto;
  min-width: 8.5rem;
}
.filter-bar .spacer { flex: 1 1 auto; }

/* 平台下拉旁的互斥提示（「类目筛选只对淘宝生效」），显隐由 hidden 属性控制 */
.filter-hint {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.3;
}
.filter-hint[hidden] { display: none; }

.gallery-main {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}
.gallery-thumbs button {
  flex: 0 0 auto;
  width: 64px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: none;
  cursor: pointer;
}
.gallery-thumbs button.is-active { border-color: var(--brand); }
.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-box {
  width: 100%;
  height: 300px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f1f5f9;
}
.map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.map-fallback {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
}
.map-fallback-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.1rem;
}
.map-fallback-body { flex: 1 1 auto; min-width: 0; }
.map-fallback-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}
.map-fallback-tip {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}

.mini-shop {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.mini-shop:last-child { border-bottom: 0; }
.mini-shop .thumb {
  flex: 0 0 auto;
  width: 74px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-weight: 700;
}
.mini-shop .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-shop .info { flex: 1 1 auto; min-width: 0; }
.mini-shop .info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

/* ============================================================
   优惠好券（淘宝客）
   ============================================================ */

.coupon-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s;
}
.coupon-card:hover {
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.09);
  transform: translateY(-2px);
}

.coupon-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  overflow: hidden;
}
.coupon-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.coupon-thumb .cover-placeholder { font-size: 1.4rem; }

/* 券面额角标，压在商品图左上角 */
.coupon-flag {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 0.3rem 0.55rem;
  border-radius: 0 0 12px 0;
  background: linear-gradient(135deg, #f53f3f, #d92b2b);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(217, 43, 43, 0.25);
}
.coupon-flag .unit { font-size: 0.66rem; }
.coupon-flag .num { font-size: 1.02rem; }
.coupon-flag.is-soldout { background: linear-gradient(135deg, #9aa4b1, #78828f); }
/* 「省 X 元」是到手价差额，不是券：换成琥珀底，避免和真券的红底混为一谈 */
.coupon-flag.is-save {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.28);
}

/* 平台角标，压在商品图右上角；颜色由 Bootstrap 的 text-bg-* 决定（京东红 / 淘宝橙） */
.coupon-platform {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 0 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.18);
}

.coupon-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 0.75rem 0.85rem 0.9rem;
}
.coupon-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 0.35rem;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.coupon-title a { color: var(--ink); }
.coupon-shop {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coupon-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.coupon-price {
  color: #e0281f;
  font-weight: 700;
  font-size: 1.24rem;
  line-height: 1;
}
.coupon-price .unit {
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 1px;
}
.coupon-price-old {
  font-size: 0.76rem;
  color: #a8b0ba;
  text-decoration: line-through;
}
.coupon-sales {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-left: auto;
}

/* 券量进度条：只是把「还剩多少」可视化，不做倒计时催单 */
.coupon-stock {
  height: 5px;
  border-radius: 3px;
  background: #eef1f5;
  overflow: hidden;
  margin: 0.5rem 0 0.55rem;
}
.coupon-stock i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.coupon-actions {
  display: flex;
  gap: 0.4rem;
}
.coupon-actions .btn { flex: 1 1 auto; }

/* 详情页券条 */
.coupon-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff1f0, #ffe4e1);
  border: 1px dashed #f7b0ab;
  margin-bottom: 1rem;
}
.coupon-hero .amount {
  font-size: 1.9rem;
  font-weight: 800;
  color: #d92b2b;
  line-height: 1;
}
.coupon-hero .amount .unit { font-size: 1rem; font-weight: 600; }
.coupon-hero .info { flex: 1 1 auto; min-width: 0; }
.coupon-hero .info .k { font-size: 0.8rem; color: var(--ink-soft); }
.coupon-hero .info .v { font-size: 0.92rem; font-weight: 600; }

/* 淘口令：等宽 + 可整段选中，方便长按复制 */
.coupon-tpwd {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  font-size: 0.84rem;
  word-break: break-all;
}
.coupon-tpwd code {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.84rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.coupon-note {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.7;
}

.coupon-mini {
  display: flex;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.coupon-mini:last-child { border-bottom: 0; }
.coupon-mini .thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-weight: 700;
}
.coupon-mini .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.coupon-mini .info { flex: 1 1 auto; min-width: 0; }
.coupon-mini .info h4 {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .detail-card {
    padding: 1.2rem;
  }
  .form-card {
    padding: 1.2rem;
  }
  .filter-bar .form-select,
  .filter-bar .form-control {
    flex: 1 1 45%;
    min-width: 0;
  }
  .map-box {
    height: 220px;
  }
  .coupon-body {
    padding: 0.65rem 0.7rem 0.75rem;
  }
  .coupon-title {
    font-size: 0.84rem;
  }
  .coupon-price {
    font-size: 1.1rem;
  }
  .coupon-sales {
    display: none;
  }
  .coupon-hero .amount {
    font-size: 1.6rem;
  }
}

/* ---------------- 菜单：父节点「标题跳转 + 箭头展开」 ---------------- */
/* 标题与箭头是两个独立锚点：标题带真实 href 负责跳转，箭头只负责展开子菜单 */
.navbar-nav .nav-item.dropdown > .nav-link {
  white-space: nowrap;
}
.navbar-nav .dropdown-toggle-split {
  padding-left: 0.1rem;
  padding-right: 0.45rem;
  opacity: 0.7;
}
.navbar-nav .dropdown-toggle-split:hover,
.navbar-nav .dropdown-toggle-split:focus {
  opacity: 1;
}
.navbar-nav .dropdown-toggle-split::after {
  margin-left: 0;
  vertical-align: 0.15em;
}
/* 子项命中当前页时父节点也高亮，这里给下拉里的当前项一点视觉区分 */
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---------------- 内容中心（推荐产品 / 服务 / 消息） ---------------- */
.content-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.18s;
}
.content-card:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.1);
  transform: translateY(-2px);
}

/* 封面固定高度 + object-fit:cover，横竖图都不会把卡片撑变形 */
.content-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: var(--brand-soft);
}
.content-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 无图时塞进 UI.placeholder()：把默认的大留白压缩到封面高度内 */
.content-cover .empty-state {
  padding: 0.5rem;
}
.content-cover .empty-icon {
  font-size: 1.2rem;
  margin-bottom: 0.15rem;
}
.content-cover .empty-state p {
  font-size: 0.76rem;
}

.content-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.9rem 1rem 1rem;
}
.content-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 0.4rem;
}
.content-summary {
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0 0 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.content-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

/* 类型角标三色：消息（蓝）/ 产品（琥珀）/ 服务（绿） */
.content-badge {
  display: inline-block;
  font-size: 0.74rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand);
}
.content-badge-news {
  background: #e0f2fe;
  color: #0369a1;
}
.content-badge-product {
  background: #fef3c7;
  color: #b45309;
}
.content-badge-service {
  background: #dcfce7;
  color: #15803d;
}

/* 详情页封面与价格区块 */
.content-detail-cover {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: var(--brand-soft);
}
.content-price-box {
  margin-bottom: 1rem;
}

/* ============================================================
   广告位：首页轮播 / 详情页底部横幅 / 详情页侧边推荐
   配色沿用站点变量（--brand / --brand-soft / --line / --ink-soft）
   ============================================================ */

/* ---------------- 首页顶部轮播（position=home_top） ---------------- */
.banner-slide {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 260px;
  padding: 2.2rem 5.2rem 2.2rem 2.4rem;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  /* 无图时的兜底海报底色，有图时被 img 与遮罩盖住，不影响 */
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}
.banner-slide:hover,
.banner-slide:focus {
  color: #fff;
}

/* 无图卡片按索引轮换 3 套渐变，避免整个首页一片同色 */
.banner-fallback-0 {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}
.banner-fallback-1 {
  background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
}
.banner-fallback-2 {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}

.banner-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 半透明遮罩：图上压白字必须靠它，否则浅色图直接看不清 */
.banner-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.25) 100%);
}

.banner-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.6rem;
  max-width: 640px;
}
.banner-title {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.banner-sub {
  display: block;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
}
.banner-btn {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.42rem 1.15rem;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.18s;
}
.banner-slide:hover .banner-btn {
  background: var(--brand-soft);
}

/* 指示器与箭头收窄一点，别盖住文字 */
#banner-carousel .carousel-indicators {
  margin-bottom: 0.7rem;
}
#banner-carousel .carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  opacity: 0.55;
}
#banner-carousel .carousel-indicators .active {
  opacity: 1;
}
#banner-carousel .carousel-control-prev,
#banner-carousel .carousel-control-next {
  width: 3.4rem;
  opacity: 0.7;
}
#banner-carousel .carousel-control-prev:hover,
#banner-carousel .carousel-control-next:hover {
  opacity: 1;
}

@media (max-width: 575px) {
  .banner-slide {
    min-height: 200px;
    padding: 1.5rem 3.4rem 1.5rem 1.3rem;
  }
  .banner-title {
    font-size: 1.15rem;
  }
  .banner-sub {
    font-size: 0.84rem;
  }
}

/* ---------------- 详情页底部横幅（position=detail_bottom） ---------------- */
.ad-bottom {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.5rem;
  padding: 0.85rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.18s;
}
a.ad-bottom:hover {
  color: var(--ink);
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}
.ad-bottom-cover {
  flex: 0 0 auto;
  width: 104px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--brand-soft);
}
.ad-bottom-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 无图时左侧给一块渐变，而不是一个大空框 */
.ad-bottom-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.ad-bottom-body {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
}
.ad-bottom-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand);
}
.ad-bottom-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-bottom-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-bottom-btn {
  flex: 0 0 auto;
  padding: 0.36rem 0.95rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 575px) {
  .ad-bottom {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .ad-bottom-cover {
    width: 72px;
    height: 48px;
  }
  .ad-bottom-title,
  .ad-bottom-sub {
    white-space: normal;
  }
  .ad-bottom-btn {
    margin-left: auto;
  }
}

/* ---------------- 详情页侧边推荐（position=detail_side） ----------------
   定位思路：贴在「内容区右外侧的留白」里，绝不用 right:16px 硬贴屏幕边。
   Bootstrap 容器在 ≥1400px 时为 1320px 定宽居中，右边界 = 50% + 660px，
   所以面板从 calc(50% + 672px) 起（离内容 12px），宽 200px。
   这样只有视口 ≥1760px 才真正放得下：
      50% + 672 + 200 + 16(右侧留白) ≤ 100%
   →   视口 < 1760px 时整块 display:none。宁可不显示广告，也不能遮挡正文。
   （视口 1400~1759 时两侧留白不足 200px，任何「贴边」写法都会压住右栏内容。）
   ------------------------------------------------------------------------ */
.ad-side {
  position: fixed;
  top: 96px;
  left: calc(50% + 672px);
  width: 200px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding: 0.7rem 0.65rem 0.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  z-index: 1000;
}

@media (max-width: 1759px) {
  .ad-side {
    display: none !important;
  }
}

.ad-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0 0.15rem 0.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.45rem;
}
.ad-side-head-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.ad-side-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
.ad-side-close:hover,
.ad-side-close:focus-visible {
  background: #f1f5f9;
  color: var(--ink);
  outline: none;
}
.ad-side-close:focus-visible {
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.35);
}

.ad-side-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ad-side-item {
  display: block;
  padding: 0.5rem 0.5rem 0.5rem 0.6rem;
  border-left: 3px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s;
}
a.ad-side-item:hover {
  color: var(--ink);
  background: #f8fafc;
  border-left-color: var(--brand);
}
.ad-side-tone-0 {
  border-left-color: #0f766e;
}
.ad-side-tone-1 {
  border-left-color: #1d4ed8;
}
.ad-side-tone-2 {
  border-left-color: #b45309;
}
.ad-side-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
}
.ad-side-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.2rem;
  font-size: 0.74rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ============================================================
   单页（/about.html 等，统一由 public/page.html 渲染）
   ============================================================ */

.page-summary {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.8;
  margin: -0.6rem 0 1.2rem;
}

.page-updated {
  margin-top: 2rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: #94a3b8;
  font-size: 0.8rem;
}

/* 正文是后台富文本产出的 HTML，做不到逐项控样式，只能给基础排版兜住底 */
.page-body {
  font-size: 0.96rem;
  line-height: 1.9;
  color: #374151;
  word-break: break-word;
}
.page-body > :first-child {
  margin-top: 0;
}
.page-body > :last-child {
  margin-bottom: 0;
}
.page-body p {
  margin-bottom: 0.9rem;
  line-height: 1.9;
}
.page-body h2 {
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.8rem 0 0.75rem;
  padding-left: 0.6rem;
  border-left: 3px solid var(--brand);
  line-height: 1.5;
}
.page-body h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.4rem 0 0.6rem;
}
.page-body h4 {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.2rem 0 0.5rem;
}
.page-body ul,
.page-body ol {
  margin: 0 0 0.9rem;
  padding-left: 1.4rem;
}
.page-body li {
  margin-bottom: 0.35rem;
  line-height: 1.9;
}
.page-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}
.page-body blockquote {
  margin: 1.1rem 0;
  padding: 0.6rem 0.95rem;
  border-left: 3px solid var(--brand);
  background: #f8fafc;
  color: var(--ink-soft);
  border-radius: 0 8px 8px 0;
}
.page-body blockquote p:last-child {
  margin-bottom: 0;
}
.page-body a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-body hr {
  margin: 1.6rem 0;
  border-color: var(--line);
  opacity: 1;
}
.page-body table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.page-body th,
.page-body td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  text-align: left;
}
.page-body th {
  background: #f8fafc;
  font-weight: 600;
}

/* 侧栏单页导航 */
.page-nav-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.9rem;
}
.page-nav-list li + li {
  margin-top: 0.15rem;
}
.page-nav-list a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  transition: all 0.15s;
}
.page-nav-list a:hover {
  background: #f8fafc;
  color: var(--brand);
}
.page-nav-current {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 600;
}

/* ============================================================
   内容中心 · 动态类型按钮上的条数
   ============================================================ */
.type-tab-count {
  margin-left: 0.35rem;
  font-size: 0.72em;
  opacity: 0.72;
}

/* 自定义类型角标：后台可配类型后，news/product/service 之外的一律走这个灰底 */
.content-badge-custom {
  background: #f1f5f9;
  color: #475569;
}

/* ============================================================
   页脚「网站信息」（后台单页链接，接口回来才显示）
   ============================================================ */
.footer-pages {
  border-top: 1px solid #1e293b;
  margin-top: 1.4rem;
  padding-top: 0.9rem;
  text-align: center;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.8;
}
.footer-pages-label {
  color: #94a3b8;
  margin-right: 0.3rem;
}
.footer-pages a {
  color: #94a3b8;
}
.footer-pages a:hover {
  color: #5eead4;
}
.footer-pages-sep {
  margin: 0 0.45rem;
  color: #334155;
}
/* 与下面的版权行同属「次要信息」，两条分隔线挨太近会显得脏，这里收窄一次 */
.footer-pages + .footer-bottom {
  border-top: 0;
  margin-top: 0.75rem;
  padding-top: 0;
}



/* ============================================================
   首页 · 六宫格快捷入口
   仅首页使用，全部新类名，不污染其它页面
   ============================================================ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

@media (min-width: 992px) {
  .quick-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
  }
}

.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  transition: all 0.18s;
}

.quick-tile:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.1);
  transform: translateY(-2px);
  color: var(--brand);
}

.quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-icon svg {
  width: 21px;
  height: 21px;
  display: block;
}

.quick-label {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

/* ============================================================
   首页 · 公告软卡片
   只按 ID 作用域生效，不动全局 .item-list / .item-row
   ============================================================ */
#announcement-list {
  gap: 0.5rem;
}

#announcement-list .item-row {
  padding: 0.75rem 0.9rem;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
  border-bottom: 1px solid var(--line);
}

/* 覆盖全局 .item-row:last-child { border-bottom: 0 }，否则最后一张卡片少一条边 */
#announcement-list .item-row:last-child {
  border-bottom: 1px solid var(--line);
}

#announcement-list .item-row:hover {
  background: #f2f7f6;
}

/* ============================================================
   首页 · 活动横滑
   窄屏横向滚动 + 吸附，宽屏还原为三列网格
   ============================================================ */
.act-scroll {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.act-scroll::-webkit-scrollbar {
  height: 6px;
}

.act-scroll::-webkit-scrollbar-thumb {
  background: #d7dee5;
  border-radius: 3px;
}

.act-card {
  flex: 0 0 auto;
  width: min(78vw, 260px);
  scroll-snap-align: start;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  border-bottom: 1px solid var(--line);
}

/* 同上：覆盖 .item-row:last-child 的 border-bottom:0 */
.act-card:last-child {
  border-bottom: 1px solid var(--line);
}

.act-card .item-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.act-card .badge-soft {
  align-self: flex-start;
}

/* 空态/错误态是 UI.showEmpty() 塞进来的单个 .empty-state，
   骨架屏是 UI.skeleton() 塞进来的单个 .skeleton-list（内部已是竖向 flex）。
   横滑容器是横向 flex，这两个「整块占位」会被当成一个窄 flex item 缩起来，
   这里显式让它们撑满一行，加载中与空数据时的样子和原来的纵向列表一致。 */
.act-scroll .empty-state {
  flex: 1 0 100%;
}

.act-scroll .skeleton-list {
  flex: 1 0 100%;
}

@media (min-width: 992px) {
  .act-scroll {
    overflow: visible;
    scroll-snap-type: none;
    /* 必须换行：宽屏关掉了 overflow-x，若还走单行 flex，
       活动超过 3 条就会直接横向溢出卡片外（当前库里正好 3 条，测不出来） */
    flex-wrap: wrap;
  }
  .act-card {
    width: calc(33.333% - 0.54rem);
  }
}

/* ---------------- 底部导航（移动端） ---------------- */
.bottom-nav { display: none; }

@media (max-width: 991.98px) {
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -1px 6px rgba(16, 24, 40, .06);
    padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom, 0px));
  }
  .bottom-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: .3rem 0; font-size: .72rem; color: var(--ink-soft); font-weight: 600;
  }
  .bottom-tab svg { width: 22px; height: 22px; }
  .bottom-tab.is-active { color: var(--brand); }
  body { padding-bottom: 72px; }
}

/* ============================================================
   二手交易（列表价格 / 详情卖家 / 我的发布缩略图）
   ============================================================ */

/* 类型角标（出租 / 求租 / 求购 / 赠送）：出售是默认语义，不挂角标。
   刻意不复用 .coupon-flag 的红底 —— 那是「券」的视觉语义，这里用品牌色区分 */
.trade-kind-flag {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.28rem 0.5rem;
  border-radius: 0 0 12px 0;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

/* 价格单位：'元' 不重复显示，'元/月' 只留 '/月' */
.trade-unit {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-left: 0.15rem;
}

/* 求购 / 求租允许不填价格，0 元不要显示成「¥0.00」 */
.trade-price-ask {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

/* 详情页右侧价格区 */
.trade-price-block {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.trade-price-now {
  color: #e0281f;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
}
.trade-price-now .unit {
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 1px;
}

/* 卖家头像：无头像时显示昵称首字 */
.trade-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.trade-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 我的发布：表格里的缩略图 */
.trade-row-thumb {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  flex: 0 0 auto;
}
.trade-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.trade-row-thumb .cover-placeholder {
  font-size: 0.9rem;
}

/* ============================================================
   多图上传组件（assets/upload.js）
   ============================================================ */

.uploader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.5rem;
}

.uploader-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
}
.uploader-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 没有本地预览时（如极端浏览器的 object URL 失败）用文字占位，别留白块 */
.uploader-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  color: #94a3b8;
}
.uploader-item.is-error {
  border-color: #e0281f;
}

/* 上传中 / 失败遮罩：压在图片上，失败的那张要一眼能认出来 */
.uploader-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.uploader-mask.is-error {
  background: rgba(224, 40, 31, 0.86);
  color: #fff;
}

.uploader-spin {
  width: 14px;
  height: 14px;
  border: 2px solid #d7dee6;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: uploader-spin 0.8s linear infinite;
}
@keyframes uploader-spin {
  to { transform: rotate(360deg); }
}

.uploader-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 24, 40, 0.62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.uploader-del:hover { background: rgba(16, 24, 40, 0.82); }

/* 失败重试：贴着底部，不挡删除按钮 */
.uploader-retry {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.12rem 0;
  border: 0;
  background: rgba(224, 40, 31, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.uploader-add {
  aspect-ratio: 1 / 1;
  border: 1px dashed #c9d2dd;
  border-radius: 10px;
  background: #fbfcfd;
  color: #8b98a6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.74rem;
  cursor: pointer;
}
.uploader-add:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.uploader-add-icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* 拖拽到容器上时的整体高亮 */
.uploader.is-dragover .uploader-add {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.uploader-tip {
  margin-top: 0.45rem;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

/* ---------- 零、主按钮的 disabled 态颜色（走查中发现） ---------- */
/* 本文件顶部的 .btn-primary 只覆盖了 --bs-btn-bg / -hover- / -active-，
   漏了 disabled 三个变量。Bootstrap 的 .btn.disabled 用的正是
   --bs-btn-disabled-bg，于是「导出 CSV」这类加载过程中被禁用的主按钮
   会跳回 Bootstrap 默认蓝 #0d6efd，在满屏品牌青绿里非常突兀。
   只补 disabled 态，正常 / 悬停 / 按下三态完全不受影响。 */
.btn-primary {
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-disabled-color: #fff;
}

/* ============================================================
   上线前收尾：移动端触控可达性 / 小屏排版修正
   ------------------------------------------------------------
   问题：全站样式 = Bootstrap 5.3 + 本文件。Bootstrap 的紧凑尺寸是按
   鼠标指针设计的 —— .btn-sm 实测只有 31px 高、分页按钮 38px、
   首页轮播圆点 8px。这些在手指下必然误触（Apple HIG 与 Material
   都把最小点击区定在 44px）。

   为什么统一追加在文件末尾，而不是改前面散落的 @media：
   1) 前面已有 @media 768px / 575px / 991.98px 三处，逐处追加改动点
      分散、容易漏；
   2) 媒体查询之间、特异性相同时由「源序靠后者胜出」，放在末尾即可
      稳定覆盖前面所有规则，不必靠 !important 硬压；
   3) 集中成一块，将来整段删改只需动一个位置。

   断点用 767.98px 而不是 768px：Bootstrap 5 的 md 断点是 768px，
   767.98 与 .container / .col-md-* 的切换点严格对齐，不会出现
   「容器已按手机排版、触控规则却没生效」的 0.02px 空档。

   作用域严格限制在小屏 —— PC 上的紧凑排版是刻意的，一律不动。
   ============================================================ */

/* ---------- 一、底部导航的安全区占位 ---------- */
/* .bottom-nav 自身的 padding-bottom 已经带了 env(safe-area-inset-bottom)，
   但 body 为它预留的 72px 是个常量。在有 Home 指示条的机型上导航实际高度
   ≈ 51(项) + 7(内边距) + 34(安全区) ≈ 92px，超出的 20px 会把页面最后一屏
   内容永久压在导航下面（表现为「底部内容滚不出来」）。
   这里让占位跟着安全区一起长，两者始终相等。
   断点沿用原规则所在的 991.98px，避免 768~991 区间（手机横屏）漏掉。 */
@media (max-width: 991.98px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 767.98px) {
  /* ---------- 二、44px 最小点击区：按钮 ---------- */
  /* 覆盖 .btn 的全部变体（-sm / -primary / -outline-* / -link / -secondary）。
     Bootstrap 用竖向内边距撑高度，.btn-sm 只有 31px。
     改成 inline-flex + 居中：文字始终垂直居中，窄容器里折成两行也不会
     把按钮压回 31px；min-height 只兜下限，原来更高的按钮不受影响。
     注：.btn-link（二手详情页的「举报」）是纯文本动作，这里只加高度与居中，
     不加边框背景，视觉上仍是一个文字链接。 */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  /* 页头操作组：.page-head 是 space-between 的两栏 flex，标题栏的 .sub 文案
     很长，会把右侧按钮压到 47px 宽，「+ 发布求助」被折成三行。
     让它整组换行后按自身文字宽度排版，按钮不再变形。 */
  .page-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .page-head .btn {
    white-space: nowrap;
  }

  /* 汉堡按钮：Bootstrap 默认 40px 高，差一点点，一并对齐到 44 */
  .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
  }

  /* ---------- 三、44px 最小点击区：底部导航 ---------- */
  /* 现有 .bottom-tab 实测 51px，本来就够；这里显式钉死 44px 下限，
     防止将来有人调小字号/图标时把可达性又改回去。
     justify-content: center 让图标+文字整体在项内垂直居中。 */
  .bottom-tab {
    min-height: 44px;
    justify-content: center;
  }

  /* ---------- 四、44px 最小点击区：分页 ---------- */
  /* 原 38×38。「上一页 / 下一页」有文字会自己变宽，数字页保持 44 方框。 */
  .pager button {
    min-width: 44px;
    min-height: 44px;
    height: auto;
  }

  /* ---------- 五、44px 最小点击区：筛选栏与表单 ---------- */
  /* 筛选栏在 768px 以下已经是 flex:1 1 45% 的两列布局（见文件前部的
     @media (max-width: 768px)），这套行为保留，这里只抬行高。
     表单控件一并抬到 44px：发布 / 报修 / 登录等表单在手机上才是主要输入场景。 */
  .filter-bar .form-select,
  .filter-bar .form-control,
  .filter-bar .btn {
    min-height: 44px;
  }

  .form-control,
  .form-select,
  textarea,
  input:not([type='hidden']):not([type='checkbox']):not([type='radio']) {
    min-height: 44px;
    /* iOS Safari 在聚焦字号 < 16px 的输入框时会自动放大整个页面，
       这是手机上「点了输入框页面突然跳大」的最常见原因。
       直接写 16px 而不是 max(16px, 1em)：max() 在 font-size 里对 em
       的求值依赖父级字号，容易在 .form-control-sm 上算回 14px 而失效。 */
    font-size: 16px;
  }

  /* ---------- 六、44px 最小点击区：卡片内的小操作链接 ---------- */
  /* 「查看全部 ›」实测 20.6px。给 44px 点击区但用等量负边距把占位还回去，
     所在 section 头的高度与视觉位置完全不变（负边距上下对称，flex 的
     align-items:center 仍把文字放在行中线）。 */
  .link-more {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: -0.55rem;
    margin-bottom: -0.55rem;
  }

  /* 首页轮播圆点：视觉仍是 8px 的圆，但用 ::after 叠出 44px 高的透明点击区。
     ::after 是绝对定位，不参与布局，所以圆点位置与间距一点不动。
     宽度只放到 12px（圆点中心相距 14px），再宽就会和相邻圆点的点击区重叠，
     反而会点错 —— 横向的精确选择交给两侧 54px 宽的箭头。 */
  #banner-carousel .carousel-indicators [data-bs-target] {
    position: relative;
  }
  #banner-carousel .carousel-indicators [data-bs-target]::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 44px;
    transform: translate(-50%, -50%);
  }

  /* 多图上传的删除按钮：20×20，压在缩略图右上角，手指几乎点不中。
     用 ::after 把点击区扩到约 46×46（绝对定位，不影响格子布局）。
     刻意不对称：按钮本身距格子边缘只有 2px，向上/向右扩再多也会被
     .uploader-item 的 overflow:hidden 裁掉，所以只各留 2px，
     把余量全部向左/向下（压进图片区）展开。
     纵向延伸到 46px 仍不与底部「重试」条重叠（格子 ≥84px，重试在最底部）。 */
  .uploader-del::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    bottom: -24px;
    left: -24px;
  }

  /* ---------- 七、长文本防溢出（兜底） ---------- */
  /* 本轮实测 390px 下全站 43 个地址（34 页 + 9 个深链）scrollWidth 全部
     等于 390，没有溢出。但详情页标题现在都是短中文，将来出现长 URL、
     连续英文串或长数字时 .detail-title 没有断行点，会撑破卡片。
     这里补一条只会「在需要时换行」的规则，不改变任何现有排版。 */
  .detail-title {
    overflow-wrap: anywhere;
  }
}

/* ============================================================
   沟通页（trade-chat.html）
   左会话列表 + 右消息面板；窄屏一次只显示一栏，靠 data-view 切换
   ============================================================ */

.chat-wrap {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.chat-list,
.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.chat-list-head {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.chat-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chat-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.chat-tabs button.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.chat-filter {
  line-height: 1.5;
}

.chat-thread-list {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* 会话条目：整块可点，别只在标题上做链接 */
.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.chat-item:last-child {
  border-bottom: 0;
}

.chat-item:hover {
  background: #f8fafb;
}

.chat-item.is-active {
  background: var(--brand-soft);
}

.chat-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-item-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item-time {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.chat-item-peer {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.chat-item-last {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 未读数：红点带数字，超过 99 显示 99+ */
.chat-unread {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e0281f;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.chat-panel-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.chat-panel-title {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-peer-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.chat-notice {
  padding: 0.5rem 0.9rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.chat-panel-body {
  flex: 1 1 auto;
  min-height: 320px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 0.9rem;
  background: #fbfcfd;
}

.chat-msgs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* 气泡：自己靠右主色，对方靠左浅底 */
.chat-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 82%;
}

.chat-msg.is-mine {
  align-items: flex-end;
  margin-left: auto;
}

.chat-bubble {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.chat-msg.is-mine .chat-bubble {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.chat-mobile {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.chat-time {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-compose textarea {
  resize: none;
  /* Bootstrap .form-control 是 width:100%，放进 flex 行里会把按钮挤出去 */
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.chat-compose .btn {
  flex: 0 0 auto;
}

@media (max-width: 991.98px) {
  .chat-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 窄屏一次只显示一栏：默认列表，点进会话切到面板 */
  .chat-wrap[data-view="list"] .chat-panel {
    display: none;
  }

  .chat-wrap[data-view="chat"] .chat-list {
    display: none;
  }

  .chat-panel-body {
    /* 窄屏不锁最大高度：会话长就让页面滚，输入区靠下面的 sticky 抱住。
       min-height 只保证「空会话」时面板不至于太矮，给 30vh 就够。 */
    min-height: 30vh;
    max-height: none;
  }

  /* 输入区吸在底部导航之上：消息一多页面会被撑长，
     不吸住的话输入框会被底部导航盖住，得先滚到底才能打字。
     .chat-panel 的 overflow:hidden 会把 sticky 关进卡片里，这里放开。 */
  .chat-panel {
    overflow: visible;
  }

  .chat-compose {
    position: sticky;
    bottom: 72px;
    z-index: 2;
    border-radius: 0 0 14px 14px;
  }

  /* 页签是纯文字的胶囊，默认高度只有 26px，手指不好点 */
  .chat-tabs button {
    min-height: 44px;
    padding: 0 0.9rem;
  }
}

@media (min-width: 992px) {
  /* 桌面两栏常驻，不需要「返回列表」 */
  .chat-back {
    display: none;
  }
}
