/* 姐姐和小狗 · 共用样式（暖粉手账风） */
:root {
  --bg: #FFF6F3;
  --dot: #F3CFD6;
  --ink: #4A2E35;
  --ink-2: #5C3D45;
  --muted: #7A5A62;
  --accent: #B33A62;
  --accent-ink: #FFFFFF;
  --pink: #FFE3EA;
  --pink-edge: #F3C2CF;
  --cream: #FFF1D6;
  --cream-edge: #F2DDB0;
  --ochre: #9A5B1E;
  --paper: #FFFFFF;
  --ph: #FBE8EC;
  --ph-edge: #E7AFBD;
  --tape-pink: #F8C9D4;
  --tape-yellow: #FBE2B8;
  --shadow: 0 4px 14px rgba(74, 46, 53, 0.08);
  --shadow-photo: 0 3px 8px rgba(74, 46, 53, 0.14);
  --display: 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --body: -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  font-family: var(--body);
  color: var(--ink);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 版面 */
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 22px 20px 48px; position: relative; }
.tape { position: absolute; height: 24px; width: 110px; opacity: 0.9; pointer-events: none; }
.tape.pink { background: var(--tape-pink); }
.tape.yellow { background: var(--tape-yellow); }
.deco-tape-tr { top: 14px; right: -16px; transform: rotate(12deg); }
.deco-tape-tl { top: 18px; left: -14px; width: 120px; transform: rotate(-14deg); }
.page-deco { position: fixed; inset: 0 0 auto 0; height: 0; pointer-events: none; z-index: 0; }

.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; position: relative; z-index: 1; }
.back {
  width: 44px; height: 44px; border-radius: 22px; background: var(--paper);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(74, 46, 53, 0.1); flex: none;
}
.title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 2px; color: var(--accent); line-height: 1.2; }
.display { font-family: var(--display); font-weight: 400; }
.muted { color: var(--muted); }

.card {
  position: relative; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}
.card > .tape { top: -10px; left: 18px; width: 70px; height: 20px; transform: rotate(-4deg); }
.card h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.3; }
.prose { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink-2); white-space: pre-line; }

.stack { display: flex; flex-direction: column; gap: 18px; }
.empty {
  padding: 28px 18px; text-align: center; color: var(--muted); font-size: 14px;
  border: 2px dashed var(--ph-edge); border-radius: 18px; background: rgba(255, 255, 255, 0.6);
}

/* 标签按钮 */
.pills { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.pill {
  min-height: 44px; border-radius: 22px; border: 2px solid var(--pink-edge); background: var(--paper);
  font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 6px; text-align: center;
}
.pill[aria-current='true'], .pill[aria-checked='true'], .pill[aria-selected='true'] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

.btn {
  min-height: 48px; padding: 0 22px; border: none; border-radius: 24px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn.ghost { background: var(--paper); color: var(--ink); border: 2px solid var(--pink-edge); }
.link-btn {
  min-height: 44px; border: none; background: none; padding: 0 4px; color: var(--accent); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 4px;
}

/* 照片 */
.ph {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--ph); overflow: hidden; border: none; padding: 0;
  display: flex; align-items: center; justify-content: center; color: #C77A90;
}
.ph img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.polaroids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; padding: 4px 2px; }
.polaroid {
  background: var(--paper); padding: 6px 6px 4px; box-shadow: var(--shadow-photo); border: none; display: block; text-align: center;
  transform: rotate(var(--r, 0deg)); transition: transform 0.15s ease;
}
.polaroid:hover { transform: rotate(0deg) scale(1.03); }
.polaroid .ph { border-radius: 0; }
.polaroid .cap { margin: 4px 0 0; min-height: 15px; font-family: var(--display); font-size: 12px; line-height: 15px; color: var(--ink-2); overflow-wrap: anywhere; }

/* 首页 */
.home { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 18px; }
.home-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.home-head h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: 2px; color: var(--accent); }
.home-head p { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: 1px; text-align: center; }
.home-main { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.cover {
  position: relative; width: 250px; padding: 12px 12px 44px; background: var(--paper); box-shadow: 0 6px 18px rgba(74, 46, 53, 0.14);
  transform: rotate(-3deg); border: none; display: block;
}
.cover .tape { top: -12px; left: 50%; width: 84px; margin-left: -42px; transform: rotate(4deg); }
.cover .ph { width: 226px; height: 226px; border-radius: 0; }
.cover .date { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; text-align: center; font-family: var(--display); font-size: 16px; }
.counter {
  display: flex; flex-direction: column; align-items: center; padding: 14px 28px; background: var(--paper);
  border-radius: 18px; box-shadow: 0 3px 10px rgba(74, 46, 53, 0.08); font-size: 13px; color: var(--muted);
}
.counter b { font-family: var(--display); font-weight: 400; font-size: 52px; line-height: 1.1; color: var(--accent); }
.nav { width: 100%; max-width: 480px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.nav a {
  min-height: 92px; padding: 14px; border-radius: 16px; display: flex; flex-direction: column; justify-content: space-between;
  font-weight: 700; font-size: 18px; transition: transform 0.15s ease;
}
.nav a:hover { transform: translateY(-2px); }
.nav .pink { background: var(--pink); box-shadow: 0 2px 0 var(--pink-edge); }
.nav .cream { background: var(--cream); box-shadow: 0 2px 0 var(--cream-edge); }
.nav .mail { grid-column: span 2; min-height: 76px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; background: var(--paper); border: 2px dashed var(--ph-edge); }
.footer-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 8px; }

@media (min-width: 860px) {
  .home-main { flex-direction: row; align-items: center; justify-content: center; gap: 56px; }
  .home-left { display: flex; flex-direction: column; align-items: center; gap: 26px; }
  .cover { width: 300px; }
  .cover .ph { width: 276px; height: 276px; }
}

/* 相册 */
.place-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.place-head h2 { display: flex; align-items: center; gap: 6px; }
.meta { font-size: 12px; color: var(--muted); }
.place-card { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; scroll-margin-top: 16px; }
.place-card .foot { display: flex; justify-content: flex-end; }
.strike { color: #9C8088; font-size: 18px; }
.stamp {
  padding: 4px 10px; border: 2px solid var(--accent); border-radius: 6px; color: var(--accent);
  font-size: 12px; font-weight: 700; transform: rotate(8deg); white-space: nowrap;
}
.intro-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
@media (min-width: 700px) {
  .thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .polaroids { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 18px; }
  .album-places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
  .place-card .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 足迹 */
.map-box { position: relative; height: 320px; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.map-box .chart { position: absolute; inset: 8px; }
.map-box .loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .pill { padding: 0 16px; font-weight: 500; font-size: 14px; }
@media (min-width: 860px) {
  .map-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; align-items: start; }
  .map-box { height: 560px; }
}

/* 时间线 */
.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 30px; position: relative; display: flex; flex-direction: column; gap: 22px; max-width: 640px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 8px; bottom: 8px; border-left: 2.5px dashed var(--ph-edge); }
.timeline li { position: relative; }
.timeline .dot { position: absolute; left: -27px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--accent); }
.timeline li:first-child .dot { width: 16px; height: 16px; left: -29px; background: var(--accent); }
.tl-card { padding: 14px 14px 14px 16px; display: flex; gap: 12px; align-items: center; }
.tl-card .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-card .when { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-card .when span:first-child { font-family: var(--display); font-size: 18px; color: var(--accent); }
.tl-card b { font-size: 16px; }
.tl-photo { flex: 0 0 76px; width: 76px; height: 76px; padding: 4px 4px 10px; background: var(--paper); box-shadow: var(--shadow-photo); transform: rotate(3deg); border: none; }
.tl-photo .ph { border-radius: 0; height: 100%; aspect-ratio: auto; }
.end-words { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; font-size: 13px; color: var(--muted); text-align: center; max-width: 640px; }

/* 清单 */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; font-size: 13px; color: var(--ink-2); }
.stat b { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.1; }
.checklist { list-style: none; margin: 6px 0 0; padding: 0; }
.checklist li { min-height: 46px; display: flex; align-items: center; gap: 12px; border-bottom: 1px dashed var(--pink-edge); padding: 6px 0; }
.checklist li:last-child { border-bottom: none; }
.checklist .t { flex: 1; font-size: 15px; overflow-wrap: anywhere; }
.list-cols { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 860px) { .list-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; } }

/* 信箱 */
.mail-layout { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.letter-paper {
  width: 100%; min-height: 140px; padding: 12px; border: 1.5px dashed var(--ph-edge); border-radius: 12px; background-color: #FFFAFB;
  background-image: repeating-linear-gradient(transparent 0, transparent 27px, #F6DCE2 27px, #F6DCE2 28px); background-attachment: local;
  line-height: 28px; font-size: 15px; resize: vertical;
}
.letter { padding: 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 3px 10px rgba(74, 46, 53, 0.08); }
.letter.dog { background: var(--pink); margin-right: 22px; }
.letter.sis { background: var(--cream); margin-left: 22px; }
.letter .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; }
.letter .who span:first-child { display: flex; align-items: center; gap: 6px; }

/* 入口 */
.lock { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 24px; position: relative; overflow: hidden; }
.lock-card {
  position: relative; width: 100%; max-width: 320px; padding: 34px 24px 26px; background: var(--paper); border-radius: 22px;
  box-shadow: 0 8px 24px rgba(74, 46, 53, 0.12); display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.lock-card > .tape { top: -12px; left: 50%; width: 90px; margin-left: -45px; transform: rotate(-3deg); }
.lock-card h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--accent); }
.lock-card p { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.lock-card form { align-self: stretch; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.field-label { font-size: 13px; font-weight: 700; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid #EBC9D1; border-radius: 12px; background: #FFFAFB; font-size: 16px;
}
textarea.input { padding: 10px 14px; line-height: 1.6; min-height: 100px; resize: vertical; }
.input.dashed { border: 2px dashed var(--ph-edge); letter-spacing: 3px; }
.err { margin: 0; font-size: 13px; color: var(--accent); min-height: 20px; }

/* 看大图 */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(46, 26, 32, 0.92); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 56px 12px 20px; touch-action: pan-y;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border: 6px solid #fff; border-bottom-width: 26px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); background: #fff; }
.lightbox .lb-cap { margin: 12px 0 0; color: #FFF1F3; font-family: var(--display); font-size: 17px; text-align: center; min-height: 26px; max-width: 600px; }
.lightbox .lb-count { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); color: #FFD9E2; font-size: 13px; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 24px; border: none; background: rgba(255,255,255,0.16); color: #fff; display: flex; align-items: center; justify-content: center; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* 小提示 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 22px; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,0.2); max-width: calc(100% - 40px); text-align: center;
}

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--pink-edge); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { min-height: 60vh; display: flex; align-items: center; justify-content: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
