/* ==========================================================================
   长葛市白酒巡检水印系统 — Claude 官网风格版
   配色：米白 #FAF9F5 / 暖炭黑 #141413 / 陶土橘 #D97757
   ========================================================================== */

:root {
  /* 色彩令牌（照抄 Claude 官网） */
  --bg: #faf9f5;
  --bg-panel: #f0eee6;
  --surface: #ffffff;
  --text: #141413;
  --text-secondary: #45423c;
  --text-muted: #83827d;
  --border: #e4e2da;
  --border-strong: #d4d1c5;
  --accent: #d97757;
  --accent-hover: #c96442;
  --accent-soft: #f7e8e1;
  --ok: #6a9a71;

  /* 字体 */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", "Songti SC", "STSong", SimSun, serif;

  /* 圆角 */
  --radius-xl: 16px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;          /* 兜底：禁止横向溢出滚动 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

::selection { background: rgba(217, 119, 87, 0.22); }

/* ---------- 顶部 ---------- */
.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 249, 245, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 20px 36px 22px;
}
.header-inner { max-width: 1380px; margin: 0 auto; }

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.brand-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: 999px;
}
.status-dot {
  width: 7px; height: 7px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(106, 154, 113, 0.15);
}

/* ---------- 控制区 ---------- */
.control-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.5fr 1.2fr auto;
  gap: 16px;
  align-items: end;
}
.ctrl-col label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ctrl-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-start;
}

.ctrl-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  color-scheme: light;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.ctrl-input:hover { border-color: #b8b3a4; }
.ctrl-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14);
}

/* 原生 select 被自绘组件接管后隐藏，仅保留取值功能 */
select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- 自绘下拉 ---------- */
.cx-select { position: relative; }
.cx-trigger {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.cx-trigger:hover { border-color: #b8b3a4; }
.cx-trigger.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14);
}
.cx-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.cx-caret { color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s ease; }
.cx-trigger.active .cx-caret { transform: rotate(180deg); }

.cx-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 20, 19, 0.12);
  z-index: 80;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  display: none;
  animation: tray-in 0.18s var(--ease-out) both;
}
.cx-menu.open { display: block; }
.cx-menu::-webkit-scrollbar { width: 8px; }
.cx-menu::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.cx-option {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.12s ease, color 0.12s ease;
}
.cx-option:hover { background: var(--bg-panel); color: var(--text); }
.cx-option.selected {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
}
.cx-option.selected::after { content: '✓'; font-size: 12px; }
@keyframes tray-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 按钮 ---------- */
.btn-secondary {
  height: 40px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s var(--ease-out);
}
.btn-secondary:hover { background: var(--bg-panel); border-color: #b8b3a4; }
.btn-secondary:active { transform: translateY(0); }

/* ==========================================================================
   工作区：左侧两占位图 + 右侧功能区
   ========================================================================== */
.workbench {
  max-width: 1380px;
  width: 100%;
  margin: 26px auto 0;
  padding: 0 36px;
  flex: 1 0 auto;
}

.workbench-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 26px;
  align-items: start;
  animation: rise-in 0.4s var(--ease-out) both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 左侧：图片区（两个占位图 + 操作按钮） ---------- */
.image-strip {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.image-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* 缩略图（与上传集成） */
.thumb-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.thumb-frame:hover { box-shadow: 0 6px 18px rgba(20, 20, 19, 0.14); }

.thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.thumb-frame.loaded img { opacity: 1; }

/* 上传态：虚线边 + hover 暖橘高亮，告诉用户可点击触发选图 */
.thumb-frame--upload {
  cursor: pointer;
  background: transparent;
  border: 1.5px dashed var(--border-strong);
}
.thumb-frame--upload:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 6px 18px rgba(217, 119, 87, 0.18);
}
.thumb-frame--upload.loaded {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  cursor: default;
}
.thumb-frame--upload.loaded:hover {
  background: var(--bg-panel);
  border-color: var(--border);
  box-shadow: 0 6px 18px rgba(20, 20, 19, 0.14);
}

/* 占位元素隐藏靠 HTML 的 `hidden` 属性；CSS 不要用 display:none 阻断 img.onload */

/* 真实文件 input 整张铺满 label，点击任意位置都触发选图 */
.thumb-frame--upload input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  border: none;
  padding: 0;
  background: transparent;
}
.thumb-frame--upload.loaded input[type="file"] {
  /* 加载完成后允许点击更换图片：保留透明层 */
  opacity: 0;
}

/* 空态占位：居中显示 + 与说明文案 */
.thumb-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  pointer-events: none;
  padding: 0 12px;
}
.thumb-frame.loaded .thumb-empty { display: none; }
.thumb-empty-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 19px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1;
  background: var(--surface);
}
.thumb-frame--upload:hover .thumb-empty-mark {
  border-color: var(--accent);
  color: var(--accent);
}
.thumb-empty-text { line-height: 1.5; }
.thumb-empty-text em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.85;
}

.thumb-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(20, 20, 19, 0.76);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #faf9f5;
  font-size: 10.5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
  z-index: 1;
  pointer-events: none;
}
.thumb-frame:not(.loaded) .thumb-pill {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

/* 单图下方的预览/下载按钮组 */
.img-actions {
  display: flex;
  gap: 8px;
}
.img-actions .act-btn { flex: 1; }

/* ---------- 右侧：功能区 ---------- */
.function-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 1px solid var(--border);
  padding-left: 26px;
  min-width: 0;
}

.search-host { position: relative; width: 100%; display: flex; gap: 9px; }

.search-input-field {
  flex: 1;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  background: var(--surface);
  color-scheme: light;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.search-input-field::placeholder { color: var(--text-muted); }
.search-input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.14);
}

.btn-search-trigger {
  height: 40px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.16s ease, transform 0.16s var(--ease-out);
}
.btn-search-trigger:hover { background: var(--accent-hover); }
.btn-search-trigger:active { transform: translateY(1px); }

/* 搜索结果下拉 */
.dropdown-tray {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 20, 19, 0.13);
  z-index: 60;
  max-height: 264px;
  overflow-y: auto;
  display: none;
  animation: tray-in 0.18s var(--ease-out) both;
}
.dropdown-tray::-webkit-scrollbar { width: 8px; }
.dropdown-tray::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.dropdown-row {
  padding: 11px 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-panel);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: background 0.12s ease;
}
.dropdown-row:last-child { border-bottom: none; }
.dropdown-row:hover { background: var(--bg-panel); }
.row-title { font-size: 13px; font-weight: 600; color: var(--text); }
.row-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

.engine-pill {
  font-size: 10.5px;
  padding: 2.5px 10px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill-amap {
  background: #eef3f9;
  color: #3f6e9b;
  border-color: #d8e4ef;
}
.pill-tencent {
  background: #f7efdd;
  color: #9a7434;
  border-color: #eadfc4;
}

/* 表单小项 */
.grid-3 { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; }
.form-item { min-width: 0; }
.form-item label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.form-item input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  color-scheme: light;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.form-item input::placeholder { color: var(--text-muted); }
.form-item input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.12);
}

.shop-name-switch { margin: 2px 0; }

/* —— 清除按钮（并入各图位按钮组） —— */
.img-actions .btn-clear {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
}
.img-actions .btn-clear:hover:not(:disabled) {
  background: #fdf3ee;
  border-color: var(--accent);
  color: var(--accent-hover);
}
.img-actions .btn-clear:disabled {
  color: #c9c7be;
  background: var(--bg-panel);
}

.switch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.16s ease;
}
.switch-bar:hover { color: var(--text-secondary); }
.switch-bar input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ---------- 操作按钮（预览/下载 共用样式） ---------- */
.act-btn {
  height: 34px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.act-btn:disabled {
  background: var(--bg-panel);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-panel);
  color: var(--text);
}
.btn-soft {
  background: var(--accent-soft);
  border: 1px solid #ecd5c9;
  color: var(--accent-hover);
}
.btn-soft:hover:not(:disabled) { background: #f3ddd2; }

/* ---------- 预览弹窗 ---------- */
.preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 24px;
  animation: fade-in 0.22s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.preview-modal {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: rise-in 0.28s var(--ease-out) both;
}
.preview-modal img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}
.preview-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  transition: background 0.16s ease, transform 0.2s ease;
}
.preview-close:hover { background: rgba(217, 119, 87, 0.85); transform: rotate(90deg); }
.modal-dl-btn {
  background: #fff !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
  padding: 0 22px !important;
  height: 40px;
  border-radius: var(--radius-md);
}
.modal-dl-btn:hover { background: var(--bg-panel) !important; }

/* ---------- 自定义弹窗 ---------- */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.36);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1600;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.dialog-backdrop.show { opacity: 1; }
.dialog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px 28px 22px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(20, 20, 19, 0.18);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s var(--ease-out);
}
.dialog-backdrop.show .dialog-card { transform: none; }
.dialog-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.dialog-msg { font-size: 13.5px; color: var(--text-secondary); line-height: 1.7; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.btn-dialog {
  height: 36px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.btn-dialog.ok {
  background: var(--accent);
  border: 1px solid transparent;
  color: #fff;
}
.btn-dialog.ok:hover { background: var(--accent-hover); }
.btn-dialog.cancel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.btn-dialog.cancel:hover { background: var(--bg-panel); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1700;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(20, 20, 19, 0.22);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}
.toast.show { opacity: 1; transform: none; }

/* ---------- 移动端设置抽屉（桌面端隐藏开关，控件区内联显示） ---------- */
.drawer-toggle,
.drawer-backdrop,
.drawer-head { display: none; }
.drawer-toggle {
  height: 34px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.drawer-toggle:hover { background: var(--bg-panel); color: var(--text); }

/* ---------- 页脚技术支持（文档流内随页面滚动，不悬浮遮挡内容） ---------- */
.site-credit {
  flex-shrink: 0;
  text-align: center;
  padding: 18px 16px 16px;
  font-size: 11px;
  font-weight: 400;
  color: #cdc9bb;            /* 比 --text-muted 更浅，几乎是背景色调 */
  letter-spacing: 0.08em;
  user-select: none;
  pointer-events: none;       /* 不挡按钮点击 */
}
.credit-rule {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: #e8e4d4;
  vertical-align: middle;
  margin: 0 12px;
}

/* ---------- 焦点可达性 ---------- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.cx-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 响应式：平板 & 手机（≤900px） ---------- */
@media (max-width: 900px) {
  /* 工作区：单列纵排，图片区在上、功能区在下 */
  .workbench { margin: 14px auto 0; padding: 0 14px; }
  .workbench-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 16px 14px;
  }

  /* 图片区：两个图框左右并排（沿用桌面横排） */
  .image-strip { gap: 12px; }

  /* 单个图位：图框在上，预览/下载/清除按钮组在下 */
  .image-slot { gap: 8px; }

  /* 三按钮横排，空间紧张时收窄内距与字号 */
  .image-slot .img-actions { gap: 6px; }
  .image-slot .img-actions .act-btn {
    height: 38px;
    font-size: 11.5px;
    padding: 0 4px;
    gap: 4px;
  }

  /* 小图框内文案压缩 */
  .thumb-empty { padding: 0 8px; font-size: 11px; }
  .thumb-empty-mark { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
  .thumb-empty-text em { font-size: 10px; }
  .thumb-pill { font-size: 10px; padding: 2.5px 8px; top: 6px; left: 6px; }

  /* 功能区：移到图片区下方，去掉左侧分隔线改为顶部通栏分隔 */
  .function-section {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 18px;
  }

  /* 时间三块：拍摄日期独占一行，门头/酒柜时间并排一行
     minmax(0, 1fr) 是轨道级强制收缩 —— iOS Safari 对 date/time
     原生控件会按内容撑出固有宽度，普通 1fr 会被顶破 */
  .grid-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
  }
  .grid-3 .form-item:first-child { grid-column: 1 / -1; }
  .grid-3 .form-item {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .grid-3 .form-item input {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0 8px;
    font-size: 13px;
    text-align: center;
    background-clip: padding-box;
  }
  .grid-3 .form-item input[type="date"],
  .grid-3 .form-item input[type="time"] { height: 38px; }

  /* iOS Safari：appearance:none 后日期/时间的值容器不再自动垂直居中（偏上） */
  .grid-3 .form-item input[type="date"]::-webkit-date-and-time-value,
  .grid-3 .form-item input[type="time"]::-webkit-date-and-time-value {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 随机时间按钮：整行显示，不超出页面宽度 */
  .btn-random-time {
    width: 100%;
    height: 40px;
    justify-content: center;
    font-size: 12.5px;
    padding: 0 10px;
    white-space: nowrap;
  }

  /* 防溢出：功能区所有控件限制在容器内 */
  .function-section { min-width: 0; }
  .function-section .btn-secondary,
  .function-section .btn-search-trigger { max-width: 100%; }

  /* 顶部只剩品牌条：恢复吸顶，控件移入侧边抽屉 */
  .dashboard-header {
    position: sticky;
    padding: 10px 14px;
    z-index: 1160;
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .brand-row {
    margin-bottom: 0;
    gap: 10px;
  }
  .brand-title {
    font-size: 16px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .status-indicator {
    font-size: 10.5px;
    padding: 3px 9px;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 设置按钮（仅移动端可见） */
  .drawer-toggle { display: inline-flex; }

  /* 顶部控件区 → 右侧滑出抽屉 */
  .header-controls {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(330px, 88vw);
    background: var(--bg);
    border-left: 1px solid var(--border);
    box-shadow: -16px 0 48px rgba(20, 20, 19, 0.12);
    z-index: 1150;
    padding: 16px 16px 28px;
    overflow-y: auto;
    transform: translateX(105%);
    transition: transform 0.3s var(--ease-out);
  }
  .header-controls.open { transform: none; }
  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 19, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1140;
  }
  .drawer-backdrop.show { opacity: 1; pointer-events: auto; }
  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  .drawer-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
  }
  .drawer-close {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
  }

  /* 抽屉内部：控件单列纵排 */
  .header-controls .control-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  .header-controls .ctrl-col { width: 100%; }
  .header-controls .ctrl-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .ctrl-col label { font-size: 12px; margin-bottom: 5px; }
  .ctrl-input { font-size: 13px; height: 40px; }
  .cx-trigger { height: 40px; font-size: 13px; }
  .btn-secondary { height: 40px; font-size: 12.5px; padding: 0 14px; }
  .switch-bar { font-size: 12.5px; }

  .preview-backdrop { padding: 12px; }
  .preview-close { top: -42px; }
  .preview-modal img { max-height: 74vh; }
}

/* ---------- 响应式：中屏（≤720px，隐藏状态胶囊给标题让位） ---------- */
@media (max-width: 720px) {
  .status-indicator { display: none; }
}

/* ---------- 响应式：手机（≤560px） ---------- */
@media (max-width: 560px) {
  .brand-title { font-size: 15px; }
  .drawer-toggle { height: 32px; padding: 0 11px; }

  /* 更小屏：按钮进一步压缩，避免三键拥挤 */
  .image-slot .img-actions { gap: 4px; }
  .image-slot .img-actions .act-btn {
    height: 36px;
    font-size: 11px;
    padding: 0 2px;
  }
  .thumb-empty-text em { display: none; }

  .search-input-field { padding: 0 9px; }

  .toast-wrap { bottom: 22px; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}