/* ── Status bar (real, lightweight) ── */
.phone-status{padding-top:calc(8px + env(safe-area-inset-top,0px))}
.status-time{font-variant-numeric:tabular-nums;font-weight:600}
.status-signal{display:inline-flex;align-items:flex-end;gap:2px;height:9px}
.status-signal i{display:block;width:3px;background:currentColor;border-radius:1px;opacity:.9}
.status-signal i:nth-child(1){height:4px}
.status-signal i:nth-child(2){height:6px}
.status-signal i:nth-child(3){height:8px}
.status-signal i:nth-child(4){height:9px}
.status-wifi svg{width:14px;height:14px;display:block}
.status-battery{display:inline-flex;align-items:center}
.status-battery::before{content:'';display:block;width:20px;height:10px;border:1.3px solid currentColor;border-radius:2.5px;box-sizing:border-box;position:relative}
.status-battery::after{content:'';display:block;width:1.3px;height:4px;background:currentColor;border-radius:0 1px 1px 0;margin-left:1px}
.status-battery i{position:absolute;left:22px;top:2px;width:14px;height:6px;border-radius:1px;background:currentColor}

/* ── Top bar: the glass bell (the desktop's ··· menu is gone: 编辑桌面 = long press, 应用中心 = its icon, 桌面设置 = the edit toolbar) ── */
.home-topbar{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:2px 20px 0}
.home-bell{position:relative;--ln:var(--pri-deep);color:var(--ln);border:none;background:none;border-radius:12px;display:flex;align-items:center;justify-content:center;cursor:pointer}
/* the visible 38px tile sits inside the 44px hit box (index.html), in the same glass as the App icons (desktop.css): light glass,
   see-through over a bright wallpaper, white lines on clear glass over a dark one */
.home-bell::before{content:"";position:absolute;inset:3px;border-radius:12px;border:1px solid rgb(255 255 255/90%);background:linear-gradient(160deg,rgb(255 255 255/80%) 0%,color-mix(in srgb,var(--pri-pale) 60%,rgb(255 255 255/40%)) 60%,rgb(255 255 255/62%) 100%);-webkit-backdrop-filter:blur(14px) saturate(150%);backdrop-filter:blur(14px) saturate(150%);box-shadow:inset 0 1.5px 0 #fff,inset 0 -3px 7px color-mix(in srgb,var(--pri-deep) 10%,transparent)}
.home-bell::after{content:"";position:absolute;left:9px;right:9px;top:5px;height:10px;pointer-events:none;border-radius:50% 50% 45% 45% / 75% 75% 25% 25%;background:linear-gradient(180deg,rgb(255 255 255/90%),rgb(255 255 255/0%));opacity:.5}
.home-bell svg{position:relative;z-index:1;width:18px;height:18px;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
#v-home.has-wall:not(.icons-on-dark) .home-bell::before{border-color:rgb(255 255 255/75%);background:linear-gradient(160deg,rgb(255 255 255/45%),rgb(255 255 255/18%) 60%,rgb(255 255 255/32%));box-shadow:inset 0 1px 0 rgb(255 255 255/70%)}
#v-home.icons-on-dark .home-bell{--ln:rgb(255 255 255/95%)}
#v-home.icons-on-dark .home-bell::before{border-color:rgb(255 255 255/28%);background:linear-gradient(160deg,rgb(255 255 255/22%),rgb(255 255 255/6%) 60%,rgb(255 255 255/12%));box-shadow:inset 0 1px 0 rgb(255 255 255/40%)}
#v-home.icons-on-dark .home-bell::after{opacity:.25}
/* 透明图标（data-icon-style="clear"）：铃铛跟图标同一种透明玻璃 */
html[data-icon-style="clear"] #v-home .home-bell::before{border-color:rgb(255 255 255/85%);background:linear-gradient(160deg,rgb(255 255 255/48%),rgb(255 255 255/14%) 60%,rgb(255 255 255/30%));-webkit-backdrop-filter:blur(2px) saturate(130%);backdrop-filter:blur(2px) saturate(130%);box-shadow:inset 0 1px 0 rgb(255 255 255/80%),0 0 0 1px color-mix(in srgb,var(--pri-deep) 13%,transparent)}
html[data-icon-style="clear"] #v-home .home-bell::after{opacity:.35}
html[data-icon-style="clear"] #v-home.icons-on-dark .home-bell::before{border-color:rgb(255 255 255/26%);background:linear-gradient(160deg,rgb(255 255 255/16%),rgb(255 255 255/4%) 60%,rgb(255 255 255/9%));box-shadow:inset 0 1px 0 rgb(255 255 255/35%)}
html[data-icon-style="clear"] #v-home.icons-on-dark .home-bell::after{opacity:.2}
.home-bell-dot{position:absolute;top:9px;right:9px;z-index:1;width:7px;height:7px;border-radius:50%;background:var(--icon-accent,#F7D27A);box-shadow:0 0 0 2px rgb(255 255 255/55%)}

/* ── Desktop app badges ── */
.app-icon,.dock-icon{position:relative}
.app-badge{position:absolute;top:-5px;right:-6px;min-width:16px;height:16px;padding:0 4px;border-radius:9px;background:var(--coral);color:var(--on-coral,#fff);font-size:10px;font-weight:700;line-height:16px;text-align:center;box-shadow:0 0 0 2px var(--bg);font-variant-numeric:tabular-nums}
.app-badge.is-dot{min-width:8px;width:8px;height:8px;padding:0;top:-2px;right:-2px}
.app-badge[hidden]{display:none}
/* 角标颜色（桌面设置 › 图标 › 角标颜色；html[data-badge-color]，默认 theme）：主题色 = 主题色压深 + 白字（深浅模式都是深底，
   不随深色模式变浅）；柔红 = 干净的玫瑰红；白玻璃 = 白底 + 主题深色字。都不再套 --bg 色的外圈（壁纸上像一圈脏边）。 */
html[data-badge-color] .app-badge{box-shadow:none;color:#fff;background:color-mix(in srgb,var(--pri) 72%,#000)}
html[data-badge-color="red"] .app-badge{background:#E5707C}
/* 点缀色: the bright second colour of the desktop icons (--icon-accent, theme-engine ICON_ACCENTS), dark ink on it */
html[data-badge-color="accent"] .app-badge{background:var(--icon-accent,#F7D27A);color:#2B3440}
html[data-badge-color="glass"] .app-badge{background:rgb(255 255 255/92%);color:color-mix(in srgb,var(--pri) 72%,#000);box-shadow:0 0 0 1px color-mix(in srgb,var(--pri) 30%,transparent)}
/* 角标不显示数字：一个小圆点，贴在图标右上角 */
html.badge-dot .app-badge:not([hidden]){min-width:0;width:9px;height:9px;padding:0;top:-2px;right:-2px;border-radius:50%;font-size:0;line-height:0;overflow:hidden}
.app-icon.pulse,.dock-icon.pulse{animation:appIconPulse .32s ease}
@keyframes appIconPulse{0%{transform:scale(1)}45%{transform:scale(1.12)}100%{transform:scale(1)}}
.app-icon.glow::after{content:'';position:absolute;inset:-5px;border-radius:22px;box-shadow:0 0 0 3px var(--pri-pale);opacity:0;animation:appIconGlow 1.6s ease-out 1}
@keyframes appIconGlow{0%{opacity:.9;transform:scale(.9)}100%{opacity:0;transform:scale(1.18)}}
@media (prefers-reduced-motion:reduce){.app-icon.pulse,.dock-icon.pulse,.app-icon.glow::after{animation:none}}

/* Calendar live day number */
#home-calendar-icon [data-icon]{opacity:0}
.app-icon-daynum{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:var(--font-display);font-weight:700;font-size:19px;color:var(--icon-fg,#3E5568)}

/* Period privacy dot (opt-in only) */
.app-icon-status-dot{position:absolute;bottom:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--pri)}

/* ── Relationship widget (real data) ── */
.relationship-widget{margin:24px 0 0;border-radius:var(--r);background:var(--bg);box-shadow:var(--shadow-in);border:1px solid var(--line-soft);overflow:hidden;flex-shrink:0}
.rel-card{position:relative;padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:14px;cursor:pointer;border:none;background:none;width:100%;text-align:left;font-family:inherit;color:inherit}
.rel-left{display:flex;align-items:center;gap:12px;min-width:0}
.rel-avatars{display:flex;align-items:center;flex-shrink:0}
.rel-avatar{width:36px;height:36px;border-radius:50%;background:var(--surface-alt);box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;font-size:15px;overflow:hidden;border:1.5px solid var(--surface);color:var(--ink2)}
.rel-avatar .avatar-placeholder{display:flex;align-items:center;justify-content:center;width:100%;height:100%}
.rel-avatar .avatar-placeholder svg{width:18px;height:18px}
.rel-avatar img{width:100%;height:100%;object-fit:cover}
.rel-avatar.second{margin-left:-11px;border:1.5px solid var(--bg);box-shadow:0 0 0 1px var(--surface),var(--shadow)}
.rel-meta{min-width:0}
.rel-names{font-size:13px;font-weight:600;color:var(--ink)}
.rel-tagline{margin-top:2px;font-size:11px;color:var(--ink2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px}
.rel-days-big{flex-shrink:0;font-family:var(--font-display);font-size:18px;font-weight:600;color:var(--ink);text-align:right}
.rel-days-suffix{font-size:11px;font-family:var(--font-body);font-weight:400;color:var(--ink2);margin-left:2px}
.rel-empty{padding:20px 18px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;border:none;background:none;width:100%;font-family:inherit;cursor:pointer;color:inherit}
.rel-empty svg{width:26px;height:26px;color:var(--mist)}
.rel-empty b{font-size:13.5px;font-weight:600;color:var(--ink)}
.rel-empty span{font-size:11.5px;color:var(--ink2)}
.rel-dots{position:absolute;left:0;right:0;bottom:5px;display:flex;justify-content:center;gap:4px;pointer-events:none}
.rel-dots i{width:4px;height:4px;border-radius:50%;background:color-mix(in srgb,var(--pri) 30%,var(--border))}
.rel-dots i.active{background:var(--pri-deep)}

/* ── Desktop dynamic widget content (container sizing/placement lives in desktop.css) ── */
.home-widget-card{border-radius:var(--r-sm);background:var(--bg);box-shadow:var(--shadow);padding:12px 14px;min-height:60px}
.hw-row{display:flex;align-items:center;gap:10px;width:100%;border:none;background:none;font-family:inherit;color:inherit;text-align:left;cursor:pointer;padding:2px 0}
.hw-av{width:38px;height:38px;border-radius:13px;overflow:hidden;background:var(--surface-alt);display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:15px}
.hw-av img{width:100%;height:100%;object-fit:cover}
.hw-main{min-width:0;flex:1}
.hw-title-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.hw-title-row b{font-size:13px;font-weight:600;color:var(--ink)}
.hw-title-row time{font-size:10.5px;color:var(--ink2);flex-shrink:0}
.hw-sub{margin-top:2px;font-size:12px;color:var(--ink2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hw-unread{flex-shrink:0;min-width:16px;height:16px;padding:0 4px;border-radius:9px;background:var(--coral);color:var(--on-coral,#fff);font-size:10px;font-weight:700;line-height:16px;text-align:center}
.hw-empty{font-size:12.5px;color:var(--ink2);text-align:center;padding:10px 0}

/* ── Notification center ── */
.notif-top-action{border:none;background:none;color:var(--accent-text);font-family:inherit;font-size:12.5px;font-weight:600;padding:6px 8px;cursor:pointer;display:flex;align-items:center}
.notif-top-action svg{width:17px;height:17px;color:var(--ink2);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.notif-group-title{padding:10px 18px 6px;font-size:12px;font-weight:600;color:var(--ink2);letter-spacing:.02em}
.notif-row{width:100%;display:flex;gap:11px;align-items:flex-start;padding:11px 16px;box-sizing:border-box;text-align:left;font-family:inherit;color:inherit;cursor:pointer;border-bottom:.5px solid color-mix(in srgb,var(--border) 65%,transparent)}
.notif-row.unread{background:color-mix(in srgb,var(--pri) 6%,var(--bg))}
.notif-icon-wrap{position:relative;flex-shrink:0;width:40px;height:40px}
.notif-icon-wrap .notif-av{width:40px;height:40px;border-radius:13px;overflow:hidden;background:var(--surface-alt);display:flex;align-items:center;justify-content:center;font-size:16px}
.notif-icon-wrap .notif-av img{width:100%;height:100%;object-fit:cover}
.notif-icon-wrap .notif-av>svg,.notif-icon-wrap .notif-av .avatar-placeholder svg{width:19px;height:19px;stroke-width:1.6;color:var(--ink2)}
.notif-icon-wrap .notif-av .avatar-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.notif-body{min-width:0;flex:1}
.notif-body-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.notif-body-top b{font-size:13.5px;font-weight:600;color:var(--ink);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* a merged card (one per character in 信息) says how many messages it stands for */
.notif-count{margin-left:6px;font-style:normal;font-size:11px;font-weight:600;color:var(--ink2)}
.notif-row.read .notif-body-top b{font-weight:500;color:var(--ink2)}
.notif-time{font-size:11px;color:var(--ink2);flex-shrink:0}
.notif-snippet{margin-top:2px;font-size:12.5px;color:var(--ink2);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.notif-unread-dot{flex-shrink:0;width:7px;height:7px;border-radius:50%;background:var(--pri);margin-top:5px}
.notif-empty{padding:60px 30px;text-align:center;color:var(--ink2)}
.notif-empty svg{width:36px;height:36px;color:var(--mist);margin-bottom:10px}
.notif-empty h3{font-size:15px;color:var(--ink);margin-bottom:4px}
.notif-empty p{font-size:12.5px;line-height:1.5}
.notif-row-menu-btn{flex-shrink:0;align-self:center;border:none;background:none;color:var(--mist);border-radius:10px;width:26px;height:26px;display:flex;align-items:center;justify-content:center}
.notif-row-menu-btn svg{width:15px;height:15px;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

@media (max-width:390px){
  .rel-tagline{max-width:130px}
}

/* ── 系统横幅 (js/system-banner.js): above every app, below appConfirm (500) ── */
.sys-banner-host{position:fixed;left:0;right:0;top:0;margin:0 auto;max-width:430px;z-index:495;pointer-events:none;padding:calc(env(safe-area-inset-top,0px) + 10px) 10px 0}
.sys-banner{--sb-fg:#2F3D4B;--sb-sub:#44546A;--sb-bg:rgb(255 255 255/62%);--sb-line:rgb(255 255 255/70%);--sb-hi:rgb(255 255 255/85%);--sb-shadow:0 12px 28px -12px rgb(30 48 72/45%);--sb-ic-bg:var(--pri-pale,#e6eef8);--sb-ic-fg:var(--pri,#5e7fa6);
  pointer-events:none;position:relative;width:100%;display:flex;align-items:center;gap:12px;padding:11px 14px;border-radius:22px;text-align:left;font-family:inherit;color:var(--sb-fg);cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;
  background:var(--sb-bg);-webkit-backdrop-filter:blur(20px) saturate(140%);backdrop-filter:blur(20px) saturate(140%);border:1px solid var(--sb-line);
  box-shadow:inset 1.5px 1.5px 0 var(--sb-hi),var(--sb-shadow);animation:sysBannerIn .32s cubic-bezier(.2,.9,.3,1.2) both;transition:transform .2s ease,opacity .2s ease}
.sys-banner.out{opacity:0;transform:translateY(-24px)!important}
/* The banner sits over the top bar of whatever app is open (返回 / 取消 on the left, 发布 / 更多 on the right), so only its middle takes taps and swipes (a transparent layer);
   the 72px at each end let the touch through to the button underneath (the bar's buttons are about 62px wide + 16px from the edge). */
.sys-banner::before{content:"";position:absolute;top:0;bottom:0;left:72px;right:72px;pointer-events:auto}
.sys-banner[data-tone="alert"]{--sb-line:rgb(150 40 48/55%);--sb-ic-bg:#7a1f28;--sb-ic-fg:#fff}
.sys-banner-av{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:var(--surface-alt,#eef2f6);border:2px solid rgb(255 255 255/90%)}
.sys-banner-av img{width:100%;height:100%;object-fit:cover}
.sys-banner-av .character-avatar-fallback{font-size:16px}
.sys-banner-ic{width:38px;height:38px;flex-shrink:0;border-radius:12px;display:flex;align-items:center;justify-content:center;background:var(--sb-ic-bg);color:var(--sb-ic-fg)}
.sys-banner-ic svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sys-banner-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.sys-banner-top{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--sb-sub)}
.sys-banner-app{font-weight:600;letter-spacing:.02em}
.sys-banner-t{margin-left:auto;flex-shrink:0}
.sys-banner-title{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sys-banner-body{font-size:13px;color:var(--sb-sub);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.4}
.sys-banner:focus-visible{outline:2px solid var(--sb-ic-fg);outline-offset:2px}
@keyframes sysBannerIn{from{opacity:0;transform:translateY(-28px) scale(.96)}to{opacity:1;transform:none}}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .sys-banner{--sb-fg:#E8EDF4;--sb-sub:#B4BFCD;--sb-bg:rgb(34 40 52/72%);--sb-line:rgb(255 255 255/14%);--sb-hi:rgb(255 255 255/10%);--sb-shadow:0 12px 28px -12px rgb(0 0 0/60%)}
  :root:not([data-theme="light"]) .sys-banner[data-tone="alert"]{--sb-line:rgb(220 90 100/55%);--sb-ic-bg:#8c2a33}}
:root[data-theme="dark"] .sys-banner{--sb-fg:#E8EDF4;--sb-sub:#B4BFCD;--sb-bg:rgb(34 40 52/72%);--sb-line:rgb(255 255 255/14%);--sb-hi:rgb(255 255 255/10%);--sb-shadow:0 12px 28px -12px rgb(0 0 0/60%)}
:root[data-theme="dark"] .sys-banner[data-tone="alert"]{--sb-line:rgb(220 90 100/55%);--sb-ic-bg:#8c2a33}
html.desk-reduce-glass .sys-banner{-webkit-backdrop-filter:none;backdrop-filter:none;--sb-bg:var(--surface,#fff)}
@media (prefers-reduced-motion:reduce){.sys-banner{animation:none;transition:none}}
