/**
 * 广告购买页样式 pay.html
 * 层次清晰、布局合理、自适应
 */

/* ========== 页面容器 ========== */
.pay-page-wrap .pay-page-card {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}

.pay-page-content {
  padding: 24px 20px 32px;
  border-radius: 12px;
  color: #1e293b;
}
.pay-page-content .layui-form-select dl dd,
.pay-page-content .layui-form-radio > div {
  color: #334155;
}

/* ========== 顶部说明（若有） ========== */
.pay-page-intro {
  font-size: 14px;
  line-height: 1.7;
  color: #2d3748;
  padding: 16px 20px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 10px;
  border-left: 4px solid #3497fc;
}

/* ========== 步骤条 ========== */
.pay-page-content .pay-step {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pay-page-content .pay-step .steps {
  display: flex;
  justify-content: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.pay-page-content .pay-step .steps li {
  flex: 0 0 auto;
  padding: 10px 20px;
  font-size: 14px;
  color: #5f6b7a;
  position: relative;
}

.pay-page-content .pay-step .steps li::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 1px;
  background: #e0e0e0;
}

.pay-page-content .pay-step .steps li:last-child::after {
  display: none;
}

.pay-page-content .pay-step .steps li.active {
  color: #3497fc;
  font-weight: 600;
}

/* ========== 标签切换 ========== */
.pay-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 6px;
  background: #f0f4f8;
  border-radius: 10px;
  border: 1px solid #e8ecf0;
}

.pay-tabs a {
  flex: 1;
  padding: 14px 20px;
  font-size: 15px;
  color: #374151;
  text-decoration: none;
  text-align: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.pay-tabs a i {
  margin-right: 8px;
}

.pay-tabs a:hover {
  color: #3497fc;
  background: rgba(52, 151, 252, 0.08);
}

.pay-tabs a.active {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #3497fc 0%, #2680e8 100%);
  box-shadow: 0 2px 8px rgba(52, 151, 252, 0.35);
}

/* ========== 面板 ========== */
.pay-panel {
  display: none;
  animation: pay-panel-in 0.25s ease;
}

.pay-panel.active {
  display: block;
}

@keyframes pay-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 通用区块（层次感） ========== */
.pay-page-content .pay-section {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e8ecf0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pay-page-content .pay-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.pay-page-content .pay-section-title i {
  margin-right: 8px;
  color: #3497fc;
}

/* 订单信息行：紧凑、弱化背景 */
.pay-section.pay-order-info {
  padding: 14px 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #e2e8f0;
}

.pay-section.pay-order-info .order {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pay-section.pay-order-info .sleft,
.pay-section.pay-order-info .sright {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
}

/* 表单区块：留白充足 */
.pay-section.pay-form-fields {
  padding: 24px;
}

/* 广告内容输入框与加粗按钮同一行 */
.content-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.content-input-wrap .layui-input,
.content-input-wrap input[id="content"] {
  flex: 1;
  min-width: 0;
}
.content-format-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.content-format-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}
.content-format-btn i {
  font-size: 16px;
}

/* 付款方式区块 */
.pay-section.pay-method {
  padding: 20px 24px;
}

.pay-section.pay-method .layui-form-item {
  margin-bottom: 0;
}

.pay-section.pay-method .layui-input-block {
  margin-left: 0;
}

/* 提交区：突出按钮 */
.pay-section.pay-submit {
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border-color: #e8ecf0;
}

.pay-section.pay-submit .pay-tip {
  font-size: 14px;
  color: #475569;
  margin-bottom: 16px;
}

/* ========== 主按钮 ========== */
.pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pay-btn-primary {
  background: linear-gradient(135deg, #3497fc 0%, #2680e8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(52, 151, 252, 0.4);
}

.pay-btn-primary:hover {
  background: linear-gradient(135deg, #2680e8 0%, #1a6fd6 100%);
  box-shadow: 0 6px 20px rgba(52, 151, 252, 0.45);
  transform: translateY(-1px);
}

/* 下拉触发框（显示当前选中值）：始终白底深色字，避免被选中态蓝底影响 */
.pay-page-content .layui-form-select .layui-input,
.pay-page-content .layui-form-select .layui-input:hover {
  background-color: #fff !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0;
}
.pay-page-content .layui-form-select.layui-form-selected .layui-input {
  background-color: #fff !important;
  color: #1e293b !important;
}

/* 下拉列表内：仅选中项蓝底白字，其余项白底深色字 */
.pay-page-content .layui-form-select dl dd {
  background-color: #fff;
  color: #334155;
}
.pay-page-content .layui-form-select dl dd:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}
.pay-page-content .layui-form-select dl dd.layui-this {
  background-color: #3497fc !important;
  color: #fff !important;
}
.layui-form-radioed, .layui-form-radioed > i, .layui-form-radio:hover * { color: #3497fc !important; }

/* ========== 文字广告：预览区块 ========== */
.pay-section.pay-preview-card .preview-inner {
  padding: 20px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #e2e8f0;
}

.pay-section.pay-preview-card .text-ad {
  padding: 16px 20px;
  border-radius: 8px;
  text-align: center;
}

.pay-section.pay-preview-card .text-ad a {
  font-size: 16px;
  text-decoration: none;
  /* 颜色由 updatePreview() 根据「文字颜色」选择器实时设置，此处不写死 */
}
.pay-section.pay-preview-card .text-ad {
  /* 背景与文字颜色由预览 JS 同步，此处仅布局 */
}

/* ========== 表单布局（文字广告） ========== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 0;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
}

.form-group label i {
  margin-right: 6px;
  color: #3497fc;
  width: 18px;
  text-align: center;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: border-color 0.2s;
}
.form-control::placeholder {
  color: #64748b;
}

.form-control:focus {
  outline: none;
  border-color: #3497fc;
  box-shadow: 0 0 0 3px rgba(52, 151, 252, 0.12);
}

.color-picker-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

.color-picker {
  width: 56px;
  height: 40px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
}

.color-text {
  flex: 1;
  background: #f8fafc !important;
  cursor: default;
}

.form-tips {
  margin-top: 8px;
  font-size: 13px;
  color: #64748b;
}

/* ========== 购买说明 ========== */
.pay-section.pay-notice {
  padding: 20px 24px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: #bbf7d0;
}

.pay-section.pay-notice .pay-section-title {
  border-bottom-color: rgba(34, 197, 94, 0.2);
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-item {
  display: flex;
  align-items: flex-start;
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
}

.notice-item i {
  color: #22c55e;
  margin-right: 10px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* 兼容旧类名 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, #3497fc 0%, #2680e8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(52, 151, 252, 0.4);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2680e8 0%, #1a6fd6 100%);
  box-shadow: 0 6px 20px rgba(52, 151, 252, 0.45);
  transform: translateY(-1px);
}

/* ========== 自适应 ========== */
@media (max-width: 768px) {
  .pay-page-content {
    padding: 16px 14px 24px;
  }

  .pay-page-intro {
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 13px;
  }

  .pay-page-content .pay-step {
    padding: 16px 18px;
  }

  .pay-step .steps li {
    padding: 8px 12px;
    font-size: 13px;
  }

  .pay-step .steps li::after {
    width: 16px;
  }

  .pay-tabs {
    flex-direction: column;
    padding: 4px;
    margin-bottom: 20px;
  }

  .pay-tabs a {
    padding: 12px 16px;
    font-size: 14px;
  }

  .pay-page-content .pay-section {
    margin-bottom: 18px;
    padding: 16px 18px;
  }

  .pay-section.pay-order-info {
    padding: 12px 18px;
  }

  .pay-section.pay-order-info .order {
    flex-direction: column;
    align-items: flex-start;
  }

  .pay-section.pay-form-fields {
    padding: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .pay-section.pay-submit {
    padding: 20px 18px;
  }

  .pay-btn,
  .btn-primary {
    width: 100%;
    padding: 14px 24px;
  }
}

@media (max-width: 480px) {
  .pay-page-content {
    padding: 12px 10px 20px;
  }

  .pay-page-content .pay-section {
    padding: 14px 16px;
  }

  .pay-section-title {
    font-size: 14px;
  }
}
