/* =====================================================================
 * 精神领域（Mind Realm）· 独立样式
 * ---------------------------------------------------------------------
 * mre-  ②号子屏幕入口组件（星球 + 双文字条）
 * mrg-  银河星海 overlay（星海 / 精神领域 / 弹窗）
 * 独立文件：不与其它功能共用选择器；仅对自身挂载槽做定位微调。
 * ===================================================================== */

/* ============================================================
 * 一、②号子屏幕入口组件
 * 通过负外边距把本组件上提到快捷区的流内横带（快捷区自身经
 * sub-screen-2-shortcuts.css 纯视觉下移，本横带只剩本组件）。
 * 2026-08-17：快捷区下移后本组件水平居中，视觉更平衡。
 * ============================================================ */

#ss2-widget-mind-realm-entry {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    /* Preserve the original flow slot so the lower widget band does not move. */
    height: calc(var(--home-quick-btn-size, 70px) * 2 + var(--home-quick-btn-gap, 12px));
    /* 上提：抵消 2×2 磁贴高度 + 功能区纵向 gap（与 sub-screen-2.css 的 clamp 同步） */
    margin-top: calc((var(--home-quick-btn-size, 70px) * 2 + var(--home-quick-btn-gap, 12px)) * -1 - clamp(12px, 2.4vh, 18px));
    /* 可见入口水平居中，并按真实视口宽度缩放，不再取固定 2×2 快捷区的剩余宽度。 */
    width: 56vw;
    min-width: 180px;
    max-width: 242px;
    margin-left: auto;
    margin-right: auto;
    pointer-events: none; /* 空隙不挡下层；按钮自身恢复 */
}

.mre-widget {
    pointer-events: auto;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    width: 100%;
    height: 29vw;
    min-height: 102px;
    max-height: 128px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
}

.mre-widget:active .mre-planet { transform: translateY(-50%) scale(0.96); }

/* ---------- 星球 ---------- */
.mre-planet {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24vw;
    height: 24vw;
    min-width: 76px;
    min-height: 76px;
    max-width: 104px;
    max-height: 104px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 3;
    background: #05030a;
    box-shadow:
        0 6px 22px rgba(10, 6, 26, 0.45),
        0 0 26px rgba(214, 178, 94, 0.28);
    transition: transform 0.18s ease;
}

.mre-planet-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: mre-planet-spin 90s linear infinite;
}

@keyframes mre-planet-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* 星球图缺失时的 CSS 兜底：金色星球 */
.mre-planet--fallback {
    background:
        radial-gradient(circle at 34% 30%, rgba(240, 214, 141, 0.95) 0%, rgba(190, 150, 70, 0.9) 26%, rgba(94, 70, 28, 0.95) 58%, rgba(20, 14, 6, 1) 100%);
}
.mre-planet--fallback::after {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px solid rgba(240, 214, 141, 0.4);
    transform: rotate(-18deg) scaleY(0.42);
}

.mre-planet-glow {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 18px rgba(240, 214, 141, 0.22);
    animation: mre-planet-breath 5.5s ease-in-out infinite;
}

@keyframes mre-planet-breath {
    0%, 100% { box-shadow: inset 0 0 14px rgba(240, 214, 141, 0.16); }
    50%      { box-shadow: inset 0 0 26px rgba(240, 214, 141, 0.34); }
}

/* ---------- 双文字条 ---------- */
.mre-bars {
    position: absolute;
    top: 5%;
    bottom: 5%;
    right: 0;
    /* 从星球中线附近开始，被星球压住一角（参考音乐组件的层叠关系） */
    left: 21.5%;
    display: flex;
    flex-direction: column;
    gap: 7px;
    gap: clamp(6px, 2vw, 9px);
    z-index: 2;
}

.mre-bar {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    border-radius: 999px;
    /* 文字避开被星球覆盖的区域 */
    /* 文字起点越过响应式星球右缘，窄屏时也不会被星球压住。 */
    padding-left: calc(27.4% + 10px);
    padding-right: 12px;
    padding-right: clamp(10px, 3.5vw, 14px);
    box-sizing: border-box;
    overflow: hidden;
}

/* 上条：纯白 · 不透明度 85% · 模糊 30px */
.mre-bar--top {
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 20px rgba(30, 20, 60, 0.10);
}

/* 下条：无底色 · 不透明度 85% · 模糊 30px（毛玻璃透出壁纸） */
.mre-bar--bottom {
    background: rgba(255, 255, 255, 0);
    opacity: 0.85;
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow: 0 8px 20px rgba(30, 20, 60, 0.08);
}

.mre-bar-text {
    display: block;
    width: 100%;
    font-family: Georgia, 'Times New Roman', 'STSong', serif;
    font-size: 12px;
    font-size: clamp(11px, 3.25vw, 13px);
    letter-spacing: 0.05em;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* 上条恒为浅底 → 深色文字 */
.mre-bar--top .mre-bar-text {
    color: rgba(38, 30, 58, 0.92);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 下条：默认深色字 + 双向光晕（取样失败也保底可读） */
.mre-bar--bottom .mre-bar-text {
    color: rgba(38, 30, 58, 0.92);
    text-shadow:
        0 0 6px rgba(255, 255, 255, 0.85),
        0 1px 2px rgba(255, 255, 255, 0.65);
}

/* 壁纸取样结果：亮背景 → 深色字 */
.mre-widget.mre-adapt-dark .mre-bar--bottom .mre-bar-text {
    color: rgba(34, 26, 54, 0.94);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.75), 0 1px 2px rgba(255, 255, 255, 0.55);
}

/* 壁纸取样结果：暗背景 → 白色字 */
.mre-widget.mre-adapt-light .mre-bar--bottom .mre-bar-text {
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 0 8px rgba(8, 6, 20, 0.85), 0 1px 3px rgba(8, 6, 20, 0.6);
}

/* 短屏手机 / 横屏 WebView：进一步收紧，但保持星球、双条和整体比例同步。 */
@media (max-height: 700px) {
    #ss2-widget-mind-realm-entry {
        width: 50vw;
        min-width: 176px;
        max-width: 220px;
    }

    .mre-widget {
        height: 26vw;
        min-height: 96px;
        max-height: 112px;
    }

    .mre-planet {
        width: 21vw;
        height: 21vw;
        min-width: 70px;
        min-height: 70px;
        max-width: 90px;
        max-height: 90px;
    }

    .mre-bar-text {
        font-size: 11.5px;
        font-size: clamp(10.5px, 3vw, 12px);
    }
}

/* ============================================================
 * 二、银河星海 overlay
 * ============================================================ */

#mind-realm-overlay {
    position: absolute;
    inset: 0;
    z-index: 6000;
    display: none;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 20% 8%, rgba(66, 46, 120, 0.55) 0%, rgba(20, 14, 46, 0) 55%),
        radial-gradient(110% 90% at 84% 88%, rgba(28, 62, 110, 0.5) 0%, rgba(10, 8, 30, 0) 60%),
        linear-gradient(168deg, #0a0820 0%, #120d33 38%, #0b1030 70%, #05040f 100%);
    color: #eef0ff;
    border-radius: inherit;
}

#mind-realm-overlay.mrg-open { display: block; }

.mrg-hidden { display: none !important; }

.mrg-stars-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 漂移星云雾块 */
.mrg-nebula-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.mrg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(46px);
    opacity: 0.5;
    animation: mrg-blob-drift 26s ease-in-out infinite alternate;
}
.mrg-blob--a {
    width: 62%; height: 40%;
    left: -12%; top: 6%;
    background: radial-gradient(circle, rgba(147, 96, 255, 0.5) 0%, rgba(147, 96, 255, 0) 70%);
}
.mrg-blob--b {
    width: 54%; height: 36%;
    right: -10%; top: 40%;
    background: radial-gradient(circle, rgba(64, 156, 255, 0.42) 0%, rgba(64, 156, 255, 0) 70%);
    animation-delay: -9s;
}
.mrg-blob--c {
    width: 48%; height: 32%;
    left: 14%; bottom: -8%;
    background: radial-gradient(circle, rgba(255, 128, 190, 0.32) 0%, rgba(255, 128, 190, 0) 70%);
    animation-delay: -17s;
}
@keyframes mrg-blob-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(6%, -4%, 0) scale(1.12); }
}

/* ---------- 视图容器 ---------- */
.mrg-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

/* ---------- 头部 ---------- */
.mrg-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) 16px 10px;
}

.mrg-header-titles { flex: 1 1 auto; min-width: 0; }

.mrg-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: #f2f0ff;
    text-shadow: 0 0 14px rgba(150, 120, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mrg-subtitle {
    margin: 3px 0 0;
    font-size: 10px;
    letter-spacing: 0.34em;
    color: rgba(214, 210, 255, 0.5);
    font-family: Georgia, serif;
}

.mrg-close,
.mrg-back,
.mrg-filter {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(214, 210, 255, 0.22);
    background: rgba(24, 18, 56, 0.55);
    color: rgba(238, 236, 255, 0.9);
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mrg-back { font-size: 24px; padding-bottom: 3px; }
.mrg-close:active, .mrg-back:active, .mrg-filter:active { background: rgba(60, 46, 120, 0.7); }

.mrg-filter {
    position: relative;
    color: rgba(226, 222, 255, 0.9);
}
.mrg-filter--active {
    border-color: rgba(178, 150, 255, 0.58);
    background: rgba(112, 78, 210, 0.3);
    color: #f4f1ff;
    box-shadow: 0 0 14px rgba(132, 94, 244, 0.2);
}
.mrg-filter-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.mrg-filter-count {
    position: absolute;
    right: -4px;
    top: -4px;
    min-width: 15px;
    height: 15px;
    box-sizing: border-box;
    padding: 0 3px;
    border-radius: 999px;
    border: 1px solid rgba(16, 10, 44, 0.95);
    background: #9d7cff;
    color: #fff;
    font-size: 8px;
    line-height: 13px;
    text-align: center;
    letter-spacing: 0;
}

/* ---------- 星海：漂浮头像 ---------- */
.mrg-avatars {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mrg-avatars::-webkit-scrollbar { display: none; width: 0; height: 0; }

.mrg-avatar-field {
    position: relative;
    width: 100%;
    min-height: 100%;
}

.mrg-sea-empty {
    position: absolute;
    left: 0; right: 0; top: 44%;
    text-align: center;
    color: rgba(214, 210, 255, 0.55);
    font-size: 13px;
    z-index: 3;
}

.mrg-avatar {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: mrg-avatar-float var(--mrg-float-dur, 9s) ease-in-out var(--mrg-float-delay, 0s) infinite alternate;
}

@keyframes mrg-avatar-float {
    from { margin-left: 0; margin-top: 0; }
    to   { margin-left: var(--mrg-float-dx, 12px); margin-top: var(--mrg-float-dy, -16px); }
}

.mrg-avatar-orb {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 32% 28%, #6a5ae0 0%, #35297a 70%);
    box-shadow:
        0 0 0 2px rgba(238, 236, 255, 0.22),
        0 0 22px rgba(150, 120, 255, 0.55),
        0 6px 18px rgba(4, 2, 16, 0.6);
}

.mrg-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1; /* 有头像图时盖住首字母兜底；加载失败时脚本会移除 img */
}

.mrg-avatar-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgba(238, 236, 255, 0.92);
    z-index: 0;
}

.mrg-avatar-ring {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 74px;
    height: 74px;
    margin-left: -37px;
    border-radius: 50%;
    border: 1px solid rgba(214, 200, 255, 0.30);
    pointer-events: none;
    animation: mrg-ring-breath 4.2s ease-in-out infinite;
}

@keyframes mrg-ring-breath {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50%      { transform: scale(1.14); opacity: 0.16; }
}

.mrg-avatar-name {
    max-width: 84px;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: rgba(238, 236, 255, 0.85);
    text-shadow: 0 0 8px rgba(8, 4, 26, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mrg-avatar:active .mrg-avatar-orb { transform: scale(0.94); }

/* ---------- 弹窗（潜入确认 / 星卡） ---------- */
.mrg-modal {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.mrg-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(4, 2, 14, 0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.mrg-modal-card {
    position: relative;
    width: min(320px, 88%);
    box-sizing: border-box;
    border-radius: 22px;
    padding: 22px 20px 18px;
    background: linear-gradient(165deg, rgba(38, 28, 88, 0.96) 0%, rgba(18, 13, 48, 0.97) 100%);
    border: 1px solid rgba(170, 150, 255, 0.28);
    box-shadow: 0 18px 50px rgba(2, 0, 12, 0.7), inset 0 1px 0 rgba(214, 200, 255, 0.18);
    text-align: center;
}

.mrg-modal-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin: -50px auto 10px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 32% 28%, #6a5ae0 0%, #35297a 70%);
    box-shadow: 0 0 0 3px rgba(24, 16, 60, 1), 0 0 24px rgba(150, 120, 255, 0.6);
    font-size: 24px;
    color: rgba(238, 236, 255, 0.92);
}
.mrg-modal-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mrg-modal-title {
    margin: 4px 0 0;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #f2f0ff;
    line-height: 1.5;
}

.mrg-modal-desc {
    margin: 8px 0 0;
    font-size: 12px;
    color: rgba(214, 210, 255, 0.6);
    line-height: 1.6;
}

.mrg-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.mrg-btn {
    flex: 1 1 0;
    height: 40px;
    border-radius: 999px;
    font-size: 13.5px;
    letter-spacing: 0.06em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid transparent;
}

.mrg-btn--ghost {
    background: rgba(238, 236, 255, 0.06);
    border-color: rgba(214, 210, 255, 0.26);
    color: rgba(224, 220, 250, 0.85);
}

.mrg-btn--primary {
    background: linear-gradient(135deg, #8f6bff 0%, #5e3ff0 100%);
    color: #fff;
    box-shadow: 0 8px 22px rgba(110, 70, 255, 0.45);
}
.mrg-btn:active { transform: translateY(1px); }

/* ---------- 星海好友筛选 ---------- */
.mrg-filter-modal {
    align-items: flex-end;
    padding: 12px 12px calc(12px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.mrg-filter-card {
    display: flex;
    flex-direction: column;
    width: min(390px, 100%);
    max-height: min(78vh, 620px);
    padding: 16px 16px 14px;
    border-radius: 24px;
    text-align: left;
}

.mrg-filter-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mrg-filter-head-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d9ceff;
    border: 1px solid rgba(178, 150, 255, 0.3);
    background: rgba(132, 94, 244, 0.14);
}
.mrg-filter-head-copy { flex: 1 1 auto; min-width: 0; }
.mrg-filter-head-copy .mrg-modal-title { margin: 0; }
.mrg-filter-head-copy .mrg-modal-desc { margin-top: 2px; }

.mrg-filter-dismiss {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(238, 236, 255, 0.06);
    color: rgba(238, 236, 255, 0.78);
    font-size: 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mrg-filter-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    height: 40px;
    padding: 0 12px;
    box-sizing: border-box;
    border-radius: 13px;
    border: 1px solid rgba(170, 150, 255, 0.2);
    background: rgba(7, 5, 24, 0.42);
}
.mrg-filter-search-wrap:focus-within { border-color: rgba(178, 150, 255, 0.58); }
.mrg-filter-search-wrap svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: rgba(214, 210, 255, 0.56);
    stroke-width: 1.7;
    stroke-linecap: round;
}
.mrg-filter-search {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #f1efff;
    font-size: 13px;
}
.mrg-filter-search::placeholder { color: rgba(214, 210, 255, 0.4); }
.mrg-filter-search::-webkit-search-cancel-button { filter: invert(1); opacity: 0.55; }

.mrg-filter-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
}
.mrg-filter-summary {
    flex: 1 1 auto;
    color: rgba(226, 222, 250, 0.68);
    font-size: 11.5px;
}
.mrg-filter-tools button {
    border: 0;
    padding: 6px 5px;
    background: transparent;
    color: rgba(193, 177, 255, 0.9);
    font-size: 11.5px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mrg-filter-list {
    flex: 1 1 auto;
    min-height: 92px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-top: 1px solid rgba(214, 210, 255, 0.08);
    border-bottom: 1px solid rgba(214, 210, 255, 0.08);
}
.mrg-filter-list::-webkit-scrollbar { display: none; width: 0; }

.mrg-filter-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 7px 2px;
    box-sizing: border-box;
    border-top: 1px solid rgba(214, 210, 255, 0.055);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mrg-filter-row:first-child { border-top: 0; }
.mrg-filter-row:active { background: rgba(238, 236, 255, 0.035); }

.mrg-filter-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 32% 28%, #6a5ae0 0%, #35297a 70%);
    color: rgba(244, 241, 255, 0.92);
    font-size: 16px;
    box-shadow: 0 0 0 1px rgba(214, 210, 255, 0.18);
}
.mrg-filter-avatar img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mrg-filter-name {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mrg-filter-name b {
    overflow: hidden;
    color: rgba(244, 241, 255, 0.94);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.mrg-filter-name small {
    overflow: hidden;
    color: rgba(214, 210, 255, 0.45);
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mrg-filter-row input {
    position: absolute;
    right: 3px;
    width: 24px;
    height: 24px;
    margin: 0;
    opacity: 0;
}
.mrg-filter-checkmark {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(214, 210, 255, 0.28);
    background: rgba(238, 236, 255, 0.04);
    color: transparent;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.mrg-filter-checkmark svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.mrg-filter-row input:checked + .mrg-filter-checkmark {
    border-color: rgba(178, 150, 255, 0.88);
    background: linear-gradient(135deg, #9b7cff 0%, #694af0 100%);
    color: #fff;
    box-shadow: 0 0 10px rgba(132, 94, 244, 0.3);
}

.mrg-filter-list-empty,
.mrg-filter-status {
    margin: 12px 4px 0;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.6;
}
.mrg-filter-list-empty { color: rgba(214, 210, 255, 0.5); }
.mrg-filter-status { color: rgba(255, 190, 174, 0.9); }
.mrg-filter-actions { flex: 0 0 auto; margin-top: 14px; }

.mrg-filter:focus-visible,
.mrg-filter-dismiss:focus-visible,
.mrg-filter-tools button:focus-visible,
.mrg-filter-row input:focus-visible + .mrg-filter-checkmark {
    outline: 2px solid rgba(202, 188, 255, 0.9);
    outline-offset: 2px;
}

@media (min-width: 720px) {
    .mrg-filter-modal { align-items: center; }
}

@media (max-height: 560px) {
    .mrg-filter-card { max-height: calc(100vh - 16px); }
    .mrg-filter-search-wrap { margin-top: 9px; }
    .mrg-filter-row { min-height: 52px; }
}

/* ---------- 精神领域视图 ---------- */
.mrg-realm-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 14px calc(26px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.mrg-loading {
    margin: 60px 0;
    text-align: center;
    font-size: 13px;
    color: rgba(214, 210, 255, 0.6);
    letter-spacing: 0.08em;
}

.mrg-now-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 2px 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(238, 236, 255, 0.05);
    border: 1px solid rgba(170, 150, 255, 0.2);
}

.mrg-now-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #b79bff 60%);
    box-shadow: 0 0 12px rgba(183, 155, 255, 0.9);
    animation: mrg-now-pulse 2.6s ease-in-out infinite;
}
@keyframes mrg-now-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.35); }
}

.mrg-now-text {
    font-size: 13px;
    color: rgba(230, 226, 255, 0.85);
    letter-spacing: 0.04em;
}
.mrg-now-text b { color: #fff; font-weight: 600; }

/* ---------- 星云卡 ---------- */
.mrg-nebula {
    position: relative;
    margin: 0 0 16px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(170, 150, 255, 0.18);
    background: rgba(14, 10, 38, 0.55);
}

.mrg-nebula-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px 6px;
}

.mrg-nebula-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(240, 238, 255, 0.94);
}

.mrg-nebula-en {
    font-size: 9px;
    letter-spacing: 0.3em;
    color: rgba(214, 210, 255, 0.4);
    font-family: Georgia, serif;
    white-space: nowrap;
}

.mrg-nebula-field {
    position: relative;
    height: 218px;
}

/* 各星云的底色雾气 */
.mrg-nebula--emotion .mrg-nebula-field {
    background: radial-gradient(85% 75% at 46% 42%, rgba(160, 92, 255, 0.24) 0%, rgba(255, 110, 180, 0.10) 48%, rgba(0, 0, 0, 0) 78%);
}
.mrg-nebula--desire .mrg-nebula-field {
    background: radial-gradient(85% 75% at 50% 44%, rgba(240, 190, 90, 0.20) 0%, rgba(255, 120, 90, 0.08) 50%, rgba(0, 0, 0, 0) 78%);
}
.mrg-nebula--bond .mrg-nebula-field,
.mrg-nebula--life .mrg-nebula-field,
.mrg-nebula--finding .mrg-nebula-field,
.mrg-nebula--murmur .mrg-nebula-field {
    height: 128px;
}
.mrg-nebula--bond .mrg-nebula-field    { background: radial-gradient(85% 85% at 50% 46%, rgba(255, 120, 170, 0.14) 0%, rgba(0,0,0,0) 76%); }
.mrg-nebula--life .mrg-nebula-field    { background: radial-gradient(85% 85% at 50% 46%, rgba(90, 220, 190, 0.13) 0%, rgba(0,0,0,0) 76%); }
.mrg-nebula--finding .mrg-nebula-field { background: radial-gradient(85% 85% at 50% 46%, rgba(96, 160, 255, 0.14) 0%, rgba(0,0,0,0) 76%); }
.mrg-nebula--murmur .mrg-nebula-field  { background: radial-gradient(85% 85% at 50% 46%, rgba(210, 214, 235, 0.12) 0%, rgba(0,0,0,0) 76%); }

/* ---------- 星体 ---------- */
.mrg-star {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: mrg-star-float var(--mrg-star-dur, 7s) ease-in-out var(--mrg-star-delay, 0s) infinite alternate;
}

@keyframes mrg-star-float {
    from { margin-top: 0; }
    to   { margin-top: -8px; }
}

.mrg-star-orb {
    width: var(--mrg-star-size, 24px);
    height: var(--mrg-star-size, 24px);
    border-radius: 50%;
    opacity: var(--mrg-star-alpha, 0.8);
    background: radial-gradient(circle at 36% 32%,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(226, 208, 255, 0.9) 32%,
        rgba(150, 110, 255, 0.75) 68%,
        rgba(90, 60, 190, 0.25) 100%);
    box-shadow:
        0 0 calc(var(--mrg-star-size, 24px) * 0.55) rgba(178, 142, 255, calc(var(--mrg-star-alpha, 0.8) * 0.9)),
        0 0 calc(var(--mrg-star-size, 24px) * 1.1) rgba(178, 142, 255, calc(var(--mrg-star-alpha, 0.8) * 0.35));
}

/* 欲望星云的星体偏金色 */
.mrg-nebula--desire .mrg-star-orb {
    background: radial-gradient(circle at 36% 32%,
        rgba(255, 252, 240, 0.98) 0%,
        rgba(250, 224, 150, 0.92) 34%,
        rgba(232, 172, 80, 0.75) 68%,
        rgba(160, 100, 30, 0.25) 100%);
    box-shadow:
        0 0 calc(var(--mrg-star-size, 24px) * 0.55) rgba(244, 200, 110, calc(var(--mrg-star-alpha, 0.8) * 0.9)),
        0 0 calc(var(--mrg-star-size, 24px) * 1.1) rgba(244, 200, 110, calc(var(--mrg-star-alpha, 0.8) * 0.35));
}

/* 最亮的行星：脉动 + 光环 */
.mrg-star--prime .mrg-star-orb {
    position: relative;
    animation: mrg-prime-pulse 3.4s ease-in-out infinite;
}
.mrg-star--prime .mrg-star-orb::after {
    content: '';
    position: absolute;
    inset: -22%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transform: rotate(-16deg) scaleY(0.55);
}
@keyframes mrg-prime-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50%      { transform: scale(1.09); filter: brightness(1.22); }
}

.mrg-star-label {
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: rgba(238, 236, 255, 0.82);
    text-shadow: 0 0 8px rgba(6, 4, 22, 0.95);
    white-space: nowrap;
}

.mrg-star:active .mrg-star-orb { transform: scale(0.92); }

/* ---------- 尚未凝聚的星云 ---------- */
.mrg-nebula-pending {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 22px;
    text-align: center;
}

.mrg-pending-mist {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(238, 236, 255, 0.16) 0%, rgba(238, 236, 255, 0) 70%);
    animation: mrg-mist-breath 4.5s ease-in-out infinite;
}
@keyframes mrg-mist-breath {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%      { transform: scale(1.3); opacity: 1; }
}

.mrg-pending-text {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.7;
    color: rgba(214, 210, 255, 0.6);
}

.mrg-pending-note {
    margin: 0;
    font-size: 10px;
    letter-spacing: 0.04em;
    color: rgba(250, 200, 120, 0.66);
}

.mrg-realm-foot {
    margin: 6px 8px 14px;
    text-align: center;
    font-size: 11px;
    line-height: 1.8;
    color: rgba(214, 210, 255, 0.42);
    letter-spacing: 0.06em;
}

/* ---------- 星卡 ---------- */
.mrg-starcard-card { text-align: left; }

.mrg-starcard-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mrg-starcard-orb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    opacity: var(--mrg-star-alpha, 0.9);
    background: radial-gradient(circle at 36% 32%,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(226, 208, 255, 0.9) 32%,
        rgba(150, 110, 255, 0.75) 68%,
        rgba(90, 60, 190, 0.25) 100%);
    box-shadow: 0 0 26px rgba(178, 142, 255, 0.8);
    animation: mrg-prime-pulse 3.4s ease-in-out infinite;
}

.mrg-starcard-en {
    margin: 3px 0 0;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: rgba(214, 210, 255, 0.5);
    font-family: Georgia, serif;
}

.mrg-starcard-level {
    margin-top: 14px;
    font-size: 13px;
    color: rgba(240, 238, 255, 0.9);
    letter-spacing: 0.06em;
}

.mrg-starcard-bar {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: rgba(238, 236, 255, 0.1);
    overflow: hidden;
}

.mrg-starcard-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #8f6bff 0%, #d0b6ff 100%);
    box-shadow: 0 0 10px rgba(178, 142, 255, 0.8);
    transition: width 0.5s ease;
}

.mrg-starcard-desc {
    margin: 12px 0 0;
    font-size: 12.5px;
    line-height: 1.8;
    color: rgba(224, 220, 250, 0.78);
}

.mrg-starcard-foot {
    margin: 12px 0 0;
    font-size: 10.5px;
    line-height: 1.7;
    color: rgba(214, 210, 255, 0.4);
}

.mrg-starcard-ok {
    width: 100%;
    margin-top: 16px;
}

/* ---------- 小屏适配 ---------- */
@media (max-height: 640px) {
    .mrg-nebula-field { height: 178px; }
    .mrg-nebula--bond .mrg-nebula-field,
    .mrg-nebula--life .mrg-nebula-field,
    .mrg-nebula--finding .mrg-nebula-field,
    .mrg-nebula--murmur .mrg-nebula-field { height: 108px; }
}

/* ============================================================
 * 三、设置面板（mrs-）
 * ============================================================ */

.mrg-gear {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(214, 210, 255, 0.22);
    background: rgba(24, 18, 56, 0.55);
    color: rgba(238, 236, 255, 0.85);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mrg-gear:active { background: rgba(60, 46, 120, 0.7); }

.mrs-panel {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120% 80% at 80% 0%, rgba(66, 46, 120, 0.5) 0%, rgba(20, 14, 46, 0) 55%),
        linear-gradient(168deg, #0b0922 0%, #100c30 46%, #060512 100%);
    color: #eef0ff;
}

.mrs-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 14px calc(28px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.mrs-card {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(238, 236, 255, 0.045);
    border: 1px solid rgba(170, 150, 255, 0.18);
}

.mrs-card-title {
    margin: 0 0 4px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(240, 238, 255, 0.92);
}

.mrs-card-sub {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: rgba(214, 210, 255, 0.45);
    margin-left: 6px;
}

/* ---------- 行（开关项） ---------- */
.mrs-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid rgba(214, 210, 255, 0.08);
}
.mrs-row:first-of-type,
.mrs-row--master { border-top: 0; padding-top: 4px; }
.mrs-card-title + .mrs-row { border-top: 0; }

.mrs-row-main { flex: 1 1 auto; min-width: 0; }

.mrs-row-title {
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(240, 238, 255, 0.92);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mrs-tag {
    flex: 0 0 auto;
    display: inline-block;
    margin-left: 6px;
    vertical-align: 1px;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 999px;
    color: rgba(180, 210, 255, 0.8);
    border: 1px solid rgba(140, 180, 255, 0.32);
    background: rgba(90, 130, 255, 0.1);
}

.mrs-row-desc {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.7;
    color: rgba(214, 210, 255, 0.55);
}

.mrs-row-warn {
    margin: 5px 0 0;
    font-size: 10.5px;
    letter-spacing: 0.02em;
    color: rgba(250, 200, 120, 0.78);
}

.mrs-row-note {
    margin: 5px 0 0;
    font-size: 10.5px;
    color: rgba(150, 220, 190, 0.72);
}

/* ---------- 开关 ---------- */
.mrs-switch {
    flex: 0 0 auto;
    position: relative;
    width: 46px;
    height: 26px;
    margin-top: 2px;
}

.mrs-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.mrs-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(238, 236, 255, 0.12);
    border: 1px solid rgba(214, 210, 255, 0.2);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.mrs-switch-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(238, 236, 255, 0.85);
    box-shadow: 0 2px 6px rgba(2, 0, 12, 0.5);
    transition: transform 0.2s ease, background 0.2s ease;
}

.mrs-switch input:checked + .mrs-switch-slider {
    background: linear-gradient(135deg, #8f6bff 0%, #5e3ff0 100%);
    border-color: rgba(170, 150, 255, 0.6);
}

.mrs-switch input:checked + .mrs-switch-slider::after {
    transform: translateX(20px);
    background: #fff;
    box-shadow: 0 0 10px rgba(178, 142, 255, 0.9), 0 2px 6px rgba(2, 0, 12, 0.5);
}

/* ---------- 今日用量 ---------- */
.mrs-quota-total {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 8px;
}

.mrs-quota-num {
    font-size: 30px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 16px rgba(150, 120, 255, 0.6);
    font-family: Georgia, serif;
}

.mrs-quota-limit {
    font-size: 12px;
    color: rgba(214, 210, 255, 0.5);
}

.mrs-quota-bar {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: rgba(238, 236, 255, 0.1);
    overflow: hidden;
}

.mrs-quota-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #8f6bff 0%, #d0b6ff 100%);
    box-shadow: 0 0 10px rgba(178, 142, 255, 0.8);
    transition: width 0.4s ease;
}

.mrs-quota-bar .mrs-quota-bar-hot {
    background: linear-gradient(90deg, #ff8a5e 0%, #ffb46b 100%);
    box-shadow: 0 0 10px rgba(255, 150, 100, 0.8);
}

.mrs-quota-list { margin-top: 10px; }

.mrs-quota-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12px;
    color: rgba(224, 220, 250, 0.78);
    border-top: 1px solid rgba(214, 210, 255, 0.07);
}
.mrs-quota-item b { font-weight: 600; color: rgba(240, 238, 255, 0.92); }

.mrs-quota-empty {
    padding: 8px 0 2px;
    font-size: 11.5px;
    color: rgba(214, 210, 255, 0.45);
}

/* ---------- 专属 API ---------- */
.mrs-radio-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0 4px;
    cursor: pointer;
}

.mrs-radio-row input[type="radio"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #8f6bff;
}

.mrs-radio-main { flex: 1 1 auto; min-width: 0; }

.mrs-radio-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(240, 238, 255, 0.92);
    letter-spacing: 0.04em;
}

.mrs-radio-desc {
    display: block;
    margin-top: 3px;
    font-size: 10.5px;
    line-height: 1.6;
    color: rgba(214, 210, 255, 0.5);
}

.mrs-sub {
    margin: 6px 0 4px 26px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mrs-select,
.mrs-input {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(170, 150, 255, 0.24);
    background: rgba(10, 8, 30, 0.55);
    color: #eef0ff;
    font-size: 12.5px;
    outline: none;
}

.mrs-select:focus,
.mrs-input:focus { border-color: rgba(170, 150, 255, 0.6); }

.mrs-select option { background: #14103a; color: #eef0ff; }

.mrs-input--num {
    flex: 0 0 auto;
    width: 76px;
    text-align: center;
    margin-top: 2px;
}

.mrs-hint {
    margin: 10px 0 0;
    font-size: 10.5px;
    line-height: 1.7;
    color: rgba(214, 210, 255, 0.42);
}
.mrs-hint--top { margin: 2px 0 4px; }

/* ---------- 心念来信设置 ---------- */
.mrs-letter-quiet { display:flex; align-items:center; gap:5px; flex:0 0 auto; color:rgba(220,214,246,.6); font-size:11px; }
.mrs-letter-quiet .mrs-input--num { width:68px; padding:0 8px; }
.mrs-letter-actions { display:flex; flex-wrap:wrap; gap:6px; margin:4px 2px 8px; }
.mrs-letter-test {
    flex:0 0 auto;
    border:1px solid rgba(186,137,255,.52);
    border-radius:999px;
    padding:8px 14px;
    background:linear-gradient(135deg,rgba(142,91,226,.78),rgba(99,74,177,.8));
    color:#f1eaff;
    font-size:11.5px;
}
.mrs-letter-test:disabled { opacity:.5; cursor:wait; }
.mrs-letter-status {
    margin:10px 2px 0;
    padding:9px 11px;
    border:1px solid rgba(193,175,236,.22);
    border-radius:10px;
    background:rgba(255,255,255,.045);
    color:rgba(233,226,250,.82);
    font-size:11px;
    line-height:1.6;
}
.mrs-letter-status.error {
    border-color:rgba(255,144,157,.28);
    background:rgba(255,105,127,.07);
    color:#ffc0c9;
}

.mrs-foot {
    margin: 4px 8px 16px;
    text-align: center;
    font-size: 10.5px;
    line-height: 1.9;
    color: rgba(214, 210, 255, 0.38);
    letter-spacing: 0.04em;
}

/* =====================================================================
 * 每日自省 · 星云结论 / 星尘日记 / 自省详情弹窗（mrg- 前缀延续星海视图）
 * ===================================================================== */

/* 星云卡底部的一句话结论 */
.mrg-nebula-summary {
    margin: 10px 16px 14px;
    font-size: 11.5px;
    line-height: 1.75;
    color: rgba(226, 220, 255, 0.72);
    letter-spacing: 0.02em;
}

/* 可点击的结论行（如情绪星云的"最近的心绪波动"） */
button.mrg-nebula-summary--link {
    display: block;
    width: calc(100% - 32px);
    box-sizing: border-box;
    text-align: left;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(190, 176, 255, 0.14);
    background: rgba(238, 236, 255, 0.05);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
button.mrg-nebula-summary--link:active { background: rgba(238, 236, 255, 0.1); }

/* ---------- 星尘日记卡 ---------- */
.mrg-nebula--diary {
    background:
        radial-gradient(120% 90% at 20% 0%, rgba(122, 108, 210, 0.20) 0%, rgba(20, 15, 52, 0) 58%),
        linear-gradient(160deg, rgba(30, 24, 72, 0.72) 0%, rgba(14, 10, 38, 0.82) 100%);
}

.mrg-diary-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 14px 0;
}

.mrg-diary-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(190, 176, 255, 0.14);
    background: rgba(238, 236, 255, 0.05);
    color: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mrg-diary-row:active { background: rgba(238, 236, 255, 0.1); }

.mrg-diary-tag {
    flex: none;
    padding: 2px 7px;
    border-radius: 7px;
    font-size: 9.5px;
    letter-spacing: 0.08em;
    color: rgba(186, 172, 255, 0.95);
    background: rgba(148, 120, 255, 0.14);
    border: 1px solid rgba(178, 156, 255, 0.24);
}
.mrg-diary-tag--cap {
    color: rgba(140, 220, 190, 0.95);
    background: rgba(96, 200, 165, 0.10);
    border-color: rgba(140, 220, 190, 0.26);
}

.mrg-diary-date {
    flex: none;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: rgba(186, 172, 255, 0.85);
    font-variant-numeric: tabular-nums;
}

.mrg-diary-preview {
    flex: 1;
    min-width: 0;
    font-size: 11.5px;
    color: rgba(226, 222, 250, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mrg-diary-empty {
    margin: 12px 16px 6px;
    font-size: 11.5px;
    line-height: 1.8;
    color: rgba(214, 210, 255, 0.55);
}

/* ---------- 星海深处（归档层） ---------- */

.mrg-deep-entry {
    position: relative;
    display: block;
    width: calc(100% - 8px);
    margin: 14px 4px 0;
    padding: 12px 14px;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px dashed rgba(170, 160, 235, 0.28);
    background: linear-gradient(180deg, rgba(20, 16, 44, 0.35), rgba(8, 6, 22, 0.55));
    color: rgba(214, 210, 255, 0.72);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.mrg-deep-entry:active { background: rgba(30, 24, 64, 0.5); }

.mrg-deep-entry-glow {
    position: absolute;
    left: 50%;
    bottom: -18px;
    width: 70%;
    height: 26px;
    transform: translateX(-50%);
    background: radial-gradient(50% 100% at 50% 100%, rgba(140, 130, 220, 0.35), rgba(0, 0, 0, 0));
    filter: blur(4px);
    pointer-events: none;
}

.mrg-deep { padding: 2px 2px 18px; }

.mrg-deep-back {
    display: inline-block;
    margin: 2px 0 10px;
    padding: 7px 14px 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(190, 176, 255, 0.22);
    background: rgba(238, 236, 255, 0.06);
    color: rgba(228, 224, 255, 0.85);
    font-size: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mrg-deep-back:active { background: rgba(238, 236, 255, 0.12); }

.mrg-deep-title {
    margin: 0 2px 2px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(240, 238, 255, 0.92);
}

.mrg-deep-sub {
    margin: 0 2px 14px;
    font-size: 9.5px;
    letter-spacing: 0.2em;
    color: rgba(214, 210, 255, 0.45);
}

.mrg-deep-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mrg-diary-row--deep {
    opacity: 0.78;
    border-color: rgba(150, 140, 200, 0.14);
    background: rgba(180, 176, 220, 0.045);
}

.mrg-deep-note {
    margin: 14px 4px 0;
    text-align: center;
    font-size: 10.5px;
    line-height: 1.8;
    color: rgba(214, 210, 255, 0.4);
    letter-spacing: 0.05em;
}

/* 日记/归档标签的类型配色 */
.mrg-diary-tag--week {
    color: rgba(255, 224, 180, 0.85);
    border-color: rgba(255, 210, 150, 0.32);
    background: rgba(255, 190, 110, 0.1);
}
.mrg-diary-tag--mur {
    color: rgba(226, 224, 245, 0.8);
    border-color: rgba(210, 214, 235, 0.3);
    background: rgba(210, 214, 235, 0.09);
}
.mrg-diary-tag--find {
    color: rgba(180, 240, 226, 0.85);
    border-color: rgba(150, 230, 214, 0.3);
    background: rgba(120, 205, 190, 0.1);
}
.mrg-diary-tag--letter {
    color: rgba(255, 196, 214, 0.88);
    border-color: rgba(255, 168, 196, 0.32);
    background: rgba(255, 140, 178, 0.1);
}

/* ---------- 见闻星云：探索收获列表 ---------- */

.mrg-finding-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
}

.mrg-finding-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(160, 220, 210, 0.14);
    background: rgba(200, 240, 232, 0.05);
    color: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mrg-finding-row:active { background: rgba(200, 240, 232, 0.11); }

.mrg-finding-orb {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, rgba(220, 255, 246, 0.95), rgba(120, 205, 190, 0.7));
    box-shadow: 0 0 9px 2px rgba(150, 230, 214, 0.35);
}

.mrg-finding-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mrg-finding-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 600;
    color: rgba(240, 252, 250, 0.9);
    letter-spacing: 0.03em;
}
.mrg-finding-title i {
    font-style: normal;
    font-weight: 400;
    font-size: 9.5px;
    color: rgba(190, 235, 226, 0.6);
}

.mrg-finding-preview {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 10.5px;
    color: rgba(214, 240, 235, 0.55);
}

.mrg-finding-date {
    flex: none;
    font-size: 9.5px;
    color: rgba(214, 240, 235, 0.4);
    letter-spacing: 0.05em;
}

/* ---------- 独白星带：横贯卡片的微光带 + 低语列表 ---------- */

.mrg-murmur-belt {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
}

.mrg-murmur-beltline {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 50%;
    height: 26px;
    transform: translateY(-50%) rotate(-2.5deg);
    background: linear-gradient(90deg, rgba(210, 214, 235, 0) 0%, rgba(210, 214, 235, 0.09) 30%, rgba(226, 220, 255, 0.13) 52%, rgba(210, 214, 235, 0.08) 72%, rgba(210, 214, 235, 0) 100%);
    filter: blur(6px);
    border-radius: 999px;
    pointer-events: none;
}

.mrg-murmur-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 9px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(210, 214, 235, 0.14);
    background: rgba(226, 224, 245, 0.05);
    color: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mrg-murmur-row:active { background: rgba(226, 224, 245, 0.11); }

.mrg-murmur-spark {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    align-self: center;
    background: rgba(235, 232, 255, 0.9);
    box-shadow: 0 0 8px 2px rgba(226, 220, 255, 0.45);
    animation: mrgMurmurSpark 3.6s ease-in-out infinite;
}
.mrg-murmur-row:nth-child(odd) .mrg-murmur-spark { animation-delay: 1.4s; }

@keyframes mrgMurmurSpark {
    0%, 100% { opacity: 0.55; transform: scale(0.85); }
    50%      { opacity: 1;    transform: scale(1.15); }
}

.mrg-murmur-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    font-style: italic;
    color: rgba(240, 238, 255, 0.88);
    letter-spacing: 0.03em;
}

.mrg-murmur-meta {
    flex: none;
    font-size: 9.5px;
    color: rgba(214, 210, 255, 0.45);
    letter-spacing: 0.05em;
}

.mrg-diary-run {
    display: block;
    width: calc(100% - 28px);
    margin: 12px 14px 0;
}
.mrg-diary-run[disabled] {
    opacity: 0.55;
    pointer-events: none;
}

.mrg-diary-note {
    margin: 8px 14px 14px;
    text-align: center;
}

/* ---------- 自省详情弹窗 ---------- */
.mrg-refl-card { width: min(340px, 90%); }

.mrg-refl-body {
    max-height: min(52vh, 380px);
    overflow-y: auto;
    margin-top: 10px;
    text-align: left;
    -webkit-overflow-scrolling: touch;
}

.mrg-refl-monologue {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(148, 120, 255, 0.10);
    border: 1px solid rgba(178, 156, 255, 0.22);
    font-size: 12.5px;
    line-height: 1.9;
    color: rgba(240, 236, 255, 0.92);
    letter-spacing: 0.02em;
}

.mrg-refl-sec { margin: 0 0 12px; }

.mrg-refl-sec h4 {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(186, 172, 255, 0.9);
}

.mrg-refl-sec p {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.85;
    color: rgba(226, 222, 250, 0.8);
}
.mrg-refl-sec p b {
    display: inline-block;
    margin-right: 8px;
    color: rgba(186, 172, 255, 0.95);
    font-weight: 600;
}

.mrg-refl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mrg-refl-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.5;
    border: 1px solid rgba(190, 176, 255, 0.2);
    background: rgba(238, 236, 255, 0.06);
    color: rgba(232, 228, 255, 0.9);
}
.mrg-refl-chip i {
    font-style: normal;
    font-size: 10px;
    color: rgba(214, 210, 255, 0.6);
}
.mrg-refl-chip--pos { border-color: rgba(140, 220, 190, 0.35); background: rgba(96, 200, 165, 0.10); }
.mrg-refl-chip--neg { border-color: rgba(240, 150, 165, 0.32); background: rgba(226, 120, 140, 0.10); }

/* ---------- 隐形滚动条（星海内所有滚动区域） ---------- */
.mrg-realm-scroll,
.mrs-scroll,
.mrg-refl-body,
.mrg-sea {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mrg-realm-scroll::-webkit-scrollbar,
.mrs-scroll::-webkit-scrollbar,
.mrg-refl-body::-webkit-scrollbar,
.mrg-sea::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ==================== 性格星云 ==================== */
.mrp-nebula {
    padding: 18px;
    border-color: rgba(202, 171, 255, .28);
    background: radial-gradient(circle at 88% 8%, rgba(188, 124, 255, .18), transparent 38%), rgba(22, 18, 48, .76);
}
.mrp-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.mrp-heading h2 { display:inline; margin:0 0 0 7px; color:#f3ebff; font-size:17px; }
.mrp-heading p { margin:6px 0 0; color:rgba(225,217,248,.65); font-size:11px; line-height:1.55; }
.mrp-gate { flex:0 0 auto; padding:5px 8px; border-radius:999px; background:rgba(255,255,255,.07); color:rgba(231,226,247,.6); font-size:10px; }
.mrp-gate.on { background:rgba(135,227,188,.13); color:#aef0d2; }
.mrp-lock-note { margin:12px 0 0; padding:9px 11px; border:1px solid rgba(255,199,126,.18); border-radius:11px; background:rgba(255,180,91,.06); color:rgba(255,222,181,.76); font-size:11px; line-height:1.55; }
.mrp-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.mrp-toolbar button,.mrp-modal-actions button { border:1px solid rgba(207,188,255,.22); border-radius:10px; padding:8px 10px; background:rgba(255,255,255,.06); color:#e9e1ff; font-size:11px; }
.mrp-toolbar button.primary,.mrp-modal-actions button.primary { border-color:rgba(186,137,255,.52); background:linear-gradient(135deg,rgba(142,91,226,.78),rgba(99,74,177,.8)); }
.mrp-toolbar button:disabled { opacity:.42; }
.mrp-toolbar button[aria-busy="true"] { cursor:wait; }
.mrp-operation-status { margin:-4px 0 12px; padding:9px 11px; border:1px solid rgba(193,175,236,.2); border-radius:10px; background:rgba(255,255,255,.045); color:rgba(233,226,250,.78); font-size:11px; line-height:1.55; }
.mrp-operation-status[hidden] { display:none; }
.mrp-operation-status.working { border-color:rgba(188,145,255,.28); color:#d9c5ff; }
.mrp-operation-status.success { border-color:rgba(135,227,188,.25); background:rgba(101,207,159,.07); color:#b8f0d5; }
.mrp-operation-status.error { border-color:rgba(255,144,157,.28); background:rgba(255,105,127,.07); color:#ffc0c9; }
.mrp-operation-status.notice { border-color:rgba(255,199,126,.24); background:rgba(255,180,91,.06); color:rgba(255,222,181,.86); }
.mrp-subhead { margin:14px 0 8px; color:#f0e9ff; font-size:13px; font-weight:700; }
.mrp-subhead span { margin-left:4px; color:rgba(220,208,249,.52); font-weight:400; }
.mrp-evidence-list,.mrp-trait-grid { display:grid; gap:8px; }
.mrp-scroll-hint { margin-left:8px; color:rgba(213,194,255,.45); font-size:9px; font-style:normal; font-weight:400; letter-spacing:.08em; }
.mrp-evidence-scroll { position:relative; }
.mrp-evidence-scroll .mrp-evidence-list { max-height:168px; overflow-y:auto; scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.mrp-evidence-scroll .mrp-evidence-list::-webkit-scrollbar { display:none; width:0; height:0; }
.mrp-evidence-scroll.scrollable::after { content:''; position:absolute; left:0; right:0; bottom:0; height:30px; border-radius:0 0 12px 12px; background:linear-gradient(180deg,rgba(22,18,48,0),rgba(22,18,48,.88)); pointer-events:none; }
.mrp-evidence { display:flex; flex-direction:column; gap:7px; padding:10px; border:1px solid rgba(210,193,255,.14); border-radius:12px; background:rgba(255,255,255,.035); }
.mrp-evidence-main { display:flex; align-items:flex-start; gap:9px; cursor:pointer; }
.mrp-evidence-main > input { margin-top:3px; flex:0 0 auto; accent-color:#ad7df2; }
.mrp-evidence-actions { display:flex; justify-content:flex-end; gap:6px; }
.mrp-evidence-act { padding:3px 10px; border:1px solid rgba(207,188,255,.22); border-radius:999px; background:rgba(255,255,255,.05); color:rgba(230,221,250,.78); font-size:10px; line-height:1.4; }
.mrp-evidence-act.danger { border-color:rgba(255,144,157,.26); background:rgba(255,105,127,.05); color:#ffb9c3; }
.mrp-evidence-original { margin:8px 0 0; padding:8px 10px; border:1px dashed rgba(210,193,255,.2); border-radius:10px; color:rgba(220,211,242,.6); font-size:11px; line-height:1.55; }
.mrp-condensed-mark { padding:1px 6px; border-radius:999px; background:rgba(135,227,188,.13); color:#aef0d2; font-size:9px; font-style:normal; }
.mrp-evidence-body { min-width:0; display:flex; flex:1; flex-direction:column; gap:5px; }
.mrp-evidence q { color:rgba(242,237,255,.91); font-size:12px; line-height:1.6; quotes:none; }
.mrp-evidence small,.mrp-trait small { color:rgba(214,205,238,.52); font-size:10px; }
.mrp-badges { display:flex; flex-wrap:wrap; gap:5px; }
.mrp-badges i { padding:2px 6px; border-radius:999px; background:rgba(189,160,255,.12); color:#d5c2ff; font-size:9px; font-style:normal; }
.mrp-badges i.direct { color:#aee8d0; background:rgba(91,198,151,.11); }
.mrp-badges i.low { color:#ffd5a5; background:rgba(239,167,82,.11); }
.mrp-badges i.archived { color:rgba(226,221,238,.52); background:rgba(255,255,255,.06); }
.mrp-trait { position:relative; display:grid; grid-template-columns:22px 1fr; gap:3px 7px; width:100%; padding:11px; text-align:left; border:1px solid rgba(204,184,255,.17); border-radius:13px; background:rgba(124,88,188,.08); color:#eee7ff; }
.mrp-trait.confirmed { border-color:rgba(188,143,255,.42); box-shadow:inset 0 0 22px rgba(142,91,226,.08); }
.mrp-trait-star { grid-row:1/4; color:#cba6ff; font-size:18px; }
.mrp-trait strong { font-size:13px; }
.mrp-trait > span:not(.mrp-trait-star) { color:rgba(230,222,248,.72); font-size:11px; line-height:1.5; }
.mrp-empty { margin:4px 0; color:rgba(222,214,242,.48); font-size:11px; line-height:1.6; }

/* ---------- 性格星云 · 紧凑卡片（主界面只展示已确认星星，小星球形态） ---------- */
.mrp-compact-field {
    margin-top: 10px;
    border-radius: 14px;
    background: radial-gradient(85% 80% at 48% 44%, rgba(168, 118, 255, 0.18) 0%, rgba(120, 80, 220, 0.07) 52%, rgba(0, 0, 0, 0) 78%);
}
.mrp-compact-star .mrg-star-label { max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
.mrp-compact-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:14px; }
.mrp-compact-hint { min-width:0; color:rgba(213,203,240,.5); font-size:10px; line-height:1.5; }
.mrp-compact-open {
    flex:0 0 auto;
    margin-left:auto;
    border:1px solid rgba(186,137,255,.52);
    border-radius:999px;
    padding:8px 16px;
    background:linear-gradient(135deg,rgba(142,91,226,.78),rgba(99,74,177,.8));
    color:#f1eaff;
    font-size:12px;
    box-shadow:0 6px 18px rgba(96,62,178,.28);
}
.mrp-compact-open:active { transform:scale(.97); }

/* ---------- 性格星云 · 全屏面板（与设置面板同款 overlay 内全屏模式） ---------- */
.mrpf-panel {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120% 80% at 80% 0%, rgba(66, 46, 120, 0.5) 0%, rgba(20, 14, 46, 0) 55%),
        linear-gradient(168deg, #0b0922 0%, #100c30 46%, #060512 100%);
    color: #eef0ff;
}
.mrpf-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 14px calc(28px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}
.mrpf-scroll > .mrp-nebula { margin-bottom:14px; }

.mrp-modal { position:fixed; inset:0; z-index:10080; display:flex; align-items:center; justify-content:center; padding:18px; background:rgba(4,3,15,.72); backdrop-filter:blur(8px); }
.mrp-modal.mrp-hidden { display:none; }
.mrp-modal-card { width:min(100%,520px); max-height:min(82vh,720px); overflow:auto; padding:18px; border:1px solid rgba(207,185,255,.28); border-radius:18px; background:#17132e; color:#eee9ff; box-shadow:0 22px 60px rgba(0,0,0,.46); -webkit-overflow-scrolling:touch; }
.mrp-modal-card,
.mrp-trait-editor textarea,
.mrp-modal-evidence-list {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mrp-modal-card::-webkit-scrollbar,
.mrp-trait-editor textarea::-webkit-scrollbar,
.mrp-modal-evidence-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.mrp-modal-card h3 { margin:0 0 10px; font-size:17px; }
.mrp-modal-card h4 { margin:16px 0 8px; font-size:13px; }
.mrp-modal-card p { color:rgba(227,219,246,.7); font-size:12px; line-height:1.6; }
.mrp-modal-close { float:right; border:0; background:transparent; color:#d9c8ff; font-size:24px; }
.mrp-trait-editor > label,.mrp-questions { display:grid; gap:6px; margin:11px 0; color:rgba(235,228,251,.78); font-size:11px; }
.mrp-trait-editor input[type="text"],.mrp-trait-editor input:not([type]),.mrp-trait-editor textarea,.mrp-trait-editor select { box-sizing:border-box; width:100%; border:1px solid rgba(210,192,255,.2); border-radius:10px; padding:9px; background:rgba(255,255,255,.055); color:#f1ecff; font:inherit; }
.mrp-trait-editor textarea { min-height:68px; resize:vertical; }
.mrp-expression { display:flex !important; grid-auto-flow:column; grid-template-columns:auto 1fr; justify-content:start; align-items:center; }
.mrp-modal-evidence-list { display:grid; gap:7px; max-height:210px; overflow:auto; -webkit-overflow-scrolling:touch; }
.mrp-modal-evidence { padding:9px; border:1px solid rgba(208,190,255,.13); border-radius:10px; background:rgba(255,255,255,.03); }
.mrp-modal-evidence p { margin:0 0 6px; }
.mrp-modal-evidence label { margin-right:12px; color:rgba(224,216,244,.65); font-size:10px; }
.mrp-modal-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; margin-top:16px; }
