/* ===== 边框工具专属样式 =====
   页面骨架（top-nav / sidebar / accordion / btn / toast 等）复用 style.css 通用区，
   本文件只放边框工具自己的样式。 */

/* ---------- 左侧：模板列表 ---------- */
.template-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.template-count {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.template-item {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
}

.template-item:hover {
  border-color: var(--primary-color);
}

.template-item.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.template-thumb {
  height: 88px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-name {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-top: 8px;
}

/* ---------- 中部：预览区 ---------- */
.preview-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
  min-width: 0;
}

.empty-placeholder {
  width: 360px;
  height: 360px;
  max-width: 80%;
  max-height: 80%;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.empty-placeholder:hover,
.border-stage.dragover .empty-placeholder {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: #f0f7ff;
}

.empty-placeholder i {
  font-size: 3rem;
}

.empty-placeholder p {
  font-size: 0.9rem;
}

/* 照片边框容器（精确尺寸与信息条定位由 border-preview.js 内联控制） */
.border-stage {
  position: relative;
}

.photo-frame {
  position: relative;
  line-height: 0;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
  border-radius: 2px;
}

.photo-frame img.frame-img {
  display: block;
  width: 100%;
  height: auto;
}

.frame-info {
  line-height: 1.35;
  /* 允许段内自然断行：CJK 逐字、西文按词，超长段落不会再横向溢出被裁 */
  white-space: normal;
  overflow-wrap: break-word;
  overflow: hidden;
  position: absolute;
  z-index: 2;
}

/* overlay 模式：信息条压在照片底部渐变上 */
.photo-frame.mode-overlay .frame-info {
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
}

/* ---------- 右侧：控件 ---------- */
.exif-status {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.5;
}

.exif-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.exif-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
}

.exif-checks input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.text-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--text-dark);
  box-sizing: border-box;
}

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

.select-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #fff;
  box-sizing: border-box;
  cursor: pointer;
}

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

/* ---------- 信息条排版（多行 / 分隔 / 品牌图标） ---------- */
.frame-info .info-line {
  display: flex;
  align-items: center;
  gap: 0.4em;
  flex-wrap: wrap; /* 单行排列时内容过长，在分隔符处自动换行 */
}

.frame-info .info-line + .info-line {
  margin-top: 0.3em;
}

.info-sep {
  opacity: 0.5;
}

.brand-icon {
  display: inline-flex;
  flex: none;
}

.brand-icon svg,
.brand-icon img {
  height: 1.15em;
  width: auto;
  display: block;
}

/* 官方 logo 图形（多为深色），加白色底片，深色信息条上也能看清 */
.brand-icon.has-logo {
  background: #fff;
  border-radius: 5px;
  padding: 1px 5px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

/* ---------- 四选项质量网格（2×2）与体积提示 ---------- */
.quality-grid-4 {
  grid-template-columns: repeat(2, 1fr) !important;
}

.quality-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
  margin: -6px 0 12px;
}

/* ---------- 厂商图标配置面板 ---------- */
.brand-icon-config {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

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

.bic-label {
  font-size: 0.85rem;
  color: var(--text-dark);
  flex: none;
  width: 3.6em;
}

.bic-row .select-input {
  flex: 1;
  min-width: 0;
}

.bic-upload-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.bic-preview {
  display: inline-flex;
  align-items: center;
  height: 28px;
  min-width: 0;
}

.bic-preview img {
  height: 24px;
  width: auto;
  display: block;
}

.bic-empty {
  font-size: 0.8rem;
  color: var(--text-light);
}

.bic-clear {
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
}

.bic-clear:hover {
  color: var(--danger-color);
}

.bic-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ---------- 照片悬浮操作条（更换 / 移除） ---------- */
.frame-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
  line-height: 1;
}

.border-stage:hover .frame-toolbar {
  opacity: 1;
}

.frame-toolbar button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-size: 1.1rem;
  color: var(--text-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.frame-toolbar button:hover {
  color: var(--primary-color);
}

/* ---------- 批量预览分页器 ---------- */
.photo-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.photo-pager button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 1rem;
  color: var(--text-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-pager button:hover {
  color: var(--primary-color);
}

.pager-count {
  font-size: 0.85rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
}

/* ---------- 示例预览标记与空信息提示 ---------- */
.demo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.6;
  letter-spacing: 0.5px;
}

.stage-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
}
