/* =============================================================
   前台样式
   - 设计基调：暖橙色主色 + 浅灰底 + 白色卡片，贴近国内分类信息站习惯
   - 断点：960px（平板）、720px（手机）、480px（小屏手机）
   ============================================================= */

:root {
  --brand: #f5602a;
  --brand-2: #ff8f4d;
  --brand-dark: #d9491a;
  --brand-soft: #fff1ea;
  --price: #ff3b30;
  --ink: #1f2430;
  --ink-2: #3d4553;
  --muted: #737c8c;
  --muted-2: #9aa3b2;
  --line: #eceff3;
  --line-2: #dfe4ea;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-2: 0 10px 30px -18px rgba(16, 24, 40, 0.28);
  --shadow-3: 0 24px 60px -30px rgba(16, 24, 40, 0.4);
  --container: 1200px;
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ---------------------------- 基础重置 ---------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.35;
  font-weight: 700;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 3px solid rgba(245, 96, 42, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 999;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}

.skip-link:focus {
  left: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------- 通用布局 ---------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
  padding-bottom: 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.section-more {
  font-size: 13px;
  color: var(--muted);
}

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

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.nowrap {
  white-space: nowrap;
}

/* ---------------------------- 顶部信息条 ---------------------------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.topbar-inner {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar a:hover {
  color: var(--brand);
}

/* ---------------------------- 站点头部 ---------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 19px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px -8px rgba(245, 96, 42, 0.8);
}

.logo-text strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0.2px;
}

.logo-text span {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.2;
}

.search-form {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(245, 96, 42, 0.12);
  background: #fff;
}

.search-form input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 0;
  outline: none;
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.link-muted {
  color: var(--muted);
  font-size: 14px;
}

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

/* ---------------------------- 按钮 ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg);
  color: var(--ink-2);
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(245, 96, 42, 0.9);
}

.btn-primary:hover {
  box-shadow: 0 14px 26px -12px rgba(245, 96, 42, 0.95);
}

.btn-outline {
  background: #fff;
  border-color: var(--line-2);
  color: var(--ink-2);
}

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

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--ink);
}

.btn-danger {
  background: #fff;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* ---------------------------- 大栏目导航 ---------------------------- */
.category-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-item.is-active .nav-link {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--brand-soft);
}

/* 悬停展开的子栏目面板 */
.nav-panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 420px;
  max-width: min(680px, 90vw);
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-2);
  display: none;
  z-index: 70;
}

.nav-item:hover .nav-panel,
.nav-item:focus-within .nav-panel {
  display: block;
}

.nav-panel-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px 8px;
}

.nav-panel-link {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
}

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

.nav-count {
  font-size: 11px;
  color: var(--muted-2);
}

.nav-mobile-toggle {
  display: none;
}

/* ---------------------------- 首页横幅 ---------------------------- */
.hero {
  margin-top: 20px;
  padding: 30px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(120deg, #ff7a3d 0%, #f5602a 45%, #e04a1c 100%);
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.hero h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.hero p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.hero-actions .btn {
  background: #fff;
  color: var(--brand-dark);
}

.hero-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* ---------------------------- 分类卡片区 ---------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.category-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 96, 42, 0.35);
  box-shadow: var(--shadow-2);
}

.category-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: var(--brand-soft);
}

.category-card-head strong {
  font-size: 16px;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.chip:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(245, 96, 42, 0.3);
}

.chip.is-active {
  background: var(--brand);
  color: #fff;
}

/* ---------------------------- 信息列表 ---------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--radius-pill);
}

.filter-tab {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.filter-tab.is-active {
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-1);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 96, 42, 0.35);
  box-shadow: var(--shadow-2);
}

.post-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f2f4f7, #e8ecf1);
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 26px;
  overflow: hidden;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-thumb img {
  transform: scale(1.04);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.badge-featured {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #ff4d2d, #ff8a3d);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(255, 77, 45, 0.9);
}

.post-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.post-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.post-summary {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.price {
  color: var(--price);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.2px;
}

.price small {
  font-size: 12px;
  font-weight: 600;
}

.post-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: auto;
}

/* 列表视图（栏目页使用） */
.post-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-row {
  display: grid;
  grid-template-columns: 168px 1fr auto;
  gap: 16px;
  padding: 14px;
  align-items: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.post-row:hover {
  border-color: rgba(245, 96, 42, 0.35);
  box-shadow: var(--shadow-2);
}

.post-row-thumb {
  width: 168px;
  height: 118px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #f2f4f7, #e8ecf1);
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 24px;
}

.post-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-row-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.post-row-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  min-width: 120px;
}

/* ---------------------------- 分页 ---------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 14px;
  color: var(--ink-2);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.page-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------------------------- 面包屑 ---------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0 0;
  flex-wrap: wrap;
}

.breadcrumb a:hover {
  color: var(--brand);
}

/* ---------------------------- 详情页 ---------------------------- */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  margin-top: 12px;
}

.detail-main {
  padding: 22px;
}

.detail-title {
  font-size: 23px;
  margin-bottom: 10px;
  word-break: break-word;
}

.detail-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-price-bar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, #fff5f1, #fff9f5);
  border: 1px solid #ffe2d5;
}

.gallery {
  display: grid;
  gap: 10px;
  margin: 18px 0 8px;
}

.gallery-main {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  max-height: 440px;
}

.gallery-main img {
  max-height: 440px;
  width: auto;
  object-fit: contain;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-thumb {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg);
  padding: 0;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb.is-active {
  border-color: var(--brand);
}

.detail-content {
  margin-top: 20px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.contact-card {
  padding: 20px;
}

.contact-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.contact-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.contact-line:last-of-type {
  border-bottom: 0;
}

.contact-line span:first-child {
  color: var(--muted);
}

.contact-line span:last-child {
  font-weight: 700;
  word-break: break-all;
  text-align: right;
}

.side-list {
  padding: 16px;
}

.side-post {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.side-post:last-child {
  border-bottom: 0;
}

.side-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  place-items: center;
  color: var(--muted-2);
}

.side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-title {
  font-size: 14px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 图片灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 16, 24, 0.88);
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox img {
  max-width: 100%;
  max-height: 84vh;
  border-radius: 10px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

/* ---------------------------- 表单 ---------------------------- */
.form-card {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.span-2 {
  grid-column: span 2;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.field .required {
  color: var(--danger);
  margin-left: 2px;
}

.field-hint {
  font-size: 12.5px;
  color: var(--muted-2);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(245, 96, 42, 0.12);
}

.textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.7;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23737c8c' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.price-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.price-input-group .select {
  max-width: 130px;
}

.error-text {
  font-size: 12.5px;
  color: var(--danger);
  min-height: 18px;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.12);
}

/* 图片上传 */
.uploader {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-sm);
  padding: 18px;
  background: #fbfcfd;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.uploader.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.uploader-icon {
  font-size: 26px;
}

.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.preview-item {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------------------------- 状态提示 ---------------------------- */
.empty-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state .emoji {
  font-size: 40px;
  margin-bottom: 8px;
}

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid transparent;
}

.alert-warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.alert-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 37%, #eef1f5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 8px;
}

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

/* ---------------------------- 页脚 ---------------------------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 28px 0 22px;
  color: var(--muted);
  font-size: 13.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
}

.footer-grid h4 {
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links a:hover {
  color: var(--brand);
}

.footer-bottom {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted-2);
}

/* ---------------------------- 提示条 / 弹窗 ---------------------------- */
.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}

.toast {
  background: rgba(24, 30, 42, 0.94);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  box-shadow: var(--shadow-3);
  animation: toast-in 0.2s ease-out;
  max-width: 100%;
}

.toast.is-ok {
  background: #15803d;
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-host {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(15, 20, 30, 0.5);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-host[hidden] {
  display: none;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  box-shadow: var(--shadow-3);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.icon-btn {
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--ink);
}

/* ---------------------------- 响应式 ---------------------------- */
@media (max-width: 960px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .post-row {
    grid-template-columns: 130px 1fr;
  }

  .post-row-thumb {
    width: 130px;
    height: 100px;
  }

  .post-row-side {
    grid-column: span 2;
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    justify-content: space-between;
    border-top: 1px dashed var(--line);
    padding-top: 10px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 58px;
  }

  body {
    font-size: 14.5px;
  }

  .topbar {
    display: none;
  }

  .header-inner {
    gap: 10px;
  }

  .logo-text span {
    display: none;
  }

  .search-form {
    padding-left: 12px;
  }

  .header-actions .link-muted {
    display: none;
  }

  /* 移动端分类导航改为横向滚动 + 抽屉式全部分类 */
  .nav-mobile-toggle {
    display: inline-flex;
  }

  .nav-list {
    display: none;
  }

  .nav-list.is-open {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 0 14px;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 11px 4px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
    justify-content: space-between;
  }

  .nav-item.is-active .nav-link {
    border-bottom-color: var(--line);
    border-left-color: var(--brand);
  }

  .nav-panel {
    position: static;
    display: block;
    min-width: 0;
    max-width: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 8px 0 12px 12px;
    background: #fafbfc;
  }

  .hero {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .hero h1 {
    font-size: 21px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .post-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .post-body {
    padding: 10px 12px 12px;
  }

  .post-summary {
    display: none;
  }

  .post-title {
    font-size: 14.5px;
  }

  .detail-main {
    padding: 16px;
  }

  .detail-title {
    font-size: 19px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .logo-text strong {
    font-size: 15.5px;
  }

  .post-row {
    grid-template-columns: 104px 1fr;
    gap: 12px;
    padding: 10px;
  }

  .post-row-thumb {
    width: 104px;
    height: 82px;
  }

  .price {
    font-size: 15.5px;
  }
}

/* 打印与减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
