/* AI 室内设计 - 移动端演示原型 公共样式 */
:root {
  --nav-w: 280px;
  --nav-w-collapsed: 56px;
  --shell-w: 390px;
  --shell-h: 844px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg-page: #e8ecf1;
  --bg-nav: #0f172a;
  --text-nav: #94a3b8;
  --text-nav-active: #fff;
  --radius: 12px;
  --font: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-page);
  color: #1e293b;
  overflow: hidden;
}

.demo-layout {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* —— 左侧页面导航 —— */
.page-nav {
  width: var(--nav-w);
  flex-shrink: 0;
  background: var(--bg-nav);
  color: var(--text-nav);
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
}

.page-nav.collapsed {
  width: var(--nav-w-collapsed);
}

.page-nav.collapsed .nav-brand span,
.page-nav.collapsed .nav-group-title,
.page-nav.collapsed .nav-link span,
.page-nav.collapsed .nav-hint {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.page-nav.collapsed .nav-link {
  justify-content: center;
  padding: 12px;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 56px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-nav-active);
  font-weight: 600;
  font-size: 15px;
}

.nav-brand i {
  color: var(--primary);
  font-size: 20px;
  flex-shrink: 0;
}

.nav-toggle {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #cbd5e1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-toggle:hover {
  background: rgba(255,255,255,0.14);
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 24px;
}

.nav-group {
  margin-bottom: 8px;
}

.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 8px 12px 6px;
  transition: opacity 0.2s;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-nav);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}

.nav-link i {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
}

.nav-link.active {
  background: rgba(37, 99, 235, 0.35);
  color: var(--text-nav-active);
}

.nav-link.sub {
  padding-left: 28px;
  font-size: 13px;
}

.nav-project-badge {
  font-size: 11px;
  color: #94a3b8;
  padding: 4px 12px 10px;
  line-height: 1.4;
  transition: opacity 0.2s;
}

.nav-divider {
  height: 1px;
  margin: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.nav-project-switch {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.nav-link.nav-project-switch:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.page-nav.collapsed .nav-project-badge {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  padding: 0;
  margin: 0;
  height: 0;
}

.nav-hint {
  font-size: 11px;
  color: #64748b;
  padding: 16px 12px 0;
  line-height: 1.5;
  transition: opacity 0.2s;
}

/* —— 主展示区 —— */
.demo-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-width: 0;
  background: linear-gradient(145deg, #dce4ed 0%, #eef2f6 50%, #e2e8f0 100%);
}

/* —— 手机壳 —— */
.phone-shell {
  --shell-pad: 12px;
  --notch-top: 18px;
  --notch-height: 28px;
  /* 屏内安全区：刘海底边 + 8px 间距（与 .phone-notch 几何一致） */
  --screen-safe-top: calc(var(--notch-top) + var(--notch-height) - var(--shell-pad) + 8px);
  width: calc(var(--shell-w) + 24px);
  padding: var(--shell-pad);
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  border-radius: 44px;
  box-shadow:
    0 0 0 2px #334155,
    0 24px 80px rgba(15, 23, 42, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
}

.phone-notch {
  position: absolute;
  top: var(--notch-top);
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: var(--notch-height);
  background: #0f172a;
  border-radius: 0 0 18px 18px;
  z-index: 20;
  pointer-events: none;
}

.phone-screen {
  width: var(--shell-w);
  height: var(--shell-h);
  background: #f1f5f9;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.phone-home-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: rgba(0,0,0,0.2);
  border-radius: 2px;
  z-index: 15;
  pointer-events: none;
}

/* 手机内滚动区 */
.app-viewport {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* 内容从刘海下方开始，避免标题被遮挡 */
  padding-top: var(--screen-safe-top, 42px);
}

.app-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 28px;
}

.app-scroll::-webkit-scrollbar {
  width: 4px;
}

.app-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* 通用手机内组件 */
.m-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 6px 12px 8px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.m-header-title {
  grid-column: 2;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
}

.m-header--stack .m-header-center {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.m-header--stack .m-header-title {
  grid-column: auto;
}

.m-header-meta {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-header-back {
  grid-column: 1;
  justify-self: start;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-header-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 40px;
  min-height: 36px;
}

.m-section {
  background: #fff;
  margin: 10px 12px;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.m-section + .m-section {
  margin-top: 12px;
}

.m-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-section-title .req {
  color: #ef4444;
  font-weight: 700;
  font-size: 16px;
  margin-left: 3px;
  line-height: 1;
}

/* 旧改 · 上传旧房照片：与自定义风格参考图保持一致 */
#upload .old-photo-hint {
  margin: -4px 0 12px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

#upload .old-photo-card {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#upload .old-photo-card.has-photos {
  border: 2px dashed #cbd5e1;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
}

#upload .old-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 140px;
  padding: 20px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

#upload .old-photo-empty-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

#upload .old-photo-empty-title {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
}

#upload .old-photo-empty-sub {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  max-width: 260px;
}

#upload .old-photo-filled {
  position: absolute;
  inset: 0;
}

#upload .old-photo-filled-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 2px;
}

#upload .old-photo-count {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

#upload .old-photo-add-more {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
}

#upload .old-photo-single,
#upload .old-photo-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#upload .old-photo-thumb {
  overflow: hidden;
  background: #e2e8f0;
}

#upload .old-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#upload .old-photo-thumb-del {
  display: none;
}

#upload .old-photo-add-cell {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
  font-family: inherit;
  flex-shrink: 0;
}

#upload .old-photo-add-cell:hover {
  border-color: #94a3b8;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
}

#upload .old-photo-replace {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
}

.m-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.m-tab {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.m-tab.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.m-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.m-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* 上传设计资料 · 图1 双栏 */
.m-section-upload {
  background: #f0f7fc;
  border: none;
  box-shadow: none;
}

.m-section-title-plain {
  margin-bottom: 14px;
}

.m-upload-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.m-upload-panel {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6fc 100%);
  min-height: 168px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.m-upload-panel:hover {
  border-color: #93c5fd;
}

.m-upload-panel-inner {
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
  min-height: 164px;
  justify-content: flex-start;
}

.m-upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.m-upload-icon-doc,
.m-upload-icon-image {
  background: #dbeafe;
  color: #2563eb;
  font-size: 20px;
}

.m-upload-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
  margin-bottom: 6px;
}

.m-upload-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.m-required {
  color: #dc2626;
  font-weight: 600;
}

.m-tag-optional {
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 2px 8px;
}

.m-upload-panel-hint {
  font-size: 10px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 0;
  flex: 1;
}

.m-upload-panel-effect .m-upload-panel-inner {
  justify-content: flex-start;
}

.m-upload-panel-effect .m-upload-panel-hint {
  margin-bottom: 10px;
}

.m-btn-row-pill {
  margin-top: auto;
  width: 100%;
  gap: 6px;
}

.m-btn-pill {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  border-radius: 20px;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
}

.m-btn-pill:active {
  background: #eff6ff;
}

.m-upload-panel-preview {
  position: absolute;
  inset: 0;
  background: #fff;
}

.m-upload-panel-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.m-upload-preview-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}

.m-preview-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.m-upload-row {
  display: flex;
  gap: 10px;
}

.m-upload-thumb {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: #e2e8f0;
}

.m-upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.m-upload-thumb .thumb-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
}

.m-upload-thumb .thumb-actions button {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
}

.m-upload-zone {
  flex: 1;
  min-height: 88px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
}

.m-upload-zone i {
  font-size: 24px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.m-upload-zone p {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.m-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.m-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}

.m-btn.primary-fill {
  background: var(--primary);
  color: #fff;
}

.style-mode-seg {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 12px;
}

.style-mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.style-mode-btn.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.style-block-label {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.style-custom-block {
  margin-top: 4px;
}

.style-custom-hint {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 12px;
}

.style-ref-panel {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.style-ref-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  color: #64748b;
  text-align: center;
}

.style-ref-empty i {
  font-size: 28px;
  color: var(--primary);
}

.style-ref-sub {
  font-size: 11px;
  color: #94a3b8;
}

.style-ref-preview {
  position: absolute;
  inset: 0;
}

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

.style-ref-del {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.style-ref-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

#style .m-style-scroll.is-locked {
  opacity: 0.45;
  pointer-events: none;
}

.style-section-head {
  margin-bottom: 12px;
  align-items: center;
}

.style-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px 4px 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}

.style-more-btn i {
  font-size: 10px;
  opacity: 0.85;
}

.style-more-btn:hover {
  color: var(--primary);
}

.m-style-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.m-style-scroll::-webkit-scrollbar {
  display: none;
}

.m-style-card {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
  height: 118px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s ease;
  background: #e2e8f0;
}

.m-style-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.m-style-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m-style-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  padding: 18px 4px 6px;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.72));
  pointer-events: none;
  line-height: 1.2;
}

.m-style-card.active span {
  font-weight: 600;
}

.m-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.m-switch.on {
  background: var(--primary);
}

.m-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.m-switch.on::after {
  transform: translateX(20px);
}

.m-switch.is-readonly {
  cursor: default;
  pointer-events: none;
}

#style .m-style-scroll.is-locked {
  opacity: 0.42;
  pointer-events: none;
}

.m-textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  color: #334155;
}

.m-textarea::placeholder {
  color: #94a3b8;
}

.m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.m-chip {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  background: #e8f0fe;
  color: #2563eb;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
}

.m-chip:hover {
  background: #dbeafe;
}

.m-fab-area {
  padding: 12px 16px 20px;
  background: linear-gradient(180deg, transparent, #f1f5f9 30%);
  flex-shrink: 0;
}

.m-fab {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.m-fab:active {
  transform: scale(0.98);
}

.m-fab i {
  animation: sparkle 1.5s ease infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* AI 扩图页 */
.expand-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  overflow-x: auto;
}

.expand-topbar .logo-mini {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.expand-tools {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.expand-tool {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.expand-tool.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.expand-canvas-wrap {
  flex: 1;
  display: flex;
  min-height: 0;
  background: #e8eef4;
}

.expand-history {
  width: 56px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.expand-history .hist-label {
  font-size: 9px;
  color: #64748b;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 2px;
}

.expand-history .hist-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
}

.expand-history .hist-thumb.active {
  border-color: var(--primary);
}

.expand-history .hist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.expand-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
}

.expand-canvas .main-img {
  max-width: 55%;
  max-height: 85%;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.15);
  transition: transform 0.3s;
}

.expand-help {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
}

.expand-help button {
  border: none;
  background: rgba(255,255,255,0.9);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #475569;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.modal-box h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.modal-box p {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}

.modal-box button {
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

/* 房间属性 */
.room-attrs .field-full {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 12px;
  color: #334155;
  margin-bottom: 6px;
  display: block;
}

.field-label .req {
  color: #ef4444;
  margin-left: 2px;
}

.m-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

.m-input::placeholder {
  color: #94a3b8;
}

.m-input:focus {
  outline: none;
  border-color: var(--primary);
}

.input-with-unit {
  display: flex;
  align-items: stretch;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-unit:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.input-with-unit .m-input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-height: 0;
  height: auto;
  box-shadow: none;
}

.input-with-unit .m-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.input-with-unit .unit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  flex-shrink: 0;
  min-width: 44px;
}

/* 带尾部图标的输入：与 .m-input 同一条边框，无拼接灰块 */
.m-field {
  position: relative;
  display: block;
}

.m-field--trail .m-input {
  padding-right: 44px;
}

.m-field-trail {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.m-field-trail:active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.m-field:focus-within .m-field-trail {
  color: #64748b;
}

.customer-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customer-fields .m-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
  padding: 10px 12px;
}

/* 上传设计资料 · 单列 */
.upload-dual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.upload-panel {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  padding: 14px 10px;
  text-align: center;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.upload-panel.has-image {
  padding: 0;
  border-style: solid;
  border-color: var(--primary);
  cursor: default;
}

.upload-panel.has-image .upload-panel-empty {
  display: none !important;
}

.upload-panel.has-image .panel-actions {
  display: none !important;
}

.upload-panel.has-image img {
  width: 100%;
  height: 100%;
  min-height: 168px;
  object-fit: cover;
  border-radius: 10px;
  display: block !important;
}

.upload-panel .panel-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
}

.upload-panel .panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

.upload-panel .panel-title .req {
  color: #ef4444;
}

.upload-panel .panel-desc {
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 10px;
  padding: 0 4px;
}

.upload-panel .badge-optional {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  background: #e0f2fe;
  color: #0284c7;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 500;
}

.upload-panel .panel-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  padding: 0 6px;
}

.upload-panel .panel-actions .m-btn {
  flex: 1;
  font-size: 11px;
  padding: 6px 4px;
}

.upload-panel .panel-actions--single {
  justify-content: center;
  padding: 0 12px;
}

.upload-panel .panel-actions--single .m-btn {
  flex: 1;
  max-width: 100%;
}

.classic-upload-panel {
  min-height: 0;
  padding: 12px 10px;
  justify-content: flex-start;
  cursor: default;
}

.classic-upload-panel .panel-icon {
  width: 40px;
  height: 40px;
  font-size: 18px;
  margin-bottom: 6px;
}

.classic-upload-panel .panel-desc {
  margin-bottom: 8px;
}

.classic-upload-panel .panel-actions .m-btn {
  padding: 5px 4px;
}

.classic-upload-panel .panel-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}

.classic-upload-panel .panel-count[hidden] {
  display: none;
}

.classic-upload-panel .upload-strip:empty {
  display: none;
}

.classic-upload-panel.has-photos {
  padding: 10px 10px 8px;
}

.classic-upload-panel.has-photos .panel-icon,
.classic-upload-panel.has-photos .panel-desc {
  display: none;
}

.classic-upload-panel.has-photos .panel-title {
  margin-bottom: 6px;
}

.classic-upload-panel.has-photos .panel-actions {
  padding: 0 2px;
}

.classic-upload-panel.has-photos .upload-strip:not(:empty) {
  display: flex;
  width: 100%;
  margin-top: 8px;
  padding: 0 2px 0;
}

.upload-panel .panel-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

/* 多图上传（旧房 / 效果图） */
.upload-block {
  margin-bottom: 16px;
}

.upload-block:last-child {
  margin-bottom: 0;
}

.upload-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.upload-block-head .label {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.upload-block-head .label .req {
  color: #ef4444;
}

.upload-block-head .count {
  font-size: 11px;
  color: #64748b;
  flex-shrink: 0;
}

.upload-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.upload-strip::-webkit-scrollbar {
  height: 4px;
}

.upload-thumb-item {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
}

.upload-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-thumb-item .thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-add-tile {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  gap: 4px;
}

.upload-add-tile i {
  font-size: 20px;
}

.upload-add-tile span {
  font-size: 10px;
  color: #64748b;
}

.upload-block-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.upload-block-actions .m-btn {
  flex: 1;
  font-size: 12px;
  padding: 8px 10px;
}

.upload-block-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
  line-height: 1.4;
}

/* 房间名称 · 文本输入 + 聚焦时显示常用标签 */
.room-name-field .field-label {
  margin-bottom: 8px;
}

.room-name-field > .m-input {
  width: 100%;
}

.room-preset-block {
  margin-top: 12px;
}

.room-preset-block[hidden] {
  display: none !important;
}

.room-preset-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.room-preset-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: #1f2937;
  flex-shrink: 0;
}

.room-preset-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.2;
}

.room-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
}

.room-preset-chip {
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.2;
  color: #374151;
  background: #f5f6f8;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.room-preset-chip:active {
  opacity: 0.85;
}

.room-preset-chip.active {
  background: #e8f0fe;
  color: var(--primary);
  font-weight: 500;
}

.room-preset-empty {
  margin: 4px 0 0;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

.room-preset-empty[hidden] {
  display: none !important;
}

.room-attrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.room-attrs .field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #334155;
}

.room-attrs .m-input {
  height: 44px;
  padding: 0 12px;
  font-size: 14px;
  line-height: 22px;
}

.room-attrs .input-with-unit {
  height: 44px;
}

.room-attrs .input-with-unit .m-input {
  height: 100%;
  padding: 0 10px 0 12px;
}

.room-attrs .m-select {
  height: 44px;
  padding: 0 32px 0 12px;
  font-size: 14px;
  background-color: #fff;
}

.upload-block-v2 .upload-source-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 420px) {
  .upload-block-v2 .upload-source-row {
    grid-template-columns: 1fr;
  }
}

.upload-block-v2 {
  position: relative;
  overflow: hidden;
}

.upload-block-v2::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(37,99,235,0.04), transparent 35%), radial-gradient(circle at top right, rgba(37,99,235,0.025), transparent 28%);
  pointer-events: none;
}

.upload-block-v2 > * {
  position: relative;
  z-index: 1;
}

.upload-card-head,
.m-section-title {
  letter-spacing: -0.01em;
}

.upload-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.upload-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.upload-card-title .icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(37,99,235,0.12);
}

.upload-card-count {
  font-size: 12px;
  color: #64748b;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 10px;
}

.upload-card-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.4;
  max-width: 240px;
}

.source-card {
  min-height: 80px;
}

.upload-thumb-item,
.upload-add-tile {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.upload-thumb-item {
  border: 1px solid rgba(219,229,245,0.95);
}

.upload-thumb-item .thumb-del {
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: rgba(15,23,42,0.72);
  backdrop-filter: blur(6px);
}

.upload-card:first-child { margin-top: 0; }

.source-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 16px 10px;
  border: 1px solid #dce6f4;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  min-height: 88px;
  box-shadow: 0 8px 20px rgba(15,23,42,0.04);
}

.source-card:active {
  transform: scale(0.98);
}

.source-card i {
  font-size: 22px;
  color: var(--primary);
}

.source-card .t {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.source-card .d {
  font-size: 10px;
  color: #94a3b8;
}

.source-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
}

.upload-block-v2 .upload-strip {
  min-height: 4px;
}

.upload-block-v2 .upload-strip:empty {
  display: none;
}

.upload-block-v2 .upload-strip:not(:empty) {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

/* 效果图库 · 移动端全屏层 */
.gallery-sheet {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: #fff;
  display: none;
  flex-direction: column;
}

.gallery-sheet.show {
  display: flex;
}

.gallery-m-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 8px;
  padding-top: var(--screen-safe-top, 42px);
  background: #fff;
  border-bottom: 1px solid #eef2f7;
  flex-shrink: 0;
}

.gallery-m-back {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-m-header-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.gallery-m-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.gallery-m-subtitle {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.gallery-m-done {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

.gallery-m-done:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.gallery-m-toolbar {
  padding: 10px 12px 8px;
  background: #fff;
  flex-shrink: 0;
}

.gallery-m-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.gallery-m-search i {
  color: #94a3b8;
  font-size: 14px;
  flex-shrink: 0;
}

.gallery-m-search input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 14px;
  outline: none;
  min-width: 0;
  color: #0f172a;
}

.gallery-m-search input::placeholder {
  color: #94a3b8;
}

.gallery-m-actions {
  display: flex;
  gap: 8px;
}

.gallery-m-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
}

.gallery-m-action i {
  color: var(--primary);
  font-size: 13px;
}

.gallery-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 12px 10px;
  font-size: 13px;
  color: #64748b;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.gallery-path-item {
  border: none;
  background: none;
  padding: 4px 2px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
}

.gallery-path-item.is-current {
  color: #0f172a;
  font-weight: 600;
  cursor: default;
}

.gallery-path-item:not(.is-current):hover {
  color: var(--primary);
}

.gallery-path-sep {
  color: #cbd5e1;
  font-size: 11px;
  user-select: none;
}

.gallery-m-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f8fafc;
}

.gallery-section-label {
  padding: 12px 14px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.gallery-grid {
  padding: 0 12px 16px;
}

.gallery-grid.is-root {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-grid.is-files {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px 3px 16px;
}

.gallery-folder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px 14px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eef2f7;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.gallery-folder-card:active {
  background: #f8fafc;
}

.gallery-folder-card .folder-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, #dbeafe, #eff6ff);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
}

.gallery-folder-card .folder-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-all;
}

.gallery-folder-card .folder-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
}

.gallery-file {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
}

.gallery-file-cover {
  width: 100%;
  height: 100%;
  position: relative;
}

.gallery-file img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-file-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(15, 23, 42, 0.25);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.gallery-file.selected .gallery-file-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.gallery-file.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--primary);
  pointer-events: none;
}

.gallery-file .tag,
.gallery-file .fname,
.gallery-file .fsize {
  display: none;
}

.gallery-file-list .gallery-file {
  grid-column: span 1;
}

.gallery-file-list .gallery-file-meta {
  display: block;
  padding: 6px 8px 8px;
  background: #fff;
}

.gallery-file-list .gallery-file .fname {
  display: block;
  font-size: 11px;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-file-list .gallery-file .fsize {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
  font-size: 13px;
  background: #fff;
  border-radius: 14px;
  border: 1px dashed #e2e8f0;
}

.gallery-grid.is-root .gallery-section-label,
.gallery-grid.is-root .gallery-empty {
  grid-column: 1 / -1;
}

.gallery-grid.is-files .gallery-empty {
  margin: 12px;
}