/* Final typography layer: sizes are assigned by meaning, not by page. */
:root{
 --font-ui:"Microsoft YaHei","PingFang SC","Segoe UI",sans-serif;
 --type-page:30px;--type-section:20px;--type-card:18px;--type-body:14px;
 --type-ui:13px;--type-meta:12px;--type-small:11px;--type-tiny:10px;
 --type-input:14px;--type-search:12px;--type-search-meta:11px;
 --type-stat:32px;--type-anniversary:52px;--type-hero:76px;
}
html,body{font-family:var(--font-ui);font-size:var(--type-body);line-height:1.7;-webkit-text-size-adjust:100%;text-size-adjust:100%}
button,input,textarea,select{font-family:var(--font-ui);letter-spacing:normal}
#app .heading h1{font-family:var(--font-ui);font-size:var(--type-page);font-weight:650;line-height:1.35;letter-spacing:1px}
#app .brand{font-size:24px;line-height:1.4;letter-spacing:1px}
#app .section-head h2,#app .panel>h2,#app .on-this-day h2,#app .memory-map h2,#app .calendar-heading h2,#app .life-month-heading h2,#app .shelf-heading h2{font-size:var(--type-section);font-weight:600;line-height:1.5}
#editor .dialog-title h2{font-family:var(--font-ui);font-size:var(--type-section);font-weight:600;line-height:1.5}
#app h3,#editor h3,#app .photo-post-title,#app .diary-content h3,#app .trash-record h3{font-family:var(--font-ui);font-size:var(--type-card);font-weight:500;line-height:1.6}
#app .subtitle,#editor .subtitle,#app .hero p,#app .hero .relationship-hero-note,#app .personal-identity>span{font-size:var(--type-ui);line-height:1.8}
#app .photo-post-caption,#app .excerpt,#app .trash-text,#editor .body-text,#editor .wish-quote,#editor .trash-text,#editor .place-record-main>span{font-family:var(--font-ui);font-size:var(--type-body);line-height:1.9;overflow-wrap:anywhere}
#app .diary-lines,#app .book-entry-text{font-family:var(--font-ui);font-size:var(--type-body);line-height:2.05}
#app .meta,#editor .meta,#app .post-time,#app .photo-post-author,#app .photo-post-footer,#app .diary-meta,#app .book-entry-date,#app .book-entry-location,#app .personal-identity>span,#editor .place-memory-summary,#editor .place-record-main small{font-size:var(--type-meta);line-height:1.7}
#app .primary,#app .secondary,#app .plain,#editor .primary,#editor .secondary,#editor .plain,#app .corner-link small,#app .life-history-tools label,#app .meeting-kpis-head label{font-family:var(--font-ui);font-size:var(--type-ui);line-height:1.5}
#app .nav button{font-size:var(--type-ui)}
#app .field,#editor .field,#app .check,#editor .check,#app fieldset legend,#editor fieldset legend{font-size:var(--type-ui);line-height:1.7}
#app input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),#editor input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),#app textarea,#editor textarea,#app select,#editor select{font-family:var(--font-ui);font-size:var(--type-input);line-height:1.5}
#app input::placeholder,#editor input::placeholder,#app textarea::placeholder,#editor textarea::placeholder{font-size:inherit}
#app .notice,#editor .notice,#app .error,#editor .error,#app .progress,#editor .progress{font-size:var(--type-ui);line-height:1.8}
#app .timeline-filter-note,#app .calendar-no-event,#app .library-footnote,#app .library-rule,#app .life-rule,#app .life-calendar-hint,#editor .photo-sort-hint,#editor .location-status,#editor .reader-hint,#app .reader-hint{font-size:var(--type-meta);line-height:1.7}
#app .calendar-source,#app .footer,#app .art-credit,#app .calendar-legend,#app .calendar-weekdays,#editor .detail-photos a,#editor .period-estimate small,#editor .place-record-locate,#app .management-actions .meta{font-size:var(--type-small);line-height:1.7}
#app .calendar-event,#app .life-calendar .calendar-event,#app .calendar-today-label,#app .day-off-badge,#app .day-work-badge,#app .tag,#editor .tag{font-size:var(--type-tiny);line-height:1.5}
#app .calendar-number{font-size:var(--type-ui)}
#app .calendar-diary-row,#editor .calendar-diary-row,#app .wish-history-item,#editor .wish-history-item,#editor .contents-row{font-size:var(--type-body);line-height:1.7}
#app .calendar-diary-row small,#editor .calendar-diary-row small,#app .wish-history-item small,#editor .wish-history-item small,#app .life-span-group h3,#app .past-year-heading span{font-size:var(--type-meta);line-height:1.7}
#app .life-type-tabs button,#app .calendar-buttons button,#app .tree-toolbar button,#app .tree-editor-controls,#app .tree-editor-controls label,#app .tree-editor-controls p{font-size:var(--type-ui)}
#app .tree-editor-controls output,#app .tree-editor-controls select{font-size:var(--type-ui)}
#app .wish-tree-caption,#app .jar-position-label{font-size:var(--type-small)}
#app .corner-link strong,#app .personal-name,#app .hero-person-name{font-size:var(--type-card);font-weight:500;line-height:1.6}
#app .personal-name{font-size:22px;font-weight:600}
#app .hero-title{font-size:24px;font-weight:500;line-height:1.5}
#app .hero-count{font-size:var(--type-hero);line-height:1.1;font-variant-numeric:tabular-nums}
#app .hero-count small,#app .hero-person-caption,#app .relationship-breakdown{font-size:var(--type-meta);line-height:1.6}
#app .relationship-breakdown b{font-size:16px}
#app .stats .stat strong{font-size:var(--type-stat);font-weight:500;line-height:1.1;font-variant-numeric:tabular-nums}
#app .stats .stat span{font-size:var(--type-meta);line-height:1.5}
#app .anniversary-card h3{font-size:20px;line-height:1.5}
#app .anniversary-card>strong{font-size:var(--type-anniversary);font-weight:500;line-height:1.15;font-variant-numeric:tabular-nums}
#app .anniversary-card>strong small{font-size:var(--type-ui)}
#app .anniversary-card>.meta,#app .anniversary-card>small,#app .anniversary-note,#app .anniversary-reminder{font-size:var(--type-meta);line-height:1.7}
#app .past-year-heading strong{font-size:var(--type-section);line-height:1.5}
#app .past-year .past-memory-copy strong{font-size:var(--type-card);line-height:1.5}
#app .past-year .past-memory-copy>span,#app .past-year .past-memory-copy small{font-size:var(--type-meta);line-height:1.6}
#app .post-day{font-size:28px;line-height:1.2}
#app .stamp-day{font-size:18px;line-height:1.4}
#app .stamp-clock,#app .stamp-repeat{font-size:var(--type-meta);line-height:1.6}
#app .year-crate-caption h2,#app .library-intro h2,#app .book-dedication h2{font-size:var(--type-section);line-height:1.5}
#app .year-crate-caption span,#app .year-crate-card>p,#app .month-slot>p,#app .book-cover-year,#app .book-pagination,#app .reader-toolbar,#app .notebook-page-footer{font-size:var(--type-meta);line-height:1.7}
#app .book-cover-label>span,#app .notebook-page-header{font-size:var(--type-card);line-height:1.6}
#app .book-dedication p,#app .library-intro p{font-size:var(--type-body);line-height:1.8}
#editor .day-event-quick strong{font-size:var(--type-card);line-height:1.5}
#editor .day-event-quick span,#editor .day-event-details span,#editor .anniversary-editor>.subtitle,#editor .import-photo-row small{font-size:var(--type-meta);line-height:1.7}
#editor .import-photo-row strong,#editor .import-day h3,#editor .place-record-main strong{font-size:var(--type-ui);line-height:1.6}
/* The compact search bar is intentionally smaller than writing forms. */
#app .timeline-tools .timeline-search,#app .timeline-tools #search,#app .timeline-tools #photo-wall-search{font-size:var(--type-search);line-height:1.4}
#app .timeline-tools #search::placeholder,#app .timeline-tools #photo-wall-search::placeholder{font-size:var(--type-search)}
#app .timeline-tools #timeline-month,#app .timeline-tools #photo-wall-month,#app .timeline-tools .timeline-month-filter>span,#app .timeline-tools>button{font-size:var(--type-search-meta);line-height:1.4}
#app .timeline-tools #timeline-month::-webkit-datetime-edit,#app .timeline-tools #photo-wall-month::-webkit-datetime-edit,#app .timeline-tools #timeline-month::-webkit-datetime-edit-fields-wrapper,#app .timeline-tools #photo-wall-month::-webkit-datetime-edit-fields-wrapper{font-size:var(--type-search-meta)}
/* Glyph controls retain their own hit areas and visual size. */
#editor .dialog-title>button,#editor .photo-remove-icon{font-size:22px;line-height:1}
#app .map-search-clear{font-size:22px;line-height:1}
#app .timeline-write{font-size:33px;line-height:1}
#app .life-month-heading>button{font-size:26px;line-height:1.2}
.photo-lightbox header,.photo-lightbox header .plain{font-size:var(--type-ui);line-height:1.5}
.photo-lightbox footer{font-size:var(--type-small);line-height:1.5}
.photo-lightbox [data-gallery=close]{font-size:22px}
#toast{font-family:var(--font-ui);font-size:var(--type-ui);line-height:1.7}
@media(max-width:760px){
 :root{--type-page:24px;--type-section:18px;--type-card:16px;--type-body:13px;--type-ui:12px;--type-meta:11px;--type-small:10px;--type-tiny:9px;--type-input:16px;--type-search:11px;--type-search-meta:10px;--type-stat:27px;--type-anniversary:46px;--type-hero:52px}
 #app .nav .nav-short{font-size:11px;line-height:1.4}
 #app .hero-title{font-size:20px}
 #app .personal-name{font-size:20px}
 #app .anniversary-card h3{font-size:18px}
 #app .post-day{font-size:25px}
 #app .stamp-day{font-size:15px}
 #editor .body-text,#editor .wish-quote{font-size:14px}
 #app .hero-person-caption{font-size:var(--type-small)}
}
#app .login-art h1{font-family:var(--font-ui);font-size:var(--type-page);font-weight:600;line-height:1.5}
#app .login-box h2{font-family:var(--font-ui);font-size:var(--type-section);line-height:1.5}
#app .file-label,#editor .file-label,#app .background-settings-preview span,#editor .background-settings-preview span{font-size:var(--type-ui);line-height:1.7}
#app .period-estimate p,#editor .day-event-choices+p{font-size:var(--type-meta);line-height:1.8}
/* Map search is a compact filter, not a writing field. */
#app #map-place-query{font-size:12px;line-height:1.5}
#app #map-place-query::placeholder{font-size:12px}
@media(max-width:760px){#app #map-place-query{font-size:11px}#app #map-place-query::placeholder{font-size:11px}}
/* Phone calendar: square dates, readable labels, compact record rows. */
@media(max-width:760px){
 #app .life-calendar .calendar-grid{gap:4px;align-items:start}
 #app .life-calendar .calendar-day{width:100%;aspect-ratio:1 / 1;min-height:0;height:auto;box-sizing:border-box;padding:3px;overflow:hidden;border-radius:9px;position:relative}
 #app .life-calendar .calendar-blank{aspect-ratio:1 / 1;min-height:0}
 #app .life-calendar .calendar-day-top{width:100%;min-height:17px;line-height:1.2}
 #app .life-calendar .calendar-number{font-size:14px;font-weight:500;line-height:1.2}
 #app .life-calendar .calendar-weekdays{font-size:12px;line-height:1.5}
 #app .life-calendar .calendar-day-events{width:100%;margin-top:2px;gap:1px;min-height:0}
 #app .life-calendar .calendar-event{font-size:11px;line-height:1.2;padding:0 1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #app .life-calendar .day-off-badge,#app .life-calendar .day-work-badge{font-size:10px;line-height:1.2}
 #app .life-calendar .life-month-heading h2{font-size:20px}
 #app .life-history .life-span-group .calendar-diary-row{min-height:34px;box-sizing:border-box;padding:6px 10px;margin-top:5px;align-items:center;gap:8px;line-height:1.4}
 #app .life-history .life-span-group .calendar-diary-row>span{font-size:13px;line-height:1.4}
 #app .life-history .life-span-group .calendar-diary-row>small{font-size:11px;line-height:1.4}
 #app .life-history .life-span-group .calendar-diary-row span small{margin-top:2px;font-size:11px;line-height:1.4}
 #app .life-history .life-span-group .calendar-diary-row span small:empty{display:none;margin:0}
 #app .life-history .life-span-group h3{margin-bottom:6px;font-size:12px;line-height:1.5}
}
.calendar-more-marks{display:none}
@media(max-width:760px){#app .life-calendar .calendar-day-events .calendar-event:nth-child(n+2){display:none}#app .life-calendar .calendar-day[data-marker-count]:not([data-marker-count="0"]):not([data-marker-count="1"]) .calendar-day-events{padding-right:15px;box-sizing:border-box}#app .life-calendar .calendar-more-marks{display:block;position:absolute;right:3px;bottom:3px;font-size:9px;line-height:1.2;color:#809db3}}

/* One month control serves as both heading and month picker. */
#app .life-month-heading #life-month{width:165px;max-width:100%;min-width:0;border:0;background:transparent;padding:4px 0;font-size:18px;font-weight:500;line-height:1.4;color:inherit}
@media(max-width:760px){
 #app .life-calendar .calendar-heading{flex-direction:row;flex-wrap:nowrap;align-items:center;gap:8px}
 #app .life-calendar .life-month-heading{gap:2px;min-width:0}
 #app .life-month-heading #life-month{width:142px;font-size:15px;padding:4px 0}
 #app .life-calendar .life-month-heading>button{font-size:22px;min-width:24px;padding:4px}
 #app .life-calendar .calendar-buttons{margin:0;flex-shrink:0}
 #app .life-calendar .calendar-buttons .secondary{font-size:11px;padding:7px 9px;white-space:nowrap}
}

#app .life-calendar .calendar-month-picker{display:flex;visibility:visible;opacity:1;align-items:center;flex-shrink:0;gap:3px}
#app .calendar-month-picker select{display:block;width:auto;min-width:0;border:1px solid #e1edf5;border-radius:8px;padding:6px 3px;background:#fff;color:#708ea5;font-size:14px;line-height:1.4}
@media(max-width:760px){#app .life-calendar .calendar-heading{display:flex;justify-content:space-between;flex-wrap:wrap}#app .calendar-month-picker select{font-size:14px;min-height:32px}#app .life-calendar .calendar-month-picker>button{display:block;min-width:20px;padding:3px;font-size:20px}}

/* Shared month navigation on desktop and phone. */
#app .life-calendar .calendar-month-picker{gap:3px}
#app .life-calendar .calendar-month-picker>button{display:block;min-width:20px;padding:3px;font-size:20px;line-height:1.2}
#app .life-calendar .calendar-month-picker select{font-size:14px;min-height:32px}

#app .life-calendar .calendar-month-picker>.calendar-month-label{font-size:15px;font-weight:500;white-space:nowrap;padding:6px}
.calendar-year-nav{display:flex;justify-content:center;align-items:center;gap:25px;margin:8px 0 20px;font-size:16px}
.calendar-year-nav button{font-size:24px;padding:5px 12px}
.calendar-month-options{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-bottom:10px}
.calendar-month-options button{font-size:14px;padding:12px 4px}
.calendar-month-options .is-selected{background:#e7f2fb;border-color:#9bbdd5}

.home-title-mobile{display:none}
@media(max-width:760px){.home-title-desktop{display:none}.home-title-mobile{display:inline}}

/* Give the desktop home banner a little more vertical room. */
@media(min-width:761px){#app .hero.red-thread-hero{min-height:415px;padding-top:55px;padding-bottom:49px}}

/* Compact page headings after removing introductory subtitles. */
#app .main>.heading{margin-top:12px;margin-bottom:18px}
#app .main>.heading h1{margin-top:0;margin-bottom:0}
@media(max-width:760px){#app .main>.heading{margin-top:8px;margin-bottom:14px}}

/* Keep every page title on the same top line. */
#app .main{position:relative;padding-top:29px}
#app .main>.heading{margin-top:12px;align-items:flex-start;min-height:44px}
#app .main>.heading h1{margin:0;line-height:1.35}
#app .main>.subpage-back{position:absolute;top:41px;margin:0;width:38px;height:38px}
#app .main>.subpage-back+.heading{padding-left:52px}
@media(max-width:760px){
 #app .main{padding-top:17px}
 #app .main>.heading{margin-top:8px;min-height:34px;align-items:flex-start}
 #app .main>.subpage-back{top:25px;width:32px;height:32px}
 #app .main>.subpage-back+.heading{padding-left:44px}
}

/* Align the first content panels beneath their shared page heading. */
#app #content>.photo-wall-panel,#app #content>.life-calendar{margin-top:0}

/* Darker text over photos, with original weights and tag backgrounds. */
#app .red-thread-hero:has(.hero-background-photo) .hero-title,
#app .red-thread-hero:has(.hero-background-photo) .hero-count{color:#35556d}
#app .red-thread-hero:has(.hero-background-photo) .hero-count small,
#app .red-thread-hero:has(.hero-background-photo) .hero-person-caption,
#app .red-thread-hero:has(.hero-background-photo) .hero-copy p,
#app .red-thread-hero:has(.hero-background-photo) .relationship-breakdown,
#app .red-thread-hero:has(.hero-background-photo) .relationship-breakdown b{color:#3f5b70}
#app .red-thread-hero:has(.hero-background-photo) .hero-person-name{color:#35556d}
#app .red-thread-hero:has(.hero-background-photo) .hero-person-right .hero-person-name{color:#8b4865}

.timeline-filter-note:empty{display:none}

/* Reduce empty space between related page sections. */
#app .memory-map .map-search{margin:10px 0 4px;gap:6px}
#app .map-search .error:empty,#app #map-search-results:empty{display:none}
#app #china-memory-map{margin-top:4px}
#app .memory-map{margin-top:18px}
#app .on-this-day{margin-top:18px;margin-bottom:18px}
#app .stats{margin-top:14px;margin-bottom:18px}
#app .life-history{margin-top:14px}
#app .life-type-tabs,#app .life-history-tools{margin-bottom:10px}
#app .personal-profile~.corner-links{margin-top:16px}
#app .corner-links{gap:12px}
@media(max-width:760px){
 #app .timeline-top{padding-bottom:14px}
 #app .memory-map,#app .life-history{margin-top:12px}
 #app .on-this-day{margin-top:14px;margin-bottom:14px}
 #app .stats{margin-top:12px;margin-bottom:14px}
}

#app .logout-button{margin-top:16px}
#app .wish-history>.wish-history-item{display:flex;width:100%;text-align:left;cursor:pointer}
@media(max-width:760px){
 #app .life-calendar .calendar-heading{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:4px;padding-inline:0}
 #app .life-calendar .calendar-month-picker{flex:1;min-width:0;gap:0}
 #app .life-calendar .calendar-month-picker>.calendar-month-label{font-size:14px;padding:5px 2px;min-width:0}
 #app .life-calendar .calendar-month-picker>button:not(.calendar-month-label){min-width:18px;padding:2px}
 #app .life-calendar .calendar-buttons{display:flex;flex:0 0 auto;width:auto;margin:0}
 #app .life-calendar .calendar-buttons .secondary{font-size:11px;padding:6px 8px}
}

#app .memory-map-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
#app .memory-map-heading h2{margin:0;min-width:0}
#app .memory-map-heading>button{flex-shrink:0;white-space:nowrap;font-size:12px;padding:7px 12px}

#app .heading-actions .logout-button{margin:0;white-space:nowrap;font-size:12px;padding:7px 12px}

.password-control{display:flex;align-items:center;position:relative}.password-control input{width:100%;padding-right:58px!important}.password-control button{position:absolute;right:8px;font-size:12px}.auth-links{display:flex;justify-content:space-between;gap:16px;margin-top:14px}

/* Centered blue account card with shared login and registration tabs. */
#app .auth-page{min-height:100dvh;display:grid;place-items:center;padding:28px 18px;background:radial-gradient(ellipse at 18% 12%,#f4faff 0,transparent 58%),linear-gradient(145deg,#dcecf8,#c7deee);color:#46677f}
#app .auth-card{width:min(100%,460px);padding:26px 24px 24px;background:#edf6fbbd;border:1px solid #ffffffd9;border-radius:40px;box-shadow:0 18px 55px #577f9b18,inset 0 1px 0 white}
#app .auth-card>h1{font-size:23px;font-family:var(--font-ui);font-weight:600;text-align:center;letter-spacing:1px;margin:0 0 24px;line-height:1.5}
#app .auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:0}
#app .auth-tabs button{border:0;background:transparent;color:#718fa4;font:500 14px/1.5 var(--font-ui);padding:15px;border-radius:25px 25px 0 0;cursor:pointer}
#app .auth-tabs button.active{background:#fff;color:#416b89}
#app .auth-form-panel{padding:22px 20px 18px;background:#fff;border-radius:0 0 27px 27px}
#app .auth-tabs:has(button:first-child.active)+.auth-form-panel{border-top-right-radius:25px}
#app .auth-tabs:has(button:last-child.active)+.auth-form-panel{border-top-left-radius:25px}
#app .auth-form-panel h2{font-size:18px;margin:0 0 16px}
#app .auth-form-panel .field{font-size:12px;gap:6px;margin:0 0 13px;color:#6a889e}
#app .auth-form-panel input{width:100%;min-height:45px;border:1px solid #e0eaf2;background:#f7fbfe;border-radius:15px;padding:11px 13px;color:#416077;font-size:14px;line-height:1.5;box-shadow:inset 0 1px 3px #5a829807}
#app .auth-form-panel input::placeholder{color:#96adbe;font-size:12px}
#app .auth-form-panel input:focus{outline:2px solid #b9d5e9;outline-offset:1px}
#app .auth-form-panel .primary{display:block;width:100%;border-radius:15px;background:#7b9fbd;color:#fff;padding:12px 16px;font-size:14px;line-height:1.5;border:0}
#app .auth-form-panel .primary:hover{background:#688fac}
#app .auth-form-panel .error{font-size:12px;line-height:1.5;margin:5px 0 12px}
#app .auth-form-panel .error:empty{display:none}
#app .auth-form-panel .auth-links{justify-content:center;margin:10px 0 0;min-height:0}
#app .auth-links:empty{display:none}
#app .auth-links button{font-size:12px;color:#7b99ad}
@media(max-width:760px){#app .auth-card{padding:22px 16px 16px;border-radius:32px}#app .auth-card>h1{font-size:21px;margin-bottom:20px}#app .auth-form-panel{padding:20px 16px 16px}#app .auth-form-panel input{font-size:16px}#app .auth-page{padding:20px 14px}}

/* 时光设置：标题和操作固定，中间独立滚动。 */
#relationship-form{display:flex;flex-direction:column;flex:1;min-height:0;margin:0;overflow:hidden}
#relationship-form>.calendar-form-scroll{flex:1;min-height:0;overflow-y:auto;touch-action:pan-y}
#relationship-form>.actions{flex-shrink:0;margin:0;padding-top:12px;border-top:1px solid #e2edf5;background:#fff}
