
  html:not(.unlocked) .wrap{display:none;}
  html:not(.unlocked){background:#fbf6ec;}

  #lock{
    position:fixed;
    inset:0;
    z-index:200;
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
    background-color:#fbf6ec;
    background-image:
      radial-gradient(rgba(180,160,135,.16) 1px, transparent 1px),
      radial-gradient(rgba(180,160,135,.10) 1px, transparent 1px);
    background-size:22px 22px, 22px 22px;
    background-position:0 0, 11px 11px;
  }
  html:not(.unlocked) #lock{display:flex;}
  #lock.gone{display:none !important;}

  .lock-card{
    width:100%;
    max-width:360px;
    text-align:center;
    background:#fffdf8;
    border:1px solid #e2d5c3;
    border-radius:4px;
    padding:40px 30px 34px;
    box-shadow:0 10px 30px -18px rgba(90,70,50,.4);
    position:relative;
  }
  .lock-card .tape{
    position:absolute;
    width:80px;height:26px;
    background:rgba(232,207,156,.55);
    border-left:1px dashed rgba(190,165,120,.5);
    border-right:1px dashed rgba(190,165,120,.5);
    top:-13px;left:50%;
    margin-left:-40px;
    transform:rotate(-2deg);
  }
  .lock-card h1{
    font-family:'Ma Shan Zheng', cursive;
    font-size:30px;
    font-weight:400;
    margin:0 0 8px;
    letter-spacing:.06em;
    color:#473a31;
  }
  .lock-card .tip{
    font-size:13px;
    color:#a1938a;
    margin:0 0 26px;
    line-height:1.8;
    letter-spacing:.04em;
  }
  .lock-card input{
    width:100%;
    font-family:'Noto Serif SC', serif;
    font-size:15px;
    color:#3b322b;
    background:#fbf6ec;
    border:1px solid #e2d5c3;
    border-radius:3px;
    padding:11px 14px;
    outline:none;
    text-align:center;
    letter-spacing:.28em;
    transition:border-color .2s ease;
  }
  .lock-card input:focus{border-color:#c9705a;}
  .lock-card input::placeholder{letter-spacing:.06em; color:#c0b3a8;}
  .lock-card button{
    width:100%;
    margin-top:14px;
    font-family:'Noto Serif SC', serif;
    font-size:14px;
    color:#fff;
    background:#c9705a;
    border:none;
    border-radius:3px;
    padding:11px;
    cursor:pointer;
    letter-spacing:.2em;
    transition:background .2s ease, transform .15s ease;
  }
  .lock-card button:hover{background:#b55f4a;}
  .lock-card button:active{transform:scale(.98);}
  .lock-err{
    font-size:12.5px;
    color:#c9705a;
    min-height:18px;
    margin:12px 0 0;
    opacity:0;
    transition:opacity .25s ease;
    letter-spacing:.06em;
  }
  .lock-err.show{opacity:1;}
  .lock-card.shake{animation:shake .4s ease;}
  @keyframes shake{
    0%,100%{transform:translateX(0);}
    20%{transform:translateX(-7px);}
    40%{transform:translateX(6px);}
    60%{transform:translateX(-4px);}
    80%{transform:translateX(3px);}
  }
  .lock-foot{
    font-size:11.5px;
    color:#a1938a;
    margin:20px 0 0;
    letter-spacing:.1em;
  }


  :root{
    --paper:#fbf6ec;
    --paper-2:#fffdf8;
    --ink:#3b322b;
    --ink-soft:#6f6257;
    --ink-faint:#a1938a;
    --line:#e2d5c3;
    --coral:#c9705a;
    --coral-soft:#f6e2da;
    --wheat:#e8cf9c;
    --sage:#8ca48a;
    --sage-soft:#e3ece0;
    --sky:#8aa9bd;
    --sky-soft:#dfeaf0;
    --accent:#c9705a;
    --fs:1;
  }
  body.dark{
    --paper:#221d19; --paper-2:#2b2520; --ink:#f0e8de; --ink-soft:#bcb0a2;
    --ink-faint:#897c6e; --line:#3b332c; --coral:#e89177; --coral-soft:#3a2a23;
    --wheat:#caa86a; --sage:#9bb59b; --sage-soft:#2c382c; --sky:#9bbdd2; --sky-soft:#26343c;
    --accent:#e89177;
  }

  /* ===== 设置 / 活动日志 / 提醒 / 隐私 / 外观 新增样式 ===== */
  .footer #settings-btn, .footer #hide-btn{ margin-left:10px; }
  .modal-card .set-sec{ margin:14px 0; border-top:1px solid var(--line); padding-top:12px; }
  .modal-card .set-sec h4{ margin:0 0 8px; font-size:14px; color:var(--ink-soft); }
  .set-row{ display:flex; align-items:center; gap:8px; margin:7px 0; flex-wrap:wrap; }
  .set-row label{ display:flex; align-items:center; gap:6px; font-size:13px; color:var(--ink-soft); }
  .set-col{ display:flex; flex-direction:column; gap:4px; margin:7px 0; }
  .set-col .set-lbl{ font-size:13px; color:var(--ink-soft); }
  .set-col input{ width:100%; box-sizing:border-box; }
  .swatch{ width:26px; height:26px; border-radius:50%; border:2px solid var(--line); cursor:pointer; display:inline-block; }
  .swatch.on{ border-color:var(--ink); box-shadow:0 0 0 2px var(--paper); }
  .log-list{ max-height:240px; overflow:auto; border:1px solid var(--line); border-radius:8px; padding:4px 6px; background:var(--paper-2); margin-top:6px; }
  .log-item{ font-size:12px; padding:5px 4px; border-bottom:1px dashed var(--line); color:var(--ink-soft); line-height:1.5; }
  .log-item:last-child{ border-bottom:none; }
  .log-item b{ color:var(--ink); }
  .log-item .lt{ color:var(--ink-faint); margin-left:6px; }
  #hide-overlay{ position:fixed; inset:0; background:var(--paper); z-index:9999; display:none;
    flex-direction:column; align-items:center; justify-content:center; gap:18px; }
  #hide-overlay.on{ display:flex; }
  #hide-overlay p{ font-size:20px; color:var(--ink-soft); }
  .egg-body{ font-size:15px; line-height:1.8; color:var(--ink); }

  *{box-sizing:border-box;}

  html{scroll-behavior:smooth;}

  body{
    margin:0;
    background-color:var(--paper);
    background-image:
      radial-gradient(rgba(180,160,135,.16) 1px, transparent 1px),
      radial-gradient(rgba(180,160,135,.10) 1px, transparent 1px);
    background-size:22px 22px, 22px 22px;
    background-position:0 0, 11px 11px;
    color:var(--ink);
    font-family:'Noto Serif SC', 'Songti SC', serif;
    line-height:1.85;
    -webkit-font-smoothing:antialiased;
  }

  .wrap{
    max-width:780px;
    margin:0 auto;
    padding:56px 24px 120px;
  }

  /* ---------- 封面 ---------- */
  .cover{
    position:relative;
    text-align:center;
    padding:64px 20px 56px;
    margin-bottom:52px;
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:4px;
    box-shadow:0 1px 0 rgba(0,0,0,.03), 0 10px 30px -18px rgba(90,70,50,.35);
  }

  .tape{
    position:absolute;
    width:96px;height:30px;
    background:rgba(232,207,156,.55);
    border-left:1px dashed rgba(190,165,120,.5);
    border-right:1px dashed rgba(190,165,120,.5);
  }
  .tape.tl{top:-14px;left:26px;transform:rotate(-6deg);}
  .tape.tr{top:-14px;right:26px;transform:rotate(5deg);}

  .kicker{
    font-size:12px;
    letter-spacing:.42em;
    color:var(--ink-faint);
    margin-bottom:18px;
    text-indent:.42em;
  }

  .cover h1{
    font-family:'Ma Shan Zheng', cursive;
    font-size:clamp(38px, 8vw, 56px);
    font-weight:400;
    margin:0 0 18px;
    letter-spacing:.06em;
    color:#473a31;
  }

  .cover .sub{
    font-size:14.5px;
    color:var(--ink-soft);
    max-width:440px;
    margin:0 auto;
    line-height:2;
  }

  .cover .since{
    display:inline-block;
    margin-top:26px;
    font-size:12.5px;
    color:var(--ink-faint);
    letter-spacing:.14em;
    padding:6px 18px;
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
  }

  /* ---------- 计数器 ---------- */
  .counter{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    margin-bottom:64px;
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:4px;
    overflow:hidden;
  }
  .counter div{
    text-align:center;
    padding:22px 8px;
    border-right:1px dashed var(--line);
  }
  .counter div:last-child{border-right:none;}
  .counter .num{
    display:block;
    font-family:'Ma Shan Zheng', cursive;
    font-size:32px;
    line-height:1.2;
    color:var(--coral);
  }
  .counter .label{
    display:block;
    font-size:11.5px;
    color:var(--ink-faint);
    letter-spacing:.14em;
    margin-top:4px;
  }

  /* ---------- 章节标题 ---------- */
  .section-head{
    display:flex;
    align-items:center;
    gap:14px;
    margin:0 0 36px;
  }
  .section-head .no{
    font-family:'Ma Shan Zheng', cursive;
    font-size:15px;
    color:#fff;
    background:var(--coral);
    width:30px;height:30px;
    border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0;
  }
  .section-head h2{
    font-size:21px;
    font-weight:600;
    margin:0;
    letter-spacing:.05em;
    white-space:nowrap;
  }
  .section-head .rule{
    flex:1;
    height:1px;
    background:repeating-linear-gradient(to right, var(--line) 0 6px, transparent 6px 12px);
  }
  .section-note{
    font-size:13px;
    color:var(--ink-faint);
    margin:-20px 0 30px;
    line-height:1.9;
  }

  /* ---------- 时间轴 ---------- */
  .timeline{
    position:relative;
    padding-left:38px;
    margin-bottom:76px;
  }
  .timeline::before{
    content:"";
    position:absolute;
    left:9px;
    top:8px;
    bottom:8px;
    width:1px;
    background:repeating-linear-gradient(to bottom, var(--line) 0 5px, transparent 5px 11px);
  }

  .entry{
    position:relative;
    margin-bottom:28px;
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:4px;
    padding:18px;
    box-shadow:0 6px 18px -14px rgba(90,70,50,.5);
    transition:transform .25s ease, box-shadow .25s ease;
  }
  .entry:hover{
    transform:translateX(3px);
    box-shadow:0 8px 22px -14px rgba(90,70,50,.7);
  }
  .entry::before{
    content:"";
    position:absolute;
    left:-33px;
    top:26px;
    width:11px;height:11px;
    border-radius:50%;
    background:var(--paper);
    border:1.5px solid var(--coral);
  }
  .entry::after{
    content:"";
    position:absolute;
    left:-24px;
    top:30px;
    width:16px;
    height:1px;
    background:var(--line);
  }

  .entry-inner{
    display:flex;
    gap:18px;
    align-items:flex-start;
  }

  .photo{
    flex-shrink:0;
    width:132px;
    height:132px;
    border-radius:3px;
    overflow:hidden;
    background:var(--coral-soft);
    border:5px solid #fff;
    box-shadow:0 2px 10px -4px rgba(90,70,50,.45), 0 0 0 1px var(--line);
    position:relative;
    cursor:default;
    transform:rotate(-1.2deg);
    transition:transform .3s ease;
    display:none;
  }
  .photo.has-img{display:block; cursor:zoom-in;}
  .photo.has-img:hover{transform:rotate(0deg) scale(1.02);}
  .photo img{
    width:100%;height:100%;
    object-fit:cover;
    display:block;
  }
  .photo .ph-hint{
    position:absolute;
    inset:0;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    color:#b98a7c;
    font-size:11px;
    letter-spacing:.1em;
    text-align:center;
    padding:8px;
    line-height:1.6;
  }
  .photo .ph-hint svg{opacity:.5;}

  .entry .text{flex:1;min-width:0;}
  .entry .date{
    font-size:11.5px;
    letter-spacing:.18em;
    color:var(--coral);
    display:block;
    margin-bottom:6px;
  }
  /* 置顶标记：贴着日期，小角标 */
  .entry .pin-tag{
    display:inline-block;
    vertical-align:middle;
    margin-left:6px;
    padding:1px 6px;
    font-size:10px;
    letter-spacing:.1em;
    line-height:1.6;
    color:#fff;
    background:var(--coral);
    border-radius:3px;
  }
  .entry .what{
    font-size:16px;
    font-weight:600;
    margin:0 0 6px;
    letter-spacing:.02em;
  }
  .entry .note{
    font-size:13.5px;
    color:var(--ink-soft);
    margin:0;
    line-height:1.9;
  }
  /* 评论：紧贴在这条下面（卡片内、文字下方），字体与「说点什么」那一栏一致 */
  .entry .cmt-block{
    margin-top:11px; padding-top:11px;
    border-top:1px dashed var(--line);
    display:flex; flex-direction:column; gap:7px;
  }
  .entry .cmt{
    font-size:13.5px;            /* 与 .entry .note 一致 */
    line-height:1.9;
    color:var(--ink-soft);
  }
  .entry .cmt-who{
    color:var(--coral);
    margin-right:4px;
    font-weight:600;
  }
  .entry .cmt-text{ color:var(--ink-soft); }
  .entry .tag{
    display:inline-block;
    font-size:11px;
    color:var(--ink-faint);
    border:1px solid var(--line);
    border-radius:20px;
    padding:1px 10px;
    margin-top:10px;
    letter-spacing:.1em;
  }
  .entry .tag.spec{
    color:var(--coral);
    border-color:#e8c9bd;
    background:var(--coral-soft);
  }
  .entry .cd{
    display:inline-block;
    font-size:11px;
    color:var(--sage);
    background:var(--sage-soft);
    border-radius:20px;
    padding:1px 10px;
    margin-top:10px;
    margin-left:6px;
    letter-spacing:.08em;
  }
  /* ---------- 倒计时 ---------- */
  .countdown{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
    gap:12px;
    margin-bottom:34px;
  }
  .countdown:empty{display:none;}
  /* v13：小卡片挪到封面上，做得紧凑一点，别把封面撑太长 */
  .countdown.on-cover{
    grid-template-columns:repeat(auto-fit, minmax(112px, 1fr));
    gap:8px;
    margin:14px 0 4px;
  }
  .on-cover .cd-card{padding:10px 8px;}
  .on-cover .cd-num{font-size:23px;}
  .on-cover .cd-unit{margin-bottom:3px;}
  .on-cover .cd-title{font-size:12px;}
  .on-cover .cd-date{font-size:10px; letter-spacing:.04em;}
  .cd-card.is-up .cd-num{color:var(--ink);}
  .cd-card{

    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:4px;
    padding:16px 14px;
    text-align:center;
    position:relative;
    overflow:hidden;
  }
  .cd-card::before{
    content:"";
    position:absolute;
    top:0;left:0;right:0;
    height:2px;
    background:var(--coral-soft);
  }
  .cd-card.today::before{background:var(--coral);}
  .cd-card .cd-num{
    display:block;
    font-family:'Ma Shan Zheng', cursive;
    font-size:30px;
    line-height:1.15;
    color:var(--coral);
  }
  .cd-card .cd-unit{
    font-size:11px;
    color:var(--ink-faint);
    letter-spacing:.1em;
    display:block;
    margin-bottom:6px;
  }
  .cd-card .cd-title{
    font-size:13px;
    color:var(--ink);
    font-weight:600;
    display:block;
    margin-bottom:2px;
  }
  .cd-card .cd-date{
    font-size:11px;
    color:var(--ink-faint);
    letter-spacing:.1em;
  }

  /* ---------- 新增按钮条 ---------- */
  .tl-bar{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:24px;
    flex-wrap:wrap;
  }
  .tl-bar button{
    font-family:inherit;
    font-size:13.5px;
    color:#fff;
    background:var(--coral);
    border:none;
    border-radius:99px;
    padding:9px 22px;
    cursor:pointer;
    letter-spacing:.1em;
    transition:background .2s ease, transform .15s ease;
  }
  .tl-bar button:hover{background:#b55f4a;}
  .tl-bar button:active{transform:scale(.97);}
  .tl-bar .tl-hint{
    font-size:12.5px;
    color:var(--ink-faint);
    letter-spacing:.06em;
  }
  .tl-empty{
    text-align:center;
    padding:40px 20px;
    border:1px dashed var(--line);
    border-radius:4px;
    margin-bottom:70px;
    background:rgba(255,253,248,.5);
  }
  .tl-empty p{
    font-family:'Ma Shan Zheng', cursive;
    font-size:19px;
    color:var(--ink-soft);
    margin:0 0 6px;
    letter-spacing:.05em;
  }
  .tl-empty span{
    font-size:12.5px;
    color:var(--ink-faint);
  }

  /* ---------- 排序切换（新→旧 / 旧→新） ---------- */
  .tl-sort{
    margin-left:auto;
    display:inline-flex;
    border:1px solid var(--line);
    border-radius:99px;
    overflow:hidden;
    background:var(--paper-2);
  }
  .tl-sort button{
    font-family:inherit;
    font-size:12.5px;
    letter-spacing:.06em;
    color:var(--ink-soft);
    background:transparent;
    border:none;
    padding:7px 16px;
    cursor:pointer;
    transition:background .15s ease, color .15s ease;
  }
  .tl-sort button + button{ border-left:1px solid var(--line); }
  .tl-sort button.on{
    background:var(--coral);
    color:#fff;
  }

  /* ---------- 时间线分组（置顶独立视觉分区 + 主区） ---------- */
  .tl-group + .tl-group{ margin-top:10px; }
  .tl-group-pin{
    border:1px solid var(--coral-soft);
    background:linear-gradient(180deg, rgba(246,226,218,.55), rgba(246,226,218,.18));
    border-radius:14px;
    padding:6px 14px 16px;
    box-shadow:0 1px 0 rgba(201,112,90,.12) inset;
  }
  .tl-group-head{
    display:flex;
    align-items:center;
    gap:8px;
    padding:10px 4px 12px;
  }
  .tl-group-head .tl-ico{ font-size:15px; }
  .tl-group-title{
    font-family:'Ma Shan Zheng', cursive;
    font-size:17px;
    color:var(--coral);
    letter-spacing:.05em;
  }
  .tl-group-count{
    font-size:11px;
    color:var(--ink-faint);
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:99px;
    padding:1px 9px;
  }
  .tl-group-body{ /* 分组体本身不再加外框，靠 .tl-group-pin 的外框区分 */
  }

  /* ---------- 弹窗内「用原图补时间」链接按钮 ---------- */
  .link-btn{
    align-self:flex-start;
    margin-top:6px;
    font-family:inherit;
    font-size:12.5px;
    color:var(--coral);
    background:transparent;
    border:1px dashed var(--coral-soft);
    border-radius:8px;
    padding:6px 12px;
    cursor:pointer;
    letter-spacing:.04em;
    transition:background .15s ease;
  }
  .link-btn:hover{ background:var(--coral-soft); }
  .link-btn:active{ transform:scale(.98); }

  /* ---------- 弹窗 ---------- */
  .modal{
    position:fixed;
    inset:0;
    z-index:150;
    background:rgba(52,42,34,.5);
    display:none;
    align-items:flex-start;
    justify-content:center;
    padding:40px 20px;
    overflow-y:auto;
  }
  .modal.open{display:flex;}
  /* 更新弹窗要能盖过解锁页(#lock z-index:200)，否则启动那次弹窗会被解锁页挡住、用户永远看不到 */
  #apk-update-modal{z-index:300;}
  .modal-card{
    width:100%;
    max-width:420px;
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:4px;
    padding:26px 26px 22px;
    box-shadow:0 20px 50px -20px rgba(60,45,30,.6);
  }
  .modal-card h3{
    font-family:'Ma Shan Zheng', cursive;
    font-size:22px;
    font-weight:400;
    margin:0 0 20px;
    color:#473a31;
    letter-spacing:.05em;
  }
  .modal-card label{
    display:block;
    font-size:12px;
    color:var(--ink-faint);
    letter-spacing:.14em;
    margin:16px 0 7px;
  }
  .modal-card input[type=text],
  .modal-card input[type=date],
  .modal-card input[type=time],
  .modal-card textarea{
    width:100%;
    font-family:inherit;
    font-size:13.5px;
    color:var(--ink);
    background:#fbf6ec;
    border:1px solid var(--line);
    border-radius:3px;
    padding:9px 12px;
    outline:none;
    transition:border-color .2s ease;
    resize:vertical;
  }
  /* 日子 + 几点 并排：日期占主，时间稍窄 */
  .date-time-row{ display:flex; gap:8px; align-items:center; }
  .date-time-row input[type=date]{ flex:2; min-width:0; }
  .date-time-row input[type=time]{ flex:1; min-width:0; }
  .modal-card input:focus,

  /* ---------- 最近删除（回收站） ---------- */
  .trash-open-btn{
    font-family:inherit; font-size:13px; letter-spacing:.18em;
    color:#a8452f; background:rgba(200,90,60,.08);
    border:1px solid rgba(200,90,60,.35); border-radius:3px;
    padding:9px 20px; cursor:pointer; transition:background .2s ease;
  }
  .trash-open-btn:hover{ background:rgba(200,90,60,.16); }
  /* ---------- 封底版本号 ---------- */
  .app-version{
    margin-top:18px; font-size:11px; letter-spacing:.12em;
    color:rgba(60,40,30,.42); text-align:center; user-select:text;
  }
  .app-version .ver-beian{
    display:block; margin-top:6px; font-size:10.5px; letter-spacing:.06em;
    color:rgba(60,40,30,.42); text-decoration:none; cursor:pointer;
  }
  .app-version .ver-beian:hover{ color:var(--coral); text-decoration:underline; }
  .help-beian{ margin-top:6px; font-size:12px; color:var(--ink-soft); letter-spacing:.04em; }
  .help-beian a{ color:var(--coral); text-decoration:none; }
  .help-beian a:hover{ text-decoration:underline; }
  .trash-card{ max-width:480px; }
  .trash-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
  .trash-head h3{ margin:0; }
  .trash-close{
    font-family:inherit; font-size:24px; line-height:1; color:var(--ink-faint);
    background:none; border:none; cursor:pointer; padding:0 4px;
  }
  .trash-close:hover{ color:var(--coral); }
  .trash-head-actions{ display:flex; align-items:center; gap:10px; }
  .trash-clear-all{
    font-family:inherit; font-size:13px; color:var(--coral);
    background:none; border:1px solid var(--line); border-radius:6px;
    padding:4px 10px; cursor:pointer;
  }
  .trash-clear-all:hover{ border-color:var(--coral); }
  .trash-clear-all:disabled{ opacity:.6; cursor:default; }
  .trash-clear-all[hidden]{ display:none; }
  .trash-tip{ font-size:12px; color:var(--ink-faint); line-height:1.7; margin:0 0 14px; }
  .trash-list{ max-height:58vh; overflow-y:auto; margin:-4px; padding:4px; }
  .trash-loading, .trash-empty{ font-size:13px; color:var(--ink-faint); text-align:center; padding:30px 10px; line-height:1.8; }
  .trash-item{
    border:1px solid var(--line); border-radius:4px; padding:12px 13px; margin-bottom:11px;
    background:#fbf6ec;
  }
  /* ============ 封面通知条：别的设备新增了内容 ============
     位置：封皮（header.cover）下边、情话和天气上边——最容易看到的地方。
     注意：display:flex 会盖掉 [hidden] 的 display:none，必须显式写一条，
     否则没通知时空容器也会占着 margin 撑开间距。 */
  .notif-stack{
    display:flex; flex-direction:column; gap:8px;
    /* 负的 margin-top 是为了抵掉 .cover 自带的 margin-bottom:52px，
       让通知条更贴封皮又不过分挤压；没通知时整块 display:none，布局分毫不动。 */
    margin:-24px auto 20px; max-width:560px; width:100%;
  }
  .notif-stack[hidden]{ display:none; }
  .notif-bar{
    display:flex; align-items:center; gap:10px;
    padding:9px 12px;
    background:linear-gradient(180deg,#fff7f0,#fdeee4);
    border:1px solid var(--coral);
    border-radius:10px;
    box-shadow:0 2px 9px rgba(201,112,90,.16);
    color:var(--ink);
  }
  .nf-text{ flex:1; min-width:0; line-height:1.5; }
  .nf-text b{ font-weight:700; }
  .nf-who{ color:var(--coral); }
  .nf-when{ display:block; font-size:12px; color:var(--ink-faint); margin-top:1px; }
  .nf-sample{ display:block; font-size:12px; color:var(--ink-faint); margin-top:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .nf-btns{ display:flex; flex-shrink:0; gap:7px; }
  .nf-read, .nf-view{
    font-family:inherit; font-size:13px; cursor:pointer;
    padding:6px 12px; border-radius:8px; border:1px solid var(--coral);
    background:#fff; color:var(--coral); white-space:nowrap;
  }
  .nf-read:hover, .nf-view:hover{ background:var(--coral-soft); }
  .nf-view{ background:var(--coral); color:#fff; }
  .nf-view:hover{ background:#b75b44; color:#fff; }
  @media (max-width:520px){
    .notif-bar{ flex-direction:column; align-items:stretch; gap:7px; }
    .nf-btns{ justify-content:flex-end; }
  }
  .trash-meta{ display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 10px; font-size:11.5px; color:var(--ink-faint); }
  .trash-type{
    font-size:11px; letter-spacing:.12em; color:#a8452f;
    border:1px solid rgba(200,90,60,.35); border-radius:10px; padding:1px 9px;
  }
  .trash-left{ margin-left:auto; color:#a8452f; }
  .trash-preview{
    font-size:14px; color:var(--ink); margin:8px 0 10px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .trash-actions{ display:flex; gap:10px; }
  .trash-actions button{
    font-family:inherit; font-size:12.5px; letter-spacing:.1em; cursor:pointer;
    border-radius:3px; padding:7px 14px; border:1px solid var(--line); background:#fff; color:var(--ink);
  }
  .trash-restore:hover{ border-color:#3a7d44; color:#3a7d44; }
  .trash-purge{ color:#a8452f; border-color:rgba(200,90,60,.4); }
  .trash-purge:hover{ background:rgba(200,90,60,.12); }
  .trash-actions button:disabled{ opacity:.5; cursor:default; }


  .modal-card textarea:focus{border-color:var(--coral);}
  .modal-card input::placeholder,
  .modal-card textarea::placeholder{color:#c0b3a8;}

  .type-picker{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
  }
  .type-picker button{
    font-family:inherit;
    font-size:12.5px;
    color:var(--ink-soft);
    background:transparent;
    border:1px solid var(--line);
    border-radius:99px;
    padding:5px 14px;
    cursor:pointer;
    transition:all .2s ease;
  }
  .type-picker button:hover{border-color:var(--coral); color:var(--coral);}
  .type-picker button.on{
    background:var(--coral);
    border-color:var(--coral);
    color:#fff;
  }
  .type-note{
    font-size:11.5px;
    color:var(--ink-faint);
    margin:8px 0 0;
    letter-spacing:.05em;
  }

  .photo-pick{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }
  .photo-pick .photo-wrap{ position:relative; display:inline-block; }
  .photo-pick input.file-cover{
    position:absolute; top:0; left:0; width:100%; height:100%;
    margin:0; padding:0; border:0; opacity:0;
    font-size:0; line-height:0; cursor:pointer;
    pointer-events:auto; z-index:2;   /* 手指直接点到真正的 file input 上，PWA 全屏也能弹相册 */
  }
  .photo-pick .photo-wrap .btn-file{ pointer-events:none; }
  .photo-pick .photo-prev{
    width:52px;height:52px;
    border-radius:3px;
    border:1px solid var(--line);
    background:var(--coral-soft);
    overflow:hidden;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .photo-pick .photo-prev img{width:100%;height:100%;object-fit:cover;display:block;}
  .photo-pick .btn-file{
    font-family:inherit;
    font-size:12.5px;
    color:var(--coral);
    background:transparent;
    border:1px solid var(--coral);
    border-radius:3px;
    padding:7px 16px;
    cursor:pointer;
    transition:all .2s ease;
    white-space:nowrap;
  }
  .photo-pick .btn-file:hover{background:var(--coral); color:#fff;}
  /* 「从文件选」：第二入口，走系统文件管理器（保住原文件名，微信图可自动读日期） */
  .photo-pick .btn-file-doc{ margin-left:8px; border-style:dashed; }
  .photo-pick .photo-name{
    font-size:11.5px;
    color:var(--ink-faint);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .modal-actions{
    display:flex;
    gap:10px;
    margin-top:26px;
  }
  .modal-actions button{
    flex:1;
    font-family:inherit;
    font-size:13.5px;
    border-radius:3px;
    padding:10px;
    cursor:pointer;
    letter-spacing:.1em;
    transition:all .2s ease;
  }
  .modal-actions #ev-cancel{
    color:var(--ink-soft);
    background:transparent;
    border:1px solid var(--line);
  }
  .modal-actions #ev-cancel:hover{border-color:var(--ink-faint);}
  .modal-actions .primary{
    color:#fff;
    background:var(--coral);
    border:none;
  }
  .modal-actions .primary:hover{background:#b55f4a;}
  .modal-actions .primary.danger-red{ background:#c0392b; }
  .modal-actions .primary.danger-red:hover{ background:#a93226; }

  /* ---------- 愿望清单 ---------- */
  .wishes{
    list-style:none;
    padding:0;
    margin:0 0 18px;
  }
  .wish{
    position:relative;
    display:flex;
    gap:16px;
    align-items:flex-start;
    padding:18px 20px;
    margin-bottom:12px;
    background:var(--paper-2);
    border:1px dashed var(--line);
    border-radius:4px;
    transition:background .25s ease, border-color .25s ease;
    animation:pop .35s ease both;
  }
  @keyframes pop{
    from{opacity:0; transform:translateY(-6px);}
    to{opacity:1; transform:translateY(0);}
  }
  .wish:hover{
    background:#fffef9;
    border-color:var(--wheat);
  }
  .wish .box{
    width:20px;height:20px;
    flex-shrink:0;
    margin-top:4px;
    border:1.5px solid var(--ink-faint);
    border-radius:3px;
    cursor:pointer;
    display:flex;align-items:center;justify-content:center;
    transition:all .2s ease;
    background:transparent;
    padding:0;
  }
  .wish .box::after{
    content:"";
    width:10px;height:6px;
    border-left:1.8px solid #fff;
    border-bottom:1.8px solid #fff;
    transform:rotate(-45deg) translate(1px,-1px);
    opacity:0;
    transition:opacity .2s ease;
  }
  .wish.done .box{
    background:var(--sage);
    border-color:var(--sage);
  }
  .wish.done .box::after{opacity:1;}

  .wish .body{flex:1;min-width:0;}
  .wish .title{
    font-size:15px;
    font-weight:600;
    margin:0 0 4px;
    display:flex;
    align-items:baseline;
    gap:10px;
    flex-wrap:wrap;
    line-height:1.6;
  }
  .wish .idx{
    font-family:'Ma Shan Zheng', cursive;
    font-size:13px;
    color:var(--wheat);
    font-weight:400;
    flex-shrink:0;
  }
  .wish.done .txt{
    text-decoration:line-through;
    text-decoration-color:var(--ink-faint);
    color:var(--ink-faint);
    text-decoration-thickness:1px;
  }
  .wish .desc{
    font-size:13px;
    color:var(--ink-soft);
    margin:0;
    line-height:1.85;
  }
  .wish.done .desc{color:var(--ink-faint);}


  /* 添加表单 */
  .add-form{
    display:flex;
    gap:10px;
    padding:16px;
    background:var(--coral-soft);
    border:1px dashed #dfb5a5;
    border-radius:4px;
    margin-bottom:64px;
    flex-wrap:wrap;
  }
  .add-form input[type=text]{
    flex:1;
    min-width:150px;
    font-family:inherit;
    font-size:13.5px;
    color:var(--ink);
    background:var(--paper-2);
    border:1px solid #e3c4b6;
    border-radius:3px;
    padding:9px 12px;
    outline:none;
    transition:border-color .2s ease;
  }
  .add-form input[type=text]::placeholder{color:#c4a294;}
  .add-form input[type=text]:focus{border-color:var(--coral);}
  .add-form .desc-input{flex:2;}
  .add-form button{
    font-family:inherit;
    font-size:13.5px;
    color:#fff;
    background:var(--coral);
    border:none;
    border-radius:3px;
    padding:9px 22px;
    cursor:pointer;
    letter-spacing:.1em;
    transition:background .2s ease, transform .15s ease;
    white-space:nowrap;
  }
  .add-form button:hover{background:#b55f4a;}
  .add-form button:active{transform:scale(.97);}

  /* 「有重复的待办事项」提醒条：默认隐藏，.show 时出现 */
  .wish-dup-hint{
    margin:-52px 0 22px;
    padding:9px 14px;
    font-size:13px;
    color:#9a3b2a;
    background:#fdece7;
    border:1px solid #f3c4b6;
    border-radius:4px;
    opacity:0;
    transform:translateY(-4px);
    transition:opacity .2s ease, transform .2s ease;
    pointer-events:none;
  }
  .wish-dup-hint.show{opacity:1;transform:translateY(0);}

  .progress-wrap{
    margin:0 0 40px;
  }
  .progress-label{
    display:flex;
    justify-content:space-between;
    font-size:12px;
    color:var(--ink-faint);
    letter-spacing:.1em;
    margin-bottom:10px;
  }
  .progress-bar{
    height:6px;
    background:var(--coral-soft);
    border-radius:99px;
    overflow:hidden;
  }
  .progress-fill{
    height:100%;
    width:0%;
    background:var(--coral);
    border-radius:99px;
    transition:width .6s cubic-bezier(.3,.9,.3,1);
  }

  /* ---------- 随机抽一条 ---------- */
  .draw{
    text-align:center;
    padding:34px 22px;
    margin-bottom:70px;
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:4px;
    position:relative;
  }
  .draw .draw-label{
    font-size:11.5px;
    letter-spacing:.28em;
    color:var(--ink-faint);
    margin-bottom:18px;
    text-indent:.28em;
  }
  .draw .result{
    font-family:'Ma Shan Zheng', cursive;
    font-size:22px;
    color:#473a31;
    min-height:38px;
    margin-bottom:6px;
    line-height:1.5;
    letter-spacing:.03em;
  }
  .draw .result.hint{
    font-family:'Noto Serif SC', serif;
    font-size:13.5px;
    color:var(--ink-faint);
    letter-spacing:.05em;
  }
  .draw .result-desc{
    font-size:13px;
    color:var(--ink-soft);
    max-width:460px;
    margin:0 auto 22px;
    line-height:1.9;
    min-height:20px;
  }
  .draw .draw-row{
    display:flex; gap:10px; justify-content:center; flex-wrap:wrap;
  }
  .draw .draw-row button{
    font-family:inherit;
    font-size:13.5px;
    color:var(--coral);
    background:transparent;
    border:1px solid var(--coral);
    border-radius:99px;
    padding:8px 30px;
    cursor:pointer;
    letter-spacing:.14em;
    transition:all .25s ease;
  }
  .draw .draw-row button:hover{background:var(--coral); color:#fff;}
  .draw .draw-row button:active{transform:scale(.97);}
  .draw .draw-row button[hidden]{display:none;}

  .draw .draw-modes{
    display:flex; gap:8px; justify-content:center;
    margin-bottom:14px;
  }
  .draw .draw-mode{
    font-family:inherit; font-size:12px;
    color:var(--ink-soft); background:transparent;
    border:1px solid var(--line);
    border-radius:99px; padding:5px 14px;
    cursor:pointer; letter-spacing:.08em;
    transition:all .2s ease;
  }
  .draw .draw-mode .cnt{font-size:11px; opacity:.7; margin-left:2px;}
  .draw .draw-mode.on{
    background:var(--coral); border-color:var(--coral); color:#fff;
  }
  .draw .draw-cats{
    display:flex; flex-wrap:wrap; gap:6px;
    justify-content:center;
    margin-bottom:18px;
  }
  .draw .draw-cat{
    font-family:inherit; font-size:11.5px;
    color:var(--ink-faint); background:transparent;
    border:1px dashed var(--line);
    border-radius:99px; padding:3px 11px;
    cursor:pointer;
    transition:all .2s ease;
  }
  .draw .draw-cat.on{
    border-style:solid; border-color:var(--coral);
    color:var(--coral); background:var(--coral-soft);
  }
  .draw .draw-tip{
    font-size:11.5px; color:var(--ink-faint);
    letter-spacing:.08em; margin:14px 0 0; opacity:.75;
  }

  /* ---------- 两个人各写一半 ---------- */
  .halves{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
    margin-bottom:70px;
  }
  .half{
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:4px;
    padding:22px 20px;
    position:relative;
  }
  .half::before{
    content:"";
    position:absolute;
    top:0;left:0;right:0;
    height:3px;
    background:var(--sky-soft);
    border-radius:4px 4px 0 0;
  }
  .half.her::before{background:var(--coral-soft);}
  .half .who{
    font-size:11.5px;
    letter-spacing:.24em;
    color:var(--ink-faint);
    margin-bottom:14px;
    text-indent:.24em;
  }
  .half .q{
    font-size:13px;
    color:var(--ink-faint);
    margin:18px 0 4px;
    letter-spacing:.03em;
  }
  .half .a{
    font-size:15.5px;
    color:var(--ink);
    margin:0;
    line-height:1.8;
    font-weight:600;
  }
  .half .a.blank{
    color:var(--ink-faint);
    font-weight:400;
    font-size:13px;
    border-bottom:1px dashed var(--line);
    display:block;
    padding-bottom:4px;
  }

  /* ---------- 不敢说的话 ---------- */
  .whispers{
    margin-bottom:70px;
  }
  .whisper{
    position:relative;
    padding:16px 20px 16px 40px;
    margin-bottom:12px;
    background:linear-gradient(to right, rgba(223,234,240,.45), rgba(255,253,248,0));
    border-left:2px solid var(--sky);
    border-radius:0 4px 4px 0;
  }
  .whisper::before{
    content:"“";
    position:absolute;
    left:12px;
    top:12px;
    font-family:'Ma Shan Zheng', cursive;
    font-size:26px;
    color:var(--sky);
    opacity:.55;
    line-height:1;
  }
  .whisper p{
    margin:0;
    font-size:13.5px;
    color:var(--ink-soft);
    line-height:1.95;
  }
  .whisper .when{
    display:block;
    font-size:11px;
    color:var(--ink-faint);
    letter-spacing:.14em;
    margin-top:8px;
  }

  /* ---------- 尾页 ---------- */
  .footer{
    text-align:center;
    padding:48px 20px 20px;
    border-top:1px dashed var(--line);
    margin-top:10px;
  }
  /* 从桌面图标全屏打开时，避开刘海和底部小黑条 */
  @supports (padding: env(safe-area-inset-top)) {
    body{ padding-top: env(safe-area-inset-top); }
    .footer{ padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  }
  .help-btn[hidden]{ display:none !important; }
  .footer p{
    font-family:'Ma Shan Zheng', cursive;
    font-size:20px;
    color:var(--ink-soft);
    margin:0 0 8px;
    letter-spacing:.05em;
  }
  .footer small{
    font-size:12px;
    color:var(--ink-faint);
    letter-spacing:.16em;
  }
  .sync-wrap{
    margin-top:14px;
  }
  /* 连接状态块（云端已连接 / 云端未连接）——与同步状态分列显示 */
  .net-state{
    font-size:11px;
    color:var(--ink-faint);
    letter-spacing:.12em;
    border:1px solid var(--line);
    border-radius:20px;
    padding:2px 12px;
    display:inline-block;
    margin-right:6px;
  }
  .net-state.ok{
    color:#4e7a52;
    border-color:#bcd6bd;
  }
  .net-state.bad{
    color:#a8563f;
    border-color:#e2c1b4;
  }
  .sync-state{
    font-size:11px;
    color:var(--ink-faint);
    letter-spacing:.12em;
    border:1px solid var(--line);
    border-radius:20px;
    padding:2px 12px;
    display:inline-block;
  }
  .sync-state.bad{
    color:#a8563f;
    border-color:#e2c1b4;
  }
  .save-state{
    font-size:11px;
    color:var(--ink-faint);
    letter-spacing:.12em;
    border:1px solid var(--line);
    border-radius:20px;
    padding:2px 12px;
    display:inline-block;
    margin-left:6px;
  }
  .save-state.bad{
    color:#a8563f;
    border-color:#e2c1b4;
  }
  .save-state.warn{
    color:#9a7b2e;
    border-color:#e6d9a8;
  }
  .footer #relock-btn{
    font-family:inherit;
    font-size:11.5px;
    color:var(--ink-faint);
    background:transparent;
    border:1px solid var(--line);
    border-radius:99px;
    padding:4px 16px;
    cursor:pointer;
    letter-spacing:.14em;
    transition:all .25s ease;
  }
  .footer #relock-btn:hover{
    color:var(--coral);
    border-color:var(--coral);
  }

  /* ---------- 照片查看器 ---------- */
  .viewer{
    position:fixed;
    inset:0;
    background:rgba(52,42,34,.86);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:99;
    padding:24px;
    cursor:zoom-out;
  }
  .viewer.open{display:flex;}
  .viewer img{
    max-width:100%;
    max-height:86vh;
    border:6px solid #fff;
    border-radius:2px;
    box-shadow:0 20px 60px -20px rgba(0,0,0,.7);
  }

  @media (max-width:600px){
    .wrap{padding:36px 16px 90px;}
    .cover{padding:46px 16px 40px;}
    .cover .tape{width:70px;height:24px;}
    .counter{grid-template-columns:repeat(2, 1fr);}
    .counter div:nth-child(2){border-right:none;}
    .counter div:nth-child(1),
    .counter div:nth-child(2){border-bottom:1px dashed var(--line);}
    .counter .num{font-size:28px;}
    .timeline{padding-left:26px;}
    .timeline::before{left:7px;}
    .entry{padding:14px;}
    .entry::before{left:-25px; width:9px;height:9px; top:22px;}
    .entry::after{left:-18px;width:10px;top:26px;}
    .entry-inner{gap:13px;}
    .photo{width:88px;height:88px;border-width:4px;}
    .photo:not(.has-img){display:none;}
    .entry .what{font-size:15px;}
    .entry .note{font-size:12.5px;}
    .entry .cmt{font-size:12.5px;}
    .section-head h2{font-size:18px;}
    .section-head .no{width:26px;height:26px;font-size:13px;}
    .halves{grid-template-columns:1fr;}
    .add-form{flex-direction:column;}
    .add-form button{width:100%;}
    .draw .result{font-size:19px;}
  }


  /* ---------- 封面可直接改 ---------- */
  [contenteditable="true"]{
    outline:none;
    border-bottom:1px dashed transparent;
    transition:border-color .2s ease;
  }
  [contenteditable="true"]:hover{border-bottom-color:var(--line);}
  [contenteditable="true"]:focus{
    border-bottom-color:var(--coral);
    background:rgba(232,122,95,.05);
  }

  /* ---------- 你记的，和我记的 ---------- */
  .qa-item{
    position:relative;
    padding-right:0;
    margin:18px 0 4px;
  }
  .qa-empty{
    font-size:13px;
    color:var(--ink-faint);
    line-height:1.9;
    margin:8px 0;
  }

  /* ---------- 没敢说出口的 ---------- */
  /* ---------- 长按操作 ---------- */
  .pressing{opacity:.5; transition:opacity .18s ease;}
  .sheet-mask{
    position:fixed; inset:0;
    background:rgba(70,55,45,.34);
    opacity:0; pointer-events:none;
    transition:opacity .22s ease;
    z-index:160;
  }
  .sheet-mask.on{opacity:1; pointer-events:auto;}
  .sheet{
    position:fixed; left:0; right:0; bottom:0;
    z-index:161;
    padding:0 12px 16px;
    transform:translateY(118%);
    transition:transform .26s cubic-bezier(.32,.9,.32,1);
  }
  .sheet.on{transform:translateY(0);}
  .sheet-inner{
    max-width:380px; margin:0 auto;
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 -8px 34px -12px rgba(90,70,50,.45);
  }
  .sheet-title{
    font-size:11.5px; color:var(--ink-faint);
    letter-spacing:.1em; text-align:center;
    padding:13px 16px 11px;
    border-bottom:1px solid var(--line);
    line-height:1.65;
  }
  .sheet-btn{
    display:block; width:100%;
    border:none; background:transparent;
    font-family:inherit; font-size:15px;
    color:var(--ink); padding:15px 16px;
    cursor:pointer; text-align:center;
    border-bottom:1px solid var(--line);
    letter-spacing:.08em;
    -webkit-tap-highlight-color:transparent;
  }
  .sheet-btn:active{background:var(--coral-soft);}
  .sheet-btn.danger{color:var(--coral);}
  .sheet-btn.accent{color:#3f7cae;}
  .sheet-btn.pin{color:#b8860b;}
  .sheet-btn.cancel{color:var(--ink-faint); border-bottom:none; font-size:13.5px;}
  .sheet-btn[hidden]{display:none;}

  /* ---------- 封面下的一句情话 ---------- */
  .lovebar{
    display:flex; align-items:center; gap:11px;
    margin:0 0 34px;
    padding:12px 14px;
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
    background:linear-gradient(90deg, rgba(232,122,95,.07), rgba(232,122,95,0) 72%);
    cursor:pointer;
    user-select:none;
    -webkit-tap-highlight-color:transparent;
    -webkit-touch-callout:none;
  }
  .lovebar .lb-mark{
    font-family:'Ma Shan Zheng', cursive;
    font-size:24px; line-height:1;
    color:var(--coral); opacity:.45;
    flex-shrink:0;
  }
  .lovebar .lb-text{
    flex:1; min-width:0;
    font-family:'Ma Shan Zheng', cursive;
    font-size:16.5px; line-height:1.8;
    color:var(--ink-soft);
    letter-spacing:.02em;
    transition:opacity .28s ease;
  }
  .lovebar .lb-text.fade{opacity:0;}
  .lovebar .lb-btn{
    flex-shrink:0;
    border:1px solid var(--line);
    background:transparent;
    font-family:inherit; font-size:11px;
    color:var(--ink-faint);
    letter-spacing:.14em;
    padding:4px 9px; border-radius:20px;
    cursor:pointer;
    transition:all .2s ease;
  }
  .lovebar .lb-btn:hover{color:var(--coral); border-color:var(--coral); background:var(--coral-soft);}
  @media (max-width:520px){
    .lovebar .lb-text{font-size:15px;}
    .lovebar{padding:11px 12px; gap:9px;}
  }

  /* ---------- 今日天气 ---------- */
  .weather{
    margin:0 0 30px;
    padding:13px 15px 12px;
    border:1px solid var(--line);
    border-radius:3px;
    background:linear-gradient(120deg, rgba(138,169,189,.11), rgba(138,169,189,0) 70%);
    position:relative;
  }
  .weather[hidden]{display:none;}
  .wx-top{display:flex; align-items:center; gap:12px;}
  .wx-icon{font-size:26px; line-height:1; flex-shrink:0;}
  .wx-mid{flex:1; min-width:0; display:block;}
  .wx-city{display:block; font-size:11.5px; letter-spacing:.16em; color:var(--ink-faint);}
  .wx-desc{display:block; font-size:14px; color:var(--ink); margin-top:3px; letter-spacing:.04em;}
  .wx-temp{flex-shrink:0; font-size:13px; color:var(--ink-soft); letter-spacing:.04em;}
  .wx-refresh{
    flex-shrink:0; font-size:10.5px; letter-spacing:.14em;
    color:var(--ink-faint); opacity:.5; cursor:pointer;
    transition:all .2s ease; user-select:none;
  }
  .wx-refresh:hover{opacity:1; color:var(--coral);}
  .wx-advice{
    margin:11px 0 0;
    font-family:'Ma Shan Zheng', cursive;
    font-size:16.5px; line-height:1.85;
    color:var(--ink-soft); letter-spacing:.02em;
  }
  .wx-pick{
    margin-top:11px; padding-top:10px;
    border-top:1px dashed var(--line);
    display:flex; align-items:flex-start; gap:10px; flex-wrap:wrap;
  }
  .wx-pick[hidden]{display:none;}
  .wp-label{flex-shrink:0; font-size:11px; letter-spacing:.16em; color:var(--ink-faint); padding-top:3px;}
  .wp-body{flex:1; min-width:0;}
  .wp-text{display:block; font-size:14px; color:var(--ink); line-height:1.65;}
  .wp-note{
    display:block; font-family:'Ma Shan Zheng', cursive;
    font-size:14.5px; color:var(--ink-faint); margin-top:3px; line-height:1.7;
  }
  .wp-add{
    flex-shrink:0; border:1px solid var(--line); background:transparent;
    font-family:inherit; font-size:11.5px; color:var(--ink-faint);
    letter-spacing:.12em; padding:5px 11px; border-radius:20px; cursor:pointer;
    transition:all .2s ease;
  }
  .wp-add:hover{color:var(--coral); border-color:var(--coral); background:var(--coral-soft);}
  @media (max-width:520px){
    .wx-advice{font-size:15.5px;}
    .wx-pick{gap:8px;}
    .wp-add{padding:6px 12px;}
  }

  /* ---------- 封面天气卡：点开看详情 ---------- */
  .weather{ cursor:pointer; }
  .weather .wx-refresh, .weather .wx-city{ cursor:pointer; }
  .wx-tap{
    display:inline-block; margin-top:9px;
    font-size:11px; letter-spacing:.1em; color:var(--ink-faint);
    opacity:.7; user-select:none; -webkit-user-select:none;
    transition:color .2s ease, opacity .2s ease;
  }
  .weather:hover .wx-tap{ color:var(--coral); opacity:1; }

  /* ---------- 天气详情弹窗（底部上滑，可上下滑动） ---------- */
  .wx-modal{
    position:fixed; inset:0; z-index:170;
    display:none;
  }
  .wx-modal:not([hidden]){ display:block; }
  .wx-modal-mask{
    position:absolute; inset:0;
    background:rgba(60,48,38,.42);
    opacity:0; pointer-events:none;
    transition:opacity .24s ease;
  }
  .wx-modal.on .wx-modal-mask{ opacity:1; pointer-events:auto; }
  .wx-card{
    position:absolute; left:0; right:0; bottom:0;
    max-height:88vh; max-height:88dvh;
    display:flex; flex-direction:column;
    background:var(--paper-2);
    border:1px solid var(--line);
    border-bottom:none;
    border-radius:16px 16px 0 0;
    box-shadow:0 -10px 40px -14px rgba(90,70,50,.5);
    transform:translateY(106%);
    transition:transform .3s cubic-bezier(.32,.9,.32,1);
    z-index:2;
  }
  .wx-modal.on .wx-card{ transform:translateY(0); }
  .wx-card-grip{
    width:40px; height:4px; border-radius:3px;
    background:var(--line); opacity:.7;
    margin:9px auto 2px; flex-shrink:0;
  }
  .wx-card-x{
    position:absolute; top:7px; right:9px; z-index:3;
    width:30px; height:30px; line-height:28px; text-align:center;
    border:none; background:transparent; cursor:pointer;
    font-size:22px; color:var(--ink-faint); border-radius:50%;
    transition:all .2s ease;
  }
  .wx-card-x:hover{ color:var(--coral); background:var(--coral-soft); }
  .wx-head{
    display:flex; align-items:center; gap:12px;
    padding:6px 18px 12px;
    border-bottom:1px solid var(--line);
    flex-shrink:0;
  }
  .wx-head{ padding-right:46px; }
  .wxm-icon{ font-size:30px; line-height:1; flex-shrink:0; }
  .wxm-head-mid{ flex:1; min-width:0; }
  .wxm-city{ display:block; font-size:12px; letter-spacing:.16em; color:var(--ink-faint); cursor:pointer; transition:color .2s ease; }
  .wxm-city:hover{ color:var(--coral); }
  .wxm-desc{ display:block; font-size:16px; color:var(--ink); margin-top:3px; letter-spacing:.04em; }
  .wxm-temp{ flex-shrink:0; font-size:15px; color:var(--ink-soft); letter-spacing:.04em; }
  .wx-card-scroll{
    overflow-y:auto; -webkit-overflow-scrolling:touch;
    padding:4px 18px 12px;
    flex:1; min-height:0;
  }
  .wxm-now{
    margin:10px 0 4px; padding:10px 12px;
    background:linear-gradient(120deg, rgba(138,169,189,.10), rgba(138,169,189,0) 70%);
    border:1px solid var(--line); border-radius:6px;
    font-size:13px; line-height:1.95; color:var(--ink-soft);
    letter-spacing:.02em;
  }
  .wxm-now b{ color:var(--ink); font-weight:600; }
  .wxm-vs{
    margin:8px 0 2px; font-size:12.5px; color:var(--ink-soft);
    letter-spacing:.04em;
  }
  .wxm-sec{ margin-top:16px; }
  .wxm-sec h4{
    font-size:12px; letter-spacing:.18em; color:var(--ink-faint);
    margin:0 0 7px; font-weight:600;
  }
  .wxm-life{
    display:grid; grid-template-columns:repeat(2,1fr); gap:8px;
  }
  .wxm-life-row{
    border:1px solid var(--line); border-radius:6px;
    padding:8px 10px; background:var(--paper);
  }
  .wxm-life-row .lr-name{ display:block; font-size:11px; letter-spacing:.1em; color:var(--ink-faint); }
  .wxm-life-row .lr-val{ display:block; font-size:15px; color:var(--ink); margin-top:2px; }
  .wxm-life-row .lr-sub{ display:block; font-size:11px; margin-top:1px; }
  .wxm-life-row.ok .lr-sub{ color:#3d7a5a; }
  .wxm-life-row.warn{ border-color:rgba(200,90,60,.4); background:var(--coral-soft); }
  .wxm-life-row.warn .lr-sub{ color:var(--coral); }
  .wxm-astro{ font-size:13px; color:var(--ink-soft); line-height:1.95; }
  .wxm-astro b{ color:var(--ink); font-weight:600; }
  .wx-card-foot{
    flex-shrink:0; padding:10px 18px calc(12px + env(safe-area-inset-bottom));
    border-top:1px solid var(--line);
    display:flex; align-items:center; gap:10px;
  }
  .wxm-refresh{
    font-family:inherit; font-size:12.5px; letter-spacing:.12em;
    color:var(--ink-soft); background:transparent;
    border:1px solid var(--line); border-radius:20px;
    padding:8px 16px; cursor:pointer; transition:all .2s ease;
    -webkit-tap-highlight-color:transparent;
  }
  .wxm-refresh:hover{ color:var(--coral); border-color:var(--coral); background:var(--coral-soft); }
  .wxm-src{ font-size:11px; color:var(--ink-faint); letter-spacing:.04em; }
  body.wx-modal-open{ overflow:hidden; }
  @media (min-width:560px){
    .wx-card{ left:50%; right:auto; transform:translate(-50%,106%); width:460px; border-radius:16px 16px 0 0; }
    .wx-modal.on .wx-card{ transform:translate(-50%,0); }
  }

  /* ---------- 地点选择 ---------- */
  .wx-city{cursor:pointer; transition:color .2s ease;}
  .wx-city:hover{color:var(--coral);}
  .wx-city::after{content:' \B7 改'; font-size:9.5px; opacity:.55; letter-spacing:.1em;}
  .place-hint{
    font-size:12.5px; line-height:1.85; color:var(--ink-faint);
    margin:-8px 0 16px; letter-spacing:.02em;
  }
  .place-results{margin-top:16px; max-height:200px; overflow-y:auto;}
  .place-row{
    display:block; width:100%; text-align:left;
    font-family:inherit; font-size:13.5px; line-height:1.5;
    padding:10px 12px; margin-bottom:6px;
    background:var(--paper); border:1px solid var(--line);
    border-radius:3px; cursor:pointer; color:var(--ink);
    transition:all .2s ease;
  }
  .place-row:hover{border-color:var(--coral); background:var(--coral-soft);}
  .place-row small{
    display:block; font-size:11px; color:var(--ink-faint);
    margin-top:3px; letter-spacing:.06em;
  }
  .place-empty{
    font-size:12.5px; color:var(--ink-faint);
    padding:12px 0; text-align:center; letter-spacing:.04em;
  }
  .modal-actions .ghost{
    color:var(--ink-soft); background:transparent; border:1px solid var(--line);
  }
  .modal-actions .ghost:hover{border-color:var(--ink-faint);}

  /* ---------- 说明 ---------- */
  .help-btn{
    font-family:inherit; font-size:12px; letter-spacing:.16em;
    color:var(--ink-faint); background:transparent;
    border:1px solid var(--line); border-radius:20px;
    padding:7px 18px; cursor:pointer; transition:all .2s ease;
  }
  .help-btn:hover{color:var(--coral); border-color:var(--coral);}
  .help-card{max-width:530px;}
  .help-body{font-size:13px; line-height:1.95; color:var(--ink-soft);}
  .help-body h4{
    font-size:13px; font-weight:600; color:var(--ink);
    margin:20px 0 7px; letter-spacing:.06em;
  }
  .help-body h4:first-child{margin-top:0;}
  .help-body p{margin:0 0 8px;}
  .help-body ul{margin:0 0 8px; padding-left:18px;}
  .help-body li{margin-bottom:5px;}
  .help-body b{color:var(--ink); font-weight:600;}
  .help-body .warn{color:var(--coral);}
  .help-body hr{border:none; border-top:1px dashed var(--line); margin:18px 0;}
  /* ---- 加密口令相关 ---- */
  #lock-card input[hidden]{display:none;}
  #lock-card[hidden], #recovery-card[hidden]{display:none !important;}
  .pw-hint{
    font-size:12px; line-height:1.7; color:var(--ink-faint);
    text-align:left; margin:10px 0 0;
  }
  .pw-hint b{color:var(--ink); font-weight:600;}
  .pw-hint.bad{color:var(--coral);}
  .pw-hint.ok{color:#3d7a5a;}
  .lock-link{
    display:block; margin:12px auto 0; padding:0;
    background:none; border:none; cursor:pointer;
    font-family:inherit; font-size:12px; color:var(--coral);
    text-decoration:underline; letter-spacing:.05em;
  }
  .rec-code{
    font-family:'Courier New', monospace; font-size:16px; letter-spacing:.08em;
    background:var(--coral-soft); border-radius:3px;
    padding:12px 10px; margin:14px 0 0; word-break:break-all;
  }
  #recovery-card[hidden]{display:none;}
  .sec-badge{
    font-size:11px; color:var(--ink-faint); letter-spacing:.08em;
    margin-top:6px;
  }
  .help-body .k{
    display:inline-block; font-size:11.5px; color:var(--ink);
    background:var(--coral-soft); border-radius:2px;
    padding:0 6px; margin:0 1px;
  }

  /* ---- v8：事件弹窗照片条（最多 3 张，可设封面）---- */
  .photo-strip{ display:flex; flex-wrap:wrap; gap:22px 14px; }
  .photo-strip .ph-item{
    position:relative; width:72px; height:72px;
    border:1px solid var(--line); border-radius:3px;
    background:var(--coral-soft);
  }
  .photo-strip .ph-item img{
    width:100%; height:100%; object-fit:cover; display:block; border-radius:2px;
  }
  .photo-strip .ph-item.cover{ outline:2px solid var(--coral); outline-offset:1px; }
  .photo-strip .ph-del{
    position:absolute; top:-8px; right:-8px; width:20px; height:20px;
    line-height:17px; border-radius:50%;
    border:1px solid var(--line); background:#fff; color:var(--ink-soft);
    font-size:14px; padding:0; text-align:center; cursor:pointer;
  }
  .photo-strip .ph-del:hover{ color:var(--coral); border-color:var(--coral); }
  .photo-strip .ph-cover{
    position:absolute; left:-1px; bottom:-19px; width:calc(100% + 2px);
    font-family:inherit; font-size:10px; padding:2px 0;
    border:1px solid var(--line); border-radius:2px;
    background:#fff; color:var(--ink-soft); cursor:pointer;
    white-space:nowrap;
  }
  .photo-strip .ph-item.cover .ph-cover{
    background:var(--coral); border-color:var(--coral); color:#fff;
  }
  .photo-pick .photo-wrap[hidden],
  .type-picker[hidden],
  .mem-date[hidden],
  .lunar-pick[hidden],
  #ev-date[hidden],
  .viewer .vnav[hidden]{ display:none !important; }

  /* ---- v8：灯箱多图左右滑动 ---- */
  .viewer .vnav{
    position:absolute; top:50%; transform:translateY(-50%);
    width:44px; height:44px; border-radius:50%;
    border:none; background:rgba(255,255,255,.92); color:#4a3c30;
    font-size:26px; line-height:42px; padding:0; cursor:pointer;
  }
  .viewer .vnav:hover{ background:#fff; }
  .viewer .vnav.prev{ left:12px; }
  .viewer .vnav.next{ right:12px; }
  .viewer .vcount{
    position:absolute; bottom:20px; left:50%; transform:translateX(-50%);
    color:#fff; font-size:13px; letter-spacing:.1em; opacity:.9;
  }
  .viewer .vclose{
    position:absolute; top:14px; right:16px;
    width:38px; height:38px; border-radius:50%;
    border:none; background:rgba(255,255,255,.92); color:#4a3c30;
    font-size:22px; line-height:36px; padding:0; cursor:pointer;
  }
  .viewer .vclose:hover{ background:#fff; }
  .ph-count{
    position:absolute; right:6px; bottom:6px;
    background:rgba(52,42,34,.6); color:#fff;
    font-size:10px; padding:1px 5px; border-radius:2px; letter-spacing:.04em;
  }
  @media (max-width:600px){
    .viewer .vnav{ width:38px; height:38px; font-size:22px; line-height:36px; }
    .viewer .vnav.prev{ left:6px; }
    .viewer .vnav.next{ right:6px; }
  }

  /* ---- v8：农历 ---- */
  .cal-toggle{ display:flex; gap:6px; margin-bottom:8px; }
  .cal-toggle button{
    font-family:inherit; font-size:12px; padding:4px 14px;
    border:1px solid var(--line); border-radius:99px;
    background:transparent; color:var(--ink-soft);
    cursor:pointer; transition:all .2s ease;
  }
  .cal-toggle button.on{ background:var(--coral); border-color:var(--coral); color:#fff; }
  .lunar-pick{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
  .lunar-pick select{
    font-family:inherit; font-size:13px; padding:6px 8px;
    border:1px solid var(--line); border-radius:3px;
    background:#fff; color:var(--ink);
  }
  .lunar-pick .chk{
    display:flex; align-items:center; gap:4px;
    font-size:12px; color:var(--ink-soft);
  }
  .lunar-tag{
    display:inline-block; margin-left:5px; padding:1px 6px;
    border:1px solid var(--coral); border-radius:2px;
    color:var(--coral); font-size:10px; letter-spacing:.03em;
  }

  /* ---- v8：栏内滚动，页面不再被撑长 ---- */
  .timeline, .wishes, .halves, .whispers, .memos{
    max-height:min(82vh, 1000px);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    /* auto = 默认滚动链：栏内滑到顶/底后接着滑，就带动整页上下滚 */
    overscroll-behavior:auto;
    scrollbar-width:thin;
    scrollbar-color:var(--line) transparent;
  }
  .timeline::-webkit-scrollbar, .wishes::-webkit-scrollbar,
  .halves::-webkit-scrollbar, .whispers::-webkit-scrollbar{ width:5px; }
  .timeline::-webkit-scrollbar-thumb, .wishes::-webkit-scrollbar-thumb,
  .halves::-webkit-scrollbar-thumb, .whispers::-webkit-scrollbar-thumb{
    background:var(--line); border-radius:99px;
  }
  @media (max-width:600px){
    .timeline, .wishes, .halves, .whispers, .memos{ max-height:min(80vh, 820px); }
  }

  /* ---- v11：纪念日 / 生日 栏 ---- */
  .memos{ display:flex; flex-direction:column; gap:10px; }
  .memo{
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding:14px 16px;
    background:var(--paper-2);
    border:1px solid var(--line);
    border-radius:4px;
    box-shadow:0 6px 18px -14px rgba(90,70,50,.5);
  }
  .memo.today{ border-color:var(--coral); background:var(--coral-soft); }
  .mo-main{ display:flex; flex-direction:column; gap:3px; min-width:0; }
  .mo-title{ font-size:15px; color:var(--ink); letter-spacing:.02em; }
  .mo-when{ font-size:11.5px; color:var(--ink-faint); letter-spacing:.02em; }
  .mo-desc{ font-size:12.5px; color:var(--ink-soft); line-height:1.6; }
  .mo-cd{ flex-shrink:0; text-align:right; }
  .mo-num{
    display:block;
    font-family:'Ma Shan Zheng', cursive;
    font-size:28px; line-height:1.15; color:var(--coral);
  }
  .memo.today .mo-num{ font-size:16px; }
  .mo-unit{ display:block; font-size:10.5px; color:var(--ink-faint); }
  .mo-nth{
    display:block; margin-top:2px;
    font-size:12px; color:var(--ink-soft); letter-spacing:.02em;
  }
  .mem-date{ display:flex; gap:6px; margin-bottom:8px; }
  .mem-date select{
    flex:1; min-width:0;
    font-family:inherit; font-size:13px; padding:6px 8px;
    border:1px solid var(--line); border-radius:3px;
    background:#fff; color:var(--ink);
  }
  @media (max-width:600px){
    .memo{ padding:12px 13px; gap:10px; }
    .mo-num{ font-size:24px; }
    .mem-date{ gap:5px; }
  }
  /* ---------- v12-1：天气补充（当下风力 / 体感 / 和昨天比） ---------- */
  .wx-now, .wx-vs{
    display:block; font-size:12px; color:var(--ink-faint);
    letter-spacing:.04em; margin-top:3px; line-height:1.65;
  }
  .wx-now[hidden], .wx-vs[hidden]{display:none;}
  .wx-vs{ color:var(--ink-soft); }

  /* ---------- v12-2：翻页小册子 ---------- */
  :root{ --book-h: calc(100vh - 150px); }
  @supports (height:100dvh){ :root{ --book-h: calc(100dvh - 150px); } }

  /* 翻页后不需要底部那一大段留白，也把顶部收紧，给书页让出高度 */
  .wrap{ padding:30px 24px 26px; }

  .book{
    position:relative;
    width:100%;
    height:var(--book-h);
    perspective:2200px;
    overflow:hidden;
    box-shadow:0 0 0 1px var(--line), 0 22px 46px -34px rgba(90,70,50,.6);
  }
  /* 装订处的阴影 + 右侧书口，浮在所有书页之上 */
  .book::after{
    content:''; position:absolute; inset:0; z-index:30; pointer-events:none;
    background:
      linear-gradient(to right, rgba(120,98,72,.15), rgba(120,98,72,0) 28px),
      linear-gradient(to left, rgba(120,98,72,.07), rgba(120,98,72,0) 14px);
  }
  .page{
    position:absolute; top:0; left:0;
    width:100%; height:100%;
    overflow-y:auto; overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    background:var(--paper);
    transform-origin:left center;
    backface-visibility:hidden;
    -webkit-backface-visibility:hidden;
    transform:rotateY(0deg);
    /* v14：翻页更快收尾（原来 .62s 太拖沓） */
    transition:transform .32s cubic-bezier(.25,.8,.3,1),
               opacity .26s ease,
               filter .32s ease;
    /* 告诉浏览器「横向手势是我在处理」，手指一落就直接跟手，不会先去试滚动 */
    touch-action:pan-y pinch-zoom;
  }
  .page.is-cur { transform:rotateY(0deg); opacity:1; z-index:4; }
  .page.is-next{ transform:translateX(4%) scale(.985); filter:brightness(.93); opacity:1; z-index:3; }
  .page.is-past{ transform:rotateY(-96deg); opacity:0; z-index:1; pointer-events:none; }
  .page.is-far { transform:translateX(9%) scale(.97); opacity:0; z-index:0; pointer-events:none; }
  .page.dragging{ transition:none; will-change:transform,opacity; }
  /* 翻页动画的终点状态：JS 临时挂上，动画结束就摘掉 */
  .page.tg-fwd   { transform:rotateY(0deg); opacity:1; z-index:3; filter:none; }
  .page.from-fwd { transform:rotateY(-96deg); opacity:0; z-index:5; }
  .page.tg-back  { transform:rotateY(0deg); opacity:1; z-index:6; filter:none; }
  .page.from-back{ transform:translateX(4%) scale(.985); filter:brightness(.93); opacity:1; z-index:4; }
  .book.flipping{ user-select:none; -webkit-user-select:none; cursor:grabbing; }
  /* 翻的时候装订处阴影加深并向里收，像纸正从书脊被揭起来 */
  .book.flipping::after{
    background:
      linear-gradient(to right, rgba(108,86,60,.32), rgba(108,86,60,0) 42px),
      linear-gradient(to left, rgba(108,86,60,.10), rgba(108,86,60,0) 18px);
  }

  /* ---------- v15：翻页的卷曲感 ----------
     真·弧面弯曲要把整页切成若干竖条、每条各转一点角度，
     等于把整页内容（连同照片）复制 4~8 份 —— 手机上必然掉帧。
     所以这里用「光影」来做卷曲：
       靠书脊一侧压暗（纸弯进装订沟里）、
       自由边一侧提亮（纸鼓起来反光）、
       自由边加圆角 + 一道投影（纸边离开了下面那页）。
     整层跟着翻动页同步旋转，只用 transform / opacity，走合成层，几乎不耗性能。 */
  .curl{
    position:absolute; top:0; left:0; width:100%; height:100%;
    transform-origin:left center;
    backface-visibility:hidden; -webkit-backface-visibility:hidden;
    pointer-events:none; opacity:0; z-index:7;
    border-radius:0 14px 14px 0;
    background:linear-gradient(100deg,
      rgba(94,72,50,.34) 0%,
      rgba(94,72,50,.13) 24%,
      rgba(255,255,255,.30) 56%,
      rgba(255,255,255,.07) 84%,
      rgba(94,72,50,.26) 100%);
    box-shadow:10px 0 28px -14px rgba(90,70,50,.55);
    will-change:transform,opacity;
  }
  /* JS 没跑起来、还是长页面模式时，这层不该出现 */
  .book:not(.paged) .curl{ display:none; }
  /* 翻页后各栏不再单独滚动（不然会出现「栏里滚 + 整页滚」两层嵌套） */
  .book .timeline, .book .memos, .book .wishes, .book .halves, .book .whispers{
    max-height:none !important; overflow:visible !important;
  }

  .pager{
    display:flex; align-items:center; justify-content:center; gap:16px;
    margin:18px auto 4px; max-width:560px;
  }
  .pg-arrow{
    flex-shrink:0; width:34px; height:34px; border-radius:50%;
    border:1px solid var(--line); background:transparent; color:var(--ink-faint);
    font-family:inherit; font-size:17px; line-height:1; cursor:pointer;
    transition:all .2s ease;
  }
  .pg-arrow:hover:not(:disabled){ color:var(--coral); border-color:var(--coral); background:var(--coral-soft); }
  .pg-arrow:disabled{ opacity:.28; cursor:default; }
  /* 「目录」入口：翻页条最左边。手势万一被浏览器的「返回」抢走时，点它也能开负一屏 */
  .pg-dir{
    flex-shrink:0; width:34px; height:34px; border-radius:50%;
    border:1px solid var(--line); background:transparent; color:var(--ink-faint);
    font-family:inherit; font-size:13px; line-height:1; cursor:pointer;
    transition:all .2s ease;
  }
  .pg-dir:hover{ color:var(--coral); border-color:var(--coral); background:var(--coral-soft); }
  .pg-mid{ display:flex; flex-direction:column; align-items:center; gap:7px; min-width:180px; }
  .pg-name{
    font-family:'Ma Shan Zheng', cursive; font-size:17px;
    color:var(--ink-soft); letter-spacing:.08em;
  }
  .pg-dots{ display:flex; align-items:center; gap:7px; }
  .pg-dot{
    width:6px; height:6px; padding:0; border:0; border-radius:50%;
    background:var(--line); cursor:pointer; transition:all .25s ease;
  }
  .pg-dot.on{ width:18px; border-radius:3px; background:var(--coral); }

  @media (max-width:600px){
    .wrap{ padding:20px 14px 18px; }
    .pager{ gap:10px; }
    .pg-mid{ min-width:150px; }
    .pg-name{ font-size:16px; }
  }
  /* JS 没跑起来时退回原来「一整页往下滚」的样子，不会白屏 */
  .book:not(.paged) .page{
    position:static; height:auto; overflow:visible;
    transform:none !important; opacity:1 !important; filter:none !important;
    backface-visibility:visible; transition:none;
  }

  /* ============================================================
     负一屏（目录）：在封面右滑拉开
     不占页码、不打断原来的翻页手势；封面左滑照旧翻到第一章
     ============================================================ */
  .neg-mask{
    position:fixed; inset:0; z-index:118;
    background:rgba(59,50,43,.30);
    opacity:0; transition:opacity .3s ease;
    -webkit-backdrop-filter:blur(1px); backdrop-filter:blur(1px);
  }
  .neg-mask[hidden]{ display:none !important; }
  .neg-mask.on{ opacity:1; }
  /* 还锁着的时候不打扰 */
  html:not(.unlocked) .neg-mask,
  html:not(.unlocked) .neg-screen{ display:none !important; }

  .neg-screen{
    position:fixed; top:0; left:0; bottom:0; z-index:119;
    width:min(84vw, 336px);
    display:flex; flex-direction:column;
    background:var(--paper-2);
    border-right:1px solid var(--line);
    box-shadow:10px 0 34px -14px rgba(90,70,50,.5);
    transform:translateX(-101%);
    transition:transform .3s cubic-bezier(.22,.61,.36,1);
    overscroll-behavior:contain;
    /* 全屏打开时避开刘海和底部小黑条 */
    padding-top:env(safe-area-inset-top);
    padding-bottom:env(safe-area-inset-bottom);
  }
  .neg-screen.on{ transform:translateX(0); }
  /* 手指拉着走的时候不能带过渡，否则会跟不上手 */
  .neg-screen.dragging{ transition:none; }
  body.neg-open{ overflow:hidden; }

  .neg-inner{
    display:flex; flex-direction:column;
    height:100%; padding:20px 20px 16px;
  }
  .neg-head{
    display:flex; align-items:baseline; justify-content:space-between;
    padding-bottom:10px; border-bottom:1px dashed var(--line);
  }
  .neg-title{
    font-family:'Ma Shan Zheng', cursive;
    font-size:23px; letter-spacing:.12em; color:var(--ink);
  }
  .neg-close{
    font-family:inherit; font-size:11.5px; letter-spacing:.16em;
    color:var(--ink-faint); background:transparent;
    border:1px solid var(--line); border-radius:20px;
    padding:5px 14px; cursor:pointer; transition:all .2s ease;
  }
  .neg-close:hover{ color:var(--coral); border-color:var(--coral); }

  .neg-list{
    list-style:none; margin:0; padding:2px 0 6px;
    flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  }
  .neg-item{
    display:flex; align-items:center; gap:10px;
    padding:12px 10px; margin-bottom:6px;
    border:1px solid transparent; border-radius:3px;
    cursor:pointer; transition:all .18s ease;
    background:transparent;
  }
  .neg-item:hover{ background:rgba(232,207,156,.14); }
  .neg-item.cur{
    background:rgba(232,207,156,.24);
    border-color:var(--line);
  }
  .neg-item .n-num{
    flex:none; width:34px; text-align:center;
    font-size:10px; letter-spacing:.1em; color:var(--ink-faint);
  }
  .neg-item.cur .n-num{ color:var(--coral); }
  .neg-item .n-name{
    flex:1; min-width:0;
    font-family:'Ma Shan Zheng', cursive;
    font-size:18px; letter-spacing:.05em; color:var(--ink);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .neg-item .n-count{
    flex:none; font-size:10.5px; letter-spacing:.08em;
    color:var(--ink-faint);
    border:1px solid var(--line); border-radius:20px;
    padding:1px 9px;
  }
  .neg-item.cur .n-count{ color:var(--coral); border-color:var(--coral-soft); }

  .neg-foot{
    border-top:1px dashed var(--line);
    padding-top:14px; margin-top:8px; text-align:center;
  }
  .neg-foot .sync-wrap{ display:block; }
  .neg-foot-btns{ margin-top:12px; }
  .neg-foot .app-version{ margin-top:12px; }

  /* ============================================================
     浪漫小装饰（手绘挂件 / 艺术字点缀）
     全部是纯 SVG 线条 + CSS，不加载任何外部图片；
     颜色跟着 currentColor 走，深色模式自动变。
     ============================================================ */
  .orn-sprite{ position:absolute; width:0; height:0; overflow:hidden; }

  .orn{
    display:inline-block; vertical-align:middle; flex:none;
    width:20px; height:20px;
    color:var(--coral);
    pointer-events:none;          /* 装饰不挡手指，也不挡编辑 */
  }
  .orn use, .orn path, .orn circle, .orn ellipse{ pointer-events:none; }
  .orn-petals ellipse{ fill:currentColor; opacity:.24; }
  .orn-core{ fill:currentColor; opacity:.55; }
  .orn-solid{ fill:currentColor; opacity:.45; }
  .orn-faint{ opacity:.22; }
  .seal-blob{ fill:currentColor; opacity:.15; }
  .seal-heart{ fill:currentColor; opacity:.5; }

  /* ---- 封面 ---- */
  .cover .kicker{ position:relative; }
  .cover .kicker::before,
  .cover .kicker::after{
    content:''; display:inline-block; vertical-align:middle;
    width:24px; height:1px; margin:0 12px;
    background:var(--line);
  }
  /* 标题原来是写死的颜色，深色模式下不会变；改回变量，再给一层很淡的暖光 */
  .cover h1{
    color:var(--ink);
    text-shadow:0 6px 18px rgba(201,112,90,.12);
  }

  .cover-wreath{ margin:0 auto 4px; line-height:0; }
  .orn-wreath{ width:158px; height:52px; }
  .cover-rule{ margin:24px 0 4px; line-height:0; }
  .orn-divider{ width:132px; height:16px; }

  .cover-flower{ position:absolute; top:26px; right:28px; }
  .cover-flower .orn-flower{ width:24px; height:24px; transform:rotate(-14deg); opacity:.85; }
  .cover-spark{ position:absolute; left:22px; bottom:32px; }
  .cover-spark .orn-spark{ width:19px; height:19px; opacity:.75; }
  .cover-bird{ position:absolute; left:30px; top:60px; }
  .cover-bird .orn-bird{ width:30px; height:30px; opacity:.42; }
  .cover-seal{ position:absolute; right:24px; bottom:20px; }
  .cover-seal .orn-seal{ width:44px; height:44px; transform:rotate(-9deg); }

  /* 慢慢飘的花瓣：只是氛围，不抢注意力，也不吃性能 */
  .petal{
    position:absolute; pointer-events:none;
    width:9px; height:12px;
    border-radius:62% 62% 55% 55% / 72% 72% 46% 46%;
    background:var(--coral); opacity:0;
  }
  .petal.p1{ left:16%; top:8%;  animation:petal-fall 19s linear infinite; }
  .petal.p2{ left:62%; top:2%;  animation:petal-fall 24s linear infinite 4s; }
  .petal.p3{ left:38%; top:16%; animation:petal-fall 21s linear infinite 9s; }
  .petal.p4{ left:84%; top:10%; animation:petal-fall 26s linear infinite 13s; }
  @keyframes petal-fall{
    0%   { transform:translate3d(0,0,0) rotate(0deg); opacity:0; }
    12%  { opacity:.16; }
    85%  { opacity:.14; }
    100% { transform:translate3d(-22px,140px,0) rotate(260deg); opacity:0; }
  }
  @media (prefers-reduced-motion: reduce){
    .petal{ animation:none !important; }
  }

  /* ---- 各章标题旁的小挂件 ---- */
  .head-orn{ width:19px; height:19px; opacity:.75; }

  /* ---- 负一屏 / 封底 ---- */
  .neg-orn{ width:17px; height:17px; margin-right:8px; }
  .footer-orn{ line-height:0; margin-bottom:18px; }

  /* ============================================================
     封面天气：按当天天气生成的动态小景
     纯 CSS 动画 + SVG，不引外部资源；
     颜色用固定中间调（深浅底上都看得见），不挡手指。
     ============================================================ */
  .cover-sky{
    position:absolute; inset:0; z-index:0;
    overflow:hidden; border-radius:4px;
    pointer-events:none;
  }
  .cover-sky > *{ pointer-events:none; }
  /* 文字和挂件都在天气之上 */
  .cover > .kicker, .cover > h1, .cover > .sub,
  .cover > .cover-rule, .cover > .cover-wreath, .cover > .since{
    position:relative; z-index:2;
  }
  .cover > .tape, .cover > .cover-flower, .cover > .cover-spark,
  .cover > .cover-bird, .cover > .cover-seal, .cover > .petal{
    z-index:2;
  }

  /* ---- 太阳：慢慢转的光芒 + 呼吸式明暗 ---- */
  .wx-sun{
    position:absolute; top:12px; right:16px;
    width:78px; height:78px; color:#e8a36b;
    animation:sun-breathe 5.6s ease-in-out infinite;
  }
  .sun-face{ fill:currentColor; opacity:.42; }
  .sun-halo{ fill:none; stroke:currentColor; stroke-width:1.1; opacity:.16; }
  /* 太阳占了右上角，那只小花先收起来 */
  .cover.has-sun .cover-flower{ display:none; }

  .sun-rays{
    transform-box:fill-box; transform-origin:center;
    animation:sun-spin 30s linear infinite;
  }
  .sun-ray path{
    stroke:currentColor; stroke-width:3.6; stroke-linecap:round; fill:none;
    opacity:.5;
  }
  @keyframes sun-spin{ to{ transform:rotate(360deg); } }
  @keyframes sun-breathe{
    0%,100%{ opacity:.72; }
    50%    { opacity:1; }
  }

  /* ---- 云：慢慢横着飘 ---- */
  .wx-cloud{
    position:absolute; color:#a49b93; opacity:.22;
    animation:cloud-drift linear infinite;
  }
  .cloud-body{ fill:currentColor; }
  @keyframes cloud-drift{
    from{ transform:translateX(-150px); }
    to  { transform:translateX(112vw); }
  }

  /* ---- 雨：真正的水滴形状（上尖下圆）斜着落下 + 底部水痕 ---- */
  .wx-drop{
    position:absolute; top:-26px; color:#7e9db3;
    animation:rain-fall linear infinite;
  }
  .drop-shape{ fill:currentColor; opacity:.62; }
  .drop-shine{ fill:#fff; opacity:.42; }
  /* 水滴不翻身：整体保持一个倾角往下掉，尖头始终朝上 */
  @keyframes rain-fall{
    from{ transform:translate3d(0,0,0) rotate(10deg); opacity:0; }
    14% { opacity:1; }
    86% { opacity:.9; }
    to  { transform:translate3d(-38px,540px,0) rotate(10deg); opacity:0; }
  }
  .wx-puddle{
    position:absolute; left:12%; right:12%; bottom:2px; height:10px;
    background:radial-gradient(ellipse at center, rgba(126,157,179,.22), rgba(126,157,179,0) 70%);
    animation:puddle-blink 3.4s ease-in-out infinite;
  }
  @keyframes puddle-blink{ 0%,100%{opacity:.5} 50%{opacity:.9} }

  /* ---- 雪：慢慢飘 + 左右轻摆 ---- */
  .wx-flake{
    position:absolute; top:-20px; color:#8fb4cc;
    animation:snow-fall linear infinite;
  }
  .flake-lines{
    fill:none; stroke:currentColor; stroke-width:1.5;
    stroke-linecap:round; opacity:.8;
  }
  @keyframes snow-fall{
    from{ transform:translate3d(0,0,0) rotate(0deg); }
    25% { transform:translate3d(14px,120px,0) rotate(70deg); }
    50% { transform:translate3d(-10px,240px,0) rotate(150deg); }
    75% { transform:translate3d(12px,360px,0) rotate(240deg); }
    to  { transform:translate3d(-6px,500px,0) rotate(320deg); }
  }

  /* ---- 雾：横向慢移的几道雾带 ---- */
  .wx-fog{
    position:absolute; left:-30%; width:160%; height:14px;
    background:linear-gradient(to bottom, rgba(154,162,168,0), rgba(154,162,168,.3), rgba(154,162,168,0));
    filter:blur(2px);
    animation:fog-slide linear infinite;
  }
  @keyframes fog-slide{
    from{ transform:translateX(-18%); }
    to  { transform:translateX(18%); }
  }

  /* ---- 阴天：整张封面压一层极淡的灰，字照旧清楚 ---- */
  .wx-dim{ position:absolute; inset:0; background:rgba(118,114,108,.075); }

  /* ---- 雷暴：偶尔闪一下 ---- */
  .wx-bolt{
    position:absolute; inset:0; background:rgba(255,247,214,.6);
    opacity:0; animation:flash 11s ease-in-out infinite;
  }
  @keyframes flash{
    0%,88%,100%{ opacity:0; }
    90%        { opacity:.42; }
    92%        { opacity:.06; }
    94%        { opacity:.3; }
  }

  /* ---- 风：挂件轻摆 + 叶子横掠 ---- */
  .wx-leaf{
    position:absolute; color:#8ca48a;
    animation:leaf-blow linear infinite;
  }
  .leaf-body{ fill:currentColor; opacity:.5; }
  .leaf-vein{ fill:none; stroke:currentColor; stroke-width:1; opacity:.5; }
  @keyframes leaf-blow{
    from{ transform:translate3d(-30px,0,0) rotate(0deg); opacity:0; }
    10% { opacity:.7; }
    85% { opacity:.6; }
    to  { transform:translate3d(112vw,-40px,0) rotate(520deg); opacity:0; }
  }
  /* 挂件摇摆：只在有风时加，风越大摆得越明显 */
  @keyframes wx-sway{
    0%,100%{ transform:rotate(-2.6deg); }
    50%    { transform:rotate(3.2deg); }
  }
  .cover.wind-1 .cover-flower,
  .cover.wind-1 .cover-spark,
  .cover.wind-1 .cover-bird,
  .cover.wind-1 .cover-seal,
  .cover.wind-1 .cover-wreath{
    animation:wx-sway 4.6s ease-in-out infinite;
  }
  .cover.wind-2 .cover-flower,
  .cover.wind-2 .cover-spark,
  .cover.wind-2 .cover-bird,
  .cover.wind-2 .cover-seal,
  .cover.wind-2 .cover-wreath{
    animation:wx-sway 3s ease-in-out infinite;
  }
  /* 风大时挂件摆幅加倍、花瓣被吹得更斜 */
  .cover.wind-2 .cover-flower{ animation:wx-sway-strong 2.6s ease-in-out infinite; }
  .cover.wind-2 .cover-seal{ animation:wx-sway-strong 2.9s ease-in-out infinite; }
  @keyframes wx-sway-strong{
    0%,100%{ transform:rotate(-5.5deg); }
    50%    { transform:rotate(6deg); }
  }
  .cover.wind-2 .petal{ animation-name:petal-fall-windy; }
  @keyframes petal-fall-windy{
    0%   { transform:translate3d(0,0,0) rotate(0deg); opacity:0; }
    12%  { opacity:.18; }
    85%  { opacity:.15; }
    100% { transform:translate3d(-72px,150px,0) rotate(300deg); opacity:0; }
  }

  /* 翻到别的页就停下，省电 */
  .cover.wx-paused *{ animation-play-state:paused !important; }

  @media (prefers-reduced-motion: reduce){
    .cover-sky *, .cover-flower, .cover-spark,
    .cover-bird, .cover-seal, .cover-wreath{
      animation:none !important;
    }
  }

  /* ============================================================
     夜景：月亮 + 眨眼的星星（is_day=0 时）
     ============================================================ */
  .wx-moon{
    position:absolute; top:14px; right:18px;
    width:64px; height:64px; color:#c9b26b;
    animation:sun-breathe 6.5s ease-in-out infinite;
  }
  .moon-face{ fill:currentColor; opacity:.5; }
  .moon-crater{ fill:currentColor; opacity:.32; }
  /* 有月亮时右上角的小花、小星先收起来，别叠在一起 */
  .cover.has-moon .cover-flower,
  .cover.has-moon .cover-spark{ display:none; }

  .wx-star{
    position:absolute; color:#c9b26b;
    animation:star-twinkle ease-in-out infinite;
  }
  .star-shape{ fill:currentColor; opacity:.8; }
  @keyframes star-twinkle{
    0%,100%{ opacity:.25; transform:scale(.82); }
    50%    { opacity:.95; transform:scale(1.08); }
  }

  /* 夜里阴天那层灰，压得比白天更沉一点 */
  .wx-dim.night-dim{ background:rgba(64,66,78,.10); }

  /* ============================================================
     未来一周小条（天气卡片里）
     ============================================================ */
  .wx-week{
    display:flex; gap:2px; justify-content:space-between;
    margin:9px 2px 0; padding-top:8px;
    border-top:1px dashed var(--line);
  }
  .wd-cell{
    position:relative; flex:1; min-width:0;
    display:flex; flex-direction:column; align-items:center; gap:1px;
    font-style:normal;
  }
  .wd-name{ font-size:9.5px; letter-spacing:.08em; color:var(--ink-faint); }
  .wd-ico{ font-style:normal; font-size:14px; line-height:1.25; }
  .wd-t{ font-style:normal; font-size:10px; color:var(--ink); opacity:.78; }
  .wd-cell.good .wd-t{ color:var(--coral); opacity:1; }
  .wd-heart{
    position:absolute; top:-3px; right:-1px;
    font-style:normal; font-size:8px; color:var(--coral); opacity:.85;
  }

  .wx-goodtip{
    margin-top:8px; padding:7px 10px;
    font-size:11px; letter-spacing:.05em; line-height:1.6;
    color:var(--coral);
    background:var(--coral-soft);
    border:1px dashed var(--coral);
    border-radius:4px;
  }

  /* ---- 未来一周：每天一句话说清天气 ---- */
  .wx-week-text{
    margin-top:10px; display:flex; flex-direction:column; gap:5px;
  }
  .wd-line{
    display:flex; align-items:baseline; gap:10px;
    padding:6px 9px; border-radius:6px;
    background:var(--paper-2, rgba(0,0,0,.02));
  }
  .wd-line.good{ background:var(--coral-soft); }
  .wdl-name{
    flex:0 0 auto; min-width:34px;
    font-size:12px; letter-spacing:.06em; color:var(--ink-faint);
  }
  .wd-line.good .wdl-name{ color:var(--coral); font-weight:600; }
  .wdl-txt{
    flex:1; min-width:0;
    font-size:13px; line-height:1.5; color:var(--ink);
  }

  /* ---- 明天：一句实在的建议 ---- */
  .wxm-tomorrow{ background:var(--coral-soft); border-radius:8px; padding:10px 12px; }
  .wxm-tomorrow h4{ color:var(--coral); }
  .wxm-tomorrow-txt{
    margin:6px 0 0; font-size:13.5px; line-height:1.7; color:var(--ink);
    letter-spacing:.02em;
  }

  @media (max-width:520px){
    .wdl-txt{ font-size:12.5px; }
    .wxm-tomorrow-txt{ font-size:13px; }
  }

  /* ---- v9.9：文档 / 更新日志应用内全屏浮层（原生壳用） ---- */
  #docs-overlay{
    position:fixed; inset:0; z-index:400; display:none; flex-direction:column;
    background:var(--paper,#fbf6ee);
  }
  #docs-overlay.open{ display:flex; }
  #docs-overlay .docs-bar{
    display:flex; align-items:center; justify-content:space-between;
    padding:10px 14px; background:#fff; border-bottom:1px solid #e7ddd0;
    padding-top:calc(10px + env(safe-area-inset-top,0px));
  }
  #docs-overlay .docs-title{ font-weight:600; font-size:15px; color:var(--ink,#3a3330); }
  #docs-overlay .docs-close{
    border:1px solid #e7ddd0; background:#fff; color:var(--coral,#e8746b);
    border-radius:8px; padding:6px 12px; font-size:14px;
  }
  #docs-overlay .docs-frame{ flex:1; width:100%; border:0; background:transparent; }
