/* ============================================================
   详情页图 · 专属样式
   配色复用 style.css 变量
   ============================================================ */

/* ---------- 工作区布局 ---------- */
.di-workspace {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  gap: 24px;
  min-height: calc(100vh - 70px);
}
.di-panel {
  min-width: 0;
}
.di-left {
  flex: 0 0 40%;
  max-width: 40%;
  overflow-y: auto;
  max-height: calc(100vh - 90px);
  position: sticky;
  top: 80px;
  align-self: flex-start;
  padding-right: 8px;
}
.di-right {
  flex: 1;
  overflow-y: auto;
}

/* ---------- 卡片 ---------- */
.di-card {
  background: var(--card, #1a1a2e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: var(--radius, 12px);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.di-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.di-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-1, #667eea), var(--primary-2, #764ba2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.di-card-head h2 {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}
.di-optional {
  font-size: 12px;
  color: var(--text-sub, #9a9ab0);
  font-weight: 400;
}
.di-count {
  font-size: 12px;
  color: var(--text-dim, #6a6a80);
  white-space: nowrap;
}

/* ---------- 上传区 ---------- */
.di-upload-zone {
  position: relative;
  border: 2px dashed var(--border, #4a4a6a);
  border-radius: var(--radius-sm, 8px);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s;
  overflow: hidden;
  background: var(--input, #2a2a3e);
}
.di-upload-zone:hover,
.di-upload-zone:focus {
  border-color: var(--primary-1, #667eea);
}
.di-upload-zone.has-image {
  border-style: solid;
}
.di-upload-preview {
  max-height: 200px;
  object-fit: contain;
}
.di-upload-placeholder {
  text-align: center;
  padding: 20px;
}
.di-upload-placeholder .upload-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}
.di-upload-placeholder .upload-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.di-upload-placeholder .upload-tip {
  font-size: 12px;
  color: var(--text-dim, #6a6a80);
}
.di-upload-mask {
  position: absolute;
  inset: 0;
  background: rgba(15,15,26,.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

/* ---------- 参考素材网格 ---------- */
.di-ref-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.di-ref-item {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border, #4a4a6a);
}
.di-ref-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.di-ref-item .di-ref-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,77,79,.8);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}
.di-ref-add {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 2px dashed var(--border, #4a4a6a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim, #6a6a80);
  transition: border-color .2s;
}
.di-ref-add:hover {
  border-color: var(--primary-1, #667eea);
  color: var(--primary-1, #667eea);
}
.di-ref-add span {
  font-size: 22px;
  line-height: 1;
}
.di-ref-add p {
  font-size: 10px;
  margin-top: 2px;
}

/* ---------- 文本域 ---------- */
.di-card textarea {
  width: 100%;
  background: var(--input, #2a2a3e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: var(--radius-sm, 8px);
  color: var(--text, #e8e8f0);
  padding: 10px 12px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
  -webkit-user-select: text;
  user-select: text;
}
.di-card textarea:focus {
  outline: none;
  border-color: var(--primary-1, #667eea);
}
.di-req-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.di-char-count {
  font-size: 12px;
  color: var(--text-dim, #6a6a80);
}
.di-btn-ai {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  background: rgba(102,126,234,.15);
  color: var(--primary-1, #667eea);
  border: 1px solid rgba(102,126,234,.3);
  cursor: pointer;
  transition: all .2s;
}
.di-btn-ai:hover {
  background: rgba(102,126,234,.25);
}
.di-btn-ai:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ---------- 快捷风格标签 ---------- */
.di-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.di-tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border, #4a4a6a);
  background: var(--input, #2a2a3e);
  color: var(--text-sub, #9a9ab0);
  cursor: pointer;
  transition: all .2s;
}
.di-tag:hover {
  border-color: var(--primary-1, #667eea);
  color: var(--text, #e8e8f0);
}
.di-tag.active {
  background: #fdf6e3;
  color: #6b4f13;
  border-color: #e6c87a;
}

/* ---------- 设置项 ---------- */
.di-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.di-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.di-field label {
  font-size: 12px;
  color: var(--text-sub, #9a9ab0);
}
.di-field select {
  background: var(--input, #2a2a3e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: 6px;
  color: var(--text, #e8e8f0);
  padding: 6px 10px;
  font-size: 13px;
}
.di-field select:focus {
  outline: none;
  border-color: var(--primary-1, #667eea);
}

/* ---------- 主按钮 ---------- */
.di-btn-primary {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-sm, 8px);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-1, #667eea), var(--primary-2, #764ba2));
  border: none;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.di-btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102,126,234,.35);
}
.di-btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}
.di-btn-primary .btn-icon {
  font-size: 18px;
}
.di-btn-generate {
  margin-top: 18px;
}

/* ---------- 按钮轮廓 ---------- */
.di-btn-outline {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--border, #4a4a6a);
  color: var(--text, #e8e8f0);
  cursor: pointer;
  transition: all .2s;
}
.di-btn-outline:hover {
  border-color: var(--primary-1, #667eea);
  color: var(--primary-1, #667eea);
}

/* ---------- 规划空状态 ---------- */
.di-plan-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim, #6a6a80);
}
.di-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.di-plan-empty p {
  font-size: 14px;
  margin: 4px 0;
}

/* ---------- 规划头部 ---------- */
.di-plan-header h2 {
  font-size: 16px;
  margin-bottom: 4px;
}
.di-plan-hint {
  font-size: 13px;
  color: var(--text-sub, #9a9ab0);
}

/* ---------- 规划卡片网格 ---------- */
.di-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.di-plan-card {
  background: var(--card, #1a1a2e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: var(--radius, 12px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.di-plan-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.di-plan-card-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.di-module-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
}
.di-module-badge.hero_shot { background: #667eea; }
.di-module-badge.feature { background: #e67e22; }
.di-module-badge.scene { background: #27ae60; }
.di-module-badge.specs { background: #9b59b6; }
.di-module-badge.comparison { background: #e74c3c; }
.di-module-badge.usage { background: #1abc9c; }
.di-module-badge.package { background: #3498db; }
.di-module-badge.brand_story { background: #f39c12; }

.di-plan-card textarea {
  width: 100%;
  background: var(--input, #2a2a3e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: 6px;
  color: var(--text, #e8e8f0);
  padding: 8px 10px;
  font-size: 12px;
  resize: vertical;
  min-height: 60px;
  line-height: 1.4;
}
.di-plan-card textarea:focus {
  outline: none;
  border-color: var(--primary-1, #667eea);
}
.di-plan-card .di-copy-input {
  width: 100%;
  background: var(--input, #2a2a3e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: 6px;
  color: var(--gold, #e6b422);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
}
.di-plan-card .di-copy-input:focus {
  outline: none;
  border-color: var(--gold, #e6b422);
}
.di-plan-card-footer {
  display: flex;
  justify-content: flex-end;
}
.di-card-regen {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border, #4a4a6a);
  color: var(--text-sub, #9a9ab0);
  cursor: pointer;
  transition: all .2s;
}
.di-card-regen:hover {
  color: var(--primary-1, #667eea);
  border-color: var(--primary-1, #667eea);
}

/* ---------- 结果区 ---------- */
.di-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.di-result-header h2 {
  font-size: 16px;
}
.di-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.di-result-item {
  background: var(--card, #1a1a2e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: var(--radius, 12px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.di-result-img-wrap {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--input, #2a2a3e);
  display: flex;
  align-items: center;
  justify-content: center;
}
.di-result-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.di-result-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim, #6a6a80);
  font-size: 13px;
}
.di-result-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--danger, #ff4d4f);
  font-size: 13px;
  padding: 16px;
}
.di-result-error button {
  padding: 4px 12px;
  border-radius: 5px;
  background: rgba(255,77,79,.1);
  border: 1px solid var(--danger, #ff4d4f);
  color: var(--danger, #ff4d4f);
  cursor: pointer;
  font-size: 12px;
}
.di-result-footer {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.di-result-title {
  font-size: 12px;
  color: var(--text-sub, #9a9ab0);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.di-result-download {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  background: rgba(102,126,234,.15);
  border: 1px solid rgba(102,126,234,.3);
  color: var(--primary-1, #667eea);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.di-result-download:hover {
  background: rgba(102,126,234,.25);
}

/* ---------- Toast（复用 style.css 样式，这里补充位置） ---------- */

/* ---------- Spinner（复用 style.css） ---------- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border, #4a4a6a);
  border-top-color: var(--primary-1, #667eea);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 登录弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: grid;
  place-items: center;
  z-index: 100;
}
.modal-card {
  background: var(--card, #1a1a2e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: var(--radius, 12px);
  width: 380px;
  max-width: 90vw;
  padding: 28px 24px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  color: var(--text-dim, #6a6a80);
  cursor: pointer;
  background: none;
  border: none;
}
.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border, #4a4a6a);
}
.modal-tab {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  color: var(--text-sub, #9a9ab0);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all .2s;
}
.modal-tab.active {
  color: var(--primary-1, #667eea);
  border-bottom-color: var(--primary-1, #667eea);
}
.modal-body .form-group {
  margin-bottom: 14px;
}
.modal-body label {
  display: block;
  font-size: 12px;
  color: var(--text-sub, #9a9ab0);
  margin-bottom: 4px;
}
.modal-body input {
  width: 100%;
  background: var(--input, #2a2a3e);
  border: 1px solid var(--border, #4a4a6a);
  border-radius: 6px;
  color: var(--text, #e8e8f0);
  padding: 10px 12px;
  font-size: 14px;
}
.modal-body input:focus {
  outline: none;
  border-color: var(--primary-1, #667eea);
}
.captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.captcha-row input {
  flex: 1;
}
.captcha-img {
  width: 100px;
  height: 38px;
  border-radius: 4px;
  border: 1px solid var(--border, #4a4a6a);
  cursor: pointer;
}
.modal-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--danger, #ff4d4f);
  text-align: center;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .di-workspace {
    flex-direction: column;
    padding: 12px 14px;
  }
  .di-left {
    flex: none;
    max-width: 100%;
    position: static;
    max-height: none;
    padding-right: 0;
  }
  .di-settings {
    grid-template-columns: 1fr;
  }
  .di-plan-grid {
    grid-template-columns: 1fr;
  }
  .di-result-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .product-tabs {
    display: none;
  }
}
