:root {
  --bg: #faf7f5;
  --card: #ffffff;
  --ink: #2b2320;
  --muted: #8a7f7a;
  --accent: #e05a47;
  --accent-dark: #c94a38;
  --accent-soft: #fdeee9;
  --border: #eee5df;
  --ok: #2f9e6e;
  --warn: #b5771a;
  --err: #d1493f;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 56px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.admin-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  background: #fff;
}
.admin-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 12px 4px 24px; }
.hero h1 {
  font-size: 27px;
  line-height: 1.4;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.hero .sub { color: var(--muted); margin: 0; font-size: 15px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(43, 35, 32, 0.03);
}
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.center { text-align: center; padding: 40px 22px; }
.card h2 {
  font-size: 17px;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 { font-size: 15px; margin: 0 0 12px; }

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* ---------- 提示条 ---------- */
.alert {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.alert a { color: inherit; font-weight: 700; }
.alert.warn { background: #fff7e8; border: 1px solid #f2dcb3; color: var(--warn); }
.alert.error { background: #fdeceb; border: 1px solid #f6c9c5; color: var(--err); }
.alert.ok { background: #eaf7f0; border: 1px solid #bde5d1; color: var(--ok); }

/* ---------- 人格选择 ---------- */
.personas { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.persona { cursor: pointer; }
.persona input { position: absolute; opacity: 0; pointer-events: none; }
.persona-body {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: all 0.15s ease;
  background: #fff;
}
.persona-emoji { grid-row: span 2; font-size: 22px; line-height: 1.4; }
.persona-name { font-weight: 700; font-size: 15px; }
.persona-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.persona input:checked + .persona-body {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(224, 90, 71, 0.08);
}

/* ---------- 上传区 ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1.5px dashed #d9cdc6;
  border-radius: 14px;
  padding: 30px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  background: #fffdfc;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }
.dz-icon { font-size: 28px; }
.dz-title { font-weight: 700; font-size: 15px; }
.dz-hint { font-size: 12.5px; color: var(--muted); }

.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.file-row { font-size: 13px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s ease;
}
.btn.primary {
  width: 100%;
  margin-top: 22px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(224, 90, 71, 0.25);
}
.btn.primary:hover { background: var(--accent-dark); }
.btn.primary:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 8px 16px;
}

/* ---------- 表单 ---------- */
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}
textarea { resize: vertical; line-height: 1.6; }
input[type="file"] { width: 100%; margin-top: 6px; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .grid2 { grid-template-columns: 1fr; gap: 0; } }

/* ---------- 进度 ---------- */
.big-emoji { font-size: 44px; margin-bottom: 8px; }
.spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 18px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.bar {
  width: 100%;
  height: 8px;
  background: #f2ebe7;
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0 12px;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f0896f, var(--accent));
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ---------- 报告 ---------- */
.report-head { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
}
.badge.soft { background: #f0ece9; color: var(--muted); font-weight: 600; }

.report h1 {
  font-size: 22px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent-soft);
  line-height: 1.5;
}
.report h2 {
  font-size: 17px;
  margin: 26px 0 10px;
  padding-left: 11px;
  border-left: 4px solid var(--accent);
  line-height: 1.5;
}
.report h3 { font-size: 15px; margin: 18px 0 6px; color: var(--accent-dark); }
.report p { margin: 0 0 12px; }
.report ul, .report ol { padding-left: 22px; margin: 0 0 14px; }
.report li { margin-bottom: 7px; }
.report strong { color: var(--accent-dark); }
.report blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--border);
  background: #fbf8f6;
  color: var(--muted);
  border-radius: 0 10px 10px 0;
}
.report code {
  background: #f5efeb;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 14px 18px;
}
.actions { margin-top: 4px; }

/* ---------- 好感度走势 ---------- */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 120px;
  padding: 0 2px;
}
.spark-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.spark-value { font-size: 11px; color: var(--muted); }
.spark-bar {
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, #f0896f, var(--accent));
  border-radius: 8px 8px 3px 3px;
}

/* ---------- 杂项 ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--muted); margin: 10px 0 0; text-align: center; }
ul.plain { list-style: none; padding-left: 0; }
ul.plain li { position: relative; padding-left: 18px; margin-bottom: 8px; font-size: 14px; }
ul.plain li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
}
code {
  background: #f5efeb;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 0.88em;
}
.foot {
  margin-top: 32px;
  font-size: 11.5px;
  color: #b3a8a2;
  text-align: center;
  line-height: 1.7;
}

/* ---------- 顶栏导航 ---------- */
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
}
.nav-link:hover { color: var(--accent); background: var(--accent-soft); }

/* ---------- 拖拽上传 ---------- */
.dropzone { position: relative; user-select: none; }
.dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(224, 90, 71, 0.1);
}
.dropzone.has-files { border-style: solid; border-color: #e3d5cd; }
.dz-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preview:empty { display: none; }
.thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f4eeea;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 1;
  border: none;
  border-radius: 50%;
  background: rgba(43, 35, 32, 0.62);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.thumb-del:hover { background: var(--err); }

.dz-counter {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
  min-height: 18px;
}
.dz-counter.warn { color: var(--err); font-weight: 600; }

.conv-label { margin-bottom: 6px; }
.tiny.left { text-align: left; }

/* ---------- 历史列表 ---------- */
.small-hero h1 { font-size: 23px; margin-bottom: 6px; }
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-item { position: relative; display: flex; }
.hist-link {
  flex: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}
.hist-link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(224, 90, 71, 0.09);
}
.hist-thumb {
  width: 56px;
  height: 74px;
  flex: 0 0 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f4eeea;
}
.hist-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #cbbfb8;
}
.hist-body { min-width: 0; flex: 1; }
.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tiny-badge { font-size: 11px; padding: 2px 9px; }
.hist-score { font-size: 16px; font-weight: 800; color: var(--accent); }
.hist-score small { font-size: 10px; color: var(--muted); font-weight: 500; }
.hist-title {
  font-weight: 700;
  font-size: 15px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hist-fail { color: var(--err); }
.hist-pending { color: var(--warn); }
.hist-locked { color: var(--accent); font-weight: 600; }
.hist-del { position: absolute; right: 8px; bottom: 8px; margin: 0; }
.hist-del button {
  width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  color: #cbbfb8;
  font-size: 13px;
}
.hist-del button:hover { background: #fdeceb; color: var(--err); }

/* ---------- 结果页按钮组 ---------- */
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .btn { width: 100%; margin-top: 0; }

/* ---------- 付费墙 ---------- */
.locked-wrap { position: relative; margin-bottom: 16px; }
.locked {
  margin-bottom: 0;
  filter: blur(6px);
  opacity: 0.45;
  user-select: none;
  pointer-events: none;
}
.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px;
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    rgba(250, 247, 245, 0.35) 0%,
    rgba(250, 247, 245, 0.92) 40%,
    rgba(250, 247, 245, 0.99) 100%
  );
}
.lock-badge { font-size: 30px; margin-bottom: 6px; }
.lock-overlay h3 { margin: 0 0 8px; font-size: 17px; }
.lock-overlay p { margin: 0 0 18px; line-height: 1.6; }
.lock-overlay .btn { width: auto; margin-top: 0; padding: 13px 26px; }

/* ---------- 解锁页 ---------- */
.pay-price {
  font-size: 44px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 4px;
}
.pay-price .cur { font-size: 22px; font-weight: 700; margin-right: 2px; }
.pay-qr { text-align: center; margin: 18px 0 6px; }
.pay-qr img {
  width: 210px;
  max-width: 70%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.order-box {
  margin: 18px 0 12px;
  padding: 14px 16px;
  background: #fbf8f6;
  border: 1px dashed #d9cdc6;
  border-radius: 12px;
  text-align: center;
}
.order-no {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: none;
  color: var(--accent-dark);
  user-select: all;
}

/* ---------- 后台 ---------- */
hr.sep { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.qr-preview {
  width: 160px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  display: block;
}
.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.inline-form label { flex: 1; min-width: 90px; margin-bottom: 0; }
.inline-form .btn { flex: 0 0 auto; }
.btn.mini {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 9px;
  margin-top: 0;
  background: var(--accent);
  color: #fff;
}
.table-wrap { overflow-x: auto; margin-bottom: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td { padding: 9px 8px; border-bottom: 1px solid #f6f1ee; vertical-align: middle; }
.admin-table code { font-size: 12px; }
.code-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 12px;
}
.code-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.code-row code { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; user-select: all; }
.code-row.used { opacity: 0.45; }

/* ---------- 冲动缓冲器 ---------- */
.cooling { border-left: 4px solid #d9cdc6; }
.ready { border-left: 4px solid var(--accent); }
.cool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cool-timer { font-size: 13px; color: var(--muted); }
.cool-timer .timer {
  color: var(--accent);
  font-size: 16px;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.impulse-content {
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #fbf8f6;
  border-radius: 10px;
  word-break: break-word;
}
.cost-list {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
}
.cost-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  color: var(--accent-dark);
  margin-bottom: 6px;
  line-height: 1.55;
}
.cost-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.btn-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 120px; }
.btn.mini.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn.mini.ghost:hover { color: var(--accent); border-color: var(--accent); }

.counter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
  margin-bottom: 14px;
}
.counter-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.counter-num.small-num { font-size: 17px; padding-top: 8px; }
.counter-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.imp-list { display: flex; flex-direction: column; gap: 8px; }
.imp-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.imp-tag {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}
.imp-tag.ok { background: #eaf7f0; color: var(--ok); }
.imp-tag.no { background: #f2ece9; color: var(--muted); }
.imp-text { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.review-card { border-left: 4px solid var(--warn); }
.review-item { padding: 12px 0; border-bottom: 1px solid #f6f1ee; }
.review-item:last-child { border-bottom: none; padding-bottom: 0; }
.review-content {
  font-size: 15px;
  margin: 0 0 4px;
  color: var(--ink);
  word-break: break-word;
}

/* ---------- 壁纸 ---------- */
.wp-canvas {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(43, 35, 32, 0.12);
  margin-bottom: 18px;
}

/* ---------- 合规：同意勾选 ---------- */
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 12px;
  cursor: pointer;
}
.check-line input[type="checkbox"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.check-line a { color: var(--accent); }

/* ---------- 页脚 ---------- */
.foot-links { margin: 6px 0; }
.foot-links a { color: #b3a8a2; }
.foot-disclaimer {
  margin: 6px 0 0;
  font-size: 11px;
  color: #c4b9b3;
  line-height: 1.6;
}
.disclaimer {
  margin: 18px 0 14px;
  padding: 12px 14px;
  background: #fbf8f6;
  border-radius: 10px;
  line-height: 1.65;
}

/* ---------- 法律页面 ---------- */
.legal h1 { font-size: 22px; }
.legal .lead {
  font-size: 15px;
  color: var(--muted);
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: 12px;
  line-height: 1.7;
}
.legal h2 {
  font-size: 16px;
  margin: 26px 0 10px;
  padding-left: 11px;
  border-left: 4px solid var(--accent);
}
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; line-height: 1.7; }

/* ---------- 后台：合规卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
  margin-bottom: 16px;
}
@media (max-width: 520px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-num { font-size: 22px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.case-item {
  padding: 12px 0;
  border-bottom: 1px solid #f6f1ee;
}
.case-item:last-child { border-bottom: none; }
.case-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.case-preview {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
