:root {
  --bg: #0e1020;
  --bg-soft: #171a30;
  --card: #1d2138;
  --card-border: #2a2f4d;
  --text: #eceaf4;
  --text-dim: #9a97b3;
  --accent: #f0c06b;
  --accent-soft: #2a2436;
  --danger: #e0647a;
  --ok: #6bdc9a;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

body { min-height: 100vh; }

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 90px;
}

.hidden { display: none !important; }

/* 顶部 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 16px;
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.brand .dot { color: var(--accent); }
.link-btn {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 13px; padding: 6px 8px; cursor: pointer;
}

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
}

/* 按钮 */
.btn {
  display: block; width: 100%;
  background: linear-gradient(135deg, #f5c87a, #e8a84f);
  color: #241a08;
  border: none; border-radius: 12px;
  padding: 13px; font-size: 16px; font-weight: 700;
  cursor: pointer; text-align: center; text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); font-weight: 500;
}
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }

/* 表单 */
input[type="text"], input[type="tel"] {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
input:focus { border-color: var(--accent); }

/* 提示 */
.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: rgba(30, 34, 58, .95); border: 1px solid var(--card-border);
  color: var(--text); padding: 10px 18px; border-radius: 24px;
  font-size: 14px; z-index: 999; max-width: 86vw; text-align: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 登录弹层 */
.sheet {
  position: fixed; inset: 0; background: rgba(6, 7, 15, .78);
  display: flex; align-items: flex-end; z-index: 500;
}
.sheet-body {
  width: 100%; max-width: 520px; margin: 0 auto;
  background: var(--bg-soft);
  border-radius: 20px 20px 0 0;
  padding: 22px 20px 30px;
}
.sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.form-row { margin-bottom: 12px; }
.form-row.flex { display: flex; gap: 10px; }
.form-row.flex input { flex: 1; }
.code-btn {
  flex-shrink: 0; width: 118px;
  background: var(--card); border: 1px solid var(--card-border);
  color: var(--accent); border-radius: 12px; font-size: 14px; cursor: pointer;
}
.code-btn:disabled { color: var(--text-dim); }
.form-tip { font-size: 12px; color: var(--text-dim); margin-top: 10px; text-align: center; }

/* 首页 */
.hero { text-align: center; padding: 34px 0 26px; }
.hero h1 { font-size: 26px; letter-spacing: 2px; margin-bottom: 10px; }
.hero p { color: var(--text-dim); font-size: 14px; }
.product-card {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 24px 20px; margin-bottom: 16px;
  border: 1px solid var(--card-border); cursor: pointer;
}
.product-card.photo { background: linear-gradient(135deg, #2a2230, #1a2033); }
.product-card.companion { background: linear-gradient(135deg, #1d2a3d, #1a2033); }
.product-card h2 { font-size: 20px; margin-bottom: 6px; }
.product-card .desc { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.product-card .price-line {
  font-size: 14px; margin-bottom: 10px; color: var(--text);
}
.product-card .price-line b { color: var(--accent); }
.product-card .tag {
  display: inline-block; background: rgba(240, 192, 107, .14);
  color: var(--accent); border-radius: 20px;
  font-size: 12px; padding: 3px 12px;
}
.arrow {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 22px;
}

/* 照片页 */
.upload-zone {
  border: 2px dashed var(--card-border); border-radius: 16px;
  padding: 34px 16px; text-align: center; cursor: pointer;
  color: var(--text-dim);
}
.upload-zone .icon { font-size: 40px; margin-bottom: 8px; }
.upload-zone.active { border-color: var(--accent); }
.preview-wrap { position: relative; }
.preview-wrap img { width: 100%; border-radius: 14px; display: block; }
.watermark {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; overflow: hidden; border-radius: 14px;
}
.watermark span {
  color: rgba(255, 255, 255, .65); font-size: 18px; font-weight: 700;
  letter-spacing: 6px; transform: rotate(-24deg);
  text-shadow: 0 0 6px rgba(0, 0, 0, .6);
}
.mode-list { display: flex; gap: 10px; flex-wrap: wrap; }
.mode-item {
  flex: 1; min-width: 90px; text-align: center;
  background: var(--bg-soft); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 10px 6px; cursor: pointer; font-size: 13px;
}
.mode-item.selected { border-color: var(--accent); color: var(--accent); }
.price-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 2px 10px;
}
.price { color: var(--accent); font-size: 24px; font-weight: 800; }
.price small { font-size: 13px; font-weight: 500; }
.section-title { font-size: 14px; color: var(--text-dim); margin: 14px 0 10px; }

/* 陪伴页 */
.role-list { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.role-card {
  flex-shrink: 0; width: 128px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 14px; padding: 14px 12px; text-align: center; cursor: pointer;
}
.role-card.selected { border-color: var(--accent); }
.role-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  margin: 0 auto 8px; display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.role-card .name { font-weight: 700; font-size: 15px; }
.role-card .tagline { font-size: 12px; color: var(--text-dim); }
.quota-bar {
  background: var(--bg-soft); border-radius: 10px;
  padding: 8px 12px; font-size: 12px; color: var(--text-dim);
  display: flex; justify-content: space-between; margin-bottom: 12px;
}
.quota-bar b { color: var(--accent); }
.chat-box {
  background: var(--bg-soft); border-radius: 16px;
  height: 52vh; overflow-y: auto; padding: 14px;
}
.msg { margin-bottom: 12px; display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble {
  max-width: 76%; padding: 10px 14px; border-radius: 16px;
  font-size: 14px; white-space: pre-wrap; word-break: break-word;
}
.msg.user .bubble { background: linear-gradient(135deg, #f5c87a, #e8a84f); color: #241a08; border-bottom-right-radius: 4px; }
.msg.assistant .bubble { background: var(--card); border: 1px solid var(--card-border); border-bottom-left-radius: 4px; }
.msg.typing .bubble { color: var(--text-dim); }
.chat-input-row {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 520px;
  display: flex; gap: 10px; padding: 12px 14px 16px;
  background: linear-gradient(transparent, var(--bg) 30%);
}
.chat-input-row input { flex: 1; }
.send-btn {
  width: 76px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #f5c87a, #e8a84f);
  color: #241a08; font-weight: 700; font-size: 15px; cursor: pointer;
}
.send-btn:disabled { opacity: .5; }
.plan-row { display: flex; gap: 10px; }
.plan-card {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--card-border);
  border-radius: 14px; padding: 14px; text-align: center; cursor: pointer;
}
.plan-card.selected { border-color: var(--accent); }
.plan-card .plan-name { font-weight: 700; }
.plan-card .plan-price { color: var(--accent); font-size: 20px; font-weight: 800; margin: 4px 0; }
.plan-card .plan-note { font-size: 12px; color: var(--text-dim); }
