/* ==================== 基础 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf3 100%);
  color: #2d3748;
  min-height: 100vh;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ==================== 顶部导航 ==================== */
.navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 14px 0;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo .logo-link {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-right a {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  cursor: pointer;
}
.nav-right a:hover { color: #fff; }

/* ==================== 主容器 ==================== */
main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

/* ==================== 扫描区头部 ==================== */
.scanner-header { text-align: center; margin-bottom: 24px; }
.scanner-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.scanner-header p { color: #718096; font-size: 14px; margin-top: 6px; }
.scanner-privacy {
  color: #a0aec0; font-size: 12px; margin-top: 4px;
}

/* ==================== 扫描完成操作区 ==================== */
.result-section {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}
.result-header {
    margin-bottom: 18px;
}
.result-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #48bb78;
    margin: 0;
}
.result-info {
    color: #718096;
    font-size: 13px;
    display: block;
    margin-top: 4px;
}
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: nowrap;
}
.btn-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-preview:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4); }
.btn-download-main {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: #fff;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-download-main:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(237, 137, 54, 0.4); }

/* ==================== 下载结果展示区 ==================== */
.download-result-section {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    margin-top: 24px;
}
.download-result-header {
    margin-bottom: 16px;
    text-align: center;
}
.download-result-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #48bb78;
    margin: 0 0 4px;
}
.download-result-hint {
    color: #e53e3e;
    font-size: 12px;
    display: block;
}
.download-result-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.download-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.download-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #4a5568;
    background: #f7f8fc;
    word-break: break-all;
}
.btn-copy-link {
    padding: 10px 18px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-copy-link:hover { background: #5a67d8; }
.btn-copy-link.copied { background: #48bb78; }
.download-btn-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.btn-download-file {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}
.btn-download-file:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.4); }

/* ==================== 预览弹窗 ==================== */
.preview-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.preview-modal.active { display: flex; }
.preview-modal-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
}
.preview-modal-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 92vw;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}
.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.preview-modal-header h3 {
    font-size: 16px;
    color: #2d3748;
    margin: 0;
}
.preview-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.preview-modal-close:hover { color: #2d3748; }
.preview-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.preview-modal-image {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    align-self: flex-start;
    max-width: 100%;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-modal-image.loading { }
.preview-modal-image.error { }
.preview-modal-image img {
    max-width: 100%;
    display: block;
}
/* loading spinner */
.preview-spinner {
    width: 36px; height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: preview-spin 0.8s linear infinite;
}
@keyframes preview-spin {
    to { transform: rotate(360deg); }
}
.preview-error-text {
    color: #a0aec0;
    font-size: 14px;
}
.preview-modal-watermark {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.preview-modal-watermark span {
    color: rgba(80,80,80,0.35);
    font-size: 28px;
    font-weight: 700;
    transform: rotate(-30deg);
    text-shadow: 0 0 2px rgba(255,255,255,0.6);
}

/* ==================== 下载选择弹窗 ==================== */
.download-choice-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.download-choice-modal.active { display: flex; }
.download-choice-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
}
.download-choice-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 92vw;
    max-width: 420px;
    overflow: hidden;
    z-index: 1;
}
.download-choice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.download-choice-header h3 {
    font-size: 17px;
    color: #2d3748;
    margin: 0;
    font-weight: 700;
}
.download-choice-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.download-choice-close:hover { color: #2d3748; }
.download-choice-body {
    padding: 20px;
}
.download-choice-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.download-choice-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.download-choice-btn:hover {
    border-color: #667eea;
    background: #f8faff;
    transform: translateX(2px);
}
.download-choice-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f0f3ff 0%, #e8ecf8 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #667eea;
}
.download-choice-icon svg {
    width: 22px;
    height: 22px;
}
.download-choice-label {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    flex-shrink: 0;
}
.download-choice-desc {
    font-size: 12px;
    color: #a0aec0;
    margin-left: auto;
}

/* ==================== 处理中弹窗 ==================== */
.processing-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.processing-modal.active { display: flex; }
.processing-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}
.processing-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 32px 24px;
    text-align: center;
    z-index: 1;
    min-width: 200px;
}
.processing-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.processing-text {
    color: #4a5568;
    font-size: 14px;
    margin: 0;
}

/* ==================== 上传区 ==================== */
.drop-zone {
  background: #fff;
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: #667eea;
  background: #f8faff;
}
.drop-zone-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.drop-zone-icon svg { width: 20px; height: 20px; }
.drop-zone-text { color: #4a5568; font-size: 14px; }
.drop-zone-sub { color: #a0aec0; font-size: 12px; margin-top: 4px; }

/* ==================== 效果对比图 ==================== */
.demo-compare { display: none; }
.demo-link {
  color: #667eea;
  font-weight: 600;
  font-size: 14px;
}

/* ==================== 微信复制链接弹窗 ==================== */
.copy-link-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 10001;
  display: flex; align-items: center; justify-content: center;
}
.copy-link-box {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 90vw; max-width: 400px; text-align: center;
}
.copy-link-box h3 { margin: 0 0 8px; font-size: 17px; color: #2d3748; }
.copy-link-box p { margin: 0 0 16px; font-size: 14px; color: #718096; }
.copy-link-row {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.copy-link-input {
  flex: 1; padding: 8px 10px; border: 1px solid #e2e8f0;
  border-radius: 6px; font-size: 13px; color: #4a5568; background: #f7f8fc;
}
.btn-copy-link {
  padding: 8px 16px; background: #667eea; color: #fff;
  border: none; border-radius: 6px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.btn-close-copy-link {
  padding: 8px 24px; background: #edf2f7; color: #4a5568;
  border: none; border-radius: 6px; font-size: 13px; cursor: pointer;
}

/* ==================== 文件计数 ==================== */
.files-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
  padding: 10px 16px;
  background: #fff;
  border-radius: 10px;
  font-size: 14px;
  color: #4a5568;
}
.counter-number { color: #667eea; font-weight: 700; }
.btn-clear-all {
  background: none;
  border: 1px solid #e53e3e;
  color: #e53e3e;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.btn-clear-all:hover { background: #e53e3e; color: #fff; }

/* ==================== 文件列表 ==================== */
.file-list { display: flex; flex-direction: column; gap: 4px; }
.file-card {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
  font-size: 13px;
}
.file-card.processing { border-color: #667eea; background: #f8faff; }
.file-card.done { border-color: #48bb78; }
.file-card.error { border-color: #e53e3e; background: #fff5f5; }
.file-card-number {
  width: 20px;
  height: 20px;
  background: #edf2f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #718096;
  flex-shrink: 0;
}
.file-card-preview {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: #edf2f7;
  flex-shrink: 0;
}
.file-card-preview img { width: 100%; height: 100%; object-fit: cover; }
/* PC 端 hover 时放大预览 */
@media (hover: hover) {
  .file-card-preview img {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .file-card-preview:hover {
    overflow: visible;
    z-index: 100;
  }
  .file-card-preview:hover img {
    transform: scale(15);
    transform-origin: left top;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    background: #fff;
    position: relative;
    z-index: 100;
  }
}
.file-card-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-card-size { font-size: 13px; color: #a0aec0; flex-shrink: 0; }
.card-action-btn {
  background: #edf2f7;
  border: none;
  color: #4a5568;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1.4;
}
.card-action-btn:hover:not(:disabled) { background: #667eea; color: #fff; }
.card-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.file-card-delete {
  background: none;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
}
.file-card-delete:hover:not(:disabled) { color: #e53e3e; }
.file-card-delete svg { width: 20px; height: 20px; }
.file-card-delete:disabled { opacity: 0.4; cursor: not-allowed; }
.file-card-status { font-size: 12px; padding: 2px 8px; border-radius: 4px; flex-shrink: 0; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card-status.success { background: #c6f6d5; color: #22543d; }
.file-card-status.fail { background: #fed7d7; color: #742a2a; }
.file-card-status.processing { background: #bee3f8; color: #2a4365; }
.sortable-ghost { opacity: 0.4; }
.sortable-chosen { box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); }

/* ==================== 进度 ==================== */
.progress-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #4a5568;
  margin-bottom: 8px;
}
.progress-percent { color: #667eea; font-weight: 700; }
.progress-bar {
  height: 8px;
  background: #edf2f7;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.3s;
}

/* ==================== 操作按钮 ==================== */
.action-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.action-hint {
  margin: 0;
  max-width: 620px;
  font-size: 13px;
  line-height: 1.7;
  color: #718096;
  text-align: center;
}
@media (max-width: 768px) {
  .action-hint { font-size: 12px; padding: 0 6px; }
}
.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-scan {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
.btn-scan:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4); }


/* ==================== 功能介绍（SEO） ==================== */
.intro-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0;
}

/* 一句话定位 */
.intro-hero {
  text-align: center;
  margin-bottom: 32px;
}
.intro-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 10px;
}
.intro-hero p {
  font-size: 15px;
  color: #718096;
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.8;
}

/* 核心卖点网格 */
.intro-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.highlight-item {
  background: #fff;
  border-radius: 12px;
  padding: 22px 16px;
  border: 1px solid #e2e8f0;
  text-align: center;
  transition: all 0.2s;
}
.highlight-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.12);
  border-color: #667eea;
}
.highlight-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f3ff 0%, #e8ecf8 100%);
  border-radius: 12px;
}
.highlight-icon svg { width: 28px; height: 28px; }
.highlight-item strong {
  display: block;
  font-size: 15px;
  color: #2d3748;
  margin-bottom: 6px;
}
.highlight-item p {
  font-size: 13px;
  color: #718096;
  line-height: 1.6;
}

/* 描述段落 */
.intro-desc {
  margin-bottom: 32px;
}
.intro-desc h2,
.intro-steps h2,
.intro-scenes h2,
.intro-faq h2 {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #edf2f7;
}
.intro-desc p {
  font-size: 14px;
  color: #4a5568;
  line-height: 1.8;
  margin-bottom: 10px;
}

/* 使用步骤 */
.intro-steps { margin-bottom: 32px; }
.steps-list {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 16px;
}
.steps-list li {
  counter-increment: step-counter;
  position: relative;
  padding: 16px 16px 16px 52px;
  font-size: 14px;
  color: #4a5568;
  line-height: 1.7;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.steps-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 8px;
  top: 10px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 适用场景 */
.intro-scenes { margin-bottom: 32px; }
.scenes-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.scenes-list li {
  background: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #4a5568;
  line-height: 1.6;
  border: 1px solid #e2e8f0;
}

/* 常见问题 */
.intro-faq { margin-bottom: 8px; }
.faq-list { padding: 0; }
.faq-list dt {
  font-size: 14px;
  color: #2d3748;
  margin-bottom: 4px;
  margin-top: 14px;
  padding-left: 4px;
}
.faq-list dd {
  font-size: 13px;
  color: #718096;
  margin: 0 0 12px 0;
  padding-left: 4px;
  line-height: 1.7;
}
.faq-list dd + dt { margin-top: 18px; }

/* ==================== 工具网格（简化） ==================== */
.tools-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0;
}
.tools-section h2 {
  text-align: center;
  font-size: 20px;
  color: #2d3748;
  margin-bottom: 20px;
}
.tools-grid-simple {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.tool-simple {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 12px;
  padding: 18px 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
  text-align: center;
}
.tool-simple:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}
.tool-simple .tool-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-simple .tool-icon svg { width: 32px; height: 32px; }
.tool-simple .tool-name {
  font-size: 14px;
  color: #2d3748;
  font-weight: 500;
}
.tool-simple .tool-btn {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 14px;
  font-size: 12px;
  margin-top: 2px;
}

/* ==================== SEO / 页脚 ==================== */
.seo-section { max-width: 1100px; margin: 30px auto; padding: 0 20px; }
.seo-text { color: #718096; font-size: 13px; text-align: center; }
.footer {
  background: #2d3748;
  color: #cbd5e0;
  padding: 24px 0;
  margin-top: 40px;
}
.footer .container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.friend-links { display: flex; gap: 14px; flex-wrap: wrap; }
.friend-links a { color: #cbd5e0; font-size: 13px; }
.friend-links a:hover { color: #fff; }
.contact-link { color: #cbd5e0; cursor: pointer; font-size: 13px; }

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #2d3748;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.toast-error { background: #e53e3e; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .intro-highlights { grid-template-columns: repeat(2, 1fr); }
  .steps-list { grid-template-columns: 1fr; }
  .scenes-list { grid-template-columns: 1fr; }
  .scanner-header h1 { font-size: 24px; }
  .nav-logo .logo-link { font-size: 16px; }
}
@media (max-width: 600px) {
  .nav-logo .logo-link { font-size: 14px; }
  .nav-container { padding: 0 12px; }
  .nav-right { gap: 10px; }
  .nav-right a { font-size: 12px; }
  .intro-hero h2 { font-size: 18px; }
  .intro-hero p { font-size: 14px; }
  .intro-highlights { grid-template-columns: 1fr 1fr; gap: 10px; }
  .highlight-item { padding: 14px 10px; }
  .highlight-icon { width: 36px; height: 36px; }
  .highlight-icon svg { width: 22px; height: 22px; }
  .highlight-item strong { font-size: 13px; }
  .highlight-item p { font-size: 12px; }
  .scenes-list { grid-template-columns: 1fr; }
  .scanner-header h1 { font-size: 22px; }
  .tools-grid-simple { grid-template-columns: repeat(2, 1fr); }
  .action-bar {
    position: sticky;
    bottom: 0;
    background: #f7f8fc;
    padding: 10px 0;
    z-index: 10;
  }
  .action-bar .btn { width: 100%; justify-content: center; }
  /* 裁剪弹窗移动端适配 */
  .crop_header { flex-wrap: wrap; padding: 10px 12px; }
  .crop_header_actions {
    width: 100%; margin-top: 8px; justify-content: flex-end;
  }
  .crop_apply_all_label { white-space: normal; font-size: 12px; padding: 5px 8px; }
  .crop_btn { font-size: 12px; padding: 6px 12px; }
  .crop_title { font-size: 14px; }
}

/* 超小屏裁剪弹窗适配 */
@media (max-width: 400px) {
  .crop_header_actions {
    justify-content: space-between; gap: 6px;
  }
  .crop_apply_all_label {
    width: 100%; justify-content: center; margin-bottom: 4px; order: -1;
  }
  .crop_btn_confirm { order: 0; flex: 1; }
  .crop_btn_reset { order: 0; flex: 1; }
}

/* ==================== 裁剪弹窗 ==================== */
.crop_overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85); z-index: 10000;
  align-items: center; justify-content: center; overflow: hidden;
}
.crop_overlay.active { display: flex; }
.crop_box {
  position: relative; width: 92vw; max-width: 900px; max-height: 92vh;
  background: #1a1a2e; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden;
}
.crop_close {
  background: none; border: none; color: rgba(255,255,255,0.6); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 0 4px; margin-left: 6px;
}
.crop_close:hover { color: #e53e3e; }
.crop_header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: #16213e; flex-shrink: 0;
}
.crop_title { color: #e2e8f0; font-size: 16px; font-weight: 600; }
.crop_header_actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crop_btn {
  padding: 7px 18px; border: none; border-radius: 6px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.crop_btn:hover { opacity: 0.85; }
.crop_btn_reset { background: rgba(255,255,255,0.15); color: #e2e8f0; }
.crop_btn_confirm { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }
.crop_apply_all_label {
  display: flex; align-items: center; gap: 5px; padding: 7px 12px;
  color: #cbd5e0; font-size: 13px; cursor: pointer; white-space: nowrap;
  background: rgba(255,255,255,0.08); border-radius: 6px;
}
.crop_apply_all_label input[type="checkbox"] { cursor: pointer; }
.crop_body { flex: 1; display: flex; align-items: flex-start; justify-content: center; overflow: hidden; }
.crop_body img { display: block; }
.crop_body canvas.crop_canvas { display: block; touch-action: none; cursor: crosshair; }

/* 列表卡片中的裁剪按钮 & 已裁剪标签 */
.btn-crop { flex-shrink: 0; }
.file-card-cropped-tag {
  background: #48bb78; color: #fff; font-size: 10px; font-weight: 600;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0;
}

/* 图片加载中提示 */
.file-loading-tip {
  text-align: center; padding: 50px 20px; color: #f6ad55;
  font-size: 16px; font-weight: 600;
}
.file-loading-tip::before {
  content: ''; display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #667eea; border-radius: 50%;
  margin-right: 10px; vertical-align: middle;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 裁剪批量处理遮罩 */
.crop_processing_mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 10001;
  display: flex; align-items: center; justify-content: center;
}
.crop_processing_box {
  text-align: center; color: #f6ad55; font-size: 16px; font-weight: 600;
}
.crop_processing_spinner {
  width: 36px; height: 36px; margin: 0 auto 16px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #667eea; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ==================== V3 顺序确认弹窗 ==================== */
.confirm-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 2000; }
.confirm-modal.active { display: flex; }
.confirm-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.confirm-box {
  position: relative; width: min(420px, 88vw); background: #fff; border-radius: 18px;
  padding: 26px 24px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.confirm-title { font-size: 18px; color: #2d3748; margin-bottom: 12px; }
.confirm-text { font-size: 14px; color: #4a5568; line-height: 1.8; }
.confirm-actions { display: flex; gap: 12px; margin-top: 22px; }
.confirm-btn { flex: 1; height: 42px; border: none; border-radius: 10px; font-size: 15px; cursor: pointer; }
.confirm-btn-ghost { background: #edf2f7; color: #4a5568; }
.confirm-btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }

/* ==================== V3 编辑弹层 ==================== */
.editor-modal { position: fixed; inset: 0; display: none; z-index: 1500; }
.editor-modal.active { display: flex; align-items: center; justify-content: center; }
.editor-mask { position: absolute; inset: 0; background: rgba(15, 20, 30, 0.78); }
.editor-box {
  position: relative; width: min(1100px, 96vw); height: min(760px, 92vh); background: #fff;
  border-radius: 18px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #edf2f7;flex: none;
}
.editor-header h3 { font-size: 17px; color: #2d3748; }
.editor-close { border: none; background: transparent; font-size: 26px; line-height: 1; color: #a0aec0; cursor: pointer; }
.editor-body { flex: 1; display: flex; min-height: 0; }
.editor-list {
  width: 132px; border-right: 1px solid #edf2f7; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px; background: #fafbfc; flex: none;
}
.editor-item { position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; }
.editor-item img { display: block; width: 100%; height: 96px; object-fit: cover; }
.editor-item.active { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15); }
.editor-item.done { border-color: #48bb78; }
.editor-item-no {
  position: absolute; top: 4px; left: 4px; background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 8px;
}
.editor-item-state {
  position: absolute; bottom: 4px; right: 4px; background: #48bb78; color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 8px; text-transform: uppercase;
}
.editor-stage {
  flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 12px; background: #f7f8fa;
  overflow: hidden;
}
/* 预览图占满中间区域：图片盒子铺满画布，由 object-fit 等比缩放，不溢出、不产生滚动条 */
.editor-canvas-wrap {
  flex: 1; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* 盒子固定铺满 + object-fit: contain：缩略图（500/1200px）比画布小时也能放大铺满，
   留白区透明并用 drop-shadow，阴影只贴合图片本身，不会给留白描一圈 */
.editor-canvas-wrap img {
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  object-fit: contain; display: block; background: transparent;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.18));
}
.editor-tip { margin-top: 12px; font-size: 13px; color: #718096; text-align: center; }
.editor-panel {
  width: 220px; border-left: 1px solid #edf2f7; padding: 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; flex: none;
}
.editor-step {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid #e2e8f0; border-radius: 12px; cursor: pointer; background: #fff;
}
.editor-step:hover { border-color: #667eea; }
.editor-step-static { cursor: default; }
.editor-step-static:hover { border-color: #e2e8f0; }
.step-no {
  width: 22px; height: 22px; border-radius: 50%; background: #667eea; color: #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center; flex: none;
}
.step-name { font-size: 14px; font-weight: 600; color: #2d3748; }
.step-state { margin-left: auto; font-size: 12px; color: #a0aec0; }
/* 几何工具：2 列 2 行，不带序号（操作顺序随意） */
.editor-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.editor-tool {
  padding: 13px 6px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff;
  font-size: 15px; font-weight: 600; color: #2d3748; cursor: pointer; text-align: center;
  font-family: inherit; transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}
.editor-tool:hover { border-color: #667eea; background: rgba(102, 126, 234, 0.06); }
.editor-tool:active { transform: scale(0.97); }
.editor-divider { height: 1px; background: #edf2f7; margin: 6px 0 2px; }
.editor-effect-title { font-size: 12px; color: #718096; }

/* 效果区：2 列、只显示大字 */
.editor-variants { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.variant-btn {
  text-align: center; border: 1px solid #e2e8f0; background: #fff; border-radius: 12px;
  padding: 14px 6px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.variant-btn.active { border-color: #667eea; background: rgba(102, 126, 234, 0.08); }
.variant-label { font-size: 14px; font-weight: 600; color: #2d3748; letter-spacing: 0; white-space: nowrap; }
.variant-desc { display: none; }

/* 效果区下方：应用到所有图片 */
.editor-apply-all {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  font-size: 13px; color: #4a5568; cursor: pointer; user-select: none;
}
.editor-apply-all input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #667eea; cursor: pointer; flex: none;
}
.editor-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid #edf2f7; background: #fff; flex: none;
}
.editor-btn {
  min-width: 104px; height: 42px; padding: 0 20px; border-radius: 10px; border: none;
  font-size: 15px; font-family: inherit; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.editor-btn-ghost { background: #edf2f7; color: #4a5568; }
.editor-btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }
.editor-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ==================== V3 拉正弹窗 ==================== */
.deskew-overlay {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.78); z-index: 2100;
}
.deskew-overlay.active { display: flex; }
.deskew-box { width: min(760px, 94vw); max-height: 92vh; background: #fff; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.deskew-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #edf2f7; }
.deskew-title { font-size: 16px; font-weight: 600; color: #2d3748; }
.deskew-close { border: none; background: transparent; font-size: 24px; color: #a0aec0; cursor: pointer; }
.deskew-preview { flex: 1; min-height: 240px; display: flex; align-items: center; justify-content: center; padding: 14px; background: #f7f8fa; overflow: hidden; }
.deskew-preview img { max-width: 100%; max-height: 58vh; transition: transform 0.12s ease-out; }
.deskew-controls { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid #edf2f7; }
.deskew-angle { font-variant-numeric: tabular-nums; font-size: 14px; color: #4a5568; min-width: 52px; text-align: center; }
.deskew-controls input[type="range"] { flex: 1; accent-color: #667eea; }
.deskew-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.deskew-btn-primary { border: none; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }

/* 缩放弹窗：图片按倍数放大/缩小，最外那圈虚线框（= 原图边界 = 输出画布）固定不动，
   框外压暗的部分就是放大后会被裁掉的区域（与 docker/scanner 的缩放矩阵同构） */
.deskew-preview-zoom { position: relative; flex: 0 0 auto; height: min(72vh, calc(92vh - 200px)); }
.zoom-stage { position: relative; display: inline-flex; line-height: 0; }
/* 100% 时尽量占满可用高度；四周仍留出空间显示"跑到框外"的画面（放大到 200% 时只溢出到弹窗边缘） */
.zoom-stage img { display: block; max-height: min(50vh, calc((92vh - 200px) * 0.75)); max-width: min(560px, 82vw); }
/* 手机端屏幕窄，放大 2 倍会横向溢出过多，回收一点尺寸 */
@media (max-width: 640px) {
  .zoom-stage img { max-height: min(42vh, calc((92vh - 200px) * 0.75)); max-width: 84vw; }
}
/* 固定边界：位置永远等于图片 100% 时的范围 */
.zoom-crop {
  position: absolute; inset: 0; box-sizing: border-box; pointer-events: none;
  border: 1.5px dashed #ff5a5f;
}
/* 放大时给框外打暗：压暗的就是被裁掉的部分；缩小是四周填白、不裁剪，所以不打暗 */
.zoom-crop-on { box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.42); }
/* 缩放弹窗的放大/缩小行做紧凑些（原 64px 圆钮 + 18px 内边距），把底部「取消 / 保存」顶上来 */
#zoomOverlay .deskew-controls { padding: 8px 16px; gap: 22px; }
#zoomOverlay .deskew-icon-btn { width: 46px; height: 46px; }
#zoomOverlay .deskew-icon-btn svg { width: 22px; height: 22px; }
.zoom-crop-tip {
  position: absolute; left: 0; right: 0; bottom: 6px; z-index: 3;
  text-align: center; font-size: 12px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); pointer-events: none;
}

/* 旋转弹窗：右上角保存 + 底部两个旋转图标 */
.deskew-header-actions { display: flex; align-items: center; gap: 10px; }
.deskew-save {
  border: none; border-radius: 10px; padding: 7px 16px; font-size: 14px; cursor: pointer;
  color: #fff; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.deskew-controls { justify-content: center; gap: 28px; padding: 18px 16px; }
.deskew-icon-btn {
  width: 64px; height: 64px; border-radius: 50%; border: 1px solid #e2e8f0; background: #fff;
  color: #667eea; display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation; user-select: none;
  -webkit-tap-highlight-color: transparent; transition: transform 0.08s ease, background 0.15s ease;
}
.deskew-icon-btn:active { transform: scale(0.94); background: rgba(102, 126, 234, 0.1); }
.deskew-icon-btn svg { width: 30px; height: 30px; }
.deskew-angle { font-size: 18px; font-weight: 600; color: #2d3748; min-width: 78px; text-align: center; }

/* 旋转：大角度 90° 按钮 */
.deskew-controls-quarter { border-top: 1px solid #edf2f7; padding: 16px 16px 8px; gap: 12px; }
.deskew-controls-quarter + .deskew-controls { border-top: none; padding: 10px 16px 18px; }

/* 弹窗底部操作条（旋转 / 缩放 / 裁剪共用）：主操作在右，关闭只留在右上角 */
.dialog-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 12px 16px; border-top: 1px solid #edf2f7; background: #fff; flex: none;
}
.crop_box .dialog-footer { background: #16213e; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.crop_box .editor-btn-ghost { background: rgba(255, 255, 255, 0.12); color: #e2e8f0; }
.deskew-quarter-btn {
  flex: 1; max-width: 190px; height: 40px; border-radius: 10px;
  border: 1px solid #e2e8f0; background: #fff; color: #4a5568;
  font-size: 14px; font-family: inherit; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.deskew-quarter-btn:active { background: rgba(102, 126, 234, 0.1); border-color: #667eea; }

/* 层级：处理中 > 拉正/裁边 > 编辑弹层 */
.processing-modal { z-index: 3000 !important; }
.toast { z-index: 4000 !important; }

/* 下载按钮：PDF / 打包文件两个静态直链（<a download>）并排，窄屏换行 */
.download-btn-row .btn-download-file {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; font-family: inherit;
  min-width: 140px;
}
.download-result-hint { margin-top: 10px; font-size: 12px; color: #a0aec0; text-align: center; }
.download-error-text { margin: 10px 0 6px; font-size: 13px; color: #e53e3e; text-align: center; }

/* ==================== 手机端（编辑弹层全屏） ==================== */
@media (max-width: 768px) {
  .editor-box { width: 100vw; height: 100vh; border-radius: 0; }
  .editor-body { flex-direction: column; }
  .editor-list {
    width: 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid #edf2f7; padding: 8px;
  }
  .editor-item { flex: none; width: 72px; }
  .editor-item img { height: 64px; }
  .editor-stage { padding: 10px; }
  .editor-canvas-wrap img { max-height: 34vh; }
  .editor-panel { width: 100%; border-left: none; border-top: 1px solid #edf2f7; max-height: 34vh; }
  .editor-variants { grid-template-columns: repeat(2, 1fr); }
  .editor-footer { padding: 10px 12px; gap: 10px; }
  .editor-btn { flex: 1; min-width: 0; }
  .dialog-footer { padding: 10px 12px; gap: 10px; }
  .deskew-controls { flex-wrap: wrap; }
  .deskew-controls input[type="range"] { flex: 1 1 100%; order: 3; }
}

/* ==================== V3 校正弹窗（左拖四角 + 右实时预览） ==================== */
.rectify-overlay {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.82); z-index: 2100;
}
.rectify-overlay.active { display: flex; }
.rectify-box {
  width: min(960px, 96vw); height: min(760px, 94vh); background: #fff; border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.rectify-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #edf2f7; flex: none;
}
.rectify-title {
  font-size: 16px; font-weight: 600; color: #2d3748;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rectify-header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.rectify-close { border: none; background: transparent; font-size: 24px; color: #a0aec0; cursor: pointer; }
.rectify-body { flex: 1; display: flex; min-height: 0; }
.rectify-pane {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  padding: 10px; background: #f2f4f7; overflow: hidden;
}
.rectify-pane-preview { flex-direction: column; background: #eceff4; border-left: 1px solid #e2e8f0; }
.rectify-preview-label { font-size: 12px; color: #718096; margin-bottom: 8px; flex: none; }
.rectify-canvas { touch-action: none; cursor: crosshair; display: block; background: #000; border-radius: 6px; }
.rectify-preview { display: block; max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); border-radius: 6px; }
.rectify-controls {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-top: 1px solid #edf2f7; flex: none; flex-wrap: wrap;
  justify-content: center;
}
.rectify-rotate-label { font-size: 13px; color: #4a5568; flex: none; }
.rectify-controls input[type="range"] { flex: 1; min-width: 140px; accent-color: #667eea; }
.rectify-angle { font-size: 13px; color: #4a5568; min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.rectify-btn {
  border: 1px solid #e2e8f0; background: #fff; border-radius: 10px;
  padding: 8px 14px; font-size: 14px; cursor: pointer; flex: none;
}
.rectify-btn-primary { border: none; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }

@media (max-width: 768px) {
  .rectify-box { width: 100vw; height: 100vh; border-radius: 0; }
  .rectify-header { padding: 10px 12px; }
  .rectify-title { font-size: 15px; }
  .rectify-body { flex-direction: column; }
  .rectify-pane { padding: 6px; flex: 1 1 0; min-height: 0; }
  .rectify-pane-preview { border-left: none; border-top: 1px solid #e2e8f0; }
  .rectify-preview { max-height: 100%; }
  .rectify-controls { flex: none; gap: 8px 10px; padding: 10px 12px; }
  .rectify-rotate-label { order: 1; }
  .rectify-controls input[type="range"] { flex: 1 1 55%; order: 2; min-width: 110px; }
  .rectify-angle { order: 3; min-width: 46px; }
  .rectify-controls .rectify-btn { order: 4; flex: 1 1 45%; min-width: 110px; }
}

/* 效果区里的「提取图中文字放入空白稿件」：与 6 个效果按钮同一套样式（白底灰边），
   占满一整行、文字分两行显示。每行 6 个字，沿用默认 14px 也不会被截断 */
.variant-btn-text { grid-column: span 2; padding: 10px 6px; }
.variant-btn-text .variant-label { white-space: normal; line-height: 1.45; }

/* ==================== V3 文字识别 / 白底稿件弹层 ==================== */
.text-page-modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.78); z-index: 2200;
}
.text-page-modal.active { display: flex; }
.text-page-mask { position: absolute; inset: 0; }
.text-page-box {
  position: relative; z-index: 1; background: #fff; border-radius: 16px;
  width: min(1080px, 96vw); height: min(760px, 92vh);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.text-page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid #edf2f7; flex: none;
}
.text-page-header h3 { font-size: 16px; color: #2d3748; margin: 0; }
.text-page-close {
  border: none; background: transparent; font-size: 24px; line-height: 1;
  color: #a0aec0; cursor: pointer; padding: 0 4px;
}
.text-page-close:hover { color: #2d3748; }
.text-page-body { flex: 1; display: flex; min-height: 0; }
.text-page-preview {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding: 10px; background: #f2f4f7; overflow: hidden;
}
/* 编辑区顶部：左侧提示文字 + 右侧「更新预览」按钮 */
.text-page-editor-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none;
}
/* 手动更新预览：默认浅灰，内容改过之后高亮提醒 */
.text-page-refresh {
  flex: none; border: 1px solid #dbe2ee; background: #fff; color: #5a6b86;
  font-size: 12px; font-family: inherit; line-height: 1; padding: 7px 12px;
  border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.text-page-refresh:hover { border-color: #667eea; color: #4353c0; background: rgba(102, 126, 234, .06); }
.text-page-refresh:active { transform: scale(.97); }
.text-page-refresh.dirty {
  border-color: #667eea; color: #4353c0; background: rgba(102, 126, 234, .12); font-weight: 600;
}
.text-page-preview-wrap {
  position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.text-page-preview-img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  background: #fff; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
/* 空白/失败提示 */
.text-page-preview-empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px; font-size: 13px; line-height: 1.7; color: #8b97ab;
  border: 1px dashed #d9e0ec; border-radius: 8px; background: #fbfcfe; max-width: 90%;
}
/* 排版中遮罩：半透明盖在预览区上，避免看到上一张旧图闪烁 */
.text-page-preview-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(247, 249, 252, 0.78); color: #5a6b86; font-size: 13px; letter-spacing: 1px;
  border-radius: 6px;
}
.text-page-editor {
  width: 58%; flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-left: 1px solid #edf2f7; min-height: 0;
}
.text-page-tip { font-size: 12px; color: #718096; line-height: 1.5; flex: 1; min-width: 0; }
.text-page-preserve {
  display: flex; align-items: center; gap: 8px; flex: none;
  font-size: 13px; color: #4a5568; cursor: pointer; user-select: none;
}
.text-page-preserve input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #667eea; cursor: pointer; flex: none;
}
.text-page-input {
  flex: 1; min-height: 0; width: 100%; resize: none; padding: 8px 10px;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fbfcfe;
  /* 字号压到 12px、行距收紧、内边距减小：同宽度下一行能多显示约 5-8 个字，
     尽量让整行完整可见（配合 wrap="off" 不软折行） */
  font-family: inherit; font-size: 12px; line-height: 1.55; color: #2d3748;
  letter-spacing: 0;
  outline: none; box-sizing: border-box;
  /* 一行就是一行：不在编辑框里软折行，避免"编辑区断行"和"成品断行"不一致 */
  white-space: pre; overflow-x: auto; overflow-y: auto;
}
.text-page-input:focus { border-color: #667eea; background: #fff; }
/* 底部按钮统一靠右 */
.text-page-footer {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 16px; border-top: 1px solid #edf2f7; background: #fff; flex-wrap: wrap;
}
.text-page-actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* 手机端：预览与编辑区上下堆叠 */
@media (max-width: 768px) {
  .text-page-box { width: 100vw; height: 100vh; border-radius: 0; }
  .text-page-body { flex-direction: column; }
  .text-page-preview { flex: 1 1 35%; padding: 8px; }
  .text-page-editor { width: 100%; flex: 1 1 65%; border-left: none; border-top: 1px solid #edf2f7; }
  .text-page-footer { padding: 10px 12px; gap: 8px; }
  .text-page-actions { width: 100%; }
  .text-page-actions .editor-btn { flex: 1; min-width: 0; padding: 0 8px; font-size: 14px; }
}

