/* TalePaws 宠物思念 Web 版 - 全局样式 */
:root {
  --bg: #0f1020;
  --bg-soft: #1a1c33;
  --card: #232646;
  --card-soft: #2b2f56;
  --line: #3a3f6e;
  --text: #f0eefc;
  --text-dim: #b8b6d8;
  --accent: #c9a3ff;
  --accent-2: #ffc4a3;
  --accent-3: #9ad0ff;
  --pink: #ff9ecb;
  --green: #8fe3b4;
  --danger: #ff8f8f;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(1px 1px at 20% 20%, rgba(255,255,255,.5) 0, transparent 100%),
    radial-gradient(1px 1px at 60% 40%, rgba(201,163,255,.5) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 70%, rgba(255,255,255,.4) 0, transparent 100%),
    radial-gradient(1px 1px at 40% 80%, rgba(154,208,255,.5) 0, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 15%, rgba(255,158,203,.4) 0, transparent 100%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.nav .logo {
  font-size: 22px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nav .logo .paw { font-size: 24px; }
.nav .logo .logo-img { width: 32px; height: 32px; border-radius: 8px; }

/* ---------- 付费 / 升级 ---------- */
.quota-badge {
  display: inline-flex; align-items: center;
  background: var(--bg-soft); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; white-space: nowrap;
}
.quota-badge.vip {
  background: linear-gradient(135deg, #f6a5c0, #b39ddb); color: #fff;
  border: none; font-weight: 600;
}
.btn-upgrade { font-size: 13px; padding: 6px 12px; }
.upgrade-card { max-width: 560px; width: 100%; }
.upgrade-sub { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 4px 0 16px; }
.plans { display: flex; gap: 14px; margin-bottom: 12px; }
.plan-card {
  flex: 1; border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 16px; background: var(--bg-soft);
  display: flex; flex-direction: column;
}
.plan-forever {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(246, 165, 192, 0.18), rgba(179, 157, 219, 0.18));
}
.plan-name { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.plan-price { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.plan-price .plan-per { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 14px; }
.plan-card li { font-size: 13px; color: var(--muted); padding: 4px 0; }
.plan-card .btn-block { margin-top: auto; }
.upgrade-coming { color: #c67b12; font-size: 13px; text-align: center; margin: 0 0 6px; }
.upgrade-note { text-align: center; font-size: 12px; color: var(--muted); margin: 0; }
.upgrade-note a { color: var(--primary); text-decoration: none; }
/* 法律页面 */
.legal-page { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.legal-page h1 { font-size: 30px; margin-bottom: 8px; }
.legal-page .updated { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.legal-page h2 { font-size: 20px; margin: 28px 0 10px; }
.legal-page p, .legal-page li { font-size: 15px; line-height: 1.75; color: var(--muted); }
.legal-page ul { padding-left: 22px; margin: 8px 0; }
.legal-page a { color: var(--primary); }
.footer-links { margin-top: 6px; font-size: 13px; }
.footer-links a { color: var(--muted); text-decoration: none; margin: 0 8px; }
.footer-links a:hover { color: var(--primary); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  max-width: 820px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--pink) 50%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
  line-height: 1.2;
}
.hero p {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 30px;
}
.hero .cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; border: none;
  transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #1a1230;
  box-shadow: 0 6px 20px rgba(201,163,255,.35);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-outline:hover { background: var(--bg-soft); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.pet-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.pet-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pet-card .thumb {
  height: 160px;
  background: var(--card-soft);
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.pet-card .info { padding: 14px 16px; }
.pet-card .info .name { font-size: 17px; font-weight: 700; }
.pet-card .info .sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.pet-card .actions {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px;
}

/* 站级留言墙 */
.gb-pets { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 14px; }
.gb-pet-chip {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px 6px 6px; cursor: pointer; white-space: nowrap;
  background: var(--card); color: var(--text); font-size: 13px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.gb-pet-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.gb-pet-chip.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(233,120,196,0.25); }
.gb-to { font-size: 13px; color: var(--primary); margin-bottom: 10px; min-height: 20px; }
.gb-form { display: grid; gap: 10px; margin-bottom: 20px; }
.gb-form input,
.gb-form textarea {
  background: var(--card, #232646);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.gb-form textarea { resize: vertical; }
.gb-form input::placeholder,
.gb-form textarea::placeholder { color: var(--text-dim); }
.gb-list { display: grid; gap: 12px; max-height: 460px; overflow-y: auto; }
.gb-item { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 13px; gap: 8px; flex-wrap: wrap; }
.gb-pet-tag { color: var(--primary); text-decoration: none; font-size: 12px; }
.gb-pet-tag.gb-all { color: var(--text-dim); }
.gb-item p { font-size: 14px; margin: 0; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.pet-card .actions .btn { padding: 8px 14px; font-size: 13px; }
.pet-card .del {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; border: none;
  cursor: pointer; font-size: 14px; line-height: 1;
  display: none;
}
.pet-card:hover .del { display: block; }
.pet-card .del:hover { background: var(--danger); }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 6px;
}
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=number],
.form-group input[type=date],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,163,255,.12);
}
.form-group input::placeholder { color: rgba(184,182,216,.45); }
.form-group textarea { resize: vertical; min-height: 70px; }
.form-group .hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 13px; cursor: pointer; user-select: none;
  transition: all .15s;
}
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #1a1230; border-color: transparent; font-weight: 600;
}

/* ---------- 照片上传 ---------- */
.uploader {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
  overflow: hidden;
}
.uploader:hover { border-color: var(--accent); background: var(--bg-soft); }
.uploader input[type=file] { display: none; }
.uploader .preview {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 10px;
  border: 3px solid var(--accent);
  display: none;
}
.uploader.has-photo { border-style: solid; }
.uploader.has-photo .uploader-text { display: none; }
.uploader .uploader-text { color: var(--text-dim); font-size: 14px; }
.uploader .uploader-text .icon { font-size: 36px; display: block; margin-bottom: 8px; }

/* ---------- 对话框 ---------- */
.chat-wrap {
  max-width: 760px;
  margin: 20px auto 40px;
  display: flex; flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 480px;
}
.chat-header {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 14px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.chat-header .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--card-soft);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.chat-header .title { flex: 1; min-width: 120px; }
.chat-header .title .name { font-size: 17px; font-weight: 700; }
.chat-header .title .sub { font-size: 12px; color: var(--text-dim); }
.chat-header .chat-actions {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}
.chat-header .btn { padding: 8px 14px; font-size: 13px; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
}
.msg { display: flex; gap: 10px; max-width: 85%; }
.msg .bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg .bubble .audio-row { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.msg .bubble audio { height: 36px; max-width: 240px; }

.msg.bot { align-self: flex-start; }
.msg.bot .bubble {
  background: var(--card);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #1a1230;
  border-top-right-radius: 4px;
  font-weight: 500;
}
.msg .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--card-soft);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.msg.user .avatar { background: rgba(255,255,255,.15); font-size: 15px; }

.chat-input {
  display: flex; gap: 10px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}
.chat-input textarea {
  flex: 1;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 46px;
  max-height: 120px;
}
.chat-input textarea:focus { border-color: var(--accent); }
.chat-input .btn { height: 46px; padding: 0 22px; flex-shrink: 0; }
.typing .dots { display: inline-flex; gap: 4px; }
.typing .dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim);
  animation: blink 1.2s infinite;
}
.typing .dots span:nth-child(2) { animation-delay: .2s; }
.typing .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

.empty-chat {
  margin: auto; text-align: center; color: var(--text-dim);
}
.empty-chat .icon { font-size: 56px; display: block; margin-bottom: 14px; }

/* ---------- 纪念墙公开页 ---------- */
.memorial-hero {
  text-align: center;
  padding: 60px 20px 30px;
}
.memorial-hero .photo {
  width: 200px; height: 200px; border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 24px;
  border: 4px solid var(--accent);
  box-shadow: var(--shadow);
  display: block;
}
.memorial-hero .photo.placeholder {
  background: var(--card-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
  border: 4px dashed var(--line);
}
.memorial-hero h1 { font-size: 40px; font-weight: 800; }
.memorial-hero .dates { color: var(--text-dim); margin-top: 8px; font-size: 15px; }
.memorial-hero .badges { margin-top: 16px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.badge {
  background: var(--card); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--text-dim);
}
.memorial-body { max-width: 640px; margin: 0 auto; padding: 20px; }
.memorial-body .memory {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  font-size: 16px; line-height: 1.7;
}
.memorial-body .memory .quote-mark { color: var(--accent); font-size: 28px; line-height: 0; }
.memorial-footer {
  text-align: center; padding: 40px 20px 60px; color: var(--text-dim); font-size: 14px;
}
.divider { border: none; border-top: 1px solid var(--line); margin: 30px 0; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(8,8,20,.7);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal.show { display: flex; }
.modal h2 { margin-bottom: 20px; font-size: 22px; }
.modal .close-btn {
  float: right; background: none; border: none; color: var(--text-dim);
  font-size: 22px; cursor: pointer; line-height: 1;
}
.modal .close-btn:hover { color: var(--text); }

/* ---------- 提示 toast ---------- */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px);
  background: var(--card); border: 1px solid var(--accent); color: var(--text);
  padding: 12px 22px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow); z-index: 200;
  transition: transform .3s;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- 工具 ---------- */
.section-title { font-size: 26px; font-weight: 800; margin: 40px 0 20px; text-align: center; }
.section-sub { text-align: center; color: var(--text-dim); margin-bottom: 30px; }
.text-dim { color: var(--text-dim); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.center { text-align: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .nav { flex-wrap: wrap; gap: 10px; padding: 14px 0; }
  .plans { flex-direction: column; align-items: stretch; }
  .plan-card { max-width: 420px; width: 100%; margin: 0 auto; }
}

@media (max-width: 640px) {
  .container { padding: 0 12px; }
  .hero { padding: 46px 12px 36px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; margin-bottom: 24px; }
  .cta-btns { width: 100%; }
  .cta-btns .btn { width: 100%; justify-content: center; }
  .nav .logo { font-size: 18px; }
  .nav .logo-img { width: 26px; height: 26px; }
  .nav .btn { padding: 8px 14px; font-size: 13px; }
  .lang-select { padding: 5px 8px; font-size: 12px; }
  .chat-wrap { height: calc(100vh - 150px); margin: 10px auto 30px; }
  .chat-header { gap: 8px; padding: 12px 14px; }
  .chat-header .avatar { width: 42px; height: 42px; font-size: 20px; }
  .chat-header .title { min-width: 0; }
  .chat-header .title .name { font-size: 16px; }
  .chat-header .chat-actions { flex: 1 1 100%; justify-content: flex-start; margin-top: 2px; }
  .chat-header .chat-actions .btn-upgrade { width: auto; }
  .chat-body { padding: 12px; }
  .msg { max-width: 92%; }
  .msg .bubble { font-size: 14px; padding: 10px 13px; }
  .msg .bubble audio { max-width: 170px; }
  .chat-input { padding: 10px; gap: 8px; }
  .chat-input .btn { padding: 0 14px; height: 44px; }
  .btn-mic { width: 44px; height: 44px; }
  .memorial-hero { padding: 44px 16px 24px; }
  .memorial-hero .photo { width: 148px; height: 148px; }
  .memorial-hero .photo.placeholder { font-size: 56px; }
  .memorial-hero h1 { font-size: 28px; }
  .memorial-hero .dates { font-size: 14px; }
  .memorial-body { padding: 14px; }
  .memorial-body .memory { padding: 18px; font-size: 15px; }
  .legal-page { padding: 24px 16px 48px; }
  .legal-page h1 { font-size: 26px; }
  .auth-card { margin: 16px auto 48px; padding: 28px 20px 24px; }
  .section-title { font-size: 22px; }
  .footer { padding: 30px 12px 40px; }
  .modal { padding: 20px 16px; border-radius: 16px; }
  .modal-mask { padding: 12px; }
  .empty-chat .icon { font-size: 44px; }
  .divider { margin: 22px 0; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 26px; }
  .nav .logo { font-size: 17px; }
  .nav .btn { padding: 7px 10px; font-size: 12px; }
  .chat-input textarea { font-size: 14px; }
  .chat-header .avatar { width: 38px; height: 38px; font-size: 18px; }
  .msg .bubble audio { max-width: 140px; }
}

/* ---------- 新增：来信 / 收藏 / 语音 / 分享卡片 ---------- */

/* 语音按钮 */
.btn-mic {
  width: 46px; padding: 0;
  justify-content: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  font-size: 18px;
  flex-shrink: 0;
}
.btn-mic.listening {
  background: rgba(255,143,143,.2);
  border-color: var(--danger);
  animation: mic-pulse 1.2s infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,143,143,.45); }
  50% { box-shadow: 0 0 0 10px rgba(255,143,143,0); }
}

/* 收藏按钮 */
.msg-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
.btn-fav {
  background: none; border: none;
  color: var(--text-dim); font-size: 16px;
  cursor: pointer; padding: 2px 6px;
  transition: transform .15s, color .15s;
  line-height: 1;
}
.btn-fav:hover { color: var(--pink); transform: scale(1.2); }
.btn-fav.active { color: var(--pink); }

/* 通用弹窗（来信 / 卡片） */
.modal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 100%; max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head h3 { font-size: 19px; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 26px; line-height: 1; cursor: pointer; }
.modal-close:hover { color: var(--text); }

/* 来信弹窗 */
.letter-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.letter-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.letter-type {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text-dim);
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.letter-type.active {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #1a1230; border-color: transparent; font-weight: 600;
}
.letter-write { margin-bottom: 16px; }
.letter-loading { text-align: center; color: var(--accent); padding: 12px; font-size: 14px; }
.letter-paper {
  background: #fdf6e3;
  color: #4a3f35;
  border-radius: 12px;
  padding: 24px;
  margin: 12px 0;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.8;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.letter-paper-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; text-align: center; font-family: Georgia, serif; }
.letter-paper-body { font-size: 15px; }
.letter-public-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text);
  cursor: pointer; margin: 10px 0 4px;
}
.letter-public-toggle input { accent-color: var(--pink); }
.letter-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.btn-danger { color: var(--danger); border-color: rgba(255,143,143,.4); }
.btn-danger:hover { background: rgba(255,143,143,.1); }

.letter-list { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.letter-list h4 { font-size: 15px; margin-bottom: 8px; }
.letter-list-empty { color: var(--text-dim); font-size: 13px; padding: 8px 0; }
.letter-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--line);
  margin-bottom: 6px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.letter-list-item:hover { border-color: var(--accent); background: var(--card-soft); }
.letter-list-item.is-public { border-color: rgba(154,208,255,.4); }
.lli-icon { font-size: 16px; }
.lli-title { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lli-tag { font-size: 12px; }
.lli-date { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }

/* 纪念墙新区块：信件 + 语录 */
.wall-block { margin-top: 28px; }
.wall-title {
  font-size: 17px; font-weight: 700;
  margin-bottom: 14px; text-align: center;
}
.wall-letter {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.wall-letter-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wall-letter-icon { font-size: 18px; }
.wall-letter-title { font-weight: 700; font-size: 16px; font-family: Georgia, serif; }
.wall-letter-body { font-size: 14px; color: var(--text-dim); line-height: 1.8; }
.wall-letter-body p { margin-bottom: 6px; }
.wall-fav {
  position: relative;
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px 18px 40px;
  margin-bottom: 12px;
  font-style: italic;
}
.wall-fav-quote { position: absolute; left: 12px; top: 4px; font-size: 34px; color: var(--accent); line-height: 1; }
.wall-fav-text { font-size: 15px; color: var(--text); }
.wall-fav-heart { color: var(--pink); }

/* ---------- 主人操作栏 ---------- */
.owner-bar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.owner-bar .btn { font-size: 13px; padding: 8px 14px; }

/* ---------- 生命时间线 ---------- */
.timeline { position: relative; padding-left: 26px; margin-top: 6px; }
.timeline.is-empty { padding-left: 0; }
.timeline.is-empty::before { display: none; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: linear-gradient(180deg, var(--accent, #e8a87c), var(--pink, #ff8fa3));
  opacity: .35; border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 18px; }
.tl-dot {
  position: absolute; left: -26px; top: 8px; width: 12px; height: 12px;
  background: #fff; border: 3px solid var(--accent, #e8a87c);
  border-radius: 50%; box-shadow: 0 0 0 3px rgba(232,168,124,.15);
}
.tl-card {
  background: var(--bg-soft, #fffaf4);
  border: 1px solid var(--line, #eee);
  border-radius: 14px; padding: 14px 16px;
}
.tl-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-date {
  font-size: 12px; color: var(--text-dim, #999);
  background: rgba(0,0,0,.04); border-radius: 20px; padding: 2px 10px;
  font-weight: 600; letter-spacing: .3px;
}
.tl-card-title { font-size: 15px; font-weight: 600; color: var(--text, #333); flex: 1; }
.tl-del {
  background: none; border: none; color: var(--text-dim, #999); cursor: pointer;
  font-size: 14px; padding: 2px 6px; border-radius: 8px;
}
.tl-del:hover { color: var(--danger, #e05); background: rgba(255,143,143,.1); }
.tl-photo { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; margin: 10px 0 2px; }
.tl-text { font-size: 14px; color: var(--text, #444); line-height: 1.65; margin: 8px 0 0; white-space: pre-line; }
.tl-empty { text-align: center; padding: 12px 0; }
.timeline-owner { text-align: center; margin-top: 4px; }

/* 时间线弹窗 */
.tl-fields label.tl-label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; color: var(--text, #333); }
.tl-fields input[type="date"],
.tl-fields input[type="text"],
.tl-fields input:not([type]),
.tl-fields textarea {
  width: 100%; border: 1px solid var(--line, #eee); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: var(--card, #232646); color: var(--text, #f0eefc);
}
.tl-fields input::placeholder,
.tl-fields textarea::placeholder { color: var(--text-dim, #b8b6d8); }
.tl-fields textarea { resize: vertical; min-height: 70px; }
.tl-fields input:focus, .tl-fields textarea:focus { outline: none; border-color: var(--accent, #e8a87c); box-shadow: 0 0 0 3px rgba(232,168,124,.15); }
.tl-fields .btn { margin-top: 12px; }
.tl-photo-preview { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tl-photo-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line, #eee); }
.tl-remove { cursor: pointer; color: var(--text-dim, #999); font-size: 18px; }
.tl-ai-text { font-size: 13px; margin-top: 8px; font-style: italic; }

/* ---------- 点蜡烛 ---------- */
.candles-block { text-align: center; padding: 22px 0 6px; }
.candle-btn {
  font-size: 44px; background: none; border: none; cursor: pointer;
  filter: grayscale(.15); transition: transform .25s ease, filter .25s ease;
  display: inline-block; padding: 4px;
}
.candle-btn:hover { transform: scale(1.12); filter: grayscale(0) drop-shadow(0 4px 10px rgba(255,170,80,.45)); }
.candle-btn:disabled { opacity: .6; }
.candle-btn.candle-shake { animation: candleShake .4s ease; }
@keyframes candleShake {
  0%,100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-6px) rotate(-6deg); }
  75% { transform: translateX(6px) rotate(6deg); }
}
#candle-text { margin-top: 8px; font-size: 14px; }

/* ---------- 访客留言 ---------- */
.note-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.note-form input, .note-form textarea {
  width: 100%; border: 1px solid var(--line, #eee); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-family: inherit;
  background: var(--card, #232646); color: var(--text, #f0eefc);
}
.note-form input::placeholder, .note-form textarea::placeholder { color: var(--text-dim, #b8b6d8); }
.note-form textarea { resize: vertical; min-height: 56px; }
.note-form input:focus, .note-form textarea:focus { outline: none; border-color: var(--accent, #e8a87c); box-shadow: 0 0 0 3px rgba(232,168,124,.15); }
.note-form .btn { align-self: flex-end; }
.wall-note {
  background: var(--bg-soft, #fffaf4); border: 1px solid var(--line, #eee);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 10px;
}
.wall-note-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.wall-note-name { font-weight: 600; font-size: 14px; color: var(--text, #333); }
.wall-note-time { font-size: 12px; color: var(--text-dim, #999); }
.note-del { margin-left: auto; background: none; border: none; color: var(--text-dim, #999); cursor: pointer; font-size: 13px; }
.note-del:hover { color: var(--danger, #e05); }
.wall-note-text { font-size: 14px; color: var(--text, #444); line-height: 1.6; margin: 0; white-space: pre-line; }
.notes-empty { text-align: center; padding: 8px 0; }

/* ---------- 纪念墙 ---------- */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.wall-card {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  padding: 0; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.wall-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  text-decoration: none;
}
.wall-photo {
  height: 180px;
  background-size: cover; background-position: center;
  background-color: var(--card-soft);
}
.wall-body {
  padding: 16px;
  flex: 1;
  display: flex; flex-direction: column;
}
.wall-name { font-size: 18px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.wall-meta { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.wall-intro {
  font-size: 14px; color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wall-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 10px;
  gap: 8px;
}
.wall-stats { display: flex; gap: 10px; }
.wall-stats span { display: inline-flex; align-items: center; gap: 4px; }
.wall-btn { align-self: flex-start; }

@media (max-width: 640px) {
  .wall-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .wall-photo { height: 150px; }
  .wall-body { padding: 12px; }
  .wall-name { font-size: 16px; }
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.section-title {
  font-size: 28px; font-weight: 700; color: var(--text); margin: 0;
  letter-spacing: -0.5px;
}
.section-title-wrap { display: flex; flex-direction: column; gap: 4px; }

/* 移动端适配 */
@media (max-width: 560px) {
  .owner-bar { justify-content: stretch; }
  .owner-bar .btn { flex: 1; min-width: 120px; }
  .timeline { padding-left: 22px; }
  .tl-dot { left: -22px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .section-title { font-size: 24px; }
}
