/* 卖货帮手 — 移动优先，大字大按钮高对比，照顾中老年用户 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #e02020;
  --primary-dark: #b81616;
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #222222;
  --text-sub: #555555;
  --border: #dddddd;
  --green: #1f8a4c;
  --yellow: #ffb300;
  --radius: 14px;
}

html {
  font-size: 17px;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 40px;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}
.topbar a {
  color: #fff;
  text-decoration: none;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 8px;
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.card h2 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .step-num {
  background: var(--primary);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ---------- 输入区 ---------- */
textarea#product-input {
  width: 100%;
  min-height: 130px;
  font-size: 18px;
  line-height: 1.6;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  background: #fdfdfb;
}
textarea#product-input:focus {
  outline: none;
  border-color: var(--primary);
}

.input-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  font-size: 19px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.05s;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  flex: 1;
}
.btn-primary:active {
  background: var(--primary-dark);
}
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-ghost {
  background: #f0efe9;
  color: var(--text);
}
.btn-block {
  width: 100%;
}
.btn-lg {
  min-height: 58px;
  font-size: 21px;
}

/* 麦克风按钮 */
#mic-btn {
  background: #fff;
  border: 2px solid var(--primary);
  color: var(--primary);
  min-width: 140px;
}
#mic-btn.recording {
  background: var(--primary);
  color: #fff;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 32, 32, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(224, 32, 32, 0); }
}

/* 微信语音降级提示条 */
.wechat-voice-hint {
  display: none;
  align-items: flex-start;
  gap: 8px;
  background: #fff7e0;
  border: 1px solid #f0d890;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 16px;
  color: #7a5b00;
}

/* 示例提示 */
.example-tip {
  font-size: 16px;
  color: var(--text-sub);
  margin-top: 10px;
}
.example-tip b {
  color: var(--primary);
}

/* ---------- 试用横幅 ---------- */
.trial-banner {
  margin-top: 14px;
  background: #fff3f3;
  border: 1px solid #f3c1c1;
  color: #a02020;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.trial-banner a {
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}
.trial-banner.activated {
  background: #eef8f0;
  border-color: #bfe3c8;
  color: var(--green);
}

/* ---------- 加载中 ---------- */
.loading-box {
  display: none;
  text-align: center;
  padding: 28px 0 12px;
}
.loading-box .spinner {
  width: 44px;
  height: 44px;
  border: 5px solid #f0d0d0;
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-box p {
  font-size: 17px;
  color: var(--text-sub);
}

/* ---------- 错误提示 ---------- */
.error-box {
  display: none;
  background: #fff2f0;
  border: 1px solid #f0b5ae;
  color: #b02a1f;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 17px;
}

/* ---------- 文案卡片 ---------- */
.copy-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
  cursor: pointer;
}
.copy-card.selected {
  border-color: var(--primary);
  background: #fff8f6;
}
.copy-card .copy-style {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border-radius: 6px;
  padding: 2px 10px;
  margin-bottom: 8px;
}
.copy-card .copy-text {
  font-size: 17px;
  white-space: pre-wrap;
  word-break: break-all;
}
.copy-card .copy-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.copy-card .copy-actions .btn {
  min-height: 46px;
  font-size: 17px;
  padding: 0 16px;
}
.copy-card .selected-flag {
  display: none;
  font-size: 15px;
  color: var(--primary);
  font-weight: 700;
  margin-left: auto;
  align-self: center;
}
.copy-card.selected .selected-flag {
  display: block;
}

/* ---------- 海报区 ---------- */
.tpl-switcher {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.tpl-chip {
  flex: 1;
  min-height: 50px;
  border-radius: 12px;
  border: 3px solid transparent;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
}
.tpl-chip[data-tpl="red"] { background: #d93a3a; }
.tpl-chip[data-tpl="yellow"] { background: #f5a623; color: #5c3a00; }
.tpl-chip[data-tpl="green"] { background: #3c9d63; }
.tpl-chip.active {
  border-color: #222;
  box-shadow: 0 0 0 2px #fff inset;
}

.poster-wrap {
  text-align: center;
}
#poster-img {
  width: 100%;
  max-width: 380px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.poster-tip {
  font-size: 17px;
  color: var(--text-sub);
  margin-top: 10px;
}
.poster-tip b {
  color: var(--primary);
}

/* ---------- 历史记录 ---------- */
details.history summary {
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.history-item {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.history-item .h-time {
  font-size: 14px;
  color: #999;
}
.history-item .h-input {
  font-size: 16px;
  font-weight: 700;
  margin: 4px 0;
}
.history-item .h-copy {
  font-size: 16px;
  color: var(--text-sub);
  white-space: pre-wrap;
}
.history-item .btn {
  min-height: 44px;
  font-size: 16px;
  margin-top: 8px;
}

/* ---------- 遮罩弹层（激活引导 / 改价格）---------- */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.show {
  display: flex;
}
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.modal h3 {
  font-size: 21px;
  margin-bottom: 10px;
}
.modal p {
  font-size: 17px;
  color: var(--text-sub);
  margin-bottom: 16px;
}
.modal input {
  width: 100%;
  min-height: 52px;
  font-size: 18px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  text-align: center;
}
.modal input:focus {
  outline: none;
  border-color: var(--primary);
}
.modal .btn {
  width: 100%;
  margin-top: 8px;
}
.modal .modal-msg {
  font-size: 16px;
  min-height: 24px;
  margin-bottom: 4px;
}
.modal .modal-msg.ok { color: var(--green); }
.modal .modal-msg.err { color: var(--primary); }
.modal .close-link {
  display: inline-block;
  margin-top: 14px;
  color: #888;
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px;
  line-height: 44px;
}

/* ---------- 设置页 ---------- */
.field-label {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}
.field-row {
  display: flex;
  gap: 10px;
}
.field-row input[type="password"],
.field-row input[type="text"] {
  flex: 1;
  min-height: 52px;
  font-size: 17px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  min-width: 0;
}
.field-row input:focus {
  outline: none;
  border-color: var(--primary);
}
.eye-btn {
  min-width: 56px;
  font-size: 22px;
  background: #f0efe9;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.save-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.field-msg {
  font-size: 16px;
  margin-top: 8px;
  min-height: 22px;
}
.field-msg.ok { color: var(--green); }
.field-msg.err { color: var(--primary); }

.privacy-note {
  background: #eef8f0;
  border: 1px solid #bfe3c8;
  color: #1a6b3c;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  margin-top: 12px;
}

/* 教程折叠块 */
details.tutorial {
  margin-top: 14px;
  border: 2px solid #f0d890;
  border-radius: 12px;
  background: #fffbef;
  padding: 0 14px;
}
details.tutorial summary {
  font-size: 18px;
  font-weight: 700;
  color: #8a6100;
  min-height: 54px;
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
details.tutorial summary::before {
  content: '▸ ';
  margin-right: 6px;
}
details.tutorial[open] summary::before {
  content: '▾ ';
}
.tutorial-steps {
  padding: 4px 0 16px;
}
.tutorial-steps .t-step {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  font-size: 17px;
}
.tutorial-steps .t-num {
  background: var(--yellow);
  color: #5c3a00;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.tutorial-steps .t-step b { color: #8a4b00; }
.tutorial-steps a {
  color: var(--primary);
  font-weight: 700;
  word-break: break-all;
}

/* 二维码上传 */
.qr-preview {
  width: 150px;
  height: 150px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 16px;
  margin: 12px 0;
  overflow: hidden;
  background: #fafaf7;
}
.qr-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 激活状态卡片 */
.act-status {
  font-size: 18px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.act-status.on {
  background: #eef8f0;
  color: var(--green);
}
.act-status.off {
  background: #fff3f3;
  color: #a02020;
}

.footer-note {
  text-align: center;
  font-size: 14px;
  color: #aaa;
  margin-top: 28px;
}

.hidden {
  display: none !important;
}
