/* ========================================
   H5 发布页样式 — 对齐原生小程序 publish.wxss
   ======================================== */

.pub-page { background: var(--bg); min-height: 100vh; padding-bottom: 120px; }

/* ===== 头部渐变区（分类选择）===== */
.pub-header-gradient {
  background: linear-gradient(180deg, #1DB9A6 0%, #2DD4BF 40%, #E0F7F4 100%);
  padding: 20px 16px 16px;
}
.pub-header-gradient .pub-section-label {
  font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 10px;
  display: flex; align-items: center; gap: 4px;
}
.pub-header-gradient .pub-section-label .pub-star { color: #fff; }

/* 分类网格 4列 */
.pub-cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px 6px; padding-bottom: 8px;
}
.pub-cat-tag {
  font-size: 12px; color: #666; background: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.5); border-radius: 10px;
  padding: 7px 3px; text-align: center; cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  min-height: 34px; user-select: none;
}
.pub-cat-tag.active {
  color: #fff; background: linear-gradient(135deg, #1DB9A6, #28C9B3);
  border-color: #1DB9A6; font-weight: 600;
  box-shadow: 0 2px 6px rgba(29,185,166,.25);
}
.pub-cat-tag:active { transform: scale(.94); opacity: .85; }

.pub-cat-hint {
  display: none; align-items: center; gap: 4px;
  padding: 8px 10px; background: rgba(255,255,255,.85);
  border-radius: 5px; font-size: 12px; color: #2e7d32;
}
.pub-cat-hint.show { display: flex; }

/* ===== 引导提示 + 发布规范（未选分类时）===== */
.pub-guide-wrap { padding: 16px; }
.pub-guide-prompt {
  background: #fff; border-radius: 12px; padding: 40px 32px 32px;
  margin-bottom: 12px; box-shadow: 0 1px 4px rgba(29,185,166,.08);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.pub-guide-icon-wrap {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #E0F7F4, #B2EBE4);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(29,185,166,.15);
}
.pub-guide-icon { font-size: 28px; }
.pub-guide-title { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 6px; }
.pub-guide-sub { font-size: 13px; color: #999; }

.pub-rules {
  background: #fff; border-radius: 12px; padding: 16px 14px 10px;
  box-shadow: 0 1px 4px rgba(29,185,166,.08);
}
.pub-rules-header {
  display: flex; align-items: center; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid #f0f0f0;
}
.pub-rules-icon { font-size: 16px; margin-right: 5px; }
.pub-rules-title { font-size: 15px; font-weight: 600; color: #333; }
.pub-rule-item {
  display: flex; align-items: flex-start; padding: 6px 0;
  font-size: 13px; color: #666; line-height: 1.5;
}
.pub-rule-icon { margin-right: 6px; flex-shrink: 0; }
.pub-rule-highlight { color: #1DB9A6; font-weight: 600; }

/* ===== 表单卡片 ===== */
.pub-card {
  background: #fff; border-radius: 12px;
  padding: 14px 14px 0; margin: 0 12px 10px;
  box-shadow: 0 1px 4px rgba(29,185,166,.08);
  overflow: hidden;
}
.pub-card-title {
  font-size: 14px; font-weight: 600; color: #333;
  margin-bottom: 10px; display: flex; align-items: center; gap: 4px;
}
.pub-card-title .pub-star { color: #1DB9A6; }

/* ===== 动态表单字段 ===== */
.pub-field { margin-bottom: 14px; }
.pub-field:last-child { margin-bottom: 14px; }
.pub-field-label {
  font-size: 13px; color: #5A6B6B; margin-bottom: 4px; display: block;
}

/* 输入框/下拉框/文本域 */
.pub-input, .pub-select, .pub-textarea {
  width: 100%; padding: 0 12px;
  border: 1px solid #eee; border-radius: 5px;
  font-size: 14px; color: #333;
  background: #fff; outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.pub-input { height: 44px; }
.pub-select { height: 44px; appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23999' stroke-width='2'/%3E%3C/svg%3E") right 12px center no-repeat;
  padding-right: 32px; cursor: pointer;
}
.pub-textarea { min-height: 100px; padding: 10px 12px; resize: vertical; }
.pub-input:focus, .pub-select:focus, .pub-textarea:focus { border-color: #1DB9A6; }
.pub-input::placeholder, .pub-textarea::placeholder, .pub-select option[value=""] { color: #bbb; }

/* ===== 标题区 ===== */
.pub-title-row { display: flex; align-items: center; gap: 8px; }
.pub-title-auto {
  flex: 1; font-size: 14px; color: #999;
  padding: 11px 12px; background: #f5f7fa;
  border: 1px solid #ddd; border-radius: 5px;
  min-height: 44px; cursor: pointer;
  display: flex; align-items: center; transition: all .2s;
  box-sizing: border-box;
}
.pub-title-auto.has { color: #333; background: linear-gradient(135deg,#f0f4ff,#fff8f5); border-color: #c8ceea; }
.pub-title-input {
  flex: 1; display: none; height: 44px;
  border: 1px solid #1DB9A6 !important;
  border-radius: 5px; padding: 0 12px;
  font-size: 14px; color: #333; outline: none;
  box-sizing: border-box;
}
.pub-title-input.show { display: block; }
.pub-edit-btn {
  padding: 7px 14px; background: linear-gradient(135deg,#1DB9A6,#28C9B3);
  color: #fff; font-size: 12px; font-weight: 600;
  border: none; border-radius: 6px; cursor: pointer;
  white-space: nowrap; box-shadow: 0 2px 7px rgba(29,185,166,.3);
  flex-shrink: 0;
}
.pub-edit-btn:active { transform: scale(.95); }
.pub-edit-btn.editing { background: linear-gradient(135deg,#667eea,#764ba2); }
.pub-char-hint { text-align: right; font-size: 11px; color: #ccc; padding: 2px 0 8px; }

/* ===== 图片上传 ===== */
.pub-img-grid { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; }
.pub-img-box {
  width: calc((100% - 16px) / 3); aspect-ratio: 1 / 1;
  border-radius: 6px; position: relative; overflow: hidden;
  border: 1px solid #e8e8e8; flex-shrink: 0;
}
.pub-img-box img { width: 100%; height: 100%; object-fit: cover; }
.pub-img-del {
  position: absolute; top: 0; right: 0;
  width: 22px; height: 22px;
  background: rgba(0,0,0,.45); color: #fff;
  border-radius: 0 0 0 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; z-index: 1; transition: background .15s;
}
.pub-img-del:active { background: rgba(211,47,47,.7); }
.pub-img-add {
  width: calc((100% - 16px) / 3); aspect-ratio: 1 / 1;
  border: 1px dashed #ccc; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #ccc; font-size: 11px;
  cursor: pointer; transition: all .2s;
  background: #fafafa; flex-shrink: 0;
  box-sizing: border-box;
}
.pub-img-add:active { background: #f0f0f0; border-color: #1DB9A6; color: #1DB9A6; }
.pub-img-add .pub-plus { font-size: 24px; margin-bottom: 2px; }

/* ===== 联系方式 ===== */
.pub-contact-row {
  display: flex; align-items: center; gap: 8px;
}
.pub-contact-label {
  font-size: 13px; color: #5A6B6B; flex-shrink: 0; min-width: 56px;
}
.pub-contact-input { flex: 1; }

.pub-toggle-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.pub-toggle-switch {
  width: 44px; height: 24px; border-radius: 12px;
  background: #ccc; position: relative; cursor: pointer;
  transition: background .2s; flex-shrink: 0;
}
.pub-toggle-switch.on { background: linear-gradient(135deg,#4caf50,#81c784); }
.pub-toggle-switch::after {
  content: ''; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; position: absolute; top: 2px; left: 2px;
  transition: left .25s ease; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.pub-toggle-switch.on::after { left: 22px; }
.pub-toggle-label { font-size: 12px; color: #888; }
.pub-phone-tip {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px; background: #e8f5e9; border-radius: 4px;
  margin-top: 8px; font-size: 11px; color: #2e7d32;
}

/* ===== 到期/规范提示卡片 ===== */
.pub-expire-notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; margin: 0 12px 10px;
  background: linear-gradient(135deg,#fffbea,#fff3cd);
  border: 1px solid #ffd54f; border-radius: 7px;
}
.pub-notice-icon-wrap {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg,#ff9800,#ff5722);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 13px; line-height: 1;
}
.pub-notice-body { flex: 1; }
.pub-notice-title {
  font-size: 12px; color: #e65100; font-weight: 700;
  line-height: 1.5; display: block;
}
.pub-notice-highlight { color: #1DB9A6; font-weight: 800; }
.pub-notice-desc { font-size: 11px; color: #5A6B6B; }

/* ===== 协议 + 提交按钮 ===== */
.pub-agree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 12px; color: #888; cursor: pointer;
}
.pub-agree-box {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #ccc; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent; transition: all .15s;
}
.pub-agree-box.on { background: #1DB9A6; border-color: #1DB9A6; color: #fff; }
.pub-agree-link { color: #1DB9A6; font-weight: 600; }

.pub-submit-wrap { padding: 10px 12px 20px; }
.pub-submit-btn {
  display: block; width: 100%; height: 48px;
  background: linear-gradient(135deg, #1DB9A6, #28C9B3);
  color: #fff; font-size: 17px; font-weight: 700;
  border: none; border-radius: 8px; letter-spacing: 4px;
  box-shadow: 0 3px 11px rgba(29,185,166,.35);
  cursor: pointer; transition: transform .1s, box-shadow .1s;
}
.pub-submit-btn:active { transform: scale(.98); box-shadow: 0 2px 8px rgba(29,185,166,.25); }
.pub-submit-btn:disabled { opacity: .65; pointer-events: none; }
