/* llxxw 共享样式 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1120px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
  flex-wrap: wrap;
  padding: 10px 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.logo {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.logo:hover {
  text-decoration: none;
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-right: auto;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-hover:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.post-title {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
}

.post-title a {
  color: var(--text);
}

.post-title a:hover {
  color: var(--primary);
  text-decoration: none;
}

.post-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.post-excerpt {
  color: #4b5563;
  margin: 0 0 12px;
}

/* ---------- 标签 ---------- */
.badge {
  display: inline-block;
  font-size: 12px;
  line-height: 1.5;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-published {
  background: #dcfce7;
  color: #15803d;
}

.badge-draft {
  background: #fef3c7;
  color: #a16207;
}

.badge-category {
  background: #eff6ff;
  color: var(--primary-dark);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: #f3f4f6;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

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

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}

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

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- 表单 ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.input,
.textarea,
.select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

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

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

/* ---------- 提示条 ---------- */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

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

/* ---------- 表格 ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  background: #fafafa;
}

.table tr:last-child td {
  border-bottom: none;
}

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 24px 0 40px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 正文排版 ---------- */
.post-body {
  font-size: 16px;
  line-height: 1.85;
  color: #374151;
}

.post-body p {
  margin: 0 0 1.1em;
}

/* 正文里的链接：清晰可点、自动换行、外链有提示感 */
.post-body a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-underline-offset: 3px;
  word-break: break-all;
  transition: text-decoration-color 0.15s ease;
}

.post-body a:hover {
  color: var(--primary-dark);
  text-decoration-color: currentColor;
}

.post-body a[target="_blank"]::after {
  content: "↗";
  font-size: 0.82em;
  margin-left: 2px;
  opacity: 0.55;
}

.post-body h2,
.post-body h3 {
  margin: 1.6em 0 0.7em;
  line-height: 1.4;
}

.post-body code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.post-body pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.post-body blockquote {
  margin: 1.2em 0;
  padding: 8px 16px;
  border-left: 3px solid var(--primary);
  background: #f8fafc;
  color: #4b5563;
}

/* ---------- 其它 ---------- */
.page-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 20px;
  flex-wrap: wrap;
}

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
}
.site-footer-brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.site-footer-note {
  margin-bottom: 6px;
}
.site-footer-copy {
  font-size: 12px;
}

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

.small {
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #d1d5db;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(16, 24, 40, 0.06);
  padding: 32px;
}

.login-box h1 {
  font-size: 20px;
  margin: 0 0 6px;
}

@media (max-width: 640px) {
  .site-header .inner {
    gap: 12px;
  }

  .nav {
    gap: 12px;
  }

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

/* ---------- v0.2 新增 ---------- */

/* 评审状态徽章 */
.badge-pending {
  background: #fef3c7;
  color: #a16207;
}

.badge-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-locked {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-level {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge-banned {
  background: #f3f4f6;
  color: #6b7280;
}

/* 内容锁定提示框 */
.lock-box {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
}

.lock-box .lock-title {
  font-weight: 600;
  color: #3730a3;
  margin: 0 0 4px;
  font-size: 15px;
}

.lock-box .lock-desc {
  color: #4b5563;
  font-size: 14px;
  margin: 0 0 10px;
}

.lock-box .lock-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 微信二维码占位 */
.wechat-box {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0 0;
}

.wechat-box .qr {
  width: 80px;
  height: 80px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}

.wechat-box .qr-tip {
  font-size: 13px;
  color: #166534;
  line-height: 1.6;
}

.wechat-box .qr-tip strong {
  color: #14532d;
}

/* 会员登录页的大号二维码 */
.wechat-box.qr-lg {
  padding: 16px;
  gap: 18px;
}

.wechat-box.qr-lg .qr {
  width: 150px;
  height: 150px;
  padding: 6px;
}

.wechat-box.qr-lg .qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-mask {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: #166534;
  text-align: center;
  padding: 10px;
}

.qr-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 22px 0 0;
}

.tabs a {
  padding: 9px 16px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

/* 资料卡 */
.profile {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 6px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
  min-width: 200px;
}

.profile-info h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.profile-info .profile-meta {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px 14px;
  font-size: 14px;
}

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

.kv dd {
  margin: 0;
}

/* 行内错误状态 */
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 驳回理由块 */
.review-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #9a3412;
  margin-top: 6px;
}

.review-note strong {
  color: #7c2d12;
}

/* 微信配置页 */
.alert-ok {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.text-ok {
  color: var(--success);
  font-weight: 500;
}

.code-block {
  background: #1f2937;
  color: #e5e7eb;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-x: auto;
  white-space: pre;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px 16px;
}

/* ---------- 主页：按分类分区预览 ---------- */
/* 主页宽容器：比默认 900 更宽，适配大屏并让分类区可多栏 */
.container-home {
  max-width: 1600px;
  padding: 0 24px;
}
/* 首页分类区：栏数随可用宽度自适应，大屏自动多分几栏，窄屏回退单/双栏 */
.home-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}

.home-cat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 0;
  transition: box-shadow .15s ease, transform .15s ease;
}
.home-cat:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
  transform: translateY(-2px);
}

.home-cat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
}

.home-cat-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-cat-more {
  color: var(--primary);
  white-space: nowrap;
  flex: 0 0 auto;
}

.home-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-post-list li {
  border-bottom: 1px dashed var(--border);
}

.home-post-list li:last-child {
  border-bottom: none;
}

.home-post-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  color: var(--text);
}

.home-post-link:hover {
  text-decoration: none;
}

.home-post-link:hover .home-post-title {
  color: var(--primary);
}

.home-post-title {
  font-size: 15px;
  line-height: 1.5;
  transition: color 0.15s;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-post-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.home-empty {
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

/* 导航条搜索（全局）—— 复用分类内 .search-field 的合并式输入框样式 */
.nav-search {
  display: flex;
  align-items: center;
}
.nav-search .search-field {
  flex: 0 1 220px;
  width: 220px;
  max-width: 100%;
}

/* 分类内搜索（位于分类标题行：名称 ↔ 搜索 ↔ 更多） */
.home-cat-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 120px;
  max-width: 380px;
  margin: 0;
  min-width: 0;
  flex-wrap: nowrap;
}
.search-field {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
}
.search-field .input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.btn-icon {
  flex: 0 0 auto;
  padding: 0 10px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.btn-icon .icon {
  display: block;
}

/* ---------- 超窄屏适配（最小手机，≤480px） ---------- */
/* 主页容器与导航内框保持同宽同边距，仅把左右留白收窄，保证对齐不变、内容更宽 */
@media (max-width: 480px) {
  .container-home,
  .site-header .inner {
    padding-left: 16px;
    padding-right: 16px;
  }
  .home-cats {
    gap: 14px;
  }
  .home-cat {
    padding: 16px;
  }
  .home-cat-head {
    gap: 8px;
  }
  /* 搜索结果态（清除 / 共X条）在最小屏可换行，避免横向溢出 */
  .home-cat-search {
    flex-wrap: wrap;
  }
}

/* ---------- 会员登录：隐私 / 合规告知 ---------- */
.consent-box {
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 16px;
}
.consent-text {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #475569;
  max-height: 150px;
  overflow: auto;
}
.consent-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1f2937;
  cursor: pointer;
  user-select: none;
}
.consent-check input {
  width: auto;
  margin: 0;
}

/* ---------- 易物（v0.6.0） ---------- */
.barter-search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.barter-search .input {
  flex: 1;
  min-width: 200px;
}

.barter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.barter-card {
  cursor: pointer;
  padding: 16px 18px;
}
.barter-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
/* 演示数据标记：临时灌入的试用内容，到期自动移除 */
.badge-demo {
  background: #fff7ed;
  color: var(--warning);
  border: 1px solid #fed7aa;
  cursor: help;
}
.barter-card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.4;
}
.barter-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
}

.barter-swap {
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.swap-block {
  flex: 1;
  min-width: 0;
}
.swap-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 2px;
}
.swap-label-want {
  color: var(--warning);
}
.swap-text {
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
  word-break: break-word;
}
.swap-arrow {
  flex: 0 0 auto;
  align-self: center;
  font-size: 18px;
  color: var(--muted);
}

/* ---------- 任务中心（前台展示，v0.7.1） ---------- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}
.task-card {
  padding: 16px 18px;
}
.task-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.task-term {
  font-size: 12px;
  background: #eef2ff;
  color: var(--primary-dark);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 1px 10px;
}
.task-side-link {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}
.task-side-link:hover {
  text-decoration: underline;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.pre-wrap {
  white-space: pre-wrap;
  word-break: break-word;
  color: #4b5563;
  line-height: 1.7;
  font-size: 14px;
  margin: 0 0 12px;
}

.barter-owner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* 易物状态徽章 */
.badge-open {
  background: #dcfce7;
  color: #15803d;
}
.badge-reserved {
  background: #eff6ff;
  color: var(--primary-dark);
}
.badge-completed {
  background: #f3f4f6;
  color: #6b7280;
}
.badge-cancelled {
  background: #f3f4f6;
  color: #9ca3af;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text);
}

/* 易物请求卡片 */
.offer-item {
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
}
.offer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.offer-msg {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 联系方式「扫码查看」组件 ===== */
.post-contact {
  margin-top: 8px;
}

.btn-ghost {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}
.btn-ghost:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* 二维码弹窗 */
.cr-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.cr-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.cr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.cr-title {
  font-weight: 600;
  font-size: 15px;
}
.cr-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #9ca3af;
}
.cr-close:hover {
  color: #374151;
}
.cr-body {
  padding: 18px 16px 20px;
  text-align: center;
}
.cr-loading,
.cr-error {
  color: #6b7280;
  font-size: 14px;
}
.cr-error {
  color: #dc2626;
}
.cr-tip {
  font-size: 13px;
  color: #4b5563;
  margin: 0 0 14px;
  line-height: 1.5;
}
.cr-qr {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.cr-qr img {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.cr-actions {
  margin-bottom: 10px;
}
.cr-foot {
  margin: 4px 0 0;
}
.cr-link {
  word-break: break-all;
  font-size: 13px;
  margin-bottom: 12px;
}
.cr-link a {
  color: var(--primary);
}
.cr-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 1100;
}

/* 揭示页（reveal.html） */
.reveal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}
.reveal-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 380px;
  padding: 28px 22px;
  text-align: center;
}
.reveal-status {
  color: #dc2626;
  font-size: 14px;
  margin-bottom: 12px;
  min-height: 18px;
}
.reveal-loading {
  color: #6b7280;
  font-size: 14px;
}
.reveal-title {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 10px;
}
.reveal-number {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #111827;
  margin: 6px 0 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.reveal-masked {
  font-size: 26px;
  font-weight: 600;
  color: #374151;
  letter-spacing: 2px;
  margin: 6px 0 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.reveal-msg {
  font-size: 14px;
  color: #4b5563;
  margin: 0 0 18px;
  line-height: 1.6;
}
.reveal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.reveal-foot {
  margin-top: 20px;
  font-size: 12px;
  color: #9ca3af;
}

/* ============================================================
   中国传统喜庆主题（后台「外观」可手动切换）
   作用域：html.theme-festive —— 由 assets/theme.js 在首屏绘制前，
   依据后台设置（settings.theme）切换；前台+后台全站生效。
   ============================================================ */
html.theme-festive {
  --bg: #fbf1e6;
  --surface: #fffdfa;
  --text: #3a1f17;
  --muted: #8c6b5b;
  --border: #f0d6c0;
  --primary: #c8102e;            /* 中国红 */
  --primary-dark: #9e0c24;
  --danger: #c8102e;
  --success: #1f8a4c;
  --warning: #d9821a;
  --shadow: 0 2px 10px rgba(200, 16, 46, 0.10);
}

/* 暖色背景叠加喜庆光晕，不喧宾夺主 */
html.theme-festive body {
  background:
    radial-gradient(circle at 10% 0%, rgba(212, 175, 55, 0.10), transparent 42%),
    radial-gradient(circle at 90% 100%, rgba(200, 16, 46, 0.07), transparent 42%),
    var(--bg);
}

/* 顶部品牌栏：暖白底 + 描金下边 */
html.theme-festive .site-header {
  background: linear-gradient(180deg, #fffdfa 0%, #fff3ea 100%);
  border-bottom: 2px solid #d4af37;
}
html.theme-festive .logo {
  color: var(--primary);
}
html.theme-festive .logo:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* 导航激活态：中国红字 + 描金下划线 */
html.theme-festive .nav a.active {
  color: var(--primary);
  border-bottom-color: #d4af37;
}

/* 主按钮：红底描金，悬浮加深 */
html.theme-festive .btn-primary {
  background: linear-gradient(135deg, #c8102e, #e23b3b);
  border: 1px solid #d4af37;
  color: #fff;
  box-shadow: 0 2px 8px rgba(200, 16, 46, 0.25);
}
html.theme-festive .btn-primary:hover {
  background: linear-gradient(135deg, #a00d24, #c8102e);
  text-decoration: none;
}

/* 卡片悬停轻微描金描边 */
html.theme-festive .card:hover,
html.theme-festive .card-hover:hover {
  border-color: #e7c66a;
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.12);
}

/* 喜庆角标 / 分类标签：红底浅染、描金边 */
html.theme-festive .badge-published,
html.theme-festive .badge-category {
  background: rgba(200, 16, 46, 0.10);
  color: var(--primary-dark);
  border: 1px solid rgba(200, 16, 46, 0.25);
}

/* 链接喜庆红 */
html.theme-festive a {
  color: var(--primary);
}
html.theme-festive a:hover {
  color: var(--primary-dark);
}
