/* 陪伴面板 —— 粉嫩、分页、常驻小动画 */
.ps-ov { --p-ink: #5f4a55; --p-sub: #a8929d; --p-mute: #e3d3da; --p-line: #f9e8ee; --p-wash: #fdf1f5; --p-card: #ffffff; --p-pink: #f4bfcf; --p-pink2: #f6cfdb; --p-deep: #e79bb4; --p-bg: #fffafc; --p-glow: rgba(231,155,180,.22);
  position: fixed; inset: 0; z-index: 10050; display: none; align-items: flex-end; justify-content: center; background: rgba(50,36,44,.34); }
html[data-ui="dark"] .ps-ov { --p-ink: #f1e6eb; --p-sub: #b09ea7; --p-mute: #65545c; --p-line: #41343a; --p-wash: #372c32; --p-card: #30262b; --p-pink: #d4a0b1; --p-pink2: #a97a8a; --p-deep: #d79bb0; --p-bg: #241d21; --p-glow: rgba(212,160,177,.16); }
.ps-ov, .ps-ov * { font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif); box-sizing: border-box; }
.ps-ov.visible { display: flex; animation: psFade .2s ease both; }
@keyframes psFade { from { opacity: 0; } to { opacity: 1; } }
.ps-sheet { position: relative; width: min(100%, 560px); height: 90%; display: flex; flex-direction: column; border-radius: 28px 28px 0 0; background: var(--p-bg); color: var(--p-ink); overflow: hidden; animation: psUp .34s cubic-bezier(.2,.8,.2,1) both; }
@keyframes psUp { from { transform: translateY(36px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 顶部：渐变 + 飘动的小爱心 */
.ps-hero { position: relative; flex: none; padding: 8px 20px 18px; background: linear-gradient(120deg, #fcdde8, #fff1f6 45%, #fbd8e5); background-size: 220% 220%; animation: psGrad 9s ease-in-out infinite; border-radius: 0 0 30px 30px; overflow: hidden; }
html[data-ui="dark"] .ps-hero { background: linear-gradient(120deg, #45343c, #3a2d33 45%, #4a3640); background-size: 220% 220%; }
@keyframes psGrad { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.ps-grip { position: relative; width: 38px; height: 4px; margin: 0 auto 10px; border-radius: 4px; background: rgba(160,100,125,.16); }
#ps-x { position: absolute; top: 12px; right: 14px; z-index: 2; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,.55); color: var(--p-deep); font-size: 13px; cursor: pointer; }
html[data-ui="dark"] #ps-x { background: rgba(0,0,0,.25); }
.ps-hero-in { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding-top: 2px; }
.ps-mascot { flex: none; width: 74px; height: 66px; overflow: visible; animation: psFloat 3.6s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(231,155,180,.32)); }
.ps-hb1 { transform-origin: 22px 36px; animation: psBeat 2.4s ease-in-out infinite; }
.ps-hb2 { transform-origin: 44px 32px; animation: psBeat 2.4s ease-in-out .35s infinite; }
@keyframes psFloat { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes psBeat { 0%,100% { transform: scale(1); } 14% { transform: scale(1.1); } 28% { transform: scale(1); } 42% { transform: scale(1.07); } 56% { transform: scale(1); } }
.ps-ht h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: .12em; color: #a4607c; }
html[data-ui="dark"] .ps-ht h3 { color: #ecc8d4; }
.ps-ht p { margin: 4px 0 0; font-size: 13px; color: #b9809a; letter-spacing: .04em; }
html[data-ui="dark"] .ps-ht p { color: #cfa9b8; }
.ps-sky { position: absolute; inset: 0; pointer-events: none; }
.ps-fl { position: absolute; bottom: -16px; font-style: normal; color: #f0a9c0; opacity: 0; animation: psRise 7s linear infinite; }
.ps-fl.f1 { left: 12%; font-size: 12px; animation-delay: 0s; }
.ps-fl.f2 { left: 38%; font-size: 9px; animation-delay: 2.3s; animation-duration: 8s; }
.ps-fl.f3 { left: 66%; font-size: 14px; animation-delay: 4.1s; }
.ps-fl.f4 { left: 86%; font-size: 10px; animation-delay: 1.2s; animation-duration: 9s; }
@keyframes psRise { 0% { transform: translateY(0) translateX(0) scale(.7); opacity: 0; } 15% { opacity: .75; } 70% { opacity: .5; } 100% { transform: translateY(-120px) translateX(10px) scale(1.15); opacity: 0; } }
.ps-sp { position: absolute; font-style: normal; color: #fff; text-shadow: 0 0 6px rgba(240,170,195,.9); animation: psTwinkle 3s ease-in-out infinite; }
.ps-sp.s1 { top: 22%; left: 52%; font-size: 12px; }
.ps-sp.s2 { top: 46%; left: 80%; font-size: 9px; animation-delay: 1s; }
.ps-sp.s3 { top: 14%; left: 24%; font-size: 10px; animation-delay: 1.9s; }
@keyframes psTwinkle { 0%,100% { opacity: .15; transform: scale(.7) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }

/* 分页标签 */
.ps-tabs { flex: none; display: flex; gap: 8px; padding: 12px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.ps-tabs::-webkit-scrollbar { display: none; }
.ps-tab { flex: 1 0 auto; height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--p-wash); color: var(--p-sub); font-size: 13.5px; letter-spacing: .06em; cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.ps-tab:active { transform: scale(.96); }
.ps-tab.on { background: linear-gradient(135deg, var(--p-pink), var(--p-deep)); color: #fff; box-shadow: 0 4px 12px var(--p-glow); }

.ps-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }
.ps-page { animation: psPage .28s ease both; }
@keyframes psPage { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 卡片 */
.ps-card { margin-bottom: 12px; padding: 14px 14px 12px; border-radius: 20px; background: var(--p-card); box-shadow: 0 2px 14px rgba(231,155,180,.12); border: 1px solid var(--p-line); }
.ps-card.ps-main { background: linear-gradient(135deg, #fff, #fff3f7); }
html[data-ui="dark"] .ps-card.ps-main { background: linear-gradient(135deg, #382d33, #30262b); }
.ps-card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; font-weight: 600; letter-spacing: .06em; color: var(--p-ink); }
.ps-hi { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--p-wash); color: var(--p-deep); }
.ps-lead { margin: 4px 4px 12px; font-size: 13.5px; line-height: 1.7; color: var(--p-sub); text-align: center; letter-spacing: .04em; }
.ps-lead small { font-size: 11.5px; color: var(--p-mute); }
.ps-sub { margin: 14px 0 8px; font-size: 12px; color: var(--p-sub); }
.ps-empty { text-align: center; padding: 28px 16px; }
.ps-eh { width: 34px; height: 34px; margin: 0 auto; color: var(--p-pink); animation: psBeat 2.4s ease-in-out infinite; }
.ps-empty p { margin: 8px 0 14px; font-size: 13px; line-height: 1.8; color: var(--p-sub); }

/* 小图标格子 */
.ps-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ps-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 92px; padding: 12px 12px 10px; border-radius: 20px; background: var(--p-card); border: 1.5px solid var(--p-line); cursor: pointer; transition: transform .18s, background .2s, border-color .2s, box-shadow .2s; }
.ps-tile:active { transform: scale(.97); }
.ps-tile input { display: none; }
.ps-tic { display: block; width: 26px; height: 26px; margin-bottom: 8px; color: var(--p-mute); transition: color .2s, transform .25s; }
.ps-tic svg, .ps-hi svg, .ps-eh svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ps-tile b { font-size: 14px; font-weight: 600; color: var(--p-sub); letter-spacing: .04em; transition: color .2s; }
.ps-tile small { font-size: 11px; color: var(--p-mute); }
.ps-tile em { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--p-mute); background: transparent; transition: all .2s; }
.ps-tile:has(input:checked) { background: linear-gradient(145deg, #fff6f9, #fde9f0); border-color: var(--p-pink2); box-shadow: 0 6px 16px var(--p-glow); }
html[data-ui="dark"] .ps-tile:has(input:checked) { background: linear-gradient(145deg, #41333a, #372c32); }
.ps-tile:has(input:checked) .ps-tic { color: var(--p-deep); animation: psPop .4s ease; }
.ps-tile:has(input:checked) b { color: var(--p-ink); }
.ps-tile:has(input:checked) small { color: var(--p-sub); }
.ps-tile:has(input:checked) em { border-color: var(--p-deep); background: var(--p-deep); }
.ps-tile:has(input:checked) em::after { content: '♥'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; }
@keyframes psPop { 0% { transform: scale(.7); } 60% { transform: scale(1.25) rotate(-6deg); } 100% { transform: scale(1); } }

/* 输入框与按钮 */
.ps-ov input[type="text"], .ps-ov input[type="password"] { width: 100%; height: 42px; padding: 0 14px; margin-bottom: 10px; border: 1.5px solid var(--p-line); border-radius: 14px; background: var(--p-bg); color: var(--p-ink); font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.ps-ov input[type="text"]:focus, .ps-ov input[type="password"]:focus { border-color: var(--p-pink2); box-shadow: 0 0 0 3px var(--p-glow); }
.ps-ov input::placeholder { color: var(--p-mute); }
.ps-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ps-row input[type="text"] { margin-bottom: 0; flex: 1; min-width: 0; }
.ps-btn { flex: none; height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--p-pink), var(--p-deep)); color: #fff; font-size: 13.5px; letter-spacing: .06em; cursor: pointer; box-shadow: 0 4px 12px var(--p-glow); transition: transform .15s; }
.ps-btn:active { transform: scale(.96); }
.ps-btn.ghost { background: var(--p-wash); color: var(--p-deep); box-shadow: none; }
.ps-btn:disabled { opacity: .5; }
.ps-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.ps-grid2 .ps-btn { width: 100%; padding: 0 8px; white-space: nowrap; }
.ps-status { font-size: 12px; color: var(--p-sub); margin: 2px 2px 4px; text-align: center; }
.ps-status:empty { display: none; }
.ps-status.ok { color: #6f9a85; }
.ps-status.bad { color: #b87580; }
.ps-note { margin: 6px 2px 2px; font-size: 12px; line-height: 1.7; color: var(--p-sub); text-align: center; }
.ps-note.ps-left { text-align: left; margin-left: 0; margin-right: 0; }

/* 开关（陪伴 / 后台 / 免打扰） */
.ps-sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 14px; cursor: pointer; }
.ps-sw span { display: flex; flex-direction: column; }
.ps-sw small { margin-top: 3px; font-size: 11.5px; color: var(--p-sub); }
.ps-sw input { display: none; }
.ps-sw i { position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--p-mute); transition: background .25s; }
.ps-sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.ps-sw input:checked + i { background: linear-gradient(135deg, var(--p-pink), var(--p-deep)); }
.ps-sw input:checked + i::after { transform: translateX(20px); }

/* 小标签、选项 */
.ps-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-chip { height: 32px; padding: 0 14px; border: 1.5px solid var(--p-line); border-radius: 999px; background: var(--p-card); color: var(--p-sub); font-size: 13px; cursor: pointer; transition: all .15s; }
.ps-chip.on { background: linear-gradient(135deg, var(--p-pink), var(--p-deep)); border-color: transparent; color: #fff; box-shadow: 0 3px 9px var(--p-glow); }
.ps-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ps-tag { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 13px; border-radius: 999px; background: var(--p-wash); color: var(--p-deep); font-size: 13px; }
.ps-tag button { border: 0; background: none; color: var(--p-pink2); font-size: 11px; padding: 4px 6px; cursor: pointer; }
.ps-appcard { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 16px; background: var(--p-wash); }
.ps-appcard b { font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-tgs { display: flex; gap: 6px; flex: none; }
.ps-tg { height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: var(--p-card); color: var(--p-sub); font-size: 12.5px; cursor: pointer; transition: background .15s, color .15s; }
.ps-tg.on { background: linear-gradient(135deg, var(--p-pink), var(--p-deep)); color: #fff; }
.ps-time { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; }
.ps-time span { color: var(--p-sub); font-size: 13px; }
.ps-ov input[type="time"] { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1.5px solid var(--p-line); border-radius: 14px; background: var(--p-bg); color: var(--p-ink); font-size: 15px; outline: none; }

/* 现在的状态 */
.ps-live { margin: 0 0 12px; border-radius: 20px; background: linear-gradient(135deg, #fff3f7, #fff); border: 1px solid var(--p-line); font-size: 13px; line-height: 1.85; color: var(--p-ink); overflow: hidden; }
html[data-ui="dark"] .ps-live { background: linear-gradient(135deg, #382d33, #30262b); }
.ps-live:empty { display: none; }
.ps-live-t { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0; padding: 12px 14px; border: 0; background: none; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--p-deep); cursor: pointer; text-align: left; }
.ps-live-t i { font-style: normal; font-size: 16px; color: var(--p-pink2); transform: rotate(90deg); transition: transform .2s; }
.ps-live.folded .ps-live-t i { transform: none; }
.ps-live-b { max-height: 168px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 14px 12px; }
.ps-live.folded .ps-live-b { display: none; }

/* 链接与教程 */
.ps-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--p-line); font-size: 13px; }
.ps-link:first-child { border-top: 0; }
.ps-link span { min-width: 0; line-height: 1.5; }
.ps-link button { flex: none; height: 28px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--p-wash); color: var(--p-deep); font-size: 12px; cursor: pointer; }
.ps-link button.done, .ps-btn.done { background: var(--p-deep); color: #fff; }
.ps-link button.fail, .ps-btn.fail { background: #f6e6e8; color: #b87580; }
.ps-flash { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); z-index: 3; transform: translate(-50%, 6px); padding: 9px 18px; border-radius: 999px; background: rgba(80,66,74,.94); color: #fff; font-size: 13px; letter-spacing: .04em; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; white-space: nowrap; }
.ps-flash.show { opacity: 1; transform: translate(-50%, 0); }
.ps-flash.bad { background: rgba(184,117,128,.95); }
.ps-guide { margin-top: 2px; }
.ps-d { border-radius: 16px; background: var(--p-wash); margin-bottom: 10px; overflow: hidden; }
.ps-d summary { list-style: none; cursor: pointer; padding: 13px 14px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ps-d summary::-webkit-details-marker { display: none; }
.ps-d summary::after { content: '›'; font-size: 18px; color: var(--p-pink2); transition: transform .2s; }
.ps-d[open] summary::after { transform: rotate(90deg); }
.ps-d[open] summary { border-bottom: 1px solid var(--p-line); }
.ps-dbody { padding: 12px 14px 14px; font-size: 13px; line-height: 1.85; color: var(--p-ink); }
.ps-dbody p { margin: 0 0 8px; }
.ps-dbody h5 { margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--p-deep); }
.ps-dbody ol, .ps-dbody ul { margin: 0 0 8px; padding-left: 20px; }
.ps-dbody li { margin-bottom: 4px; }
.ps-dbody b { font-weight: 600; }
.ps-card > .ps-outer { margin: 0; background: transparent; }
.ps-card > .ps-outer > summary { padding: 4px 2px; font-weight: 600; letter-spacing: .06em; }
.ps-card > .ps-outer[open] > summary { border-bottom: 0; margin-bottom: 6px; }
.ps-outer > .ps-guide { padding: 6px 2px 2px; }
.ps-card > .ps-outer .ps-d { background: var(--p-wash); }
.ps-card > .ps-outer > .ps-dbody { padding: 4px 2px 2px; }

/* 减少动态 */
@media (prefers-reduced-motion: reduce) {
  .ps-hero, .ps-mascot, .ps-hb1, .ps-hb2, .ps-fl, .ps-sp, .ps-eh, .ps-page, .ps-tile:has(input:checked) .ps-tic { animation: none !important; }
  .ps-fl { opacity: 0; }
}
html[data-ui="dark"] .ps-ov .ps-sheet { background: var(--p-bg) !important; }
html[data-ui="dark"] .ps-ov input[type="text"], html[data-ui="dark"] .ps-ov input[type="password"], html[data-ui="dark"] .ps-ov input[type="time"] { background: var(--p-wash) !important; color: var(--p-ink) !important; border-color: var(--p-line) !important; }
.ps-ov .ps-chip.on, .ps-ov .ps-tg.on, .ps-ov .ps-btn:not(.ghost), .ps-ov .ps-tab.on { background: linear-gradient(135deg, var(--p-pink), var(--p-deep)) !important; color: #fff !important; }
.ps-ov .ps-sw input:checked + i { background: linear-gradient(135deg, var(--p-pink), var(--p-deep)) !important; }
.ps-ov .ps-sw i { background: var(--p-mute); }
