/* ===================================================
   柚子日记 — 样式表
   默认字体：鸿雷小纸条青春体（猫啃网 · 免费商用）
   日记卡片：黑白涂鸦背景层（独立） + 图文内容层
   =================================================== */

:root {
  --accent:      #c08a5e;
  --accent-soft: #f5e9dc;
  --accent-deep: #8b5e3c;

  --paper:   #fdfaf4;
  --paper-2: #f7f1e6;
  --ink:     #3a3230;
  --ink-2:   #6b5f58;
  --line:    #e6dccd;

  --radius: 18px;
  --shadow: 0 4px 18px rgba(90, 70, 50, .10);
  --shadow-lg: 0 10px 34px rgba(90, 70, 50, .18);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-app);
  font-size: 16px;
  line-height: 1.75;
  overscroll-behavior-y: none;
}

/* 自定义背景层 */
.bg-overlay {
  position: fixed; inset: 0; z-index: -2;
  background-size: cover; background-position: center;
  background-repeat: no-repeat;
}
.bg-overlay.has-img::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(253, 250, 244, .78);
  backdrop-filter: blur(1px);
}

.hidden { display: none !important; }
.spacer { flex: 1; }

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, var(--accent-soft), rgba(255,255,255,0));
  backdrop-filter: blur(8px);
  padding: 14px 18px 10px;
}
.topbar-inner { display: flex; align-items: center; gap: 10px; }
.topbar h1 {
  font-size: 28px; margin: 0; font-weight: 400; letter-spacing: 3px;
  color: var(--accent-deep); flex: 1; cursor: pointer;
  transition: opacity .2s;
}
.topbar h1:active { opacity: .6; }
.icon-btn {
  border: none; background: rgba(255,255,255,.7); color: var(--accent-deep);
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 19px; cursor: pointer; box-shadow: var(--shadow);
  display: grid; place-items: center; flex-shrink: 0;
}

/* ===== 主区域 ===== */
.screen {
  padding: 4px 16px calc(var(--tabbar-h) + var(--safe-b) + 26px);
  max-width: 720px; margin: 0 auto;
}
.view { display: none; animation: fadeUp .28s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

.greeting { color: var(--ink-2); font-size: 15px; margin: 4px 2px 14px; }
.section-tip {
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 14px; padding: 10px 14px; font-size: 14px; margin: 8px 0 16px;
}

/* ===== 首页月份导航 ===== */
.home-cal-nav {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.72); border: 1px solid var(--line);
  border-radius: 14px; padding: 6px 10px; margin: 6px 0 12px;
}
.cal-nav-sm, .cal-jump-btn {
  border: none; background: transparent; color: var(--accent-deep);
  font-size: 20px; width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
}
.cal-nav-sm:active, .cal-jump-btn:active { background: var(--accent-soft); }
.home-cal-title { flex: 1; text-align: center; color: var(--ink); font-size: 17px; }
.cal-jump-btn { font-size: 17px; }
.hidden-date { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* ===================================================
   日记卡片：黑白涂鸦背景层 + 内容层
   =================================================== */
.entry-list { display: flex; flex-direction: column; gap: 20px; }

.entry-card {
  position: relative;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #2b2b2b;
  background: #fff;
  transition: transform .18s, box-shadow .18s;
}
.entry-card:active { transform: scale(.985); box-shadow: var(--shadow-lg); }

/* —— 黑白涂鸦背景层（独立于内容） —— */
.doodle-bg {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: .16;
  background-repeat: repeat;
  background-size: 190px 190px;
  filter: grayscale(1) contrast(1.15);
}
/* 卡片内容层（照片 + 文字 在一起） */
.ec-content {
  position: relative; z-index: 1;
  padding: 16px 16px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.94));
}

.ec-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ec-daynum {
  font-size: 40px; line-height: .95; color: #2b2b2b; letter-spacing: -1px;
}
.ec-datemeta { display: flex; flex-direction: column; padding-top: 4px; }
.ec-month { font-size: 13px; color: var(--ink-2); }
.ec-wd { font-size: 13px; color: var(--accent-deep); }

/* 卡片上的多个心情气泡 */
.ec-moods { margin-left: auto; display: flex; gap: -6px; align-items: center; }
.ec-moods .mood-chip { width: 38px; height: 38px; margin-left: -8px; }
.ec-moods .mood-chip:first-child { margin-left: 0; }

/* 日记正文（富文本，图文混排） */
.ec-rich {
  font-size: 15.5px; color: var(--ink); line-height: 1.85;
  max-height: 260px; overflow: hidden; position: relative;
  word-break: break-word;
}
.ec-rich img {
  max-width: 100%; height: auto; border-radius: 10px; display: block;
  margin: 8px 0; border: 2px solid #2b2b2b;
}
.ec-rich.clamped::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 54px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.96));
}
.ec-empty { color: #a99; font-style: italic; }
.ec-foot { margin-top: 10px; font-size: 12.5px; color: #a2988f; display: flex; gap: 10px; }

/* ===================================================
   心情：不规则圆形气泡（彩色填充 + 表情）
   =================================================== */
.mood-picker {
  background: rgba(255,255,255,.8); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
}
.mood-picker-title { font-size: 16px; color: var(--accent-deep); margin-bottom: 12px; }
.mp-sub { font-size: 12.5px; color: var(--ink-2); }

.mood-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px;
}
.mood-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px; border-radius: 14px; cursor: pointer;
  border: 2px solid transparent; background: transparent;
  transition: all .18s; position: relative;
}
.mood-item:active { transform: scale(.94); }
.mood-item.selected {
  border-color: var(--accent);
  background: rgba(255,255,255,.95);
  box-shadow: 0 3px 12px rgba(0,0,0,.10);
}
.mood-item.selected::after {
  content: "✓"; position: absolute; top: 2px; right: 6px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px;
  display: grid; place-items: center;
}
.mood-item .mood-chip { width: 52px; height: 52px; }
.mood-item span { font-size: 12.5px; color: var(--ink-2); }
.mood-item.selected span { color: var(--accent-deep); }

.mood-chip { display: block; }
.mood-chip svg { width: 100%; height: 100%; display: block; }

/* ===================================================
   字体选择器
   =================================================== */
.font-picker {
  background: rgba(255,255,255,.8); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.fp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fp-title { font-size: 15.5px; color: var(--accent-deep); }
.maoken-link { font-size: 12.5px; color: var(--accent); text-decoration: none; }

.font-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.font-row::-webkit-scrollbar { display: none; }
.font-chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 20px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font-size: 15px; cursor: pointer; white-space: nowrap; transition: all .18s;
}
.font-chip.active {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent-deep); box-shadow: 0 2px 8px rgba(192,138,94,.24);
}
.font-chip .fc-tag { font-size: 10px; opacity: .6; margin-left: 4px; }

.maoken-btn {
  display: block; text-align: center; text-decoration: none;
  background: linear-gradient(135deg, #ffd8a8, #ffb3c1); color: #6b3f2a;
  border-radius: 14px; padding: 11px; margin: 10px 0; font-size: 15px;
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
}
.custom-font-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cf-item {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  background: var(--paper-2); border-radius: 10px; padding: 8px 12px;
}
.cf-item button { border: none; background: transparent; color: #d9534f; cursor: pointer; font-size: 14px; }

/* ===================================================
   富文本编辑区（图文混排）
   =================================================== */
.rich-area {
  background: #fff; border: 2px solid #2b2b2b; border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px;
}
.rich-toolbar {
  display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto;
  background: var(--paper-2); border-bottom: 1.5px dashed #cfc4b4;
  scrollbar-width: none;
}
.rich-toolbar::-webkit-scrollbar { display: none; }
.rt-btn {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 10px; padding: 6px 12px;
  font-size: 14px; cursor: pointer; font-family: var(--font-app);
}
.rt-btn:active { background: var(--accent-soft); }

.entry-rich {
  min-height: 240px; padding: 16px; font-size: 16.5px; line-height: 2;
  outline: none; color: var(--ink); word-break: break-word;
  background-image: repeating-linear-gradient(180deg, transparent, transparent 31px, #eee5d6 32px);
}
.entry-rich:empty::before {
  content: attr(data-placeholder); color: #b9aea3; pointer-events: none;
}
.entry-rich img {
  max-width: 100%; height: auto; display: block; border-radius: 10px;
  border: 2px solid #2b2b2b; margin: 10px 0; cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.entry-rich img:active { opacity: .82; }
.entry-rich img[data-align="center"] { margin-left: auto; margin-right: auto; }
.entry-rich img[data-align="right"]  { margin-left: auto; margin-right: 0; }
.entry-rich img[data-align="left"]   { margin-left: 0; margin-right: auto; }
.entry-rich hr { border: none; border-top: 2px dashed #cfc4b4; margin: 14px 0; }

/* ===================================================
   编辑页通用
   =================================================== */
.editor-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.date-wrap { display: flex; align-items: center; gap: 8px; }
.date-input {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 12px; font-size: 15px; color: var(--ink); font-family: var(--font-app);
}
.entry-wd { font-size: 15px; color: var(--accent-deep); }

.text-input {
  width: 100%; border: 1.5px solid var(--line); background: #fff;
  border-radius: 12px; padding: 11px 14px; font-size: 16px;
  color: var(--ink); font-family: var(--font-app); margin-bottom: 12px;
}
.text-input:focus, .date-input:focus { outline: none; border-color: var(--accent); }

.editor-actions { display: flex; gap: 10px; align-items: center; margin: 18px 0 8px; }
.primary-btn {
  flex: 1; border: none; background: var(--accent); color: #fff;
  border-radius: 14px; padding: 13px; font-size: 17px; cursor: pointer;
  font-family: var(--font-app); box-shadow: 0 4px 14px rgba(192,138,94,.35);
}
.primary-btn:active { transform: scale(.98); }
.ghost-btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 12px; padding: 10px 16px; font-size: 15px; cursor: pointer;
  font-family: var(--font-app);
}
.ghost-btn.block { display: block; width: 100%; margin-bottom: 9px; text-align: center; }
.ghost-btn.danger { color: #d9534f; border-color: #f0c8c6; }
.ghost-btn:active { background: var(--paper-2); }

/* ===================================================
   心情日历
   =================================================== */
.cal-header { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.cal-nav {
  border: none; background: rgba(255,255,255,.8); color: var(--accent-deep);
  width: 38px; height: 38px; border-radius: 12px; font-size: 22px;
  cursor: pointer; box-shadow: var(--shadow);
}
.cal-title { flex: 1; text-align: center; font-size: 20px; color: var(--accent-deep); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 13px; color: var(--ink-2); margin-bottom: 6px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1; border-radius: 12px; background: rgba(255,255,255,.66);
  border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; position: relative; padding: 2px; overflow: hidden;
}
.cal-cell.empty { background: transparent; border: none; cursor: default; }
.cal-cell.today { border-color: var(--accent); border-width: 2px; }
.cal-cell:active:not(.empty) { background: var(--accent-soft); }
.cal-daynum { font-size: 12px; color: var(--ink-2); line-height: 1; }
.cal-cell.today .cal-daynum { color: var(--accent-deep); font-weight: bold; }
.cal-moods { display: flex; gap: -3px; justify-content: center; }
.cal-moods .mood-chip { width: 21px; height: 21px; margin-left: -5px; }
.cal-moods .mood-chip:first-child { margin-left: 0; }
.cal-dots { display: flex; gap: 2px; position: absolute; bottom: 3px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot.cd { background: var(--accent-deep); }
.cal-dot.ev { background: #e88ba6; }

.cal-legend {
  margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px;
  background: rgba(255,255,255,.7); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px;
}
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.legend-item .mood-chip { width: 26px; height: 26px; }

/* ===================================================
   倒计时 / 重要日
   =================================================== */
.cd-list, .memo-list, .trash-list { display: flex; flex-direction: column; gap: 12px; }
.cd-card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.9); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  cursor: pointer;
}
.cd-card:active { transform: scale(.99); }
.cd-icon {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
  background: var(--accent-soft); display: grid; place-items: center;
  font-size: 24px; overflow: hidden;
}
.cd-icon img { width: 100%; height: 100%; object-fit: cover; }
.cd-body { flex: 1; min-width: 0; }
.cd-name { font-size: 17px; color: var(--ink); }
.cd-meta { font-size: 12.5px; color: var(--ink-2); }
.cd-note { font-size: 13px; color: var(--ink-2); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-num { text-align: right; flex-shrink: 0; }
.cd-num b { font-size: 30px; color: var(--accent-deep); line-height: 1; }
.cd-num span { display: block; font-size: 12px; color: var(--ink-2); }
.cd-mode-tag {
  display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 8px;
  margin-right: 5px;
}
.cd-mode-tag.pos { background: #e3f3e6; color: #3f8f52; }
.cd-mode-tag.neg { background: #fde8e6; color: #c9564e; }
/* 卡片列表中的删除按钮（点击即移入回收空间） */
.cd-del, .memo-del {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.045); color: #c9564e;
  font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: background .15s, opacity .15s;
}
.cd-del { margin-left: 2px; opacity: .6; }
.memo-del { position: absolute; top: 10px; right: 10px; opacity: .55; }
.cd-del:hover, .cd-del:active, .memo-del:hover, .memo-del:active { background: rgba(201,86,78,.16); opacity: 1; }

/* ===================================================
   备忘录 / 回收站
   =================================================== */
.memo-card, .trash-card {
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  cursor: pointer;
}
.memo-card { position: relative; padding-right: 46px; }
.memo-title { font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.memo-preview { font-size: 14px; color: var(--ink-2); max-height: 66px; overflow: hidden; }
.memo-preview img { max-width: 68px; border-radius: 6px; margin: 2px; vertical-align: middle; }
.memo-date { font-size: 12px; color: #a2988f; margin-top: 6px; }

.trash-card { display: flex; align-items: center; gap: 10px; cursor: default; }
.trash-info { flex: 1; min-width: 0; }
.trash-kind {
  display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-deep); margin-right: 6px;
}
.trash-title { font-size: 15.5px; color: var(--ink); }
.trash-left { font-size: 12px; color: #c0736b; }
.trash-acts { display: flex; gap: 6px; flex-shrink: 0; }
.trash-acts button {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 6px 10px; font-size: 13px; cursor: pointer; font-family: var(--font-app);
}
.trash-acts .del { color: #d9534f; border-color: #f0c8c6; }
.trash-head-actions { display: flex; gap: 8px; margin-bottom: 12px; }

/* ===================================================
   设置
   =================================================== */
.settings-block {
  background: rgba(255,255,255,.86); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.settings-title { font-size: 17px; color: var(--accent-deep); margin-bottom: 4px; }
.settings-sub { font-size: 13.5px; color: var(--ink-2); margin: 0 0 12px; }
.muted { color: var(--ink-2); font-size: 13px; }
.muted.small { font-size: 12px; }
.muted a { color: var(--accent); }
.badge {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 12px; margin-left: 4px;
}
.color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.color-item {
  border: 2px solid transparent; border-radius: 14px; padding: 10px 6px;
  cursor: pointer; text-align: center; font-size: 13px; color: var(--ink);
}
.color-item.active { border-color: var(--ink); }
.color-dot { width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 5px; }
.custom-color {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper-2); border-radius: 12px; padding: 10px 14px; font-size: 15px;
}
.custom-color input[type=color] {
  width: 44px; height: 30px; border: none; background: transparent; cursor: pointer;
}
.about p { margin: 4px 0; }

/* ===================================================
   安装引导横幅
   =================================================== */
.install-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #ffd6ec, #ff9ecb);
  border: 1px solid #ffb3d9; border-radius: 16px;
  padding: 12px 14px; margin: 0 0 14px;
  box-shadow: 0 6px 18px rgba(255,140,190,.25);
  position: relative;
}
.install-banner[hidden] { display: none; }
.ib-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.ib-text { flex: 1; min-width: 0; }
.ib-title { font-size: 14.5px; font-weight: 700; color: #7a2e54; }
.ib-sub { font-size: 12px; color: #9b4a73; margin-top: 2px; }
.ib-steps {
  font-size: 11.5px; color: #7a2e54; margin-top: 5px; line-height: 1.5;
  background: rgba(255,255,255,.55); border-radius: 8px; padding: 5px 8px;
}
.ib-steps b { color: #d6488f; font-weight: 700; }
.ib-btn {
  flex-shrink: 0; border: none; border-radius: 12px;
  background: #fff; color: #d6488f; font-weight: 700;
  padding: 9px 16px; font-size: 14px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.ib-btn:active { transform: scale(.96); }
.ib-btn-alt {
  background: rgba(255,255,255,.35); color: #fff;
  border: 1px solid rgba(255,255,255,.7); box-shadow: none;
}
.ib-close {
  flex-shrink: 0; width: 26px; height: 26px; border: none;
  background: rgba(255,255,255,.5); border-radius: 50%;
  color: #9b4a73; font-size: 18px; line-height: 1; cursor: pointer;
}

/* ===================================================
   底部导航
   =================================================== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-around;
  max-width: 720px; margin: 0 auto;
}
.tab-item {
  border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 2px; color: var(--ink-2); flex: 1; min-width: 0;
  font-family: var(--font-app);
}
.tab-icon { font-size: 17px; line-height: 1; }
.tab-label { font-size: 10.5px; white-space: nowrap; }
.tab-item.active { color: var(--accent-deep); }
.tab-item.active .tab-icon { transform: scale(1.14); }
.tab-fab-wrap { border: none; background: transparent; padding: 0; flex: 0 0 56px; }
.fab {
  width: 50px; height: 50px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; font-size: 27px; cursor: pointer;
  box-shadow: 0 5px 16px rgba(192,138,94,.45);
  margin-top: -18px; display: grid; place-items: center;
}
.fab:active { transform: scale(.93); }

/* ===================================================
   弹窗
   =================================================== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-mask { position: absolute; inset: 0; background: rgba(50,40,35,.45); backdrop-filter: blur(2px); }
.modal-card {
  position: relative; width: 100%; max-width: 420px;
  background: var(--paper); border-radius: 22px; padding: 20px;
  box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto;
  animation: popIn .22s ease;
}
.modal-card-lg { max-width: 460px; }
.modal-card-img { max-width: 500px; padding: 16px; }
@keyframes popIn { from { opacity: 0; transform: scale(.94);} to { opacity: 1; transform: none;} }
.modal-title { font-size: 19px; color: var(--accent-deep); margin-bottom: 14px; }
.modal-textarea {
  width: 100%; min-height: 76px; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 11px 14px; font-size: 15px;
  font-family: var(--font-app); color: var(--ink); resize: vertical; margin-bottom: 12px;
}
.modal-textarea:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

.icon-upload-area { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.icon-preview {
  width: 58px; height: 58px; border-radius: 16px; background: var(--accent-soft);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
  border: 1.5px dashed var(--accent);
}
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-placeholder { font-size: 26px; }

.mode-toggle { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mode-opt {
  display: flex; align-items: center; gap: 8px; font-size: 14.5px;
  background: var(--paper-2); border-radius: 12px; padding: 9px 12px; cursor: pointer;
}
.mode-opt input { accent-color: var(--accent); }
.date-row { display: flex; gap: 10px; }
.date-field { flex: 1; min-width: 0; }
.field-label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }

/* ===================================================
   图片编辑器（裁剪 / 旋转）
   =================================================== */
.crop-stage {
  position: relative; width: 100%; background: #2b2b2b;
  border-radius: 14px; overflow: hidden; margin-bottom: 12px;
  display: grid; place-items: center; min-height: 200px; max-height: 46vh;
  touch-action: none;
}
#cropCanvas { max-width: 100%; max-height: 46vh; display: block; }
.crop-box {
  position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
  cursor: move; touch-action: none;
}
.crop-box .ch {
  position: absolute; width: 22px; height: 22px; background: #fff;
  border-radius: 50%; border: 2px solid var(--accent); touch-action: none;
}
.ch.nw { left: -11px; top: -11px; cursor: nwse-resize; }
.ch.ne { right: -11px; top: -11px; cursor: nesw-resize; }
.ch.sw { left: -11px; bottom: -11px; cursor: nesw-resize; }
.ch.se { right: -11px; bottom: -11px; cursor: nwse-resize; }
.crop-grid-line { position: absolute; background: rgba(255,255,255,.42); pointer-events: none; }
.crop-grid-line.v1 { left: 33.33%; top: 0; bottom: 0; width: 1px; }
.crop-grid-line.v2 { left: 66.66%; top: 0; bottom: 0; width: 1px; }
.crop-grid-line.h1 { top: 33.33%; left: 0; right: 0; height: 1px; }
.crop-grid-line.h2 { top: 66.66%; left: 0; right: 0; height: 1px; }

.img-tools {
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px;
  flex-wrap: wrap;
}
.tool-btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 11px; padding: 8px 12px; font-size: 14px; cursor: pointer;
  font-family: var(--font-app);
}
.tool-btn.sm { padding: 6px 11px; font-size: 13px; }
.tool-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.tool-btn:active { background: var(--accent-soft); }
.tool-label { font-size: 13px; color: var(--ink-2); flex-shrink: 0; }
.range { flex: 1; accent-color: var(--accent); min-width: 90px; }

/* ===== 空状态 / 提示 ===== */
.empty-state { text-align: center; padding: 46px 20px; color: var(--ink-2); }
.empty-doodle { width: 130px; margin: 0 auto 18px; color: var(--accent); }
.empty-doodle svg { width: 100%; height: auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 22px);
  transform: translateX(-50%); z-index: 200;
  background: rgba(50,40,35,.92); color: #fff; padding: 10px 20px;
  border-radius: 22px; font-size: 14.5px; box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px);} to { opacity: 1; transform: translate(-50%, 0);} }

/* ===== 设置：心情画风 / 照片画质 切换 ===== */
.mood-style-row { display: flex; gap: 8px; margin: 4px 0 10px; }
.mood-style-opt, .imgq-opt {
  flex: 1; padding: 10px 4px; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--line, #2b2b2b); background: #fff; color: var(--ink, #3a3230);
  font-family: inherit; font-size: 14px; line-height: 1.3;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .12s ease, background .16s ease;
}
.mood-style-opt small, .imgq-opt small { font-size: 11px; opacity: .55; }
.mood-style-opt:active, .imgq-opt:active { transform: scale(.96); }
.mood-style-opt.active, .imgq-opt.active {
  background: var(--accent-soft, #ffe3ee);
  border-color: var(--accent-deep, #c98f00);
  box-shadow: 0 2px 0 var(--accent-deep, #c98f00);
}
.mood-style-preview {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  padding: 10px; border-radius: 14px; background: rgba(255,255,255,.6);
  border: 2px dashed var(--line, #2b2b2b);
}

/* ===== 设置：开关行 ===== */
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 14px; margin-top: 8px;
  border: 2px solid var(--line, #2b2b2b); border-radius: 14px; background: #fff;
  font-size: 14.5px; cursor: pointer;
}
.switch-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent-deep, #c98f00); }

/* ===== 设置：无上限说明格 ===== */
.limit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 8px 0 12px; }
.limit-cell {
  text-align: center; padding: 10px 2px; border-radius: 13px;
  background: var(--accent-soft, #ffe3ee); border: 2px solid var(--line, #2b2b2b);
}
.limit-cell b { display: block; font-size: 21px; line-height: 1; color: var(--accent-deep, #c98f00); }
.limit-cell span { font-size: 11px; opacity: .7; }
.settings-title.small-title { font-size: 14.5px; margin-top: 12px; opacity: .85; }
