:root {
  --bg-a: #fff3ee;
  --bg-b: #f9e8ed;
  --card: #ffffff;
  --ink: #46383a;
  --muted: #b28f8f;
  --faint: #e9d5d6;
  --accent: #ef6a85;
  --accent-2: #ff9a8b;
  --accent-soft: #fdebf0;
  --green: #6db87a;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(160, 90, 90, 0.10);
  --shadow-sm: 0 4px 14px rgba(160, 90, 90, 0.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: none; background: none; cursor: pointer; font-family: inherit; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-a), var(--bg-b));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ================= 登录页 ================= */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: min(90vw, 380px);
  padding: 44px 32px 36px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-heart { font-size: 52px; display: inline-block; animation: beat 1.6s infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.12); } 40% { transform: scale(1); } }
.login-card h1 { margin: 14px 0 4px; font-size: 24px; letter-spacing: 1px; }
.login-sub { color: var(--muted); margin: 0 0 28px; font-size: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 13px; }
.login-card input {
  padding: 13px 15px; border: 1.5px solid var(--faint); border-radius: 14px;
  font-size: 15px; background: #fff; transition: border-color .2s;
}
.login-card input:focus { outline: none; border-color: var(--accent-2); }
.login-card button {
  padding: 13px; border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 2px;
  box-shadow: 0 8px 20px rgba(239, 106, 133, 0.3);
}
.login-error { color: #d9485a; min-height: 18px; margin: 10px 0 0; font-size: 13px; }

/* ================= 导航（默认=手机：顶部品牌 + 底部导航栏） ================= */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--faint);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.brand .brand-heart { font-size: 20px; }
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 6px; padding-bottom: calc(8px + var(--safe-b));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--faint);
}
.nav .brand { display: none; }
.nav-btn {
  border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 10px; border-radius: 14px; color: var(--muted);
  font-size: 11px; min-width: 52px;
}
.nav-btn .nav-ico { font-size: 21px; line-height: 1; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-ico { transform: translateY(-1px); }
.nav-btn.active::after {
  content: ""; width: 16px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.logout { font-size: 17px; }
.logout span { font-size: 19px; }

.panel {
  max-width: 640px; margin: 0 auto;
  padding: 18px 16px calc(96px + var(--safe-b));
  display: flex; flex-direction: column; gap: 16px;
}

/* ================= 卡片 ================= */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.hint { font-size: 13px; color: var(--muted); }

/* 按钮 & 输入 */
.btn {
  border: none; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 16px rgba(239, 106, 133, 0.25);
}
.btn.full { width: 100%; margin-top: 12px; }
.chip {
  border: 1.5px solid var(--accent-2); background: #fff; color: var(--accent);
  padding: 9px 15px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.chip:active { background: var(--accent-soft); }
.chip.sel { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled, .chip:disabled { opacity: .55; cursor: not-allowed; }
input, textarea {
  font-family: inherit; max-width: 100%;
  padding: 11px 13px; border: 1.5px solid var(--faint); border-radius: 13px;
  font-size: 14px; background: #fff; color: var(--ink);
}
input[type="date"], input[type="datetime-local"] { min-width: 0; width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--accent-2); }
textarea { resize: vertical; width: 100%; }

/* ================= 首页 hero ================= */
.hero-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: var(--radius); padding: 30px 24px;
  text-align: center; box-shadow: var(--shadow);
}
.hero-card::before {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); top: -60px; right: -50px;
}
.hero-card::after {
  content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); bottom: -40px; left: -30px;
}
.hero-days { position: relative; font-size: 52px; font-weight: 800; line-height: 1; }
/* hero 两侧头像：绝对定位在粉色框左右，垂直居中 */
.hero-avatar {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 64px; height: 64px;
  background: rgba(255, 255, 255, .22);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
}
#hero-avatar-me { left: 18px; }
#hero-avatar-them { right: 18px; }
.hero-days small { display: block; font-size: 14px; font-weight: 500; margin-top: 8px; opacity: .92; }
.hero-days .hero-unit { display: inline; font-size: 20px; font-weight: 600; margin: 0 0 0 6px; }
.hero-meet { position: relative; margin: 16px 0 8px; font-size: 15px; opacity: .95; }
.anniv-list { position: relative; margin-top: 10px; font-size: 13px; opacity: .92; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }

/* ================= 天气 ================= */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.weather { text-align: center; }
.weather .w-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.weather .w-icon { font-size: 38px; }
.weather .w-temp { font-size: 30px; font-weight: 700; margin: 2px 0; }
.weather .w-extra { font-size: 13px; color: var(--muted); }
.weather .w-error { font-size: 13px; color: var(--muted); }

/* ================= 抱抱 ================= */
.hug-card { text-align: center; }
.hug-btn {
  width: 128px; height: 128px; border-radius: 50%; border: none; cursor: pointer;
  margin: 0 auto;
  padding: 0; outline: none;
  -webkit-tap-highlight-color: transparent;
  background: radial-gradient(circle at 32% 28%, #ffb3c1, var(--accent) 72%);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 14px 34px rgba(239, 106, 133, .4), inset 0 -6px 14px rgba(0, 0, 0, .08);
  transition: transform .12s ease;
  position: relative;
  animation: hug-beat 2.2s ease-in-out infinite;
}
.hug-heart { width: 44px; height: 44px; display: block; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .15)); }
.hug-text { font-size: 15px; font-weight: 700; letter-spacing: 2px; color: rgba(255, 255, 255, .95); }
.hug-btn:active { transform: scale(.9); animation-play-state: paused; }
.hug-btn:focus, .hug-btn:focus-visible { outline: none; }
.hug-btn::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid rgba(239, 106, 133, .35);
  animation: hug-ripple 2.2s ease-out infinite;
}
@keyframes hug-beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.05); }
  24% { transform: scale(1); }
  36% { transform: scale(1.03); }
  48% { transform: scale(1); }
}
@keyframes hug-ripple {
  0% { transform: scale(.9); opacity: .8; }
  100% { transform: scale(1.25); opacity: 0; }
}
#hug-hint { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* AI 快捷按钮 */
.ai-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ================= 留言 ================= */
.msg-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.msg-bubble {
  background: #fbf2f4; border-radius: 18px; padding: 13px 15px;
  box-shadow: var(--shadow-sm);
}
.msg-bubble.me { background: var(--accent-soft); }
.msg-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.msg-body { font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg-del { color: var(--muted); background: none; border: none; cursor: pointer; }
.msg-list.small .msg-body { color: var(--muted); }
.read-tag { margin-left: 6px; font-size: 11px; color: var(--green); }

/* ================= 背景音乐按钮 ================= */
.bgm-btn {
  position: fixed; top: 12px; right: 12px; z-index: 30;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(90, 60, 70, 0.08); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: .75; transition: opacity .2s, transform .2s;
}
.bgm-btn:hover { opacity: 1; transform: scale(1.08); }
.bgm-btn.playing { opacity: 1; animation: bgm-spin 3.5s linear infinite; }
@keyframes bgm-spin { to { transform: rotate(360deg); } }

/* ================= 聊天模式（留言 tab） ================= */
.chat-tab { display: flex; flex-direction: column; min-height: calc(100vh - 170px); }
.chat-tab[hidden] { display: none; }
.chat-flow {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1; padding: 6px 2px 14px;
}
.chat-flow .hint { text-align: center; color: var(--muted); margin: 40px 0; }

/* 一行 = 头像 + 气泡 */
.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; align-self: flex-start; }
.msg-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: var(--shadow-sm);
}
.msg-row.me .msg-avatar { background: linear-gradient(135deg, #b99df1, var(--accent)); }
.msg-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}

/* ---------- 设置页头像 ---------- */
.avatar-row { display: flex; gap: 32px; justify-content: center; margin-bottom: 14px; }
.avatar-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.avatar-circle {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-name { font-size: 13px; color: var(--ink-2, #5a3a42); }
.avatar-hint { font-size: 11px; color: #c98a96; }
#avatar-me-btn { cursor: pointer; }
#avatar-me-btn:active .avatar-circle { transform: scale(0.94); }

/* 气泡本体 */
.chat-flow .msg-bubble {
  position: relative; min-width: 0;
  padding: 10px 14px 9px;
  background: #fff; border-radius: 16px 16px 16px 4px;
  box-shadow: var(--shadow-sm);
}
.chat-flow .msg-bubble.me {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: 16px 16px 4px 16px;
}
.chat-flow .msg-bubble.me .msg-head { color: rgba(255, 255, 255, 0.78); }
.chat-flow .msg-bubble.me .read-tag { color: #e8ffe9; }
.chat-flow .msg-bubble.me .msg-del { color: rgba(255, 255, 255, 0.75); }
.chat-flow .msg-head { font-size: 11px; margin-bottom: 4px; gap: 12px; }
.chat-flow .msg-body { font-size: 15px; }
.msg-del { font-size: 14px; line-height: 1; padding: 0 2px; opacity: 0; transition: opacity .2s; }
.msg-row:hover .msg-del, .msg-row.me .msg-del { opacity: .8; }
/* 撤回按钮在手机端没有 hover，锁定信里保持可见 */
.locked-card .msg-del { opacity: .8; }

/* 新消息入场 */
.pop-in { animation: msg-pop .28s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes msg-pop { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.locked-card { margin-top: 12px; }
.locked-card[hidden] { display: none; }

/* 表情面板：悬浮在输入条上方，不挤占布局 */
.emoji-toggle {
  font-size: 20px; padding: 4px 6px; flex-shrink: 0;
  opacity: .7; transition: opacity .15s, transform .15s;
  align-self: flex-end; margin-bottom: 4px;
}
.emoji-toggle:hover, .emoji-toggle.on { opacity: 1; transform: scale(1.12); }
/* 表情面板：相对输入条绝对定位，正好浮在输入框上方，不遮挡输入框 */
.emoji-panel {
  position: absolute; left: 0; right: 0;
  bottom: calc(100% + 8px); z-index: 21;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  padding: 8px;
  max-height: 168px; overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(90, 60, 70, 0.14);
  animation: emoji-up .15s ease;
}
@keyframes emoji-up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.emoji-opt {
  font-size: 21px; padding: 5px 0; border-radius: 8px; line-height: 1.2;
  transition: background .12s, transform .12s;
}
.emoji-opt:hover { background: var(--accent-soft); transform: scale(1.15); }

/* 底部输入条 */
.chat-composer {
  position: sticky; bottom: calc(74px + var(--safe-b)); z-index: 10;
  display: flex; align-items: flex-end; gap: 8px;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(10px);
  border: 1.5px solid transparent; border-radius: 22px; padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(90, 60, 70, 0.14);
  margin-top: 10px;
  transition: border-color .2s;
}
.chat-composer:focus-within { border-color: var(--accent-2); }
.chat-composer textarea {
  flex: 1; resize: none; border: none; outline: none; background: transparent;
  font-size: 15px; line-height: 1.5; max-height: 120px; padding: 9px 6px;
}
.composer-side { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lock-toggle { font-size: 18px; cursor: pointer; padding: 5px; border-radius: 10px; transition: background .2s; }
.lock-toggle input { display: none; }
.lock-toggle:has(input:checked) { background: var(--accent-soft); }
.composer-side input[type=datetime-local] { font-size: 12px; padding: 6px 8px; max-width: 190px; }
.send-btn {
  padding: 0; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.send-btn:disabled { opacity: .5; }

/* ================= 日历 ================= */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { margin: 0; font-size: 16px; }
.cal-head .chip { padding: 4px 14px; font-size: 16px; line-height: 1; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week { margin-bottom: 4px; }
.cal-week span { text-align: center; font-size: 11px; color: var(--ink-3, #b98d96); }
.cal-day {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1;
}
.cal-num {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink, #4a2c33);
  border-radius: 50%;
}
.cal-day.today .cal-num { outline: 1.5px dashed var(--accent); outline-offset: 2px; font-weight: 700; }
.cal-day.heart { cursor: pointer; }
.cal-day.heart .cal-num {
  width: 34px; height: 34px; border-radius: 0;
  padding-bottom: 3px;  /* 数字落在爱心视觉中心（偏上） */
  /* 爱心框：浅粉填充 + 粉色描边，把日期整个框住 */
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fdebf0' stroke='%23ef6a85' stroke-width='1.6' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--accent); font-weight: 700;
}
.cal-day.heart:active { transform: scale(0.92); }

/* 天气预报条 */
.w-forecast {
  display: flex; justify-content: space-around;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed rgba(255, 143, 163, 0.3);
}
.w-f-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--ink-3, #b98d96);
}
.w-f-icon { font-size: 16px; }
.w-f-temp { font-size: 10px; }

/* ================= 日常（见面计划） ================= */
.plan-add { display: flex; gap: 8px; margin-bottom: 10px; align-items: stretch; }
.plan-add input { flex: 1; min-width: 0; }
.plan-add .btn {
  border-radius: 999px; padding: 0 20px; white-space: nowrap;
  font-size: 13px; letter-spacing: 1px;
  transition: transform .15s, box-shadow .15s;
}
.plan-add .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(239, 106, 133, 0.35); }
.plan-add .btn:active { transform: translateY(0) scale(.96); }
.plan-list { display: flex; flex-direction: column; gap: 6px; }
.plan-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 999px;
  padding: 8px 14px 8px 10px; box-shadow: 0 1px 4px rgba(90, 60, 70, 0.05);
  transition: opacity .2s;
}
/* 纯 CSS 圆形勾选框：空心圆 → 完成时渐变实心 + 白勾 */
.plan-check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #e7b6c0; background: #fff; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .18s;
}
.plan-check::after {
  content: "✓"; color: #fff; font-size: 12px; font-weight: 700;
  opacity: 0; transform: scale(.5); transition: all .18s;
}
.plan-item.done .plan-check {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.plan-item.done .plan-check::after { opacity: 1; transform: scale(1); }
.plan-text { flex: 1; min-width: 0; font-size: 14px; word-break: break-all; }
.plan-item.done .plan-text { text-decoration: line-through; color: var(--ink-3, #b98d96); }
.plan-del { color: #c98a96; font-size: 15px; opacity: .5; flex-shrink: 0; padding: 0 2px; }
.plan-del:hover { opacity: 1; }
/* 归档按钮：幽灵风格，居中低调 */
.plan-archive-btn {
  display: block; margin: 14px auto 0;
  border-style: dashed; color: var(--ink-3, #b98d96); border-color: var(--faint);
  font-size: 12px; padding: 8px 16px;
  transition: all .15s;
}
.plan-archive-btn:hover { color: var(--accent); border-color: var(--accent-2); }
.plan-group { margin-bottom: 12px; }
.plan-group-title {
  font-size: 12px; color: var(--ink-3, #b98d96);
  margin-bottom: 6px; padding-left: 2px;
}

/* ================= 每日一句 ================= */
.daily-line {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(120deg, #fff 0%, var(--accent-soft) 100%);
  border: 1px dashed rgba(239, 106, 133, 0.35);
}
.daily-icon { font-size: 18px; flex-shrink: 0; }
.daily-text {
  flex: 1; font-size: 14px; line-height: 1.6; color: var(--ink);
  font-style: italic;
}
.daily-refresh {
  flex-shrink: 0; font-size: 15px; color: var(--muted);
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s, color .2s;
}
.daily-refresh:hover { color: var(--accent); transform: rotate(180deg); }

/* ================= 见面策划师 ================= */
.plan-ai-btn {
  display: block; margin: 12px auto 0;
  color: var(--accent); border-color: var(--accent-2);
  transition: all .15s;
}
.plan-ai-btn:hover { background: var(--accent-soft); }
.plan-ai-btn:disabled { opacity: .55; }
.plan-ai-refs { margin-top: 8px; font-size: 12px; color: var(--muted); }
/* ✨ 帮我想回复：生成时旋转 */
.reply-ai.busy { animation: ai-spin .9s linear infinite; opacity: 1; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ================= 心情 ================= */
.mood-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-opt {
  font-size: 32px; padding: 8px 10px; border-radius: 14px; cursor: pointer;
  background: none; border: 2px solid transparent; transition: transform .12s;
}
.mood-opt:active { transform: scale(1.12); }
.mood-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.mood-svg { width: 100%; height: auto; }
.legend { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.8; }

/* ================= 愿望 ================= */
.wish-add { display: flex; gap: 8px; flex-wrap: wrap; }
.wish-add input { flex: 1; min-width: 110px; }
.wish-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.wish-item {
  background: #fff; border-radius: 18px; padding: 14px 16px;
  box-shadow: var(--shadow-sm); display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.wish-content { font-size: 15px; }
.wish-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.wish-claimed { color: var(--green); font-weight: 600; }

/* ================= AI ================= */
.ai-out {
  margin-top: 12px; padding: 14px; background: #fdf3f5; border-radius: 14px;
  font-size: 15px; line-height: 1.65; white-space: pre-wrap; min-height: 30px;
}
/* 生成中加载态：心跳 + 弹跳省略号 */
.ai-out.loading {
  display: flex; align-items: center; justify-content: center;
  white-space: normal; padding: 22px 14px;
  background: linear-gradient(120deg, #fdf3f5 30%, #fce7ee 50%, #fdf3f5 70%);
  background-size: 200% 100%;
  animation: think-shimmer 1.6s linear infinite;
}
@keyframes think-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.think-wrap {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 14px; letter-spacing: 1px;
}
.think-heart { display: inline-block; animation: beat 1.2s infinite; }
.think-dots { display: inline-flex; gap: 3px; margin-left: 2px; align-items: flex-end; height: 14px; }
.think-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: .45;
  animation: think-bounce 1s ease-in-out infinite;
}
.think-dots i:nth-child(2) { animation-delay: .15s; }
.think-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes think-bounce {
  0%, 100% { transform: translateY(0); opacity: .45; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* ================= 设置 ================= */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; min-width: 0; }
.field label { font-size: 13px; color: var(--muted); }
.grid2 > .field { min-width: 0; }
.anniv-row { display: flex; gap: 8px; margin-bottom: 8px; }
.anniv-row input { flex: 1; min-width: 0; }
.anniv-row .del { flex: 0 0 auto; }
#settings-msg { margin-top: 8px; }
.logout-btn { background: #efe4e4; color: var(--muted); box-shadow: none; }
.more-btn { display: block; margin: 4px auto 16px; }
.more-btn[hidden] { display: none; }
.ai-history { margin-top: 14px; border-top: 1px dashed #e8d9d5; padding-top: 10px; }
.ai-history h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.ai-history-item { margin-bottom: 10px; font-size: 13px; }
.ai-history-meta { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.ai-history-text { white-space: pre-wrap; line-height: 1.5; }

/* ================= 弹层 ================= */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 60; max-width: 86vw;
  background: rgba(55, 40, 42, 0.92); color: #fff;
  padding: 13px 20px; border-radius: 14px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); text-align: center;
  animation: pop .25s ease;
}
@keyframes pop { from { transform: translateX(-50%) translateY(-8px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }

/* ================= 实时同屏 & 弹幕 ================= */
.presence {
  position: fixed; top: 12px; left: 12px; z-index: 30;
  font-size: 12px; color: var(--muted);
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(8px);
  padding: 6px 12px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(90, 60, 70, 0.08);
  transition: color .3s;
}
.presence.on { color: var(--accent); }
.presence.on::before {
  content: "●"; margin-right: 4px; color: #4ecb71; font-size: 10px;
  vertical-align: 1px;
}
#danmaku-layer {
  position: fixed; inset: 0; z-index: 15;
  pointer-events: none; overflow: hidden;
}
.danmaku {
  position: absolute; left: 100%;
  white-space: nowrap; max-width: 80vw; overflow: hidden; text-overflow: ellipsis;
  font-size: 13px; color: var(--accent);
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(6px);
  padding: 6px 14px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(239, 106, 133, 0.18);
  animation: danmaku-fly linear forwards;
}
@keyframes danmaku-fly { to { transform: translateX(calc(-100vw - 100%)); } }

/* ================= 电脑（宽屏 ≥880px）：左侧边栏 ================= */
@media (min-width: 880px) {
  body { background: linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 60%, #f6e3ee 100%); }
  .appbar { display: none; }

  .nav {
    position: fixed; left: 0; top: 0; bottom: 0; width: 250px;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 6px;
    padding: 26px 16px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    border-top: none; border-right: 1px solid var(--faint);
  }
  .nav .brand { display: flex; padding: 6px 12px 22px; font-size: 20px; }
  .nav .brand .brand-heart { font-size: 22px; }
  .nav-btn {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 12px 16px; border-radius: 14px;
    font-size: 15px; min-width: 0;
  }
  .nav-btn .nav-ico { font-size: 20px; }
  .nav-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
  .nav-btn.active::after { display: none; }
  .logout { margin-top: auto; justify-content: center; font-size: 14px; }

  .panel { margin-left: 250px; max-width: 980px; padding: 28px 30px 60px; gap: 18px; }
  .chat-composer { bottom: 16px; }
  .chat-tab { min-height: calc(100vh - 120px); }

  /* 首页两栏 */
  #tab-home { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  /* 切到其它 tab 时必须隐藏首页（否则 id 的 display:grid 会盖过 [hidden]） */
  #tab-home[hidden] { display: none; }
  #tab-home > .hero-card, #tab-home > .grid2, #tab-home > .daily-line { grid-column: 1 / -1; }
  .hero-card { padding: 38px 28px; }
  .hero-days { font-size: 64px; }
  .weather .w-icon { font-size: 44px; }
  .weather .w-temp { font-size: 34px; }
  .card { padding: 22px 24px; }
  .card h3 { font-size: 17px; }
}

/* ================= 宽的笔记本/桌面(≥1280px)：内容更居中 ================= */
@media (min-width: 1280px) {
  .nav { width: 260px; }
  .panel { margin-left: 260px; max-width: 1020px; }
}