/* ============ 雾散 FOGLESS · dating 主壳 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --ink: #22303e;
  --muted: #7b8a99;
  --fog: #eef2f6;
  --line: #dde5ec;
  --accent: #4a6f8f;
  --accent-deep: #35556f;
  --bg: #f6f8fa;
  --card: #ffffff;
  --serif: "Noto Serif SC","Songti SC","SimSun",serif;
  --sans: "PingFang SC","Microsoft YaHei",sans-serif;
}
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, #f2f5f8 0%, #e9eef3 55%, #e4ebf1 100%);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: #b3563f; font-size: 13px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 10px 0 4px; }

/* 雾气背景 */
.mist { position: fixed; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; z-index: 0; }
.mist-1 { width: 55vw; height: 55vw; background: #cfdde9; top: -18vw; right: -15vw; animation: drift 26s ease-in-out infinite alternate; }
.mist-2 { width: 48vw; height: 48vw; background: #dbe4ec; bottom: -16vw; left: -14vw; animation: drift 32s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0,0); } to { transform: translate(-5vw, 4vw); } }

.view { position: relative; z-index: 1; min-height: 100dvh; }

/* ============ 入场 ============ */
.enter-wrap { max-width: 560px; margin: 0 auto; padding: 48px 20px 60px; }
.hero { text-align: center; margin-bottom: 28px; }
.eyebrow { letter-spacing: .5em; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.hero h1 { font-family: var(--serif); font-size: 30px; line-height: 1.45; font-weight: 600; }
.hero p { margin-top: 14px; color: var(--muted); font-size: 14px; line-height: 1.9; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 20px; box-shadow: 0 8px 30px rgba(60, 90, 120, .08);
}
.card-title { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.field { margin-bottom: 14px; flex: 1; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd;
  padding: 10px 12px; font-size: 14.5px; font-family: var(--sans); color: var(--ink); resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field-row { display: flex; gap: 12px; }
.field-row .field { min-width: 0; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fbfcfd; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 0; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }

.l2-head {
  margin: 20px 0 12px; padding: 8px 12px; border-radius: 10px;
  background: linear-gradient(90deg, #e8eef4, #f2f6f9); color: var(--accent-deep);
  font-size: 13px; font-weight: 600; letter-spacing: .05em;
}

.primary-btn {
  width: 100%; border: 0; border-radius: 12px; padding: 13px 0; margin-top: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-size: 15.5px; font-weight: 600; letter-spacing: .1em; cursor: pointer;
  transition: opacity .2s;
}
.primary-btn:active { opacity: .8; }
.primary-btn.small { width: auto; padding: 8px 18px; margin: 0; font-size: 14px; }
.ghost-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.75); color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font-size: 13.5px; cursor: pointer; text-decoration: none; display: inline-block;
}
.ghost-btn.small { padding: 5px 12px; font-size: 12.5px; }

/* ============ 主界面 ============ */
#view-app { max-width: 560px; margin: 0 auto; padding: 24px 18px calc(74px + env(safe-area-inset-bottom)); }
.tab-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tab-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; }

/* 发现卡片 */
.person-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 26px 22px; box-shadow: 0 10px 34px rgba(60, 90, 120, .1);
  animation: rise .4s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pc-head { display: flex; align-items: baseline; gap: 10px; }
.pc-name { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.pc-meta { color: var(--muted); font-size: 13.5px; }
.pc-bio { margin-top: 10px; font-size: 15px; line-height: 1.8; color: var(--ink); }
.pc-ai { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.kw {
  background: linear-gradient(135deg, #eaf0f5, #f5f8fa); border: 1px solid var(--line);
  color: var(--accent-deep); border-radius: 999px; padding: 5px 14px; font-size: 13px;
  animation: kwIn .5s ease backwards;
}
.kw:nth-child(2) { animation-delay: .12s; }
.kw:nth-child(3) { animation-delay: .24s; }
@keyframes kwIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pc-actions { display: flex; gap: 10px; margin-top: 20px; }
.pc-actions .primary-btn { flex: 1; margin: 0; }
.pc-actions .ghost-btn { flex: 1; text-align: center; padding: 12px 0; font-size: 14.5px; border-radius: 12px; }

.empty {
  text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; line-height: 2;
}

/* L2 答案 */
.l2-block { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.l2-q { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.l2-a { font-size: 14.5px; line-height: 1.85; margin-bottom: 12px; }
.locked {
  margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 16px; text-align: center;
  color: var(--muted); font-size: 13px; line-height: 2;
}

/* 消息列表 */
.chat-item {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
}
.chat-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #cdd9e4, #e7edf2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 19px; color: var(--accent-deep);
}
.chat-item-main { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 600; font-size: 15px; }
.chat-item-last { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { color: var(--muted); font-size: 11.5px; flex: none; }

/* 聊天 */
.chat-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 4px 0;
}
.chat-head b { font-size: 16px; }
.chat-head .muted { margin-left: 8px; font-size: 12.5px; }
#chat-msgs { height: calc(100dvh - 220px); overflow-y: auto; padding: 6px 0 12px; }
.msg-row { display: flex; margin-bottom: 10px; }
.msg-row.me { justify-content: flex-end; }
.bubble {
  max-width: 76%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.7;
  background: var(--card); border: 1px solid var(--line);
}
.msg-row.me .bubble { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; border: 0; }
.chat-input-row { display: flex; gap: 10px; padding: 10px 0; }
.chat-input-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; font-size: 14.5px; background: #fff;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }

/* 我的 */
.me-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 14px; }
.me-card h3 { font-family: var(--serif); font-size: 17px; margin-bottom: 10px; }
.me-name { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.me-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.me-links { display: flex; flex-direction: column; gap: 10px; }
.me-link {
  display: flex; justify-content: space-between; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; font-size: 14.5px;
  cursor: pointer; text-decoration: none; color: var(--ink);
}
.me-link span.arrow { color: var(--muted); }

/* 底部导航 */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; display: flex; z-index: 20;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.nav-btn {
  flex: 1; border: 0; background: transparent; font-size: 14px; color: var(--muted);
  padding: 8px 0; cursor: pointer; position: relative; letter-spacing: .15em;
}
.nav-btn.on { color: var(--accent-deep); font-weight: 600; }
.dot {
  position: absolute; top: 4px; right: calc(50% - 22px); width: 8px; height: 8px;
  background: #d46a5b; border-radius: 50%;
}

/* ============ 雾层仪式弹层 ============ */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(240, 244, 247, .96);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-box { max-width: 420px; width: 100%; text-align: center; }
.unlock-anim { display: flex; justify-content: center; gap: 12px; margin-bottom: 26px; }
.ul { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); opacity: .35; animation: pulse 1.2s ease-in-out infinite; }
.ul.u2 { animation-delay: .2s; }
.ul.u3 { animation-delay: .4s; }
@keyframes pulse { 0%,100% { opacity: .25; transform: scale(.9); } 50% { opacity: .9; transform: scale(1.15); } }
.unlock-text { font-family: var(--serif); font-size: 19px; line-height: 1.9; margin-bottom: 22px; }
.unlock-body { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; }

/* toast */
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: rgba(34, 48, 62, .92); color: #fff; font-size: 13.5px;
  border-radius: 999px; padding: 10px 20px; white-space: nowrap;
}
