/* J12：工具台 · 抠图（白底 4K）页面样式。
   自包含，不依赖 portal.css / cutout.css —— 旧版 /cutout 的样式不动，避免互相牵连。
   配色沿用 I3 之后的全站白底：文字 #111827 / 次要 #6b7280 / 主色 = 全站品牌绿 --brand。 */

.tc-main {
  padding: 0 4px 64px;
}

.tc-crumb {
  margin: 22px 0 10px;
  font-size: 13px;
}

.tc-crumb a {
  color: var(--brand-strong, #5BC85A);
  text-decoration: none;
}

.tc-crumb a:hover {
  text-decoration: underline;
}

.tc-hero h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
  color: #111827;
}

.tc-sub {
  margin: 0 0 4px;
  color: #6b7280;
  font-size: 0.95rem;
}

.tc-price {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft, rgba(113,220,104,.14));
  color: var(--brand-strong, #5BC85A);
  font-size: 12px;
  font-weight: 600;
}

.tc-panel {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 860px) {
  .tc-panel {
    grid-template-columns: 1fr;
  }
}

.tc-drop {
  border: 2px dashed #d1d5db;
  border-radius: 14px;
  background: #fafafa;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 24px;
  transition: border-color 0.15s, background 0.15s;
}

.tc-drop:hover,
.tc-drop.is-over {
  border-color: var(--brand-strong, #5BC85A);
  background: #f5f8ff;
}

.tc-drop.has-file {
  border-style: solid;
  border-color: var(--brand-line, #A9EFA4);
  background: #fff;
}

.tc-drop-icon {
  font-size: 2rem;
}

/* J14-fix：上传后的预览图（之前只改了图标和文件名，用户以为没传上去） */
.tc-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  margin-bottom: 6px;
  object-fit: contain;
}

/* J14-fix：未登录时的警示条 + 上传区锁定 */
.tc-auth {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
}

.tc-auth a {
  color: #b91c1c;
  font-weight: 700;
  text-decoration: underline;
}

.tc-drop.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none; /* 未登录时彻底锁住：不给点、不给拖 */
}

.tc-drop-title {
  font-weight: 600;
  color: #111827;
}

.tc-drop-hint {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.6;
}

.tc-preview {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  object-fit: contain;
}

.tc-opts {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tc-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.tc-seg {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tc-seg button {
  flex: 1 1 auto;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
}

.tc-seg button.is-active {
  border-color: var(--brand-strong, #5BC85A);
  background: var(--brand-soft, rgba(113,220,104,.14));
  color: var(--brand-strong, #5BC85A);
  font-weight: 600;
}

.tc-go {
  margin-top: auto;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--brand, #71DC68);
  color: var(--brand-ink, #14331B);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.tc-go:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.tc-go:not(:disabled):hover {
  background: var(--brand-strong, #5BC85A);
}

.tc-hint {
  font-size: 12px;
  color: #9ca3af;
  min-height: 16px;
}

.tc-progress,
.tc-result,
.tc-error {
  margin-top: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  background: #fff;
}

.tc-progress-text {
  color: #374151;
  font-size: 14px;
}

.tc-bar {
  margin-top: 12px;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.tc-bar > i {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: var(--brand, #71DC68);
  animation: tc-slide 1.2s ease-in-out infinite;
}

@keyframes tc-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

.tc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tc-col-h {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
}

.tc-img-box {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f3f4f6 25%, transparent 25%) 0 0/16px 16px,
    linear-gradient(-45deg, #f3f4f6 25%, transparent 25%) 0 8px/16px 16px,
    #fff;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.tc-img-box.is-white {
  background: #fff;
}

.tc-img-box img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.tc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tc-btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 0;
  background: var(--brand, #71DC68);
  color: var(--brand-ink, #14331B);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.tc-btn:hover {
  background: var(--brand-strong, #5BC85A);
}

.tc-btn.is-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.tc-btn.is-secondary:hover {
  background: #f9fafb;
}

.tc-meta {
  margin-top: 14px;
  font-size: 12px;
  color: #9ca3af;
}

.tc-error-title {
  font-weight: 600;
  color: #b91c1c;
  margin-bottom: 6px;
}

.tc-error-msg {
  color: #7f1d1d;
  font-size: 14px;
}

/* M27-A：两段式版式（左窄操作 + 右结果），给抠图 / 扩图 / AI 渲染三个单工具页用。
   用 specificity 限定在 .tc-layout 容器下，其他页面（精修 / 主图换场景 / 买家秀 / 详情页
   等也引用本 CSS）不主动加 .tc-layout 时**不受影响**，等各自卡片改造时再加。
   红线：不动现有 .tc-* 基础定义，只追加新规则。 */
.tc-panel.tc-layout,
.tc-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 22px;
}
.tc-layout .tc-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.tc-layout .tc-right { min-width: 0; }
.tc-layout .tc-drop {
  min-height: 120px;
  max-height: 120px;
  padding: 8px 10px;
  gap: 4px;
  overflow: hidden;
}
.tc-layout .tc-drop-icon { font-size: 1.3rem; }
.tc-layout .tc-drop-title { font-size: 13px; line-height: 1.3; }
.tc-layout .tc-drop-hint { font-size: 11px; line-height: 1.45; }
.tc-layout .tc-drop .tc-preview { max-height: 100px; margin-bottom: 4px; }
.tc-layout .tc-opts { padding: 12px; gap: 8px; }
.tc-layout .tc-go {
  position: sticky;
  bottom: 8px;
  z-index: 1;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.06);
}
@media (max-width: 900px) {
  .tc-layout { grid-template-columns: 1fr; }
  .tc-layout .tc-go { position: static; box-shadow: none; }
  .tc-layout .tc-drop { max-height: 200px; } /* <900px 一列时给点缓冲 */
}
