/* ─────────────────────────────────────────────────────────
   腕表拍卖档案 — 老钱风 (Old Money Aesthetic)
   暖象牙白 · 墨绿 · 酒红 · 旧金 · 衬线 · 细金线
   master-detail 布局：左卡片列表 / 右详情栏
   ───────────────────────────────────────────────────────── */

:root {
  --bg: #f4efe6;
  --panel: #fbf8f1;
  --panel-2: #f7f2e8;
  --ink: #2b2620;
  --ink-soft: #7a6f5f;
  --ink-faint: #a89b86;
  --green: #143c33;
  --green-deep: #0d2b24;
  --wine: #5c1f2e;
  --gold: #a8863e;
  --gold-deep: #8a6d30;
  --gold-soft: rgba(168, 134, 62, 0.30);
  --gold-line: rgba(168, 134, 62, 0.28);
  --serif: Georgia, "Palatino Linotype", "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

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

body {
  font-family: var(--serif);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(168, 134, 62, 0.06), transparent 60%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.page {
  max-width: 1570px;
  margin: 0 auto;
  padding: 48px 28px 64px;
}

/* ── master-detail 分栏：左（表单+卡片列表）+ 右（详情，sticky 固定独立滚动）── */
.master {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 30px;
}
.left-pane {
  flex: 1;
  min-width: 0;
}
.right-pane {
  width: 600px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

/* ── 顶部徽标 ── */
.masthead { text-align: center; margin-bottom: 40px; }

.crest {
  font-size: 34px;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 14px;
  letter-spacing: 2px;
}

.masthead-title {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--green);
  margin-bottom: 2px;
}

.masthead-sub {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.masthead-sub-title { letter-spacing: 0.2em; }
.masthead-sub-houses {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}
.rule span {
  display: block;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.rule::before, .rule::after {
  content: "";
  display: block;
  width: 120px;
  height: 1px;
  background: var(--gold-line);
}

/* ── 面板卡片 ── */
.panel {
  background: var(--panel);
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(43, 38, 32, 0.04), 0 8px 24px rgba(43, 38, 32, 0.05);
  padding: 28px 30px 30px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gold-line);
}

.panel-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--green);
}

.panel-note {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

/* ── 表单 ── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 20px;
}
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

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

.field label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.18em;
  padding: 12px 30px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-primary {
  background: var(--green);
  color: #e9dcc0;
  border-color: var(--green);
}
.btn-primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn-primary:disabled { opacity: 0.55; cursor: progress; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--gold-line);
}
.btn-ghost:hover { color: var(--green); border-color: var(--gold); }

/* ── 状态栏 ── */
.status {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: 6px;
  font-size: 14px;
  letter-spacing: 0.04em;
  border: 1px solid var(--gold-line);
  background: var(--panel);
  color: var(--ink-soft);
}
.status.busy { color: var(--wine); }
.status.error { color: var(--wine); border-color: rgba(92, 31, 46, 0.4); }
.status.done { color: var(--green); }
.status.warn { color: var(--gold-deep); border-color: var(--gold); }

/* ── 结果 ── */
#results { margin-top: 26px; }

.results-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
}

.results-count {
  font-size: 13px;
  color: var(--ink-soft);
}
.results-count strong { color: var(--gold-deep); font-weight: 500; }

/* ── 排序 chips ── */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.sort-label {
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  margin-right: 2px;
}
.sort-chip {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--gold-line);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.sort-chip:hover { color: var(--green); border-color: var(--gold); }
.sort-chip.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

/* ── 结果卡片列表 ── */
.lot-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lot-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.lot-card:hover {
  background: #f6efe0;
  box-shadow: 0 4px 16px rgba(43, 38, 32, 0.08);
}

.lot-left { flex-shrink: 0; }
.thumb {
  width: 60px;
  height: 76px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--gold-line);
  background: #efe7d6;
  display: block;
}
.thumb-empty {
  width: 60px;
  height: 76px;
  border-radius: 4px;
  border: 1px dashed var(--gold-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-size: 22px;
}

.lot-main { flex: 1; min-width: 0; }
.lot-house {
  font-size: 13px;
  color: var(--gold-deep);
  display: flex;
  align-items: center;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 8px;
  flex-shrink: 0;
}
.lot-title {
  font-size: 14px;
  color: var(--ink);
  margin: 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lot-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.lot-right {
  text-align: right;
  flex-shrink: 0;
}
.lot-rmb {
  font-size: 15px;
  color: var(--gold-deep);
  font-weight: 500;
  white-space: nowrap;
}
.lot-price {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ── 详情（右栏）── */
.detail-content {
  background: var(--panel);
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(43, 38, 32, 0.05);
}
.detail-empty {
  color: var(--ink-faint);
  font-size: 14px;
  text-align: center;
  padding: 80px 0;
  letter-spacing: 0.04em;
}

.detail-two-col {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.detail-left { width: 42%; flex-shrink: 0; }
.detail-right { flex: 1; min-width: 0; }

.detail-img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  background: #efe7d6;
  border-radius: 4px;
  border: 1px solid var(--gold-line);
  margin-bottom: 18px;
  cursor: zoom-in;
}
.detail-img-empty {
  width: 100%;
  height: 340px;
  background: #efe7d6;
  border-radius: 4px;
  border: 1px dashed var(--gold-line);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--ink-faint);
  line-height: 1;
}

.detail-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 4px;
  line-height: 1.4;
}
.detail-house {
  font-size: 14px;
  color: var(--gold-deep);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  row-gap: 10px;
  column-gap: 16px;
  font-size: 14px;
  border-top: 1px dashed var(--gold-line);
  padding-top: 16px;
}
.dl dt { color: var(--ink-soft); font-size: 13px; }
.dl dd { color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.dl .rmb-dd { color: var(--gold-deep); font-weight: 500; }

.link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-line);
  padding-bottom: 2px;
}
.link:hover { color: var(--wine); }

/* ── 确认框 ── */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 26, 0.45);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  width: min(440px, 92vw);
  background: var(--panel);
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(20, 30, 26, 0.3);
  padding: 28px 30px 26px;
  animation: modalIn 0.18s ease;
}
@keyframes modalIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gold-line);
}
.modal-head h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--green);
}
.modal-text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.8;
}
.modal-text strong { color: var(--gold-deep); font-weight: 500; }
.modal-hint { font-size: 12px; color: var(--wine); }
.modal-hint.warn { color: var(--gold-deep); font-weight: 500; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ── 抓取进度框 ── */
.progress-info { font-size: 14px; color: var(--ink); margin-bottom: 14px; line-height: 1.7; }
.progress-info strong { color: var(--gold-deep); font-weight: 500; }
.progress-track { height: 8px; background: var(--gold-soft); border-radius: 4px; overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; width: 0; background: var(--green); border-radius: 4px; transition: width 0.4s ease; }

/* ── 图片预览（点击放大 + 滚轮缩放 + 左键关闭）── */
.img-preview {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 26, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  cursor: zoom-out;
  overflow: hidden;
}
.img-preview img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  transform-origin: center;
  transition: transform 0.08s ease;
  user-select: none;
}

/* ── 竖屏详情抽屉（窄屏点拍品从右滑出，覆盖列表）── */
.detail-drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 26, 0.45);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: none;
}
.detail-drawer-mask.open { display: block; }

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 420px);
  background: var(--panel);
  border-left: 1px solid var(--gold-line);
  box-shadow: -16px 0 48px rgba(20, 30, 26, 0.28);
  z-index: 61;
  display: none;
  animation: drawerIn 0.22s ease;
}
.detail-drawer.open { display: block; }
@keyframes drawerIn {
  from { transform: translateX(100%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.detail-drawer-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  background: var(--panel);
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  cursor: pointer;
  z-index: 62;
}
.detail-drawer-close:hover { color: var(--wine); border-color: var(--wine); }

.detail-drawer-body {
  height: 100%;
  overflow-y: auto;
  padding: 24px 22px 40px;
}

/* ── 底部 ── */
.foot { text-align: center; margin-top: 56px; }
.foot p { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.06em; }
.foot a { color: inherit; text-decoration: none; }
.foot-beian { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.foot-beian .beian-item { display: inline-flex; align-items: center; gap: 5px; }
.foot-beian .beian-badge { width: 14px; height: 14px; flex: none; }

/* ── 登录遮罩 ── */
.login-mask { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: #f4efe6; padding: 24px; }
.login-box { width: 100%; max-width: 360px; background: #fffdf8; border: 1px solid #a8863e; border-radius: 8px; padding: 40px 32px; text-align: center; box-shadow: 0 12px 40px rgba(20, 60, 51, 0.12); }
.login-crest { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.login-title { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; color: #143c33; letter-spacing: 0.12em; margin: 0 0 6px; }
.login-sub { font-size: 13px; color: #8a857a; margin: 0 0 24px; letter-spacing: 0.05em; }
.login-input { display: block; width: 100%; box-sizing: border-box; margin-bottom: 12px; padding: 12px 14px; font-size: 15px; border: 1px solid #d8d2c2; border-radius: 6px; background: #fbf8f0; color: #143c33; }
.login-input:focus { outline: none; border-color: #a8863e; }
.login-err { min-height: 18px; margin: 4px 0 8px; font-size: 13px; color: #5c1f2e; }
.login-btn { width: 100%; padding: 12px; font-size: 15px; letter-spacing: 0.2em; color: #fff; background: #143c33; border: none; border-radius: 6px; cursor: pointer; }
.login-btn:hover { background: #1d4a3f; }

/* 退出按钮（视口右上角） */
.logout-btn { position: fixed; top: 16px; right: 20px; z-index: 900; padding: 6px 14px; font-size: 12px; letter-spacing: 0.1em; color: #8a857a; background: transparent; border: 1px solid #d8d2c2; border-radius: 4px; cursor: pointer; }
.logout-btn:hover { color: #5c1f2e; border-color: #5c1f2e; }

/* ── 响应式 ── */
@media (max-width: 900px) {
  .master { display: block; }
  .right-pane {
    width: auto;
    position: static;
    max-height: none;
    margin-top: 28px;
  }
}

@media (max-width: 760px) {
  .page { padding: 40px 16px 48px; }
  .masthead-title { font-size: 26px; }
  .grid, .grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .panel { padding: 22px 18px 24px; }
  .lot-card { gap: 12px; padding: 12px; }
  /* 竖屏：隐藏右栏详情，改走抽屉 */
  .right-pane { display: none; }
}

/* ── 手机横屏：恢复 master-detail 双列（左列表 / 右详情，各自滚动）
      覆盖上面 max-width:900 的 block 折叠；竖屏抽屉不受影响。
      断点跟小程序端一致用 orientation: landscape，上限 1000px 排除桌面/平板横屏。── */
@media (orientation: landscape) and (max-width: 1000px) {
  .page { padding: 16px 16px 32px; }
  .masthead { margin-bottom: 14px; }
  .masthead-title { font-size: 22px; }
  .masthead-sub { gap: 6px; }
  .masthead-sub-houses { display: none; }
  .rule { margin-top: 10px; }

  .master { display: flex; gap: 14px; align-items: flex-start; margin-top: 10px; }
  .left-pane { flex: 1; min-width: 0; }
  .right-pane {
    display: block;
    width: 50%;
    flex-shrink: 0;
    position: sticky;
    top: 10px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    margin-top: 0;
  }

  .panel { padding: 16px 16px 18px; }
  .panel-head { margin-bottom: 12px; padding-bottom: 8px; }
  .grid, .grid-3 { gap: 10px 12px; }
  .field input { padding: 8px 10px; font-size: 14px; }
  .actions { margin-top: 16px; }
  .detail-content { padding: 16px; }
  .lot-card { gap: 10px; padding: 10px 12px; }
  .foot { margin-top: 24px; }
}
