/* 我们的小日子 */
:root {
  --paper: #FFFFFF;
  --ground: #F6F5F2;
  --well: #ECEAE5;
  --line: #E6E3DC;
  --ink: #1A1A1A;
  --ink-2: #47463F;
  --muted: #6B6A64;
  --rose: #B23A48;
  --rose-ink: #8E2A37;
  --rose-soft: #F9E8EA;
  --num: "Didot", "Bodoni 72", "Bodoni MT", Georgia, "Times New Roman", serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --col: 680px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; padding-top: var(--safe-t); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

.btn { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid #D6D3CA; background: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; white-space: nowrap; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 500; }
.btn.rose { background: var(--rose); border-color: var(--rose); color: #fff; font-weight: 500; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 17px; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lab { font-size: 14px; color: var(--ink-2); }
.input { min-height: 48px; padding: 10px 14px; border: 1px solid #D6D3CA; border-radius: 10px; background: var(--paper); font-size: 16px; width: 100%; }
.input:focus { outline: none; border-color: var(--ink); }
textarea.input { resize: none; line-height: 1.75; }
.err { color: var(--rose-ink); font-size: 14px; min-height: 1em; }
.hint { color: var(--muted); font-size: 13px; }

/* 登录 / 初始化 */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px 22px; }
.gate form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.gate h1 { margin: 0 0 8px; font-family: var(--serif); font-weight: 900; font-size: 44px; letter-spacing: 3px; line-height: 1.15; }
.gate .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gate fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.gate legend { font-size: 14px; color: var(--ink-2); padding: 0 6px; }

/* 外框 */
.shell { max-width: var(--col); margin: 0 auto; padding: 0 18px calc(96px + var(--safe-b)); }
.bar { position: sticky; top: var(--safe-t); z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.bar-in { max-width: var(--col); margin: 0 auto; height: 56px; padding: 0 12px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bar b { font-family: var(--serif); font-weight: 900; font-size: 19px; letter-spacing: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 44px; height: 44px; border: none; background: none; border-radius: 22px; display: grid; place-items: center; color: var(--ink); }
.iconbtn:hover { background: var(--ground); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs-in { max-width: var(--col); margin: 0 auto; height: 60px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; }
.tabs a, .tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); border: none; background: none; height: 100%; justify-content: center; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.tabs .add span { width: 48px; height: 36px; border-radius: 18px; background: var(--ink); color: #fff; display: grid; place-items: center; }

/* 首页天数 */
.days { padding: 36px 0 28px; display: flex; flex-direction: column; gap: 10px; }
.days small { font-size: 14px; color: var(--muted); letter-spacing: 2px; }
.days .n { display: flex; align-items: baseline; gap: 10px; }
.days .n strong { font-family: var(--num); font-weight: 400; font-size: clamp(88px, 26vw, 140px); line-height: .82; letter-spacing: -.03em; }
.days .n span { font-family: var(--serif); font-size: 24px; }
.next { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); }
.next i { width: 8px; height: 8px; border-radius: 4px; background: var(--rose); flex-shrink: 0; }
.next b { color: var(--rose-ink); font-family: var(--num); font-size: 22px; font-weight: 400; margin: 0 2px; }

.otd { margin: 8px 0 20px; padding: 18px; border-radius: 14px; background: var(--rose-soft); display: flex; flex-direction: column; gap: 12px; }
.otd h3 { margin: 0; font-size: 15px; color: var(--rose-ink); }
.otd-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.otd-row::-webkit-scrollbar { display: none; }
.otd-item { flex: 0 0 auto; width: 140px; border: none; padding: 0; background: none; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.otd-item .ph { width: 140px; height: 140px; border-radius: 10px; overflow: hidden; background: var(--paper); display: grid; place-items: center; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.otd-item .ph img { width: 100%; height: 100%; object-fit: cover; }
.otd-item.textonly .ph { place-items: start; padding: 12px; }
.otd-item span { font-size: 13px; color: var(--rose-ink); }

/* 动态流 */
.day { margin-top: 8px; }
.day-h { position: sticky; top: calc(56px + var(--safe-t)); z-index: 10; background: var(--paper); padding: 14px 0 10px; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); }
.day-h a { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.day-h small { font-size: 13px; color: var(--muted); }
.post { padding: 18px 0 16px; display: flex; gap: 12px; border-bottom: 1px solid var(--ground); }
.av { width: 40px; height: 40px; border-radius: 20px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--well); color: var(--ink); }
.av.me { background: var(--ink); color: #fff; }
.av.them { background: var(--rose); color: #fff; }
.post-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.post-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-top b { font-weight: 600; font-size: 15px; }
.post-top time { font-size: 13px; color: var(--muted); }
.mood { font-size: 12px; padding: 1px 9px; border-radius: 10px; background: var(--ground); color: var(--ink-2); }
.post-top .more { margin-left: auto; }
.post-text { margin: 0; white-space: pre-wrap; word-break: break-word; line-height: 1.8; }
.grid { display: grid; gap: 4px; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 420px; }
.grid.n1 { grid-template-columns: 1fr; max-width: 360px; }
.grid.n2, .grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 300px; }
.grid button { border: none; padding: 0; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--well); }
.grid.n1 button { aspect-ratio: auto; max-height: 440px; }
.grid img { width: 100%; height: 100%; object-fit: cover; }
.vid { max-width: 420px; border-radius: 6px; overflow: hidden; background: #111; }
.vid video { width: 100%; max-height: 480px; }
.loc { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.acts { display: flex; gap: 2px; margin-left: -10px; }
.acts .btn { color: var(--ink-2); }
.acts .on { color: var(--rose-ink); }
.social { background: var(--ground); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.social .likes { color: var(--rose-ink); }
.cm { line-height: 1.6; word-break: break-word; }
.cm b { font-weight: 600; }
.cm button { border: none; background: none; color: var(--muted); font-size: 12px; padding: 0 0 0 6px; }
.cm-form { display: flex; gap: 8px; }
.cm-form .input { min-height: 40px; font-size: 15px; padding: 6px 12px; }
.loadmore { display: flex; justify-content: center; padding: 28px 0; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* 发布面板 */
.sheet-bg { position: fixed; inset: 0; z-index: 90; background: rgba(26,26,26,.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 620px; max-height: 94vh; overflow: auto; background: var(--paper); border-radius: 18px 18px 0 0; padding: 14px 18px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-h { display: flex; justify-content: space-between; align-items: center; }
.sheet-h h2 { margin: 0; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; }
.chips button[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-soft); color: var(--rose-ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.picks:empty { display: none; }
.picks div { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--well); }
.picks img, .picks video { width: 100%; height: 100%; object-fit: cover; }
.picks button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 13px; border: none; background: rgba(0,0,0,.6); color: #fff; line-height: 1; }
.progress { height: 4px; border-radius: 2px; background: var(--ground); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--rose); transition: width .2s; }
@media (min-width: 720px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }

/* 菜单与对话框 */
.pop { position: absolute; right: 0; top: 36px; z-index: 40; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(26,26,26,.12); padding: 6px; min-width: 132px; display: flex; flex-direction: column; }
.pop button { min-height: 42px; border: none; background: none; text-align: left; padding: 0 12px; border-radius: 6px; font-size: 15px; }
.pop button:hover { background: var(--ground); }
.pop .danger { color: var(--rose-ink); }

/* 日历 */
.cal-h { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 16px; }
.cal-h h1 { margin: 0; font-family: var(--num); font-weight: 400; font-size: 40px; line-height: 1; }
.cal-h h1 small { font-family: var(--serif); font-size: 18px; margin-left: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .wd { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
.cal .c { aspect-ratio: 1; border-radius: 8px; position: relative; overflow: hidden; border: none; padding: 0; background: var(--ground); display: block; }
.cal .c.blank { background: none; }
.cal .c img { width: 100%; height: 100%; object-fit: cover; }
.cal .c .d { position: absolute; left: 6px; top: 4px; font-family: var(--num); font-size: 15px; color: var(--ink-2); }
.cal .c.has { background: var(--rose-soft); }
.cal .c.has .d { color: var(--rose-ink); }
.cal .c.img .d { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.cal .c.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .c.future { opacity: .45; }
.cal .c .cnt { position: absolute; right: 5px; bottom: 3px; font-size: 11px; color: var(--rose-ink); }
.cal .c.img .cnt { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.cal-foot { margin-top: 16px; font-size: 14px; color: var(--muted); }

/* 单日 */
.dayv { padding: 24px 0 8px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.dayv h1 { margin: 0; font-family: var(--serif); font-size: 26px; }
.dayv small { color: var(--rose-ink); font-size: 14px; }

/* 心愿 / 我们 */
.page-h { padding: 26px 0 16px; }
.page-h h1 { margin: 0; font-family: var(--serif); font-weight: 900; font-size: 28px; letter-spacing: 2px; }
.page-h p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.wish-add { display: flex; gap: 8px; margin-bottom: 18px; }
.wish { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ground); }
.chk { width: 28px; height: 28px; border-radius: 14px; border: 2px solid #C9C6BD; background: var(--paper); flex-shrink: 0; display: grid; place-items: center; padding: 0; }
.chk[aria-checked="true"] { background: var(--rose); border-color: var(--rose); color: #fff; }
.wish .t { flex: 1; min-width: 0; word-break: break-word; }
.wish .t small { display: block; font-size: 12px; color: var(--muted); }
.wish.done .t > span { color: var(--muted); text-decoration: line-through; }
.sec { margin: 26px 0 0; display: flex; flex-direction: column; gap: 14px; }
.sec h2 { margin: 0; font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stats div { background: var(--ground); border-radius: 10px; padding: 12px 8px; text-align: center; }
.stats b { display: block; font-family: var(--num); font-weight: 400; font-size: 28px; line-height: 1.1; }
.stats span { font-size: 12px; color: var(--muted); }
.ann { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ground); }
.ann .t { flex: 1; min-width: 0; }
.ann .t small { display: block; font-size: 12px; color: var(--muted); }
.ann .left { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.ann .left b { font-family: var(--num); font-weight: 400; font-size: 26px; color: var(--rose-ink); }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 大图 */
.lb { position: fixed; inset: 0; z-index: 120; background: rgba(10,10,10,.97); display: flex; flex-direction: column; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 56px 8px 8px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.lb-bar { display: flex; justify-content: center; gap: 10px; padding: 12px 12px calc(14px + var(--safe-b)); }
.lb-bar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.lb-x { position: absolute; top: calc(10px + var(--safe-t)); right: 10px; width: 44px; height: 44px; border-radius: 22px; border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; }
.lb-n { position: absolute; top: calc(22px + var(--safe-t)); left: 18px; color: #bbb; font-size: 14px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 23px; border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; }
.lb-p { left: 10px; } .lb-nx { right: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 16px); z-index: 200; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 40px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

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