:root {
  --rose: #ff5c8a;
  --rose-deep: #e8437a;
  --rose-soft: #ffe3ec;
  --ink: #2b2230;
  --muted: #8a7f8c;
  --line: #f0e4ea;
  --bg: #fff7fa;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(232, 67, 122, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; text-decoration: none; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-size: 19px; font-weight: 700; letter-spacing: 0.5px; }
.brand-dot { color: var(--rose); margin: 0 2px; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a, .nav button {
  border: 0; cursor: pointer; font-size: 14px; color: var(--ink);
  padding: 8px 14px; border-radius: 999px; background: transparent;
}
.nav a:hover, .nav button:hover { background: var(--rose-soft); }
.nav .active { background: var(--rose); color: #fff; }
.nav .me-chip { color: var(--muted); font-size: 13px; padding: 0 6px; }

/* ---------- 通用 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; cursor: pointer; border-radius: 999px;
  padding: 11px 22px; font-size: 15px; font-weight: 600;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: #fff; transition: transform 0.08s ease, opacity 0.2s;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: #fff; color: var(--rose-deep); border: 1px solid var(--rose-soft); }
.btn.gray { background: #f2edf0; color: var(--ink); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.danger { background: #fff; color: #d33; border: 1px solid #ffd9de; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field label .req { color: var(--rose-deep); margin-left: 2px; }
.field input[type="text"], .field input[type="number"], .field input[type="password"],
.field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font-size: 15px; font-family: inherit; background: #fff;
  outline: none; transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--rose); }
.field textarea { min-height: 110px; resize: vertical; }
.field .err { color: #d33; font-size: 12px; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px;
}
.loading, .empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- 首页 ---------- */
.hero {
  text-align: center; padding: 44px 20px 26px;
}
.hero h1 { font-size: 30px; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 22px;
}
.filter-bar select, .filter-bar input[type="text"] {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
.filter-bar .spacer { flex: 1; }
.filter-bar .count { color: var(--muted); font-size: 13px; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 18px;
  padding-bottom: 40px;
}
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(232, 67, 122, 0.18); }
.card-photo {
  aspect-ratio: 3 / 4; background-size: cover; background-position: center;
  background-color: var(--rose-soft);
}
.card-body { padding: 12px 14px 14px; }
.card-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.badge.f { background: #ffe9f1; color: var(--rose-deep); }
.badge.m { background: #e8f0ff; color: #3b6fd4; }
.card-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card-bio {
  color: var(--muted); font-size: 13px; margin-top: 8px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.card-foot .likes { color: var(--rose-deep); }

/* ---------- 详情弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(30, 12, 20, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 16px; overflow-y: auto; z-index: 100;
}
.modal {
  background: #fff; border-radius: 20px; width: 100%; max-width: 860px;
  overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-close {
  border: 0; background: #f6eef2; color: var(--ink); width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1;
}
.modal-body { display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 760px) { .modal-body { grid-template-columns: 1fr; } }
.carousel { background: #241a20; position: relative; min-height: 320px; }
.carousel-img { width: 100%; height: 100%; object-fit: contain; display: block; min-height: 380px; background: #241a20; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); cursor: pointer; font-size: 18px;
}
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-count {
  position: absolute; bottom: 10px; right: 12px; color: #fff;
  background: rgba(0, 0, 0, 0.45); border-radius: 999px; font-size: 12px; padding: 3px 10px;
}
.thumbs { display: flex; gap: 8px; padding: 10px; flex-wrap: wrap; }
.thumb {
  width: 62px; height: 62px; border-radius: 10px; background-size: cover; background-position: center;
  cursor: pointer; border: 2px solid transparent; background-color: #3a2c34;
}
.thumb.active { border-color: var(--rose); }
.detail-info { padding: 20px; overflow-y: auto; max-height: 640px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { background: var(--rose-soft); color: var(--rose-deep); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.info-list { display: grid; grid-template-columns: 90px 1fr; row-gap: 8px; font-size: 14px; margin: 14px 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; }
.bio-text { font-size: 14px; line-height: 1.7; color: #4a3f47; background: #fdf4f7; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; }
.contact-line { font-size: 14px; margin-top: 10px; color: var(--muted); }
.contact-line b { color: var(--ink); }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; }
.msg-section { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.msg-section h3 { font-size: 15px; margin: 0 0 10px; }
.msg-list { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.msg { background: #faf5f7; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.msg .who { color: var(--rose-deep); font-weight: 600; margin-right: 6px; }
.msg .time { color: #b6aab3; font-size: 11px; margin-left: 6px; }
.msg-form { display: flex; gap: 8px; }
.msg-form input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; font-size: 14px; outline: none; font-family: inherit; }

/* ---------- 发布/我的/登录 ---------- */
.page { max-width: 640px; margin: 30px auto 50px; }
.page h1 { font-size: 24px; margin: 0 0 18px; }
.photo-picker { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.photo-slot {
  width: 96px; height: 96px; border-radius: 12px; position: relative; overflow: hidden;
  background: var(--rose-soft); display: flex; align-items: center; justify-content: center;
  color: var(--rose-deep); font-size: 13px; cursor: pointer; border: 1px dashed #f3bcd0;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot .del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer; font-size: 12px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button {
  flex: 1; border: 0; background: #f4edf1; color: var(--muted); padding: 11px;
  border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 600; font-family: inherit;
}
.tabs button.active { background: var(--rose); color: #fff; }
.my-card { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: start; }
@media (max-width: 560px) { .my-card { grid-template-columns: 1fr; } }
.my-photo { width: 100%; aspect-ratio: 3/4; border-radius: 12px; background-size: cover; background-position: center; background-color: var(--rose-soft); }
.my-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #2b2230; color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.18s ease;
}
.toast.err { background: #c0392b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.foot { text-align: center; color: #c4b6bf; font-size: 13px; padding: 26px 0 34px; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 640px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 6px 0; gap: 4px; }
  .brand { font-size: 15px; white-space: nowrap; }
  .nav { flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
  .nav a, .nav button { padding: 5px 8px; font-size: 12px; }
  .nav .me-chip { display: none; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .filter-bar { gap: 8px; }
  .filter-bar input[type="number"] { width: 86px; }
  .page { margin-top: 18px; }
  .panel { padding: 18px; }
}
