/* ============================================================
   腾讯移动端 UI 标准规范 · 可执行测试版本
   60% 中性 · 30% 品牌 · 10% 功能色
   品牌主色 #07C160（微信绿）
   ============================================================ */
:root {
  --bg-page: #F5F5F5;
  --text-primary: #1A1A1A;
  --text-secondary: #999999;
  --line: #E5E5E5;
  --brand: #07C160;
  --brand-tap: #06AD56;
  --brand-light: #95EC69;
  --brand-bg: rgba(7, 193, 96, 0.06);
  --success: #00A870;
  --warning: #FF8F1F;
  --error: #F53F3F;
  --error-bg: #FFF0F0;
  --silver: #D0D0D0;
  --card-bg: #FFFFFF;
  --mask: rgba(0,0,0,0.5);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tab-h: 56px;
  --icp-bar-h: 0px;
  --bottom-chrome-h: calc(var(--tab-h) + var(--safe-bottom));
  /* z-index 层级体系 */
  --z-navbar: 10;
  --z-tab-bar: 20;
  --z-overlay: 40;
  --z-sheet: 50;
  --z-dialog: 100;
  --z-toast: 200;
  --z-banner: 300;
  --z-image-viewer: 1000;
  --z-share-fallback: 10000;
  /* F-UI-06: 与 components.css adm Token 对齐（过渡期双向引用） */
  --brand: var(--adm-color-primary, #07C160);
  --brand-tap: var(--adm-color-primary-tap, #06AD56);
  --text-primary: var(--adm-color-text, #1A1A1A);
  --text-secondary: var(--adm-color-text-secondary, #999999);
  --line: var(--adm-color-border, #E5E5E5);
  --bg-page: var(--adm-color-background, #F5F5F5);
  --card-bg: var(--adm-color-white, #FFFFFF);
  --error: var(--adm-color-danger, #F53F3F);
  --success: var(--adm-color-success, #00A870);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
html, body {
  width: 100%; min-height: 100vh; min-height: -webkit-fill-available;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  touch-action: manipulation;
}
.app {
  width: 100%; max-width: 480px; min-height: 100vh; min-height: -webkit-fill-available;
  background: var(--bg-page); margin: 0 auto; position: relative;
}
.screen { display: none; padding: 0 0 var(--bottom-chrome-h); animation: fadeIn .2s ease; }
.screen.active { display: block; }
/* 带底栏 Tab 的全屏 flex 页（Safari 用 dvh/svh 避免地址栏跳动） */
.screen.active.flow-screen,
.screen.active#page-list,
.screen.active#page-gallery,
.screen.active#page-upload,
.screen.active#page-template,
.screen.active#page-desc,
.screen.active#page-profile {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--bottom-chrome-h));
  height: calc(100dvh - var(--bottom-chrome-h));
  height: calc(100svh - var(--bottom-chrome-h));
  max-height: calc(100vh - var(--bottom-chrome-h));
  max-height: calc(100dvh - var(--bottom-chrome-h));
  overflow: hidden;
  padding-bottom: 0;
}
/* 设置子页无 Tab，占满可视区 */
.screen.active#page-settings-system,
.screen.active#page-settings-ai,
.screen.active#page-settings-client,
.screen.active#page-settings-users {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--icp-bar-h) - var(--safe-bottom));
  height: calc(100dvh - var(--icp-bar-h) - var(--safe-bottom));
  height: calc(100svh - var(--icp-bar-h) - var(--safe-bottom));
  max-height: calc(100dvh - var(--icp-bar-h) - var(--safe-bottom));
  overflow: hidden;
  padding-bottom: 0;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Navbar ===== */
.navbar {
  display: flex; align-items: center;
  height: 48px; padding: max(0px, calc(var(--safe-top) - 8px)) 12px 0;
  background: var(--card-bg);
  position: sticky; top: 0; z-index: var(--z-navbar);
  gap: 12px;
}
.navbar .back {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  font-size: 22px; color: var(--text-primary); border-radius: 50%;
  flex-shrink: 0;
}
.navbar .back:active { background: var(--bg-page); }
.navbar .title {
  font-size: 17px; font-weight: 500;
  color: var(--text-primary); white-space: nowrap;
  flex-shrink: 0; margin-right: 4px;
}
.navbar-search {
  flex: 1; min-width: 100px; max-width: 280px;
  height: 32px;
  padding: 0 12px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--bg-page);
  font-size: 13px; color: var(--text-primary);
}
.navbar-search::placeholder { color: var(--text-secondary); }
.navbar-search:focus { outline: none; border-color: var(--brand); }
.list-toolbar {
  position: relative;
  justify-content: flex-start;
  gap: 8px;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 8px;
}
.list-status-filter {
  flex: 0 0 auto;
  width: 72px;
  height: 32px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-page);
  font-size: 13px;
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386909C' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  cursor: pointer;
}
.list-status-filter:focus { outline: none; border-color: var(--brand); }
.list-toolbar #btn-new-vehicle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  flex: none;
  margin: 0;
}
.list-toolbar .btn-sm {
  flex: 0 0 auto;
  white-space: nowrap;
}
.navbar .right {
  font-size: 15px; color: var(--brand);
  border: none; background: none; cursor: pointer;
  padding: 8px 10px; font-weight: 500; flex-shrink: 0;
}
.navbar .right:active { opacity: 0.7; }
.navbar .spacer { width: 44px; flex-shrink: 0; }

/* ===== Tab Bar ===== */
.tab-bar {
  position: fixed; bottom: var(--safe-bottom); left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--card-bg);
  display: flex;
  border-top: 1px solid var(--line);
  z-index: var(--z-tab-bar);
  padding-bottom: var(--safe-bottom);
  height: var(--tab-h);
}
.tab-item {
  flex: 1; text-align: center; padding: 4px 0 6px;
  cursor: pointer; color: var(--text-secondary);
  font-size: 10px; transition: color .15s;
  position: relative; user-select: none;
  min-height: 48px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.tab-item[data-tab="page-upload"] { display: none; }

/* ICP 备案号已移至启动首屏 .splash-icp-footer */
.tab-item .icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-bottom: 2px;
}
.tab-item .icon .tab-icon {
  width: 22px; height: 22px; display: block; flex-shrink: 0;
}
.tab-item .icon .tab-icon--solid { display: none; }
.tab-item.active .icon .tab-icon--outline { display: none; }
.tab-item.active .icon .tab-icon--solid { display: block; }
.tab-item .label { font-size: 10px; line-height: 1.2; font-weight: 400; }
.tab-item.active { color: var(--brand); }
.tab-item.active .label { font-weight: 500; }
.tab-item:active .icon { opacity: 0.72; }
.tab-item.active::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2.5px; background: var(--brand); border-radius: 0 0 2px 2px;
}

/* ===== Responsive: desktop frame vs mobile fullscreen ===== */
@media (min-width: 520px) {
  body { background: #E8E8E8; display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
  .app { border-radius: 40px; overflow: hidden; box-shadow: 0 0 40px rgba(0,0,0,0.12); min-height: 812px; max-height: 95vh; }
}
@media (max-width: 519px) {
  body { background: var(--bg-page); }
  .app { max-width: 100%; border-radius: 0; }
}

/* ===== Card (微信风格白色圆角卡片) ===== */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  margin: 8px 16px;
  padding: 16px;
  position: relative;
}
.card:active { background: #F7F7F7; }
.card-img {
  width: 80px; height: 80px;
  background: var(--silver);
  border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.card-info { flex: 1; min-width: 0; }
.card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.card-title-row .card-title-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-title-row .card-title-tag {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
}
.card-info h3 { font-size: 16px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.card-info .code { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; font-family: monospace; letter-spacing: 0.3px; }
.card-info .meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.card-info .price { font-size: 18px; font-weight: 600; color: var(--error); }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 3px;
  font-size: 11px; font-weight: 500; margin-right: 4px;
}
.tag.sale { background: rgba(0, 168, 112, 0.1); color: var(--success); }
.tag.sold { background: var(--error-bg); color: var(--error); }
.tag.draft { background: rgba(255, 143, 31, 0.1); color: var(--warning); }
.card-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.card-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.card-actions .checkbox { margin-top: 0; }

/* ===== Button System ===== */
.btn-block {
  display: block; width: calc(100% - 32px);
  height: 48px; line-height: 48px;
  margin: 12px 16px; padding: 0 16px;
  border-radius: 6px; border: none;
  font-size: 16px; font-weight: 500;
  cursor: pointer; text-align: center;
  transition: opacity .15s;
}
.btn-block:active { opacity: 0.8; }
.btn-block.primary { background: var(--brand); color: #fff; }
.btn-block.primary:active { background: var(--brand-tap); }
.btn-block.success { background: var(--success); color: #fff; }
.btn-block:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-block.outline { background: var(--card-bg); color: var(--brand); border: 1px solid var(--brand); line-height: 46px; }
.btn-block.outline:active { background: var(--brand-bg); }
.btn-block.muted { background: var(--card-bg); color: var(--text-secondary); border: 1px solid var(--line); line-height: 46px; margin-top: 0; }
.btn-block.muted:active { background: var(--bg-page); }

.btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--card-bg);
  font-size: 13px; cursor: pointer;
  color: var(--text-primary); transition: opacity .15s, background-color .15s, border-color .15s;
}
.btn-sm:active { opacity: 0.7; }
.btn-sm.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-sm.danger { color: var(--error); border-color: var(--error); }
.btn-sm.danger:active { background: var(--error-bg); }

/* ===== Checkbox ===== */
.checkbox {
  width: 20px; height: 20px;
  border: 1.5px solid var(--silver);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; margin-top: 2px;
  transition: background-color .15s, border-color .15s;
}
.checkbox.checked { background: var(--brand); border-color: var(--brand); }
.checkbox.checked::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 600; }

/* ===== Photo Upload (三步流程) ===== */
.step-progress { display: flex; padding: 16px 16px 0; gap: 6px; }
.step-dot { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.step-dot.active { background: var(--brand); }
.step-dot.done { background: var(--success); }

.step-header { padding: 20px 16px 8px; }
.step-header h2 { font-size: 20px; font-weight: 600; color: var(--text-primary); }
.step-header .sub { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.upload-section.is-collapsible .upload-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 16px 16px 10px;
  border: none;
  background: var(--card-bg);
  text-align: left;
  cursor: pointer;
}
.upload-section.is-collapsible .step-header-main { flex: 1 1 auto; min-width: 0; }
.upload-section.is-collapsible .step-header-main h2,
.upload-section.is-collapsible .step-header-main .sub { pointer-events: none; }
.upload-section-chevron {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}
.upload-section.is-collapsible:not(.is-collapsed) .upload-section-chevron {
  transform: rotate(90deg);
}
.upload-section.is-collapsed .upload-section-body { display: none; }
.upload-section.is-collapsible.is-collapsed + .upload-section {
  margin-top: 0;
  border-top-width: 1px;
}
.step-header-actions { margin-top: 10px; }
.btn-batch-photos {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--brand); background: var(--brand-bg);
  color: var(--brand); font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.btn-batch-photos:active { opacity: 0.75; }

.upload-batch-bar {
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-batch-bar .upload-mode-hint {
  width: 100%;
  margin: 12px 0 8px;
  text-align: center;
}

#btn-batch-all-photos {
  width: 50%;
  margin: 0 0 8px;
}

.upload-mode-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

#btn-batch-all-photos.is-locked,
#btn-batch-all-photos:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.upload-batch-bar.upload-mode-locked {
  opacity: 0.55;
}

.upload-section + .upload-section {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 8px solid var(--bg-page);
}

#upload-step-area.upload-mode-locked {
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

#upload-step-area.upload-mode-locked::after {
  content: '已使用「图片上传」，下方空位添加已锁定';
  display: block;
  margin: 0 16px 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-page);
  border-radius: 8px;
  text-align: center;
}

#upload-step-area.upload-ready::after {
  content: '照片已上传，点击照片可替换或删除，空位可继续添加';
  display: block;
  margin: 0 16px 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--success);
  background: #f0faf5;
  border-radius: 8px;
  text-align: center;
}

.upload-batch-bar.upload-mode-locked::after {
  content: '已使用空位单独添加，「图片上传」已锁定';
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-page);
  border-radius: 8px;
  text-align: center;
}

.photo-item.upload-mode-locked,
.btn-batch-photos.is-locked,
[data-skip].is-locked {
  opacity: 0.5;
  pointer-events: none;
}

.photo-extras {
  padding: 0 16px 8px;
}

.photo-extras[hidden] {
  display: none !important;
}

.photo-extras-title {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.photo-overflow-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.photo-extra-item {
  flex: 0 0 auto;
  width: 72px;
  text-align: center;
  position: relative;
}

.photo-extra-del {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.photo-extra-del:active {
  background: #e54d42;
}

.photo-extra-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.photo-extra-item span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-item.is-uploading {
  pointer-events: none;
  border-style: solid;
  border-color: var(--brand);
  animation: upload-slot-pulse 1.4s ease-in-out infinite;
}

@keyframes upload-slot-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(7, 193, 96, 0.28);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(7, 193, 96, 0);
    transform: scale(0.98);
  }
}

.photo-item.upload-just-done {
  animation: upload-slot-success 0.45s ease-out;
}

@keyframes upload-slot-success {
  0% { box-shadow: 0 0 0 0 rgba(7, 193, 96, 0.5); }
  40% { box-shadow: 0 0 0 8px rgba(7, 193, 96, 0); border-color: var(--success); }
  100% { box-shadow: none; }
}

.photo-upload-progress {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: upload-overlay-in 0.22s ease-out;
}

.photo-upload-progress.is-leaving {
  animation: upload-overlay-out 0.28s ease-in forwards;
}

@keyframes upload-overlay-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes upload-overlay-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.96); }
}

.photo-item {
  position: relative;
}

.photo-upload-progress-inner {
  width: 88%;
  text-align: center;
}

.photo-upload-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.75s linear infinite, upload-spinner-glow 1.5s ease-in-out infinite;
  will-change: transform;
}

@keyframes upload-spinner-glow {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 4px rgba(7, 193, 96, 0.45)); }
}

.photo-upload-pct {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  animation: upload-pct-pop 0.2s ease-out;
}

@keyframes upload-pct-pop {
  from { transform: scale(0.85); opacity: 0.6; }
  to { transform: scale(1); opacity: 1; }
}

.photo-upload-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 4px 0 6px;
}

.photo-upload-bar,
.upload-global-bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.photo-upload-fill,
.upload-global-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--brand) 0%,
    #5dd39e 45%,
    var(--brand) 90%
  );
  background-size: 200% 100%;
  animation: upload-bar-shimmer 1.1s linear infinite;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes upload-bar-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.upload-global-progress {
  margin: 0 16px 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.upload-global-progress:not([hidden]) {
  animation: upload-global-in 0.32s ease-out;
}

.upload-global-progress.is-leaving {
  animation: upload-global-out 0.25s ease-in forwards;
}

@keyframes upload-global-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 80px;
  }
}

@keyframes upload-global-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-6px); }
}

.upload-global-text {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-global-text::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.photo-item:not(.has-photo) {
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-page),
    var(--bg-page) 8px,
    #f3f3f3 8px,
    #f3f3f3 16px
  );
}

.photo-item:not(.has-photo):not(.is-uploading) .add-icon {
  animation: upload-add-hint 2.8s ease-in-out infinite;
}

@keyframes upload-add-hint {
  0%, 100% { transform: scale(1); color: #b0b0b0; }
  50% { transform: scale(1.12); color: var(--brand); }
}

.photo-item.has-photo .photo-thumb {
  animation: upload-thumb-in 0.35s ease-out;
}

@keyframes upload-thumb-in {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}

.upload-global-progress-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 16px; }
.photo-item {
  aspect-ratio: 1;
  background: var(--bg-page);
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;
  border: 1.5px dashed var(--silver);
  position: relative;
  transition: border-color .15s;
}
.photo-item:active { border-color: var(--brand); }
.photo-item .label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.photo-item .add-icon { font-size: 26px; color: #B0B0B0; }
.photo-item.has-photo { border-style: solid; border-color: var(--success); background: #F0FAF5; }
.photo-item.has-photo .label { color: var(--success); }
.photo-item .badge {
  position: absolute; top: -5px; right: -5px;
  width: 18px; height: 18px;
  background: var(--success);
  border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 600;
}
.photo-item.has-photo .badge { display: flex; }

.photo-item.has-photo .photo-manage-hint {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  font-size: 9px;
  color: rgba(7, 193, 96, 0.9);
  text-align: center;
  z-index: 1;
  pointer-events: none;
}

/* ===== Photo Action Sheet ===== */
.photo-action-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--mask);
  z-index: var(--z-overlay);
  display: none;
}

.photo-action-overlay.show {
  display: block;
}

.photo-action-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border-radius: 16px 16px 0 0;
  padding: 16px 20px calc(16px + var(--safe-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: var(--z-sheet);
  display: none;
}

.photo-action-sheet.show {
  display: block;
  animation: slideUp 0.25s ease;
}

.photo-action-preview {
  width: 120px;
  height: 120px;
  margin: 0 auto 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-page);
}

.photo-action-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-action-title {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 14px;
}

.photo-action-btn {
  display: block;
  width: 100%;
  height: 48px;
  margin-bottom: 10px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-page);
  color: var(--text-primary);
}

.photo-action-btn:active {
  opacity: 0.85;
}

.photo-action-btn.danger {
  background: #fff5f5;
  color: #e54d42;
}

.photo-action-btn.cancel {
  margin-bottom: 0;
  background: transparent;
  color: var(--text-secondary);
}

.skip-bar { padding: 16px; text-align: center; }
.skip-bar button {
  background: none; border: none;
  color: var(--brand); font-size: 15px;
  cursor: pointer; padding: 10px 20px;
  font-weight: 500;
}

/* ===== Selling Points ===== */
.selling-tags { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 16px; }
.selling-tag {
  padding: 8px 16px; border-radius: 4px;
  border: 1px solid var(--line);
  font-size: 14px; cursor: pointer;
  transition: border-color .15s, background-color .15s; background: var(--card-bg);
  color: var(--text-primary);
}
.selling-tag.selected { border-color: var(--brand); background: var(--brand-bg); color: var(--brand); }
.selling-tag:active { opacity: 0.7; }
.selling-tag .emoji { margin-right: 4px; }
.btn-refresh-tags {
  flex-shrink: 0;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card-bg);
  color: var(--text-secondary); font-size: 12px; cursor: pointer;
}
.btn-refresh-tags:active { opacity: 0.75; background: var(--bg-page); }

.desc-meta-row {
  padding: 12px 16px 8px;
  margin: 8px 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-bg);
}
.desc-meta-row .desc-hint {
  margin-top: 10px;
  margin-bottom: 0;
}
.desc-meta-fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.desc-meta-row .model-field,
.desc-meta-row .price-field {
  padding: 0;
  min-width: 0;
}
.desc-meta-row .model-field {
  flex: 1 1 auto;
}
.desc-meta-row .price-field {
  flex: 0 0 108px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.price-field {
  padding: 12px 16px 4px;
  display: flex; align-items: center; gap: 12px;
}
.price-field label {
  font-size: 13px; color: var(--text-secondary); flex-shrink: 0;
}
.desc-meta-row .price-field label {
  display: block;
  margin-bottom: 0;
}
.price-field input {
  width: 140px; font-size: 18px; font-weight: 600;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card-bg); color: var(--text-primary);
}
.desc-meta-row .price-field input {
  width: 100%;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 8px;
  text-align: left;
}
.price-field input:focus { outline: none; border-color: var(--brand); }
.price-field input[readonly] {
  background: var(--bg-page);
  color: var(--text-secondary);
  cursor: default;
}

.model-field {
  padding: 16px 16px 4px;
}
.model-field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.model-field input {
  width: 100%;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
}
.model-field input:focus { outline: none; border-color: var(--brand); }
.desc-extract-status {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 18px;
}
.desc-extract-status.loading { color: var(--brand); }
.desc-extract-status.ok { color: #00A870; }

/* ===== Long Image Preview ===== */
.long-img-preview {
  margin: 8px 16px; border-radius: 8px;
  overflow: hidden; background: var(--card-bg);
  max-height: 380px; overflow-y: auto;
}
.long-img-preview::-webkit-scrollbar { width: 3px; }
.long-img-preview::-webkit-scrollbar-thumb { background: var(--silver); border-radius: 3px; }
.long-block { padding: 16px; border-bottom: 6px solid var(--bg-page); }
.long-block:last-child { border-bottom: none; }
.long-main-img {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, #07C160, #95EC69);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; margin-bottom: 8px;
}
.long-title { font-size: 17px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.long-code { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; font-family: monospace; }
.long-point { font-size: 14px; padding: 3px 0; color: var(--text-primary); }
.long-price { font-size: 24px; font-weight: 600; color: var(--error); margin: 8px 0; }

/* ===== Gallery Long Image Preview ===== */
.preview-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--mask); z-index: var(--z-overlay); display: none;
}
.preview-overlay.show { display: block; }
.preview-panel {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px); max-width: 420px;
  max-height: calc(100vh - 80px);
  background: var(--card-bg);
  border-radius: 12px;
  z-index: var(--z-sheet); display: none;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.preview-panel.show { display: flex; flex-direction: column; }
.preview-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  font-size: 16px; font-weight: 500;
}
.preview-panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.preview-share {
  border: none;
  background: none;
  color: var(--brand);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
}
.preview-close {
  border: none; background: none; color: var(--brand);
  font-size: 15px; cursor: pointer; padding: 4px 8px;
}
.preview-poster-body {
  overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch;
}
.preview-poster-body img { width: 100%; display: block; }
.gallery-card { cursor: pointer; margin: 4px 16px; padding: 12px 16px 0; }
.gallery-card .card-img { cursor: zoom-in; }
.gallery-card-price-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.gallery-card-price-row .price {
  margin-bottom: 0;
}
.gallery-card > .card-actions {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  margin-top: 4px;
  margin-bottom: 0;
}
.gallery-card-actions-toggle.adm-button.adm-button--small {
  width: 100%;
  height: 10px;
  min-height: 10px;
  max-height: 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  line-height: 1;
  box-shadow: none;
}
.gallery-card-actions-toggle {
  width: 100%;
  min-height: 10px;
  height: 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  box-shadow: none;
}
.gallery-card-actions-toggle.adm-button {
  border: none;
  box-shadow: none;
}
.gallery-card-actions-chevron {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: 0;
}
.gallery-card--expanded .gallery-card-actions-toggle {
  display: none;
}
.gallery-card-actions-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.gallery-card--expanded .gallery-card-actions-panel {
  display: flex;
}
.gallery-card-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
}
.gallery-card-actions .btn-sm {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
}
.gallery-hint {
  margin: 0 16px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Share Panel (微信分享风格) ===== */
.share-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--mask); z-index: var(--z-overlay); display: none;
}
.share-overlay.show { display: block; }
.share-panel {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--card-bg);
  border-radius: 16px 16px 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: var(--z-sheet); display: none;
}
.share-panel.show { display: block; animation: slideUp .25s ease; }
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}
.share-panel h3 { font-size: 17px; font-weight: 500; margin-bottom: 14px; color: var(--text-primary); text-align: center; }
.share-poster-preview {
  width: 100%; max-height: 200px; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-page); margin-bottom: 12px;
}
.share-poster-preview img,
.share-poster-preview object {
  width: 100%; display: block; max-height: 200px; object-fit: cover; object-position: top;
}
.share-preview-empty {
  padding: 32px 16px; text-align: center; font-size: 13px; color: var(--text-secondary);
}
.share-textarea {
  width: 100%; height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px; font-size: 15px;
  resize: none; font-family: inherit;
  color: var(--text-primary); line-height: 1.5;
  margin-bottom: 14px;
}
.share-textarea:focus { outline: none; border-color: var(--brand); }
.share-actions { display: flex; gap: 12px; }
.share-actions button {
  flex: 1; height: 44px; line-height: 44px; padding: 0;
  border-radius: 6px; border: none;
  font-size: 16px; font-weight: 500; cursor: pointer;
}
.share-actions .cancel { background: var(--bg-page); color: var(--text-primary); }
.share-actions .cancel:active { background: #E8E8E8; }
.share-actions .confirm { background: var(--brand); color: #fff; }
.share-actions .confirm:active { background: var(--brand-tap); }
.share-actions .confirm:disabled { opacity: 0.65; }

.share-image-fallback {
  position: fixed; inset: 0; z-index: var(--z-share-fallback);
  background: rgba(0, 0, 0, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.share-image-fallback-panel {
  width: 100%; max-width: 420px; max-height: 92vh; overflow: auto;
  background: #fff; border-radius: 12px; padding: 16px;
}
.share-image-fallback-panel h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 8px; text-align: center;
}
.share-image-fallback-tip,
.share-image-fallback-copy {
  font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 10px;
}
.share-image-fallback-copy { color: var(--brand); }
.share-image-fallback-img-wrap {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  margin-bottom: 12px; max-height: 55vh; overflow-y: auto;
}
.share-image-fallback-img-wrap img { width: 100%; display: block; }
.share-image-fallback-img-wrap img.share-image-save-target,
.share-image-save-target {
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
}
.share-panel-hint {
  font-size: 12px;
  color: #999;
  margin-bottom: 12px;
  line-height: 1.5;
}
.share-image-fallback-wechat-hint {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  text-align: center;
  margin: 0 0 10px;
}
.share-image-fallback-close {
  width: 100%; height: 44px; border: none; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 16px; cursor: pointer;
}

/* ===== Filter Chips ===== */
.filter-bar { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 6px 14px; border-radius: 4px;
  border: 1px solid var(--line);
  font-size: 13px; cursor: pointer;
  white-space: nowrap; background: var(--card-bg);
  color: var(--text-secondary);
  transition: background-color .15s, color .15s, border-color .15s;
}
.filter-chip:active { opacity: 0.7; }
.filter-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ===== 列表滚动区 + 右侧滑条 ===== */
#page-list .navbar,
#page-list .list-toolbar,
#page-list .search-bar,
#page-list .list-page-footer,
#page-gallery .gallery-page-footer,
#page-gallery .gallery-hint {
  flex-shrink: 0;
}
.list-page-footer { flex-shrink: 0; }
.list-page-footer .summary-bar { padding: 8px 16px; min-height: 36px; }
.stats-inline { font-size: 12px; }
.batch-actions-panel {
  display: flex; padding: 6px 16px; gap: 10px;
  background: var(--card-bg); border-top: 1px solid var(--line);
  justify-content: space-between;
}
.batch-actions-panel .btn-sm { height: 32px; padding: 0 12px; font-size: 13px; flex: 1; min-width: 90px; }
.batch-actions-panel .btn-sm.primary { background: var(--brand); color: #fff; border: none; border-radius: 6px; }
.batch-actions-panel .btn-sm.outline { background: var(--card-bg); border-radius: 6px; border: 1px solid var(--line); }
.batch-actions-panel .btn-sm.danger { color: #F53F3F; border-color: #F53F3F; }
.batch-actions-panel .btn-sm:disabled { opacity: 0.4; cursor: not-allowed; }
.flow-page-footer {
  flex-shrink: 0;
  padding-bottom: max(4px, var(--safe-bottom));
  background: var(--bg-page);
  border-top: 1px solid var(--line);
}
.flow-page-footer .flow-primary-btn {
  margin: 8px 16px;
  width: calc(100% - 32px);
}
.flow-scroll-shell { margin-right: 2px; }
.flow-screen .navbar,
.flow-screen .flow-page-footer,
#page-upload .navbar,
#page-upload .upload-page-footer,
#page-template .navbar,
#page-profile .navbar,
[id^="page-settings-"] .navbar {
  flex-shrink: 0;
}
.upload-page-footer {
  flex-shrink: 0;
  padding: 8px 16px max(12px, var(--safe-bottom));
  background: var(--card-bg);
  border-top: 1px solid var(--line);
}
.upload-form-actions {
  display: flex;
  gap: 10px;
}
.upload-form-actions .btn-block {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  width: auto;
  height: 40px;
  line-height: 38px;
  font-size: 14px;
}
.upload-form-actions .upload-action-btn {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}
.upload-form-actions .upload-action-btn:active {
  background: var(--brand-bg);
  opacity: 1;
}
.upload-form-actions .upload-action-btn.is-selected {
  border-color: var(--brand);
  font-weight: 600;
  background: #fff;
  color: var(--brand);
}
.upload-page-scroll,
.profile-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.screen.active#page-template > *:not(.long-img-preview):not(.tab-bar) {
  flex-shrink: 0;
}
.screen.active#page-template .long-img-preview {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
}
.desc-page-body { padding-bottom: 12px; }
.desc-section-head { padding: 12px 16px 8px; }
.desc-section-title { font-size: 17px; font-weight: 600; }
.desc-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.desc-textarea-wrap { padding: 0 16px; }
.desc-ai-block {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 8px solid var(--bg-page);
}
.desc-ai-block-head {
  padding: 12px 16px 0;
}
.desc-ai-block-title {
  font-size: 14px;
  font-weight: 600;
}
.desc-polish-block .desc-ai-actions {
  padding-top: 12px;
}
.desc-polish-block .compare-container {
  padding: 8px 16px 12px;
}
.selling-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px 0;
}
.selling-head-title { font-size: 14px; font-weight: 600; }
.selling-head-sub { font-weight: 400; color: var(--text-secondary); font-size: 12px; }
.selling-tag-hint { margin-top: 8px; font-size: 13px; color: var(--brand); padding: 0 16px; }
.desc-ai-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 16px;
}
.polish-status { font-size: 13px; color: var(--text-secondary); }
.desc-preview-block { padding: 8px 16px 0; }
.desc-preview-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.compare-container { padding: 0 16px 12px; }
.compare-head {
  display: flex; justify-content: space-between; margin-bottom: 4px;
}
.compare-head-title { font-size: 13px; font-weight: 500; }
.compare-head-ver { font-size: 12px; color: var(--text-secondary); }
.compare-actions { display: flex; gap: 8px; margin-bottom: 4px; }

/* Safari / iOS：输入框 ≥16px 防止聚焦自动放大 */
@supports (-webkit-touch-callout: none) {
  .desc-input,
  .price-field input,
  .model-field input,
  .search-bar input,
  .dealer-field,
  .share-textarea,
  .settings-page-body input,
  .settings-page-body textarea,
  .settings-page-body select {
    font-size: 16px;
  }
  .list-scroll-panel,
  .settings-page-body,
  .upload-page-scroll,
  .profile-scroll-body,
  .screen.active#page-template .long-img-preview {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
}
/* iOS 键盘弹起时底栏上移，避免遮挡输入框 */
.is-ios .tab-bar {
  transform: translateX(-50%) translateY(calc(-1 * var(--keyboard-offset, 0px)));
  transition: transform 0.15s ease;
}
.is-ios .flow-screen .navbar,
.is-ios #page-upload .navbar,
.is-ios #page-template .navbar,
.is-ios #page-profile .navbar,
.is-ios [id^="page-settings-"] .navbar {
  padding-top: max(0px, var(--safe-top));
}
.list-scroll-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 4px 0 0;
}
.list-scroll-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #C5C5C5 #E8E8E8;
  padding-right: 14px;
  transform: translateZ(0);  /* 强制GPU合成层 */
}
.list-scroll-panel::-webkit-scrollbar { width: 10px; }
.list-scroll-panel::-webkit-scrollbar-track {
  background: #E8E8E8;
  border-radius: 10px;
  margin: 6px 0;
}
.list-scroll-panel::-webkit-scrollbar-thumb {
  background: #C5C5C5;
  border-radius: 10px;
  min-height: 48px;
}
.list-scrollbar {
  position: absolute;
  top: 6px;
  right: 2px;
  bottom: 6px;
  width: 8px;
  background: #E8E8E8;
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
}
.list-scrollbar.hidden { display: none; }
.list-scrollbar-thumb {
  width: 100%;
  background: #B8B8B8;
  border-radius: 8px;
  min-height: 40px;
  will-change: transform;
}
/* 产品页 / 图库页不显示右侧自定义滑条（保留描述页等其它滚动区） */
#page-list .list-scrollbar,
#page-gallery .list-scrollbar {
  display: none !important;
}
#page-list .list-scroll-panel,
#page-gallery .list-scroll-panel {
  padding-right: 8px;
  scrollbar-width: none;
}
#page-list .list-scroll-panel::-webkit-scrollbar,
#page-gallery .list-scroll-panel::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
@media (min-width: 520px) {
  .list-scrollbar { display: none; }
  .list-scroll-panel { padding-right: 8px; }
}
@media (max-width: 519px) {
  .list-scroll-panel {
    scrollbar-width: none;
    padding-right: 12px;
  }
  .list-scroll-panel::-webkit-scrollbar { display: none; }
}

/* ===== Summary Bar ===== */
.summary-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  font-size: 13px; color: var(--text-secondary);
}
.summary-bar .count { font-weight: 500; color: var(--brand); }
.summary-actions { display: flex; align-items: center; gap: 12px; }
.select-all-btn {
  border: none; background: none; padding: 0;
  font-size: 13px; color: var(--brand); cursor: pointer;
}
.select-all-btn:active { opacity: 0.7; }

/* ===== Template Selector ===== */
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 16px; }
.template-item { border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.template-item.active { border-color: var(--brand); }
.template-item .preview { height: 80px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.template-item .name { text-align: center; font-size: 12px; padding: 6px 0 2px; color: var(--text-secondary); }

/* 图片布局选择 */
.layout-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px 16px; }
.layout-item { border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; background: #F5F5F5; }
.layout-item.active { border-color: var(--brand); }
.layout-item .preview { height: 60px; display: flex; align-items: center; justify-content: center; }
.layout-item .preview svg { width: 40px; height: 40px; }
.layout-item .name { text-align: center; font-size: 11px; padding: 4px 0 2px; color: var(--text-secondary); }

/* 模板页面优化布局 */
.template-layout-bar {
  padding: 8px 10px 4px;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--card-bg);
}
.template-layout-unified {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.template-layout-unified .template-mini-grid,
.template-layout-unified .layout-mini-grid {
  display: contents;
}
.template-layout-unified .template-item,
.template-layout-unified .layout-item {
  flex: 1 1 0;
  min-width: 0;
}
.template-mini-grid .template-item,
.layout-mini-grid .layout-item {
  min-width: 0;
  width: auto;
}
.template-mini-grid .template-item {
  border-radius: 6px;
  border-width: 1.5px;
}
.template-mini-grid .template-item .preview {
  height: 28px;
  font-size: 10px;
  border-radius: 4px;
}
.template-mini-grid .template-item .name {
  font-size: 11px;
  padding: 2px 0 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layout-mini-grid .layout-item {
  border-radius: 6px;
  border-width: 1.5px;
}
.layout-mini-grid .layout-item .preview {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.layout-mini-grid .layout-item .preview svg {
  width: 22px;
  height: 22px;
}
.layout-mini-grid .layout-item .name {
  font-size: 11px;
  padding: 2px 0 0;
  text-align: center;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  padding: 2px 12px;
  font-size: 13px;
  font-weight: 600;
}
.preview-header-divider {
  align-items: center;
  gap: 10px;
  padding: 8px 12px 6px;
}
.preview-header-line {
  flex: 1;
  height: 0;
  border-top: 1px dashed var(--line);
  min-width: 0;
}
.preview-header-title {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.poster-export-hint {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand, #07C160);
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(7, 193, 96, 0.08);
}
.preview-header span:last-child {
  color: var(--text-secondary);
  font-size: 11px;
}
.long-img-preview {
  flex: 1;
  min-height: 200px;
  max-height: none;
  overflow-y: auto;
  background: #F8F8F8;
  margin: 0 12px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px;
}
.long-img-preview img {
  max-width: 100%;
  border-radius: 4px;
}
.long-img-preview.loading {
  background: #F8F8F8 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50" y="55" text-anchor="middle" font-size="14" fill="#999">加载中...</text></svg>') center no-repeat;
}
.action-buttons-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px 4px;
}
.btn-action {
  flex: 1;
  height: 40px;
  line-height: 40px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  background: var(--card-bg);
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn-action.primary {
  background: var(--success);
  color: #fff;
  border: none;
}
.btn-action:active { opacity: 0.85; }

/* 模板页底部：默认选中「确定」，分享/保存为描边样式 */
.action-buttons-row .template-action-btn {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}
.action-buttons-row .template-action-btn:active {
  background: var(--brand-bg);
  opacity: 1;
}
.action-buttons-row .template-action-btn.is-selected {
  background: var(--adm-color-primary, var(--brand));
  color: #fff;
  border: none;
  font-weight: 600;
}
.action-buttons-row .template-action-btn.is-selected:active {
  background: var(--adm-color-primary-tap, var(--brand-tap));
  opacity: 0.85;
}

/* 模板页底部三按钮（legacy，保留兼容） */
.action-buttons-row .btn-action:not(.template-action-btn) {
  background: var(--adm-color-primary, var(--brand));
  color: #fff;
  border: none;
}
.action-buttons-row .btn-action:active {
  background: var(--adm-color-primary-tap, var(--brand-tap));
  opacity: 0.85;
}

/* ===== Dialog (微信风格) ===== */
.dialog-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--mask);
  z-index: var(--z-dialog); display: none; align-items: center; justify-content: center;
}
.dialog-overlay.show { display: flex; }
/* F-UI-05: adm-dialog 嵌套在 flex overlay 内时取消 fixed 定位 */
.dialog-overlay.adm-dialog-mask .adm-dialog {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  animation: none;
}
.dialog-overlay.adm-dialog-mask .adm-dialog-header {
  padding-top: 20px;
}
.dialog-overlay.adm-dialog-mask .adm-dialog-body {
  padding-bottom: 8px;
}
.dialog-overlay.adm-dialog-mask .adm-dialog-footer .adm-button.confirm-del {
  color: var(--error);
  font-weight: 500;
}
.dialog {
  background: var(--card-bg); border-radius: 14px;
  width: 280px; padding: 24px 20px 0;
  text-align: center; overflow: hidden;
}
.dialog h3 { font-size: 17px; font-weight: 500; margin-bottom: 8px; color: var(--text-primary); }
.dialog p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 20px; }
.dialog-actions { display: flex; border-top: 1px solid var(--line); margin: 0 -20px; }
.dialog-actions button {
  flex: 1; height: 48px; line-height: 48px; padding: 0;
  border: none; font-size: 16px; cursor: pointer;
  background: var(--card-bg);
}
.dialog-actions button:active { background: var(--bg-page); }
.dialog-actions .cancel { color: var(--text-secondary); }
.dialog-actions .confirm-del { color: var(--error); font-weight: 500; }
.dialog-actions button + button { border-left: 1px solid var(--line); }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78);
  color: #fff; padding: 12px 28px;
  border-radius: 10px; font-size: 15px;
  z-index: var(--z-toast); display: none;
  white-space: nowrap;
  animation: fadeIn .2s ease;
}

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .icon { font-size: 56px; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 17px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--text-secondary); }

/* ===== Input ===== */
input[type="text"], input[type="number"] {
  height: 44px; padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 16px; color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--brand); }
input::placeholder { color: #C0C0C0; }

/* ===== Utilities ===== */
.multi-bar {
  background: var(--brand-bg);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--brand);
}

/* ===== AI Polish ===== */
.ai-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 6px;
  border: none; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: opacity .15s;
  background: linear-gradient(135deg, #07C160, #95EC69);
  color: #fff;
}
.ai-btn:active { opacity: 0.8; }
.ai-btn.spinning { pointer-events: none; opacity: 0.7; }
.ai-btn .spin { display: none; animation: spin .8s linear infinite; }
.ai-btn.spinning .spin { display: inline-block; }
.ai-btn.spinning .label { display: none; }
.ai-btn-icon-only {
  padding: 8px 12px;
  min-width: 40px;
  justify-content: center;
}
.ai-btn-icon-only .label {
  font-size: 16px;
  line-height: 1;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.compare-box {
  border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
  margin: 12px 0;
}
.compare-header {
  display: flex; border-bottom: 1px solid var(--line);
}
.compare-header span {
  flex: 1; text-align: center; padding: 8px;
  font-size: 12px; color: var(--text-secondary);
  background: var(--bg-page);
}
.compare-header span.active { background: var(--card-bg); color: var(--brand); font-weight: 500; }
.compare-body { padding: 12px; font-size: 14px; line-height: 1.6; min-height: 60px; color: var(--text-primary); }
.compare-body .placeholder { color: #C0C0C0; }

.desc-input {
  width: 100%; min-height: 120px; padding: 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 16px; font-family: inherit; line-height: 1.6;
  color: var(--text-primary); resize: vertical;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.desc-input:focus { outline: none; border-color: var(--brand); }

.photo-thumb { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; position: absolute; inset: 0; }
.photo-item { overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.long-img-preview img,
.long-img-preview object { width: 100%; display: block; min-height: 200px; }
.search-bar { padding: 0 16px 8px; }
.search-bar input { width: 100%; }
.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
.loading { opacity: 0.6; pointer-events: none; }

.poster-generating {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8fffb 0%, #ffffff 100%);
}

.poster-progress {
  width: 100%;
  padding: 28px 20px 24px;
  text-align: center;
}

.poster-progress-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 14px;
}

.poster-progress-ring svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.poster-progress-track {
  fill: none;
  stroke: #e8f8ef;
  stroke-width: 8;
}

.poster-progress-arc {
  fill: none;
  stroke: var(--brand);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.18s ease;
  will-change: stroke-dashoffset;
}

.poster-progress-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand);
}

.poster-progress-label {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.poster-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #eef7f1;
  overflow: hidden;
}

.poster-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #07C160, #95EC69);
  transition: width 0.18s ease;
  will-change: width;
}

.poster-progress--waiting .poster-progress-arc {
  animation: poster-arc-pulse 1.6s ease-in-out infinite;
}

.poster-progress--waiting .poster-progress-fill {
  background: linear-gradient(
    90deg,
    #07C160 0%,
    #95EC69 40%,
    #07C160 80%,
    #95EC69 100%
  );
  background-size: 200% 100%;
  animation: poster-bar-flow 1.8s linear infinite;
}

.poster-progress--waiting .poster-progress-pct {
  animation: poster-pct-pulse 1.6s ease-in-out infinite;
}

.poster-progress--waiting .poster-progress-label {
  animation: poster-label-fade 1.6s ease-in-out infinite;
}

.poster-progress--done .poster-progress-success {
  animation: poster-pop 0.45s ease;
}

.poster-progress-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(7, 193, 96, 0.28);
}

.poster-progress-done-text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.poster-progress-error {
  padding: 32px 16px;
  text-align: center;
  color: var(--error);
  font-size: 14px;
}

@keyframes poster-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes poster-arc-pulse {
  0%, 100% { opacity: 1; stroke-width: 8; }
  50% { opacity: 0.55; stroke-width: 7; }
}

@keyframes poster-bar-flow {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes poster-pct-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.88; }
}

@keyframes poster-label-fade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.poster-fade-in img {
  animation: poster-image-in 0.35s ease;
}

@keyframes poster-image-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.desc-preview {
  min-height: 72px; padding: 12px; border-radius: 8px;
  background: #F9F9F9; border: 1px solid #E5E5E5;
  font-size: 14px; line-height: 1.6; color: #1A1A1A;
  white-space: pre-wrap; word-break: break-all;
}
.desc-preview.empty { color: #C0C0C0; }

.dealer-settings {
  margin: 0 16px 24px; padding: 16px;
  background: var(--card-bg); border-radius: 12px;
  border: 1px solid var(--line);
}
.dealer-settings-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.dealer-settings-title .version-badge,
.profile-version-inline .version-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  background: rgba(7, 193, 96, 0.12);
  border-radius: 6px;
  vertical-align: middle;
}
.profile-version-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}
.profile-version-inline .version-badge {
  margin-left: 0;
  color: var(--text-secondary);
  background: transparent;
  padding: 0;
  font-weight: 400;
}
.profile-version-inline .profile-version-label {
  color: var(--text-secondary);
}
.storage-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--line);
}
.storage-stat-row:last-child { border-bottom: none; }
.storage-stat-row strong { color: var(--text-primary); font-weight: 600; }
.storage-stats { margin: 8px 0 12px; }
.storage-quota-warn {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #b45309;
  background: #fffbeb;
  border-radius: 8px;
  border: 1px solid #fde68a;
}
.storage-toggle-row { margin: 8px 0 4px; }
.login-panel { margin: 0 16px 16px; padding: 16px; background: #F7F7F7; border-radius: 12px; }
/* ICP 备案号（展示于启动首屏宣传图底部） */
.splash-icp-footer {
  flex-shrink: 0;
  width: 100%;
  padding: 2px 12px calc(4px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-secondary);
  background: #fff;
}
.splash-icp-footer a {
  color: inherit;
  text-decoration: none;
}
.splash-icp-footer a:active {
  opacity: 0.72;
  text-decoration: underline;
}
.app-boot-pending { visibility: hidden; }
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #fff;
  padding-top: env(safe-area-inset-top, 0px);
  cursor: pointer;
}
.splash-countdown {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.65);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  user-select: none;
}
.splash-screen.hidden { display: none; }
.splash-screen-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.splash-screen-body picture {
  display: block;
  width: 100%;
  max-height: 100%;
}
.splash-screen-body img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: bottom center;
  background: #fff;
}
.guide-screen {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.guide-screen.hidden { display: none; }
.guide-screen .guide-carousel {
  flex: 1;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.guide-start-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
}
.guide-carousel {
  margin: -4px -4px 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  touch-action: pan-y;
}
.guide-carousel-viewport {
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.guide-carousel-track {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}
.guide-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
}
.guide-carousel-slide picture,
.guide-carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  aspect-ratio: auto;
  background: #f5f5f5;
}
.guide-carousel-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px 12px;
  background: #fff;
}
.guide-screen .guide-carousel-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 45%, #fff 100%);
  pointer-events: none;
}
.guide-screen .guide-carousel-footer .guide-carousel-dot {
  pointer-events: auto;
}
.guide-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.guide-carousel-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #d9d9d9;
  cursor: pointer;
}
.guide-carousel-dot.active {
  width: 16px;
  background: var(--brand);
}
.guide-carousel-caption {
  margin: 0;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}
.login-submit-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.login-submit-stack .login-code-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 108px;
  padding: 0 12px;
  margin: 0;
  white-space: nowrap;
}
.login-submit-stack .login-submit-btn {
  width: 100%;
  margin: 0;
}
.login-dev-hint { margin-top: 8px; font-size: 12px; color: #999; }
.quota-bar { font-size: 13px; color: #666; margin: 0 0 8px; }
.quota-bar.warn { color: #F53F3F; font-weight: 600; }
.trial-bar { font-size: 13px; color: #666; margin: 0 0 8px; }
.trial-bar.warn { color: #F53F3F; font-weight: 600; }
.trial-bar.ok { color: #07C160; }
.paywall-dialog .paywall-contact { font-size: 13px; color: #999; margin-top: 8px; }
.dealer-settings-hint { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.settings-hub { margin: 0 16px 16px; }
.settings-nav-btn {
  display: block; width: 100%; margin: 0 0 10px; padding: 14px 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card-bg);
  font-size: 15px; text-align: left; cursor: pointer; color: var(--text-primary);
}
.settings-nav-btn:active { background: var(--bg-page); }
.settings-page-body {
  padding: 0 16px 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.screen.active[id^="page-settings-"] .settings-page-body {
  padding-bottom: max(24px, var(--safe-bottom));
}
.settings-meta { font-size: 12px; color: #999; margin: 8px 0 12px; }
.settings-form-fields { display: flex; flex-direction: column; gap: 0; }
.settings-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.settings-form-actions .btn-block {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0;
}
.settings-check-row {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 16px;
  font-size: 14px; color: var(--text-primary);
}
.settings-check-row input { width: 18px; height: 18px; }
.settings-field-block { margin: 12px 0 16px; }
.settings-radio-group {
  display: flex; gap: 20px; margin-top: 8px;
}
.settings-radio-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text-primary);
}
.settings-radio-row input { width: 18px; height: 18px; }
.settings-error { color: #F53F3F; font-size: 13px; padding: 12px 0; }
.users-admin-page .dealer-settings { padding-bottom: 24px; }
.users-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px;
}
.users-stat-card {
  background: var(--bg-page); border-radius: 10px; padding: 12px 8px; text-align: center;
}
.users-stat-card .num { display: block; font-size: 22px; font-weight: 700; color: var(--text-primary); }
.users-stat-card .lbl { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.users-stat-card.ok .num { color: #07C160; }
.users-stat-card.warn .num { color: #F53F3F; }
.users-summary-extra { font-size: 12px; color: #999; margin: 0 0 16px; }
.users-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.users-toolbar .dealer-field { flex: 1; margin: 0; }
.users-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.users-filter-chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card-bg); font-size: 12px; cursor: pointer;
}
.users-filter-chip.active { background: #E8F8EF; border-color: #07C160; color: #07C160; }
.users-admin-list { display: flex; flex-direction: column; gap: 10px; }
.users-batch-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-page); border: 1px solid var(--line);
}
.users-batch-bar.hidden { display: none; }
.users-select-all {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer;
}
.users-selected-count { font-size: 12px; color: var(--text-secondary); flex: 1; }
.users-row {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card-bg);
}
.users-row.selected { border-color: #F53F3F; background: #FFF7F7; }
.users-row-check { flex: 0 0 auto; padding-top: 2px; }
.users-row-check input { width: 18px; height: 18px; }
.users-row-body { flex: 1; min-width: 0; }
.users-row-phone { font-size: 16px; font-weight: 600; }
.users-row-sub { font-size: 12px; color: #999; margin-top: 4px; }
.users-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.users-row-metrics {
  display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 10px 0; font-size: 12px; color: #666;
}
.users-row-actions { display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.users-row-actions-main { display: flex; flex-wrap: wrap; gap: 8px; }
.users-row-actions .btn-sm.danger { color: #F53F3F; border-color: #F53F3F; }
.users-row-actions .btn-sm.danger:disabled { opacity: 0.45; }
.users-batch-bar .btn-sm.danger { background: #F53F3F; color: #fff; border-color: #F53F3F; }
.users-batch-bar .btn-sm.danger:disabled { opacity: 0.45; }
.users-status-tag {
  font-size: 11px; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  background: #F5F5F5; color: #666;
}
.users-status-tag.status-paid { background: #E8F8EF; color: #07C160; }
.users-status-tag.status-trial_active { background: #E8F8EF; color: #00A870; }
.users-status-tag.status-trial_expired,
.users-status-tag.status-limit_reached { background: #FFF0ED; color: #F53F3F; }
.users-empty { text-align: center; color: #999; padding: 24px 0; font-size: 13px; }
.field-label { display: block; font-size: 13px; color: var(--text-secondary); margin: 12px 0 6px; }
.dealer-field {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: inherit; box-sizing: border-box;
}
.dealer-field:focus { outline: none; border-color: var(--brand); }
.qrcode-upload {
  width: 100%; min-height: 120px; margin-top: 6px;
  border: 1px dashed var(--line); border-radius: 8px;
  background: var(--bg-page); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; position: relative;
}
.qrcode-upload img {
  max-width: 120px; max-height: 120px; border-radius: 8px; display: block;
}
.qrcode-upload img.hidden { display: none; }
.qrcode-upload span { font-size: 14px; color: var(--text-secondary); }
.dealer-settings .btn-block { margin-top: 16px; }

/* 我的页：卡片内主按钮绝对居中，宽度约为原来一半 */
#profile-authed .dealer-settings .btn-block.adm-button.adm-button--block,
#profile-authed .logout-btn-non-admin.btn-block.adm-button.adm-button--block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  max-width: 50%;
  margin: 16px auto 12px;
  height: 40px;
  line-height: 1.2;
  font-size: 14px;
  padding: 0 12px;
  box-sizing: border-box;
}
#profile-authed .dealer-settings .btn-block.outline {
  line-height: 1.2;
}

.server-settings-panel.hidden { display: none; }

.pwa-install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-banner);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(7, 193, 96, 0.96);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 13px;
}
.pwa-install-banner,
.pwa-success-toast {
  display: none !important;
}
.pwa-install-banner.hidden { display: none; }
.pwa-install-banner button {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: var(--brand);
  font-weight: 600;
}

/* 表单验证样式 */
.field-error {
  color: #D32F2F;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

.required {
  color: #D32F2F;
  font-size: 12px;
}

.field-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

/* Loading 动画增强 */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--brand);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.loading::after {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
}

/* Spinning 状态（按钮专用） */
.btn.spinning {
  position: relative;
  color: transparent;
}

.btn.spinning::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* iOS Safari 适配 */
/* 禁止弹性滚动 */
body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* 输入框字体 ≥16px 防止 iOS 自动缩放 */
input, textarea, select {
  font-size: 16px;
}

/* 固定底部元素适配安全区域 */
.navbar-bottom, .tab-bar {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* 固定顶部元素适配安全区域 */
.header-bar, .navbar-top {
  padding-top: env(safe-area-inset-top, 0px);
}

/* 允许特定区域滚动 */
.scrollable, .page-content, .card-list {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* 100vh 正确计算（iOS Safari 地址栏问题） */
.full-height {
  height: calc(var(--vh, 1vh) * 100);
}

/* 按钮最小尺寸（iOS 人机界面指南：44px） */
.btn {
  min-height: 44px;
  min-width: 44px;
}

/* 触摸区域扩展（视觉小但触摸大） */
.btn-icon::after {
  content: '';
  position: absolute;
  inset: -8px;
}

/* iOS 模态框适配 */
.modal-overlay, .dialog-overlay {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== 骨架屏和加载动画 ===== */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
  will-change: background-position;
}

.skeleton-card {
  background: var(--card-bg);
  border-radius: 12px;
  margin: 8px 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton-card-body {
  display: flex;
  gap: 10px;
}
.skeleton-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.skeleton-actions .skeleton-line.btn {
  width: 72px;
  height: 32px;
}

.skeleton-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.skeleton-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  flex-shrink: 0;
}

.skeleton-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
}

.skeleton-line.title { width: 60%; height: 18px; }
.skeleton-line.code { width: 40%; }
.skeleton-line.meta { width: 70%; }
.skeleton-line.price { width: 30%; height: 22px; margin-top: 4px; }

/* ===== 空状态操作按钮 ===== */
.empty-state .btn-primary {
  margin-top: 20px;
  display: inline-block;
}

/* ===== 图片加载动画 ===== */
.card-img img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-img img.loaded {
  opacity: 1;
}

.card-img.loading {
  background: linear-gradient(90deg, #f5f5f5 25%, #ebebeb 50%, #f5f5f5 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1s ease-in-out infinite;
}

/* ===== 错误状态 ===== */
.error-state {
  text-align: center;
  padding: 60px 20px;
}

.error-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.error-state h3 {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.error-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
