:root {
  --bg: #fbfcf9;
  --ink: #3a403a;
  --muted: #8a938a;
  --line: #e7ece4;
  --card: #ffffff;
  --red: #e06b5b;        /* 红雨 主色 */
  --red-soft: #f7e3df;
  --green: #7ba05b;      /* 茉莉绿 */
  --gold: #e0b84a;       /* 桂花金 */
  --shadow: 0 6px 24px rgba(80, 110, 80, 0.08);
  --radius: 16px;
  --wrap: 760px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100dvh;
}

/* 茉莉花 + 桂花 隐形水印（极低透明度，几乎察觉不到） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/images/watermark.svg");
  background-size: 320px 320px;
  opacity: 0.06;
  pointer-events: none;
  z-index: -1;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--red); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶部 ---------------- */
.site-header {
  background: rgba(255, 253, 246, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { color: var(--ink); }
.brand-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.brand-name { font-size: 22px; letter-spacing: 4px; color: var(--red); font-family: var(--brush); }
.site-nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.wx-badge { color: var(--muted); font-size: 13px; }

/* 书法字体标题（中国风） */
.page-title, .post-title, .comments-title, .form-section, .alm-title, .today-hello {
  font-family: var(--brush);
  letter-spacing: 2px;
}

/* ---------------- 通用卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.page-title { font-size: 22px; margin: 28px 0 18px; letter-spacing: 1px; }
.section-title { font-size: 16px; color: var(--muted); margin: 26px 0 10px; }
.empty { color: var(--muted); padding: 18px 0; }

/* ---------------- 日志列表 ---------------- */
.post-list { display: grid; gap: 16px; }
.post-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(80, 110, 80, 0.12); }
.post-link { display: block; padding: 20px 22px; color: inherit; }
.post-title { margin: 0 0 8px; font-size: 19px; color: var(--ink); }
.post-excerpt { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.post-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------------- 日志详情 ---------------- */
.back { display: inline-block; margin: 24px 0 6px; font-size: 14px; color: var(--muted); }
.post-detail { padding: 30px 30px 34px; margin-bottom: 24px; }
.post-detail .post-title { font-size: 26px; margin-bottom: 10px; }
.post-body {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 16px;
  font-size: 16px;
}

/* ---------------- 评论 ---------------- */
.comments { margin-bottom: 60px; }
.comments-title { font-size: 17px; margin: 8px 0 16px; }
.comment-list { display: grid; gap: 12px; }
.comment { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.c-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 38px; border: 1px solid var(--line); }
.c-avatar--default { display: flex; align-items: center; justify-content: center; background: var(--red-soft); font-size: 18px; }
.c-main { flex: 1; min-width: 0; }
.c-head { display: flex; justify-content: space-between; font-size: 13px; }
.c-name { font-weight: 600; }
.c-time { color: var(--muted); }
.c-content { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

.comment-form { margin-top: 16px; }
.comment-form textarea, .form-card textarea, .form-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}
.comment-form textarea:focus, .form-card textarea:focus, .form-card input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(123, 160, 91, 0.15);
}
.login-tip { margin-top: 16px; text-align: center; color: var(--muted); }
.login-tip p { margin: 0 0 12px; }

/* ---------------- 按钮 / 表单 ---------------- */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 20px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #d35c4c; color: #fff; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.emoji-trigger {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}
.emoji-trigger:hover { border-color: var(--green); }
.error { color: var(--red); background: var(--red-soft); padding: 10px 14px; border-radius: 10px; }
.ok { color: var(--green); background: #eef5e8; padding: 10px 14px; border-radius: 10px; }

/* ---------------- 表情面板 ---------------- */
.emoji-panel {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 320px;
  margin-top: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.emoji-item { cursor: pointer; font-size: 20px; padding: 4px; border-radius: 8px; }
.emoji-item:hover { background: var(--red-soft); }

/* ---------------- 后台 ---------------- */
.auth-box { max-width: 340px; margin: 80px auto; text-align: center; }
.auth-box form { display: grid; gap: 12px; margin-top: 18px; }
.auth-box input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; }
.auth-box h1 { font-size: 24px; letter-spacing: 2px; color: var(--red); margin: 0; }
.auth-box .auth-alt { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
/* 登录/注册页的「记住密码」勾选行 */
.remember-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none;
  padding: 2px 0;
}
.remember-row input[type="checkbox"] {
  width: 15px; height: 15px; margin: 0; accent-color: var(--red); cursor: pointer;
}
.remember-row:hover { color: var(--ink); }
.auth-box .back-link { display: inline-block; margin-top: 16px; font-size: 14px; color: var(--muted); }

.admin-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-nav a {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--muted);
}
.admin-nav a:hover { background: var(--red-soft); color: var(--red); }

.page-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 18px; }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat { padding: 22px; text-align: center; }
.stat-num { font-size: 30px; color: var(--red); font-weight: 700; }
.stat-label { color: var(--muted); font-size: 13px; }

.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mini-list li { display: flex; justify-content: space-between; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.mini-list .muted { color: var(--muted); font-size: 12px; }

.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid th, .grid td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.grid th { background: #f5f8f3; color: var(--muted); font-weight: 600; }
.grid tr:last-child td { border-bottom: none; }
.grid .ops { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.grid .ops a, .link-danger { color: var(--green); background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
.link-danger { color: var(--red); }
.muted { color: var(--muted); }
.c-cell { max-width: 360px; }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.form-card label { display: grid; gap: 6px; font-size: 14px; color: var(--ink); }
.form-section { margin: 4px 0 0; font-size: 15px; color: var(--ink); }
.form-hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------------- 页脚 ---------------- */
.site-footer { margin-top: 60px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.error-code { font-size: 48px; color: var(--red); margin-bottom: 8px; }

/* ---------------- 导航头像 ---------------- */
.nav-user { display: inline-flex; align-items: center; gap: 6px; }
.nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

/* ---------------- 图库 ---------------- */
.gallery-tabs { display: flex; gap: 10px; margin: 8px 0 18px; }
.gallery-tabs .tab {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 8px 22px; font: inherit; font-size: 14px; cursor: pointer;
}
.gallery-tabs .tab.active { background: var(--red); color: #fff; border-color: var(--red); }
.upload-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 22px; }
.upload-hint { color: var(--muted); font-size: 13px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gallery-item { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.gallery-item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.gallery-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery-video { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.gallery-video video { width: 100%; border-radius: 8px; background: #000; }
.gallery-video p { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }

/* ---------------- 正文媒体（图文混排）---------------- */
.post-img { max-width: 100%; border-radius: 12px; margin: 12px 0; display: block; border: 1px solid var(--line); }
.post-video { max-width: 100%; border-radius: 12px; margin: 12px 0; display: block; background: #000; }

/* ---------------- 验证码行 ---------------- */
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; }

/* ---------------- 个人资料 ---------------- */
.me-card { max-width: 520px; }
.me-avatar { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; margin: 0 auto 18px; border: 2px solid var(--line); background: var(--red-soft); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-section { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.me-section h3 { margin: 0; font-size: 15px; color: var(--muted); font-weight: 600; }
.me-section input[type="text"], .me-section input[type="tel"], .me-section input[type="password"] { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: #fff; color: var(--ink); }
.me-section .btn { justify-self: start; }

/* ---------------- 私信 ---------------- */
.msg-list { display: grid; gap: 12px; }
.msg-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.msg-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.msg-name { font-weight: 600; color: var(--ink); }
.msg-content { white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.msg-hint { font-size: 13px; color: var(--muted); margin: -4px 0 4px; }
.msg-hint strong { color: var(--ink); }
/* 分享链接（仅管理员可见） */
.share-bar { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; flex-wrap: wrap; }
.share-label { font-size: 13px; color: var(--muted); }
.form-hint { font-size: 13px; color: var(--muted); margin: -6px 0 6px; }
.link-share { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 14px; padding: 0; }
.link-share:hover { text-decoration: underline; }
.msg-card .link-danger { margin-top: 8px; font-size: 13px; }

/* ================================================================
   中国风 · 适老化 · 首页问候卡片区（v3 新增）
   ================================================================ */

/* ---------------- 水墨角落装饰（淡雅白色） ---------------- */
.deco { position: fixed; pointer-events: none; z-index: 0; background-repeat: no-repeat; background-size: contain; }
.deco-mountain { top: 72px; left: 0; width: 230px; height: 190px; background-image: url("/images/ink-mountain.svg"); opacity: 0.55; }
.deco-peony { bottom: 0; right: 0; width: 250px; height: 230px; background-image: url("/images/ink-peony.svg"); opacity: 0.5; }
.deco-osmanthus { bottom: 0; left: 0; width: 220px; height: 180px; background-image: url("/images/ink-osmanthus.svg"); opacity: 0.5; }
main.wrap { position: relative; z-index: 1; }
@media (max-width: 720px) { .deco { display: none; } }

/* ---------------- 字号调节（适老化，右上角） ---------------- */
.fs-switch {
  position: fixed; top: 72px; right: 14px; z-index: 40;
  display: flex; align-items: center; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 6px; box-shadow: var(--shadow);
}
.fs-label { font-size: 12px; color: var(--muted); padding: 0 4px; }
.fs-btn {
  border: none; background: none; cursor: pointer; font: inherit;
  font-size: 13px; color: var(--muted); padding: 4px 10px; border-radius: 999px;
}
.fs-btn.active { background: var(--red); color: #fff; }
.fs-btn:hover { color: var(--red); }
.fs-btn.active:hover { color: #fff; }

/* 三档字号：小 / 中 / 大（默认大） */
html.fs-small body { zoom: 0.88; }
html.fs-medium body { zoom: 1; }
html.fs-large body { zoom: 1.15; }

/* ---------------- 首页：今日一览（问候/暖心话/纪念日/叮嘱/黄历/节气 六合一） ---------------- */
.today-sweet { position: relative; }
.sweet-quote {
  position: absolute; left: 14px; top: 4px;
  font-family: var(--brush); font-size: 40px; color: var(--red); opacity: 0.6;
}
.sweet-text {
  margin: 0; font-size: 19px; font-family: var(--brush);
  color: var(--red); letter-spacing: 1px; line-height: 1.6;
}
/* 当前场景角标：让用户知道这句是「看天 / 逢节」挑出来的 */
.sweet-scene {
  display: inline-block; margin-top: 10px; font-size: 13px; color: var(--muted);
  background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 12px;
}
.sweet-in { animation: sweetIn 0.45s ease; }
@keyframes sweetIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 后台情话库：按场景分组 + 标签 */
.sweet-group { margin: 18px 0 24px; }
.sweet-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tag-chip {
  display: inline-block; font-size: 13px; padding: 3px 12px; border-radius: 999px;
  background: var(--red-soft); color: var(--red); border: 1px solid rgba(176, 58, 66, 0.22);
}

/* ---- ① 问候抬头 ---- */
.today-card {
  padding: 0; margin: 24px 0 22px; overflow: hidden;
  border: 1px solid rgba(176, 58, 66, 0.26);
  background: linear-gradient(180deg, rgba(255, 251, 242, 0.92), #fff 40%);
}
/* 顶部一道暖红金渐变细带，像老黄历的抬头 */
.today-card::before {
  content: ''; display: block; height: 6px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}
.today-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px 16px; }
.today-lantern { font-size: 32px; flex: 0 0 auto; }
.today-head-text { min-width: 0; }
.today-hello {
  margin: 0; font-size: 22px; font-weight: 700; color: var(--ink);
  font-family: var(--brush); letter-spacing: 1px; line-height: 1.45;
}
.today-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.today-sub span + span { margin-left: 12px; }

/* ---- 内部各分区：细虚线分隔，不再是各自独立的小卡片 ---- */
.today-sweet, .today-meet, .today-care, .today-foot {
  padding: 14px 22px; border-top: 1px dashed rgba(176, 58, 66, 0.22);
}
.today-sweet {
  padding-left: 44px;
  background: linear-gradient(135deg, rgba(176, 58, 66, 0.07), rgba(201, 162, 75, 0.07));
}

/* ---- ③ 相识纪念日 ---- */
.today-meet {
  display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(176, 58, 66, 0.05), rgba(201, 162, 75, 0.07));
}
.meet-icon { font-size: 24px; }
.meet-line {
  margin: 0; font-size: 16px; color: var(--muted);
  font-family: var(--brush); letter-spacing: 1px;
}
.meet-count { font-size: 24px; color: var(--red); font-weight: 700; margin-left: 4px; }
.meet-sub { margin: 0; font-size: 13px; color: var(--muted); }

/* ---- 临时预览：暖心话测试生成（仅管理员首页可见） ---- */
.sweet-preview { margin: 0 0 22px; padding: 18px 22px; border: 1px dashed var(--gold); background: rgba(201, 162, 75, 0.06); }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.preview-title { margin: 0; font-size: 16px; color: var(--red); font-family: var(--brush); letter-spacing: 1px; }
.preview-badge { font-size: 12px; color: var(--muted); }
.preview-row { display: flex; flex-wrap: wrap; gap: 12px; }
.preview-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.preview-row input { width: 160px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; background: #fff; color: var(--ink); }
.preview-row input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(123, 160, 91, 0.15); }
.preview-actions { display: flex; gap: 12px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.preview-hint { font-size: 12px; color: var(--muted); }
.preview-result { margin-top: 12px; font-size: 18px; font-family: var(--brush); color: var(--red); line-height: 1.6; white-space: pre-wrap; word-break: break-word; min-height: 24px; }
.preview-result.ok { color: var(--red); }
.preview-result.err { color: #c0392b; font-family: var(--font, system-ui, sans-serif); font-size: 14px; }
.meet-sub b { color: var(--green); }

/* ---- ④ 今日叮嘱 ---- */
.today-care { display: grid; gap: 8px; }
.care-line { margin: 0; font-size: 15px; display: flex; gap: 10px; align-items: baseline; }
.care-tag { flex: 0 0 auto; font-size: 13px; color: var(--green); background: rgba(63, 92, 80, 0.1); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }

/* ---- ⑤⑥ 黄历 + 节气 ---- */
.today-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; }
@media (max-width: 620px) { .today-foot { grid-template-columns: 1fr; } }
.alm-title { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.alm-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.alm-yi, .alm-ji {
  flex: 0 0 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-family: var(--brush); font-size: 18px; color: #fff;
}
.alm-yi { background: var(--green); }
.alm-ji { background: var(--red); }
.alm-items { font-size: 15px; color: var(--ink); }
.term-box { display: flex; gap: 14px; align-items: center; }
.term-icon { width: 84px; height: 84px; flex: 0 0 84px; }
.term-text { min-width: 0; }
.term-desc { margin: 4px 0; font-size: 14px; color: var(--muted); }
.term-next { margin: 0; font-size: 13px; color: var(--gold); }

/* ---------------- 日志页：朗读 / 送花 / 语音评论 ---------------- */
.post-actions { display: flex; gap: 10px; margin: 12px 0 0; }
.read-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.read-hint { font-size: 14px; color: var(--muted); }
.read-bar .btn-primary { font-size: 16px; padding: 10px 22px; }

.flower-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding: 14px 18px;
  background: linear-gradient(135deg, rgba(192, 162, 75, 0.10), rgba(176, 58, 66, 0.06));
  border: 1px dashed var(--gold); border-radius: 14px;
}
.flower-btn {
  border: none; cursor: pointer; font: inherit; font-size: 16px;
  background: var(--red); color: #fff; padding: 10px 20px; border-radius: 12px;
  transition: transform 0.15s ease;
}
.flower-btn:hover:not(:disabled) { transform: translateY(-1px); }
.flower-btn:disabled { background: var(--muted); cursor: default; }
.flower-count { font-size: 14px; color: var(--muted); }
.flower-count b { color: var(--red); font-size: 17px; }
.flower-field { margin-top: 10px; font-size: 20px; letter-spacing: 3px; line-height: 1.6; word-break: break-all; }

.mic-btn {
  border: 1px solid var(--green); background: rgba(63, 92, 80, 0.08); color: var(--green);
  cursor: pointer; font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 12px;
}
.mic-btn.listening {
  background: var(--red); border-color: var(--red); color: #fff;
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(176, 58, 66, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(176, 58, 66, 0); }
}

/* ---------------- 后台：重要日子 ---------------- */
.date-banner {
  background: rgba(201, 162, 75, 0.12); border: 1px solid var(--gold);
  border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-size: 14px;
}
.date-banner p { margin: 4px 0; }

.date-list { display: grid; gap: 10px; }
.date-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.date-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.date-name { font-weight: 700; font-size: 15px; }
.date-kind { color: var(--card); background: var(--green); font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.date-when { color: var(--muted); }
.date-note { color: var(--muted); font-size: 13px; }

.remind-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(66, 58, 48, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.remind-modal {
  max-width: 420px; width: 100%; text-align: center; padding: 32px 28px 26px;
  border-top: 4px solid var(--red);
}
.remind-flower { font-size: 30px; margin-bottom: 8px; }
.remind-title { margin: 6px 0; font-size: 22px; font-family: var(--brush); color: var(--ink); }
.remind-bless { font-size: 16px; color: var(--red); margin: 10px 0 4px; }
.remind-note { font-size: 13px; color: var(--muted); margin: 0 0 16px; }

/* 表单里的下拉框与文本框统一 */
.form-card select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: inherit; background: #fff; color: var(--ink);
}

/* ---------------- 首页写日志卡片 / 草稿箱（仅管理员可见） ---------------- */
.compose-card, .drafts-card { padding: 22px; margin-bottom: 28px; }
.compose-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.compose-title { font-size: 20px; margin: 0; color: var(--ink); }
.compose-badge {
  font-size: 12px; color: var(--red); background: rgba(214,92,76,0.10);
  border: 1px solid rgba(214,92,76,0.25); border-radius: 999px; padding: 3px 12px;
}
.compose-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.compose-label input[type="text"] {
  width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font: inherit; background: #fff; color: var(--ink);
}
.compose-label textarea {
  width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font: inherit; background: #fff; color: var(--ink); resize: vertical; line-height: 1.6;
}
.cover-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.cover-preview .cover-thumb { max-height: 64px; border-radius: 10px; border: 1px solid var(--line); }
.compose-toolbar { display: flex; gap: 10px; margin: 4px 0 14px; }
.compose-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.compose-tip { font-size: 13px; color: var(--muted); margin-right: auto; }
.compose-tip.is-error { color: var(--red); }

.drafts-empty { color: var(--muted); font-size: 14px; margin: 0; }
.drafts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.draft-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff;
}
.draft-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.draft-title { font-size: 15px; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-meta { font-size: 12px; color: var(--muted); }
.draft-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 幽灵按钮 / 小按钮（补全局基础样式） */
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }

/* ---------------- 图库分类文件夹 ---------------- */
.upload-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 22px; }
.upload-box .cat-input,
.upload-box .album-select {
  width: 200px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; background: #fff; color: var(--ink);
}
.upload-hint { font-size: 12px; color: var(--muted); }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 5px 14px; font: inherit; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }
.chip .del {
  margin-left: 2px; line-height: 1; font-size: 14px; opacity: 0.6; cursor: pointer;
}
.chip .del:hover { opacity: 1; color: #fff; }

/* ---------------- 日志朗读（正文上方） ---------------- */
.read-bar { border-bottom: 1px dashed var(--line); padding-bottom: 14px; }
.voice-select {
  max-width: 260px; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.read-bar.reading-hint { color: var(--muted); }

/* ---------------- 写日志：多图上传 ---------------- */
.cover-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.cover-thumbs:empty { display: none; }
.cover-thumb {
  max-height: 64px; max-width: 96px; border-radius: 10px; border: 2px solid var(--line);
  cursor: pointer; object-fit: cover; background: #fff;
}
.cover-thumb.is-active { border-color: var(--red); box-shadow: 0 0 0 2px rgba(200, 40, 60, 0.15); }
.compose-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---------------- 后台：AI 暖心话设置 ---------------- */
.switch-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; font-size: 15px; }
.switch-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--red); cursor: pointer; }
#aiTestResult { margin-top: 8px; line-height: 1.7; }

/* ---------------- 后台：站点头像上传 ---------------- */
.avatar-field { display: flex; gap: 16px; align-items: flex-start; margin: 12px 0 18px; flex-wrap: wrap; }
.avatar-preview {
  width: 84px; height: 84px; flex: 0 0 84px; border-radius: 50%; overflow: hidden;
  border: 1px solid var(--line); background: #fafafa;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-main { flex: 1; min-width: 240px; }
.avatar-main label { display: block; margin: 0 0 8px; }
.avatar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar-actions .form-hint { margin: 0; }


/* ---------------- 图库：文件夹卡片网格（默认视图） ---------------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin: 18px 0 24px;
}
.album-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.album-cover {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 1:1 正方形 */
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  overflow: hidden;
}
.album-cover img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.album-cover-empty {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; color: var(--muted);
}
.album-del {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.album-card:hover .album-del { opacity: 1; }
.album-del:hover { background: var(--red); }
.album-meta {
  padding: 10px 12px 14px;
}
.album-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-count {
  font-size: 12px;
  color: var(--muted);
}

/* ---------------- 文件夹内容（点进文件夹后展示） ---------------- */
.album-view {
  margin: 18px 0 32px;
}
.album-view-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.album-view-title {
  margin: 0;
  font-size: 20px;
  color: var(--ink);
}
.album-batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff8f0;
  border: 1px solid #ffd9a8;
  border-radius: 10px;
  margin-bottom: 14px;
}
.batch-hint {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

/* ---------------- 看原图灯箱（不可下载） ---------------- */
.lightbox, .lightbox-global {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden], .lightbox-global[hidden] { display: none; }
.lightbox-mask {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}
.lightbox-stage {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 4px;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 32px;
  line-height: 1;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(200, 40, 60, 0.85);
}
.lightbox-close {
  top: -54px; right: 0;
  font-size: 28px;
}
.lightbox-prev {
  left: -64px; top: 50%;
  transform: translateY(-50%);
}
.lightbox-next {
  right: -64px; top: 50%;
  transform: translateY(-50%);
}
.lightbox-cap {
  position: absolute;
  bottom: -40px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 移动端：把上下按钮放底部 */
@media (max-width: 768px) {
  .lightbox-prev, .lightbox-next {
    top: auto; bottom: -56px;
    transform: none;
  }
  .lightbox-prev { left: 30%; }
  .lightbox-next { right: 30%; }
  .lightbox-close { top: -50px; right: 0; }
}

/* ---------------- 媒体项：管理员专属选择 + 删除 ---------------- */
.gallery-item, .gallery-video {
  position: relative;
}
.item-check {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 2px 4px;
  cursor: pointer;
  z-index: 2;
  display: none;
}
.gallery-item:hover .item-check,
.gallery-video:hover .item-check {
  display: block;
}
.item-pick { cursor: pointer; width: 16px; height: 16px; }
.item-del {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(220, 50, 50, 0.92);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 28px; height: 28px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.gallery-item:hover .item-del,
.gallery-video:hover .item-del {
  opacity: 1;
}
.item-del:hover { background: #c00; }

/* ---------------- 危险按钮 ---------------- */
.btn-danger {
  background: #c8283c;
  color: #fff;
  border: 1px solid #c8283c;
}
.btn-danger:hover {
  background: #a01a2c;
  border-color: #a01a2c;
}
.btn-sm {
  font-size: 13px;
  padding: 6px 14px;
}

