/* 海大闲置信息墙 */

:root {
  --orange: #0876bb;
  --orange-dark: #075489;
  --orange-soft: #eaf6ff;
  --ink: #102f48;
  --ink-2: #38566b;
  --muted: #657e91;
  --line: #d9e7f0;
  --card: #ffffff;
  --bg: #f4f9fc;
  --green: #1a9c63;
  --red: #c8392d;
  --blue: #2a6db0;
  --gold: #d4a017;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(12, 55, 86, .08);
  --shadow-lg: 0 8px 24px rgba(12, 55, 86, .14);
  --font: "PingFang SC", "Microsoft YaHei UI", system-ui, -apple-system, "Segoe UI", sans-serif;
  --docs-sidebar-width: 248px;
  --docs-sidebar-bg: var(--card);
  --docs-content-bg: var(--card);
  --docs-border: var(--line);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; padding-bottom: 40px; }

.site-footer { text-align: center; padding: 24px 18px 8px; color: var(--muted); font-size: 12px; }
.site-footer p { margin-bottom: 3px; }
.site-footer a { display: inline-block; color: var(--ink-2); }
.site-footer a[hidden] { display: none; }
.registration-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 16px; max-width: 100%; overflow-wrap: anywhere; }
.registration-links a, .registration-links span { min-width: 0; }
.mail-captcha { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mail-captcha img { width: 180px; height: 58px; border-radius: 8px; border: 1px solid var(--line); background: #eaf6ff; }
.mail-captcha input { flex: 1 1 160px; min-width: 0; max-width: 240px; text-transform: uppercase; }

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

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

h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.35; font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 10px; }

.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.center { text-align: center; }

/* ============ 顶部导航 ============ */
header.topbar {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.topbar-inner {
  width: min(1220px, 94vw);
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.brand {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon { width: 34px; height: 34px; object-fit: cover; border-radius: 7px; background: #fff; }
.brand-name { display: inline-block; }
.admin-users-scroll { overflow-x: auto; }
.admin-users-scroll table { min-width: 750px; }
.admin-user-actions { min-width: 205px; }
.admin-user-actions .btn { margin: 2px; }
.brand:hover { text-decoration: none; }

.topnav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.topnav > a {
  color: #dfe5ec;
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 5px;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.topnav > a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.topnav > a.active { background: var(--orange); color: #fff; font-weight: 600; }

.topnav .badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  background: var(--orange);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  text-align: center;
  line-height: 18px;
  vertical-align: 1px;
}
.topnav > a.active .badge { background: rgba(0, 0, 0, .28); }

.searchbar {
  display: flex;
  gap: 6px;
  flex: 0 1 300px;
  min-width: 120px;
  max-width: 360px;
}
.searchbar input {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  outline: none;
  font-family: var(--font);
}
.searchbar input::placeholder { color: rgba(255, 255, 255, .5); }
.searchbar input:focus { border-color: var(--orange); background: rgba(255, 255, 255, .18); }
.searchbar button {
  border: 0;
  border-radius: 9px;
  padding: 7px 14px;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  flex: none;
}

#user-slot { flex: none; min-width: 0; }

/* 用户菜单 */
.usermenu { position: relative; }
.usermenu > button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 14px;
  font-family: var(--font);
}
.usermenu > button:hover { background: rgba(255, 255, 255, .1); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink-2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.avatar.lg { width: 62px; height: 62px; font-size: 22px; }
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  padding: 7px;
  display: none;
  z-index: 100;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
  text-decoration: none;
}
.dropdown a:hover, .dropdown button:hover { background: var(--orange-soft); text-decoration: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* 移动端抽屉按钮 */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  border-radius: 9px;
}
.menu-toggle:hover { background: rgba(255, 255, 255, .1); }
.menu-toggle:focus-visible, .searchbar input:focus-visible, .searchbar button:focus-visible,
.topnav > a:focus-visible, .btn:focus-visible, .icon-btn:focus-visible {
  outline: 3px solid rgba(244, 125, 32, .45);
  outline-offset: 2px;
}

/* ============ 布局 ============ */
main {
  width: min(1220px, 94vw);
  margin: 26px auto 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: none;
  margin-bottom: 16px;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.gap-sm { gap: 8px; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }

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

.layout-side {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 22px;
  align-items: start;
}

/* ============ 按钮 ============ */
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font);
  text-decoration: none;
  transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

.btn.secondary { background: #edf0f3; color: var(--ink-2); }
.btn.outline { background: #fff; color: var(--orange-dark); border: 1.5px solid var(--orange); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #edf0f3; color: var(--ink); }
.btn.danger { background: var(--red); }
.btn.green { background: var(--green); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.back-button { margin-bottom: 14px; border: 1px solid var(--line); font-weight: 700; }

/* ============ 表单 ============ */
.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.form label.full { grid-column: 1 / -1; }
.form > .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font);
  background: #fff;
  color: var(--ink);
  outline: none;
  width: 100%;
  font-weight: 400;
}
.form input:focus, .form select:focus, .form textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(244, 125, 32, .13);
}
.form textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.form .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.form .actions { grid-column: 1 / -1; display: flex; gap: 10px; }

.field-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ 闲置信息卡片 ============ */
.listing {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  transition: border-color .15s;
}
.listing:hover { border-color: #9fc5dc; }

.listing > a.cover { display: block; position: relative; text-decoration: none; }
.listing img.cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #eeece7;
}
.listing .cond {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(23, 33, 45, .82);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}
.listing-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.listing-meta { font-size: 12px; color: var(--muted); margin: 0; }
.listing-view-count { display: flex; align-items: center; gap: 4px; margin: auto 0 0; padding-top: 3px; color: var(--muted); font-size: 12px; }
.listing-view-count svg { flex: none; }
.view-count-inline { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.view-count-inline svg { flex: none; }

/* ============ 徽标 ============ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #eef1f4;
  color: var(--ink-2);
  white-space: nowrap;
  font-weight: 500;
}
.tag.orange { background: var(--orange-soft); color: var(--orange-dark); }
.tag.green { background: #e6f6ee; color: var(--green); }
.tag.red { background: #fdecea; color: var(--red); }
.tag.gold { background: #fdf5e2; color: #a97b0a; }
.tag.blue { background: #e8f1fb; color: var(--blue); }
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.verified-badge.pending { background: var(--gold); }
.verified-badge.none { background: #b8beC6; }

.avatar-wrap { position: relative; display: inline-block; }
.avatar-wrap .verified-badge {
  position: absolute;
  right: -6px;
  bottom: -5px;
  font-size: 9px;
  padding: 0 4px;
  border: 1.5px solid #fff;
  line-height: 14px;
}

.announcement-bar {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid #c9dfef;
  border-radius: 12px;
  background: #f0f8ff;
  color: #164b73;
}
.announcement-label {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 15px;
  color: #fff;
  background: #0b6ea8;
}
.announcement-window { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; }
.announcement-window span { display: inline-block; min-width: 100%; padding-left: 100%; animation: notice-scroll 18s linear infinite; }
.announcement-tone-red .announcement-window { color: #a82d25; }
.announcement-tone-orange .announcement-window { color: #a6530b; }
.announcement-tone-green .announcement-window { color: #147449; }
.announcement-tone-purple .announcement-window { color: #6d3b91; }
.announcement-tone-gray .announcement-window { color: #38566b; }
@keyframes notice-scroll { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .announcement-window { white-space: normal; padding: 9px 12px; }
  .announcement-window span { min-width: 0; padding-left: 0; animation: none; }
}

/* ============ 筛选侧栏 ============ */
.filters {
  position: sticky;
  top: 82px;
  max-height: none;
  overflow: visible;
  padding: 0 8px 0 0;
}

/* 筛选折叠头只在移动端出现，桌面端始终展开 */
.filters-head { display: none; }
.filters-body { display: block; }
.filter-group { margin-bottom: 18px; }
.filter-group h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; text-transform: none; }
.filter-item {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
}
.filter-item:hover { background: var(--orange-soft); text-decoration: none; }
.filter-item.active { background: var(--orange); color: #fff; font-weight: 600; }
.filter-item .count { float: right; color: var(--muted); font-size: 12px; }
.filter-item.active .count { color: rgba(255, 255, 255, .8); }
.filter-group select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 40px;
  padding: 8px 36px 8px 11px;
  border: 1px solid #bdd3e1;
  border-radius: 6px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2338566b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.filter-group select:hover { border-color: #7eafca; }
.filter-group select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(8, 118, 187, .12);
}
.filter-group select:disabled {
  color: #91a2ae;
  background-color: #f1f5f7;
  border-color: #dce7ed;
  cursor: not-allowed;
  opacity: 1;
}

/* ============ 排序条 ============ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.sorts { display: flex; gap: 6px; flex-wrap: wrap; }
.sorts button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
  font-family: var(--font);
}
.sorts button.active { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }

/* ============ 分页 ============ */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 24px 0 8px; flex-wrap: wrap; }
.pager button {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13.5px;
  font-family: var(--font);
}
.pager button.active { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ============ 详情页 ============ */
.detail { display: grid; grid-template-columns: 380px 1fr; gap: 30px; align-items: start; }
.detail-gallery { position: sticky; top: 82px; }
.detail-main-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  background: #eeece7;
  border: 1px solid var(--line);
}
.detail-view-count { display: flex; align-items: center; gap: 5px; }
.detail-view-count svg { flex: none; }
.draft-cover-placeholder { display: grid; place-items: center; width: 100%; height: 100%; min-height: 120px; color: var(--muted); background: #eef5fc; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img {
  width: 58px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  background: #eeece7;
}
.thumbs img.active { border-color: var(--orange); }

.meta-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.meta-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 400;
  padding: 7px 14px 7px 0;
  width: 88px;
  vertical-align: top;
  white-space: nowrap;
}
.meta-table td { padding: 7px 0; }

.publisher-card { display: flex; align-items: center; gap: 12px; }
.publisher-card .meta { min-width: 0; }

/* ============ 求购求助公开回复 ============ */
.comment {
  display: flex;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid #f0eee9;
}
.comment:last-child { border-bottom: 0; }
.comment .body { flex: 1; min-width: 0; }
.comment .name { font-weight: 600; font-size: 13.5px; }
.comment .text { margin: 3px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; }

/* ============ 后台 ============ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 13px; margin-bottom: 18px; }
.stat { padding: 15px 17px; }
.stat strong { display: block; font-size: 24px; line-height: 1.25; }
.stat span { font-size: 12.5px; color: var(--muted); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 2px solid var(--line); padding-bottom: 10px; }
.tabs button {
  border: 0;
  background: transparent;
  padding: 8px 15px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
  font-family: var(--font);
  font-weight: 500;
}
.tabs button.active { background: var(--ink); color: #fff; font-weight: 600; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left;
  padding: 10px 11px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
table.data td { padding: 10px 11px; border-bottom: 1px solid #f0eee9; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }

/* ============ 页面标题 / 我的发布 ============ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head h1, .page-head p { margin: 0; }
.page-head p { margin-top: 3px; }

.manage-listings { display: grid; gap: 12px; }
.my-listing-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.my-listing-stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px 15px; }
.my-listing-stat > div { min-width: 0; }
.my-listing-stat .switch-control { flex-shrink: 0; }
.my-listing-stat span { display: block; color: var(--muted); font-size: 13px; }
.my-listing-stat strong { display: block; color: var(--ink); font-size: 24px; margin-top: 3px; }
.my-listing-filter { display: flex; align-items: center; gap: 10px; margin: 0 0 15px; }
.my-listing-filter label { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.my-listing-filter select { max-width: 260px; }
.my-listing-pages { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px 0; }
.manage-listing {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 16px;
  margin: 0;
}
.manage-cover {
  width: 72px;
  height: 96px;
  border-radius: 9px;
  overflow: hidden;
  background: #eeece7;
  box-shadow: 0 2px 8px rgba(23, 33, 45, .1);
}
.manage-cover img { width: 100%; height: 100%; object-fit: cover; }
.manage-main { min-width: 0; }
.manage-title-row { display: flex; align-items: flex-start; gap: 8px; }
.manage-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.manage-title-row .tag { margin-top: 2px; flex: none; }
.manage-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 14px 0 0;
}
.manage-facts div { min-width: 54px; }
.manage-facts dt { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.manage-facts dd { margin: 3px 0 0; color: var(--ink-2); font-weight: 600; line-height: 1.35; }
.manage-side {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.cover-tools { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 18px;
  font-family: var(--font);
}
.icon-btn:hover { border-color: var(--orange); color: var(--orange-dark); background: var(--orange-soft); }
.icon-btn:disabled { opacity: .5; cursor: wait; }
.manage-actions { display: flex; gap: 7px; }
.manage-tip { margin-top: 12px; margin-bottom: 0; }

/* ============ 认证区域 ============ */
.verify-banner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--orange-soft);
  border: 1px solid #f8dcb8;
}
.verify-banner.pending { background: #fdf5e2; border-color: #f0e0b4; }
.verify-banner.approved { background: #e6f6ee; border-color: #bfe6d3; }
.verify-banner.rejected { background: #fdecea; border-color: #f6cfcb; }

/* ============ Toast / 加载 ============ */
#toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 22px;
  border-radius: 11px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-8px); }
#toast.error { background: var(--red); }
#toast.ok { background: var(--green); }

.loading { padding: 46px; text-align: center; color: var(--muted); }
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty .icon:empty { display: none; }
.empty .icon { font-size: 30px; margin-bottom: 8px; opacity: .45; }

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(23, 33, 45, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 14px; }

/* 登录 / 注册面板 */
.auth-wrap { max-width: 420px; margin: 50px auto; }
.auth-wrap .card { padding: 26px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.auth-tabs button {
  flex: 1;
  border: 0;
  background: #f1efea;
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink-2);
}
.auth-tabs button.active { background: var(--ink); color: #fff; font-weight: 600; }

/* ============ 图片上传预览 ============ */
.upload-box {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 13.5px;
  transition: border-color .15s, background .15s;
}
.upload-box:hover { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); }

.previews { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 11px; }
.preview-item { position: relative; width: 76px; }
.preview-item img { width: 76px; height: 100px; object-fit: cover; border-radius: 9px; }
.preview-item button {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 0;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 21px;
  padding: 0;
}
.preview-item .cover-tag {
  position: absolute;
  left: 0;
  bottom: 0;
  background: rgba(23, 33, 45, .8);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 0 6px 0 8px;
}

/* ============ 提示框 ============ */
.notice {
  border-radius: 11px;
  padding: 12px 15px;
  font-size: 13.5px;
  margin-bottom: 14px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.notice.warn { background: var(--orange-soft); color: #8a4a08; border: 1px solid #f8dcb8; }
.notice.info { background: #e8f1fb; color: #174a7c; border: 1px solid #c8dcf1; }
.notice.ok { background: #e6f6ee; color: #0d6b42; border: 1px solid #bfe6d3; }
.notice.err { background: #fdecea; color: #8f211a; border: 1px solid #f6cfcb; }

/* ============ 响应式 ============ */
.topbar.nav-collapsed .topbar-inner { gap: 10px; }
.topbar.nav-collapsed .menu-toggle { display: inline-flex; flex: none; }
.topbar.nav-collapsed #user-slot { margin-left: auto; }
.topbar.nav-collapsed .topnav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px 14px;
    gap: 2px;
    display: none;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .24);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 60;
}
.topbar.nav-collapsed .topnav.open { display: flex; }
.topbar.nav-collapsed .topnav > a { padding: 11px 13px; font-size: 15px; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .detail-gallery { position: static; }
  .detail-main-img { height: clamp(180px, 40vh, 300px); aspect-ratio: auto; object-fit: contain; }
  .layout-side { grid-template-columns: 1fr; }
  .filters {
    position: static;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 13px 15px;
    margin-bottom: 16px;
  }
  /* 移动端筛选默认收起，避免筛选面板占满整屏把书列表挤到下面 */
  .filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
  }
  .filters-body { display: none; padding-top: 14px; }
  .filters.open .filters-body { display: block; }
  .filter-group { margin-bottom: 13px; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar-inner {
    width: calc(100% - 24px);
    min-height: 0;
    padding: 8px 0 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand { font-size: 19px; }
  #user-slot { margin-left: auto; }
  .topnav { max-height: calc(100dvh - 104px); }

  main { width: 94vw; margin-top: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .listing-title { font-size: 13.5px; min-height: 38px; }
  .form { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail { gap: 18px; }
  .auth-wrap { margin: 22px auto; }
  .toolbar { gap: 8px; }
  .page-head { align-items: flex-start; margin-bottom: 14px; }
  .page-head h1 { font-size: 23px; }

  .manage-listing {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 13px;
  }
  .manage-cover { width: 64px; height: 86px; }
  .manage-title-row { flex-wrap: wrap; gap: 5px 8px; }
  .manage-title { font-size: 15px; }
  .manage-facts { gap: 12px; margin-top: 10px; justify-content: space-between; }
  .manage-facts div { min-width: 0; flex: 1 1 calc(50% - 12px); }
  .manage-side {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .cover-tools > span { display: none; }
  .manage-actions { margin-left: auto; }

  .tabs {
    flex-wrap: wrap;
    overflow: visible;
  }
  .tabs button { flex: 1 1 calc(50% - 8px); text-align: center; }

  .form .actions { flex-wrap: wrap; }
  .verify-banner { align-items: flex-start; }
  .modal-mask { padding: 12px; }

  /* 底部安全区适配 iPhone */
  body { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .usermenu > button > span:not(.avatar) { display: none; }
  .usermenu > button { padding: 5px; }
  .page-head { gap: 10px; }
  .page-head .btn { padding-inline: 13px; }
  .manage-facts { font-size: 13px; }
  .manage-side { align-items: stretch; }
  .cover-tools, .manage-actions { flex: 1; }
  .cover-tools .row, .manage-actions { display: grid; grid-template-columns: repeat(2, 1fr); }
  .icon-btn, .manage-actions .btn { width: 100%; min-height: 40px; }
  .form .actions > * { flex: 1 1 120px; }
}
.footer-links{display:flex;justify-content:center;gap:18px;flex-wrap:wrap;margin:8px 0}
.footer-links a{color:var(--blue);text-decoration:none}
@media (max-width: 480px) {
  .registration-links { flex-direction: column; gap: 2px; }
}
.legal-page{max-width:900px;margin:0 auto;line-height:1.8}
.legal-page section{padding:10px 0;border-bottom:1px solid var(--line)}
.legal-page section:last-of-type{border-bottom:0}
.legal-page h2{font-size:18px;margin:8px 0}
.legal-note{padding:14px 16px;border-radius:10px;background:var(--orange-soft);color:var(--orange-dark)}
.danger-zone{border-color:#f0b8b8}
.danger-zone label{display:block;max-width:420px;margin:12px 0}
.account-delete-form { display: block; max-width: 420px; margin: 14px 0; }
.account-delete-form label { margin: 0; }
@media (max-width: 600px) {
  .my-listing-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .my-listing-filter select { min-width: 0; max-width: none; }
}
.report-action{margin-top:12px}
.text-button{border:0;background:transparent;color:var(--muted);padding:0;cursor:pointer;font:inherit;font-size:12px}
.text-button:hover{color:var(--red)}
.stat small{display:block;color:var(--muted);font-size:12px;margin-top:5px;font-weight:400}
.compact-stats{margin:10px 0 0}
