/* M2.0-A3b1 顾客制作页独立样式：成套暖色变量与既有产品同源（纸面 / 墨色 /
   赭石强调），只服务 /make 顾客页面，不改公开贺卡与后台任何既有样式。
   手机优先、零 JS 依赖；输入与按钮满足触控热区，焦点态完整。 */

:root {
  --make-accent: #9b4a32;
  --make-accent-dark: #773522;
  --make-accent-soft: #f0e2da;
  --make-ink: #20211f;
  --make-muted: #666962;
  --make-paper: #f5f1e8;
  --make-surface: #fffdf8;
  --make-line: #d8d0c0;
  --make-error: #9d2d28;
  --make-error-soft: #f6e4e2;
  --make-ok: #41624a;
  --make-ok-soft: #e6ede7;
  --make-warn: #8a5a1f;
  --make-warn-soft: #f7eedd;
  --make-radius: 14px;
  --make-radius-small: 8px;
}

.make-body {
  min-height: 100dvh;
  margin: 0;
  color: var(--make-ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(155, 74, 50, 0.07), transparent 42%),
    var(--make-paper);
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

.make-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.make-wordmark {
  font-weight: 760;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.make-tagline {
  color: var(--make-muted);
  font-size: 13px;
}

.make-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 4px 20px 64px;
  display: grid;
  gap: 28px;
}

.make-panel {
  background: var(--make-surface);
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius);
  padding: 28px 22px;
  box-shadow: 0 1px 0 rgba(32, 33, 31, 0.04);
}

.make-panel-narrow { max-width: 560px; }
.make-panel-secondary {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.make-eyebrow {
  margin: 0 0 8px;
  color: var(--make-accent);
  font: 700 11px/1.2 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.16em;
}

.make-panel h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.make-panel h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.make-lede {
  margin: 0 0 18px;
  color: var(--make-muted);
  line-height: 1.75;
}

.make-opening {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--make-accent);
  border-radius: 0 var(--make-radius-small) var(--make-radius-small) 0;
  color: var(--make-muted);
  line-height: 1.7;
  background: var(--make-accent-soft);
}

.make-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 3px solid;
  border-radius: 0 var(--make-radius-small) var(--make-radius-small) 0;
  line-height: 1.65;
}

.make-notice-error { color: var(--make-error); border-color: var(--make-error); background: var(--make-error-soft); }
.make-notice-ok { color: var(--make-ok); border-color: var(--make-ok); background: var(--make-ok-soft); }
.make-notice-warn { color: var(--make-warn); border-color: var(--make-warn); background: var(--make-warn-soft); }

.make-form { display: grid; gap: 20px; }

.make-fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--make-ink);
  display: grid;
  gap: 14px;
}

.make-fieldset legend {
  padding: 0 10px 0 0;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.make-field { display: grid; gap: 7px; }

.make-field label {
  font-size: 14px;
  font-weight: 700;
}

.make-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #bcb4a4;
  border-radius: var(--make-radius-small);
  color: var(--make-ink);
  background: #fff;
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea.make-input { min-height: 120px; resize: vertical; line-height: 1.7; }

.make-input:focus {
  border-color: var(--make-accent);
  box-shadow: 0 0 0 3px rgba(155, 74, 50, 0.18);
}

.make-input-code {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.make-field-error {
  margin: 0;
  color: var(--make-error);
  font-size: 12px;
  line-height: 1.55;
}

.make-help {
  margin: 0;
  color: var(--make-muted);
  font-size: 12px;
  line-height: 1.6;
}

.make-music-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.make-music-preview-button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--make-accent);
  border-radius: var(--make-radius-small);
  color: var(--make-accent);
  background: var(--make-surface);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.make-music-preview-button:hover:not(:disabled) {
  color: var(--make-surface);
  background: var(--make-accent);
}

.make-music-preview-button:focus-visible {
  outline: 3px solid var(--make-accent-soft);
  outline-offset: 2px;
}

.make-music-preview-button:disabled { opacity: .5; cursor: not-allowed; }

.make-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  line-height: 1.6;
  cursor: pointer;
}

.make-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--make-accent);
}

.make-scene-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.make-scene-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--make-line);
  border-radius: 999px;
  color: var(--make-ink);
  background: var(--make-surface);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

a.make-scene-chip:hover { border-color: var(--make-accent); }

.make-scene-chip.is-active {
  color: #fffaf2;
  background: var(--make-accent);
  border-color: var(--make-accent);
}

.make-button {
  /* 链接式按钮（<a class="make-button">）必须进入正常布局流：行内盒的
     padding 视觉盒会与其后说明文字重叠约 13px（索引 285 真实布局矩形）；
     块级全宽后 min-height 触控热区真实生效，表单栅格内的提交按钮外观不变
     （border-box 由 site.css 全局提供，这里显式声明以自持）。 */
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--make-accent);
  border-radius: var(--make-radius-small);
  color: #fffaf2;
  background: var(--make-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.make-button:hover { background: var(--make-accent-dark); border-color: var(--make-accent-dark); }
.make-button:active { transform: translateY(1px); }

.make-button-secondary {
  color: var(--make-accent);
  background: transparent;
  border-color: var(--make-accent);
}

.make-button-secondary:hover {
  color: #fffaf2;
  background: var(--make-accent);
}

/* 表单/链接式按钮与其后说明文字的垂直间距（索引 285）：仅作用于面板
   直接子级的相邻组合（表单后的说明、按钮后的说明、两条相邻说明），
   不触碰 .make-form 栅格内部由 gap 控制的既有节奏。 */
.make-panel > .make-form + .make-help,
.make-panel > .make-button + .make-help {
  margin-top: 12px;
}

.make-panel > .make-help + .make-help {
  margin-top: 10px;
}

.make-button:focus-visible,
.make-scene-chip:focus-visible,
.make-link:focus-visible {
  outline: 3px solid rgba(155, 74, 50, 0.45);
  outline-offset: 2px;
}

.make-link {
  color: var(--make-accent);
  text-underline-offset: 4px;
}

.make-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.make-footer p {
  margin: 0;
  color: var(--make-muted);
  font-size: 12px;
  line-height: 1.6;
}

/* M2.0-A3b2 顾客媒体编辑区：照片清单 / 文件输入 / 主题画面单选。沿用
   暖色变量与既有节奏；文件输入与按钮满足触控热区，焦点态复用既有
   .make-input:focus / .make-button:focus-visible；零 JS 依赖。 */

.make-media-panel h2 {
  margin: 24px 0 12px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.make-media-panel h2:first-of-type { margin-top: 4px; }

.make-photo-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.make-photo-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
  background: var(--make-surface);
}

.make-photo-thumb {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
  background: var(--make-accent-soft);
}

.make-photo-label {
  margin: 0;
  color: var(--make-muted);
  font-size: 12px;
  line-height: 1.5;
}

.make-media-form {
  display: grid;
  gap: 10px;
}

.make-media-form + .make-media-form,
.make-media-form + .make-help,
.make-photo-list + .make-media-form { margin-top: 10px; }

.make-media-label {
  font-size: 14px;
  font-weight: 700;
}

.make-input-file { padding: 9px 11px; }

.make-upload-status[hidden] { display: none; }
.make-upload-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
  color: var(--make-accent-dark);
  background: var(--make-accent-soft);
  font-size: 14px;
}
.make-upload-spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid var(--make-line);
  border-top-color: var(--make-accent);
  border-radius: 50%;
  animation: make-upload-spin .8s linear infinite;
}
@keyframes make-upload-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .make-upload-spinner { animation: none; border-color: var(--make-accent); }
}

.make-button-danger {
  color: #fffaf2;
  background: var(--make-error);
  border-color: var(--make-error);
}

.make-button-danger:hover {
  background: #7d231f;
  border-color: #7d231f;
}

.make-check input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--make-accent);
}

.make-theme-current {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.make-theme-current span {
  color: var(--make-ink);
  font-size: 14px;
  font-weight: 700;
}

.make-theme-thumb {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
  background: var(--make-accent-soft);
}

/* 主题候选区卡片化（索引 295 返修）：每个可选项 = radio + 会话绑定缩略图
   （GET /make/theme-preview/{preset_id}，仅当前编辑会话可取）+ 文字说明的
   整项可点卡片，顾客按画面直接选图；loading=lazy 分摊 16 项预览请求。
   图片加载失败时保留软底占位块与 alt 文字，radio 选择与整项点击不受影响；
   选中/键盘焦点态走纯 CSS（:has），零 JS 依赖。 */

.make-theme-picker {
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.make-theme-picker legend,
.make-theme-intro,
.make-theme-none,
.make-theme-picker > .make-field-error { grid-column: 1 / -1; }

.make-theme-panel > .make-help { margin-bottom: 16px; }
.make-theme-panel .make-theme-current { margin-top: 16px; }

.make-theme-option {
  min-height: 48px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
  background: var(--make-surface);
  transition: border-color 0.18s ease;
}

.make-theme-option:hover,
.make-theme-option:has(input:checked) { border-color: var(--make-accent); }

.make-theme-option:has(input:focus-visible),
.make-theme-option input:focus-visible {
  outline: 3px solid rgba(155, 74, 50, 0.45);
  outline-offset: 2px;
}

.make-theme-option-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.make-theme-option-thumb {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
  background: var(--make-accent-soft);
}

.make-theme-option-text {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

@media (min-width: 640px) {
  .make-theme-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .make-theme-picker legend { grid-column: 1 / -1; }

  .make-theme-option-thumb { max-width: none; }
}

@media (max-width: 359px) {
  .make-theme-picker { grid-template-columns: minmax(0, 1fr); }
}

/* M2.0-A4 只读收礼链接/二维码面板：链接只读展示 + 打开核对 + 二维码预览
   与原生 download 下载，全部零 JS；本机（loopback）形态由模板渲染显著
   warn 短句，fail-closed 形态只有固定短句与说明。触控热区复用
   .make-button（min-height 48px），焦点态复用既有 focus-visible。 */

.make-share-panel h2 {
  margin: 4px 0 12px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.make-share-row {
  display: grid;
  gap: 10px;
}

.make-share-url {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.make-share-qr {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.make-share-qr-img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
  background: #fff;
}

.make-panel > .make-share-row + .make-help,
.make-panel > .make-share-qr + .make-help {
  margin-top: 12px;
}

@media (min-width: 640px) {
  .make-share-qr { grid-template-columns: auto minmax(0, 260px); align-items: start; justify-content: start; }
  .make-share-qr .make-button { align-self: start; }
}

@media (min-width: 640px) {
  .make-header { padding: 30px 24px 20px; }
  .make-main { padding: 8px 24px 72px; }
  .make-panel { padding: 34px 30px; }
  .make-form { gap: 24px; }
}

/* M2.1-A2 情侣暗号类型（原生 radio 三态）与暗号成句预览：fieldset/legend
   语义分组、整项 label 可点、键盘原生可达、焦点原生可见（focus-visible）；
   390px 单列自然换行不横溢；预览行复用 .make-help 字号并与公开页逐字同源，
   空值行由模板/脚本隐藏，零 JS 依赖也能保存并重开核对。 */

.make-kind-radios {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
}

.make-kind-radios legend {
  padding: 0 4px;
  color: var(--make-ink);
  font-size: 14px;
  font-weight: 700;
}

.make-kind-option {
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--make-line);
  border-radius: var(--make-radius-small);
  background: var(--make-surface);
}

.make-kind-option:hover,
.make-kind-option:has(input:checked) { border-color: var(--make-accent); }

.make-kind-option:has(input:focus-visible),
.make-kind-option input:focus-visible {
  outline: 3px solid rgba(155, 74, 50, 0.45);
  outline-offset: 2px;
}

.make-kind-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.make-capsule-preview {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--make-line);
  border-radius: var(--make-radius-small);
  background: var(--make-accent-soft);
}

.make-capsule-preview [data-make-capsule-line] {
  color: var(--make-ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.make-media-panel audio {
  display: block;
  width: 100%;
  max-width: 440px;
  margin: 12px 0;
}
