/* 版式翻译页面专属样式 */

.ti-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ---- 门槛提示（未付费） ---- */
.ti-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.ti-gate-card {
  text-align: center;
  max-width: 420px;
  padding: 2.5rem 2rem;
  background: var(--surface, #fff);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.ti-gate-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.ti-gate-card h2 { margin: 0 0 .75rem; font-size: 1.4rem; }
.ti-gate-card p  { color: #6b7280; margin: 0 0 1.5rem; }
.ti-gate-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ---- 页头 ---- */
.ti-header { text-align: center; margin-bottom: 2rem; }
.ti-header h1 { font-size: 2rem; margin: 0 0 .5rem; }
.ti-header p  { color: #6b7280; margin: 0; }

/* ---- 上传区 ---- */
.ti-upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  background: #f9fafb;
  transition: border-color .2s;
  cursor: pointer;
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ti-upload-zone:hover,
.ti-upload-zone.drag-over { border-color: #6366f1; background: #eef2ff; }
.ti-upload-inner { text-align: center; padding: 2.5rem 1rem; }
.ti-upload-icon  { font-size: 2.5rem; margin-bottom: .75rem; }
.ti-upload-hint  { font-weight: 600; color: #374151; margin: 0 0 .25rem; }
.ti-upload-sub   { color: #9ca3af; font-size: .875rem; margin: 0; }

/* 预览 */
.ti-preview-wrap {
  position: relative;
  width: 100%;
  max-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  padding: .5rem;
}
.ti-preview-img { max-width: 100%; max-height: 380px; object-fit: contain; border-radius: 8px; }
.ti-clear-btn {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 参数设置 ---- */
.ti-options { margin: 1.25rem 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.ti-option-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.ti-option-row label { font-size: .875rem; color: #374151; white-space: nowrap; }
.ti-select {
  padding: .4rem .75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .875rem;
  background: #fff;
  cursor: pointer;
}

/* ---- 提交按钮 ---- */
.ti-submit-row { display: flex; justify-content: center; margin: 1.5rem 0; }
.ti-submit-btn { min-width: 160px; font-size: 1rem; padding: .7rem 2rem; }

/* ---- 状态 ---- */
.ti-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1.5rem;
  color: #6b7280;
}
.ti-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 错误 ---- */
.ti-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: .85rem 1rem;
  margin: 1rem 0;
  font-size: .875rem;
  white-space: pre-wrap;
  font-family: inherit;
}

/* ---- 结果区 ---- */
.ti-result { margin-top: 2rem; }

.ti-warnings {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  font-size: .875rem;
  color: #92400e;
}

/* 区域明细 */
.ti-regions-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}
.ti-regions-header h3 { margin: 0; font-size: 1rem; }
.ti-badge {
  font-size: .75rem;
  padding: .2rem .6rem;
  border-radius: 9999px;
  font-weight: 600;
}
.ti-badge-auto   { background: #d1fae5; color: #065f46; }
.ti-badge-manual { background: #fee2e2; color: #991b1b; }

.ti-regions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.75rem;
  max-height: 320px;
  overflow-y: auto;
}
.ti-region-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: start;
  gap: .5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: .6rem .75rem;
  font-size: .875rem;
}
.ti-region-row.complex { border-color: #fca5a5; background: #fff5f5; }
.ti-region-orig   { color: #374151; }
.ti-region-arrow  { color: #9ca3af; text-align: center; padding-top: 2px; }
.ti-region-trans  { color: #1d4ed8; }
.ti-region-badge  { font-size: .7rem; color: #9ca3af; }
.ti-region-badge.manual { color: #ef4444; }

/* 版式图对比 */
.ti-section-title { font-size: 1rem; margin: 1.5rem 0 .75rem; }
.ti-image-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.ti-image-col   { display: flex; flex-direction: column; gap: .4rem; }
.ti-image-label {
  font-size: .75rem;
  color: #6b7280;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.ti-result-img  {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  object-fit: contain;
  background: #f3f4f6;
}

.ti-annotated-hint { color: #92400e; font-size: .875rem; margin: .75rem 0 .5rem; }

.ti-download-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; }

/* 文字翻译 */
.ti-text-result {
  width: 100%;
  min-height: 120px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: .75rem;
  font-size: .875rem;
  resize: vertical;
  margin-bottom: .75rem;
  font-family: inherit;
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
  .ti-image-compare { grid-template-columns: 1fr; }
  .ti-region-row    { grid-template-columns: 1fr; }
  .ti-region-arrow  { display: none; }
}

/* ---- 步骤指示器 ---- */
.ti-steps {
  display: flex; align-items: center; margin: 1.5rem 0 2rem;
}
.ti-step {
  display: flex; align-items: center; gap: .5rem;
  color: #9ca3af; font-size: .85rem; font-weight: 600;
}
.ti-step.active    { color: #4f46e5; }
.ti-step.completed { color: #16a34a; }
.ti-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: #e5e7eb; color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.ti-step.active    .ti-step-num { background: #4f46e5; color: #fff; }
.ti-step.completed .ti-step-num { background: #16a34a; color: #fff; }
.ti-step-line { flex: 1; height: 2px; background: #e5e7eb; margin: 0 .75rem; }

/* ---- Step 2：区域确认 ---- */
.ti-step2-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.ti-step2-header h3 { margin: 0; font-size: 1.1rem; }
.ti-back-btn { font-size: .85rem; }

.ti-step2-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.ti-step2-img-col  { }
.ti-step2-list-col { display: flex; flex-direction: column; gap: .5rem; }

.ti-detect-summary {
  padding: .75rem 1rem; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; font-size: .875rem; line-height: 1.6;
  margin-bottom: .75rem;
}
.color-ok   { color: #16a34a; }
.color-warn { color: #d97706; }

.ti-regions-list {
  flex: 1; overflow-y: auto; max-height: 360px;
  display: flex; flex-direction: column; gap: .4rem;
}
.ti-detect-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .75rem; border-radius: 7px;
  background: #fff; border: 1px solid #e5e7eb; font-size: .82rem;
}
.ti-detect-row.complex { border-color: #fde68a; background: #fffbeb; }
.ti-detect-num  { flex-shrink: 0; width: 20px; color: #6b7280; font-weight: 700; text-align: right; }
.ti-detect-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #374151; }
.ti-detect-bg   { flex-shrink: 0; font-size: .72rem; font-weight: 600; padding: .1rem .45rem; border-radius: 5px; }
.ti-detect-bg.ok   { background: #dcfce7; color: #16a34a; }
.ti-detect-bg.warn { background: #fef3c7; color: #d97706; }

/* 警告行 */
.ti-warn-row { margin: .25rem 0; font-size: .85rem; }

@media (max-width: 640px) {
  .ti-step2-layout { grid-template-columns: 1fr; }
  .ti-steps .ti-step-label { display: none; }
}

/* ---- 免费次数提示条 ---- */
.ti-trial-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem; margin-bottom: 1rem;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  font-size: .875rem; color: #1e40af;
}
.ti-trial-banner.ti-trial-full {
  background: #fef2f2; border-color: #fecaca; color: #b91c1c;
}
.ti-trial-link {
  flex-shrink: 0; margin-left: 1rem;
  color: #4f46e5; font-weight: 600; text-decoration: none; font-size: .8rem;
}
.ti-trial-link:hover { text-decoration: underline; }
