/* ==========================================================================
   文兴选装修 · 共享样式（视觉令牌与 visual-spec.md 一致）
   零外链字体 / 零 CDN；图标全部内联 SVG。
   ========================================================================== */

:root {
  --brand: #123A63;
  --brand-deep: #0B2440;
  --brand-soft: #EDF3F9;
  --gold: #C08A2E;
  --gold-soft: #FBF4E6;
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --text-1: #1F2329;
  --text-2: #23425F;
  --text-3: #9AA0A6;
  --line: #EFF1F4;
  --danger: #D93026;
  --success: #1E8E5A;
  --radius-card: 10px;
  --radius-img: 6px;
  --font: -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
  --shadow-card: 0 1px 2px rgba(18, 58, 99, 0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  line-height: 1.55;
}

a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--card); color: var(--text-1);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost { border-color: var(--line); color: var(--text-2); background: #fff; }
.btn-danger-ghost { border-color: var(--danger); color: var(--danger); background: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 6px; }

/* ---------- 通用表单 ---------- */
.field { padding: 14px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: none; }
.field-label { font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.field-label .req { color: var(--danger); }
.field-label .hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.field input[type=text], .field input[type=password], .field input[type=tel],
.field input[type=number], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 10px 12px; font-size: 15px; color: var(--text-1); outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }

/* 筛选胶囊（单选） */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  height: 28px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 13px; line-height: 26px; cursor: pointer;
}
.pill.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* ---------- 卡片 / 表格 ---------- */
.card {
  background: var(--card); border-radius: var(--radius-card); padding: 16px;
  box-shadow: var(--shadow-card); margin-bottom: 12px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 12px; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td {
  padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid th { color: var(--text-3); font-weight: 500; font-size: 12px; }
table.grid td { color: var(--text-1); }
table.grid tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 4px; font-size: 12px; line-height: 18px;
}
.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-gray { background: var(--bg); color: var(--text-3); }
.badge-danger { background: #FBEAE9; color: var(--danger); }
.badge-success { background: #E7F4EE; color: var(--success); }

/* ---------- 空态 / 异常条 ---------- */
.empty { padding: 40px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-text { font-size: 14px; color: var(--text-3); }
.banner {
  display: none; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px;
  background: #FBEAE9; color: var(--danger); font-size: 13px; margin-bottom: 12px;
}
.banner.show { display: flex; }
.banner .retry { margin-left: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 13px; padding: 8px 14px;
  border-radius: 8px; z-index: 80; display: none; max-width: 80vw; text-align: center;
}
.toast.show { display: block; }

/* ==========================================================================
   PC 后台外壳：左侧 200px 菜单 + 右侧内容区（最大 960px）
   ========================================================================== */

.pc-shell { display: flex; min-height: 100vh; }

.pc-sidebar {
  width: 200px; flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.pc-brand {
  height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--brand-deep);
}
.pc-brand .logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--brand-soft);
  color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none;
}
.pc-menu { padding: 8px 0; flex: 1; }
.menu-group { margin-bottom: 4px; }
.menu-group-title {
  padding: 12px 16px 6px; font-size: 11px; color: var(--text-3); letter-spacing: .04em;
}
.menu-item {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  color: var(--text-2); font-size: 14px; cursor: pointer; border-left: 2px solid transparent;
  overflow: hidden; white-space: nowrap;
}
.menu-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover { background: var(--bg); }
.menu-item.active { color: var(--brand); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 600; }
.menu-item.disabled { color: #C6CAD1; cursor: not-allowed; }
.menu-item.disabled:hover { background: transparent; }
.menu-item .lock { margin-left: auto; }

.pc-side-foot { border-top: 1px solid var(--line); padding: 12px 16px; font-size: 12px; color: var(--text-3); flex: none; background: #fff; }
.pc-menu { overflow-y: auto; }
.pc-side-foot .who { color: var(--text-1); font-weight: 600; margin-bottom: 2px; }

.pc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
}
.pc-topbar .page-title { font-size: 16px; font-weight: 600; }
.pc-topbar .top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pc-content { width: 100%; max-width: 960px; margin: 0 auto; padding: 20px 24px 48px; }

/* 概览卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.stat-card { background: #fff; border-radius: var(--radius-card); padding: 16px; box-shadow: var(--shadow-card); }
.stat-card .stat-label { font-size: 12px; color: var(--text-3); }
.stat-card .stat-value { font-size: 22px; font-weight: 600; color: var(--text-1); margin-top: 6px; }
.stat-card .stat-value.gold { color: var(--gold); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .search-input {
  height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px;
  font-size: 13px; background: #fff; outline: none; min-width: 200px;
}
.toolbar .spacer { margin-left: auto; }

/* ==========================================================================
   登录页（三套入口同一套样式）
   ========================================================================== */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.login-card {
  width: 360px; max-width: 100%; background: #fff; border-radius: 14px;
  box-shadow: 0 8px 30px rgba(18, 58, 99, 0.08); padding: 32px 28px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand .logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft);
  color: var(--brand); display: flex; align-items: center; justify-content: center;
}
.login-brand .name { font-size: 18px; font-weight: 600; color: var(--brand-deep); }
.login-sub { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }
.login-card .field { padding: 10px 0; }
.login-submit { margin-top: 18px; width: 100%; height: 44px; }
.login-foot { margin-top: 16px; text-align: center; font-size: 12px; color: var(--text-3); }
.login-error {
  display: none; margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: #FBEAE9; color: var(--danger); font-size: 13px;
}
.login-error.show { display: block; }

/* 强制改密遮罩 */
.modal-mask { position: fixed; inset: 0; background: rgba(11, 36, 64, 0.35); z-index: 60; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-mask.open { display: flex; }
.modal { width: 380px; max-width: 100%; background: #fff; border-radius: 14px; padding: 24px; }
.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.modal .modal-sub { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }

/* ==========================================================================
   手机端 /m/（竖屏）：桌面下居中 390 列，手机上铺满
   ========================================================================== */

.phone {
  width: 390px; max-width: 100%; margin: 0 auto; min-height: 100vh; background: var(--bg);
  position: relative; display: flex; flex-direction: column;
}
@media (min-width: 420px) {
  body { padding: 24px 0; }
  .phone { min-height: calc(100vh - 48px); border-radius: 24px; box-shadow: 0 8px 30px rgba(18, 58, 99, 0.12); overflow: hidden; }
}

.m-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 0 12px; flex: none; }
.m-topbar-row { height: 44px; display: flex; align-items: center; gap: 10px; }
.m-topbar .back { color: var(--text-1); display: flex; width: 32px; height: 44px; align-items: center; }
.m-topbar .top-title { font-size: 16px; font-weight: 600; flex: 1; text-align: center; }
.m-topbar .top-right { width: 32px; display: flex; justify-content: flex-end; }

.m-scroll { flex: 1; overflow-y: auto; padding: 8px 12px 96px; }
.phone .login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.m-scroll::-webkit-scrollbar { display: none; }

.m-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.m-section-label { font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: 10px; }

/* 手机列表卡片 */
.post-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow-card); }
.post-card .pc-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.post-card .pc-meta { font-size: 12px; color: var(--text-3); margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.post-card .pc-actions { margin-top: 10px; display: flex; gap: 8px; }

/* 底部发布条 */
.publish-bar {
  position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.publish-btn {
  height: 44px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 15px;
  font-weight: 600; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}
.publish-btn:active { background: var(--brand-deep); }
.publish-btn:disabled { opacity: .5; }

/* 触控热区（≥44px） */
.tap { min-height: 44px; min-width: 44px; }

/* ==========================================================================
   PC 上传组件
   ========================================================================== */
.wx-upload-pc .pc-drop {
  display: flex; align-items: center; gap: 12px; border: 1px dashed #D5D9E0;
  border-radius: 10px; padding: 16px; margin-bottom: 12px;
}
.wx-upload-pc.drag-over .pc-drop { border-color: var(--brand); background: var(--brand-soft); }
.wx-upload-pc .pc-drop-hint { font-size: 12px; color: var(--text-3); }

.wx-upload-pc .pc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px; }
.wx-upload-pc .pc-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #F2F3F5; }
.wx-upload-pc .pc-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wx-upload-pc .pc-item.is-fail { outline: 1px solid var(--danger); }
.wx-upload-pc .pc-cover-tag {
  position: absolute; left: 0; bottom: 0; background: var(--brand); color: #fff;
  font-size: 10px; height: 16px; line-height: 16px; padding: 0 6px; border-radius: 0 6px 0 0;
}
.wx-upload-pc .pc-item-mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 6px; background: rgba(11, 36, 64, 0.45); opacity: 0; transition: opacity .15s;
}
.wx-upload-pc .pc-item:hover .pc-item-mask { opacity: 1; }
.wx-upload-pc .pc-icon-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none; background: rgba(255,255,255,.92);
  color: var(--text-1); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.wx-upload-pc .pc-icon-btn.pc-del { color: var(--danger); }
.wx-upload-pc .pc-icon-btn.pc-cover-btn.on { color: var(--gold); }
.wx-upload-pc .pc-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.6); }
.wx-upload-pc .pc-progress i { display: block; height: 100%; background: var(--brand); }

.wx-upload-pc .pc-queue { display: flex; flex-direction: column; gap: 10px; }
.wx-upload-pc .pc-q-item { display: flex; align-items: center; gap: 10px; }
.wx-upload-pc .pc-q-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: #eee; }
.wx-upload-pc .pc-q-main { flex: 1; min-width: 0; }
.wx-upload-pc .pc-q-name { font-size: 13px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-upload-pc .pc-q-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.wx-upload-pc .pc-q-item.is-fail .pc-q-name { color: var(--danger); }
.wx-upload-pc .pc-q-progress { height: 4px; border-radius: 999px; background: var(--brand-soft); margin-top: 6px; overflow: hidden; }
.wx-upload-pc .pc-q-progress i { display: block; height: 100%; width: 60%; background: var(--brand); }

/* ==========================================================================
   手机上传组件
   ========================================================================== */
.wx-upload-m .m-add-btns { display: flex; gap: 8px; margin-bottom: 10px; }
.wx-upload-m .add-btn {
  flex: 1; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  color: var(--text-2); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
}
.wx-upload-m .m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.wx-upload-m .m-slot { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #F2F3F5; }
.wx-upload-m .m-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wx-upload-m .m-del {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none; font-size: 14px; line-height: 1; cursor: pointer;
}
.wx-upload-m .m-queue { display: flex; flex-direction: column; gap: 10px; }
.wx-upload-m .m-q-item { display: flex; align-items: center; gap: 10px; }
.wx-upload-m .m-q-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: #eee; }
.wx-upload-m .m-q-main { flex: 1; min-width: 0; }
.wx-upload-m .m-q-name { font-size: 13px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-upload-m .m-q-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.wx-upload-m .m-q-item.is-fail .m-q-name { color: var(--danger); }
.wx-upload-m .m-progress { height: 4px; border-radius: 999px; background: var(--brand-soft); margin-top: 6px; overflow: hidden; }
.wx-upload-m .m-progress i { display: block; height: 100%; background: var(--brand); }
.wx-upload-m .retry {
  flex: none; min-height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--danger);
  color: var(--danger); font-size: 12px; background: #fff; cursor: pointer;
}
.wx-upload-m .m-pending { font-size: 12px; color: var(--text-3); margin-top: 8px; min-height: 16px; }
