/* 证件照换底色工具页专属样式，复用 style.css 的 CSS 变量。 */

.tool-wrap { max-width: 760px; margin: 0 auto; }
.hidden { display: none !important; }

.tool-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
}

/* 上传区 */
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 56px 24px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-tint);
  outline: none;
}
.drop-icon { font-size: 42px; line-height: 1; margin-bottom: 14px; }
.drop-title { font-size: 17px; color: var(--ink); margin-bottom: 8px; }
.drop-hint { font-size: 13px; color: var(--light-gray); }

.tool-privacy {
  font-size: 13px;
  color: var(--light-gray);
  margin-top: 18px;
  line-height: 1.7;
}

/* 处理中 */
.spinner {
  width: 40px; height: 40px;
  margin: 8px auto 20px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: tool-spin .9s linear infinite;
}
@keyframes tool-spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.loading-hint { font-size: 13px; color: var(--light-gray); }

/* 无障碍：用户开启「减少动效」时停掉旋转，避免前庭不适 */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--primary); }
}

/* 结果区 */
.result-stage {
  /* 棋盘格背景：白底结果贴在纯白面板上会看不出边界 */
  background:
    linear-gradient(45deg, #eceff3 25%, transparent 25%, transparent 75%, #eceff3 75%),
    linear-gradient(45deg, #eceff3 25%, transparent 25%, transparent 75%, #eceff3 75%),
    var(--bg-soft);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 22px;
}
#result-img {
  display: block;
  max-width: 100%;
  max-height: 460px;
  margin: 0 auto;
  border-radius: 4px;
}

.color-picker {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s, color .2s, box-shadow .2s;
}
.color-chip:hover { border-color: var(--primary); }
.color-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.color-chip.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-tint);
}
.chip-swatch {
  width: 15px; height: 15px;
  border-radius: 50%;
  display: inline-block;
}
/* 白色圆点在白底 chip 上不可见，需要描边 */
.chip-white { border: 1px solid var(--line); }

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-error {
  margin-top: 18px;
  padding: 13px 18px;
  font-size: 14px;
  color: #b3261e;
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: var(--radius);
  text-align: center;
}

/* 拍摄建议 */
.tool-tips {
  margin-top: 32px;
  padding: 26px 30px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tool-tips h3 { font-size: 16px; margin-bottom: 14px; color: var(--ink); }
.tool-tips ul { padding-left: 20px; margin-bottom: 14px; }
.tool-tips li {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.9;
}
.tool-tips-note {
  font-size: 13px;
  color: var(--light-gray);
  line-height: 1.8;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.tool-tips-note a { color: var(--primary); }

@media (max-width: 640px) {
  .tool-panel { padding: 22px 16px; }
  .drop-zone { padding: 40px 14px; }
  .tool-tips { padding: 20px 18px; }
  .result-actions .btn { width: 100%; }
}

/* 工具曾嵌在 products.html 里做两列（左文案右工具），但文案比工具矮一截，
   宽屏下左边留一大块空白。现已独立成 retouch.html，居中单栏，
   .product-tool 那套两列规则全部删除。 */

/* ---- 证件照设置面板 ---- */
.tool-panel#panel-settings { text-align: left; }
.settings-title { font-size: 17px; font-weight: 700; color: var(--ink); text-align: center; }
.settings-sub { font-size: 13px; color: var(--light-gray); text-align: center; margin-top: 6px; }

.opt-block { margin-top: 24px; }
.opt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.opt-label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.opt-hint { font-size: 12px; color: var(--light-gray); margin: 6px 0 10px; }
.opt-links { display: inline-flex; gap: 14px; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 13px; color: var(--primary);
}
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 着装：5 个等宽格子，窄屏自动换行 */
.clothing-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.cloth-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px;
  font-size: 12px; color: var(--gray);
  background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, color .2s, box-shadow .2s;
}
.cloth-icon { font-size: 20px; line-height: 1; }
.cloth-item:hover { border-color: var(--primary); }
.cloth-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cloth-item.active {
  border-color: var(--primary); color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-tint);
}

/* 修图细项：两列勾选卡片 */
.retouch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rt-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.rt-item:hover { border-color: var(--primary); }
.rt-item:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.rt-item input { margin: 2px 0 0; flex: 0 0 auto; cursor: pointer; accent-color: var(--primary); }
.rt-item.checked { border-color: var(--primary); background: var(--primary-tint); }
.rt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rt-name { font-size: 13px; color: var(--ink); }
.rt-desc { font-size: 11px; color: var(--light-gray); line-height: 1.5; }

/* 眼神矫正开关：原生 checkbox 隐藏在轨道下，保留键盘可达性 */
.switch-row {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13px; color: var(--gray);
  cursor: pointer;
}
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  flex: 0 0 auto;
  position: relative;
  width: 42px; height: 24px;
  background: #cfd6e0; border-radius: 999px;
  transition: background .2s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--white); border-radius: 50%;
  transition: transform .2s;
}
.switch-row input:checked ~ .switch-track { background: var(--primary); }
.switch-row input:checked ~ .switch-track::after { transform: translateX(18px); }
.switch-row input:focus-visible ~ .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }

.settings-actions {
  margin-top: 26px;
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
  .switch-track, .switch-track::after { transition: none; }
}

@media (max-width: 640px) {
  .clothing-row { grid-template-columns: repeat(3, 1fr); }
  .retouch-grid { grid-template-columns: 1fr; }
  .settings-actions .btn { width: 100%; }
}

/* ---- 付费去水印 ---- */

.wm-badge {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #874d00;
  font-size: 14px;
  line-height: 1.6;
}

.btn-pay {
  background: #d4380d;
  border-color: #d4380d;
  color: #fff;
}

.btn-pay:hover { background: #ad2102; border-color: #ad2102; }
.btn-pay:disabled { opacity: .6; cursor: not-allowed; }

.pay-title { margin: 0 0 6px; font-size: 20px; }
.pay-sub { margin: 0 0 18px; color: #666; font-size: 14px; line-height: 1.6; }

.plan-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.plan-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  border: 2px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}

.plan-item:hover { border-color: #c0c0c0; }

.plan-item.active {
  border-color: #d4380d;
  background: #fff2e8;
}

.plan-name { font-size: 15px; font-weight: 600; color: #222; }
.plan-price { font-size: 22px; font-weight: 700; color: #d4380d; }
.plan-note { font-size: 12px; color: #888; line-height: 1.5; }

.pay-qr {
  margin: 0 auto 14px;
  padding: 12px;
  max-width: 100%;
  border: 1px dashed #ccc;
  border-radius: 8px;
  font-size: 12px;
  color: #666;
  word-break: break-all;
}

.pay-status {
  margin: 0 0 16px;
  min-height: 22px;
  font-size: 14px;
  color: #555;
}

@media (max-width: 640px) {
  .plan-row { grid-template-columns: 1fr; }
  .plan-item { flex-direction: row; align-items: baseline; justify-content: space-between; text-align: left; }
  .plan-note { flex-basis: 100%; }
}

/* ---- 额度与券码 ---- */

.quota-line {
  margin: 10px 0 0;
  font-size: 14px;
  color: #4a5568;
  text-align: center;
}

.redeem-card {
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px dashed #b4c6e0;
  border-radius: 8px;
  background: #f6f9fd;
  text-align: center;
}

.redeem-card p { margin: 0 0 8px; font-size: 14px; color: #4a5568; }

.redeem-card code {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 5px;
  background: #fff;
  border: 1px solid #d5e0ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  letter-spacing: 1px;
  color: #1a365d;
  /* 券码要靠用户手抄，选中范围必须干净 */
  user-select: all;
}

.redeem-card-note { font-size: 13px; color: #718096; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

.redeem-box {
  margin: 22px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid #e2e8f0;
}

.redeem-box h3 { margin: 0 0 6px; font-size: 15px; color: #2d3748; }
.redeem-box > p { margin: 0 0 10px; font-size: 13px; color: #718096; }

.redeem-row { display: flex; gap: 8px; flex-wrap: wrap; }

.redeem-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.redeem-input:focus { outline: 2px solid #4a90d9; outline-offset: 1px; }

.redeem-status { margin: 8px 0 0; font-size: 13px; color: #c53030; min-height: 18px; }
.redeem-status.is-ok { color: #2f855a; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
