/* ============================================================
   style.css - 手账记账本主样式
   日系可爱手账风：奶油纸 + 樱花粉 + 薄荷绿
   ============================================================ */

:root {
  --cream: #FFF8E7;
  --cream-deep: #FFF1D6;
  --pink: #FFB6C1;
  --pink-deep: #FF8FA3;
  --pink-soft: #FFE4EC;
  --mint: #B5EAD7;
  --mint-deep: #9EC9B5;
  --lavender: #E8D6FF;
  --yellow: #FFE8C2;
  --ink: #5A4A42;
  --ink-soft: #8A7569;
  --exp: #E8829A;
  --inc: #6BB58C;
  --paper: #FFFBF0;
  --shadow: 0 4px 16px rgba(180, 140, 130, 0.18);
  --radius: 18px;
  --font-hand: "LXGW WenKai", "霞鹜文楷", "KaiTi", "STKaiti", "Ma Shan Zheng", cursive, sans-serif;
  --font-body: "LXGW WenKai", "霞鹜文楷", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

@import url("https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.7.0/style.css");

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

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body {
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255,182,193,0.15) 0, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(181,234,215,0.15) 0, transparent 40%);
  background-attachment: fixed;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}

/* ============ 视图 ============ */
.view {
  display: none;
  flex-direction: column;
  height: 100%;
  max-width: 540px;
  margin: 0 auto;
  position: relative;
}
.view.active { display: flex; }

/* ============ 顶栏 ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0) + 14px) 16px 12px;
  background: var(--paper);
  border-bottom: 2px dashed var(--pink);
  position: relative;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px; height: 6px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 8px, transparent 8px 16px);
  opacity: 0.3;
}
.topbar .title {
  font-family: var(--font-hand);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  text-align: center;
}
.btn-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 20px;
  background: var(--pink-soft);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.btn-icon svg, .chat-attach svg, .chat-send svg {
  width: 22px; height: 22px; color: currentColor;
}

/* ============ 书架 ============ */
.shelf-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 100px;
}
.shelf {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
  font-family: var(--font-hand);
  font-size: 16px;
}
.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--paper);
  border-radius: 14px;
  padding: 14px 10px 12px;
  box-shadow: var(--shadow);
  transition: transform 0.18s;
  border: 2px solid transparent;
}
.book-card:active { transform: scale(0.96); border-color: var(--pink); }
.book-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset -8px 0 12px rgba(0,0,0,0.08);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-spine {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,0.15), transparent);
}
.book-emoji { font-size: 42px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.book-lock {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent, #e88);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.book-lock svg { width: 13px; height: 13px; }
.lock-dot { font-size: 12px; margin-left: 4px; }
.pw-input {
  width: 100%; padding: 12px;
  border: 2px dashed var(--line, #ccc);
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
  background: var(--paper, #fffdf7);
  color: var(--ink, #333);
}
.book-meta { margin-top: 10px; text-align: center; width: 100%; }
.book-title {
  font-family: var(--font-hand);
  font-size: 16px; font-weight: 700;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.book-sub {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.book-add {
  margin: 24px auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 40px;
  background: var(--paper);
  border: 2px dashed var(--pink);
  border-radius: 14px;
  color: var(--pink-deep);
  font-family: var(--font-hand);
  box-shadow: var(--shadow);
}
.book-add .plus { font-size: 28px; }
.book-add:active { transform: scale(0.96); }

.shelf-deco {
  padding: 0 16px 20px;
  opacity: 0.7;
}

/* ============ 手账本 ============ */
.nb-topbar { background: var(--paper); }

.tabs {
  display: flex;
  background: var(--paper);
  border-bottom: 2px dashed var(--mint);
  padding: 0 8px;
}
.tab {
  flex: 1;
  padding: 12px 4px;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
  font-family: var(--font-hand);
  font-weight: 600;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.tab-icon {
  display: inline-flex; width: 16px; height: 16px; color: currentColor;
}
.tab-icon svg { width: 100%; height: 100%; }
.tab.active {
  color: var(--pink-deep);
  border-bottom-color: var(--pink);
}

.book-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 140px;
  /* 纸张背景 */
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(255,182,193,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,182,193,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}
.book-wrap.grid {
  background-image:
    linear-gradient(rgba(158,201,181,0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(158,201,181,0.25) 1px, transparent 1px);
  background-size: 18px 18px;
}

.book { min-height: 100%; }

.page[hidden] { display: none; }
.page { display: none; animation: fadeIn 0.3s; }
.page.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 日历 ============ */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  background: var(--pink-soft);
  border-radius: 14px;
  padding: 10px 16px;
  border: 2px dashed var(--pink);
}
.cal-title {
  font-family: var(--font-hand);
  font-size: 18px; font-weight: 700;
  color: var(--ink);
}
.cal-nav {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--paper);
  font-size: 22px;
  color: var(--pink-deep);
  box-shadow: var(--shadow);
}
.cal-nav:active { transform: scale(0.9); }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-family: var(--font-hand);
}
.cal-week span { padding: 4px 0; }
.cal-week span:first-child, .cal-week span:last-child { color: var(--pink-deep); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1 / 1.05;
  background: var(--paper);
  border-radius: 10px;
  padding: 4px 3px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border: 1.5px solid var(--cream-deep);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.cal-cell.empty { background: transparent; }
.cal-cell.today {
  border-color: var(--pink-deep);
  background: var(--pink-soft);
}
.cal-cell.has {
  border-color: var(--mint-deep);
  background: linear-gradient(180deg, var(--paper) 0%, rgba(181,234,215,0.15) 100%);
}
.cal-d {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-hand);
}
.cal-cell.today .cal-d { color: var(--pink-deep); }
.cal-amt {
  font-size: 10px;
  line-height: 1.2;
  font-weight: 600;
}
.cal-amt.inc { color: var(--inc); }
.cal-amt.exp { color: var(--exp); }
.cal-dots {
  font-size: 9px;
  line-height: 1;
  margin-top: 2px;
  letter-spacing: -1px;
}
.cal-dots svg { width: 12px; height: 12px; vertical-align: bottom; }

.cal-summary {
  margin-top: 14px;
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 14px;
  border: 2px dashed var(--mint);
}
.sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  font-family: var(--font-hand);
}
.sum-item { color: var(--ink-soft); }
.sum-item b { font-size: 14px; }
.sum-item b.inc { color: var(--inc); }
.sum-item b.exp { color: var(--exp); }
.sum-item b.bal { color: var(--pink-deep); }

.cal-search {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cal-search select, .cal-search input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--mint-deep);
  background: var(--paper);
  font-size: 13px;
}

.day-detail {
  margin-top: 14px;
  background: var(--pink-soft);
  border-radius: 14px;
  padding: 12px;
  border: 2px dashed var(--pink);
}
.day-head {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--pink-deep);
  margin-bottom: 8px;
  font-size: 15px;
}

/* ============ 流水 ============ */
.list-filter {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.list-filter select {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--mint-deep);
  background: var(--paper);
  font-size: 13px;
}
.entries { display: flex; flex-direction: column; gap: 8px; }
.entry-date-head {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 10px 0 4px;
  padding-left: 4px;
  position: relative;
}
.entry-date-head::before {
  content: "❀";
  margin-right: 6px;
  color: var(--pink);
}
.entry-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(180,140,130,0.1);
  border-left: 4px solid var(--mint);
  transition: transform 0.15s;
}
.entry-card:active { transform: scale(0.98); }
.entry-card.type-expense { border-left-color: var(--exp); }
.entry-card.type-income { border-left-color: var(--inc); }
.entry-card.type-save { border-left-color: var(--lavender); }
.entry-icon { font-size: 24px; display: flex; align-items: center; justify-content: center; }
.entry-icon svg { width: 24px; height: 24px; color: var(--ink-soft); }
.entry-main { flex: 1; min-width: 0; }
.entry-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.entry-sub {
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--cream-deep);
  padding: 1px 6px;
  border-radius: 6px;
}
.entry-type {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.entry-thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 4px;
  border: 2px solid var(--mint);
}
.entry-amt {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-hand);
}
.entry-amt.inc { color: var(--inc); }
.entry-amt.exp { color: var(--exp); }

/* ============ 统计 ============ */
.stats-cards {
  margin-bottom: 18px;
}
.stats-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  background: var(--pink-soft);
  border-radius: 14px;
  padding: 10px 16px;
  border: 2px dashed var(--pink);
}
.stats-month-header .cal-title {
  font-family: var(--font-hand);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stats-detail-list {
  margin-top: 18px;
}
.stats-detail-list .entry-card {
  margin-bottom: 6px;
}
.s-card {
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  border: 2px dashed transparent;
}
.s-card.inc { background: rgba(181,234,215,0.3); border-color: var(--inc); }
.s-card.exp { background: var(--pink-soft); border-color: var(--exp); }
.s-card.bal { background: var(--yellow); border-color: #E8C878; }
.s-card.save { background: var(--lavender); border-color: #C8A8E8; }
.s-label {
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--font-hand);
}
.s-num {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  font-family: var(--font-hand);
}
.stats-h {
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--ink);
  margin: 18px 0 10px;
}
.cat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 6px;
  box-shadow: 0 1px 4px rgba(180,140,130,0.08);
}
.cb-icon { font-size: 18px; display: flex; align-items: center; justify-content: center; }
.cb-icon svg { width: 18px; height: 18px; color: var(--ink-soft); }
.cb-name { font-size: 13px; width: 60px; flex-shrink: 0; }
.cb-track {
  flex: 1;
  height: 10px;
  background: var(--cream-deep);
  border-radius: 5px;
  overflow: hidden;
}
.cb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--pink-deep));
  border-radius: 5px;
  transition: width 0.4s;
}
.cb-amt {
  font-size: 13px;
  font-weight: 700;
  color: var(--exp);
  width: 70px;
  text-align: right;
  font-family: var(--font-hand);
}
.debt-sum {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: var(--paper);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}
.debt-item { font-size: 13px; color: var(--ink-soft); }
.debt-item b { font-size: 14px; }
.debt-net { font-size: 13px; color: var(--ink); font-weight: 700; margin-left: auto; }
.debt-row {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 4px;
  font-size: 13px;
  border-left: 3px solid var(--exp);
}
.btn-soft {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-size: 13px;
  font-family: var(--font-hand);
  margin: 4px 4px 0 0;
  border: 1.5px solid var(--pink);
}
.btn-soft:active { transform: scale(0.96); }

/* ============ 对话记账输入栏 ============ */
.chat-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0) + 10px);
  background: var(--paper);
  border-top: 2px dashed var(--pink);
  z-index: 30;
}
.chat-bar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -6px; height: 6px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 8px, transparent 8px 16px);
  opacity: 0.3;
}
.chat-attach, .chat-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-attach {
  background: var(--cream-deep);
  border: 1.5px solid var(--mint-deep);
}
.chat-attach.has-img {
  background: var(--mint);
  border-color: var(--inc);
}
.chat-send {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,143,163,0.4);
}
.chat-send:active { transform: scale(0.9); }
.chat-input-wrap {
  flex: 1;
  position: relative;
}
#chat-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 22px;
  border: 2px solid var(--pink);
  background: var(--cream);
  font-size: 14px;
  outline: none;
}
#chat-input:focus { border-color: var(--pink-deep); background: var(--paper); }
.chat-preview {
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  margin-bottom: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-preview .pv-label { color: var(--mint); margin-right: 4px; }

.quick-cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 4px;
  background: var(--paper);
  border-top: 1px solid var(--cream-deep);
  margin-bottom: -8px;
  scrollbar-width: none;
}
.quick-cats::-webkit-scrollbar { display: none; }
.qc-icon { display: inline-flex; width: 16px; height: 16px; }
.qc-icon svg { width: 100%; height: 100%; }
.qc-btn, .qc-cat {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 3px;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--cream-deep);
  font-size: 12px;
  color: var(--ink);
  font-family: var(--font-hand);
  border: 1px solid transparent;
}
.qc-btn { background: var(--pink-soft); color: var(--pink-deep); }
.qc-cat:active { background: var(--mint); }

/* ============ 弹层 ============ */
.modal-mask[hidden] { display: none; }
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(90,74,66,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--paper);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  border: 3px solid var(--pink);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 2px dashed var(--pink);
  background: var(--pink-soft);
}
.modal-title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 17px;
  color: var(--pink-deep);
}
.modal-body {
  padding: 16px;
  overflow-y: auto;
}

/* 表单 */
.field {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: var(--font-hand);
}
.field input, .field select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--mint-deep);
  background: var(--cream);
  font-size: 15px;
  color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--pink); outline: none; }
.hint { font-size: 11px; color: var(--ink-soft); margin: 6px 0 0; }

.btn-primary {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-hand);
  box-shadow: 0 4px 12px rgba(255,143,163,0.4);
}
.btn-primary:active { transform: scale(0.97); }
.btn-danger {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  border-radius: 20px;
  background: #FFF0F0;
  color: #D84848;
  border: 1.5px solid #D84848;
  font-size: 14px;
  font-family: var(--font-hand);
}
.btn-danger:active { transform: scale(0.97); }

.color-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.color-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: var(--shadow);
}
.color-dot.sel { border-color: var(--ink); transform: scale(1.1); }
.cover-prev {
  max-width: 100%;
  max-height: 160px;
  border-radius: 10px;
  margin: 8px 0;
  border: 2px solid var(--pink);
}
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.icon-dot {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--cream);
  font-size: 20px;
  border: 2px solid transparent;
}
.icon-dot.sel { border-color: var(--pink); background: var(--pink-soft); }

/* 类别管理 */
.cat-manage .cm-h {
  font-family: var(--font-hand);
  font-size: 15px;
  margin: 12px 0 8px;
  color: var(--ink);
}
.cm-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream);
  border-radius: 12px;
  padding: 8px 12px;
}
.cm-icon { font-size: 20px; }
.cm-name { flex: 1; font-size: 14px; font-family: var(--font-hand); }
.cm-edit, .cm-del {
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.cm-edit svg, .cm-del svg { width: 16px; height: 16px; }
.cm-edit { background: var(--mint); }
.cm-del { background: #FFE0E0; color: #D84848; }

/* 记录详情 */
.entry-detail {
  background: var(--cream);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.ed-row {
  font-size: 14px;
  margin: 6px 0;
  color: var(--ink);
  font-family: var(--font-hand);
}
.ed-row b { color: var(--pink-deep); font-size: 16px; }
.ed-img {
  max-width: 100%;
  border-radius: 10px;
  margin-top: 8px;
  border: 2px solid var(--pink);
}

/* About */
.about h2, .about h3 {
  font-family: var(--font-hand);
  color: var(--pink-deep);
  margin: 8px 0;
}
.about ul { padding-left: 20px; }
.about li { margin: 6px 0; font-size: 14px; }
.about p { font-size: 14px; line-height: 1.6; }

/* Toast */
.toast[hidden] { display: none; }
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font-hand);
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toastIn 0.25s;
  max-width: 80%;
  text-align: center;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--pink); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

.icon-dot { display: flex; align-items: center; justify-content: center; }
.icon-dot svg { width: 22px; height: 22px; color: var(--ink); }
.icon-dot.sel svg { color: var(--pink-deep); }
.qc-cat .qc-icon, .qc-cat .qc-icon svg { display: inline-flex; }
.qc-cat .qc-icon svg { width: 16px; height: 16px; }
.cm-icon svg { width: 20px; height: 20px; }
.cm-icon { display: flex; align-items: center; justify-content: center; }

/* ========== 安装到桌面引导 ========== */
.install-tip {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 900;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.98);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  animation: installSlideUp .35s ease;
}
@keyframes installSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.install-card {
  display: flex; align-items: center; gap: 12px;
  max-width: 520px; margin: 0 auto;
}
.install-icon { font-size: 28px; flex-shrink: 0; }
.install-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.install-text b { font-size: 15px; color: var(--ink); }
.install-text span { font-size: 12px; color: #888; }
.install-card .btn-primary { padding: 8px 18px; font-size: 14px; flex-shrink: 0; }
.install-close {
  background: none; border: none;
  font-size: 16px; color: #aaa;
  padding: 4px; flex-shrink: 0;
}
.install-close:active { color: #666; }

/* ========== 安装指引弹窗 ========== */
.guide-box p { margin: 10px 0; font-size: 14px; color: var(--ink); line-height: 1.6; }
.guide-box b { color: var(--pink-deep, #e88); }
.guide-icon {
  display: inline-block; padding: 0 6px;
  background: #FFF0F3; border-radius: 6px;
  font-size: 16px;
}

/* ========== 封面颜色选择 ========== */
.color-pick { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 0; }
.color-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .15s;
}
.color-dot.sel { border-color: var(--ink, #333); transform: scale(1.1); }

/* ========== 日历备注/计划 ========== */
.cal-note-mark { font-size: 11px; line-height: 1; margin-top: 2px; }
.cal-cell.has-note { box-shadow: inset 0 0 0 2px #FFD6E0; }
.day-note-box {
  margin: 10px 0;
  padding: 10px 12px;
  background: #FFF8E7;
  border: 1px dashed #E8C97A;
  border-radius: 10px;
}
.day-note-text {
  font-size: 14px; color: var(--ink, #333);
  line-height: 1.6; white-space: pre-wrap; word-break: break-all;
  margin-bottom: 8px;
}
.day-note-btn { font-size: 13px; padding: 6px 14px; margin-right: 8px; }
.dn-textarea {
  width: 100%; min-height: 100px;
  padding: 12px;
  border: 2px dashed var(--line, #ccc);
  border-radius: 10px;
  font-size: 15px; line-height: 1.6;
  background: var(--paper, #fffdf7);
  color: var(--ink, #333);
  resize: vertical;
  font-family: var(--font-hand, inherit);
}
