/* AI 图生图 自定义样式 */

/* ========== 全站直角（全站约定）：覆盖 bootstrap 组件默认圆角 ========== */
.btn, .form-control, .form-select, .input-group-text, .card, .alert,
.dropdown-menu, .modal-content, .badge, .list-group-item,
.toast, .progress, .tooltip-inner, .popover, .accordion-item,
img, .img-thumbnail, .card-img-top, .rounded, .rounded-1, .rounded-2, .rounded-3,
.rounded-4, .rounded-circle, .rounded-pill, .rounded-top, .rounded-bottom {
  border-radius: 0 !important;
}

body {
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ========== 全屏生成遮罩 ========== */
.gen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  /* 阻止所有鼠标事件冒泡到下面 */
  cursor: wait;
}
.gen-overlay.is-active {
  display: flex !important;
}
.gen-overlay-inner {
  text-align: center;
  pointer-events: auto;
}
/* 遮罩打开时，下层所有点击都吃掉 */
.gen-overlay.is-active ~ * {
  pointer-events: none !important;
}

.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* 首页 banner 左右分栏：Logo / 宣传图 双入口 */
/* 锚点跳转均为浏览器原生瞬间定位（不用 scroll-behavior:smooth） */
.hero-pane-divider { border-left: 1px solid rgba(255, 255, 255, 0.35); }
@media (max-width: 767.98px) {
  .hero-pane-divider {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    padding-left: 0 !important;
    padding-top: 1rem;
  }
  .hero-pane:first-child { padding-bottom: 1rem; }
}
.hero-price {
  font-size: 0.65em;
  opacity: 0.85;
  font-weight: 400;
  margin-left: 0.25rem;
}
.hero-btn {
  color: #5b4bc4;
  font-weight: 600;
  border-radius: 0;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.hero-btn:hover, .hero-btn:focus {
  color: #4a3ba3;
  background-color: #f8f9fa;
}

.preset-card {
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.preset-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.preset-card img {
  height: 176px;
  object-fit: cover;
  background: #f0f0f0;
}

table img {
  border-radius: 4px;
}

/* 表格行高紧凑 */
.table-sm td,
.table-sm th {
  padding: 0.5rem;
}

/* ========== 手机端触摸体验优化（≤768px 生效，电脑端零影响） ========== */
@media (max-width: 768px) {
  /* 触摸目标 ≥44px（iOS/Google 推荐） */
  .btn {
    min-height: 44px;
    padding: 0.6rem 1rem;
    font-size: 1rem;
  }
  .btn-sm {
    min-height: 40px;
    padding: 0.5rem 0.85rem;
  }
  /* 输入框字号 ≥16px（避免 iOS 自动缩放视口） */
  .form-control,
  .form-select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }
  /* 容器内边距收紧 */
  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  /* 导航链接加大点击区 */
  .navbar-nav .nav-link {
    padding: 0.65rem 1rem;
  }
  /* 预设卡片图高度降低（手机一屏多看几个） */
  .preset-card img {
    height: 140px;
  }
  /* 表格在手机上横向滚动而不是挤压 */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
  /* modal 在手机上更紧凑 */
  .modal-dialog {
    margin: 0.5rem;
  }
  /* 弹窗内的图片不让它顶到屏幕外 */
  #resultModalImg {
    max-height: 55vh !important;
  }
}

/* 生成弹窗内的输入框提示文字：更小更淡 */
#genModal .form-control::placeholder {
  font-size: 12px;
  color: #adb5bd;
}

/* ===== 小字快捷填入：蓝色链接字（无框） ===== */
.js-fill-small {
  border: 0;
  background: transparent;
  color: #0d6efd;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}
.js-fill-small:hover {
  text-decoration: underline;
}



/* ============ 宣传图（xct）编辑区：缩略图 + 大输入框 + 图标上传按钮 ============ */
.xct-editor {
  background: #ffffff;
}
.xct-editor:focus-within {
  border-color: #86b7fe;
}
.xct-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
  border: 1px solid #dee2e6;
  border-radius: 0;
}
.xct-thumb-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 20px;
  border: 1px solid #6c757d;
  background: #ffffff;
  color: #6c757d;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.xct-thumb-remove:hover {
  background: #dc3545;
  border-color: #dc3545;
  color: #ffffff;
}
/* 输出尺寸比例卡片：图形示意 + 比例文字，radio 隐藏、选中态蓝色边框 */
.xct-size-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 54px;
  height: 62px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0;
  cursor: pointer;
  user-select: none;
}
.xct-size-card:hover { border-color: #adb5bd; }
input:checked + .xct-size-card {
  border-color: #0d6efd;
  box-shadow: inset 0 0 0 1px #0d6efd;
}
input:checked + .xct-size-card .xct-size-shape { background: #0d6efd; }
input:checked + .xct-size-card .xct-size-label { color: #0d6efd; font-weight: 600; }
.xct-size-shape {
  display: block;
  background: #adb5bd;
}
.shape-portrait { width: 18px; height: 32px; }  /* 9:16 */
.shape-square   { width: 26px; height: 26px; }  /* 1:1 */
.xct-size-label {
  font-size: 11px;
  line-height: 1;
  color: #495057;
}

.xct-upload-btn {
  position: relative;
  padding: 0.3rem 0.55rem;
  color: #495057;
  border-radius: 0;
}
/* 自定义 tooltip：hover 瞬时显示，位于元素正上方（原生 title 有系统延迟且位置不受控） */
.has-tip {
  position: relative; /* tooltip 伪元素 absolute 定位的锚点 */
}
.has-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 9px;
  background: #212529;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 20;
}
.has-tip:hover::after,
.has-tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* ============ 宣传图右侧生成区域（#xctStage：idle/loading/failed/result 四态） ============ */
#xctStage {
  min-height: 420px;
}
.xct-slogan {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ced4da;
  letter-spacing: 0.05em;
}
.xct-slogan-divider {
  width: 56px;
  height: 2px;
  background: #ced4da;
  margin: 0.75rem auto;
}
.xct-slogan-sub {
  font-size: 0.9rem;
  color: #adb5bd;
  letter-spacing: 0.15em;
}
.xct-stage-loading p,
.xct-stage-failed p {
  overflow-wrap: anywhere;
}
.xct-stage-img {
  max-width: 100%;
  max-height: 68vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid #dee2e6;
  cursor: zoom-in;
}
/* 窄屏堆叠时右侧区域收窄高度 */
@media (max-width: 991.98px) {
  #xctStage {
    min-height: 280px;
  }
}
