/* ========== 全局变量 & 重置 ========== */
:root {
  --bg: #FFF8F3;
  --bg-soft: #FFF5EE;
  --rose: #FF6B9D;
  --rose-deep: #FF4081;
  --orange: #FF8E53;
  --lavender: #A78BFA;
  --mint: #34D399;
  --text: #2D2B3D;
  --text-soft: #9B98AD;
  --card: #FFFFFF;
  --border: #F0E8E0;
  --shadow: 0 8px 30px rgba(255, 107, 157, 0.12);
  --shadow-soft: 0 4px 16px rgba(45, 43, 61, 0.06);
  --radius-card: 20px;
  --radius-btn: 16px;
  --radius-modal: 24px;
  --gradient-rose: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
  --gradient-lavender: linear-gradient(135deg, #A78BFA 0%, #60A5FA 100%);
  --gradient-mint: linear-gradient(135deg, #34D399 0%, #6EE7B7 100%);
  --shadow-gold: 0 8px 24px rgba(255, 180, 80, 0.35);
}

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

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

button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; border: none; outline: none; background: #F7F3EF; color: var(--text); }
textarea { resize: none; }
.hidden { display: none !important; }

/* ========== PC端背景 ========== */
.pc-bg {
  display: none;
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,107,157,0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(167,139,250,0.12) 0%, transparent 40%),
    linear-gradient(180deg, #FFF5EE 0%, #FDE8F0 100%);
  z-index: 0;
}

/* ========== App 容器 ========== */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(45,43,61,0.08);
}

@media (min-width: 768px) {
  .pc-bg { display: block; }
  .app {
    margin: 24px auto;
    border-radius: 32px;
    overflow: hidden;
    min-height: calc(100vh - 48px);
    box-shadow: 0 20px 80px rgba(255,107,157,0.18);
  }
}

/* ========== PC端顶部导航 ========== */
.topbar { display: none; }
@media (min-width: 768px) {
  .topbar {
    display: none; /* 保持手机视图一致性，底部Tab已有导航 */
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
  }
  .topbar-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 14px 32px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
  .logo-emoji { font-size: 24px; }
  .topnav { display: flex; gap: 28px; }
  .topnav a {
    text-decoration: none; color: var(--text-soft); font-size: 14px; font-weight: 500;
    transition: color .2s;
  }
  .topnav a:hover, .topnav a.active { color: var(--rose); }
  .btn-login-pc {
    padding: 8px 20px; border-radius: 20px;
    background: var(--gradient-rose); color: #fff; font-weight: 600; font-size: 13px;
  }
}

/* ========== 页面切换 ========== */
.pages {
  padding-bottom: 90px; /* 给底部tab留空间 */
  min-height: 100vh;
}

.page { display: none; padding: 20px 16px 20px; animation: fadeIn .3s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head { margin-bottom: 16px; }
.page-head h2 { font-size: 22px; font-weight: 700; }
.page-sub { color: var(--text-soft); font-size: 13px; margin-top: 4px; }

/* ========== 通用按钮 ========== */
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-btn);
  background: var(--gradient-rose);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(255,107,157,0.35);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  border: 1px solid var(--border);
  margin-top: 10px;
}

.btn-gold {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, #FFD66B 0%, #FFB347 100%);
  color: #5C3A0E;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-gold);
  transition: transform .15s;
}
.btn-gold:active { transform: scale(0.97); }

/* ========== 底部 Tab 导航 ========== */
.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
@media (min-width: 768px) {
  .tabbar { border-radius: 0 0 32px 32px; }
}

.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0;
  color: var(--text-soft);
  cursor: pointer;
  transition: color .2s;
}
.tab-icon { font-size: 22px; filter: grayscale(0.6); transition: transform .2s; }
.tab-label { font-size: 11px; font-weight: 500; }
.tab.active { color: var(--rose); }
.tab.active .tab-icon { filter: grayscale(0); transform: translateY(-2px) scale(1.08); }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(45,43,61,0.45);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  animation: maskFade .25s ease;
}
@media (min-width: 768px) {
  .modal-mask { align-items: center; }
}
@keyframes maskFade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%; max-width: 440px;
  background: #fff;
  border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  animation: slideUp .3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}
@media (min-width: 768px) {
  .modal {
    border-radius: var(--radius-modal);
    padding: 32px;
    animation: zoomIn .25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #F5F0EC; color: var(--text-soft);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

.modal-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.modal-sub { font-size: 13px; color: var(--text-soft); text-align: center; margin-bottom: 16px; }

/* 输入框 */
.auth-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  background: #F7F3EF;
  font-size: 15px;
  margin-bottom: 10px;
  transition: box-shadow .2s;
}
.auth-input:focus { box-shadow: 0 0 0 2px rgba(255,107,157,0.3); background: #fff; }

/* 登录注册 tab */
.auth-tabs {
  display: flex; justify-content: center; gap: 8px; margin-bottom: 18px;
  background: #F7F3EF; border-radius: 12px; padding: 4px;
}
.auth-tab {
  flex: 1; padding: 8px; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: var(--text-soft); transition: all .2s;
}
.auth-tab.active { background: #fff; color: var(--rose); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.auth-third { margin-top: 18px; }
.at-divider {
  text-align: center; position: relative; color: var(--text-soft); font-size: 12px; margin: 14px 0;
}
.at-divider::before, .at-divider::after {
  content: ''; position: absolute; top: 50%; width: 30%; height: 1px; background: var(--border);
}
.at-divider::before { left: 0; }
.at-divider::after { right: 0; }
.at-btns { display: flex; gap: 10px; justify-content: center; }
.at-btn {
  padding: 10px 20px; border-radius: 20px; background: #F7F3EF; font-size: 13px;
}

/* Toast */
.toast-modal {
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  width: auto;
  min-width: 200px;
}
.toast-icon { font-size: 40px; margin-bottom: 8px; }
.toast-text { font-size: 15px; font-weight: 500; }

/* ========== Loading ========== */
.global-loading {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(255,255,255,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.heart-loader {
  font-size: 40px;
  animation: heartbeat 1s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* ========== 通用卡片 ========== */
.discover-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: var(--radius-card);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.discover-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.discover-card:active { transform: scale(0.98); }
.dc-emoji { font-size: 32px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: #FFF0F5; border-radius: 14px; flex-shrink: 0; }
.dc-body { flex: 1; min-width: 0; }
.dc-title { font-weight: 600; font-size: 15px; }
.dc-desc { color: var(--text-soft); font-size: 12px; margin-top: 2px; }
.dc-arrow { color: var(--text-soft); font-size: 22px; }
.dc-hot {
  position: absolute; top: -6px; right: 12px;
  background: linear-gradient(135deg, #FF4081, #FF8E53);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 10px;
}

.love-tip-box {
  margin-top: 20px;
  background: linear-gradient(135deg, #FFF5EE, #FFE8F0);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex; gap: 12px; align-items: flex-start;
}
.tip-emoji { font-size: 24px; }
.tip-text { font-size: 14px; color: var(--text); line-height: 1.7; font-style: italic; }
