:root {
  --bg:#f4f9fc;
  --surface:rgba(255,255,255,.88);
  --surface-solid:#fff;
  --text:#203745;
  --muted:#708490;
  --line:#dce9ee;
  --blue:#8fc9df;
  --blue-deep:#4b91ad;
  --pink:#f3c9d2;
  --shadow:0 14px 40px rgba(57,103,125,.12);
  --radius:24px;
  --tab-h:78px;
  --top-h:68px
}

* {
  box-sizing:border-box
}

html {
  background:var(--bg)
}

body {
  margin:0;
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background:radial-gradient(circle at 15% 0,#dff3fb 0,transparent 35%),radial-gradient(circle at 100% 20%,#fdecef 0,transparent 32%),var(--bg);
  min-height:100vh
}

button,input {
  font:inherit
}

button {
  color:inherit
}

.app-shell {
  max-width:760px;
  min-height:100vh;
  margin:auto;
  position:relative;
  padding-bottom:calc(var(--tab-h) + env(safe-area-inset-bottom));
  background:rgba(248,252,254,.62)
}

.topbar {
  height:calc(var(--top-h) + env(safe-area-inset-top));
  padding:env(safe-area-inset-top) 18px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky;
  top:0;
  z-index:20;
  background:rgba(244,249,252,.78);
  backdrop-filter:blur(20px);
  border-bottom:1px solid rgba(220,233,238,.72)
}

.icon-btn,.plain-btn {
  border:0;
  background:rgba(255,255,255,.78);
  width:42px;
  height:42px;
  border-radius:15px;
  box-shadow:0 6px 18px rgba(60,96,110,.08);
  cursor:pointer
}

.top-title {
  text-align:center;
  display:grid;
  gap:2px
}

.top-title small,.page-intro small,.section-heading small,.feature-dialog>small {
  font-size:10px;
  letter-spacing:.18em;
  color:var(--blue-deep);
  font-weight:800
}

.top-title strong {
  font-size:17px
}

.pages {
  overflow:hidden
}

.page {
  display:none;
  padding:22px 18px 34px;
  animation:pageIn .28s ease
}

.page.active {
  display:block
}

@keyframes pageIn {
  from {
    opacity:0;
    transform:translateY(7px)
  }
  to {
    opacity:1;
    transform:none
  }
}

.hero-card {
  padding:25px;
  border-radius:30px;
  background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(225,244,251,.88));
  box-shadow:var(--shadow);
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:center;
  border:1px solid rgba(255,255,255,.9)
}

.hero-card h1 {
  font-size:25px;
  margin:10px 0 7px;
  line-height:1.25
}

.hero-card p {
  margin:0;
  color:var(--muted)
}

.pill {
  display:inline-flex;
  background:#dceff7;
  color:#397d98;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700
}

.days-card {
  min-width:105px;
  text-align:center;
  padding:16px 10px;
  border-radius:22px;
  background:rgba(255,255,255,.72)
}

.days-card small,.days-card span {
  display:block;
  color:var(--muted);
  font-size:11px
}

.days-card strong {
  display:block;
  font-size:35px;
  color:var(--blue-deep);
  line-height:1.1;
  margin:4px
}

.section-block {
  margin-top:24px
}

.section-heading {
  display:flex;
  align-items:end;
  justify-content:space-between;
  margin:0 3px 12px
}

.section-heading h2 {
  font-size:20px;
  margin:4px 0 0
}

.text-btn {
  border:0;
  background:none;
  color:var(--blue-deep);
  font-size:13px;
  cursor:pointer
}

.mail-card {
  margin:0;
  padding:22px;
  border-radius:var(--radius);
  background:linear-gradient(135deg,#fff,#fff5f6);
  box-shadow:var(--shadow);
  border:1px solid #fff
}

.mail-card p {
  font-family:"STKaiti","KaiTi",serif;
  font-size:18px;
  line-height:1.75;
  margin:0
}

.mail-card footer {
  text-align:right;
  color:var(--muted);
  margin-top:12px;
  font-size:13px
}

.home-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:20px
}

.mini-card {
  border:0;
  text-align:left;
  padding:17px;
  border-radius:21px;
  background:var(--surface);
  box-shadow:0 9px 27px rgba(57,103,125,.08);
  display:flex;
  gap:11px;
  min-height:132px
}

.mini-card>span {
  font-size:24px
}

.mini-card div {
  min-width:0
}

.mini-card small {
  color:var(--muted);
  display:block;
  margin-bottom:7px
}

.mini-card strong {
  font-size:15px;
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}

.mini-card p {
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
  margin:7px 0 0;
  display:-webkit-box;
  -webkit-line-clamp:2;
  line-clamp: 2;
  -webkit-box-orient:vertical;
  overflow:hidden
}

.clickable,.mini-card[data-feature] {
  cursor:pointer
}

.status-row {
  display:flex;
  justify-content:space-between;
  gap:16px;
  background:var(--surface);
  padding:15px 17px;
  border-bottom:1px solid var(--line);
  font-size:13px
}

.status-row:first-of-type {
  border-radius:20px 20px 0 0
}

.status-row:last-child {
  border:0;
  border-radius:0 0 20px 20px
}

.status-row b {
  text-align:right;
  font-size:12px;
  color:var(--blue-deep)
}

.online-dot {
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#77c49b;
  margin-right:7px
}

.page-intro {
  padding:12px 5px 18px
}

.page-intro h1 {
  font-size:29px;
  margin:5px 0
}

.page-intro p {
  margin:0;
  color:var(--muted);
  line-height:1.6
}

.search-box {
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--surface-solid);
  border:1px solid var(--line);
  padding:12px 14px;
  border-radius:17px;
  box-shadow:0 7px 24px rgba(57,103,125,.06)
}

.search-box input {
  border:0;
  outline:0;
  background:transparent;
  flex:1;
  color:var(--text)
}

.inline-status {
  text-align:center;
  color:var(--muted);
  padding:20px;
  font-size:13px
}

.timeline {
  display:grid;
  gap:13px
}

.entry-card {
  padding:18px;
  border-radius:22px;
  background:var(--surface);
  box-shadow:0 9px 28px rgba(57,103,125,.08)
}

.entry-top {
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:12px
}

.entry-card h3 {
  margin:12px 0 7px;
  font-size:18px
}

.entry-body {
  margin:0;
  line-height:1.7;
  white-space:pre-wrap
}

.entry-tags {
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin-top:13px
}

.tag {
  font-size:11px;
  border-radius:999px;
  background:#e7f3f7;
  padding:5px 8px;
  color:#41788c
}

.year-card,.coming-card {
  padding:22px;
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow)
}

.year-card>small {
  font-size:32px;
  color:var(--blue-deep);
  font-weight:800
}

.year-card>strong {
  display:block;
  margin:5px 0 20px
}

.time-event {
  display:flex;
  gap:13px;
  padding:13px 0;
  border-top:1px solid var(--line)
}

.time-event i {
  width:10px;
  height:10px;
  background:var(--pink);
  border-radius:50%;
  margin-top:6px
}

.time-event p {
  margin:4px 0;
  color:var(--muted);
  font-size:13px
}

.coming-card {
  text-align:center;
  margin-top:18px
}

.coming-card>span {
  font-size:36px
}

.coming-card h2 {
  font-size:19px
}

.coming-card p {
  color:var(--muted);
  line-height:1.6
}

.chat-preview {
  padding:18px;
  border-radius:25px;
  background:linear-gradient(#eaf6fa,#f7fbfc);
  min-height:260px;
  display:flex;
  flex-direction:column;
  gap:12px
}

.bubble {
  max-width:78%;
  padding:12px 14px;
  border-radius:17px;
  line-height:1.5;
  font-size:14px
}

.bubble.other {
  background:#fff;
  border-bottom-left-radius:5px
}

.bubble.mine {
  background:#bee4f1;
  align-self:flex-end;
  border-bottom-right-radius:5px
}

.chat-date {
  text-align:center;
  color:var(--muted);
  font-size:11px;
  margin-top:auto
}

.tabbar {
  height:calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding:8px 14px env(safe-area-inset-bottom);
  display:grid;
  grid-template-columns:repeat(4,1fr);
  position:fixed;
  z-index:25;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  width:min(760px,100%);
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(22px);
  border-top:1px solid var(--line)
}

.tab {
  border:0;
  background:none;
  border-radius:17px;
  display:grid;
  place-items:center;
  gap:2px;
  color:var(--muted);
  cursor:pointer
}

.tab span {
  font-size:21px;
  filter:grayscale(.45);
  transition:.2s
}

.tab b {
  font-size:11px
}

.tab.active {
  color:var(--blue-deep);
  background:#e7f4f8
}

.tab.active span {
  filter:none;
  transform:translateY(-1px)
}

.backdrop {
  position:fixed;
  inset:0;
  background:rgba(25,48,58,.27);
  z-index:39;
  backdrop-filter:blur(2px)
}

.drawer {
  position:fixed;
  z-index:40;
  top:0;
  bottom:0;
  left:0;
  width:min(88vw,350px);
  background:#f9fcfd;
  padding:calc(18px + env(safe-area-inset-top)) 14px 18px;
  transform:translateX(-110%);
  visibility:hidden;
  pointer-events:none;
  transition:transform .3s ease,visibility 0s linear .3s;
  box-shadow:22px 0 50px rgba(36,72,88,.18);
  overflow:auto
}

.drawer.open {
  transform:none;
  visibility:visible;
  pointer-events:auto;
  transition-delay:0s
}

.drawer-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 5px 17px;
}

.drawer-profile {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.drawer-profile img {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  object-fit: cover;
  background: #eef6fb;
  box-shadow: 0 7px 18px rgba(57, 103, 125, 0.12);
}

.drawer-profile span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.drawer-profile b {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
}

.drawer-profile em {
  color: #ef7f9d;
  font-style: normal;
}

.drawer-profile small {
  color: var(--muted);
  font-size: 12px;
}

.drawer-head .plain-btn {
  flex: 0 0 42px;
  margin-left: auto;
}

.drawer-head p {
  margin: 0;
  font-weight: 800;
}

.drawer-head p {
  margin:0;
  font-weight:800
}

.drawer-head small {
  color:var(--muted)
}

.drawer-head .plain-btn {
  margin-left:auto
}

.island-avatar {
  width:48px;
  height:48px;
  border-radius:17px;
  background:#e1f2f8;
  display:grid;
  place-items:center;
  font-size:25px
}

.drawer-nav {
  display:grid;
  gap:6px
}

.drawer-nav button {
  border:0;
  background:transparent;
  border-radius:18px;
  padding:11px;
  display:grid;
  grid-template-columns:35px 1fr;
  grid-template-rows:auto auto;
  text-align:left;
  cursor:pointer
}

.drawer-nav button:hover,.drawer-nav button.highlight {
  background:#edf7fa
}

.drawer-nav button span {
  grid-row:1/3;
  font-size:22px
}

.drawer-nav button b {
  font-size:14px
}

.drawer-nav button small {
  color:var(--muted);
  font-size:11px;
  margin-top:3px
}

.drawer-version {
  text-align:center;
  color:var(--muted);
  font-size:11px;
  margin-top:20px
}

.feature-dialog {
  border:0;
  border-radius:28px;
  width:min(88vw,410px);
  padding:30px;
  text-align:center;
  color:var(--text);
  background:var(--surface-solid);
  box-shadow:0 30px 90px rgba(22,54,67,.3)
}

.feature-dialog::backdrop {
  background:rgba(28,49,58,.33);
  backdrop-filter:blur(4px)
}

.dialog-close {
  position:absolute;
  right:14px;
  top:14px;
  border:0;
  background:#eef5f7;
  width:34px;
  height:34px;
  border-radius:12px
}

.dialog-icon {
  font-size:43px
}

.feature-dialog h2 {
  margin:8px
}

.feature-dialog p {
  color:var(--muted);
  line-height:1.7
}

.night {
  --bg:#10212b;
  --surface:rgba(26,48,59,.94);
  --surface-solid:#1a303b;
  --text:#edf7fa;
  --muted:#9bb0ba;
  --line:#2b4754;
  --shadow:0 16px 45px rgba(0,0,0,.22);
  background:radial-gradient(circle at 10% 0,#173f50 0,transparent 36%),#10212b
}

.night .app-shell,.night .topbar {
  background:rgba(16,33,43,.72)
}

.night .hero-card {
  background:linear-gradient(145deg,#1c3947,#18303a)
}

.night .mail-card {
  background:linear-gradient(135deg,#223b47,#3a3037)
}

.night .tabbar {
  background:rgba(18,36,46,.9)
}

.night .drawer {
  background:#142a35
}

.night .drawer-nav button.highlight,.night .drawer-nav button:hover,.night .tab.active {
  background:#244653
}

.night .search-box input {
  color:var(--text)
}

@media(max-width:520px) {
  .home-grid {
    grid-template-columns:1fr
  }
  .mini-card {
    min-height:105px
  }
  .hero-card {
    align-items:flex-start
  }
  .days-card {
    min-width:92px
  }
  .hero-card h1 {
    font-size:22px
  }
}

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

/* Alpha 1.2 · 稳固 */
button,.clickable,.secondary-action {
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation
}

.tab:active,.icon-btn:active,.drawer-nav button:active,.primary-action:active,.secondary-action:active {
  transform:scale(.97)
}

.tab,.icon-btn,.drawer-nav button,.primary-action,.secondary-action {
  transition:transform .16s ease,background .2s ease,box-shadow .2s ease
}

.backup-hero {
  display:flex;
  gap:16px;
  align-items:center;
  padding:22px;
  border-radius:26px;
  background:linear-gradient(145deg,#fff,#e8f6fb);
  box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,.9)
}

.backup-mark {
  display:grid;
  place-items:center;
  flex:0 0 68px;
  height:68px;
  border-radius:22px;
  background:rgba(255,255,255,.78);
  font-size:34px
}

.backup-hero small {
  color:var(--blue-deep);
  font-weight:800;
  letter-spacing:.08em
}

.backup-hero h2 {
  margin:5px 0 6px;
  font-size:20px
}

.backup-hero p {
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.6
}

.backup-list {
  display:grid;
  margin-top:16px;
  background:var(--surface);
  border-radius:22px;
  overflow:hidden;
  box-shadow:0 9px 27px rgba(57,103,125,.07)
}

.backup-list>div {
  display:flex;
  align-items:center;
  gap:12px;
  padding:15px 16px;
  border-bottom:1px solid var(--line)
}

.backup-list>div:last-child {
  border:0
}

.backup-list>div>span {
  font-size:22px
}

.backup-list p {
  display:grid;
  gap:3px;
  flex:1;
  margin:0
}

.backup-list b {
  font-size:14px
}

.backup-list small {
  color:var(--muted);
  font-size:11px
}

.backup-list em {
  font-style:normal;
  color:#438467;
  background:#e6f5ed;
  border-radius:999px;
  padding:5px 8px;
  font-size:10px;
  font-weight:700
}

.backup-list em.pending {
  color:#8b7651;
  background:#f6f0e4
}

.backup-actions {
  display:grid;
  gap:10px;
  margin-top:18px
}

.primary-action,.secondary-action {
  width:100%;
  border:0;
  border-radius:20px;
  padding:16px 18px;
  display:flex;
  align-items:center;
  gap:13px;
  text-align:left;
  cursor:pointer
}

.primary-action {
  color:#fff;
  background:linear-gradient(135deg,#4f9bb8,#74bad2);
  box-shadow:0 12px 30px rgba(67,140,168,.25)
}

.secondary-action {
  background:var(--surface-solid);
  border:1px solid var(--line);
  box-shadow:0 8px 22px rgba(57,103,125,.06)
}

.primary-action>span,.secondary-action>span {
  font-size:24px
}

.primary-action div,.secondary-action div {
  display:grid;
  gap:3px
}

.primary-action small {
  color:rgba(255,255,255,.82)
}

.secondary-action small {
  color:var(--muted)
}

.primary-action:disabled {
  opacity:.65;
  cursor:wait
}

.backup-status {
  margin-top:13px;
  padding:13px 15px;
  border-radius:16px;
  background:rgba(255,255,255,.55);
  border:1px dashed var(--line);
  color:var(--muted);
  font-size:12px;
  line-height:1.55
}

.backup-status[data-state="success"] {
  background:#edf8f2;
  color:#3e765d;
  border-style:solid
}

.backup-status[data-state="error"] {
  background:#fff0f1;
  color:#9a545d;
  border-style:solid
}

.cache-button {
  width:100%;
  margin-top:10px;
  border:1px solid var(--line);
  background:var(--surface-solid);
  padding:13px;
  border-radius:16px;
  color:var(--blue-deep);
  font-weight:700;
  cursor:pointer
}

.toast {
  position:fixed;
  z-index:80;
  left:50%;
  bottom:calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px);
  transform:translate(-50%,12px);
  opacity:0;
  max-width:min(86vw,420px);
  padding:11px 16px;
  border-radius:999px;
  background:rgba(31,55,66,.92);
  color:#fff;
  font-size:13px;
  box-shadow:0 12px 35px rgba(0,0,0,.22);
  transition:.22s ease
}

.toast.show {
  opacity:1;
  transform:translate(-50%,0)
}

.night .backup-hero {
  background:linear-gradient(145deg,#1c3947,#18303a)
}

.night .backup-mark,.night .backup-status {
  background:rgba(255,255,255,.06)
}

.night .backup-status[data-state="success"] {
  background:#1d4032;
  color:#b6e5ca
}

.night .backup-status[data-state="error"] {
  background:#4a2930;
  color:#ffd0d5
}

@media(max-width:520px) {
  .page {
    padding-left:15px;
    padding-right:15px
  }
  .topbar {
    padding-left:14px;
    padding-right:14px
  }
  .hero-card {
    padding:20px
  }
  .backup-hero {
    align-items:flex-start
  }
  .backup-mark {
    flex-basis:58px;
    height:58px;
    border-radius:18px;
    font-size:29px
  }
  .tabbar {
    padding-left:8px;
    padding-right:8px
  }
  .tab {
    min-height:56px
  }
}

@media(min-width:761px) {
  .app-shell {
    box-shadow:0 0 0 1px rgba(220,233,238,.45),0 25px 80px rgba(45,83,100,.08)
  }
}

/* Alpha 2 · 起风：日记 */
.diary-intro {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px
}

.round-action {
  border:0;
  width:52px;
  height:52px;
  flex:0 0 52px;
  border-radius:18px;
  background:linear-gradient(135deg,#5ba5c0,#8dcee0);
  color:#fff;
  font-size:29px;
  box-shadow:0 12px 28px rgba(69,145,174,.25)
}

.diary-tools {
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px
}

.trash-button {
  border:1px solid var(--line);
  background:var(--surface-solid);
  border-radius:17px;
  padding:0 13px;
  display:flex;
  align-items:center;
  gap:6px
}

.trash-button b {
  font-size:12px
}

.trash-button em {
  font-style:normal;
  min-width:20px;
  height:20px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#edf5f7;
  color:var(--blue-deep);
  font-size:10px
}

.diary-list {
  display:grid;
  gap:15px
}

.diary-card {
  background:var(--surface);
  border-radius:24px;
  padding:18px;
  box-shadow:0 10px 30px rgba(57,103,125,.08);
  overflow:hidden
}

.diary-card-head {
  display:flex;
  justify-content:space-between;
  gap:12px
}

.diary-card time {
  color:var(--blue-deep);
  font-size:11px;
  font-weight:700
}

.diary-card h3 {
  margin:6px 0 12px;
  font-size:19px
}

.favorite-button {
  border:0;
  background:transparent;
  font-size:28px;
  color:#d5a64f;
  align-self:flex-start
}

.diary-photo {
  display:block;
  width:100%;
  max-height:420px;
  object-fit:cover;
  border-radius:18px;
  margin:3px 0 14px;
  background:#edf4f6
}

.diary-voice {
  padding:13px 14px;
  border-radius:17px;
  margin-top:9px
}

.diary-voice.xinan {
  background:#fff4f6
}

.diary-voice.y {
  background:#edf7fb
}

.diary-voice b {
  font-size:12px
}

.diary-voice p {
  margin:7px 0 0;
  white-space:pre-wrap;
  line-height:1.7;
  font-size:14px
}

.diary-meta {
  display:flex;
  gap:7px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:13px
}

.diary-meta span {
  font-size:10px;
  padding:5px 8px;
  border-radius:999px;
  background:#eaf4f7;
  color:#4c7d90
}

.diary-meta button {
  margin-left:auto;
  border:0;
  background:none;
  color:var(--blue-deep);
  font-weight:700;
  font-size:12px
}

.empty-state {
  text-align:center;
  padding:42px 18px;
  background:var(--surface);
  border-radius:24px;
  font-size:35px
}

.empty-state b,.empty-state p {
  display:block
}

.empty-state b {
  font-size:17px;
  margin-top:12px
}

.empty-state p {
  font-size:13px;
  color:var(--muted)
}

.editor-dialog,.trash-dialog {
  border:0;
  padding:0;
  color:var(--text);
  background:var(--bg);
  width:min(100%,760px);
  max-width:760px;
  height:min(92vh,900px);
  max-height:92vh;
  border-radius:28px;
  box-shadow:0 30px 90px rgba(20,50,64,.35)
}

.editor-dialog::backdrop,.trash-dialog::backdrop {
  background:rgba(22,44,55,.35);
  backdrop-filter:blur(4px)
}

.editor-dialog form {
  height:100%;
  display:flex;
  flex-direction:column
}

.editor-head,.trash-head {
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  background:rgba(244,249,252,.92);
  backdrop-filter:blur(18px);
  border-bottom:1px solid var(--line)
}

.editor-head>div {
  text-align:center
}

.editor-head small,.trash-head small {
  font-size:9px;
  letter-spacing:.16em;
  color:var(--blue-deep);
  font-weight:800
}

.editor-head h2,.trash-head h2 {
  margin:3px 0 0;
  font-size:18px
}

.save-diary {
  border:0;
  background:#5da5bf;
  color:#fff;
  padding:10px 14px;
  border-radius:13px;
  font-weight:700
}

.save-diary:disabled {
  opacity:.65
}

.editor-scroll {
  overflow:auto;
  padding:18px;
  padding-bottom:calc(28px + env(safe-area-inset-bottom))
}

.editor-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:11px
}

.editor-grid label {
  display:grid;
  gap:6px
}

.editor-grid .full {
  grid-column:1/-1
}

.editor-grid span {
  font-size:11px;
  color:var(--muted)
}

.editor-grid input,.editor-grid select,.writer-panel textarea {
  width:100%;
  border:1px solid var(--line);
  background:var(--surface-solid);
  color:var(--text);
  border-radius:15px;
  padding:12px;
  outline:0
}

.writer-panel {
  margin-top:14px;
  padding:14px;
  border-radius:20px
}

.xinan-panel {
  background:#fff5f6
}

.y-panel {
  background:#edf7fb
}

.writer-title {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px
}

.writer-title>span {
  font-size:22px
}

.writer-title div {
  display:grid;
  flex:1
}

.writer-title small {
  color:var(--muted);
  font-size:10px
}

.writer-title em {
  font-style:normal;
  color:var(--muted);
  font-size:11px
}

.writer-panel textarea {
  resize:vertical;
  line-height:1.7
}

.photo-editor {
  margin-top:16px
}

.section-heading.compact {
  margin-bottom:9px
}

.section-heading.compact h3 {
  margin:3px 0
}

.photo-picker {
  display:block;
  min-height:170px;
  border:1.5px dashed #a9cbd8;
  border-radius:20px;
  overflow:hidden;
  background:rgba(255,255,255,.45)
}

.photo-picker img {
  width:100%;
  max-height:420px;
  object-fit:contain;
  background:#eef5f7
}

.photo-picker>div {
  min-height:170px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:7px;
  color:var(--muted)
}

.photo-picker>div span {
  font-size:35px
}

.photo-picker>div b {
  color:var(--text)
}

.photo-note {
  font-size:10px;
  color:var(--muted);
  line-height:1.5
}

.danger-link {
  width:100%;
  border:0;
  background:none;
  color:#bd5b66;
  padding:18px;
  margin-top:5px
}

.trash-dialog {
  padding-bottom:18px
}

.trash-head p {
  margin:4px 0 0;
  color:var(--muted);
  font-size:11px
}

.trash-status {
  padding:15px 18px;
  color:var(--muted);
  font-size:12px
}

.trash-list {
  padding:0 16px 18px;
  display:grid;
  gap:11px;
  overflow:auto
}

.trash-item {
  background:var(--surface);
  border-radius:19px;
  padding:15px;
  display:grid;
  gap:12px
}

.trash-item small {
  color:var(--muted)
}

.trash-item b {
  display:block;
  margin:5px 0
}

.trash-item p {
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.5
}

.trash-item>div:last-child {
  display:flex;
  gap:8px
}

.trash-item button {
  border:0;
  border-radius:12px;
  padding:8px 12px;
  background:#e5f4f8;
  color:var(--blue-deep);
  font-weight:700
}

.trash-item button.permanent {
  background:#fff0f1;
  color:#ad5661
}

.night .editor-head,.night .trash-head {
  background:rgba(16,33,43,.92)
}

.night .xinan-panel,.night .diary-voice.xinan {
  background:#3b2b31
}

.night .y-panel,.night .diary-voice.y {
  background:#173b49
}

.night .photo-picker {
  background:rgba(255,255,255,.04)
}

@media(max-width:520px) {
  .editor-dialog,.trash-dialog {
    width:100%;
    height:100dvh;
    max-height:100dvh;
    border-radius:0
  }
  .diary-tools {
    grid-template-columns:1fr
  }
  .trash-button {
    min-height:44px;
    justify-content:center
  }
  .editor-grid {
    grid-template-columns:1fr
  }
  .editor-grid .full {
    grid-column:auto
  }
}

/* Alpha 2.1 · 头像彩蛋与外观 */
.avatar-egg-button {
  width:44px;
  height:44px;
  padding:0;
  border:3px solid rgba(255,255,255,.92);
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 7px 20px rgba(60,96,110,.13);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:transform .16s ease,box-shadow .2s ease
}

.avatar-egg-button:active {
  transform:scale(.95)
}

.avatar-egg-button img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover
}

.love-note-dialog {
  border:0;
  width:min(88vw,470px);
  padding:54px 34px 34px;
  border-radius:32px;
  color:#392f2a;
  background:#fffdfa;
  box-shadow:0 30px 100px rgba(32,40,45,.34);
  text-align:center
}

.love-note-dialog::backdrop {
  background:rgba(32,45,52,.43);
  backdrop-filter:blur(8px)
}

.love-close {
  position:absolute;
  right:18px;
  top:16px;
  background:none;
  box-shadow:none;
  color:#8a837d;
  font-size:25px
}

.love-heart {
  font-size:63px;
  line-height:1;
  margin:0 0 25px
}

.love-note-dialog h2 {
  margin:0;
  font-size:27px;
  line-height:1.35
}

.love-note-dialog p {
  margin:24px auto 0;
  max-width:360px;
  color:#8b837d;
  font-size:16px;
  line-height:1.85
}

.another-note {
  margin-top:28px;
  border:1px solid #d9e9ef;
  border-radius:999px;
  background:#eef7fa;
  color:#4b8ca5;
  padding:10px 18px;
  font-weight:700;
  cursor:pointer
}

.profile-dialog {
  border:0;
  padding:0;
  color:var(--text);
  background:var(--bg);
  width:min(92vw,650px);
  max-height:min(88vh,820px);
  border-radius:29px;
  box-shadow:0 30px 90px rgba(20,50,64,.35)
}

.profile-dialog::backdrop {
  background:rgba(22,44,55,.35);
  backdrop-filter:blur(5px)
}

.profile-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:21px 22px 17px;
  background:rgba(244,249,252,.92);
  backdrop-filter:blur(18px);
  border-bottom:1px solid var(--line)
}

.profile-head small,.profile-section-title small {
  font-size:9px;
  letter-spacing:.17em;
  color:var(--blue-deep);
  font-weight:800
}

.profile-head h2 {
  font-size:22px;
  margin:4px 0
}

.profile-head p {
  margin:0;
  color:var(--muted);
  font-size:12px
}

.profile-scroll {
  overflow:auto;
  max-height:calc(min(88vh,820px) - 92px);
  padding:18px 20px calc(24px + env(safe-area-inset-bottom))
}

.profile-section+.profile-section {
  margin-top:25px
}

.profile-section-title h3 {
  margin:4px 0 12px;
  font-size:20px
}

.avatar-settings-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px
}

.avatar-setting-card {
  display:grid;
  justify-items:center;
  text-align:center;
  gap:9px;
  padding:18px 13px;
  border-radius:22px;
  background:var(--surface);
  box-shadow:0 8px 24px rgba(57,103,125,.07)
}

.avatar-setting-card>img {
  width:82px;
  height:82px;
  border-radius:27px;
  object-fit:cover;
  border:4px solid rgba(255,255,255,.85);
  box-shadow:0 8px 22px rgba(48,90,109,.14)
}

.avatar-setting-card div {
  display:grid;
  gap:3px
}

.avatar-setting-card small {
  color:var(--muted);
  font-size:10px;
  line-height:1.45
}

.avatar-upload,.avatar-reset {
  width:100%;
  border-radius:13px;
  padding:9px 10px;
  font-size:12px;
  font-weight:700;
  cursor:pointer
}

.avatar-upload {
  background:#dff1f7;
  color:#43829b
}

.avatar-reset {
  border:0;
  background:transparent;
  color:var(--muted)
}

.local-note {
  margin:10px 3px 0;
  color:var(--muted);
  font-size:10px;
  line-height:1.55
}

.theme-choice {
  display:grid;
  gap:9px
}

.theme-choice label {
  display:flex;
  align-items:center;
  gap:11px;
  padding:14px 15px;
  border:1px solid var(--line);
  border-radius:17px;
  background:var(--surface);
  cursor:pointer
}

.theme-choice label:has(input:checked) {
  border-color:#75b6cf;
  background:#e9f6fa;
  box-shadow:0 7px 22px rgba(71,139,164,.1)
}

.theme-choice input {
  accent-color:#5b9fb9
}

.theme-choice>label>span {
  font-size:23px
}

.theme-choice div {
  display:grid;
  gap:3px
}

.theme-choice b {
  font-size:14px
}

.theme-choice small {
  color:var(--muted);
  font-size:11px
}

.night .profile-head {
  background:rgba(16,33,43,.92)
}

.night .theme-choice label:has(input:checked) {
  background:#173b49
}

.night .love-note-dialog {
  background:#fffdfa;
  color:#392f2a
}

@media(max-width:520px) {
  .avatar-settings-grid {
    grid-template-columns:1fr 1fr
  }
  .profile-dialog {
    width:100%;
    max-width:none;
    height:100dvh;
    max-height:100dvh;
    border-radius:0
  }
  .profile-scroll {
    max-height:calc(100dvh - 92px)
  }
  .love-note-dialog {
    padding:48px 24px 30px
  }
  .love-note-dialog h2 {
    font-size:25px
  }
  .love-note-dialog p {
    font-size:15px
  }
  .avatar-setting-card {
    padding-left:10px;
    padding-right:10px
  }
  .avatar-setting-card>img {
    width:72px;
    height:72px;
    border-radius:23px
  }
}

/* Alpha 2.0.1 快速启动修复 */
.diary-card-actions {
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0
}

.diary-time-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:58px;
  padding:8px 11px;
  border-radius:999px;
  background:rgba(117,186,215,.15);
  color:#4e8cac;
  font-weight:800;
  font-size:.85rem;
  line-height:1
}

.inline-status.retryable {
  cursor:pointer;
  text-decoration:underline;
  text-decoration-style:dotted;
  text-underline-offset:4px
}

@media(max-width:520px) {
  .diary-card-actions {
    gap:6px
  }
  .diary-time-pill {
    min-width:52px;
    padding:7px 9px;
    font-size:.78rem
  }
}

/* Alpha 2.2 · 时光与手机底栏微调 */
.time-intro {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px
}

.time-controls {
  margin:0 0 5px
}

.time-auto-toggle {
  display:flex;
  align-items:center;
  gap:11px;
  padding:13px 15px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
  box-shadow:0 7px 22px rgba(57,103,125,.06)
}

.time-auto-toggle input {
  accent-color:#5b9fb9;
  width:18px;
  height:18px;
  flex:0 0 auto
}

.time-auto-toggle span {
  font-weight:750;
  font-size:13px
}

.time-auto-toggle small {
  margin-left:auto;
  color:var(--muted);
  font-size:10px;
  text-align:right;
  max-width:190px
}

.time-years {
  display:grid;
  gap:16px
}

.time-year-card {
  padding:22px
}

.time-year-card+.time-year-card {
  margin-top:0
}

.time-event {
  position:relative;
  align-items:flex-start
}

.time-event-content {
  min-width:0;
  flex:1
}

.time-event-heading {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap
}

.time-event-heading span {
  font-size:9px;
  padding:4px 7px;
  border-radius:999px;
  background:#edf5f7;
  color:var(--blue-deep)
}

.time-event h3 {
  margin:7px 0 0;
  font-size:15px
}

.time-event p {
  margin-top:5px;
  line-height:1.55
}

.time-event.manual i {
  background:#83c4d9
}

.time-event.diary i {
  background:#f3c9d2
}

.time-event.milestone i {
  background:#7baed0
}

.time-edit-button {
  border:0;
  background:transparent;
  color:var(--blue-deep);
  font-size:11px;
  font-weight:750;
  padding:5px
}

.time-editor-dialog {
  border:0;
  padding:0;
  color:var(--text);
  background:var(--bg);
  width:min(92vw,620px);
  border-radius:28px;
  box-shadow:0 30px 90px rgba(20,50,64,.35)
}

.time-editor-dialog::backdrop {
  background:rgba(22,44,55,.35);
  backdrop-filter:blur(4px)
}

.time-editor-body {
  padding:18px;
  display:grid;
  gap:14px
}

.time-editor-body label {
  display:grid;
  gap:7px
}

.time-editor-body label span {
  font-size:11px;
  color:var(--muted)
}

.time-editor-body input,.time-editor-body textarea {
  width:100%;
  border:1px solid var(--line);
  background:var(--surface-solid);
  color:var(--text);
  border-radius:15px;
  padding:12px;
  outline:0;
  resize:vertical
}

@media(max-width:520px) {
  .tabbar {
    padding-top:12px
  }
  .tab {
    transform:translateY(4px)
  }
  .time-auto-toggle {
    align-items:flex-start
  }
  .time-auto-toggle small {
    max-width:145px
  }
  .time-editor-dialog {
    width:100%;
    height:100dvh;
    max-height:100dvh;
    border-radius:0
  }
  .time-editor-body {
    padding-bottom:calc(28px + env(safe-area-inset-bottom))
  }
}

.diary-time-missing {
  opacity:.58;
  font-weight:700
}

.time-row-actions {
  display:flex;
  gap:7px;
  align-items:center;
  flex-shrink:0
}

.time-delete-button,.time-hide-button {
  border:0;
  background:transparent;
  color:#8aa0ad;
  font-weight:700;
  cursor:pointer;
  padding:7px
}

.time-delete-button {
  color:#c57a7a
}

.time-hide-button {
  font-size:.78rem
}

@media(max-width:520px) {
  .time-event {
    align-items:flex-start
  }
  .time-row-actions {
    flex-direction:column;
    gap:2px
  }
  .time-hide-button {
    max-width:72px;
    line-height:1.25
  }
}

/* ===== Alpha 2.4 · 首页 ===== */
.page.home-screen {
  min-height: calc(100vh - var(--tab-h) - env(safe-area-inset-bottom));
  padding: 26px 18px 36px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 245, 241, 0.08) 0%,
      rgba(255, 244, 239, 0.18) 32%,
      rgba(255, 249, 246, 0.45) 58%,
      rgba(255, 251, 249, 0.82) 82%,
      rgba(255, 252, 251, 0.96) 100%
    ),
    url("./assets/home-bg.jpg") center / cover no-repeat;
}

.home-hero-copy {
  padding: 22px 8px 30px;
  text-align: center;
}

.home-hero-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.2;
}

.home-caption {
  margin: 0;
  color: rgba(32, 55, 69, 0.84);
  font-size: 16px;
}

.home-days {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.home-days strong {
  color: #ea718e;
  font-size: clamp(64px, 13vw, 120px);
  font-weight: 800;
  line-height: 0.92;
}

.home-days span {
  margin-bottom: 14px;
  color: rgba(32, 55, 69, 0.86);
  font-size: 22px;
  font-weight: 700;
}

.home-date {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.home-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quick-card {
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(76, 92, 110, 0.1);
  backdrop-filter: blur(8px);
}

.quick-card-head h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

.quick-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.weather-icon {
  font-size: 34px;
  line-height: 1;
}

.weather-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.weather-line strong {
  font-size: 20px;
}

.weather-line span,
.weather-copy p,
.today-copy p {
  margin: 0;
  color: var(--muted);
}

.weather-copy p {
  margin-top: 8px;
  font-size: 13px;
}

.icon-link,
.quick-arrow {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.quick-meta {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.quick-meta b {
  color: var(--blue-deep);
}

.today-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
}

.today-row img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #eef6fb;
  box-shadow: 0 8px 18px rgba(70, 100, 120, 0.1);
  object-fit: cover;
}

.today-copy strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.today-copy p {
  font-size: 13px;
}

.memories-block {
  margin-top: 22px;
}

.memories-heading {
  margin-bottom: 12px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(124px, 1fr));
  gap: 12px;
  padding-bottom: 4px;
  overflow-x: auto;
}

.memory-card {
  position: relative;
  min-height: 176px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 22px;
  color: #fff;
  box-shadow: 0 14px 30px rgba(65, 80, 100, 0.1);
  cursor: pointer;
}

.memory-card::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(19, 37, 49, 0.58));
  content: "";
}

.memory-pill,
.memory-content {
  position: relative;
  z-index: 1;
}

.memory-pill {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #7b8792;
  font-size: 11px;
  font-weight: 700;
}

.memory-content {
  display: flex;
  height: calc(100% - 30px);
  flex-direction: column;
  justify-content: flex-end;
}

.memory-content h3 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.16;
}

.memory-content p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.memory-anniversary {
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 239, 156, 0.92) 0 16%, transparent 17%),
    linear-gradient(180deg, rgba(255, 213, 178, 0.86), rgba(81, 101, 119, 0.9));
}

.memory-diary {
  background: linear-gradient(180deg, rgba(222, 243, 255, 0.82), rgba(101, 142, 171, 0.88));
}

.memory-chat {
  background: linear-gradient(180deg, rgba(233, 224, 255, 0.84), rgba(130, 113, 175, 0.88));
}

.memory-letter {
  background: linear-gradient(180deg, rgba(252, 239, 223, 0.9), rgba(182, 142, 120, 0.88));
}

@media (max-width: 720px) {
  .memory-grid {
    grid-template-columns: repeat(4, minmax(132px, 1fr));
  }
}
.y-avatar-egg {
  width: 48px;
  height: 48px;
  margin-left: -8px;
  padding: 0;
  border: 0 !important;
  outline: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
}

.y-avatar-egg img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width: 560px) {
  .page.home-screen {
    padding: 20px 16px 30px;
  }

  .home-hero-copy {
    padding: 18px 4px 24px;
  }

  .home-quick-grid {
    gap: 12px;
  }

  .quick-card {
    padding: 16px 14px 14px;
    border-radius: 22px;
  }

  .today-row {
    grid-template-columns: 52px 1fr auto;
  }

  .y-avatar-egg {
  width: 48px;
  height: 48px;
  margin-left: -6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  appearance: none;
}
}

