:root {
  --paper: #f9f0df;
  --paper-deep: #f2e2c5;
  --ink: #2f241d;
  --brown: #74503b;
  --red: #b74934;
  --jade: #466c61;
  --gold: #d6a74d;
  --peach: #f0b48a;
  --cream: rgba(255, 252, 246, 0.82);
  --line: rgba(74, 52, 42, 0.14);
  --shadow: 0 26px 60px rgba(89, 61, 41, 0.16);
  --shadow-sm: 0 8px 24px rgba(89, 61, 41, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(240, 180, 138, 0.5), transparent 34%),
    radial-gradient(circle at top right, rgba(214, 167, 77, 0.34), transparent 24%),
    radial-gradient(circle at bottom center, rgba(70, 108, 97, 0.18), transparent 26%),
    linear-gradient(180deg, #f8edd8 0%, #f4e5c6 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(116, 80, 59, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116, 80, 59, 0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  opacity: 0.45;
}

#app {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 20px 88px;
}

.journal {
  display: grid;
  gap: 26px;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
}

.paper,
.panel,
.sidebar-card,
.day-card,
.tip-card,
.food-card,
.source-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(249, 241, 226, 0.96));
  border: 1px solid rgba(125, 93, 70, 0.12);
  border-radius: 28px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease;
}

.day-card:hover,
.food-card:hover,
.tip-card:hover {
  box-shadow: 0 32px 72px rgba(89, 61, 41, 0.22);
}

.paper::before,
.panel::before,
.sidebar-card::before,
.day-card::before,
.tip-card::before,
.food-card::before,
.source-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 32px;
  width: 86px;
  height: 26px;
  background: rgba(215, 197, 174, 0.6);
  border: 1px solid rgba(131, 106, 86, 0.14);
  border-radius: 8px;
  transform: rotate(-4deg);
}

.hero-note {
  padding: 34px 34px 30px;
  overflow: hidden;
}

.hero-note::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -42px;
  width: 190px;
  height: 190px;
  background: radial-gradient(circle, rgba(183, 73, 52, 0.16), transparent 68%);
  border-radius: 50%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(183, 73, 52, 0.1);
  color: var(--red);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.hero-title {
  margin: 18px 0 14px;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 1.02;
  color: #7b3425;
}

.hero-copy {
  margin: 0 0 26px;
  max-width: 640px;
  font-size: 1.02rem;
  line-height: 1.9;
  color: rgba(47, 36, 29, 0.84);
}

/* ─── Metrics (2×2 grid) ─────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: rgba(255, 248, 239, 0.85);
  border: 1px dashed rgba(116, 80, 59, 0.24);
  transition: background 0.2s;
}

.metric:hover {
  background: rgba(255, 244, 230, 0.95);
}

.metric-value {
  display: block;
  font-family: "Outfit", sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
}

[data-metric="spending"] .metric-value  { color: var(--red); }
[data-metric="remaining"] .metric-value { color: var(--jade); }

.metric-label {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
  color: rgba(47, 36, 29, 0.65);
}

/* ─── Hero Side ──────────────────────────────────────────── */
.hero-side {
  display: grid;
  gap: 18px;
}

.postcard {
  padding: 26px;
  background:
    linear-gradient(145deg, rgba(183, 73, 52, 0.94), rgba(122, 48, 31, 0.96)),
    #8a3d2d;
  color: #fffaf4;
  overflow: hidden;
}

.postcard::before {
  background: rgba(255, 237, 217, 0.22);
}

.stamp {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 243, 229, 0.36);
  font-family: "Outfit", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.postcard h2 {
  margin: 18px 0 10px;
  font-size: 1.9rem;
}

.postcard p {
  margin: 0;
  line-height: 1.8;
  color: rgba(255, 250, 244, 0.86);
}

.mini-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 247, 238, 0.22);
}

.postcard-extra-list {
  margin-top: 0;
}

.mini-list-sep {
  pointer-events: none;
  justify-content: flex-start !important;
}

.mini-list-sep span {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: rgba(255, 250, 244, 0.48);
  text-transform: uppercase;
  padding-top: 4px;
}

.sidebar-card {
  padding: 22px 24px;
}

.sidebar-card h3,
.panel h3,
.day-card h3,
.food-card h3,
.tip-card h3,
.source-card h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.checklist li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  line-height: 1.7;
  color: rgba(47, 36, 29, 0.8);
}

.checklist li::before {
  content: "•";
  color: var(--gold);
  font-size: 1.2rem;
  line-height: 1.2;
}

/* ─── Budget / Ledger ────────────────────────────────────── */
.ledger-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 22px;
}

.panel {
  padding: 28px;
}

.ledger {
  display: grid;
  gap: 10px;
}

.ledger-row {
  display: grid;
  grid-template-columns: 128px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.ledger-row:last-child {
  border-bottom: 0;
}

.ledger-date {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  color: var(--red);
}

.ledger-note {
  color: rgba(47, 36, 29, 0.78);
}

.ledger-price {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
}

/* ─── Budget Summary Box ─────────────────────────────────── */
.total-box {
  padding: 28px;
  background:
    linear-gradient(160deg, rgba(70, 108, 97, 0.92), rgba(52, 84, 77, 0.94)),
    var(--jade);
  color: #fbf8f1;
}

.total-box::before {
  background: rgba(255, 248, 233, 0.2);
}

.total-box h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  color: rgba(251, 248, 241, 0.75);
  letter-spacing: 0.04em;
}

.budget-stat-row {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.bstat-main {
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 248, 233, 0.22);
}

.budget-stat-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bstat-label {
  display: block;
  font-size: 0.82rem;
  color: rgba(251, 248, 241, 0.6);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

.bstat-value {
  display: block;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
}

.bstat-main .bstat-value,
.total-amount {
  font-size: 2.4rem;
}

.remain-amount {
  color: #a8e8d5;
}

.budget-note {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.7;
  color: rgba(251, 248, 241, 0.6);
}

/* ─── Section Title ──────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 0 4px;
}

.section-title-text {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-deco {
  display: inline-block;
  width: 4px;
  height: 28px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--red));
  flex-shrink: 0;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.section-title p {
  margin: 0;
  max-width: 520px;
  line-height: 1.8;
  color: rgba(47, 36, 29, 0.72);
}

/* ─── Day Cards ──────────────────────────────────────────── */
.days {
  display: grid;
  gap: 18px;
}

.day-card {
  padding: 24px;
  overflow: visible;
}

.day-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}

.day-badge {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(214, 167, 77, 0.24), rgba(183, 73, 52, 0.16));
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  color: var(--red);
}

.day-badge span {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-badge strong {
  font-size: 1.56rem;
}

.day-meta h3 {
  margin: 0 0 6px;
}

.day-meta p {
  margin: 0;
  line-height: 1.7;
  color: rgba(47, 36, 29, 0.76);
}

.day-cost {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(70, 108, 97, 0.1);
  color: var(--jade);
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

.route-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 18px;
}

.route-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(183, 73, 52, 0.08);
  color: #8c402d;
  font-size: 0.92rem;
}

/* ─── Timeline ───────────────────────────────────────────── */
.timeline {
  display: grid;
  gap: 12px;
}

.slot {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}

.slot:last-child {
  border-bottom: 0;
}

.slot-time {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  color: var(--brown);
}

.slot-body strong {
  display: block;
  margin-bottom: 4px;
}

.slot-body p {
  margin: 0;
  line-height: 1.72;
  color: rgba(47, 36, 29, 0.76);
}

/* User-added slots */
.user-slot {
  grid-template-columns: 104px 1fr auto;
  border-bottom: none;
  background: rgba(214, 167, 77, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px dashed rgba(214, 167, 77, 0.3);
  align-items: center;
}

/* ─── Note Pill ──────────────────────────────────────────── */
.note-pill {
  margin-top: 18px;
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(214, 167, 77, 0.14);
  color: #8f6523;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Collapsible Add Forms ──────────────────────────────── */
.add-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.add-toggle {
  background: none;
  border: 1px dashed rgba(116, 80, 59, 0.28);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: "Noto Serif SC", serif;
  font-size: 0.9rem;
  color: var(--brown);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.add-toggle:hover {
  background: rgba(116, 80, 59, 0.06);
  border-color: rgba(116, 80, 59, 0.48);
}

.add-form {
  display: none;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
  padding: 18px;
  background: rgba(255, 248, 239, 0.75);
  border-radius: 18px;
  border: 1px dashed rgba(116, 80, 59, 0.16);
  animation: fadeSlideIn 0.22s ease;
}

.add-form.open {
  display: grid;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(116, 80, 59, 0.2);
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.9);
  font-family: "Noto Serif SC", serif;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(116, 80, 59, 0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 76px;
  grid-column: 1 / -1;
}

.form-btn {
  justify-self: start;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--brown), var(--red));
  color: #fffaf4;
  border: none;
  border-radius: 999px;
  font-family: "Noto Serif SC", serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(183, 73, 52, 0.24);
}

.form-btn:hover  { opacity: 0.88; }
.form-btn:active { transform: scale(0.97); }

/* ─── Remove Button ──────────────────────────────────────── */
.remove-item-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(183, 73, 52, 0.1);
  color: var(--red);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.2s;
}

.remove-item-btn:hover {
  background: rgba(183, 73, 52, 0.22);
}

/* ─── Expense Section ────────────────────────────────────── */
.expense-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.expense-header {
  margin-bottom: 10px;
}

.expense-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brown);
}

.expense-list {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.expense-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(70, 108, 97, 0.05);
  border: 1px dashed rgba(70, 108, 97, 0.18);
}

.expense-desc {
  flex: 1;
  font-size: 0.9rem;
  color: rgba(47, 36, 29, 0.78);
}

.expense-amt {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  color: var(--jade);
  font-size: 0.95rem;
  white-space: nowrap;
}

/* ─── Photo Section ──────────────────────────────────────── */
.photo-section {
  margin-top: 18px;
  padding-top: 18px;
  padding-bottom: 4px;
  border-top: 1px dashed var(--line);
}

.food-photo-area {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.photo-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.photo-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brown);
  flex: 1;
}

.photo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(70, 108, 97, 0.1);
  color: var(--jade);
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px dashed rgba(70, 108, 97, 0.3);
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.photo-upload-btn:hover {
  background: rgba(70, 108, 97, 0.18);
  border-color: rgba(70, 108, 97, 0.5);
}

.photo-upload-sm {
  font-size: 0.8rem;
  padding: 5px 12px;
}

/* ─── Photo Grid — polaroid 手账风 ──────────────────────── */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 2px 14px;
}

.photo-item {
  position: relative;
  background: #fff;
  padding: 8px 8px 26px;
  box-shadow:
    0 6px 20px rgba(89, 61, 41, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.08);
  border-radius: 1px;
  width: 150px;
  flex-shrink: 0;
  transform: rotate(-2.2deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  cursor: pointer;
  z-index: 1;
}

/* 随机旋转角度——让照片像随手贴上去的 */
.photo-item:nth-child(2n) { transform: rotate(1.8deg); }
.photo-item:nth-child(3n) { transform: rotate(-0.5deg); }
.photo-item:nth-child(4n) { transform: rotate(2.6deg); }
.photo-item:nth-child(5n) { transform: rotate(-1.6deg); }
.photo-item:nth-child(6n) { transform: rotate(0.8deg); }
.photo-item:nth-child(7n) { transform: rotate(-3deg); }

.photo-item:hover {
  transform: rotate(0deg) scale(1.07) !important;
  box-shadow: 0 16px 40px rgba(89, 61, 41, 0.3);
  z-index: 30;
}

/* 顶部胶带装饰 */
.photo-item::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 44px;
  height: 18px;
  background: rgba(214, 197, 168, 0.55);
  border: 1px solid rgba(180, 160, 130, 0.25);
  border-radius: 2px;
  z-index: 4;
  pointer-events: none;
}

.photo-item:nth-child(even)::before {
  transform: translateX(-50%) rotate(2deg);
  background: rgba(183, 208, 198, 0.45);
}

.photo-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 0.82rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
}

.photo-item:hover .photo-remove {
  opacity: 1;
}

/* 移动端：删除按钮始终可见，触控目标更大 */
@media (hover: none) {
  .photo-remove {
    opacity: 1;
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.6);
  }
}

/* 表单预览区（偏小，避免撑开表单） */
#ci-photo-preview.photo-grid { gap: 12px; padding: 8px 2px 10px; }
#ci-photo-preview .photo-item { width: 96px; padding: 5px 5px 16px; }
#ci-photo-preview .photo-item::before { display: none; }

/* 打卡记录里的小拍立得 */
.checkin-photos.photo-grid  { gap: 12px; padding: 6px 0 8px; }
.checkin-photos .photo-item { width: 100px; padding: 5px 5px 18px; }
.checkin-photos .photo-item::before { top: -8px; width: 34px; height: 14px; }

/* 美食卡里稍小一号 */
.food-photo-area .photo-grid  { gap: 14px; }
.food-photo-area .photo-item  { width: 124px; padding: 7px 7px 22px; }

/* ─── Lightbox ───────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  cursor: default;
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: white;
  color: #333;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.lightbox-close:hover {
  transform: scale(1.12);
}

/* ─── Food Cards ─────────────────────────────────────────── */
.guide-grid,
.tips-grid,
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.food-card,
.tip-card,
.source-card {
  padding: 24px;
}

.food-card p,
.tip-card p,
.source-card p {
  margin: 0;
  line-height: 1.8;
  color: rgba(47, 36, 29, 0.76);
}

.food-meta,
.tip-meta {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(70, 108, 97, 0.1);
  color: var(--jade);
  font-size: 0.88rem;
}

.tip-meta.warn {
  background: rgba(183, 73, 52, 0.08);
  color: var(--red);
}

/* ─── Food Checkin Section ───────────────────────────────── */
.food-checkin-section {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(249, 241, 226, 0.96));
  border: 1px solid rgba(125, 93, 70, 0.12);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.food-checkin-section::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 32px;
  width: 86px;
  height: 26px;
  background: rgba(215, 197, 174, 0.6);
  border: 1px solid rgba(131, 106, 86, 0.14);
  border-radius: 8px;
  transform: rotate(-4deg);
}

.checkin-section-header {
  margin-bottom: 18px;
}

.checkin-section-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.checkin-section-sub {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(47, 36, 29, 0.6);
}

.checkin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.checkin-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(47, 36, 29, 0.5);
  border: 1px dashed rgba(116, 80, 59, 0.18);
  border-radius: 16px;
}

.checkin-card {
  padding: 16px;
  background: rgba(255, 248, 239, 0.85);
  border-radius: 18px;
  border: 1px solid rgba(116, 80, 59, 0.12);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.checkin-card:hover {
  box-shadow: 0 12px 32px rgba(89, 61, 41, 0.14);
}

.checkin-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding-right: 10px;
  position: relative;
}

.checkin-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
}

.checkin-area-tag {
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(70, 108, 97, 0.1);
  color: var(--jade);
  align-self: center;
}

.checkin-remove {
  margin-left: auto;
  flex-shrink: 0;
  position: static;
  transform: none;
}

.checkin-note-text {
  font-size: 0.88rem;
  color: rgba(47, 36, 29, 0.7);
  line-height: 1.7;
  margin: 0 0 10px;
}

.checkin-photos {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

.checkin-add-section {
  border-top: 1px dashed var(--line);
  padding-top: 16px;
  margin-top: 4px;
}

/* ─── Source List ────────────────────────────────────────── */
.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.source-list a {
  color: var(--red);
  text-decoration: none;
}

.source-list a:hover {
  text-decoration: underline;
}

/* ─── Toolbar ────────────────────────────────────────────── */
.journal-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 0 14px;
}

.save-status {
  margin-right: auto;
  font-size: 0.82rem;
  color: var(--jade);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.save-status.visible {
  opacity: 1;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid rgba(116, 80, 59, 0.2);
  font-family: "Noto Serif SC", serif;
  font-size: 0.82rem;
  color: var(--brown);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.toolbar-btn:hover {
  background: rgba(255, 248, 236, 1);
  border-color: rgba(116, 80, 59, 0.4);
}

/* ─── Extra day cost badge ───────────────────────────────── */
.extra-cost {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red);
  background: rgba(183, 73, 52, 0.1);
  padding: 2px 7px;
  border-radius: 6px;
}

/* ─── Home Page ──────────────────────────────────────────── */
.home-journal {
  display: grid;
  gap: 32px;
}

.home-header {
  position: relative;
  padding: 40px 36px 36px;
  background:
    linear-gradient(145deg, rgba(183, 73, 52, 0.93), rgba(110, 38, 22, 0.96));
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  color: #fffaf4;
}

.home-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.home-header::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 220, 180, 0.15), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

.home-brand {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 243, 229, 0.28);
  font-family: "Outfit", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: rgba(255, 250, 244, 0.75);
  margin-bottom: 18px;
}

.home-title {
  margin: 0 0 14px;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 1.1;
  color: #fff8f0;
}

.home-tagline {
  margin: 0;
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 250, 244, 0.72);
}

.home-stamp {
  position: absolute;
  top: 28px;
  right: 32px;
  z-index: 1;
  padding: 10px 16px;
  border: 2px solid rgba(255, 243, 229, 0.3);
  border-radius: 10px;
  font-family: "Outfit", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 250, 244, 0.5);
  transform: rotate(6deg);
}

/* ─── Trips Section ──────────────────────────────────────── */
.trips-section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.trips-section-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.trips-count {
  font-size: 0.85rem;
  color: rgba(47, 36, 29, 0.5);
}

.trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* ─── Trip Card ──────────────────────────────────────────── */
.trip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
  background: linear-gradient(160deg, rgba(255, 252, 246, 0.97), rgba(249, 241, 226, 0.97));
  border: 1px solid rgba(125, 93, 70, 0.14);
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  cursor: pointer;
  overflow: hidden;
}

.trip-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 28px;
  width: 72px;
  height: 22px;
  background: rgba(215, 197, 174, 0.6);
  border: 1px solid rgba(131, 106, 86, 0.14);
  border-radius: 8px;
  transform: rotate(-3deg);
}

.trip-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 0 32px 72px rgba(89, 61, 41, 0.22);
}

.trip-card-city {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 2.8rem;
  line-height: 1;
  color: #7b3425;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.trip-card-dates {
  font-family: "Outfit", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown);
  letter-spacing: 0.04em;
}

.trip-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex: 1;
}

.trip-card-tags span {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(183, 73, 52, 0.08);
  color: #8c402d;
  font-size: 0.82rem;
}

.trip-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.trip-card-info {
  font-size: 0.82rem;
  color: rgba(47, 36, 29, 0.55);
}

.trip-status-badge {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(70, 108, 97, 0.12);
  color: var(--jade);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── New Trip Card ──────────────────────────────────────── */
.trip-card-new {
  align-items: center;
  justify-content: center;
  background: rgba(255, 252, 246, 0.5);
  border: 2px dashed rgba(116, 80, 59, 0.22);
  box-shadow: none;
  min-height: 180px;
  color: rgba(47, 36, 29, 0.4);
}

.trip-card-new::before { display: none; }

.trip-card-new:hover {
  background: rgba(255, 248, 236, 0.8);
  border-color: rgba(116, 80, 59, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.trip-new-icon {
  font-size: 2rem;
  line-height: 1;
  color: rgba(116, 80, 59, 0.35);
  margin-bottom: 8px;
}

.trip-card-new p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(47, 36, 29, 0.45);
}

/* ─── Home Toolbar: hide home btn on home page ───────────── */
.toolbar-home-btn {
  text-decoration: none;
  flex-shrink: 0;
}

.home-footer {
  text-align: center;
  padding: 8px 0 4px;
  color: rgba(47, 36, 29, 0.55);
  font-size: 0.92rem;
}

@media (max-width: 720px) {
  .home-header {
    padding: 28px 20px 26px;
  }
  .home-stamp {
    display: none;
  }
  .trips-grid {
    grid-template-columns: 1fr;
  }
  .trip-card-city {
    font-size: 2.4rem;
  }
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding-top: 4px;
  color: rgba(47, 36, 29, 0.6);
  font-size: 0.92rem;
}

/* ─── Loading Screen ─────────────────────────────────────── */
.loading-screen {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: rgba(47, 36, 29, 0.55);
  font-size: 0.95rem;
}

.loading-dot {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(183, 73, 52, 0.2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Update Banner ──────────────────────────────────────── */
.update-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(70, 108, 97, 0.96), rgba(52, 84, 77, 0.98));
  color: #fbf8f1;
  border-radius: 999px;
  font-size: 0.88rem;
  box-shadow: 0 8px 28px rgba(52, 84, 77, 0.35);
  white-space: nowrap;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.update-banner button {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 233, 0.35);
  background: transparent;
  color: #fbf8f1;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}

.update-banner button:first-of-type {
  background: rgba(255, 248, 233, 0.18);
}

.update-banner button:hover {
  background: rgba(255, 248, 233, 0.28);
}

/* ─── Day Navigation (sticky) ───────────────────────────── */
.day-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(248, 237, 216, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(116, 80, 59, 0.1);
  border-radius: 22px;
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(89, 61, 41, 0.1);
}

.day-nav::-webkit-scrollbar {
  display: none;
}

.day-nav-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: 14px;
  background: rgba(255, 248, 239, 0.85);
  border: 1px solid rgba(116, 80, 59, 0.16);
  font-family: "Noto Serif SC", serif;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.22s ease;
  flex-shrink: 0;
  min-width: 58px;
  min-height: 52px;
  justify-content: center;
}

.nav-date {
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.nav-label {
  font-size: 0.72rem;
  color: var(--brown);
  line-height: 1.2;
}

.day-nav-item:hover {
  background: rgba(183, 73, 52, 0.07);
  border-color: rgba(183, 73, 52, 0.28);
}

.day-nav-item.active {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 4px 16px rgba(183, 73, 52, 0.32);
}

.day-nav-item.active .nav-date,
.day-nav-item.active .nav-label {
  color: #fff;
}

/* ─── Expense Category Tag ───────────────────────────────── */
.expense-cat-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(214, 167, 77, 0.18);
  color: #8f6523;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Small Form Button ──────────────────────────────────── */
.form-btn-sm {
  padding: 8px 14px;
  background: rgba(116, 80, 59, 0.08);
  color: var(--brown);
  border: 1px dashed rgba(116, 80, 59, 0.3);
  border-radius: 999px;
  font-family: "Noto Serif SC", serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.form-btn-sm:hover {
  background: rgba(116, 80, 59, 0.16);
  border-color: rgba(116, 80, 59, 0.5);
}

/* ─── Category form row (keep 2-col on mobile) ───────────── */
.form-row-cat {
  grid-template-columns: 1fr auto !important;
  align-items: center;
}

/* ─── New Category Inline Row ────────────────────────────── */
.new-cat-row {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.new-cat-row.visible {
  display: grid;
}

/* ─── Extra Ledger Section ───────────────────────────────── */
.ledger-extra-header {
  margin: 18px 0 10px;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
  font-weight: 700;
  color: var(--brown);
  font-size: 0.95rem;
}

.ledger-cat-section {
  margin-bottom: 10px;
}

.ledger-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(214, 167, 77, 0.1);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 4px;
}

.ledger-cat-total {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  color: var(--red);
}

.ledger-extra-row {
  padding-left: 10px;
}
.ledger-extra-row .ledger-date {
  font-size: 0.82rem;
  color: var(--brown);
  font-weight: 400;
}

/* ─── Category Totals in Budget Summary ──────────────────── */
.cat-totals-header {
  margin: 14px 0 8px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 248, 233, 0.22);
  font-size: 0.82rem;
  color: rgba(251, 248, 241, 0.6);
  letter-spacing: 0.03em;
}

.cat-totals-grid {
  display: grid;
  gap: 4px;
}

.cat-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px dashed rgba(255, 248, 233, 0.14);
}
.cat-total-row:last-child {
  border-bottom: none;
}

.cat-total-label {
  font-size: 0.88rem;
  color: rgba(251, 248, 241, 0.78);
}

.cat-total-value {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #a8e8d5;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero,
  .ledger-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #app {
    padding: 16px 12px 88px;
  }

  .journal {
    gap: 16px;
  }

  /* ── Cards ── */
  .hero-note,
  .postcard,
  .sidebar-card,
  .panel,
  .day-card,
  .food-card,
  .tip-card,
  .source-card,
  .total-box,
  .food-checkin-section {
    padding: 18px 16px;
  }

  /* ── Section title ── */
  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .section-title p {
    font-size: 0.88rem;
  }

  /* ── Day nav ── */
  .day-nav {
    border-radius: 16px;
    padding: 8px 12px;
    gap: 6px;
  }

  .day-nav-item {
    padding: 7px 12px;
    min-height: 48px;
    min-width: 52px;
  }

  /* ── Day header: badge 和标题并排，费用另起一行 ── */
  .day-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 10px 12px;
    align-items: start;
  }

  .day-badge {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    grid-row: 1;
    grid-column: 1;
  }

  .day-badge strong {
    font-size: 1.25rem;
  }

  .day-meta {
    grid-row: 1;
    grid-column: 2;
  }

  .day-meta h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
  }

  .day-meta p {
    font-size: 0.88rem;
  }

  .day-cost {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: start;
    font-size: 0.88rem;
  }

  /* ── Route tags ── */
  .route-tags span {
    font-size: 0.82rem;
    padding: 6px 10px;
  }

  /* ── Timeline ── */
  .slot {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 0;
  }

  .slot-time {
    font-size: 0.85rem;
    color: var(--red);
  }

  .user-slot {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .user-slot .slot-time,
  .user-slot .slot-body {
    grid-column: 1;
  }

  /* ── Ledger ── */
  .ledger-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ledger-date {
    font-size: 0.88rem;
  }

  /* ── Budget box ── */
  .budget-stat-secondary {
    grid-template-columns: 1fr 1fr;
  }

  /* ── Forms: 更大的触控目标 ── */
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-input {
    font-size: 1rem;
    padding: 12px 14px;
  }

  .form-textarea {
    min-height: 88px;
  }

  .form-btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 1rem;
  }

  .add-toggle {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.92rem;
    width: 100%;
    justify-content: center;
  }

  .photo-upload-btn {
    min-height: 40px;
    padding: 10px 18px;
    font-size: 0.88rem;
  }

  .toolbar-btn {
    min-height: 40px;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  /* ── Note pill ── */
  .note-pill {
    font-size: 0.86rem;
    padding: 10px 14px;
  }

  /* ── Photos: 移动端稍小 ── */
  .photo-item                   { width: 128px; padding: 7px 7px 22px; }
  .food-photo-area .photo-item  { width: 112px; padding: 6px 6px 18px; }
  .checkin-photos  .photo-item  { width: 88px;  padding: 5px 5px 14px; }
}

@media (max-width: 400px) {
  .photo-item                   { width: 108px; padding: 6px 6px 20px; }
  .food-photo-area .photo-item  { width: 96px; }
  .hero-title                   { font-size: 2.6rem; }
}
