:root {
  --paper: #F7F5F0;
  --card: #ffffff;
  --ink: #1d1c1a;
  --ink-2: #4a4741;
  --muted: #7d7972;
  --line: #e4e0d7;
  --line-2: #efebe3;
  --brand: #0E7A5F;
  --brand-soft: #E7F4EF;
  --ok: #2c6e52;
  --ok-soft: #e9f3ee;
  --warn: #a8761f;
  --warn-soft: #fbf2e1;
  --danger: #B03A2E;
  --danger-soft: #FCEDEC;
  --danger-line: #ECCFCB;
  --shadow: 0 1px 2px rgba(29, 28, 26, 0.04), 0 8px 24px rgba(29, 28, 26, 0.06);
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

button { font-family: inherit; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% -10%, #E3EFE8 0%, rgba(246, 244, 239, 0) 60%),
    var(--paper);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand h1 { margin: 0; font-family: var(--serif); font-size: 24px; letter-spacing: 2px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; letter-spacing: 1px; }

.brand-mark {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(10, 92, 73, 0.22);
  flex: none;
}
.brand-mark.sm { width: 34px; height: 34px; font-size: 18px; border-radius: 8px; }

.tabs { display: flex; gap: 6px; padding: 4px; background: var(--paper); border-radius: 10px; margin-bottom: 18px; }
.tab {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 8px 0; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.tab.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fdfcfa; color: var(--ink); font-size: 14px; font-family: inherit;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.field-row { display: flex; gap: 8px; align-items: flex-end; }
.field-row .field { flex: 1; margin-bottom: 14px; }
.field-row .btn { margin-bottom: 14px; white-space: nowrap; }

.hint { color: var(--muted); font-size: 12px; margin: 8px 0 14px; }
.error { color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 8px 10px; font-size: 12px; margin: 0 0 12px; }
.login-foot { text-align: center; color: #a9a49b; font-size: 11px; margin: 18px 0 0; }

.uid-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.uid-row code { flex: 1; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; overflow: auto; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: #d3cdc1; }
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #0A5C49; border-color: #0A5C49; }
.btn-ghost { background: #fff; }
.btn-link { border: 0; background: none; color: var(--muted); padding: 4px; font-size: 12px; cursor: pointer; }
.btn-link:hover { color: var(--brand); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-ok { color: var(--ok); border-color: #cfe3d8; background: var(--ok-soft); }
.btn-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- 工作台骨架 ---------- */
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }

.side {
  border-right: 1px solid var(--line);
  background: #fbfaf7;
  display: flex; flex-direction: column;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 20px; }
.side-brand strong { font-family: var(--serif); font-size: 17px; letter-spacing: 2px; display: block; }
.side-brand small { color: var(--muted); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  border: 0; background: none; text-align: left; cursor: pointer;
  padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13px;
}
.nav-item:hover { background: #f2efe8; }
.nav-item.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item em {
  font-style: normal; font-size: 11px; color: var(--muted);
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 0 6px;
}
.nav-item.is-on em { color: var(--danger); border-color: var(--danger-line); }

.side-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--line-2); }
.side-email { display: block; color: var(--muted); font-size: 11px; word-break: break-all; }

.main { padding: 24px 28px 60px; max-width: 1100px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.topbar h2 { margin: 0; font-family: var(--serif); font-size: 22px; letter-spacing: 1px; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- 卡片 / 统计 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(29,28,26,.03);
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 26px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 12px; }

.progress { height: 8px; background: var(--line-2); border-radius: 20px; overflow: hidden; margin: 10px 0 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #2E9E7E, var(--brand)); border-radius: 20px; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.item-title { font-weight: 600; font-size: 14px; margin: 0; }
.item-desc { color: var(--ink-2); font-size: 13px; margin: 4px 0 0; white-space: pre-wrap; }
.item-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.item-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.item-body { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.item-body dl { display: grid; grid-template-columns: 68px 1fr; gap: 4px 10px; margin: 0; font-size: 12px; }
.item-body dt { color: var(--muted); }
.item-body dd { margin: 0; color: var(--ink-2); word-break: break-all; }

.tag { font-size: 11px; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--ink-2); background: #faf8f4; }
.tag-job { color: #8a4b16; background: #fdf3e6; border-color: #f0dcc2; }
.tag-house { color: #2b5c86; background: #eef4fa; border-color: #d4e3f1; }
.tag-goods { color: #2c6e52; background: var(--ok-soft); border-color: #cfe3d8; }
.tag-corpus { color: #6b4a8a; background: #f4eefb; border-color: #e2d5f2; }

.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: #f1efe9; color: var(--muted); }

.voice-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; }
.empty strong { display: block; font-family: var(--serif); font-size: 17px; color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }

/* ---------- 校对 ---------- */
.proof { margin-top: 12px; background: #fbfaf7; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.proof .field textarea { min-height: 84px; resize: vertical; }
.accents { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--ink-2);
}
.chip.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.proof-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.export-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 人工录建瓯话 ---------- */
.rec-card { margin-bottom: 14px; border-color: #e7ded3; background: linear-gradient(#fffdf9, #fff); }
.rec-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rec-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px; letter-spacing: 1px; color: var(--ink-2);
  min-width: 76px;
}
.rec-tip { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 2px 8px; }
.rec-card audio { width: 100%; height: 36px; margin-bottom: 12px; }
.rec-card .field textarea { min-height: 76px; resize: vertical; }
.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.rec-grid .field { margin-bottom: 6px; }
.rec-grid .accents { margin-bottom: 0; }
@media (max-width: 720px) { .rec-grid { grid-template-columns: 1fr; } }

/* ---------- 批量操作 ---------- */
.bulkbar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(29, 28, 26, .06);
}
.bulkbar.is-empty { box-shadow: none; }
.bulk-info { font-size: 12px; color: var(--muted); }
.bulk-info b { color: var(--brand); font-size: 13px; }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.pick-all { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); cursor: pointer; user-select: none; }
.pick { display: inline-flex; align-items: center; cursor: pointer; }
.bulkbar input[type="checkbox"], .pick input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer;
}
.bulkbar input[type="checkbox"]:disabled { cursor: default; opacity: .45; }
.item.is-picked { border-color: #BFD9CF; background: #FBFDFB; box-shadow: inset 3px 0 0 var(--brand); }

@media (max-width: 640px) {
  .bulk-actions { margin-left: 0; width: 100%; }
  .bulkbar { gap: 10px; }
}

/* ---------- 弹层 / 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(29, 28, 26, .92); color: #fff; padding: 9px 16px;
  border-radius: 20px; font-size: 13px; z-index: 60;
}
.modal { position: fixed; inset: 0; background: rgba(29,28,26,.35); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px; }
.modal-card { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.modal-card h3 { margin: 0 0 6px; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 14px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side-brand { padding: 0; }
  .nav { flex-direction: row; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; white-space: nowrap; }
  .side-email { display: none; }
  .main { padding: 16px 14px 60px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* 帖子图片：审核时一眼看到屋里/实物长什么样 */
.photo-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.photo-strip .thumb {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef1f5;
  border: 1px solid #e6e9ee;
  cursor: zoom-in;
}

.photo-strip .thumb-fail {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #c63030;
  border-color: #f3c7c7;
  background: #fdf3f3;
}

.badge-deal {
  background: #eceef1;
  color: #6f767f;
}

/* 房屋出租 / 出售：列表上直接就分得清 */
.tag-rent { color: #2c6e52; background: var(--ok-soft); border-color: #cfe3d8; }
.tag-sale { color: #B03A2E; background: var(--danger-soft); border-color: #eed3ce; }
/* 求职：紫色，和「招聘」的橙色分开 */
.tag-seek { color: #6b4a8a; background: #f4eefb; border-color: #e2d5f2; }
/* 找房的人：求租青绿、求购琥珀，和房源的绿/红分开 */
.tag-want-rent { color: #0d6b5f; background: #e4f5f3; border-color: #c6e8e3; }
.tag-want-buy { color: #8a5a0d; background: #fdf2dd; border-color: #efdcb9; }

/* 会员 */
.member-search { display: flex; gap: 8px; margin-bottom: 12px; }
.member-search input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}
.member-name { font-size: 15px; }
.member-uid { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.member-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 6px; color: var(--ink-2); font-size: 12px; }
.member-posts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.member-post { display: flex; align-items: center; gap: 8px; }
.member-post-title { flex: 1; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 全网采集 ---------- */
.field select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fdfcfa; color: var(--ink); font-size: 14px; font-family: inherit;
  outline: none;
}
.field select:focus { border-color: var(--brand); background: #fff; }

.crawl-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.crawl-textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfcfa;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}
.crawl-textarea:focus { border-color: var(--brand); background: #fff; }

.crawl-list { display: flex; flex-direction: column; }
.crawl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.crawl-row:first-child { border-top: none; }
.crawl-pick { flex: 0 0 auto; display: flex; align-items: center; }
.crawl-pick input { width: 16px; height: 16px; cursor: pointer; }
.crawl-main { flex: 1; min-width: 0; }
.crawl-title {
  color: var(--ink);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crawl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.crawl-src { color: var(--brand); }
.crawl-link { flex: 0 0 auto; color: var(--brand); font-size: 12px; text-decoration: none; }
.crawl-link:hover { text-decoration: underline; }

/* 抖音导入：天数选择 + 每条的原发布时间 */
.dy-days {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.crawl-when {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef6ef;
  color: #2f7d4f;
  font-size: 11px;
  vertical-align: 1px;
}
.crawl-when-old { background: #fbf1e2; color: #a8761f; }

.crawl-log {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
}
.crawl-log:first-child { border-top: none; }
.crawl-log .crawl-bad { color: var(--danger); }

.badge-src { background: #eef4fb; color: #2f6da8; }

.crawl-notice {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #eef4fb;
  color: #2f6da8;
  font-size: 13px;
  line-height: 1.6;
}
