:root {
  --black: #111111;
  --gray-900: #1a1a1a;
  --gray-600: #555555;
  --gray-500: #888888;
  --gray-300: #d9d9d9;
  --gray-200: #e5e5e5;
  --gray-100: #f5f5f5;
  --white: #ffffff;
  --accent: #e11d48; /* 仅用于「喜欢」的心形 */
  --radius: 10px;
  --font-sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.7; }

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }

.container { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px; }

main.container { flex: 1; padding-top: 32px; padding-bottom: 48px; }

/* ===== 导航栏 ===== */
.site-header { border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; background: var(--white); z-index: 10; }

.navbar { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand { font-family: var(--font-serif); font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }

.nav-links { display: flex; align-items: center; gap: 20px; list-style: none; }

.nav-links a { font-size: 15px; color: var(--gray-600); }
.nav-links a:hover { color: var(--black); opacity: 1; }
.nav-links a.active { color: var(--black); font-weight: 600; }

.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-username { color: var(--gray-600); font-size: 14px; }

.nav-toggle { display: none; background: none; border: 1px solid var(--gray-200); border-radius: 6px; padding: 4px 10px; font-size: 18px; cursor: pointer; }

/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 9px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 600; border: 1px solid transparent; cursor: pointer; text-align: center; transition: all 0.15s ease; background: none; }
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--gray-900); opacity: 1; }
.btn-outline { border-color: var(--gray-300); color: var(--black); background: var(--white); }
.btn-outline:hover { border-color: var(--black); opacity: 1; }
.btn-danger { border-color: var(--gray-300); color: var(--accent); background: var(--white); }
.btn-danger:hover { border-color: var(--accent); opacity: 1; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; }

.link-btn { background: none; border: none; color: var(--gray-600); cursor: pointer; font-size: 14px; padding: 0; }
.link-btn:hover { color: var(--black); }

/* ===== flash 消息 ===== */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; border: 1px solid var(--gray-200); }
.flash-success { background: var(--gray-100); border-color: var(--gray-300); }
.flash-error { background: #fdf2f4; border-color: #f5c6cf; color: var(--accent); }

/* ===== 表单 ===== */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gray-600); }
.form input, .form select, .form textarea {
  padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: 8px;
  font-size: 15px; font-family: inherit; color: var(--black); background: var(--white); width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--black); }
.form textarea { resize: vertical; }

.error-list { list-style: none; background: #fdf2f4; border: 1px solid #f5c6cf; color: var(--accent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 14px; }

/* ===== 落地页 ===== */
.hero { text-align: center; padding: 72px 0 56px; }
.hero h1 { font-size: 48px; line-height: 1.15; }
.hero .accent { color: var(--accent); }
.hero-sub { color: var(--gray-500); font-size: 18px; margin: 20px 0 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; }

.how { padding: 48px 0; border-top: 1px solid var(--gray-200); }
.how h2 { text-align: center; margin-bottom: 36px; font-size: 28px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.how-item { text-align: center; }
.how-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--black); border-radius: 50%; font-family: var(--font-serif); margin-bottom: 12px; }
.how-item h3 { font-size: 18px; margin-bottom: 6px; }
.how-item p { color: var(--gray-500); font-size: 14px; }

/* ===== 认证页 ===== */
.auth-wrap { max-width: 400px; margin: 40px auto; }
.auth-wrap h1 { text-align: center; margin-bottom: 24px; }
.auth-alt { text-align: center; margin-top: 20px; color: var(--gray-500); font-size: 14px; }
.auth-alt a { color: var(--black); font-weight: 600; }

/* ===== 浏览页 ===== */
.browse-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.browse-toolbar h1 { font-size: 28px; }
.filter-bar { display: flex; gap: 8px; align-items: center; }
.filter-bar select { padding: 6px 10px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 14px; font-family: inherit; }

.card-stack { max-width: 420px; margin: 0 auto; }
.profile-card { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.card-photo { aspect-ratio: 3 / 4; background: var(--gray-100); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .avatar-fallback { border-radius: 0; width: 100%; height: 100%; font-size: 64px; }
.card-body { padding: 20px; }
.card-body h2 { font-size: 22px; }
.card-body .age { color: var(--gray-500); font-weight: 400; }
.card-loc { color: var(--gray-500); font-size: 14px; margin: 4px 0 10px; }
.card-bio { color: var(--gray-600); font-size: 15px; }

.swipe-actions { display: flex; justify-content: center; gap: 40px; margin-top: 24px; }
.swipe-btn { width: 64px; height: 64px; border-radius: 50%; font-size: 26px; cursor: pointer; border: 1px solid var(--gray-300); background: var(--white); transition: all 0.15s ease; }
.swipe-pass:hover { border-color: var(--black); background: var(--black); color: var(--white); }
.swipe-like { border-color: var(--accent); color: var(--accent); }
.swipe-like:hover { background: var(--accent); color: var(--white); }
.swipe-hint { text-align: center; color: var(--gray-500); font-size: 13px; margin-top: 16px; }

/* ===== 发现网格（一页 6 人）===== */
.browse-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mini-card { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.mini-photo { display: block; aspect-ratio: 1; background: var(--gray-100); overflow: hidden; }
.mini-photo img { width: 100%; height: 100%; object-fit: cover; }
.mini-photo .avatar { width: 100%; height: 100%; border-radius: 0; font-size: 48px; }
.mini-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.mini-body h3 { font-size: 15px; }
.mini-loc { color: var(--gray-500); font-size: 12px; margin: 2px 0 8px; }
.mini-actions { display: flex; gap: 8px; margin-top: auto; }
.mini-btn { flex: 1; height: 32px; border-radius: 8px; font-size: 15px; cursor: pointer; border: 1px solid var(--gray-300); background: var(--white); transition: all 0.15s ease; }
.mini-pass:hover { border-color: var(--black); background: var(--black); color: var(--white); }
.mini-like { border-color: var(--accent); color: var(--accent); }
.mini-like:hover { background: var(--accent); color: var(--white); }

@media (max-width: 640px) {
  .browse-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ===== 头像 ===== */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 128px; height: 128px; }
.avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--gray-600); font-weight: 600; font-family: var(--font-serif); }

/* ===== 标签 ===== */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { font-size: 13px; color: var(--gray-600); border: 1px solid var(--gray-200); border-radius: 999px; padding: 3px 12px; }

/* ===== 列表 ===== */
.match-list, .conv-list { list-style: none; display: flex; flex-direction: column; }
.match-item, .conv-item { border-bottom: 1px solid var(--gray-200); }
.match-item a, .conv-item a { display: flex; align-items: center; gap: 16px; padding: 16px 4px; }
.match-info, .conv-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.match-loc, .conv-last { color: var(--gray-500); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 80px 20px; color: var(--gray-500); }
.empty-sub { margin-top: 8px; font-size: 14px; }
.empty a { color: var(--black); font-weight: 600; }

/* ===== 聊天 ===== */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 160px); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--gray-200); }
.chat-back { color: var(--gray-500); font-size: 14px; margin-right: 4px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--gray-100); }
.msg { max-width: 70%; display: flex; flex-direction: column; }
.msg-self { align-self: flex-end; align-items: flex-end; }
.msg-other { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 10px 14px; border-radius: 14px; font-size: 15px; word-break: break-word; }
.msg-self .bubble { background: var(--black); color: var(--white); border-bottom-right-radius: 4px; }
.msg-other .bubble { background: var(--white); border: 1px solid var(--gray-200); border-bottom-left-radius: 4px; }
.msg-time { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.chat-input { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--gray-200); }
.chat-input input { flex: 1; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 15px; font-family: inherit; }
.chat-input input:focus { outline: none; border-color: var(--black); }

/* ===== 资料页 ===== */
.profile-head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.profile-meta h1 { font-size: 30px; }
.profile-meta .muted { color: var(--gray-500); margin: 6px 0; }
.profile-meta .btn { margin-top: 16px; }
.profile-bio { border-top: 1px solid var(--gray-200); padding-top: 24px; margin-bottom: 24px; }
.profile-bio h2 { font-size: 20px; margin-bottom: 8px; }
.profile-bio p { color: var(--gray-600); }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.photo-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--gray-200); }
.photo-item { position: relative; }
.photo-item form { position: absolute; top: 8px; right: 8px; }

/* ===== 编辑资料 ===== */
.edit-section { border-top: 1px solid var(--gray-200); padding: 28px 0; }
.edit-section h2 { font-size: 20px; margin-bottom: 16px; }
.avatar-upload { display: flex; align-items: center; gap: 20px; }
.avatar-upload form { display: flex; flex-direction: column; gap: 10px; }
.photo-upload { display: flex; gap: 10px; align-items: center; margin-top: 16px; }

/* ===== 表格 / 统计 ===== */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gray-200); }
.table th { color: var(--gray-500); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-family: var(--font-serif); font-size: 32px; font-weight: 700; }
.stat-label { color: var(--gray-500); font-size: 14px; }

/* ===== 错误页 ===== */
.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 72px; color: var(--gray-300); }
.error-page p { color: var(--gray-500); margin: 12px 0 24px; }

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--gray-200); padding: 24px 0; }
.site-footer p { color: var(--gray-500); font-size: 13px; text-align: center; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .nav-toggle { display: inline-block; }
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--gray-200); flex-direction: column; align-items: stretch; padding: 12px 20px; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 8px 0; }
  .nav-user { flex-direction: row; justify-content: space-between; }

  .hero h1 { font-size: 36px; }
  .hero-actions { flex-direction: column; }
  .how-grid { grid-template-columns: 1fr; gap: 32px; }

  .profile-head { flex-direction: column; align-items: center; text-align: center; }
  .profile-head .tags { justify-content: center; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }

  .msg { max-width: 85%; }
}
