/* Logus 风格主题：奶油底 + 白卡 + 柠檬黄 / 薄荷青 / 樱花粉，黑色粗描边卡通 */
@font-face {
  font-family: 'Happy';
  src: url('/fonts/happy.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #FFF6E3;
  --surface: #FFFFFF;
  --surface-soft: #FFFDF8;
  --surface-2: #FBF1DC;
  --text: #3B3226;
  --muted: #B2A488;
  --border: #F3E8D2;
  --border-strong: #E5D5B4;
  --accent: #FFD43D;
  --accent-deep: #EBBC2B;
  --accent-soft: #FFF0B8;
  --on-accent: #3B3226;
  --pink: #FF8FAB;
  --pink-soft: #FFE8EF;
  --blue: #4A9FE6;
  --blue-soft: #E9F4FD;
  --teal: #4EC3B0;
  --teal-deep: #2FA795;
  --teal-soft: #DFF5F0;
  --purple: #B4A3E6;
  --purple-soft: #F0EDFB;
  --danger: #FF4D5E;
  --danger-soft: #FFE9EC;
  --outline: #3B3226;
  --sky: #8FC9EE;
  --shadow: 0 3px 10px rgba(120,96,44,.08), 0 12px 28px rgba(120,96,44,.07);
  --shadow-pop: 0 3px 0 var(--border-strong);
  --radius: 18px;
  --radius-lg: 24px;
  --tabbar-h: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #292419;
    --surface: #37311F;
    --surface-soft: #3E3722;
    --surface-2: #241F13;
    --text: #F2EBD8;
    --muted: #A39670;
    --border: #463E28;
    --border-strong: #574C31;
    --accent: #FFD43D;
    --accent-deep: #C99F1E;
    --accent-soft: #4A3E1C;
    --on-accent: #3B3226;
    --pink: #FF8FAB;
    --pink-soft: #4A3238;
    --blue: #6FB4EC;
    --blue-soft: #26384A;
    --teal: #58C9B5;
    --teal-deep: #45B5A2;
    --teal-soft: #1F3B35;
    --purple: #BBA9EC;
    --purple-soft: #342F45;
    --danger: #FF6B78;
    --danger-soft: #46292C;
    --outline: #F2EBD8;
    --sky: #8FC9EE;
    --shadow: 0 2px 10px rgba(0,0,0,.3), 0 10px 26px rgba(0,0,0,.22);
    --shadow-pop: 0 3px 0 #1D180D;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100dvh;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; padding: 0; }
input, textarea { font-family: inherit; font-size: 15px; color: var(--text); }
img, video { display: block; max-width: 100%; }

.display { font-family: 'Happy', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; }
.logo-img { width: 36px; height: 36px; display: block; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; }

/* ---------- 通用 ---------- */
.page { padding: 16px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
.page-full { padding: 0; }
.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.hide { display: none !important; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }

.section-title {
  font-weight: 800;
  font-size: 15.5px;
  margin: 20px 2px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
}
.section-title::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--accent-deep);
  flex: none;
}

/* ---------- 按钮：柠檬黄 + 黑字，贴纸感 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: var(--on-accent);
  border-radius: 999px; padding: 12px 24px;
  font-size: 15px; font-weight: 800;
  box-shadow: 0 3px 0 var(--accent-deep);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-ghost {
  background: var(--surface); color: var(--text);
  border: 2px solid var(--border-strong);
  box-shadow: 0 3px 0 var(--border-strong);
}
.btn-ghost:active { box-shadow: 0 1px 0 var(--border-strong); }
.btn-white {
  background: var(--surface); color: var(--text);
  border: 2px solid var(--surface);
  box-shadow: 0 3px 0 rgba(0,0,0,.15);
}
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 2px solid var(--danger); box-shadow: 0 3px 0 var(--danger); }
.btn-danger:active { box-shadow: 0 1px 0 var(--danger); }
.btn-sm { padding: 7px 16px; font-size: 13px; font-weight: 700; }

.input {
  width: 100%; background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: 14px; padding: 12px 16px; outline: none;
  transition: border-color .15s, background .15s;
  font-weight: 500;
}
.input:focus { border-color: var(--accent); background: var(--surface); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.form-error { color: var(--danger); font-size: 13px; margin: 8px 0; min-height: 18px; font-weight: 600; }

/* ---------- 头像 ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; border: 2px solid var(--surface); box-shadow: 0 2px 6px rgba(46,44,40,.1); }
.avatar-fb {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sky);
  color: #fff; font-weight: 800; border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(46,44,40,.1);
}

.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty .empty-icon { font-size: 44px; margin-bottom: 12px; line-height: 1; }
.empty .mascot { margin: 0 auto 14px; width: 110px; height: 110px; }

.divider { height: 2px; background: var(--border); margin: 14px 0; border: none; border-radius: 2px; }

.loading { text-align: center; color: var(--muted); padding: 32px 0; font-size: 14px; }

/* ---------- Toast ---------- */
#toasts {
  position: fixed; top: calc(env(safe-area-inset-top) + 14px); left: 50%;
  transform: translateX(-50%); z-index: 999; width: min(86vw, 400px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--outline); color: var(--bg);
  border-radius: 14px; padding: 11px 18px; font-size: 14px; font-weight: 600;
  text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.2);
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.95); } to { opacity: 1; transform: none; } }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 10px; gap: 10px;
}
.topbar h2 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: .5px; }
.topbar-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--surface); border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); transition: transform .1s;
  box-shadow: 0 2px 0 var(--border);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: translateY(1px); box-shadow: none; }

/* ---------- 登录页 ---------- */
.auth-page {
  min-height: 100dvh; display: flex; flex-direction: column;
  justify-content: center; padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .auth-logo-img {
  width: 108px; height: 108px; margin: 0 auto 12px;
  animation: mascotFloat 3s ease-in-out infinite;
}
.auth-brand h1 {
  margin: 0; font-size: 36px; font-weight: 400; letter-spacing: 3px;
  font-family: 'Happy', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}
.auth-brand p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.auth-logo {
  width: 84px; height: 84px; margin: 0 auto 14px;
  background: var(--sky);
  border-radius: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 900; color: #fff;
  box-shadow: 0 6px 16px rgba(143,201,238,.5);
}
.auth-tabs {
  display: flex; background: var(--surface-soft); border-radius: 999px;
  padding: 4px; margin-bottom: 18px; gap: 4px;
}
.auth-tabs button {
  flex: 1; padding: 10px; border-radius: 999px;
  font-size: 15px; font-weight: 700; color: var(--muted);
  transition: all .15s;
}
.auth-tabs button.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 2px 8px rgba(46,44,40,.08);
}
.auth-form { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }

/* ---------- Tabbar：奶油底细线 ---------- */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 520px);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: none;
  display: flex; align-items: center; justify-content: space-around;
  z-index: 50;
  box-shadow: 0 -6px 24px rgba(120,96,44,.08);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); position: relative; min-width: 56px;
  padding: 4px 2px; border-radius: 12px; transition: color .15s, transform .1s;
}
.tab svg { width: 24px; height: 24px; }
.tab span { font-size: 10.5px; font-weight: 700; }
.tab.active { color: var(--text); }
.tab.active::after {
  content: '';
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 4px; border-radius: 999px; background: var(--accent);
}
.tab:active { transform: scale(.92); }

.tab-record { position: relative; min-width: 64px; display: flex; justify-content: center; }
.rec-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--on-accent);
  box-shadow: 0 4px 0 var(--accent-deep), 0 10px 20px rgba(235,188,43,.35);
  transform: translateY(-14px);
  transition: transform .12s;
}
.rec-btn svg { width: 26px; height: 26px; }
.rec-btn:active { transform: translateY(-10px); }
.rec-core { width: 22px; height: 22px; border-radius: 50%; background: currentColor; }
.rec-dash { width: 20px; height: 20px; border-radius: 6px; background: currentColor; }
.rec-main { display: flex; align-items: center; justify-content: center; }

/* ---------- 首页：Logus 布局 ---------- */
.lg-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 6px;
}
.lg-logo { display: flex; align-items: center; gap: 8px; }
.lg-logo .logo-img { width: 36px; height: 36px; }
.lg-logo b {
  font-family: 'Happy', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 23px; font-weight: 400; letter-spacing: 1px;
  color: var(--blue);
}
.lg-header-actions { display: flex; gap: 8px; }

/* 我的好友入口卡（仿 Logus 白卡） */
.lg-friend {
  margin: 10px 16px 0;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .1s;
  position: relative; overflow: hidden;
}
.lg-friend:active { transform: scale(.98); }
.lg-friend .avatar, .lg-friend .avatar-fb {
  border: 2.5px solid var(--pink);
  box-shadow: 0 0 0 2px var(--surface-soft);
}
.lg-friend-info { flex: 1; min-width: 0; }
.lg-friend-info b { display: block; font-size: 15.5px; font-weight: 800; }
.lg-friend-info span {
  display: block; color: var(--muted); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px;
}
.lg-badge {
  min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(255,77,94,.4);
}
.cam-mini {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--surface); border: 2px solid var(--border-strong);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s;
  box-shadow: 0 2px 0 var(--border-strong);
}
.cam-mini svg { width: 19px; height: 19px; }
.cam-mini:active { transform: scale(.9); }

/* 我的小队列表（仿 Logus 分组白卡） */
.lg-groups { padding: 0 16px; }
.lg-group-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 13px 15px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .1s;
}
.lg-group-card:active { transform: scale(.98); }
.lg-group-card.sel { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--accent), var(--shadow); }
.lg-group-info { flex: 1; min-width: 0; }
.lg-group-info b { display: block; font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-group-tag {
  display: inline-block; color: var(--blue); font-size: 12.5px; font-weight: 700;
  margin-top: 2px;
}
.lg-group-members { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.lg-new-group {
  border: 2px dashed var(--border-strong);
  background: transparent; box-shadow: none;
  color: var(--muted); justify-content: center;
  font-weight: 700; font-size: 14px;
}

/* 小队卡聊天按钮 + 未读红点 */
.lg-chat-btn { color: var(--teal-deep); position: relative; }
.lg-chat-btn svg { width: 21px; height: 21px; }
.lg-unread {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger, #FF4D5E); color: #fff;
  border-radius: 999px; font-size: 10.5px; font-weight: 800; font-style: normal;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(255,77,94,.4);
  border: 1.5px solid var(--surface);
}

/* 首页日期导航（仿 Logus 横向圆日期条） */
.week-bar { display: flex; align-items: center; gap: 10px; padding: 14px 12px 0; }
.week-strip { flex: 1; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.week-strip::-webkit-scrollbar { display: none; }
.week-day { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; }
.week-day .wd-num {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 15.5px; font-weight: 800; color: var(--text);
  box-shadow: 0 2px 8px rgba(120,96,44,.1);
  transition: transform .12s, background .15s, box-shadow .15s;
}
.week-day .wd-w { font-size: 11px; font-weight: 700; color: var(--muted); }
.week-day.today .wd-w { color: var(--teal-deep); }
.week-day.today .wd-num { box-shadow: 0 2px 8px rgba(120,96,44,.1), inset 0 0 0 2px var(--teal); }
.week-day.sel .wd-num { background: var(--accent); color: var(--on-accent); box-shadow: 0 3px 0 var(--accent-deep); }
.week-day.sel .wd-w { color: var(--accent-deep); }
.week-day:active .wd-num { transform: scale(.88); }
.day-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 2px; }
.day-label { font-size: 13px; font-weight: 800; color: var(--teal-deep); }
.lg-tools { display: flex; gap: 8px; padding: 6px 16px 0; }
.lg-tools .btn { gap: 5px; }
.lg-tools svg { width: 15px; height: 15px; }
.room-chip {
  background: var(--surface); border: none;
  border-radius: 999px; padding: 8px 16px;
  font-size: 14px; font-weight: 800; color: var(--text);
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(120,96,44,.1);
}
.room-chip:active { transform: translateY(1px); box-shadow: none; }
.date-chip {
  background: var(--accent); border: 2px solid var(--accent-deep);
  color: var(--on-accent); border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 800;
  box-shadow: 0 2px 0 var(--accent-deep);
}

.c-head b { font-size: 13.5px; font-weight: 700; }
.c-head span { font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.c-head { display: flex; align-items: baseline; }

.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }

.hour-banner.done { background: linear-gradient(120deg, var(--teal-soft), var(--blue-soft)); border-color: var(--teal); }
.hour-banner.done .hb-time { border-color: var(--teal); color: var(--teal); box-shadow: 0 3px 0 var(--teal); }
.hour-banner.done .hb-cta { background: var(--teal); box-shadow: 0 3px 0 #3AA593; }

/* ---------- 时间线 / 视频卡 ---------- */
.timeline { padding: 10px 16px 0; }
.timeline.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; align-items: start; }
.timeline.grid-2 .clip-card { margin-bottom: 10px; }

.clip-card {
  background: var(--surface); border: none;
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 12px; box-shadow: var(--shadow);
  transition: transform .12s;
}
.clip-card:active { transform: scale(.985); }
.clip-head {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px 9px;
}
.clip-head .avatar, .clip-head .avatar-fb { width: 32px; height: 32px; font-size: 13px; }
.clip-head b { font-size: 13.5px; font-weight: 700; }
.clip-head .muted { font-size: 11.5px; }
.clip-thumb { position: relative; background: var(--surface-2); }
.clip-thumb video { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.timeline.grid-2 .clip-thumb video { aspect-ratio: 1 / 1; }
.vlog-tag {
  position: absolute; left: 10px; bottom: 10px;
  background: var(--teal); color: #fff;
  border-radius: 8px; padding: 3px 9px;
  font-size: 11px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 0 2px 0 rgba(47,167,149,.9);
}
.clip-time {
  position: absolute; right: 10px; bottom: 10px;
  color: #fff; font-size: 12px; font-weight: 800;
  text-shadow: 0 1px 4px rgba(0,0,0,.55);
  background: rgba(59,50,38,.32); backdrop-filter: blur(3px);
  border-radius: 8px; padding: 3px 8px;
}
.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(59,50,38,.42); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  color: #fff; border: 2px solid rgba(255,255,255,.75);
}
.play-badge svg { width: 17px; height: 17px; }
.clip-caption {
  padding: 10px 14px 12px; font-size: 13.5px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.timeline.grid-2 .clip-caption { padding: 8px 12px 10px; font-size: 12.5px; }

.hour-group { margin: 6px 16px 14px; }
.hour-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); font-weight: 700;
  margin: 14px 2px 10px;
}
.hour-head::after { content: ''; flex: 1; height: 2px; background: var(--border); border-radius: 2px; }

.hour-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--accent-soft);\n  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 14px 16px; margin: 10px 16px;
}
.hb-time {
  width: 56px; height: 56px; border-radius: 18px; flex: none;
  background: var(--surface); border: 2px solid var(--accent);
  display: flex; align-items: baseline; justify-content: center;
  font-size: 22px; font-weight: 900; color: var(--accent-deep);
  box-shadow: 0 3px 0 var(--accent);
  padding-top: 8px;
}
.hb-time small { font-size: 11px; font-weight: 700; margin-left: 1px; opacity: .7; }
.hb-main { flex: 1; min-width: 0; }
.hb-title { font-weight: 800; font-size: 15px; }
.hb-state { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.hb-cta {
  flex: none; background: var(--accent); color: var(--on-accent);
  border-radius: 999px; padding: 9px 18px;
  font-size: 13.5px; font-weight: 800;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.hb-cta:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }

/* ---------- 日历弹层 ---------- */
.cal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(46,44,40,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.cal-card {
  width: min(92vw, 360px); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,.25); padding: 18px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head b { font-size: 17px; font-weight: 900; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 700; }
.cal-cell {
  aspect-ratio: 1; border-radius: 12px; font-size: 14px; font-weight: 600; position: relative;
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.cal-cell:active { background: var(--surface-2); }
.cal-cell.has::after {
  content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.cal-cell.today { border: 2px solid var(--accent); color: var(--accent-deep); font-weight: 800; }
.cal-cell.sel { background: var(--accent); color: var(--on-accent); font-weight: 800; box-shadow: 0 2px 0 var(--accent-deep); }
.cal-cell.sel.has::after { background: var(--on-accent); }

/* ---------- 详情页 ---------- */
.detail-page { min-height: 100dvh; background: var(--bg); }
.detail-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 12px;
}
.detail-head b { font-size: 16px; font-weight: 800; }
.detail-video-wrap { background: #000; position: relative; }
.detail-video-wrap video { width: 100%; max-height: 72vh; object-fit: contain; }
.detail-caption { padding: 14px 16px 4px; font-size: 14.5px; }
.like-bar { display: flex; align-items: center; padding: 6px 16px 10px; }
.like-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid var(--border-strong); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; color: var(--muted);
  background: var(--surface); font-weight: 700;
  box-shadow: 0 2px 0 var(--border-strong);
  transition: transform .1s;
}
.like-btn svg { width: 18px; height: 18px; }
.like-btn span { font-size: 13px; font-weight: 800; }
.like-btn.liked { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 2px 0 var(--danger); }
.like-btn:active { transform: translateY(2px); box-shadow: none; }

.comments-section { padding: 6px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 80px); }
.comments-title { font-weight: 800; font-size: 15px; margin: 8px 0 6px; }
.comment { display: flex; gap: 10px; padding: 10px 0; }
.comment .avatar, .comment .avatar-fb { width: 32px; height: 32px; font-size: 13px; }
.c-body { flex: 1; min-width: 0; }
.c-name { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.c-text { font-size: 14px; margin-top: 2px; word-break: break-word; }
.c-actions { display: flex; gap: 14px; margin-top: 4px; }
.c-actions button { font-size: 12px; color: var(--muted); font-weight: 600; }
.comment-reply { margin-top: 8px; background: var(--surface-2); border-radius: 12px; padding: 2px 12px; }

.comment-inputbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 520px);
  background: var(--surface); border-top: 1.5px solid var(--border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center; z-index: 40;
}
.replying-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--blue-soft); border-radius: 999px;
  padding: 5px 8px 5px 14px; font-size: 12.5px; color: var(--blue);
  font-weight: 600; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.replying-chip button { color: var(--blue); font-weight: 900; padding: 2px 6px; }

/* ---------- 聊天 ---------- */
.chat-page { display: flex; flex-direction: column; height: 100dvh; }
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: var(--surface); border-bottom: 1.5px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.chat-head b { font-size: 16px; font-weight: 800; flex: 1; }
.chat-body {
  flex: 1; overflow-y: auto; padding: 14px 14px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-day { text-align: center; color: var(--muted); font-size: 12px; padding: 6px 0; font-weight: 600; }
.msg { display: flex; gap: 8px; max-width: 86%; }
.msg .avatar, .msg .avatar-fb { width: 30px; height: 30px; font-size: 12px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-name { font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.msg.mine .msg-name { text-align: right; }
.msg-bubble {
  background: var(--surface); border: 1.5px solid var(--border);
  padding: 9px 13px; border-radius: 16px 16px 16px 6px;
  font-size: 14.5px; word-break: break-word; box-shadow: 0 2px 0 var(--border);
}
.msg.mine .msg-bubble {
  background: var(--accent); border-color: var(--accent-deep);
  color: var(--on-accent); border-radius: 16px 16px 6px 16px;
  box-shadow: 0 2px 0 var(--accent-deep);
}
.msg-time { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.msg.mine .msg-time { text-align: right; }
.msg-del { font-size: 11px; color: var(--danger); margin-top: 3px; font-weight: 600; }
.msg-body { min-width: 0; }
.chat-loadmore { text-align: center; color: var(--muted); font-size: 12.5px; padding: 6px; font-weight: 600; }
.chat-inputbar {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1.5px solid var(--border);
}
.chat-send {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.chat-send svg { width: 19px; height: 19px; }
.chat-send:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }
.chat-send[disabled] { opacity: .45; }

/* ---------- 拍摄页 ---------- */
.camera-page {
  height: 100dvh; background: #1D1C1A; color: #fff;
  display: flex; flex-direction: column; position: relative;
}
.cam-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 10px;
}
.cam-title { font-size: 16px; font-weight: 800; }
.cam-stage { flex: 1; position: relative; overflow: hidden; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; }
.cam-error {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: #1D1C1A; padding: 30px;
}
.cam-hint { color: rgba(255,255,255,.75); font-size: 13px; }
.cam-side-btn {
  position: absolute; right: 14px; bottom: 110px;
  display: flex; flex-direction: column; gap: 14px; z-index: 5;
}
.cam-side-btn button {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.16); backdrop-filter: blur(6px);
  color: #fff; display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.35);
}
.cam-side-btn svg { width: 20px; height: 20px; }
.cam-bottom {
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.cam-btn {
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--accent);
  border: 4px solid rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  color: var(--on-accent); box-shadow: 0 6px 20px rgba(235,188,43,.4);
  transition: transform .12s;
}
.cam-btn svg { width: 32px; height: 32px; }
.cam-btn:active { transform: scale(.92); }
.cam-btn[disabled] { opacity: .5; }
.countdown-ring { position: relative; width: 78px; height: 78px; }
.countdown-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900;
}
.cam-result-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  background: rgba(29,28,26,.92); backdrop-filter: blur(8px);
}
.cam-result-bar .btn { flex: 1; }
.cam-result-actions { display: flex; gap: 10px; flex: 1; }

/* ---------- Vlog ---------- */
.vlog-player { position: relative; background: #000; }
.vlog-player video { width: 100%; max-height: 74vh; object-fit: contain; }
.vp-overlay-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.6), transparent);
  color: #fff; display: flex; align-items: center; gap: 10px;
}
.vp-overlay-top b { font-size: 16px; font-weight: 800; }
.vp-overlay-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 30px 16px 16px;
  background: linear-gradient(0deg, rgba(0,0,0,.65), transparent);
  color: #fff;
}
.vp-who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.vp-who .avatar, .vp-who .avatar-fb { width: 28px; height: 28px; font-size: 11px; border-color: rgba(255,255,255,.6); }
.vp-who b { font-size: 13px; }
.vp-when { font-size: 11.5px; opacity: .85; }
.vl-text { font-size: 13px; margin-top: 2px; }
.vp-controls {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 18px;
}
.vp-ctl {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--border-strong);
}
.vp-ctl svg { width: 20px; height: 20px; }
.vp-ctl:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border-strong); }
.vp-ctl-big { width: 64px; height: 64px; background: var(--accent); border-color: var(--accent-deep); color: var(--on-accent); box-shadow: 0 4px 0 var(--accent-deep); }
.vp-ctl-big svg { width: 26px; height: 26px; }
.vp-segments { height: 8px; display: flex; gap: 3px; padding: 0 16px 12px; }
.vp-seg { flex: 1; background: rgba(255,255,255,.3); border-radius: 4px; overflow: hidden; height: 100%; }
.vp-seg i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; }
.vp-start {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: rgba(29,28,26,.75); backdrop-filter: blur(4px); color: #fff;
}
.vp-start-btn {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--accent);
  border: 4px solid rgba(255,255,255,.92); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px rgba(235,188,43,.45);
}
.vp-start-btn svg { width: 36px; height: 36px; }
.vp-start-btn:active { transform: scale(.93); }
.vlog-list { padding: 4px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); }
.vlog-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.vlog-item:active { transform: scale(.98); }
.vl-play {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  background: var(--accent-soft); border: 2px solid var(--accent);
  color: var(--accent-deep); display: flex; align-items: center; justify-content: center;
}
.vl-play svg { width: 18px; height: 18px; }
.vl-time { font-size: 13px; color: var(--muted); }

/* ---------- 小队详情 ---------- */
.room-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px;
  margin-bottom: 10px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .1s;
}
.room-row:active { transform: scale(.98); }
.room-row .r-info { flex: 1; min-width: 0; }
.room-row .r-info b { display: block; font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-row .r-info span { display: block; color: var(--blue); font-size: 12.5px; font-weight: 700; margin-top: 1px; }
.room-cur {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 0 var(--accent-deep);
}
.room-cur svg { width: 13px; height: 13px; }

.rd-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rd-name { margin: 0; font-size: 20px; font-weight: 900; }
.rd-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rd-bio { margin-top: 10px; font-size: 14px; color: var(--muted); }
.invite-box { margin-top: 14px; background: var(--surface-2); border-radius: var(--radius); padding: 13px 15px; border: 2px dashed var(--border-strong); }
.invite-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.invite-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; letter-spacing: 4px; font-weight: 700; }
.rd-actions { display: flex; gap: 10px; margin-top: 14px; }
.rd-actions .btn { flex: 1; padding-inline: 8px; font-size: 14px; }

.member-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.member-pill {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 58px; text-align: center;
}
.member-pill .avatar, .member-pill .avatar-fb { width: 44px; height: 44px; font-size: 17px; }
.member-pill span {
  font-size: 11px; color: var(--muted); font-weight: 600;
  max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1.5px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-row .avatar, .member-row .avatar-fb { width: 42px; height: 42px; font-size: 16px; }
.mr-info { flex: 1; min-width: 0; }
.mr-info b { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 700; }
.mr-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-badge {
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  border: 1.5px solid var(--accent);
}

.id-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.id-chip {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--surface-2); border: 2px solid var(--border-strong);
  border-radius: 10px; padding: 4px 12px; font-size: 12.5px; letter-spacing: 1.5px;
  font-weight: 700;
}
.id-chip:active { opacity: .7; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  padding: 7px 16px; border-radius: 999px; font-size: 13px;
  background: var(--surface-2); border: 2px solid var(--border-strong);
  color: var(--muted); font-weight: 700;
}
.tag-chip.active {
  background: var(--blue-soft); border-color: var(--blue);
  color: var(--blue);
}

/* ---------- 消息通知 ---------- */
.notif-item {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; border-bottom: 1.5px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--accent-soft); }
.notif-item.tappable { cursor: pointer; }
.notif-item.tappable:active { background: var(--surface-2); }
.notif-icon {
  flex: none; width: 38px; height: 38px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-style: normal;
  border: 2px solid transparent;
}
.notif-icon.t-like { background: var(--danger-soft); border-color: var(--danger); }
.notif-icon.t-comment { background: var(--blue-soft); border-color: var(--blue); }
.notif-icon.t-friend { background: var(--pink-soft); border-color: var(--pink); }
.notif-icon.t-room { background: var(--teal-soft); border-color: var(--teal); }
.notif-icon.t-remind { background: var(--accent-soft); border-color: var(--accent); }
.notif-body { flex: 1; min-width: 0; font-size: 14px; }
.notif-body > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.notif-quote {
  margin-top: 4px; font-size: 12.5px; color: var(--muted);
  background: var(--surface-2); border-radius: 10px; padding: 5px 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unread-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ---------- Tabbar 消息红点 ---------- */
.tab { position: relative; }
.tab-dot {
  position: absolute; top: -2px; left: 50%; transform: translateX(20px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; font-style: normal;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--surface); line-height: 1;
}

/* ---------- 我的 ---------- */
.me-page { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
.me-profile {
  display: flex; align-items: center; gap: 15px;
  background: var(--surface-soft);
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px; margin: 12px 16px 0; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.me-profile .avatar, .me-profile .avatar-fb { border: 2.5px solid var(--pink); }
.me-profile::after {
  content: '';
  position: absolute; right: -22px; top: -22px;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--accent-soft);
}
.me-avatar-wrap { position: relative; flex: none; }
.me-avatar-wrap .avatar, .me-avatar-wrap .avatar-fb { width: 64px; height: 64px; font-size: 25px; }
.me-avatar-edit {
  position: absolute; right: -4px; bottom: -4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 0 var(--accent-deep);
}
.me-avatar-edit svg { width: 12px; height: 12px; }
.me-name-row { flex: 1; min-width: 0; position: relative; z-index: 1; }
.me-name-row h2 { margin: 0; font-size: 19px; font-weight: 900; }
.me-about { color: var(--muted); font-size: 13px; margin-top: 3px; }
.me-actions { display: flex; gap: 10px; padding: 12px 16px 0; }
.me-actions .btn { flex: 1; }

/* 设置卡（时区 / 整点提醒） */
.me-set-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; }
.me-set-row b { display: block; font-size: 14.5px; font-weight: 800; }
.me-set-row .muted { display: block; margin-top: 2px; line-height: 1.4; }
.me-set-ico {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%; background: var(--teal-soft, #E2F6F2); color: var(--teal-deep);
  display: flex; align-items: center; justify-content: center;
}
.me-set-ico svg { width: 19px; height: 19px; }
.me-set-auto {
  flex: none; font-size: 11px; font-weight: 800; color: var(--teal-deep);
  background: var(--teal-soft, #E2F6F2); padding: 4px 9px; border-radius: 999px;
}

/* 通知内嵌好友申请按钮 */
.notif-fr-actions { display: flex; gap: 8px; margin-top: 8px; }
.notif-fr-actions .btn { padding: 5px 18px; }

/* 好友页"新的好友"行 */
.fr-req-actions { display: flex; gap: 8px; flex: none; }
.switch {
  width: 46px; height: 27px; flex: none;
  border-radius: 999px; border: none;
  background: var(--border-strong, #E8DCC3);
  position: relative; transition: background .18s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 2px 5px rgba(120,96,44,.25);
  transition: transform .18s;
}
.switch.on { background: var(--teal); }
.switch.on::after { transform: translateX(19px); }

/* ---------- 吉祥物 SVG ---------- */
.mascot { display: block; }
@keyframes mascotFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- 动画 ---------- */
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: none; } }
.clip-card, .lg-group-card, .lg-friend, .card, .room-row, .vlog-item, .notif-item { animation: popIn .22s ease; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 400px) {
  .member-pill .avatar, .member-pill .avatar-fb { width: 38px !important; height: 38px !important; }
  .tag-chip { padding: 6px 13px; font-size: 12px; }
  .like-btn { padding: 7px 13px; }
  .lg-logo b { font-size: 19px; }
  .hb-time { width: 46px; height: 46px; font-size: 17px; }
}
