/* 一日恋爱 · H5 预览 · 基础层（令牌 / 舞台 / 通用组件 / 图标 / 动效） */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }

:root {
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --ink: #191A1F;
  --ink-2: #5B6070;
  --ink-3: #989EAC;
  --line: #ECE9E4;
  --brand: #E5484D;
  --brand-deep: #C9353B;
  --brand-soft: #FFF1F0;
  --brand-soft-2: #FFE4E1;
  --coral: #FF7A59;
  --ok: #3FA37D;
  --ok-soft: #E9F6F0;
  --warn: #C98A2B;
  --warn-soft: #FBF3E4;
  --blue: #4C7FE0;
  --blue-soft: #EDF3FE;
  --grad-brand: linear-gradient(135deg, #E5484D 0%, #FF7A59 100%);
  --grad-ink: linear-gradient(150deg, #1E1B25 0%, #33283A 55%, #4A3040 100%);
  --grad-glow: radial-gradient(420px 300px at 85% -10%, rgba(229, 72, 77, 0.45), transparent 70%);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 24, 28, 0.05), 0 2px 8px rgba(23, 24, 28, 0.04);
  --shadow-md: 0 2px 6px rgba(23, 24, 28, 0.05), 0 14px 34px rgba(23, 24, 28, 0.08);
  --shadow-float: 0 10px 28px rgba(229, 72, 77, 0.28);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Helvetica Neue", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #101014;
  --surface: #1A1A20;
  --surface-2: #202028;
  --ink: #F3F3F6;
  --ink-2: #B6BAC7;
  --ink-3: #74798A;
  --line: #2A2A33;
  --brand: #FF6B6E;
  --brand-deep: #E5484D;
  --brand-soft: #2E1A1D;
  --brand-soft-2: #3A1F23;
  --coral: #FF9270;
  --ok-soft: #17271F;
  --warn-soft: #2A2214;
  --blue-soft: #1A2233;
  --grad-ink: linear-gradient(150deg, #17151C 0%, #241B29 60%, #2E1F2A 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4), 0 14px 34px rgba(0, 0, 0, 0.45);
  --shadow-float: 0 10px 28px rgba(0, 0, 0, 0.5);
}

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--ink);
  min-height: 100dvh;
  transition: background 0.25s ease;
}

/* 移动端网页容器：正常手机网页形态（无设备边框/状态栏） */
.phone {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.25s ease;
}

/* 演示控制（左下角，默认收起） */
.ctl {
  position: fixed;
  left: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.ctl-panel { display: none; flex-direction: column; gap: 8px; }
.ctl-panel.open { display: flex; }
.ctl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0.88;
  transition: all 0.16s ease;
}
.ctl-pill:hover { opacity: 1; border-color: var(--ink-3); }
.ctl-pill .ic { width: 13px; height: 13px; }
.ctl-toggle { font-weight: 600; color: var(--ink); }

.screen { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.screen[data-route="/chat"] { overflow: hidden; }
.bar-slot { flex: 0 0 auto; background: var(--bg); }

/* 页面容器与进场动效 */
.page { padding: 0 16px 40px; animation: pageIn 0.26s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 通用 */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-title { display: flex; align-items: center; font-size: 16.5px; font-weight: 700; letter-spacing: 0.2px; }
.section-title::before {
  content: ''; width: 3px; height: 15px; border-radius: 3px;
  background: var(--grad-brand); margin-right: 9px; flex-shrink: 0;
}
.section-title.plain::before { display: none; }
.section-sub { font-size: 11.5px; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.footnote { margin-top: 18px; font-size: 11.5px; color: var(--ink-3); line-height: 1.65; padding: 0 4px; }
.footnote-link { margin-top: 9px; font-size: 12px; color: var(--brand); font-weight: 600; padding: 0 4px; cursor: pointer; }
.hint { padding: 80px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }

.icon-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
}
.icon-chip .ic { width: 16px; height: 16px; }

/* 图标 */
.ic { display: inline-block; vertical-align: -2px; flex-shrink: 0; }
.ic svg { display: block; width: 100%; height: 100%; }
.ic path, .ic circle, .ic rect, .ic polyline, .ic line {
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ic.fill path, .ic.fill circle { fill: currentColor; stroke: none; }

/* 空状态 */
.empty { padding: 66px 20px 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.empty-art { margin-bottom: 18px; opacity: 0.9; }
.empty-art svg { display: block; }
.empty-title { font-size: 15px; font-weight: 600; }
.empty-desc { margin-top: 7px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.empty-btn { margin-top: 24px; width: 100%; }
.empty-link { margin-top: 14px; font-size: 13px; color: var(--brand); font-weight: 600; cursor: pointer; }

/* 按钮 */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 48px; border-radius: 999px;
  font-size: 15.5px; font-weight: 600; letter-spacing: 0.5px;
  border: none; cursor: pointer; transition: opacity 0.15s, transform 0.15s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
}
.btn .ic { width: 17px; height: 17px; }
.btn:active { transform: scale(0.985); opacity: 0.92; }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-float); }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid rgba(229, 72, 77, 0.35); }
.btn-plain { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.btn-disabled { opacity: 0.45; pointer-events: none; }
.btn-sm { height: 42px; font-size: 14px; }
.btn-sm .ic { width: 15px; height: 15px; }

/* 标签/角标 */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  font-size: 12.5px; margin: 0 8px 8px 0; cursor: pointer; user-select: none;
  transition: all 0.16s ease;
}
.chip:hover { border-color: var(--ink-3); }
.chip-on { background: var(--brand-soft); border-color: rgba(229, 72, 77, 0.45); color: var(--brand); font-weight: 600; }
.mini-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; margin: 0 6px 6px 0; }
.mini-tag-brand { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* 表单 */
.field { display: flex; align-items: center; min-height: 54px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: none; }
.field-label { display: flex; align-items: center; gap: 7px; width: 104px; color: var(--ink-2); font-size: 14px; flex-shrink: 0; }
.field-label .ic { width: 15px; height: 15px; color: var(--ink-3); }
.field-value { flex: 1; text-align: right; font-size: 14px; }
.field-value.empty-v { color: var(--ink-3); }
.field-arrow { width: 8px; height: 8px; margin-left: 6px; border-top: 2px solid var(--ink-3); border-right: 2px solid var(--ink-3); transform: rotate(45deg); flex-shrink: 0; }
.field input, .field select { flex: 1; text-align: right; font-size: 14px; color: var(--ink); border: none; outline: none; background: transparent; font-family: inherit; }
.pill-group { flex: 1; display: flex; justify-content: flex-end; }
.pill { padding: 5px 22px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; margin-left: 8px; cursor: pointer; user-select: none; transition: all 0.16s ease; }
.pill-on { background: var(--brand-soft); border-color: rgba(229, 72, 77, 0.45); color: var(--brand); font-weight: 600; }

.submit-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.submit-space { height: 90px; }

/* 导航栏 */
.navbar { display: flex; align-items: center; padding: calc(env(safe-area-inset-top) + 4px) 16px 4px; min-height: 52px; }
.nav-side { width: 84px; display: flex; align-items: center; }
.nav-side.right { justify-content: flex-end; }
.nav-title { flex: 1; text-align: center; font-size: 16px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav-back { width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; cursor: pointer; position: relative; }
.nav-back:hover { background: rgba(127, 127, 127, 0.12); }
.nav-back::before { content: ''; position: absolute; left: 13px; top: 11px; width: 11px; height: 11px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); border-radius: 2px; }

/* 头像 */
.avatar { width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 66px; height: 66px; font-size: 26px; }
.avatar-md { width: 42px; height: 42px; font-size: 16px; }
.avatar-me { background: var(--grad-brand) !important; }
.nav-avatar { cursor: pointer; }

/* toast */
.toast {
  position: absolute; left: 50%; bottom: 110px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 21, 26, 0.9);
  backdrop-filter: blur(8px);
  color: #fff; padding: 10px 18px; border-radius: 12px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: all 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 999; max-width: 300px; text-align: center; line-height: 1.5;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* modal */
.modal {
  position: absolute; inset: 0; background: rgba(12, 10, 16, 0.52);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.2s; padding: 28px;
}
.modal.show { opacity: 1; pointer-events: auto; }
.modal-card {
  width: 100%; max-width: 320px; background: var(--surface);
  border-radius: 20px; padding: 22px 20px 18px;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 78%; overflow-y: auto; box-shadow: var(--shadow-md);
}
.modal.show .modal-card { transform: none; }
.modal-title { font-size: 16px; font-weight: 700; text-align: center; }
.modal-content { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); line-height: 1.68; text-align: center; white-space: pre-wrap; }
.modal-content.left { text-align: left; }
.modal-input { margin-top: 14px; width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 13px; font-size: 14px; outline: none; font-family: inherit; background: var(--surface-2); color: var(--ink); transition: border-color 0.15s; }
.modal-input:focus { border-color: var(--brand); }
.modal-actions { display: flex; margin-top: 18px; gap: 10px; }
.modal-btn { flex: 1; height: 44px; border-radius: 999px; border: none; font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity 0.15s, transform 0.15s; }
.modal-btn:active { transform: scale(0.98); }
.modal-btn.cancel { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.modal-btn.ok { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-float); }
.modal-btn.ok.danger { background: linear-gradient(135deg, #D93A3F, #B3272C); box-shadow: none; }
.modal-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.modal-list button {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  height: 46px; padding: 0 16px; font-size: 14.5px; color: var(--ink); cursor: pointer; font-family: inherit;
  transition: all 0.15s ease; text-align: left;
}
.modal-list button .ic { width: 16px; height: 16px; color: var(--ink-3); }
.modal-list button:hover { background: var(--brand-soft); border-color: rgba(229, 72, 77, 0.35); color: var(--brand); }
.modal-list button:hover .ic { color: var(--brand); }
.modal.sheet { align-items: flex-end; padding: 0; }
.modal.sheet .modal-card { max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: 26px; }
.modal.sheet .modal-card::before {
  content: ''; display: block; width: 40px; height: 4px; border-radius: 4px;
  background: var(--line); margin: -8px auto 14px;
}

/* 骨架屏 */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-lg); }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.3s infinite;
}
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* 通用动效 */
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes pulseRing { 0% { transform: scale(0.9); opacity: 0.7; } 70% { transform: scale(1.35); opacity: 0; } 100% { opacity: 0; } }
@keyframes bounceDot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }

/* 爱心特效层（双方达成一致时播放） */
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 950; overflow: hidden; }
.fx-heart { position: absolute; bottom: 16%; opacity: 0; animation: heartUp var(--dur, 2.4s) cubic-bezier(0.22, 0.61, 0.36, 1) var(--delay, 0s) forwards; }
.fx-heart svg { width: 100%; height: 100%; display: block; }
.fx-heart svg path { fill: var(--hc, #E5484D); }
@keyframes heartUp {
  0% { transform: translateY(18px) scale(0.5) rotate(var(--rot, 0deg)); opacity: 0; }
  12% { opacity: 1; }
  72% { opacity: 1; }
  100% { transform: translateY(-56vh) scale(1.08) rotate(var(--rot, 0deg)); opacity: 0; }
}
.fx-text { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); opacity: 0; text-align: center; animation: fxPop 2.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.fx-title { font-size: 22px; font-weight: 800; color: var(--brand); letter-spacing: 1px; text-shadow: 0 6px 24px rgba(229, 72, 77, 0.28); }
.fx-sub { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
@keyframes fxPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  30% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}
