        /* --- 0. 全局设置 --- */
        :root {
            --input-bg: #fbf1ec;
            --input-border: #4c200c;
            --text-brown: #59474a;
            --main-pink: #FF9A9E;
            --btn-gradient: linear-gradient(90deg, #fd5392 0%, #ff6b81 100%);
        }

        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
            outline: none;
        }

        html,
        body {
            width: 100%;
            min-height: 100vh;
            /* 恢复自然高度 */
            margin: 0;
            padding: 0;
            overflow-x: hidden;
            /* 只防左右横跳 */
            /* 移除 position: fixed/overflow: hidden，让浏览器能感知滚动 */

            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            touch-action: manipulation;
        }

        /* --- 单独的背景层 (焊死在最底下) --- */
        #bg-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -999;
            /* 放在所有内容后面 */
            background-color: #FFF0F5;
            background-image: url('https://i.postimg.cc/28Fj5nBt/04.jpg');
            background-size: cover;
            background-position: center;
            pointer-events: none;
            /* 让点击穿透 */
        }

        /* --- 页面切换控制 --- */
        .page-view {
            display: none;
            width: 100%;
            /* 移除 position: absolute/height: 100% */

            /* 底部留白 */
            padding-bottom: calc(100px + env(safe-area-inset-bottom));
            animation: fadeIn 0.3s ease;
        }

        .page-view.active {
            display: block;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        /* --- 1. 首页 (Home) 样式 --- */
        .home-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            justify-content: center;
            min-height: 100%;
            /* 改为100% */
            padding: 20px;
        }

        .home-title {
            font-size: 32px;
            color: var(--text-brown);
            margin-bottom: 50px;
            text-shadow: 2px 2px 0 #fff;
            font-weight: bold;
        }

        .home-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            width: 100%;
            max-width: 400px;
        }

        .home-card {
            background: rgba(255, 255, 255, 0.9);
            border: 3px solid #FFB7C5;
            border-radius: 20px;
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            box-shadow: 0 5px 15px rgba(255, 183, 197, 0.4);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 150px;
            user-select: none;
            -webkit-user-select: none;
        }

        .home-card:active {
            transform: scale(0.95);
            background: #fff0f5;
        }

        .home-card-emoji {
            font-size: 48px;
            margin-bottom: 10px;
            pointer-events: none;
        }

        .home-card span {
            color: var(--text-brown);
            font-size: 16px;
            font-weight: bold;
            pointer-events: none;
        }

        /* 修复头图样式 */
        .header-wrapper {
            position: relative;
            width: 100%;
            aspect-ratio: 1125 / 354;
            background: url('https://i.postimg.cc/52zsWZmJ/01.png') no-repeat top center;
            background-size: 100% auto;
            z-index: 10;
            margin-top: 20px;
        }

        /* --- 2. API 设置页样式 --- */
        .api-container {
            padding: 20px;
            max-width: 600px;
            margin: 0 auto;
            padding-bottom: 50px;
        }

        .nav-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            padding: 10px 0;
        }

        .back-btn,
        .letter-list-back,
        .letter-detail-back-btn {
            font-size: 32px;
            font-weight: bold;
            color: var(--text-brown);
            cursor: pointer;
            background: transparent;
            border: none;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .section-card {
            background: #fff;
            border-radius: 20px;
            padding: 20px;
            margin-bottom: 20px;
            border: 2px solid #FFDEE9;
            box-shadow: 0 4px 10px rgba(255, 222, 233, 0.3);
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            color: #888;
            font-size: 14px;
            margin-bottom: 5px;
        }

        .api-input,
        .api-select {
            width: 100%;
            padding: 12px;
            background: var(--input-bg);
            border: 2px solid var(--input-border);
            border-radius: 12px;
            color: var(--text-brown);
            font-family: inherit;
            font-size: 14px;
        }

        .save-btn {
            width: 100%;
            padding: 12px;
            background: var(--btn-gradient);
            color: white;
            border: none;
            border-radius: 50px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(255, 107, 129, 0.3);
        }

        .save-btn:active {
            transform: scale(0.98);
        }

        /* 保存的列表 */
        .saved-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #FFF5F7;
            border: 1px solid #FFB7C5;
            padding: 15px;
            border-radius: 12px;
            margin-bottom: 10px;
        }

        .saved-info {
            display: flex;
            flex-direction: column;
        }

        .saved-name {
            font-weight: bold;
            color: var(--text-brown);
        }

        .saved-detail {
            font-size: 12px;
            color: #aaa;
            margin-top: 2px;
        }

        .action-btns {
            display: flex;
            gap: 10px;
        }

        .btn-mini {
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 12px;
            border: none;
            cursor: pointer;
        }

        .btn-use {
            background: #81C784;
            color: white;
        }

        .btn-del {
            background: #FFCDD2;
            color: #D32F2F;
        }

        .current-badge {
            background: var(--main-pink);
            color: white;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: 5px;
        }

        /* --- 3. 小目标页样式 (保留原样式) --- */

        .apple-counter {
            position: absolute;
            top: 20%;
            right: 15%;
            width: 10vw;
            text-align: center;
            font-size: 8vw;
            color: white;
            font-weight: 900;
            text-shadow: 1.5px 0 0 #43200b, -1.5px 0 0 #43200b, 0 1.5px 0 #43200b, 0 -1.5px 0 #43200b;
            transform: rotate(10deg);
            z-index: 20;
            pointer-events: none;
        }

        .input-area {
            position: absolute;
            left: 28%;
            bottom: 24%;
            width: 52%;
            height: 23%;
            z-index: 50;
        }

        .custom-input {
            width: 100%;
            height: 100%;
            background-color: var(--input-bg);
            border: 2px solid var(--input-border);
            border-radius: 50px;
            padding: 0 10px 0 30px;
            color: var(--text-brown);
            font-family: inherit;
            font-size: 14px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2359474a'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-size: 15px;
            background-position: 12px center;
        }

        .paw-btn {
            position: absolute;
            width: 10vw;
            height: 10vw;
            max-width: 28px;
            max-height: 28px;
            right: 10%;
            bottom: 23%;
            background: url('https://i.postimg.cc/ZnkrHq1n/02.png') no-repeat center;
            background-size: contain;
            border: none;
            cursor: pointer;
            z-index: 60;
            transition: transform 0.1s;
        }

        .paw-btn:active {
            transform: scale(0.8);
        }

        .main-content {
            padding: 20px;
            width: 100%;
            max-width: 600px;
            margin: 0 auto;
            position: relative;
            z-index: 5;
            padding-bottom: 120px;
        }

        .goal-title-custom {
            text-align: center;
            color: #dd4b6d;
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 15px;
            margin-top: -15px;
            display: none;
            text-shadow: 1px 1px 0 #fff;
        }

        .star-decor {
            margin: 0 10px;
        }

        .glass-progress-container {
            width: 100%;
            height: 24px;
            background-color: #F8F0F2;
            border-radius: 50px;
            position: relative;
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            border: 2px solid #FFB7C5;
            margin-bottom: 40px;
            display: none;
        }

        .glass-progress-fill {
            height: 100%;
            width: 0%;
            background-color: #FF69B4;
            background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
            background-size: 15px 15px;
            border-radius: 50px;
            transition: width 0.5s ease;
        }

        .progress-text {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10;
            font-size: 16px;
            /* 稍微加大一点 */
            color: #FF5EAA;
            /* 字体内部颜色 */
            font-weight: 900;
            /* 核心修改：使用矢量描边替代阴影 */
            -webkit-text-stroke: 3px white;
            paint-order: stroke fill;
            /* 让描边在字体下面，不遮挡文字 */
            text-shadow: none;
            /* 清除旧的阴影 */
        }

        .category-card {
            background: #FFF;
            border: 2px solid #e48d99;
            border-radius: 20px;
            /* 👇 优化：顶部内边距改大到 40px，给标题胶囊留位置 */
            padding: 40px 15px 15px 15px;
            margin-bottom: 40px;
            position: relative;
            box-shadow: 0 6px 0 #ffbac6;
            animation: popIn 0.4s ease-out;
        }

        @keyframes popIn {
            from {
                transform: scale(0.9);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .card-header-pill {
            position: absolute;
            top: -18px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(90deg, #fd5392 0%, #ff6b81 100%);
            padding: 8px 40px;
            border-radius: 50px;
            border: 2px solid white;
            color: white;
            font-size: 18px;
            white-space: nowrap;
            z-index: 10;
            box-shadow: 0 3px 8px rgba(255, 107, 129, 0.4);
        }

        .card-header-pill::before,
        .card-header-pill::after {
            content: '✦';
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.9em;
            opacity: 0.9;
        }

        .card-header-pill::before {
            left: 12px;
        }

        .card-header-pill::after {
            right: 12px;
        }

        .card-controls-left {
            position: absolute;
            top: 5px;
            left: 10px;
            display: flex;
            gap: 8px;
            z-index: 20;
        }

        .card-controls-right {
            position: absolute;
            top: 5px;
            right: 8px;
            display: flex;
            align-items: center;
            gap: 10px;
            z-index: 20;
        }

        .ctrl-btn {
            font-size: 13px !important;
            cursor: pointer;
            opacity: 0.6;
            transition: all 0.2s;
            user-select: none;
        }

        .ctrl-btn:hover {
            opacity: 1;
            transform: scale(1.2);
        }

        .task-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 15px;
            margin-bottom: 8px;
            border-radius: 12px;
            background: #FFF5F7;
            transition: all 0.2s;
            width: 100%;
            box-sizing: border-box;
            user-select: none;
            -webkit-user-select: none;
        }

        .task-item.completed {
            background: #e9f3e8;
        }

        .check-box {
            width: 22px;
            height: 22px;
            border: 2px solid #FFC0CB;
            border-radius: 50%;
            background: white;
            flex-shrink: 0;
            margin-right: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .task-item.completed .check-box {
            border-color: #81C784;
            background: #81C784;
            color: white;
        }

        .task-item.completed .check-box::after {
            content: '✔';
            font-size: 14px;
        }

        .task-item.completed .task-text {
            text-decoration: line-through;
            color: #999;
        }

        .task-text {
            flex: 1;
            width: 0;
            min-width: 0;
            font-size: 16px;
            border: none;
            background: transparent;
            font-family: inherit;
            color: var(--text-brown);
        }

        .task-del {
            color: #ffb7c5;
            padding: 5px;
            cursor: pointer;
            font-size: 18px;
            flex-shrink: 0;
            margin-left: 5px;
        }

        .add-project-btn {
            width: 50%;
            margin: -15px auto 80px auto;
            display: block;
            padding: 10px;
            background: var(--btn-gradient);
            border: 2px solid #fff;
            border-radius: 50px;
            color: white;
            font-size: 18px;
            font-weight: bold;
            text-align: center;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(255, 154, 158, 0.4);
            user-select: none;
        }

        /* 底部导航栏 */
        .bottom-nav-container {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 90px;
            z-index: 100;
            pointer-events: none;
        }

        .center-bump {
            position: absolute;
            bottom: 35px;
            left: 50%;
            transform: translateX(-50%);
            width: 70px;
            height: 70px;
            background: #fff;
            border-radius: 50%;
            box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.02);
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
            z-index: 101;
        }

        .add-btn-circle {
            width: 50px;
            height: 50px;
            background: linear-gradient(180deg, #ffe0e0 0%, #ffc0cb 100%);
            border-radius: 50%;
            border: 2px solid #59474a;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 30px;
            color: #59474a;
            cursor: pointer;
            border: none;
        }

        .nav-bg {
            position: absolute;
            bottom: 0;
            width: 100%;
            height: 70px;
            background: #fff;
            border-top-left-radius: 20px;
            border-top-right-radius: 20px;
            box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-around;
            align-items: center;
            pointer-events: auto;
        }

        .nav-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            border: none;
            background: none;
            cursor: pointer;
            padding: 0 20px;
            width: 30%;
        }

        .nav-icon-img {
            width: 25px;
            height: 25px;
            object-fit: contain;
        }

        .nav-text {
            font-size: 12px;
            color: #888;
        }

        /* 弹窗与特效 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: white;
            width: 85%;
            max-width: 320px;
            border-radius: 25px;
            padding: 20px;
            text-align: center;
        }

        /* 转账弹窗样式 */
        .transfer-dialog {
            max-width: 320px;
            padding: 25px;
            text-align: left;
        }

        .transfer-dialog h3 {
            text-align: center;
            color: var(--text-brown);
            margin-bottom: 20px;
            margin-top: 0;
        }

        .transfer-dialog .form-group {
            margin-bottom: 15px;
        }

        .transfer-dialog label {
            display: block;
            font-size: 14px;
            color: #888;
            margin-bottom: 5px;
        }

        .transfer-dialog input {
            width: 100%;
            padding: 10px;
            border: 2px solid #FFB7C5;
            border-radius: 8px;
            font-size: 14px;
            box-sizing: border-box;
        }

        .transfer-dialog .error-hint {
            display: none;
            color: #e74c3c;
            font-size: 12px;
            margin-top: 5px;
        }

        .transfer-dialog .error-hint.show {
            display: block;
        }

        .dialog-buttons {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }

        .dialog-buttons button {
            flex: 1;
            padding: 10px;
            border: none;
            border-radius: 20px;
            font-size: 14px;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .dialog-buttons button:active {
            transform: scale(0.95);
        }

        .btn-cancel {
            background: #f0f0f0;
            color: #666;
        }

        .btn-confirm {
            background: linear-gradient(90deg, #fd5392 0%, #ff6b81 100%);
            color: white;
        }

        .win-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 2000;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.5s;
        }

        .win-img {
            width: 80%;
            max-width: 300px;
            margin-bottom: 20px;
            animation: popIn 0.5s;
        }

        .win-btn-row {
            display: flex;
            gap: 20px;
            margin-top: 10px;
        }

        .overlay-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.9);
            border: 3px solid #e8718d;
            color: #e8718d;
            font-size: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            transition: transform 0.2s;
        }

        .overlay-btn:active {
            transform: scale(0.9);
        }

        /* Loading */
        .loading-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 3000;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .loading-img {
            width: 80%;
            max-width: 300px;
            animation: breathe 1.5s infinite ease-in-out;
        }

        @keyframes breathe {
            0% {
                transform: scale(0.95);
            }

            50% {
                transform: scale(1.05);
            }

            100% {
                transform: scale(0.95);
            }
        }

        .empty-hint {
            text-align: center;
            margin-top: 50px;
            color: #ccc;
        }

        /* 长按气泡菜单样式 */
        .task-context-menu {
            position: fixed;
            z-index: 1000;
            background: rgba(255, 255, 255, 0.98);
            border-radius: 16px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 183, 197, 0.3);
            padding: 8px 0;
            min-width: 140px;
            animation: menuPopIn 0.2s ease-out;
            backdrop-filter: blur(10px);
        }

        @keyframes menuPopIn {
            from {
                opacity: 0;
                transform: scale(0.8) translateY(-10px);
            }

            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .context-menu-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 18px;
            font-size: 15px;
            color: var(--text-brown);
            cursor: pointer;
            transition: background 0.15s;
        }

        .context-menu-item:hover,
        .context-menu-item:active {
            background: #FFF0F5;
        }

        .context-menu-item .menu-icon {
            font-size: 16px;
            width: 20px;
            text-align: center;
        }

        .context-menu-item.danger {
            color: #e74c3c;
        }

        .context-menu-divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, #FFD0D8, transparent);
            margin: 6px 0;
        }

        .context-menu-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 999;
            background: transparent;
        }

        /* 任务长按高亮效果 */
        .task-item.long-press-active {
            background: #FFE8EE !important;
            transform: scale(1.02);
            box-shadow: 0 4px 12px rgba(255, 154, 158, 0.3);
        }

        /* --- 2.5 设置页面样式 --- */
        .settings-btn {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 30px;
            cursor: pointer;
            z-index: 100;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            transition: transform 0.2s;
        }

        .settings-btn:active {
            transform: scale(0.9);
        }

        .avatar-upload-container {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 3px solid #ffb7c5;
            margin: 0 auto 15px auto;
            position: relative;
            cursor: pointer;
            overflow: hidden;
            background: #fff;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .avatar-preview {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .avatar-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            background: rgba(0, 0, 0, 0.5);
            color: white;
            font-size: 10px;
            padding: 2px 0;
            text-align: center;
            opacity: 0.8;
        }

        /* --- 2.6 角色互动区 & 任务列表升级 --- */
        .char-area {
            display: flex;
            align-items: center;
            /* 垂直居中 */
            margin-bottom: 20px;
            padding: 0 10px;
            gap: 15px;
            animation: fadeIn 0.5s;
        }

        .char-avatar {
            width: 45px;
            /* 缩小头像 */
            height: 45px;
            border-radius: 50%;
            border: 3px solid #FFB7C5;
            object-fit: cover;
            background: white;
            flex-shrink: 0;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .char-bubble {
            background: #fff;
            /* 改回纯白背景 */
            padding: 12px 18px;
            border-radius: 18px;
            border-top-left-radius: 4px;
            border: 2px solid #FFDEE9;
            /* 淡粉色边框 */
            box-shadow: 0 4px 10px rgba(255, 183, 197, 0.2);
            color: #59474a;
            /* 深色字体 */
            font-size: 14px;
            line-height: 1.4;
            position: relative;
            max-width: 70%;
            transition: opacity 0.3s;
        }

        .char-bubble::before {
            content: '';
            position: absolute;
            top: 15px;
            left: -8px;
            width: 0;
            height: 0;
            border-top: 8px solid transparent;
            border-bottom: 8px solid transparent;
            border-right: 12px solid #fff;
            /* 匹配白色背景 */
        }

        .task-text-wrapper {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            margin-left: 5px;
            /* 稍微给点间距 */
        }

        /* --- 文件夹分类样式 --- */
        .folder-scroll {
            display: flex;
            overflow-x: auto;
            gap: 10px;
            margin-bottom: 15px;
            padding-bottom: 5px;
            border-bottom: 1px dashed #eee;
            -ms-overflow-style: none;
            /* 隐藏滚动条 */
            scrollbar-width: none;
        }

        .folder-scroll::-webkit-scrollbar {
            display: none;
        }

        .folder-chip {
            padding: 6px 15px;
            background: #f0f0f0;
            border-radius: 20px;
            font-size: 13px;
            color: #888;
            white-space: nowrap;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.2s;
            user-select: none;
            flex-shrink: 0;
        }

        .folder-chip.active {
            background: #FF9A9E;
            color: white;
            font-weight: bold;
            box-shadow: 0 2px 6px rgba(255, 154, 158, 0.4);
        }

        .saved-item-row {
            padding: 12px;
            border-bottom: 1px solid #fff0f5;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #fff;
            border-radius: 8px;
            margin-bottom: 8px;
        }

        .task-title {
            font-size: 16px;
            color: var(--text-brown);
        }

        .task-subtitle {
            font-size: 12px;
            color: #999;
            margin-top: 4px;
        }

        /* ================= 日历 (Calendar) 样式 ================= */
        :root {
            /* 日历专用配色 */
            --theme-black: #4b4b4b;
            --theme-pink-text: #ff9cb7;
            --theme-weekend: #f06e8e;
            --today-red: #ff3333;
            --prio-high: #ffb7c5;
            --prio-mid: #baffc9;
            --prio-low: #bae1ff;
            --cal-bg-pink: #FFF0F5;
        }

        /* 顶部月份导航 */
        .calendar-header {
            padding: 30px 20px 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 40px;
            /* Increased gap for diamonds */
            background: transparent;
            margin-top: 10px;
        }

        /* Stacked Date Styles */
        .month-title {
            display: flex;
            flex-direction: column;
            align-items: center;
            line-height: 1;
            color: var(--theme-black);
            font-weight: bold;
        }

        .month-year {
            font-size: 28px;
            color: #555;
            font-weight: 800;
            margin-bottom: 5px;
            letter-spacing: 1px;
        }

        .month-num {
            font-size: 40px;
            font-weight: 900;
            letter-spacing: 1px;
            color: var(--theme-black);
        }

        /* Custom Navigation Button */
        .cal-nav-btn {
            background: none;
            border: none;
            color: var(--theme-black);
            font-size: 18px;
            /* Diamond size */
            cursor: pointer;
            padding: 8px;
            transition: transform 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .cal-nav-btn:active {
            transform: scale(0.8);
        }

        /* 日历主体 */
        .calendar-container {
            padding: 10px 12px;
            padding-bottom: 200px;
        }

        .weekdays {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            text-align: center;
            margin-bottom: 15px;
            margin-left: -10px;
            margin-right: -10px;
            padding: 10px 10px;
            font-size: 15px;
            font-weight: bold;
            background: var(--theme-black);
            border-radius: 25px;
            color: var(--theme-pink-text);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            font-family: "Arial Rounded MT Bold", "Helvetica Rounded", sans-serif;
        }

        .days-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 2px;
            row-gap: 2px;
        }

        .day-cell {
            background: transparent;
            border-radius: 14px;
            height: 56px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding-top: 4px;
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
            z-index: 2;
        }

        .day-number {
            font-size: 17px;
            font-weight: bold;
            z-index: 3;
            position: relative;
            margin-top: 12px;
            color: var(--theme-black);
        }

        .day-cell.weekend .day-number {
            color: var(--theme-weekend);
        }

        .day-cell.selected::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--theme-black);
            border-radius: 12px;
            z-index: -1;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        }

        .day-cell.selected .day-number {
            color: white !important;
        }

        .day-cell.today .day-number {
            color: var(--today-red);
        }

        /* 标记点 */
        .day-heart {
            position: absolute;
            top: 2px;
            font-size: 11px;
            z-index: 3;
        }

        .event-dots {
            display: flex;
            gap: 3px;
            position: absolute;
            bottom: 7px;
            z-index: 3;
        }

        .dot {
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: #FFB7C5;
        }

        /* 下方日程列表 (弹窗式) */
        .schedule-area {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 40vh;
            background: rgba(255, 255, 255, 0.98);
            border-top-left-radius: 25px;
            border-top-right-radius: 25px;
            padding: 20px;
            box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.1);
            transform: translateY(110%);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 2000;
            /* 层级要高 */
            display: flex;
            flex-direction: column;
        }

        .schedule-area.show {
            transform: translateY(0);
        }

        .schedule-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            padding-bottom: 10px;
            flex-shrink: 0;
        }

        .selected-date-info {
            font-size: 18px;
            font-weight: bold;
            color: var(--theme-black);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .heart-selector {
            display: flex;
            gap: 8px;
        }

        .heart-btn {
            font-size: 18px;
            cursor: pointer;
            opacity: 0.4;
            transition: all 0.2s;
        }

        .heart-btn.active {
            opacity: 1;
            transform: scale(1.2);
        }

        /* 任务列表与卡片 */
        #scheduleList {
            overflow-y: auto;
            flex: 1;
            padding-bottom: 20px;
            scrollbar-width: none;
        }

        #scheduleList::-webkit-scrollbar {
            display: none;
        }

        .task-card {
            display: flex;
            align-items: stretch;
            background: white;
            border-radius: 12px;
            margin-bottom: 10px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
            overflow: hidden;
            min-height: 50px;
        }

        .task-time {
            font-size: 15px;
            font-weight: bold;
            width: 70px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-right: 1px solid rgba(0, 0, 0, 0.1);
            background: transparent;
        }

        .task-content {
            flex: 1;
            font-size: 15px;
            color: var(--theme-black);
            display: flex;
            align-items: center;
            padding-left: 15px;
        }

        .task-icon {
            margin-right: 10px;
            font-size: 18px;
        }

        .task-card.prio-high {
            background: #FFF0F5;
            color: #fd5392;
        }

        .task-card.prio-high .task-time {
            color: #fd5392;
        }

        .task-card.prio-mid {
            background: #f0fff4;
            color: #2d6a40;
        }

        .task-card.prio-mid .task-time {
            color: #2d6a40;
        }

        .task-card.prio-low {
            background: #f0f8ff;
            color: #2d5a88;
        }

        .task-card.prio-low .task-time {
            color: #2d5a88;
        }

        /* 浮动按钮组 */
        .fab-group {
            position: absolute;
            top: -20px;
            right: 20px;
            display: flex;
            gap: 10px;
            z-index: 2100;
        }

        .mini-fab {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            font-weight: bold;
            transition: transform 0.2s;
        }

        .btn-add {
            background: #fd5392;
            color: white;
            font-size: 24px;
        }

        .btn-close {
            background: white;
            color: #999;
            font-size: 18px;
        }

        /* 弹窗表单 (Modal Box) */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 3000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(2px);
        }

        .modal-box {
            background: white;
            width: 85%;
            max-width: 320px;
            border-radius: 20px;
            padding: 25px;
            animation: popIn 0.3s;
        }

        .form-row {
            margin-bottom: 15px;
        }

        .label-text {
            display: block;
            color: #888;
            font-size: 12px;
            margin-bottom: 6px;
        }

        .form-input {
            width: 100%;
            height: 42px;
            padding: 0 10px;
            border-radius: 10px;
            border: 1px solid #FFDEE9;
            background: #FFF0F5;
            color: #333;
            outline: none;
            font-size: 14px;
        }

        .prio-selector {
            display: flex;
            gap: 8px;
        }

        .prio-opt {
            flex: 1;
            padding: 8px;
            text-align: center;
            border-radius: 8px;
            font-size: 13px;
            cursor: pointer;
            border: 2px solid transparent;
            transition: all 0.2s;
            font-weight: bold;
        }

        .prio-opt.high {
            background: #ffeef2;
            color: #ff8fa3;
        }

        .prio-opt.high.selected {
            background: var(--prio-high);
            border-color: #fd5392;
            color: #fd5392;
        }

        .prio-opt.mid {
            background: #e8f5e9;
            color: #81c784;
        }

        .prio-opt.mid.selected {
            background: var(--prio-mid);
            border-color: #4caf50;
            color: #2e7d32;
        }

        .prio-opt.low {
            background: #e3f2fd;
            color: #64b5f6;
        }

        .prio-opt.low.selected {
            background: var(--prio-low);
            border-color: #2196f3;
            color: #1565c0;
        }



        /* 表情贴纸选择 */
        .sticker-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 8px;
            overflow-x: auto;
            padding-bottom: 2px;
        }

        .sticker-tab {
            font-size: 16px;
            padding: 4px 10px;
            background: #f2f2f2;
            border-radius: 12px;
            cursor: pointer;
            white-space: nowrap;
        }

        .sticker-tab.active {
            background: #FFB7C5;
            color: white;
        }

        .sticker-grid {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            padding: 10px 5px;
            background: #fafafa;
            border-radius: 10px;
            scrollbar-width: none;
        }

        .sticker-item {
            flex-shrink: 0;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            border-radius: 8px;
            cursor: pointer;
        }

        .sticker-item.selected {
            background: #ffe4e8;
            border: 1px solid #FFB7C5;
        }

        .btn-block-confirm {
            width: 100%;
            background: #fd5392;
            color: white;
            border: none;
            padding: 12px;
            border-radius: 25px;
            font-size: 16px;
            margin-top: 15px;
            cursor: pointer;
        }

        .menu-item.danger {
            color: #ff4757;
        }

        /* === 强制修复日历顶部排版 (Fix Calendar Header) === */
        .calendar-header {
            display: flex !important;
            /* 强制弹性布局 */
            flex-direction: row !important;
            /* 强制横向排列，不准换行 */
            justify-content: center !important;
            /* 居中对齐 */
            align-items: center !important;
            /* 垂直居中 */
            gap: 15px !important;
            /* 按钮和文字的间距 */
            white-space: nowrap !important;
            /* 禁止内容换行 */
            width: 100% !important;
            padding-top: 50px !important;
            /* 顶部留出足够空间 */
            margin-top: 0 !important;
        }

        .month-title {
            font-size: 32px !important;
            /* 保持原版大字体 */
            font-weight: bold !important;
            color: #4b4b4b !important;
            /* 确保颜色正确 */
            letter-spacing: 2px !important;
            line-height: 1 !important;
            /* 压低行高 */
            margin: 0 !important;
            /* 去掉多余边距 */
            display: inline-block !important;
            /* 确保在同一行 */
        }

        .nav-btn {
            font-size: 24px !important;
            background: transparent !important;
            border: none !important;
            padding: 0 5px !important;
            cursor: pointer !important;
            display: inline-block !important;
            color: #4b4b4b !important;
            /* Update diamond color */
        }

        /* 修复返回按钮的位置，防止它挤压标题 */
        .calendar-header .back-btn {
            top: 5px !important;
            /* 调整垂直位置，往上挪 */
            left: 10px !important;
        }

        /* 日历页面专用背景 */
        #calendar-layer {
            background-image: url('https://i.postimg.cc/6pzb10qS/09.jpg') !important;
            background-size: cover !important;
            background-position: center !important;
            background-attachment: fixed !important;
            height: 100vh !important;
            overflow: hidden !important;
        }

        /* --- AI Schedule Assistant (Post-it Style) --- */
        /* --- AI Schedule AssistantRefined (Round 3) --- */
        /* 容器 */
        #ai-schedule-wrapper {
            position: relative;
            width: 95%;
            height: 0;
            padding-bottom: 75%;
            /* 维持背景图比例 */
            margin: -190px auto 40px auto;
            background: url('https://i.postimg.cc/VNJWk2Pc/011.png') no-repeat center center;
            background-size: 100% 100%;
            transform: rotate(-1deg);
            box-shadow: none;
            z-index: 10;
        }

        /* 1. 左上角头像 (拍立得风格) - 向左歪 */
        .polaroid-avatar {
            position: absolute;
            top: -5px;
            left: 15px;
            background: white;
            padding: 4px 4px 15px 4px;
            box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
            transform: rotate(-8deg);
            z-index: 10;
        }

        #ai-char-avatar {
            width: 50px;
            height: 50px;
            object-fit: cover;
            display: block;
        }

        /* 2. 用户标题胶囊 (深色背景) */
        #user-schedule-pill {
            position: absolute;
            top: 25px;
            left: 85px;
            background: #59474a;
            color: #ffb8cc;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: bold;
            z-index: 5;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            transform: none;
        }

        /* 3. 右上角按钮组 */
        .ai-btn-group {
            position: absolute;
            top: 23px;
            right: 60px;
            display: flex;
            gap: 8px;
            z-index: 10;
        }

        .circle-btn {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            cursor: pointer;
            transition: transform 0.1s;
        }

        .circle-btn:active {
            transform: scale(0.9);
        }

        #btn-ai-gen {
            background: #FFDEE9;
        }

        /* 粉色 */
        #btn-ai-play {
            background: #E0F2F1;
        }

        /* 浅绿 */

        /* 4. 滚动文字区 (上移 + 宽行高) */
        #ai-text-scroll-area {
            position: absolute;
            top: 26%;
            left: 12%;
            /* 往左移动 */
            width: 75%;
            height: 60%;
            /* 底部留空 */
            overflow-y: auto;
            /* 隐藏滚动条 */
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        #ai-text-scroll-area::-webkit-scrollbar {
            display: none;
        }

        #ai-reply-text {
            margin: 0;
            font-size: 14px;
            /* 字体稍微大一点 */
            line-height: 1.8;
            /* 宽松行高 */
            color: #59474a;
            text-align: justify;
            /* 两端对齐 */
            font-weight: 500;
        }

        /* 高亮样式的圆角优化 */
        .highlight-pill {
            padding: 2px 6px;
            border-radius: 12px !important;
            /* 更圆润 */
            font-weight: bold;
            font-size: 12px;
            margin: 0 2px;
        }

        /* ================= 番茄钟专属样式 ================= */

        /* 新增：番茄钟中间的AI气泡区 */
        .pomo-ai-interaction {
            display: flex;
            align-items: center;
            /* 垂直居中 */
            gap: 10px;
            /* 使用绝对定位，不影响下面瓶子的布局 */
            position: absolute;
            top: 171px;
            /* 在顶部卡片下方 */
            left: 15px;
            /* 往左靠 */
            z-index: 80;
            /* 保证在瓶子上面 */
            animation: fadeIn 0.5s;
        }

        .pomo-ai-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 2px solid #FFB7C5;
            background: #fff;
            object-fit: cover;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .pomo-ai-bubble {
            background: #fff;
            padding: 8px 12px;
            border-radius: 20px;
            border-top-left-radius: 4px;
            /* 气泡尖角在左边 */
            border: 2px solid #FFDEE9;
            color: #59474a;
            font-size: 13px;
            box-shadow: 0 4px 10px rgba(255, 183, 197, 0.2);
            position: relative;
            white-space: nowrap;
            /* 强制单行不换行 */
        }

        /* 给气泡加个小尖角 */
        .pomo-ai-bubble::before {
            content: '';
            position: absolute;
            top: 10px;
            left: -8px;
            width: 0;
            height: 0;
            border-top: 6px solid transparent;
            border-bottom: 6px solid transparent;
            border-right: 10px solid #FFDEE9;
        }

        .pomo-ai-bubble::after {
            content: '';
            position: absolute;
            top: 10px;
            left: -5px;
            /* 盖住边框颜色 */
            width: 0;
            height: 0;
            border-top: 6px solid transparent;
            border-bottom: 6px solid transparent;
            border-right: 10px solid #fff;
        }

        /* 新按钮样式：告诉角色并开始 */
        .btn-confirm-ai {
            flex: 1;
            padding: 10px 8px;
            border: none;
            border-radius: 25px;
            font-size: 13px;
            cursor: pointer;
            font-weight: bold;
            background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
            /* 紫粉渐变，区别于普通开始 */
            color: white;
            box-shadow: 0 4px 10px rgba(161, 140, 209, 0.3);
            white-space: nowrap;
        }

        /* 1. 容器调整 */
        .pomo-wrapper {
            width: 100%;
            max-width: 400px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding-top: 30px;
            /* 顶部间距 */
            height: 100vh;
            overflow-y: auto;
            position: relative;
        }

        /* 1. 顶部统计卡片 */
        .stats-card {
            display: flex;
            justify-content: space-between;
            align-items: stretch;
            /* 让子元素填满高度 */
            background-color: rgba(255, 255, 255, 0.56);
            border: 2px solid rgba(255, 255, 255, 0.8);
            border-radius: 25px;
            padding: 2px 15px;
            width: 95%;
            height: 130px;
            box-shadow: 0 2px 5px rgba(255, 150, 170, 0.3),
                inset 0 0 10px rgba(255, 230, 240, 0.3);
            position: relative;
            flex-shrink: 0;
            z-index: 50;
            margin-bottom: 10px;
            overflow: visible;
            /* 左侧角色需要溢出 */
        }

        /* 3. 左侧：角色与气泡区 */
        .pomo-char-container {
            position: relative;
            width: 140px;
            /* 限制左侧宽度 */
            height: 100%;
            flex-shrink: 0;
        }

        /* 2. 左侧角色图片 */
        .pomo-char-img {
            position: absolute;
            bottom: -2px;
            left: -10px;
            /* 往右挑一点 */
            width: 150px;
            /* 缩小到150px */
            height: 150px;
            object-fit: contain;
            z-index: 60;
        }

        /* 3. 气泡文字定位 */
        .pomo-bubble-text {
            position: absolute;
            top: -26px;
            left: 5px;
            display: flex;
            align-items: center;
            gap: 6px;
            transform: rotate(0);
            /* 不旋转 */
            z-index: 70;
            background: transparent;
            /* 透明背景 */
            padding: 5px 12px;
            border-radius: 15px;
            box-shadow: none;
            /* 去掉阴影 */
        }

        /* "今日努力" 竖排小字：上面“今日”，下面“努力” */
        .pomo-label-group {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            line-height: 1.2;
        }

        .pomo-label-small {
            font-size: 11px;
            color: #ff8b8b;
            font-weight: 800;
            letter-spacing: 1px;
        }

        /* 时间大字 00:00 */
        .pomo-time-big {
            font-size: 24px;
            color: #6d5c56;
            font-weight: 900;
            font-family: "Arial Rounded MT Bold", sans-serif;
            letter-spacing: 1px;
            line-height: 1;
            text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
            /* 稍微加粗效果 */
        }

        /* 4. 右侧：迷你日历区 */
        .pomo-calendar-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            /* 垂直居中 */
            align-items: stretch;
            padding-left: 10px;
            padding-right: 5px;
            overflow: hidden;
            /* 防止溢出 */
        }

        /* 日历表头 */
        .mini-cal-header {
            background-color: #ff97bc;
            border-radius: 10px;
            display: flex;
            justify-content: space-between;
            padding: 3px 5px;
            margin-bottom: 9px;
            flex-shrink: 0;
        }

        .mini-cal-weekday {
            color: white;
            font-size: 9px;
            font-weight: bold;
            width: 14.28%;
            /* 7等分 */
            text-align: center;
        }

        /* 日历格子间距 */
        .mini-cal-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            row-gap: 3px;
            column-gap: 0;
        }

        /* 日历圆圈 */
        .mini-day-cell {
            height: 14px;
            width: 14px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            color: #6d5c56;
            font-weight: bold;
            border-radius: 50%;
            position: relative;
        }

        /* 打卡成功的样式 (蓝色圆圈+白色勾) */
        .mini-day-cell.checked {
            background-color: #8FD3FE;
            color: white;
            width: 14px;
            height: 14px;
            border: 1.5px solid white;
        }

        .mini-day-cell.checked::after {
            content: '✔';
            font-size: 7px;
            position: absolute;
            color: white;
        }

        /* 今天的样式 (稍微加个红框) */
        .mini-day-cell.is-today {
            border: 1px solid #ff8b8b;
            color: #ff8b8b;
        }

        /* --- 物理番茄钟容器 (修正版) --- */
        .pomodoro-section {
            flex: 1;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            /* 改为顶部对齐，方便用 margin 控制位置 */
            position: relative;
            padding-top: 10px;
            /* 稍微往下顶一点 */
            overflow: hidden;
            /* 防止瓶子超出 */
        }

        /* 瓶子容器：通过 height 和 scaleY 来压扁 */
        .physics-container {
            width: 423px;
            height: 520px;
            /* 高度减小，原639 */
            position: relative;
            transform-origin: center top;
            transform: scale(0.85);
            /* 整体缩放 */
            margin-top: 45px;
            /* 往下挨，给对话气泡留出空间 */
        }

        /* 瓶子背景 */
        .jar-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: url('https://i.postimg.cc/yYncJzxQ/013.png');
            background-size: 100% 100%;
            z-index: 1;
        }

        /* 画布 */
        #matter-canvas {
            position: absolute;
            top: 0;
            left: 0;
            z-index: 2;
            background: transparent;
            /* 既然瓶子压扁了，画布不需要变，MatterJS里我们会调整边界墙 */
        }

        /* 玻璃反光 (位置微调) */
        .glass-shine {
            position: absolute;
            top: 20%;
            left: 5%;
            width: 90%;
            height: 60%;
            border-radius: 40px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.05) 30%, transparent 50%);
            pointer-events: none;
            z-index: 3;
        }

        .shine-stripe {
            position: absolute;
            top: 22%;
            left: 12%;
            width: 15px;
            height: 180px;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 10px;
            transform: rotate(5deg);
            filter: blur(2px);
            z-index: 4;
            pointer-events: none;
        }

        /* --- 文字层 (横排修正) --- */
        .timer-overlay {
            position: absolute;
            top: 55%;
            /* 垂直居中偏下 */
            left: 0;
            width: 100%;
            display: flex;
            /* 使用Flex布局 */
            flex-direction: column;
            /* 垂直排列：上时间，下任务 */
            align-items: center;
            /* 水平居中 */
            justify-content: center;
            z-index: 10;
            pointer-events: none;
        }

        .pomo-wrapper .timer-text {
            font-size: 70px;
            /* 稍微调小一点，防止太宽 */
            color: white;
            font-weight: 900;
            line-height: 1;
            /* 虚化散开的多层阴影，颜色深度不变但更柔和 */
            text-shadow:
                0 0 8px rgba(221, 108, 130, 0.9),
                0 0 15px rgba(221, 108, 130, 0.7),
                0 0 25px rgba(221, 108, 130, 0.5),
                0 0 35px rgba(221, 108, 130, 0.3);
            font-family: "Arial Rounded MT Bold", sans-serif;
            letter-spacing: 2px;
        }

        .pomo-wrapper .task-text {
            font-size: 28px;
            color: white;
            font-weight: 800;
            margin-top: 5px;
            /* 虚化散开的多层阴影 */
            text-shadow:
                0 0 6px rgba(221, 108, 130, 0.9),
                0 0 12px rgba(221, 108, 130, 0.7),
                0 0 20px rgba(221, 108, 130, 0.5);
            /* 强制横排 */
            writing-mode: horizontal-tb;
            width: 80%;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* --- 番茄钟设置弹窗样式 --- */
        .pomo-setup-modal {
            display: none;
            /* 默认隐藏 */
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(3px);
        }

        .pomo-setup-box {
            background: #fff;
            width: 85%;
            max-width: 320px;
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            animation: popIn 0.3s;
        }

        .pomo-setup-box h3 {
            text-align: center;
            color: #dd6c82;
            margin-top: 0;
            margin-bottom: 20px;
        }

        .setup-row {
            margin-bottom: 15px;
        }

        .setup-row label {
            display: block;
            color: #59474a;
            font-weight: bold;
            font-size: 14px;
            margin-bottom: 5px;
        }

        .setup-input {
            width: 100%;
            padding: 10px;
            border: 2px solid #FFDEE9;
            border-radius: 10px;
            font-size: 14px;
            color: #333;
            background: #FFF0F5;
        }

        .setup-input:focus {
            border-color: #dd6c82;
        }

        /* 模式切换开关 */
        .mode-switch {
            display: flex;
            background: #f0f0f0;
            border-radius: 10px;
            padding: 3px;
        }

        .mode-opt {
            flex: 1;
            text-align: center;
            padding: 8px 0;
            font-size: 13px;
            cursor: pointer;
            border-radius: 8px;
            color: #888;
            transition: all 0.2s;
        }

        .mode-opt.active {
            background: #fff;
            color: #dd6c82;
            font-weight: bold;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        .setup-actions {
            display: flex;
            gap: 8px;
            margin-top: 25px;
        }

        .btn-cancel,
        .btn-confirm {
            flex: 1;
            padding: 10px 8px;
            border: none;
            border-radius: 25px;
            font-size: 13px;
            cursor: pointer;
            font-weight: bold;
            white-space: nowrap;
        }

        .btn-cancel {
            background: #f0f0f0;
            color: #888;
        }

        .btn-confirm {
            background: linear-gradient(90deg, #fd5392 0%, #ff6b81 100%);
            color: white;
        }

        /* --- 底部控制栏样式 (V3 变窄版) --- */
        .pomo-controls {
            position: absolute;
            bottom: 15px;
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            max-width: 320px;
            height: 55px;

            /* 玻璃底框 */
            background: rgba(255, 255, 255, 0.57);
            border: 2px solid #fff;
            border-radius: 40px;

            box-shadow: 0 10px 20px rgba(221, 108, 130, 0.3);

            display: flex;
            justify-content: space-evenly;
            align-items: center;
            z-index: 100;
            padding: 0 5px;
        }

        /* 通用按钮 */
        .pomo-btn {
            background: transparent;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.1s;
            color: #dd6c82;
            /* 统一颜色 */
            padding: 0;
            /* 去除内边距干扰 */
        }

        .pomo-btn:active {
            transform: scale(0.9);
        }

        /* 1,2,4号按钮：只有图标，无背景圆 */
        .icon-btn {
            background: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .icon-btn svg {
            fill: #dd6c82;
        }

        /* 各图标独立尺寸 */
        .asmr-icon svg {
            width: 38px;
            height: 38px;
        }

        .volume-icon svg {
            width: 38px;
            height: 38px;
        }

        .chat-icon svg {
            width: 32px;
            height: 32px;
        }

        /* 3号按钮：播放键 (缩小版) */
        .play-btn {
            width: 44px;
            height: 44px;
            background-color: #dd6c82;
            border-radius: 50%;
            color: white;
            border: none;
            box-shadow: none;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* 播放键内部的三角形 */
        .play-btn svg {
            width: 26px;
            height: 26px;
        }

        /* 5号按钮：关闭键 */
        .close-btn {
            width: 32px;
            /* 和左边图标视觉平衡 */
            height: 32px;
            background-color: #dd6c82;
            border-radius: 50%;
            color: white;
        }

        .close-btn svg {
            width: 18px;
            height: 18px;
        }

        /* 番茄钟音量弹窗容器 */
        .pomo-vol-wrap {
            position: relative;
        }

        /* 番茄钟音量弹窗 */
        .pomo-vol-popup {
            position: absolute;
            bottom: 50px;
            left: 50%;
            transform: translateX(-50%) scale(0.9);
            width: 130px;
            height: 40px;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 15px;
            opacity: 0;
            pointer-events: none;
            transition: all 0.2s ease;
            touch-action: none;
        }

        .pomo-vol-popup.show {
            opacity: 1;
            pointer-events: auto;
            transform: translateX(-50%) scale(1);
        }

        #pomo-asmr-volume {
            width: 100%;
            height: 6px;
            background: rgba(221, 108, 130, 0.25);
            border-radius: 3px;
            outline: none;
            -webkit-appearance: none;
            appearance: none;
            touch-action: none;
        }

        #pomo-asmr-volume::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            background: #dd6c82;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        }

        /* ================= ASMR 弹窗样式 ================= */
        .asmr-modal-layer {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 350px;
            background: rgba(228, 202, 203, 0.35);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-top-left-radius: 30px;
            border-top-right-radius: 30px;
            border-top: 1px solid rgba(255, 255, 255, 0.5);
            box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
            z-index: 2000;
            display: flex;
            flex-direction: column;
            align-items: center;
            transform: translateY(120%);
            transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
        }

        .asmr-modal-layer.show {
            transform: translateY(0);
        }

        /* 顶部把手 */
        .modal-handle {
            width: 40px;
            height: 5px;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 10px;
            margin-top: 15px;
            cursor: pointer;
        }

        /* 控制区 */
        .asmr-controls-area {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 30px;
            width: 100%;
            margin-top: 20px;
            margin-bottom: 15px;
        }

        /* 播放按钮 */
        .asmr-btn-play {
            width: 50px;
            height: 50px;
            background: #fff;
            border-radius: 50%;
            border: none;
            color: #dd6c82;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 5px 15px rgba(221, 108, 130, 0.2);
            cursor: pointer;
            transition: transform 0.2s;
        }

        .asmr-btn-play:active {
            transform: scale(0.9);
        }

        .asmr-btn-play svg {
            width: 26px;
            height: 26px;
        }

        /* 切歌/音量按钮 */
        .asmr-btn-small {
            width: 44px;
            height: 44px;
            background: transparent;
            border: none;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.2s;
        }

        .asmr-btn-small:active {
            transform: scale(0.85);
        }

        .asmr-btn-small svg {
            width: 32px;
            height: 32px;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
        }

        /* 音量按钮容器 */
        .asmr-vol-wrap {
            position: relative;
        }

        /* 音量弹窗 - 横向滑块 */
        .asmr-vol-popup {
            position: absolute;
            bottom: 55px;
            left: 50%;
            transform: translateX(-50%) scale(0.9);
            width: 130px;
            height: 40px;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 15px;
            opacity: 0;
            pointer-events: none;
            transition: all 0.2s ease;
            touch-action: none;
        }

        .asmr-vol-popup.show {
            opacity: 1;
            pointer-events: auto;
            transform: translateX(-50%) scale(1);
        }

        #asmr-volume {
            width: 100%;
            height: 6px;
            background: rgba(221, 108, 130, 0.25);
            border-radius: 3px;
            outline: none;
            -webkit-appearance: none;
            appearance: none;
            touch-action: none;
        }

        #asmr-volume::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            background: #dd6c82;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        }

        /* --- 3D 卡片滑动区 --- */
        .interactive-section {
            width: 100%;
            height: 220px;
            perspective: 1000px;
            overflow: visible;
        }

        .card-slider {
            display: flex;
            overflow-x: auto;
            overflow-y: visible;
            scroll-snap-type: x mandatory;
            gap: 12px;
            padding: 15px 0;
            scrollbar-width: none;
            height: 100%;
            align-items: center;
        }

        .card-slider::-webkit-scrollbar {
            display: none;
        }

        .asmr-spacer {
            min-width: 50vw;
            margin-left: -70px;
        }

        /* 占位，保证第一张居中 */

        .asmr-card {
            flex-shrink: 0;
            width: 140px;
            height: 200px;
            background: #fff;
            border-radius: 15px;
            scroll-snap-align: center;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            opacity: 0.6;
            transform: scale(0.9);
        }

        .asmr-card.active {
            opacity: 1;
            transform: scale(1.1);
            /* 放大 */
            box-shadow: 0 15px 30px rgba(221, 108, 130, 0.25);
            border: 2px solid #fff;
            z-index: 10;
        }

        .asmr-img {
            width: 100%;
            height: 72%;
            object-fit: cover;
            border-bottom: 1px solid #f0f0f0;
        }

        .asmr-info {
            padding: 10px;
            text-align: center;
        }

        .asmr-title {
            font-size: 14px;
            font-weight: bold;
            color: #59474a;
        }

        .asmr-tag {
            font-size: 10px;
            color: #999;
            margin-top: 3px;
        }

        /* ================= 番茄钟小手机聊天 ================= */
        .phone-modal-layer {
            display: none;
            /* 默认隐藏 */
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            /* 背景压暗 */
            z-index: 2500;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(5px);
            animation: fadeIn 0.3s;
        }

        .phone-case {
            width: 320px;
            height: 600px;
            max-height: 85vh;
            background: linear-gradient(145deg, #fff5f8 0%, #fff0f5 50%, #ffe8ee 100%);
            border: 8px solid #ffb7c5;
            border-radius: 40px;
            position: relative;
            display: flex;
            flex-direction: column;
            /* 多层阴影增加立体感 */
            box-shadow:
                0 20px 50px rgba(0, 0, 0, 0.25),
                0 0 0 2px rgba(255, 255, 255, 0.8) inset,
                0 -3px 10px rgba(255, 183, 197, 0.3) inset,
                0 3px 10px rgba(255, 255, 255, 0.5) inset;
            overflow: hidden;
            animation: slideUpPhone 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes slideUpPhone {
            from {
                transform: translateY(100px) scale(0.9);
                opacity: 0;
            }

            to {
                transform: translateY(0) scale(1);
                opacity: 1;
            }
        }

        /* 小猫挂饰 (挂在手机外面) */
        .phone-charm {
            position: absolute;
            top: calc(50% - 301px);
            /* 与手机顶部对齐，高出1px */
            left: calc(50% - 165px);
            /* 相对于手机左侧 */
            width: 50px;
            height: auto;
            z-index: 100;
            transform-origin: top center;
            animation: swingCharm 2.5s ease-in-out infinite;
            pointer-events: none;
            filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
        }

        @keyframes swingCharm {

            0%,
            100% {
                transform: rotate(-12deg);
            }

            50% {
                transform: rotate(12deg);
            }
        }

        /* 顶部刘海和关闭键 */
        .phone-header {
            height: 40px;
            background: #fff0f5;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            padding: 0 15px;
            position: relative;
            flex-shrink: 0;
            border-bottom: 1px solid #ffeef2;
        }

        .phone-notch {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 22px;
            background: linear-gradient(180deg, #ffb7c5 0%, #ffc4d0 100%);
            border-bottom-left-radius: 12px;
            border-bottom-right-radius: 12px;
            box-shadow: 0 2px 4px rgba(255, 183, 197, 0.3);
        }

        .phone-close-btn {
            color: #ff8a9b;
            font-size: 22px;
            font-weight: bold;
            cursor: pointer;
            z-index: 10;
        }

        /* 聊天屏幕 */
        /* 聊天屏幕 */
        .phone-screen {
            flex: 1;
            background: #fff;
            padding: 15px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 15px;
            /* 内阴影让屏幕有嵌入感 */
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        /* 消息气泡通用 */
        .chat-msg {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            max-width: 100%;
        }

        .chat-msg.ai {
            align-self: flex-start;
            /* AI靠左 */
        }

        .chat-msg.user {
            align-self: flex-end;
            /* 用户靠右 */
            flex-direction: row-reverse;
            /* 头像在右边 */
        }

        .chat-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: 2px solid #ffb7c5;
            object-fit: cover;
            flex-shrink: 0;
        }

        .msg-bubble {
            padding: 10px 14px;
            border-radius: 18px;
            font-size: 14px;
            line-height: 1.4;
            word-break: break-all;
            max-width: 220px;
            position: relative;
        }

        /* 1. AI 气泡：浅蓝色背景 + 深灰字 */
        .msg-bubble.ai {
            background: #E1F5FE;
            /* 浅蓝 */
            color: #59474a;
            /* 深灰字 */
            border-bottom-left-radius: 4px;
            border: 1px solid #B3E5FC;
            /* 微微一点深蓝边框增加质感 */
        }

        /* 2. 用户气泡：淡粉色背景 + 深灰字 */
        .msg-bubble.user {
            background: #FFDEE9;
            /* 淡粉 */
            color: #59474a;
            /* 深灰字 */
            border-bottom-right-radius: 4px;
            border: 1px solid #FFB7C5;
        }

        /* 底部输入栏 */
        .phone-input-bar {
            height: 60px;
            background: #fff0f5;
            display: flex;
            align-items: center;
            padding: 0 12px 0 10px;
            gap: 6px;
            border-top: 2px solid #ffeef2;
            flex-shrink: 0;
        }

        .phone-input {
            flex: 1;
            height: 40px;
            border-radius: 20px;
            border: 2px solid #ffb7c5;
            padding: 0 15px;
            outline: none;
            font-size: 14px;
            color: #59474a;
        }

        .chat-tool-btn {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: transform 0.1s;
            color: white;
            flex-shrink: 0;
        }

        .chat-tool-btn:active {
            transform: scale(0.9);
        }

        /* 3. 召唤AI按钮：使用图片 (更具体的选择器覆盖全局样式) */
        .phone-input-bar .paw-btn {
            position: static !important;
            background: transparent url('https://i.postimg.cc/ZnkrHq1n/02.png') no-repeat center center !important;
            background-size: contain !important;
            border: none !important;
            width: 32px !important;
            height: 32px !important;
            max-width: none !important;
            max-height: none !important;
            right: auto !important;
            bottom: auto !important;
            transition: transform 0.2s;
        }

        .phone-input-bar .paw-btn:active {
            transform: scale(0.8) rotate(-10deg);
        }

        .send-btn {
            background: linear-gradient(90deg, #fd5392 0%, #ff6b81 100%);
        }

        /* ================= 日记本样式 (Diary Notebook) ================= */

        /* --- 日记本容器 (适配所有手机) --- */
        .diary-notebook-container {
            width: 100vw;
            height: calc(100dvh - 60px);
            height: calc(100vh - 60px);
            margin-top: 60px;
            margin-bottom: 10px;
            position: relative;
            perspective: 1500px;
            padding-bottom: env(safe-area-inset-bottom, 0);
        }

        @supports (height: 100dvh) {
            .diary-notebook-container {
                height: calc(100dvh - 60px);
            }
        }

        /* 笔记本主体 */
        .diary-notebook {
            width: 100%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .diary-notebook.closed {
            transform: rotateY(0deg) rotateX(0deg);
        }

        .diary-notebook.open {
            transform: rotateY(0deg) rotateX(0deg);
        }

        /* --- 顶部标签 (Tabs) --- */
        .diary-tabs-top {
            position: absolute;
            top: -39px;
            right: 10px;
            display: flex;
            gap: 3px;
            z-index: 20;
        }

        .diary-tab {
            width: 90px;
            height: 52px;
            border-radius: 8px 8px 0 0;
            cursor: pointer;
            position: relative;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
        }

        .diary-tab-calendar {
            background-image: url('diary/RJ07.png');
        }

        .diary-tab-write {
            background-image: url('diary/RJ08.png');
        }

        .diary-tab-settings {
            background-image: url('diary/RJ09.png');
        }

        /* --- 封面 (Front Cover) --- */
        .diary-cover {
            position: absolute;
            width: 100%;
            height: 100%;
            background-image: url('diary/RJ01.jpg');
            background-size: cover;
            background-position: center;
            border-radius: 0;
            box-shadow: inset 5px 0 10px rgba(0, 0, 0, 0.1), 5px 10px 20px rgba(0, 0, 0, 0.2);
            z-index: 10;
            transform-origin: left center;
            transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
            backface-visibility: hidden;
        }

        .diary-cover-content {
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: #fff;
        }

        .diary-notebook.open .diary-cover {
            transform: rotateY(-180deg);
        }

        /* --- 封底/内页容器 --- */
        .diary-back-cover {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #fff;
            border-radius: 0;
            box-shadow: inset 10px 0 20px rgba(0, 0, 0, 0.05), 5px 5px 15px rgba(0, 0, 0, 0.1);
            z-index: 5;
            overflow: hidden;
        }

        /* 纸张纹理 - 基础样式 */
        .diary-paper-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: transparent;
            z-index: 0;
        }

        /* 纹理覆盖层 - 从日期栏下方开始，上下缩减，默认隐藏，JS控制显示 */
        .diary-texture-layer {
            position: absolute;
            top: 95px;
            left: 10px;
            right: 20px;
            bottom: 80px;
            z-index: 1;
            pointer-events: none;
            display: none;
        }

        /* 纹理层显示状态 - 由JS添加show类 */
        .diary-texture-layer.show {
            display: block;
        }

        /* 格子纹理 */
        .diary-texture-layer.texture-grid {
            background-image:
                linear-gradient(#f0f0f0 1px, transparent 1px),
                linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
            background-size: 25px 25px;
        }

        /* 点阵纹理 */
        .diary-texture-layer.texture-dots {
            background-image: radial-gradient(circle, #d8d8d8 2px, transparent 2px);
            background-size: 22px 22px;
        }

        /* 横线纹理 - 匹配28px行高 */
        .diary-texture-layer.texture-lines {
            background-image: linear-gradient(transparent 27px, #f0f0f0 1px);
            background-size: 100% 28px;
        }

        /* 空白纹理 */
        .diary-texture-layer.texture-blank {
            background: transparent;
        }

        /* --- 内容区域 --- */
        .diary-content-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 2;
            padding: 15px;
            overflow-y: auto;
            display: none;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .diary-content-layer.active {
            display: block;
            opacity: 1;
        }

        /* 日历页去掉padding并锁住滚动 */
        #diary-page-calendar {
            padding: 0;
            overflow: hidden;
        }

        /* 写日记页 - 使用 RJ10.jpg 作为纸张背景，固定背景不滚动 */
        #diary-page-write {
            background: url('diary/RJ10.jpg') no-repeat center center;
            background-size: 100% 100%;
            padding-bottom: 30px;
            overflow: hidden;
        }

        /* 写日记页内部的纹理层 */
        .diary-write-texture-layer {
            position: absolute;
            top: 90px;
            left: 10px;
            right: 20px;
            bottom: 80px;
            z-index: 1;
            pointer-events: none;
        }

        /* 格子纹理 */
        .diary-write-texture-layer.texture-grid {
            background-image:
                linear-gradient(#e0e0e0 1px, transparent 1px),
                linear-gradient(90deg, #e0e0e0 1px, transparent 1px);
            background-size: 25px 25px;
        }

        /* 点阵纹理 */
        .diary-write-texture-layer.texture-dots {
            background-image: radial-gradient(circle, #e8e8e8 1.5px, transparent 1.5px);
            background-size: 20px 20px;
        }

        /* 横线纹理 - 匹配28px行高 */
        .diary-write-texture-layer.texture-lines {
            background-image: linear-gradient(transparent 27px, #e0e0e0 1px);
            background-size: 100% 28px;
        }

        /* 空白纹理 */
        .diary-write-texture-layer.texture-blank {
            background: transparent;
        }

        /* --- 1. 日历页样式 --- */
        .diary-calendar-page {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            position: relative;
        }

        /* RJ10背景图层 */
        .diary-calendar-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
        }

        .diary-calendar-bg img {
            width: 100%;
            height: 100%;
            object-fit: fill;
        }

        .diary-calendar-content {
            position: relative;
            z-index: 1;
            width: 100%;
            height: calc(100% - 60px);
            display: flex;
            flex-direction: column;
            padding: 15px 20px 10px 10px;
            overflow: hidden;
        }

        .diary-calendar-header {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 15px 0;
            font-size: 1.5rem;
            color: #333;
            font-weight: bold;
            letter-spacing: 2px;
            background: transparent;
        }

        .diary-nav-btn {
            cursor: pointer;
            font-size: 1.5rem;
            color: #555;
            padding: 0 25px;
            user-select: none;
            transition: transform 0.2s, color 0.2s;
        }

        .diary-nav-btn:hover {
            transform: scale(1.2);
            color: #000;
        }

        .diary-weekdays {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            background-color: #444;
            color: #ff9cb7;
        }

        .diary-weekday {
            text-align: center;
            padding: 8px 0;
            font-weight: 600;
            border-right: 1px solid #555;
        }

        .diary-weekday:last-child {
            border-right: none;
        }

        .diary-calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            border-left: 1px solid #000;
            border-top: 1px solid #000;
            flex: 1;
            overflow: hidden;
        }

        .diary-day-cell {
            min-height: 60px;
            border-right: 1px solid #000;
            border-bottom: 1px solid #000;
            position: relative;
            background-color: transparent;
            display: flex;
            flex-direction: column;
        }

        .diary-day-cell.empty {
            background-color: rgba(255, 192, 203, 0.3);
        }

        .diary-date-number {
            position: absolute;
            top: 5px;
            left: 8px;
            font-size: 12px;
            font-weight: bold;
            color: #333;
            pointer-events: none;
        }

        .diary-day-cell.today .diary-date-number {
            color: #fff;
            background-color: #ff618c;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0;
        }

        /* 返回封面按钮 */
        .diary-back-to-cover-btn {
            position: absolute;
            bottom: 25px;
            right: 20px;
            width: 35px;
            height: 35px;
            background: url('diary/RJ11.png') no-repeat center center;
            background-size: contain;
            cursor: pointer;
            z-index: 10;
            transition: transform 0.2s;
        }

        .diary-back-to-cover-btn:hover {
            transform: scale(1.1);
        }

        /* --- 2. 写日记样式 (核心书写区) --- */
        .diary-wrapper {
            position: relative;
            width: 100%;
            max-height: calc(100% - 130px);
            overflow-y: auto;
            font-family: 'ZCOOL KuaiLe', cursive;
            line-height: 28px;
            font-size: 16px;
            cursor: text;
            color: #5a4a3a;
            padding-right: 5px;
        }

        #diary-hidden-input {
            position: relative;
            width: 100%;
            min-height: 300px;
            opacity: 1;
            z-index: 2;
            font-family: 'ZCOOL KuaiLe', cursive;
            font-size: 16px;
            line-height: 28px;
            border: none;
            outline: none;
            resize: none;
            overflow-y: auto;
            padding: 0;
            margin: 0;
            white-space: pre-wrap;
            word-wrap: break-word;
            background: transparent;
            color: #5a4a3a;
            letter-spacing: 1px;
            caret-color: #ff6b8a;
        }

        #diary-display-text {
            display: none;
        }

        #diary-cursor-marker {
            display: none;
        }

        /* 铅笔 - 改为跟随光标位置（可选隐藏）*/
        #diary-pencil {
            display: none;
            width: 0;
            height: 20px;
        }

        /* 铅笔 */
        #diary-pencil {
            position: absolute;
            top: 0;
            left: 0;
            width: 13px;
            height: 13px;
            pointer-events: none;
            z-index: 10;
            transition: top 0.05s linear, left 0.05s linear;
            font-size: 13px;
            transform: translate(2px, -2px);
        }

        /* 书写时笔的动画 */
        .diary-writing-anim {
            animation: diary-writing-motion 0.12s ease-in-out infinite;
        }

        @keyframes diary-writing-motion {
            0% {
                transform: translate(2px, -2px) rotate(0deg) scale(1);
            }

            25% {
                transform: translate(3px, -1px) rotate(-3deg) scale(0.98);
            }

            50% {
                transform: translate(1px, -2px) rotate(-5deg) scale(1);
            }

            75% {
                transform: translate(3px, -2px) rotate(-2deg) scale(0.99);
            }

            100% {
                transform: translate(2px, -2px) rotate(0deg) scale(1);
            }
        }

        /* 保存按钮区域 */
        .diary-save-area {
            position: fixed;
            bottom: 33px;
            right: 20px;
            margin: 0;
            z-index: 100;
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .diary-btn-save {
            width: 30px;
            height: 30px;
            background: url('diary/RJ13.png') no-repeat center center;
            background-size: contain;
            border-radius: 0;
            border: none;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .diary-btn-save img {
            display: none;
        }

        .diary-btn-save:active {
            transform: scale(0.9);
        }

        /* 关书按钮 - 参照.diary-back-to-cover-btn */
        .diary-btn-close-book {
            width: 30px;
            height: 30px;
            background: url('diary/RJ11.png') no-repeat center center;
            background-size: contain;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .diary-btn-close-book:hover {
            transform: scale(1.1);
        }

        .diary-btn-close-book:active {
            transform: scale(0.9);
        }

        /* --- AI 回复区域 --- */
        .diary-ai-trigger {
            position: fixed;
            bottom: 33px;
            left: 20px;
            width: 33px;
            height: 33px;
            background: url('diary/RJ12.png') no-repeat center center;
            background-size: contain;
            border-radius: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 0;
            cursor: pointer;
            z-index: 100;
            transition: transform 0.2s;
        }

        .diary-ai-trigger:hover {
            transform: scale(1.1);
        }

        @keyframes diary-float-gentle {

            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-5px);
            }
        }

        /* AI 便签弹窗 - 遮罩层 */
        .diary-ai-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 200;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .diary-ai-modal-overlay.show {
            display: flex;
            opacity: 1;
        }

        /* 包裹层 - 包含拍立得头像+便签 */
        .diary-ai-note-wrapper {
            position: relative;
            width: 90%;
            max-width: 360px;
            padding-top: 50px;
            /* 给拍立得头像留空间 */
            animation: diary-note-float 0.3s ease-out;
        }

        @keyframes diary-note-float {
            from {
                transform: translateY(20px) scale(0.9);
                opacity: 0;
            }

            to {
                transform: translateY(0) scale(1);
                opacity: 1;
            }
        }

        /* 拍立得头像 - 参照日程页.polaroid-avatar */
        .diary-polaroid-avatar {
            position: absolute;
            top: 40px;
            left: 15px;
            background: white;
            padding: 4px 4px 15px 4px;
            box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
            transform: rotate(-8deg);
            z-index: 20;
        }

        .diary-polaroid-avatar img {
            width: 50px;
            height: 50px;
            object-fit: cover;
            display: block;
        }

        /* 便签主体 - 使用图片背景 */
        .diary-ai-note {
            width: 100%;
            min-height: 280px;
            padding: 20px 20px 25px 20px;
            position: relative;
            background-image: url('https://i.postimg.cc/VNJWk2Pc/011.png');
            background-size: 100% 100%;
            background-repeat: no-repeat;
            font-family: 'ZCOOL KuaiLe', sans-serif;
        }

        .diary-ai-modal-overlay.show .diary-ai-note {
            animation: diary-note-float 0.3s ease-out 0.1s both;
        }

        /* 标题胶囊 - 参照日程页#user-schedule-pill */
        .diary-ai-title-pill {
            position: absolute;
            top: 30px;
            left: 85px;
            background: #59474a;
            color: #ffb8cc;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: normal;
            z-index: 15;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            white-space: nowrap;
        }

        /* 按钮组 - 参照日程页.ai-btn-group */
        .diary-ai-btn-group {
            position: absolute;
            top: 28px;
            right: 40px;
            display: flex;
            gap: 4px;
            z-index: 15;
        }

        .diary-ai-circle-btn {
            width: 25px;
            height: 25px;
            border-radius: 50%;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            cursor: pointer;
            transition: transform 0.1s;
        }

        .diary-ai-circle-btn:active {
            transform: scale(0.9);
        }

        /* 回复按钮 - 粉色 */
        #diary-btn-ai-gen {
            background: #FFDEE9;
        }

        /* 语音按钮 - 浅绿 */
        #diary-btn-ai-play {
            background: #E0F2F1;
        }

        /* AI 内容滚动区 */
        .diary-ai-text-scroll-area {
            max-height: 180px;
            overflow-y: auto;
            padding: 8px 15px 10px 20px;
            margin-top: 45px;
            /* 给标题胶囊留空间 */
        }

        .diary-ai-text-scroll-area::-webkit-scrollbar {
            width: 4px;
        }

        .diary-ai-text-scroll-area::-webkit-scrollbar-track {
            background: transparent;
        }

        .diary-ai-text-scroll-area::-webkit-scrollbar-thumb {
            background: rgba(139, 69, 19, 0.3);
            border-radius: 2px;
        }

        .diary-ai-text-scroll-area p {
            margin: 0;
            font-size: 14px;
            color: #5d4037;
            line-height: 1.8;
            text-align: left;
        }

        /* 关闭按钮 - 隐藏，改用点击空白处关闭 */
        .diary-ai-note-close {
            display: none;
        }

        /* --- 3. 设置页 - 封面选择弹窗 --- */
        .diary-settings-hint {
            text-align: center;
            padding: 60px 20px;
            color: #888;
            font-size: 16px;
        }

        .diary-settings-hint-icon {
            font-size: 60px;
            margin-bottom: 20px;
            opacity: 0.6;
        }

        .diary-settings-hint-text {
            line-height: 1.8;
        }

        /* 封面选择弹窗 */
        .diary-cover-picker-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 300;
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .diary-cover-picker-overlay.show {
            display: flex;
            opacity: 1;
        }

        .diary-cover-picker-title {
            color: #fff;
            font-size: 18px;
            margin-bottom: 25px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        .diary-cover-carousel {
            width: 100%;
            height: 320px;
            display: flex;
            align-items: center;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            padding: 20px 0;
            scroll-behavior: smooth;
        }

        .diary-cover-carousel::-webkit-scrollbar {
            display: none;
        }

        .diary-cover-carousel-inner {
            display: flex;
            padding: 0 calc(50vw - 90px);
            gap: 20px;
        }

        .diary-cover-card {
            flex: 0 0 180px;
            height: 260px;
            border-radius: 12px;
            background-size: cover;
            background-position: center;
            scroll-snap-align: center;
            transition: transform 0.3s, box-shadow 0.3s;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
            position: relative;
            cursor: pointer;
        }

        .diary-cover-card.active {
            transform: scale(1.15);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
        }

        .diary-cover-picker-actions {
            margin-top: 30px;
            display: flex;
            gap: 15px;
        }

        .diary-btn-cover-action {
            padding: 10px 25px;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            transition: transform 0.2s;
            border: none;
        }

        .diary-btn-cover-action:active {
            transform: scale(0.95);
        }

        .diary-btn-save-cover {
            background: #fbc2eb;
            color: #fff;
        }

        .diary-btn-cancel-cover {
            background: #fff;
            color: #888;
        }

        /* 滑动指示器 */
        .diary-carousel-dots {
            display: flex;
            gap: 8px;
            margin-top: 20px;
        }

        .diary-carousel-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.4);
            transition: background 0.3s, transform 0.3s;
        }

        .diary-carousel-dot.active {
            background: #fbc2eb;
            transform: scale(1.3);
        }

        /* 日期选择弹窗 */
        .diary-date-picker-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 400;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .diary-date-picker-overlay.show {
            display: flex;
            opacity: 1;
        }

        .diary-date-picker-modal {
            background: #fff;
            border-radius: 15px;
            padding: 25px;
            width: 280px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            transform: scale(0.9);
            transition: transform 0.3s;
        }

        .diary-date-picker-overlay.show .diary-date-picker-modal {
            transform: scale(1);
        }

        .diary-date-picker-title {
            text-align: center;
            font-size: 16px;
            font-weight: bold;
            color: #333;
            margin-bottom: 20px;
        }

        .diary-date-picker-row {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin-bottom: 20px;
        }

        .diary-date-picker-select {
            padding: 8px 5px;
            border: 2px solid #fbc2eb;
            border-radius: 8px;
            font-size: 13px;
            outline: none;
            background: #fff;
            color: #333;
            cursor: pointer;
            width: 75px;
        }

        .diary-date-picker-select:focus {
            border-color: #ff9cb7;
        }

        .diary-date-picker-actions {
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        .diary-btn-date-action {
            padding: 10px 25px;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            border: none;
            transition: transform 0.2s;
        }

        .diary-btn-date-action:active {
            transform: scale(0.95);
        }

        .diary-btn-date-confirm {
            background: #fbc2eb;
            color: #fff;
        }

        .diary-btn-date-cancel {
            background: #f0f0f0;
            color: #666;
        }

        /* 日记日期栏样式 */
        .diary-date-bar {
            margin-bottom: 12px;
            border-bottom: 2px dashed #e0d4c8;
            padding-top: 10px;
            padding-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .diary-date-text {
            font-weight: bold;
            color: #8d7b6a;
            cursor: pointer;
            padding: 5px 10px;
            border-radius: 5px;
            transition: background 0.2s;
        }

        .diary-date-text:hover {
            background: rgba(251, 194, 235, 0.2);
        }

        /* 天气图标 */
        .diary-weather-icon {
            font-size: 1.6em;
            cursor: pointer;
            padding: 5px;
            border-radius: 5px;
            transition: background 0.2s;
        }

        .diary-weather-icon:hover {
            background: rgba(251, 194, 235, 0.2);
        }

        /* 天气选择弹窗 */
        .diary-weather-picker-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 400;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .diary-weather-picker-overlay.show {
            display: flex;
            opacity: 1;
        }

        .diary-weather-picker-modal {
            background: #fff;
            border-radius: 15px;
            padding: 20px;
            width: 320px;
            max-width: 90vw;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            transform: scale(0.9);
            transition: transform 0.3s;
            overflow: hidden;
        }

        .diary-weather-picker-overlay.show .diary-weather-picker-modal {
            transform: scale(1);
        }

        .diary-weather-picker-title {
            text-align: center;
            font-size: 16px;
            font-weight: bold;
            color: #333;
            margin-bottom: 15px;
        }

        .diary-weather-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 8px;
            margin-bottom: 15px;
            width: 100%;
        }

        .diary-weather-option {
            font-size: 22px;
            text-align: center;
            padding: 8px 4px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s, transform 0.2s;
        }

        .diary-weather-option:hover {
            background: rgba(251, 194, 235, 0.3);
            transform: scale(1.1);
        }

        .diary-weather-option.selected {
            background: #fbc2eb;
        }

        /* --- 纹理选择按钮 (爱心) --- */
        .diary-texture-btn {
            font-size: 1.2em;
            cursor: pointer;
            padding: 3px 8px;
            border-radius: 5px;
            transition: transform 0.2s, background 0.2s;
            color: #ff6b8a;
        }

        .diary-texture-btn:hover {
            background: rgba(255, 183, 197, 0.2);
            transform: scale(1.1);
        }

        /* --- 纹理选择弹窗 --- */
        .diary-texture-picker-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 400;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .diary-texture-picker-overlay.show {
            display: flex;
            opacity: 1;
        }

        .diary-texture-picker-modal {
            background: #fff;
            border-radius: 15px;
            padding: 20px;
            width: 280px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            transform: scale(0.9);
            transition: transform 0.3s;
        }

        .diary-texture-picker-overlay.show .diary-texture-picker-modal {
            transform: scale(1);
        }

        .diary-texture-picker-title {
            text-align: center;
            font-size: 16px;
            font-weight: bold;
            color: #333;
            margin-bottom: 15px;
        }

        .diary-texture-options {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-bottom: 15px;
        }

        .diary-texture-option {
            height: 70px;
            border-radius: 10px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            border: 2px solid #eee;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-size: 12px;
            color: #666;
            gap: 5px;
        }

        .diary-texture-option:hover {
            transform: scale(1.02);
            border-color: #ffb7c5;
        }

        .diary-texture-option.selected {
            border-color: #fbc2eb;
            box-shadow: 0 0 0 2px rgba(251, 194, 235, 0.4);
        }

        .diary-texture-option .texture-icon {
            font-size: 24px;
        }

        /* 纹理预览 */
        .diary-texture-option.opt-grid {
            background-image:
                linear-gradient(#e8e8e8 1px, transparent 1px),
                linear-gradient(90deg, #e8e8e8 1px, transparent 1px);
            background-size: 12px 12px;
        }

        .diary-texture-option.opt-dots {
            background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
            background-size: 8px 8px;
        }

        .diary-texture-option.opt-lines {
            background-image: linear-gradient(transparent 11px, #e8e8e8 1px);
            background-size: 100% 12px;
        }

        .diary-texture-option.opt-blank {
            background: #fcfcfc;
        }

        /* ========================================
           心情贴纸选择弹窗 (Mood Sticker Picker)
        ======================================== */
        .diary-mood-picker-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 500;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .diary-mood-picker-overlay.show {
            display: flex;
            opacity: 1;
        }

        .diary-mood-picker-modal {
            background: #fff;
            border-radius: 20px;
            padding: 25px 20px;
            width: 320px;
            max-width: 90vw;
            box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
            transform: scale(0.9);
            transition: transform 0.3s;
        }

        .diary-mood-picker-overlay.show .diary-mood-picker-modal {
            transform: scale(1);
        }

        .diary-mood-picker-title {
            text-align: center;
            font-size: 18px;
            font-weight: bold;
            color: #ff6b8a;
            margin-bottom: 20px;
        }

        .diary-mood-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }

        .diary-mood-item {
            width: 100%;
            aspect-ratio: 1;
            border-radius: 12px;
            border: 3px solid transparent;
            cursor: pointer;
            transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
            overflow: hidden;
            background: #fef6f8;
        }

        .diary-mood-item img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .diary-mood-item:hover {
            transform: scale(1.08);
            border-color: #fbc2eb;
        }

        .diary-mood-item.selected {
            border-color: #ff6b8a;
            box-shadow: 0 3px 12px rgba(255, 107, 138, 0.4);
        }

        .diary-mood-picker-actions {
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        .diary-btn-mood-skip {
            padding: 10px 25px;
            border-radius: 10px;
            font-size: 14px;
            cursor: pointer;
            border: none;
            background: #f0f0f0;
            color: #888;
            transition: transform 0.2s;
        }

        .diary-btn-mood-confirm {
            padding: 10px 30px;
            border-radius: 10px;
            font-size: 14px;
            cursor: pointer;
            border: none;
            background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
            color: #fff;
            font-weight: bold;
            transition: transform 0.2s;
        }

        .diary-btn-mood-skip:active,
        .diary-btn-mood-confirm:active {
            transform: scale(0.95);
        }

        /* ========================================
           邮戳章选择弹窗 (Stamp Picker)
        ======================================== */
        .diary-stamp-picker-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 500;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .diary-stamp-picker-overlay.show {
            display: flex;
            opacity: 1;
        }

        .diary-stamp-picker-modal {
            background: #fff;
            border-radius: 20px;
            padding: 25px 20px;
            width: 300px;
            max-width: 90vw;
            box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
            transform: scale(0.9);
            transition: transform 0.3s;
            text-align: center;
        }

        .diary-stamp-picker-overlay.show .diary-stamp-picker-modal {
            transform: scale(1);
        }

        .diary-stamp-picker-title {
            font-size: 18px;
            font-weight: bold;
            color: #ff6b8a;
            margin-bottom: 15px;
        }

        .diary-stamp-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 15px;
        }

        .diary-stamp-item {
            width: 100%;
            aspect-ratio: 1;
            border-radius: 10px;
            border: 3px solid transparent;
            cursor: pointer;
            transition: transform 0.2s, border-color 0.2s;
            overflow: hidden;
            background: #fef6f8;
        }

        .diary-stamp-item img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .diary-stamp-item:hover {
            transform: scale(1.08);
            border-color: #ffb7c5;
        }

        .diary-stamp-item.selected {
            border-color: #ff6b8a;
            box-shadow: 0 3px 12px rgba(255, 107, 138, 0.4);
        }

        .diary-stamp-picker-hint {
            font-size: 12px;
            color: #999;
            margin-bottom: 15px;
        }

        .diary-btn-stamp-confirm {
            padding: 10px 40px;
            border-radius: 10px;
            font-size: 14px;
            cursor: pointer;
            border: none;
            background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
            color: #fff;
            font-weight: bold;
            transition: transform 0.2s;
        }

        .diary-btn-stamp-confirm:active {
            transform: scale(0.95);
        }

        /* ========================================
           邮戳章选择按钮 (左下角)
        ======================================== */
        .diary-stamp-selector-btn {
            position: absolute;
            bottom: 30px;
            left: 15px;
            width: 36px;
            height: 36px;
            cursor: pointer;
            z-index: 50;
            transition: transform 0.2s;
            opacity: 0.85;
        }

        .diary-stamp-selector-btn:hover {
            transform: scale(1.1);
            opacity: 1;
        }

        .diary-stamp-selector-btn img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* ========================================
           日历格子中的贴纸和邮戳章
        ======================================== */
        .diary-cell-mood {
            position: absolute;
            top: 45%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 40px;
            height: 40px;
            pointer-events: none;
            z-index: 5;
        }

        .diary-cell-mood img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .diary-cell-stamp {
            position: absolute;
            bottom: 2px;
            right: 2px;
            width: 30px;
            height: 30px;
            pointer-events: none;
            z-index: 6;
            opacity: 0.9;
        }

        .diary-cell-stamp img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* ================= 日记AI生图 - 拍立得插画样式 ================= */
        .diary-polaroid-frame {
            background: #fff;
            border: 3px solid #f5e6e8;
            border-radius: 4px;
            padding: 8px 8px 25px 8px;
            margin: 0 auto 15px auto;
            max-width: 200px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 182, 193, 0.3);
            position: relative;
            transform: rotate(-2deg);
            transition: all 0.3s ease;
        }

        .diary-polaroid-frame:hover {
            transform: rotate(0deg) scale(1.02);
        }

        .polaroid-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 30px 10px;
            background: linear-gradient(135deg, #ffeef2 0%, #fff5f7 100%);
            border-radius: 2px;
            min-height: 120px;
        }

        .polaroid-loading-icon {
            font-size: 32px;
            animation: paintBounce 1s ease-in-out infinite;
        }

        @keyframes paintBounce {

            0%,
            100% {
                transform: translateY(0) rotate(0deg);
            }

            50% {
                transform: translateY(-8px) rotate(10deg);
            }
        }

        .polaroid-loading-text {
            font-size: 12px;
            color: #e8758f;
            margin-top: 8px;
            font-weight: 500;
        }

        .polaroid-loading-text::after {
            content: '';
            animation: loadingDots 1.5s infinite;
        }

        @keyframes loadingDots {
            0% {
                content: '.';
            }

            33% {
                content: '..';
            }

            66% {
                content: '...';
            }

            100% {
                content: '.';
            }
        }

        .polaroid-image {
            width: 100%;
            aspect-ratio: 1 / 1;
            object-fit: cover;
            border-radius: 2px;
            display: none;
            background: #fdf5f7;
        }

        .polaroid-image.loaded {
            display: block;
        }

        .polaroid-caption {
            position: absolute;
            bottom: 5px;
            left: 8px;
            right: 8px;
            font-size: 10px;
            color: #b08a8e;
            text-align: center;
            font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ================= 4. 新增：日记插画交互样式 ================= */

        /* 1. 全屏看图弹窗 (遮罩层) - 改为悬浮在便签内 */
        .diary-image-modal-overlay {
            display: none;
            /* 默认隐藏 */
            position: absolute;
            /* 改为 absolute */
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: transparent;
            /* 透明背景 */
            z-index: 10;
            justify-content: center;
            align-items: center;
            /* backdrop-filter: blur(5px); 移除模糊 */
            opacity: 0;
            transition: opacity 0.3s ease;
            border-radius: 12px;
        }

        .diary-image-modal-overlay.show {
            display: flex;
            opacity: 1;
            justify-content: flex-end;
            /* 偏右 */
            align-items: center;
            /* 垂直居中 */
            padding-right: 15px;
            /* 右边距 */
        }

        /* 2. 大尺寸拍立得相框 */
        .diary-image-polaroid {
            background: #fff;
            width: 70%;
            max-width: 350px;
            padding: 15px 15px 50px 15px;
            /* 底部留白给文字 */
            box-shadow: 6px 7px 5px 0px rgb(0 0 0 / 17%);
            transform: rotate(0deg) scale(0.9);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            border-radius: 2px;
            position: relative;
            margin-top: 150px;
        }

        .diary-image-modal-overlay.show .diary-image-polaroid {
            transform: rotate(0deg) scale(1);
            /* 弹窗出现时的动画 */
        }

        /* 图片本体 */
        .diary-image-main {
            width: 100%;
            aspect-ratio: 1;
            /* 强制正方形 */
            object-fit: cover;
            background: #f0f0f0;
            border: 1px solid #eee;
            display: block;
        }

        /* 底部手写备注 */
        .diary-image-caption {
            position: absolute;
            bottom: 10px;
            left: 0;
            width: 100%;
            text-align: center;
            font-family: 'ZCOOL KuaiLe', cursive;
            font-size: 18px;
            color: #444;
            transform: rotate(1deg);
        }

        /* 图片弹窗的加载提示 */
        .diary-image-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            aspect-ratio: 1;
            background: linear-gradient(135deg, #ffeef2 0%, #fff5f7 100%);
        }

        .diary-image-loading-icon {
            font-size: 48px;
            margin-bottom: 10px;
        }

        .diary-image-loading-text {
            font-size: 14px;
            color: #e8758f;
        }

        /* 图片弹窗关闭按钮 */
        .diary-image-close-btn {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: #666;
            cursor: pointer;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            transition: transform 0.2s;
        }

        .diary-image-close-btn:hover {
            transform: scale(1.1);
        }

        /* 3. 头像 Loading 特效 (生图时显示) */
        .diary-avatar-loading {
            position: absolute;
            top: -4px;
            left: -4px;
            right: -4px;
            bottom: -4px;
            border-radius: 50%;
            border: 3px solid #ffb7c5;
            border-top-color: transparent;
            animation: avatarSpin 1s linear infinite;
            box-shadow: 0 0 10px rgba(255, 183, 197, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .avatar-loading-spinner {
            width: 100%;
            height: 100%;
        }

        @keyframes avatarSpin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        /* 头像就绪图标 */
        .diary-avatar-ready {
            position: absolute;
            bottom: -5px;
            right: -5px;
            width: 22px;
            height: 22px;
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
            animation: readyPulse 2s infinite;
        }

        @keyframes readyPulse {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.1);
            }
        }

        /* 4. 顶部轻提示 (Toast) - 画好后弹出 */
        .diary-toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%) translateY(-100%);
            background: rgba(255, 255, 255, 0.95);
            padding: 10px 20px;
            border-radius: 30px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 8px;
            z-index: 10000;
            opacity: 0;
            transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
            border: 1px solid #ffdeeb;
            color: #59474a;
            font-size: 14px;
            font-weight: bold;
            pointer-events: none;
        }

        .diary-toast.show {
            transform: translateX(-50%) translateY(0);
            /* 滑下来 */
            opacity: 1;
        }

        /* ================= 7. 书信页 (Letter Layer) 样式 ================= */

        /* 书信页整体背景 - 使用02.jpg背景图 */
        #letter-layer {
            background-image: url('shuxin/02.jpg');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            min-height: 100vh;
            position: relative;
            overflow: hidden;
        }

        /* 氛围光遮罩 - 关灯时只对背景变暗，保留灯光区域 */
        .letter-ambient-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle 200px at calc(100% - 60px) 120px,
                    transparent 0%,
                    transparent 20%,
                    rgba(255, 200, 120, 0.1) 35%,
                    rgba(255, 180, 100, 0.06) 45%,
                    rgba(15, 10, 8, 0.75) 65%,
                    rgba(15, 10, 8, 0.85) 100%);
            z-index: 100;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.8s ease;
        }

        .letter-ambient-overlay.lamp-off {
            opacity: 1;
        }

        /* 暖色光晕效果 - 从灯泡位置发出 */
        .letter-warm-glow {
            position: absolute;
            top: 130px;
            right: 40px;
            width: 260px;
            height: 260px;
            background: radial-gradient(circle at 50% 0%,
                    rgba(255, 220, 150, 0.5) 0%,
                    rgba(255, 200, 120, 0.35) 15%,
                    rgba(255, 180, 100, 0.2) 30%,
                    rgba(255, 160, 80, 0.1) 50%,
                    rgba(255, 140, 60, 0.03) 70%,
                    transparent 100%);
            filter: blur(25px);
            animation: glowPulse 3s ease-in-out infinite;
            transform-origin: top center;
        }

        @keyframes glowPulse {

            0%,
            100% {
                transform: scale(1);
                opacity: 0.9;
            }

            50% {
                transform: scale(1.08);
                opacity: 1;
            }
        }

        /* 顶部功能按钮组 - 灯的左侧 */
        .letter-top-btns {
            position: absolute;
            top: 13px;
            right: 145px;
            z-index: 150;
            display: flex;
            flex-direction: row;
            gap: 8px;
            align-items: flex-start;
        }

        .letter-top-btn {
            width: 50px;
            height: 50px;
            cursor: pointer;
            transition: transform 0.2s ease;
            -webkit-tap-highlight-color: transparent;
        }

        .letter-top-btn:active {
            transform: scale(0.9);
        }

        .letter-top-btn img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* 吊灯容器 - 右上角悬挂 */
        .letter-lamp-btn {
            position: absolute;
            top: 0;
            right: 20px;
            z-index: 150;
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            user-select: none;
            -webkit-tap-highlight-color: transparent;
        }

        /* 灯罩图片 - 顶部紧贴屏幕顶部 */
        .lamp-shade {
            width: 100px;
            height: auto;
            position: relative;
            z-index: 3;
            transition: transform 0.3s ease;
            margin-top: -5px;
        }

        .lamp-shade:active {
            transform: scale(0.95);
        }

        /* 灯泡 - 倒置悬挂在灯罩下方 */
        .lamp-bulb {
            width: 50px;
            height: 55px;
            position: relative;
            margin-top: -30px;
            z-index: 2;
            transition: all 0.3s ease;
        }

        .lamp-bulb-svg {
            width: 100%;
            height: 100%;
        }

        /* 灯泡玻璃 - 默认亮着 */
        .bulb-glass {
            fill: #fff8e8;
            stroke: #e8d8a0;
            stroke-width: 1.5;
            transition: all 0.5s ease;
        }

        /* 亮灯状态 */
        .lamp-bulb.lamp-on .bulb-glass {
            fill: #fff4d0;
        }

        /* 灭灯状态 */
        .lamp-bulb.lamp-off .bulb-glass {
            fill: #d8c8b8;
            stroke: #b8a898;
            filter: none;
        }

        /* 灯泡底座 */
        .bulb-base {
            fill: #c0a070;
            stroke: #a08860;
            stroke-width: 0.5;
        }

        /* 灯丝 */
        .bulb-filament {
            stroke: #ffb040;
            stroke-width: 2;
            fill: none;
            stroke-linecap: round;
            transition: all 0.5s ease;
        }

        .lamp-bulb.lamp-on .bulb-filament {
            stroke: #ffdd66;
            animation: filamentGlow 1.5s ease-in-out infinite;
        }

        .lamp-bulb.lamp-off .bulb-filament {
            stroke: #8a7a70;
            filter: none;
        }

        @keyframes filamentGlow {

            0%,
            100% {
                opacity: 0.85;
            }

            50% {
                opacity: 1;
            }
        }

        /* 灯泡下方的光晕 */
        .lamp-glow-ring {
            position: absolute;
            bottom: -30px;
            left: 50%;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: radial-gradient(circle,
                    rgba(255, 220, 150, 0.6) 0%,
                    rgba(255, 200, 120, 0.3) 40%,
                    transparent 70%);
            transform: translateX(-50%);
            opacity: 0;
            transition: opacity 0.5s ease;
            pointer-events: none;
            z-index: 1;
        }

        .lamp-bulb.lamp-on .lamp-glow-ring {
            opacity: 1;
            animation: glowRingPulse 2s ease-in-out infinite;
        }

        @keyframes glowRingPulse {

            0%,
            100% {
                transform: translateX(-50%) scale(1);
            }

            50% {
                transform: translateX(-50%) scale(1.15);
            }
        }

        /* 灯泡标签 - 在整个灯下方 */
        .lamp-label {
            margin-top: 8px;
            font-size: 12px;
            color: #c08878;
            font-weight: bold;
            text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
            transition: all 0.3s ease;
            z-index: 4;
        }

        .letter-lamp-btn:hover .lamp-label {
            color: #a06858;
        }

        .lamp-bulb.lamp-off~.lamp-label {
            color: #ffcc88;
            text-shadow: 0 0 10px rgba(255, 200, 120, 0.8);
        }

        /* ================= 8. 新版书信功能样式 ================= */

        /* 书信内容容器 - 全屏覆盖 */
        .letter-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 300;
            display: flex;
            flex-direction: column;
        }

        /* 信纸背景图 */
        .letter-paper-bg {
            position: absolute;
            top: 120px;
            left: 0;
            width: 100%;
            height: auto;
            min-height: 70%;
            object-fit: cover;
            object-position: top center;
            z-index: 1;
            pointer-events: none;
        }

        /* 1. 信纸选择弹窗 */
        .stationery-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .stationery-modal-overlay.show {
            opacity: 1;
        }

        .stationery-modal {
            background: #fff;
            width: 85%;
            max-width: 320px;
            border-radius: 16px;
            padding: 20px;
            text-align: center;
            transform: scale(0.9);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .stationery-modal-overlay.show .stationery-modal {
            transform: scale(1);
        }

        .stationery-title {
            font-size: 18px;
            font-weight: bold;
            color: #59474a;
            margin-bottom: 20px;
        }

        .stationery-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .stationery-option {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            gap: 8px;
            transition: transform 0.2s;
        }

        .stationery-option:active {
            transform: scale(0.95);
        }

        /* 信纸预览图 (使用img) */
        .stationery-preview-img {
            width: 100%;
            aspect-ratio: 3/4;
            object-fit: cover;
            border-radius: 8px;
            border: 2px solid #eee;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            transition: border-color 0.2s, transform 0.2s;
        }

        .stationery-option:hover .stationery-preview-img {
            border-color: #ff9a9e;
            transform: scale(1.02);
        }

        .stationery-option span {
            font-size: 14px;
            color: #666;
        }

        .stationery-close {
            color: #999;
            font-size: 14px;
            cursor: pointer;
            margin-top: 10px;
        }

        /* 2. 书写区 - 可滚动 */
        .letter-paper-area {
            position: relative;
            z-index: 2;
            flex: 1;
            overflow-y: auto;
            padding: 220px 60px 100px 70px;
            animation: fadeIn 0.5s ease-out;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        .letter-paper-content {
            position: relative;
            width: 100%;
            min-height: 100%;
        }

        /* 输入框 & 镜像层 */
        .letter-write-textarea,
        .letter-write-mirror {
            width: 100%;
            height: 220px;
            min-height: 330px;
            background: transparent;
            border: none;
            outline: none;
            font-size: 14px;
            line-height: 1.8;
            color: #777;
            font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
            resize: none;
            padding: 0;
            margin: 0;
            word-wrap: break-word;
            white-space: pre-wrap;
            overflow-wrap: break-word;
        }

        .letter-write-textarea {
            position: relative;
            z-index: 2;
            color: #777;
        }

        .letter-write-mirror {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 1;
            visibility: hidden;
            pointer-events: none;
        }

        /* 3. 羽毛笔动效 */
        .feather-pen-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            min-height: 330px;
            pointer-events: none;
            z-index: 10;
            overflow: visible;
        }

        .letter-feather-pen {
            position: absolute;
            width: 30px;
            height: auto;
            top: 0;
            left: 0;
            transform-origin: 100% 100%;
            transition: top 0.1s ease-out, left 0.1s ease-out;
            pointer-events: none;
        }

        /* 书写动画 */
        .letter-feather-pen.writing {
            animation: writeShake 0.2s infinite;
        }

        @keyframes writeShake {
            0% {
                transform: rotate(0deg) translateY(0);
            }

            25% {
                transform: rotate(-2deg) translateY(-2px);
            }

            50% {
                transform: rotate(0deg) translateY(0);
            }

            75% {
                transform: rotate(2deg) translateY(-1px);
            }

            100% {
                transform: rotate(0deg) translateY(0);
            }
        }

        /* 按钮区 - 固定底部 */
        .letter-write-actions {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            padding: 15px;
            display: flex;
            justify-content: center;
            gap: 15px;
            z-index: 10;
            background: transparent;
        }

        .letter-action-btn {
            padding: 10px 24px;
            border: none;
            border-radius: 20px;
            font-size: 15px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            transition: transform 0.2s;
        }

        .letter-action-btn:active {
            transform: scale(0.95);
        }

        .btn-send {
            background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
            color: #fff;
        }

        .btn-clear {
            background: linear-gradient(135deg, #ffcccc 0%, #ffa3bd 100%);
            color: #fff;
        }

        .btn-close {
            background: #fff;
            color: #999;
        }

        /* 信纸飞走动画 - 只对信纸部分生效 */
        @keyframes letterFlyAway {
            0% {
                transform: scale(1) translateY(0);
                opacity: 1;
            }

            40% {
                transform: scale(0.9) translateY(-20px);
                opacity: 1;
            }

            100% {
                transform: scale(0.3) translate(100px, -250px) rotate(15deg);
                opacity: 0;
            }
        }

        .letter-container.sending .letter-paper-bg,
        .letter-container.sending .letter-paper-area {
            animation: letterFlyAway 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }

        .letter-container.sending .letter-write-actions {
            opacity: 0;
            transition: opacity 0.3s;
        }

        .letter-container.sending {
            pointer-events: none;
        }

        /* 等待回信覆盖层 */
        .letter-waiting-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 500;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }

        .waiting-content {
            text-align: center;
            color: #fff;
        }

        .waiting-icon {
            font-size: 60px;
            margin-bottom: 20px;
            animation: floatIcon 2s ease-in-out infinite;
        }

        @keyframes floatIcon {

            0%,
            100% {
                transform: translateY(0) rotate(-5deg);
            }

            50% {
                transform: translateY(-15px) rotate(5deg);
            }
        }

        .waiting-text {
            font-size: 18px;
            color: #ffeedd;
            letter-spacing: 2px;
        }

        .waiting-dots {
            animation: dotsAnimation 1.5s infinite;
        }

        @keyframes dotsAnimation {
            0% {
                content: '.';
            }

            33% {
                opacity: 0.5;
            }

            66% {
                opacity: 0.8;
            }

            100% {
                opacity: 1;
            }
        }

        /* ================= 8. 信纸选择滑块弹窗 ================= */

        .stationery-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .stationery-modal-overlay.show {
            opacity: 1;
        }

        .stationery-modal-title {
            color: #fff;
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 25px;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .stationery-slider-container {
            width: 100%;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        .stationery-slider-container::-webkit-scrollbar {
            display: none;
        }

        .stationery-slider {
            display: flex;
            padding: 0 calc(50% - 70px);
            gap: 15px;
            min-height: 280px;
            align-items: center;
        }

        .stationery-item {
            flex: 0 0 140px;
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            scroll-snap-align: center;
            transition: transform 0.3s ease;
        }

        .stationery-item.active {
            transform: scale(1.15);
        }

        .stationery-item:not(.active) {
            transform: scale(0.85);
            opacity: 0.7;
        }

        .stationery-img {
            width: 130px;
            height: 180px;
            border-radius: 8px;
            object-fit: cover;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
            transition: box-shadow 0.3s ease;
        }

        .stationery-item.active .stationery-img {
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
        }

        .stationery-name {
            font-size: 14px;
            color: #fff;
            text-align: center;
        }

        /* ================= 9. 角色选择弹窗 ================= */


        /* 收信人提示条 */
        .letter-recipient-bar {
            position: absolute;
            top: 75px;
            left: 55px;
            z-index: 150;
            font-size: 14px;
            color: #8b7355;
            white-space: nowrap;
        }

        .letter-recipient-bar strong {
            color: #6b5344;
            font-weight: bold;
        }

        /* 角色弹窗遮罩 */
        .character-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .character-modal-overlay.show {
            opacity: 1;
        }

        /* 角色弹窗 */
        .character-modal {
            background: #fff;
            width: 85%;
            max-width: 340px;
            max-height: 70vh;
            border-radius: 16px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            transform: scale(0.9);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .character-modal-overlay.show .character-modal {
            transform: scale(1);
        }

        .character-modal-title {
            font-size: 18px;
            font-weight: bold;
            color: #59474a;
            text-align: center;
            margin-bottom: 15px;
        }

        /* 角色列表 */
        .character-list {
            flex: 1;
            overflow-y: auto;
            max-height: 300px;
            margin-bottom: 15px;
        }

        .character-item {
            display: flex;
            align-items: center;
            padding: 12px;
            border-radius: 10px;
            margin-bottom: 8px;
            background: #fef8f8;
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
        }

        .character-item:hover {
            background: #fff0f5;
            border-color: #ffc0cb;
        }

        .character-item.selected {
            background: #fff0f5;
            border-color: #ff9a9e;
        }

        .char-main {
            display: flex;
            align-items: center;
            flex: 1;
            min-width: 0;
        }

        .char-actions {
            display: flex;
            gap: 8px;
            margin-left: 10px;
            flex-shrink: 0;
        }

        .char-action-btn {
            font-size: 16px;
            cursor: pointer;
            opacity: 0.6;
            transition: opacity 0.2s, transform 0.2s;
        }

        .char-action-btn:hover {
            opacity: 1;
            transform: scale(1.1);
        }

        .char-avatar-placeholder {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            margin-right: 12px;
            flex-shrink: 0;
        }

        .char-info {
            flex: 1;
            overflow: hidden;
        }

        .char-name {
            font-size: 15px;
            font-weight: bold;
            color: #59474a;
            margin-bottom: 2px;
        }

        .char-desc {
            font-size: 12px;
            color: #999;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* 添加角色表单 */
        .add-character-form {
            background: #fef8f8;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 15px;
        }

        .char-input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ffe0e6;
            border-radius: 8px;
            font-size: 14px;
            margin-bottom: 10px;
            outline: none;
            transition: border-color 0.2s;
        }

        .char-input:focus {
            border-color: #ffb6c1;
        }

        .char-form-btns {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .char-btn {
            padding: 8px 16px;
            border: none;
            border-radius: 15px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-cancel {
            background: #f0f0f0;
            color: #666;
        }

        .btn-confirm {
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
            color: #fff;
        }

        /* 弹窗底部操作 */
        .character-modal-actions {
            display: flex;
            justify-content: space-between;
            gap: 10px;
        }

        .add-char-btn {
            flex: 1;
            text-align: center;
            padding: 10px;
            background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
            color: #fff;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            transition: transform 0.2s;
        }

        .add-char-btn:active {
            transform: scale(0.95);
        }

        .close-char-btn {
            padding: 10px 20px;
            color: #999;
            cursor: pointer;
            font-size: 14px;
        }

        .empty-char-hint {
            text-align: center;
            color: #ccc;
            padding: 30px;
            font-size: 14px;
        }

        /* 信封弹窗遮罩 - 全屏透明 */
        .envelope-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .envelope-modal-overlay.show {
            opacity: 1;
        }

        /* 标题 */
        .envelope-modal-title {
            color: #fff;
            font-size: 18px;
            margin-bottom: 25px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        /* 信封滑块容器 - 仿日记本封面选择 */
        .envelope-slider-container {
            width: 100%;
            height: 180px;
            display: flex;
            align-items: center;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            padding: 20px 0;
            scroll-behavior: smooth;
        }

        .envelope-slider-container::-webkit-scrollbar {
            display: none;
        }

        .envelope-slider {
            display: flex;
            padding: 0 calc(50% - 55px);
            gap: 10px;
            min-height: 160px;
            align-items: center;
        }

        /* 单个信封 */
        .envelope-item {
            flex: 0 0 110px;
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            scroll-snap-align: center;
            transition: transform 0.3s ease;
        }

        .envelope-item:active {
            transform: scale(0.92);
        }

        .envelope-item.active {
            transform: scale(1.25);
        }

        .envelope-item:not(.active) {
            transform: scale(0.85);
            opacity: 0.7;
        }

        .envelope-icon {
            width: 100px;
            height: 75px;
            border-radius: 8px;
            position: relative;
            margin-bottom: 10px;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            overflow: hidden;
        }

        .envelope-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .envelope-item.active .envelope-icon {
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
        }

        /* ===== 信封选择器样式 ===== */

        .envelope-selector {
            margin: 15px 0;
        }

        .envelope-selector-label {
            font-size: 13px;
            color: #666;
            margin-bottom: 10px;
        }

        .envelope-options {
            display: flex;
            gap: 8px;
            justify-content: space-between;
        }

        .envelope-option {
            flex: 1;
            aspect-ratio: 4/3;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            border: 2px solid #eee;
            transition: all 0.2s;
        }

        .envelope-option img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .envelope-option.selected {
            border-color: #ff9a9e;
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(255, 154, 158, 0.3);
        }

        .envelope-option:active {
            transform: scale(0.95);
        }




        .envelope-name {
            font-size: 13px;
            color: #59474a;
            text-align: center;
            max-width: 100px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .envelope-hint {
            text-align: center;
            color: #bbb;
            font-size: 12px;
            margin-top: 10px;
        }

        .envelope-close {
            text-align: center;
            color: #999;
            font-size: 14px;
            cursor: pointer;
            margin-top: 15px;
        }

        .empty-envelope-hint {
            text-align: center;
            color: #ccc;
            padding: 40px 20px;
            font-size: 14px;
        }

        /* 信件列表弹窗 */
        .letter-list-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.1);
            z-index: 1001;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .letter-list-modal-overlay.show {
            opacity: 1;
        }

        .letter-list-modal {
            background: #fff;
            width: 90%;
            max-width: 360px;
            max-height: 70vh;
            border-radius: 16px;
            overflow: hidden;
            transform: scale(0.9);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
        }

        .letter-list-modal-overlay.show .letter-list-modal {
            transform: scale(1);
        }

        .letter-list-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 15px;
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
        }

        .letter-list-back {
            font-size: 28px;
            color: #fff;
            cursor: pointer;
            width: 30px;
            text-align: center;
        }

        .letter-list-title {
            font-size: 16px;
            font-weight: bold;
            color: #fff;
        }

        .letter-list-content {
            padding: 15px;
            max-height: calc(70vh - 60px);
            overflow-y: auto;
        }

        /* 单封信件条目 */
        .letter-item {
            background: #fef8f8;
            border-radius: 10px;
            padding: 12px 15px;
            margin-bottom: 10px;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid #ffe4e4;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .letter-item-content {
            flex: 1;
            overflow: hidden;
        }

        .letter-item-delete {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #ffebee;
            color: #ff6b81;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            cursor: pointer;
            flex-shrink: 0;
            transition: all 0.2s;
        }

        .letter-item-delete:hover {
            background: #ff6b81;
            color: #fff;
        }

        .letter-item:hover {
            background: #fff0f5;
            border-color: #ffc0cb;
        }

        .letter-item-date {
            font-size: 12px;
            color: #999;
            margin-bottom: 5px;
        }

        .letter-item-preview {
            font-size: 14px;
            color: #59474a;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* 信件详情弹窗 - 全屏信纸样式 */
        .letter-detail-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: transparent;
            z-index: 1002;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .letter-detail-modal-overlay.show {
            opacity: 1;
        }

        /* 返回按钮 - 悬浮左上角 */
        .letter-detail-back-btn {
            position: absolute;
            top: 15px;
            left: 15px;
            width: 40px;
            height: 40px;
            background: rgba(255, 182, 193, 0.9);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            color: #fff;
            cursor: pointer;
            z-index: 10;
            box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
            transition: transform 0.2s;
        }

        .letter-detail-back-btn:active {
            transform: scale(0.9);
        }

        /* 日期显示 - 悬浮顶部 */
        .letter-detail-date-bar {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #ffb6c1 0%, #ffc0cb 100%);
            padding: 8px 20px;
            border-radius: 20px;
            box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
            font-size: 14px;
            color: #fff;
            z-index: 10;
        }

        /* 全屏信纸容器 */
        .letter-detail-paper-container {
            position: relative;
            width: 92%;
            max-width: 400px;
            height: 85vh;
            max-height: 700px;
            border-radius: 8px;
            overflow: hidden;
            background: transparent;
            animation: letterPaperSlideIn 0.4s ease-out;
        }

        @keyframes letterPaperSlideIn {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.95);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* 信纸背景图 */
        .letter-detail-paper-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 1;
        }

        /* 内容滚动区 - 限制在信纸可见区域内 */
        .letter-detail-paper-area {
            position: absolute;
            top: 100px;
            left: 45px;
            right: 45px;
            bottom: 120px;
            z-index: 2;
            overflow-y: auto;
            padding: 10px 5px 10px 5px;
        }

        /* 信件文字内容 */
        .letter-detail-content {
            font-size: 14px;
            line-height: 1.8;
            color: #777;
            font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        /* 回信内容区减少空行间距 */
        #letterReplyContent {
            white-space: pre-wrap;
            line-height: 1.5;
        }

        /* 收下回信按钮 */
        .letter-reply-close-btn {
            position: fixed;
            bottom: 15px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 600;
            padding: 12px 30px;
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
            border: none;
            border-radius: 25px;
            font-size: 15px;
            font-weight: bold;
            color: #fff;
            cursor: pointer;
            box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .letter-reply-close-btn:active {
            transform: translateX(-50%) scale(0.95);
        }

        /* 查看回信按钮 (信件详情底部) */
        .view-reply-btn {
            position: fixed;
            bottom: 15px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 500;
            padding: 12px 30px;
            background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
            border: none;
            border-radius: 25px;
            font-size: 14px;
            font-weight: bold;
            color: #fff;
            cursor: pointer;
            text-align: center;
            box-shadow: 0 4px 15px rgba(161, 196, 253, 0.4);
        }

        .view-reply-btn:active {
            transform: scale(0.95);
        }

        /* ================= 私教页样式 ================= */

        /* 设置按钮 */
        .coach-settings-btn {
            position: absolute;
            top: 10px;
            right: 15px;
            z-index: 100;
            cursor: pointer;
            padding: 5px;
            transition: transform 0.2s;
        }

        .coach-settings-btn img {
            width: 30px;
            height: 30px;
            object-fit: contain;
        }

        .coach-settings-btn:active {
            transform: scale(0.9);
        }

        /* 周打卡区域 */
        .coach-week-checkin {
            display: flex;
            justify-content: center;
            gap: 8px;
            width: 100%;
            padding: 15px 10px;
            margin-top: 30px;
        }

        .week-day-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }

        .week-day-label {
            font-size: 12px;
            color: #b0a0a0;
            font-weight: 500;
        }

        .week-day-circle {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            border: 2px solid #f0e0e0;
            background: rgba(255, 255, 255, 0.6);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
        }

        .week-day-circle.checked {
            background: #fff0f3;
            border-color: #ffb7c5;
        }

        .week-day-circle.checked .week-heart {
            display: block;
            color: #ffb7c5;
            font-size: 18px;
        }

        .week-day-circle.today {
            border-color: #8FD3FE;
            background: #f0f8ff;
        }

        .week-day-circle.today .week-heart {
            display: block;
            color: #8FD3FE;
            font-size: 18px;
        }

        .week-heart {
            display: none;
        }

        /* 设置弹窗 */
        .coach-settings-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 3000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(3px);
        }

        .coach-settings-box {
            width: 90%;
            max-width: 400px;
            max-height: 85vh;
            background: #fff;
            border-radius: 20px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            animation: popIn 0.3s;
        }

        .coach-settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background: linear-gradient(90deg, #fd5392 0%, #ff6b81 100%);
            color: white;
        }

        .coach-settings-header h3 {
            margin: 0;
            font-size: 18px;
        }

        .coach-settings-close {
            font-size: 28px;
            cursor: pointer;
            line-height: 1;
        }

        .coach-settings-content {
            padding: 15px 20px;
            overflow-y: auto;
            flex: 1;
        }

        .coach-section-title {
            font-size: 14px;
            font-weight: bold;
            color: #59474a;
            margin: 15px 0 10px 0;
            padding-bottom: 5px;
            border-bottom: 1px dashed #FFDEE9;
        }

        .coach-section-title:first-child {
            margin-top: 0;
        }

        .coach-form-row {
            margin-bottom: 12px;
        }

        .coach-form-row label {
            display: block;
            font-size: 13px;
            color: #888;
            margin-bottom: 5px;
        }

        .coach-form-row-inline {
            display: flex;
            gap: 10px;
            margin-bottom: 12px;
        }

        .coach-form-col {
            flex: 1;
        }

        .coach-form-col label {
            display: block;
            font-size: 13px;
            color: #888;
            margin-bottom: 5px;
        }

        .coach-input,
        .coach-select,
        .coach-textarea {
            width: 100%;
            padding: 10px 12px;
            border: 2px solid #FFDEE9;
            border-radius: 10px;
            font-size: 14px;
            background: #FFFAFA;
            /* Lighter background */
            color: #59474a;
        }

        .coach-input:focus,
        .coach-select:focus,
        .coach-textarea:focus {
            border-color: #ff6b81;
            outline: none;
            background: #fff;
        }

        .coach-textarea {
            resize: vertical;
            min-height: 60px;
        }

        .coach-bmi-display {
            padding: 10px 12px;
            background: linear-gradient(90deg, #e8f5e9 0%, #c8e6c9 100%);
            border-radius: 10px;
            font-size: 16px;
            font-weight: bold;
            color: #4caf50;
            text-align: center;
        }

        .coach-save-btn {
            width: calc(100% - 40px);
            margin: 15px 20px 10px 20px;
            padding: 12px;
            background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 100%);
            /* Light pink gradient */
            border: none;
            border-radius: 25px;
            color: white;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(255, 154, 158, 0.3);
        }

        .coach-contract-btn {
            width: calc(100% - 40px);
            margin: 0 20px 20px 20px;
            padding: 12px;
            background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 100%);
            /* Slightly darker pink gradient */
            border: none;
            border-radius: 25px;
            color: white;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(255, 117, 140, 0.3);
        }

        .coach-save-btn:active,
        .coach-contract-btn:active {
            transform: scale(0.98);
        }

        /* 体重进度卡片 */
        .coach-progress-card {
            width: 90%;
            max-width: 350px;
            background: rgba(255, 255, 255, 0.9);
            border: 2px solid #FFDEE9;
            border-radius: 20px;
            padding: 0;
            /* 如果有内边距会影响header贴边，改为0 */
            margin-top: 15px;
            box-shadow: 0 2px 5px rgb(243 135 156 / 25%);
            overflow: hidden;
            /* 确保header圆角不溢出 */
            flex-shrink: 0;
            /* 防止被压缩 */
        }

        /* 顶部粉色横条 */
        .coach-card-header {
            background: #ffeef4;
            /* 浅粉色背景 */
            padding: 10px 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
            color: #59474a;
        }

        .header-item {
            font-size: 13px;
            color: #59474a;
        }

        .header-item strong {
            color: #ff6b81;
            font-weight: bold;
        }

        .header-title {
            color: #59474a;
            /* 中间标题浅色 */
            font-size: 13px;
        }


        /* 下半部分内容 */
        .coach-card-body {
            padding: 15px 20px 20px 20px;
            background: #fff;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .progress-current-value-row {
            display: flex;
            align-items: baseline;
            justify-content: center;
            gap: 5px;
            margin-bottom: 15px;
            /* 与下方进度条的间距 */
        }

        .current-weight-big {
            font-size: 42px;
            /* 稍微加大数字 */
            font-weight: bold;
            color: #ff6b81;
            line-height: 1;
        }

        .progress-current-value-row .unit {
            font-size: 16px;
            color: #ff6b81;
            font-weight: 500;
        }

        .weight-edit-btn {
            background: none;
            border: none;
            font-size: 14px;
            /* 缩小铅笔 */
            cursor: pointer;
            padding: 5px;
            margin-left: 8px;
            opacity: 0.6;
            transition: opacity 0.3s;
        }

        .weight-edit-btn:hover {
            opacity: 1;
            transform: scale(1.1);
        }

        /* 进度条容器调整 */
        .progress-bar-container {
            position: relative;
            width: 100%;
            height: 20px;
            /* 也可以适当调小 */
            display: flex;
            align-items: center;
        }

        .progress-bar-track {
            width: 100%;
            height: 12px;
            background: #f0f0f0;
            border-radius: 6px;
            position: relative;
            margin: 0;
            /* 去掉多余margin */
        }

        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
            border-radius: 6px;
            transition: width 0.5s ease;
            position: relative;
            z-index: 1;
        }

        /* 阶段节点容器 */
        .progress-nodes-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 2;
            pointer-events: none;
        }

        /* 单个节点 */
        .progress-node {
            position: absolute;
            top: 50%;
            width: 8px;
            height: 8px;
            background: #fff;
            border: 2px solid #ff9a9e;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .progress-node.reached {
            background: #ff9a9e;
            border-color: #fff;
        }

        /* 15天体重趋势卡片 */
        .coach-trend-card {
            width: 90%;
            max-width: 350px;
            background: rgba(255, 255, 255, 0.9);
            border: 2px solid #FFDEE9;
            border-radius: 20px;
            padding: 0;
            margin-top: 15px;
            box-shadow: 0 2px 5px rgb(243 135 156 / 25%);
            overflow: hidden;
            flex-shrink: 0;
            /* 防止被压缩 */
        }

        .trend-chart-container {
            width: 100%;
            height: 120px;
            position: relative;
        }

        #coach-trend-canvas {
            width: 100%;
            height: 100%;
        }

        .trend-label {
            text-align: center;
            font-size: 13px;
            color: #aaa;
            margin-top: 8px;
        }

        /* 让容器可以横向滚动，隐藏滚动条但能滑 */
        .chart-scroll-wrapper {
            width: 100%;
            min-height: 150px;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            /* iOS顺滑滚动 */
            padding-bottom: 5px;
        }

        #weight-svg {
            display: block;
            min-height: 150px;
        }

        /* 隐藏滚动条样式 */
        .chart-scroll-wrapper::-webkit-scrollbar {
            display: none;
        }

        /* SVG 里的样式 */
        .chart-line {
            fill: none;
            stroke: #ff7b9c;
            stroke-width: 3;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .chart-area {
            fill: url(#gradientPink);
            stroke: none;
        }

        .chart-dot {
            fill: white;
            stroke: #ff7b9c;
            stroke-width: 2;
        }

        .chart-text {
            font-size: 10px;
            fill: #ff7b9c;
            font-weight: bold;
            text-anchor: middle;
        }

        .chart-date-text {
            font-size: 10px;
            fill: #ccc;
            text-anchor: middle;
        }

        /* 生成今日计划按钮 */
        .daily-plan-btn {
            width: 40%;
            margin: 15px auto;
            /* 居中且增加上间距 */
            display: block;
            padding: 10px 0;
            background: linear-gradient(135deg, #ff6b81 0%, #ff9a9e 100%);
            border: none;
            border-radius: 25px;
            color: white;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(255, 107, 129, 0.4);
            transition: all 0.3s;
        }

        .daily-plan-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 129, 0.5);
        }

        .daily-plan-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* 今日计划卡片 */
        .daily-plan-card {
            width: 90%;
            max-width: 350px;
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 250, 0.9) 100%);
            border: 1px solid rgba(255, 183, 197, 0.4);
            border-radius: 20px;
            padding: 20px;
            margin-top: 15px;
            box-shadow: 0 8px 32px rgba(255, 107, 129, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            flex-shrink: 0;
            /* 防止被压缩 */
        }

        .plan-character-msg {
            background: linear-gradient(135deg, #fff0f3 0%, #ffe4ec 100%);
            padding: 15px;
            border-radius: 15px;
            font-size: 14px;
            line-height: 1.6;
            color: #59474a;
            margin-bottom: 15px;
            border-left: 4px solid #ff6b81;
        }

        .plan-section {
            margin-bottom: 15px;
        }

        .plan-section-title {
            font-size: 15px;
            font-weight: bold;
            color: #59474a;
            margin-bottom: 10px;
            padding-bottom: 5px;
            border-bottom: 1px dashed #ffdee9;
        }

        .plan-meal {
            display: flex;
            padding: 8px 0;
            border-bottom: 1px solid #f5f5f5;
        }

        .plan-meal:last-child {
            border-bottom: none;
        }

        .meal-label {
            width: 50px;
            font-weight: bold;
            color: #ff6b81;
            font-size: 13px;
        }

        .meal-content {
            flex: 1;
            font-size: 13px;
            color: #666;
        }

        .plan-workout-focus {
            font-size: 16px;
            font-weight: bold;
            color: #ff6b81;
            text-align: center;
            padding: 10px;
            background: #fff5f7;
            border-radius: 10px;
            margin-bottom: 8px;
        }

        .plan-workout-duration {
            text-align: center;
            font-size: 12px;
            color: #aaa;
            margin-bottom: 10px;
        }

        .plan-moves-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .plan-move-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            background: #fafafa;
            border-radius: 8px;
            font-size: 13px;
            gap: 10px;
        }

        .plan-move-item .move-name {
            color: #59474a;
            flex: 1;
            line-height: 1.4;
        }

        .plan-move-item .move-sets {
            background: linear-gradient(135deg, #ff9a9e 0%, #ff758c 100%);
            color: white;
            font-weight: 600;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 12px;
            text-align: center;
            white-space: nowrap;
            flex-shrink: 0;
        }

        /* 契约按钮组 - 删除重复定义，使用上面的统一按钮样式 */

        .coach-view-contract-btn {
            width: calc(100% - 40px);
            margin: 0 20px 20px 20px;
            padding: 12px;
            background: rgba(255, 255, 255, 0.9);
            border: 2px solid #ff6b81;
            border-radius: 25px;
            color: #ff6b81;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
        }

        /* 契约弹窗 */
        .contract-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 4000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(5px);
        }

        .contract-modal-box {
            width: 92%;
            max-width: 400px;
            max-height: 85vh;
            background: linear-gradient(180deg, #fff8f0 0%, #fff 100%);
            border-radius: 20px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            animation: popIn 0.3s;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        }

        .contract-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background: linear-gradient(135deg, #ff6b81 0%, #fd5392 100%);
            color: white;
        }

        .contract-modal-header h3 {
            margin: 0;
            font-size: 18px;
        }

        .contract-modal-close {
            font-size: 28px;
            cursor: pointer;
            line-height: 1;
        }

        .contract-modal-content {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
        }

        /* 契约内容样式 */
        .contract-overview {
            position: relative;
            background: #fff;
            padding: 18px 20px;
            border-radius: 16px;
            margin-bottom: 20px;
            font-size: 14px;
            line-height: 1.8;
            color: #59474a;
            border: 1px solid #ffe0e8;
            box-shadow: 0 2px 8px rgba(255, 183, 197, 0.15);
        }

        .contract-overview::before {
            content: '💌 TA对你说：';
            display: block;
            font-size: 12px;
            color: #ff6b81;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .contract-summary {
            display: flex;
            justify-content: space-around;
            margin-bottom: 20px;
            padding: 10px;
            background: #fff0f5;
            border-radius: 12px;
        }

        .contract-summary-item {
            text-align: center;
        }

        .contract-summary-item .label {
            font-size: 12px;
            color: #888;
        }

        .contract-summary-item .value {
            font-size: 20px;
            font-weight: bold;
            color: #ff6b81;
        }

        .contract-phase {
            background: #fff;
            border: 2px solid #ffdee9;
            border-radius: 15px;
            padding: 15px;
            margin-bottom: 12px;
            position: relative;
        }

        .contract-phase-num {
            position: absolute;
            top: -10px;
            left: 15px;
            background: linear-gradient(135deg, #ff6b81 0%, #fd5392 100%);
            color: white;
            font-size: 12px;
            font-weight: bold;
            padding: 3px 10px;
            border-radius: 10px;
        }

        .contract-phase-name {
            font-size: 16px;
            font-weight: bold;
            color: #59474a;
            margin-top: 5px;
            margin-bottom: 10px;
        }

        .contract-phase-info {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            font-size: 13px;
        }

        .contract-phase-info .item {
            background: #f8f8f8;
            padding: 8px 10px;
            border-radius: 8px;
        }

        .contract-phase-info .item .label {
            color: #888;
            font-size: 11px;
        }

        .contract-phase-info .item .value {
            color: #59474a;
            font-weight: 500;
        }

        .contract-intensity {
            display: flex;
            align-items: center;
            gap: 5px;
            margin-top: 10px;
        }

        .intensity-bar {
            flex: 1;
            height: 8px;
            background: #e0e0e0;
            border-radius: 4px;
            overflow: hidden;
        }

        .intensity-fill {
            height: 100%;
            background: linear-gradient(90deg, #81c784 0%, #ffb74d 50%, #e57373 100%);
            border-radius: 4px;
        }

        .intensity-label {
            font-size: 12px;
            color: #888;
            min-width: 50px;
        }

        .contract-regen-btn {
            width: calc(100% - 40px);
            margin: 15px 20px;
            padding: 12px;
            background: #f0f0f0;
            border: none;
            border-radius: 25px;
            color: #666;
            font-size: 14px;
            cursor: pointer;
        }

        /* 加载状态 */
        .contract-loading {
            text-align: center;
            padding: 40px 20px;
        }

        .contract-loading-spinner {
            width: 50px;
            height: 50px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        /* 完成打卡按钮 */
        .coach-checkin-btn {
            width: 100%;
            padding: 14px;
            margin-top: 20px;
            background: linear-gradient(135deg, #81C784 0%, #4CAF50 100%);
            border: none;
            border-radius: 25px;
            color: white;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
            transition: all 0.3s;
        }

        .coach-checkin-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
        }

        .coach-checkin-btn:active {
            transform: scale(0.98);
        }

        /* ==================== 世界书样式 ==================== */

        /* 世界书列表容器 */
        .wb-container-scroll {
            max-height: 40vh;
            overflow-y: auto;
            margin-bottom: 20px;
            padding: 10px;
            background: rgba(255, 245, 247, 0.5);
            border-radius: 15px;
            border: 2px dashed #FFB7C5;
        }

        /* 分组样式 */
        .wb-group {
            margin-bottom: 15px;
            background: #fff;
            border-radius: 12px;
            border: 2px solid #FFDEE9;
            overflow: hidden;
        }

        .wb-group-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 15px;
            background: linear-gradient(90deg, #FFE4EC 0%, #FFF0F5 100%);
            cursor: pointer;
            user-select: none;
        }

        .wb-group-header.ungrouped {
            background: linear-gradient(90deg, #f5f5f5 0%, #fff 100%);
        }

        .wb-group-title {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-brown);
            font-weight: bold;
        }

        .wb-group-arrow {
            font-size: 12px;
            transition: transform 0.2s;
        }

        .wb-group-arrow.collapsed {
            transform: rotate(-90deg);
        }

        .wb-group-count {
            font-size: 12px;
            color: #999;
            font-weight: normal;
        }

        .wb-group-actions {
            display: flex;
            gap: 8px;
        }

        .wb-group-btn {
            font-size: 14px;
            cursor: pointer;
            opacity: 0.7;
            transition: opacity 0.2s;
        }

        .wb-group-btn:hover {
            opacity: 1;
        }

        .wb-group-content {
            padding: 10px;
        }

        .wb-group-content.collapsed {
            display: none;
        }

        /* 条目样式 */
        .wb-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            margin-bottom: 8px;
            background: #FFF5F7;
            border-radius: 10px;
            border: 1px solid #FFDEE9;
            transition: all 0.2s;
        }

        .wb-item:hover {
            border-color: #FFB7C5;
            box-shadow: 0 2px 8px rgba(255, 183, 197, 0.3);
        }

        .wb-item-main {
            flex: 1;
            cursor: pointer;
            overflow: hidden;
        }

        .wb-item-title {
            font-weight: bold;
            color: var(--text-brown);
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .wb-item-position {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            color: white;
        }

        .wb-item-content {
            font-size: 12px;
            color: #999;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .wb-item-del {
            padding: 5px 10px;
            font-size: 12px;
            color: #ff6b81;
            cursor: pointer;
            background: #FFF0F3;
            border-radius: 6px;
            transition: all 0.2s;
        }

        .wb-item-del:hover {
            background: #ff6b81;
            color: white;
        }

        /* 输入区域样式 */
        .wb-input-section {
            margin-top: 15px;
        }

        .wb-options-row {
            display: flex;
            align-items: center;
            gap: 15px;
            margin: 15px 0;
            flex-wrap: wrap;
        }

        .wb-position-group {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .wb-option-label {
            font-size: 13px;
            color: #888;
        }

        .wb-radio-label {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 13px;
            color: var(--text-brown);
            cursor: pointer;
        }

        .wb-group-selector {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .wb-group-dropdown {
            flex: 1;
            min-width: 150px;
        }

        .wb-new-group-input {
            flex: 1;
            min-width: 150px;
        }

        .wb-btn-row {
            display: flex;
            gap: 10px;
        }

        .wb-primary-btn {
            flex: 1;
        }

        .wb-cancel-btn {
            flex: 0.5;
            background: #94a3b8 !important;
        }

        /* ==================== 聊天室样式 ==================== */

        /* 聊天页面布局 */
        #chat-layer.active {
            display: flex;
            flex-direction: column;
            height: 100vh;
            padding-bottom: 0 !important;
            /* 移除固定背景，允许JS动态设置 */
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
        }

        /* 聊天导航栏 */
        .chat-nav-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 9.5px 15px;
            background: rgba(255, 233, 235, 0.8);
            border-bottom: 1px solid #FFDEE9;
            flex-shrink: 0;
        }

        .chat-title-area {
            text-align: center;
            flex: 1;
        }

        #chat-title {
            font-size: 16px;
            font-weight: bold;
            color: var(--text-brown);
        }

        .chat-settings-btn {
            font-size: 20px;
            cursor: pointer;
            padding: 5px;
        }

        /* 消息区域 */
        .chat-msg-area {
            flex: 1;
            overflow-y: auto;
            padding: 15px;
            padding-bottom: 90px;
            background: transparent;
        }

        .chat-empty-hint {
            text-align: center;
            padding-top: 80px;
        }

        /* 消息行样式 */
        .chat-msg-row {
            display: flex;
            align-items: flex-start;
            margin-bottom: 15px;
            gap: 10px;
        }

        .chat-msg-row.me {
            flex-direction: row-reverse;
        }

        /* 头像样式 */
        .chat-avatar {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            object-fit: cover;
            flex-shrink: 0;
            border: none;
        }

        /* 气泡样式 */
        .chat-bubble {
            max-width: 70%;
            padding: 6px 12px;
            /* 垂直内边距减小到6px */
            border-radius: 15px;
            font-size: 14px;
            line-height: 1.5;
            word-break: break-word;
        }

        .chat-msg-row.ai .chat-bubble {
            background: #e5f7ff;
            /* 粉蓝色背景 */
            color: #325881;
            border: 2px solid #8bb1d0;
            border-radius: 15px 15px 15px 4px;
            /* 18px -> 15px */
        }

        .chat-msg-row.me .chat-bubble {
            background: #ffe5eb;
            /* 粉红色背景 */
            color: #b76683;
            border: 2px solid #d5aab4;
            border-radius: 15px 15px 4px 15px;
            /* 18px -> 15px */
        }

        #chat-layer {
            background: #fff;  /* 移除 !important，允许JS动态设置背景 */
            min-height: 100vh;
        }

        /* 输入栏 */
        .chat-input-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            display: flex;
            align-items: center;
            padding: 10px 15px;
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
            background: rgba(255, 233, 235, 0.8);
            border-top: 1px solid #FFDEE9;
            gap: 10px;
            z-index: 100;
        }

        .chat-ai-btn {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            background: linear-gradient(135deg, #FFB7C5 0%, #FF9A9E 100%);
            border: none;
            color: white;
            font-size: 18px;
            cursor: pointer;
            flex-shrink: 0;
            transition: transform 0.2s;
        }

        .chat-ai-btn:active {
            transform: scale(0.95);
        }

        .chat-input {
            flex: 1;
            padding: 10px 15px;
            border: 3px solid #b7a2a9;
            border-radius: 20px;
            font-size: 14px;
            background: #faeaeb;
            color: var(--text-brown);
            font-family: inherit;
        }

        .chat-input:focus {
            border-color: #a08a8f;
            outline: none;
        }

        .chat-send-btn {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            background: var(--btn-gradient);
            border: none;
            color: white;
            font-size: 16px;
            cursor: pointer;
            flex-shrink: 0;
            transition: transform 0.2s;
        }

        .chat-send-btn:active {
            transform: scale(0.95);
        }

        /* ==================== 消息列表页样式 ==================== */

        /* 消息列表页布局 - 只在active时显示 */
        #chatlist-layer.active {
            display: flex;
            flex-direction: column;
            height: 100vh;
        }

        /* 顶部导航 */
        .chatlist-nav-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 15px;
            background: rgba(255, 255, 255, 0.95);
            border-bottom: 1px solid #FFDEE9;
            flex-shrink: 0;
        }

        #chatlist-title {
            font-size: 18px;
            font-weight: bold;
            color: var(--text-brown);
        }

        .chatlist-add-btn {
            font-size: 24px;
            color: var(--text-brown);
            cursor: pointer;
            padding: 5px 10px;
        }

        /* 新建菜单 */
        .chat-add-menu {
            position: absolute;
            top: 50px;
            right: 15px;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            z-index: 200;
            overflow: hidden;
        }

        .chat-add-menu-item {
            padding: 12px 20px;
            cursor: pointer;
            font-size: 14px;
            color: var(--text-brown);
            transition: background 0.2s;
        }

        .chat-add-menu-item:hover {
            background: #FFF5F7;
        }

        /* 聊天列表容器 */
        .chatlist-scroll {
            flex: 1;
            overflow-y: auto;
            padding-bottom: 70px;
            background-color: #FFF0F5;
            background-image: url('https://i.postimg.cc/28Fj5nBt/04.jpg');
            background-size: cover;
            background-position: center;
        }

        /* 列表项 */
        .chatlist-item {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            background: rgba(255, 255, 255, 0.6);
            border-bottom: 1px solid #FFF5F7;
            cursor: pointer;
            transition: background 0.2s;
            position: relative;
            /* 为长按菜单定位做准备 */
        }

        .chatlist-item:active {
            background: #FFF0F5;
        }

        .chatlist-item.pinned {
            background: #fff0f5c9;
            /* 置顶项背景色 */
            border-left: 4px solid #ffa4c2;
        }

        .chatlist-avatar {
            width: 50px;
            height: 50px;
            border-radius: 8px;
            /* 改为圆角方形 */
            object-fit: cover;
            margin-right: 12px;
            /* 移除描边 */
            flex-shrink: 0;
        }

        .chatlist-info {
            flex: 1;
            min-width: 0;
        }

        .chatlist-name {
            font-size: 16px;
            font-weight: bold;
            color: var(--text-brown);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .chatlist-status {
            font-size: 12px;
            color: #9ca3af;
            margin-top: 4px;
        }

        /* 长按气泡菜单 */
        .chat-context-menu {
            position: fixed;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            padding: 5px 0;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            min-width: 120px;
            animation: menuPopIn 0.2s ease-out;
        }

        .chat-menu-option {
            padding: 10px 20px;
            font-size: 14px;
            color: var(--text-brown);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .chat-menu-option:hover {
            background: #FFF5F7;
        }

        .chat-menu-option.delete {
            color: #ff6b81;
        }

        /* 底部Tab栏 */
        .chatlist-tab-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            display: flex;
            background: #fff;
            border-top: 1px solid #FFDEE9;
            padding-bottom: env(safe-area-inset-bottom);
            z-index: 100;
        }

        .tab-item {
            flex: 1;
            text-align: center;
            padding: 12px 0;
            font-size: 14px;
            color: #9ca3af;
            cursor: pointer;
            transition: color 0.2s;
        }

        .tab-item.active {
            color: #ff6b81;
            font-weight: bold;
        }

        /* 用户资料页 */
        .profile-page {
            padding: 20px;
            padding-bottom: 100px;
            overflow-y: auto;
            max-height: calc(100vh - 120px);
        }

        .profile-avatar-large {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-size: cover;
            background-position: center;
            border: 3px solid #FFB7C5;
            cursor: pointer;
        }

        /* ==================== 创建角色弹窗样式 ==================== */

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 3001;
        }

        .modal-box {
            background: #fff;
            border-radius: 20px;
            padding: 25px;
            width: 90%;
            max-width: 400px;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        }

        .modal-header {
            text-align: center;
            color: var(--text-brown);
            margin-bottom: 20px;
            font-size: 18px;
        }

        .avatar-upload-row {
            display: flex;
            justify-content: center;
            margin: 10px 0;
        }

        .char-avatar-preview {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: linear-gradient(135deg, #FFF5F7 0%, #FFDEE9 100%);
            border: 3px dashed #FFB7C5;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            background-size: cover;
            background-position: center;
            transition: all 0.3s;
        }

        .char-avatar-preview:hover {
            border-color: #FF9A9E;
        }

        .char-avatar-preview span {
            font-size: 28px;
            color: #FFB7C5;
        }

        .cancel-btn {
            text-align: center;
            color: #9ca3af;
            margin-top: 10px;
            cursor: pointer;
            font-size: 14px;
        }

        .cancel-btn:hover {
            color: #666;
        }

        /* ================= 世界书选择器样式 ================= */
        .wb-select-group {
            border-bottom: 1px solid #f0f0f0;
        }

        .wb-select-group:last-child {
            border-bottom: none;
        }

        .wb-select-group-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 10px;
            background: #fef8f9;
            cursor: pointer;
            font-size: 13px;
            color: #59474a;
        }

        .wb-select-group-header:hover {
            background: #fff0f5;
        }

        .wb-select-group-header.ungrouped {
            background: #f8f8f8;
        }

        .wb-select-group-name {
            font-weight: 500;
        }

        .wb-select-group-count {
            color: #9ca3af;
            font-size: 12px;
        }

        .wb-select-item {
            display: flex;
            align-items: center;
            padding: 6px 10px 6px 20px;
            cursor: pointer;
            font-size: 13px;
            color: #59474a;
            transition: background 0.2s;
        }

        .wb-select-item:hover {
            background: #fff5f7;
        }

        .wb-select-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
            margin-right: 8px;
            accent-color: #ff6b81;
        }

        .wb-select-item label {
            flex: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .wb-select-position {
            font-size: 10px;
            padding: 1px 4px;
            border-radius: 3px;
            background: #60a5fa;
            color: white;
        }

        /* ================= 全屏编辑弹窗优化样式 ================= */
        #modal-fullscreen-edit {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #ffffff !important;
            z-index: 9999;
            flex-direction: column;
            animation: slideUp 0.3s ease-out;
            border-radius: 0 !important;
            box-shadow: none !important;
        }

        @keyframes slideUp {
            from {
                transform: translateY(100%);
            }

            to {
                transform: translateY(0);
            }
        }

        .fullscreen-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 56px;
            padding: 0 16px;
            background: #ffffff;
            border-bottom: 1px solid #f0f0f0;
            flex-shrink: 0;
        }

        .fullscreen-title {
            font-size: 17px;
            font-weight: 600;
            color: var(--text-brown);
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
        }

        .fullscreen-btn {
            border: none;
            background: none;
            font-size: 15px;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 8px;
            transition: opacity 0.2s;
        }

        .fullscreen-btn:active {
            opacity: 0.7;
        }

        .fullscreen-btn.cancel {
            color: #9ca3af;
            font-weight: 500;
            margin-left: -12px;
            /* Visual alignment */
        }

        .fullscreen-btn.save {
            background: var(--btn-gradient);
            color: white;
            font-weight: bold;
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 14px;
            box-shadow: 0 2px 8px rgba(255, 107, 129, 0.3);
        }

        .fullscreen-textarea {
            flex: 1;
            width: 100%;
            border: none;
            padding: 20px;
            font-size: 16px;
            line-height: 1.6;
            resize: none;
            background: #ffffff;
            color: var(--text-brown);
            font-family: inherit;
        }

        .fullscreen-textarea:focus {
            background: #fff;
        }

        /* ================= 创建角色弹窗全屏化 (Modal Add Fullscreen) ================= */
        #modal-add-char {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #ffffff;
            /* 纯白背景 */
            z-index: 9000;
            /* 比全屏编辑器低，但比其他高 */
            flex-direction: column;
            animation: slideUp 0.3s ease-out;
        }

        .add-char-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 56px;
            padding: 0 16px;
            background: #ffffff;
            border-bottom: 1px solid #f0f0f0;
            flex-shrink: 0;
        }

        .add-char-title {
            font-size: 17px;
            font-weight: 600;
            color: var(--text-brown);
        }

        .add-char-content {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            padding-bottom: 80px;
            /* 底部留白 */
        }

        /* ================= 用户资料页优化 (Profile Page) ================= */
        #profile-page {
            /* 覆盖 script.js 的 display: block, 强制使用 flex */
            display: none;
            flex-direction: column;
            height: 100%;
            padding: 20px;
            box-sizing: border-box;
            overflow: hidden;
        }

        #profile-page[style*="display: block"] {
            display: flex !important;
        }

        /* 让个人介绍的容器(第3个元素)自动撑开 */
        #profile-page .form-group:nth-child(3) {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            margin-bottom: 20px;
        }

        #profile-intro {
            flex: 1;
            height: 100%;
            resize: none;
        }

        /* ================= 聊天分组样式 (Chat Groups) ================= */
        .chat-group-container {
            margin-bottom: 4px;
            /* 缩小这个缝隙 */
        }

        .chat-group-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 12px;
            background: #fff7ef;
            /* 用户指定的颜色 */
            /* border-radius: 8px; */
            cursor: pointer;
            user-select: none;
            transition: background 0.2s;
            border-bottom: 1px solid #f0f0f0;
        }

        .chat-group-header:active {
            background: #ffead0;
            /* 点击时稍微深一点 */
        }

        .chat-group-title-area {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            font-weight: 600;
            color: #555;
        }

        .chat-group-arrow {
            font-size: 10px;
            color: #ccc;
            transition: transform 0.2s;
            width: 14px;
            text-align: center;
        }

        .chat-group-count {
            font-weight: normal;
            font-size: 12px;
            color: #999;
        }

        .chat-group-actions {
            display: flex;
            gap: 10px;
            opacity: 0.3;
            transition: opacity 0.2s;
        }

        .chat-group-header:hover .chat-group-actions {
            opacity: 1;
        }

        .chat-group-btn {
            cursor: pointer;
            font-size: 12px;
        }

        .chat-group-btn:hover {
            transform: scale(1.1);
        }

        .chat-group-content {
            padding-left: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
        }

        .chat-group-content.collapsed {
            display: none;
        }

        /* 选中置顶项的样式 */
        .chatlist-item.pinned-item {
            background-color: #fff0f5c9;
            border-left: 4px solid #ffa4c2;
        }

        /* 增加Move to Group的菜单项样式 */
        .chat-menu-option span {
            margin-right: 5px;
        }

        /* ================= 聊天设置弹窗样式 ================= */
        .chat-settings-modal {
            width: 90%;
            max-width: 400px;
            background: #fff;
            border-radius: 20px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            max-height: 85vh;
        }

        .chat-settings-header {
            padding: 15px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #eee;
            background: #fff;
            flex-shrink: 0;
            /* 防止被压扁 */
        }

        .chat-settings-header h3 {
            margin: 0;
            color: #374151;
            font-size: 18px;
        }

        .chat-settings-content {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
        }

        .settings-divider {
            height: 1px;
            background: #eee;
            margin: 20px 0;
            width: 100%;
            border-top: 1px dashed #FFDEE9;
        }

        .wb-select-list {
            border: 1px solid #f0f0f0;
            border-radius: 10px;
            background: #fafafa;
            max-height: 150px;
            overflow-y: auto;
            padding: 5px;
        }

        .wb-select-item {
            display: flex;
            align-items: center;
            padding: 8px 10px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
        }

        .wb-select-item:hover {
            background: #fff0f5;
        }

        .wb-select-item input {
            margin-right: 10px;
            width: 16px;
            height: 16px;
            accent-color: #ff6b81;
        }

        .wb-select-item span {
            font-size: 14px;
            color: #555;
        }

        .settings-action-btn {
            width: 100%;
            padding: 10px;
            border: none;
            border-radius: 12px;
            color: white;
            font-weight: bold;
            font-size: 14px;
            cursor: pointer;
            transition: transform 0.2s, opacity 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

        .settings-action-btn:active {
            transform: scale(0.98);
        }

        /* 统一头像上传样式复用 adjustment if needed */
        .avatar-upload-container {
            width: 80px;
            height: 80px;
            margin: 0 auto;
            position: relative;
            border-radius: 50%;
            overflow: hidden;
            cursor: pointer;
            border: 3px solid #fff;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .avatar-preview {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .avatar-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            background: rgba(0, 0, 0, 0.5);
            color: white;
            font-size: 10px;
            padding: 2px 0;
            text-align: center;
        }

        /* ==================== ������Ƭ��ʽ ==================== */

        /* ����Ϣ���ݰ��� App Card ʱ���Ƴ�Ĭ�����ݱ������ڱ߾� */
        .chat-msg-row.ai .chat-msg-content.has-app-card {
            background: transparent !important;
            padding: 0 !important;
            box-shadow: none !important;
            border: none !important;
            max-width: 100%;
            /* ������Ƭ�ſ� */
        }

        /* ��Ƭ������ʽ (����) */
        .app-card {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            color: #333;
            background: #fff;
            /* Ĭ�ϰ׵� */
            overflow: hidden;
            /* ��ֹԲ����� */
            width: 280px;
            /* Ĭ�Ͽ��ȣ���Ӧ�ֻ��� */
            max-width: 100%;
        }

        /* ������Ƭ��ʽ���� - �Ƴ����ݰ��� */
        .chat-bubble.has-app-card {
            background: transparent !important;
            padding: 0 !important;
            border-radius: 0 !important;
            box-shadow: none !important;
            border: none !important;
            max-width: 100% !important;
            width: 100%;
        }

        /* ��Ƭ�Դ�����ʽ��֤ */
        .chat-bubble.has-app-card .app-card {
            width: 100%;
            max-width: 300px;
        }


        /* ==================== 群聊消息样式 ==================== */

        /* AI 消息行：确保头像在顶部对齐 */
        .chat-msg-row.ai {
            align-items: flex-start !important;
        }

        /* 消息列容器：包裹名字和气泡 */
        .msg-col {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            max-width: 75%;
            /* 限制整体最大宽度，避免气泡太宽 */
        }

        /* 让气泡在容器内自然撑开，而不是受自身百分比限制 */
        .chat-bubble {
            max-width: 100% !important;
        }

        /* 发送者名字：微信群聊风格 */
        .msg-name {
            font-size: 12px;
            color: #999;
            margin-bottom: 4px;
            margin-left: 2px;
            line-height: 1.2;
        }

        /* 🕐 消息时间戳 */
        .chat-msg-time {
            font-size: 10px;
            color: #9ca3af;
            margin-top: 3px;
            opacity: 0.7;
            padding-left: 2px;
        }

        .chat-msg-row.me .msg-col {
            align-items: flex-end;
        }

        .chat-msg-row.me .chat-msg-time {
            text-align: right;
            padding-right: 2px;
            padding-left: 0;
        }

        /* 确保头像和消息之间有合适的间距 */
        .chat-msg-row .chat-avatar {
            margin-right: 10px;
            flex-shrink: 0;
            /* 防止头像被压缩 */
        }

        /* 群聊气泡：确保不会太宽 */
        .chat-msg-row.ai .msg-col .chat-bubble {
            max-width: 100%;
        }

        /* ========================================
   🎤 语音消息气泡样式
   ======================================== */

        /* --- 语音消息容器 (垂直排列) --- */
        .voice-msg-container {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            /* 左对齐 */
            gap: 8px;
            /* 上下间距 */
            max-width: 80%;
        }

        /* --- 上半部分：语音胶囊 --- */
        .voice-pill {
            display: flex;
            align-items: center;
            background: #E1F5FE;
            /* 浅蓝底，类似参照图 */
            /* 或者用 #f0f2f5 灰色，看哪个更配 */
            padding: 8px 16px;
            border-radius: 50px;
            /* 胶囊形状 */
            cursor: pointer;
            min-width: 120px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
            transition: background 0.2s;
            user-select: none;
        }

        .voice-pill:active {
            filter: brightness(0.95);
        }

        /* 播放图标 */
        .voice-icon {
            width: 14px;
            height: 14px;
            fill: #59474a;
            /* 深棕色图标 */
            margin-right: 12px;
            flex-shrink: 0;
        }

        .voice-icon svg {
            width: 100%;
            height: 100%;
        }

        /* 声波纹 (静态模拟) */
        .voice-wave {
            display: flex;
            align-items: center;
            gap: 3px;
            height: 16px;
            margin-right: 12px;
            flex: 1;
            /* 撑开中间 */
        }

        .voice-bar {
            width: 3px;
            background-color: #aebbc7;
            /* 默认灰色 */
            border-radius: 2px;
            animation: none;
        }

        /* 定义几根长短不一的线 */
        .voice-bar:nth-child(1) {
            height: 8px;
        }

        .voice-bar:nth-child(2) {
            height: 14px;
        }

        .voice-bar:nth-child(3) {
            height: 10px;
        }

        .voice-bar:nth-child(4) {
            height: 12px;
        }

        .voice-bar:nth-child(5) {
            height: 6px;
        }

        /* 播放时的动画 */
        .voice-pill.playing .voice-icon {
            fill: #ff6b81;
            /* 播放时图标变粉 */
        }

        .voice-pill.playing .voice-bar {
            background-color: #ff6b81;
            /* 播放时波纹变粉 */
            animation: waveJump 0.8s infinite ease-in-out;
        }

        .voice-pill.playing .voice-bar:nth-child(2) {
            animation-delay: 0.1s;
        }

        .voice-pill.playing .voice-bar:nth-child(3) {
            animation-delay: 0.2s;
        }

        .voice-pill.playing .voice-bar:nth-child(4) {
            animation-delay: 0.3s;
        }

        .voice-pill.playing .voice-bar:nth-child(5) {
            animation-delay: 0.4s;
        }

        @keyframes waveJump {

            0%,
            100% {
                transform: scaleY(1);
            }

            50% {
                transform: scaleY(1.5);
            }
        }

        /* 时长文字 */
        .voice-duration {
            font-size: 12px;
            color: #999;
            white-space: nowrap;
        }

        /* --- 下半部分：文字气泡 --- */
        .voice-text-bubble {
            background: #fff;
            padding: 10px 14px;
            border-radius: 12px;
            border-top-left-radius: 2px;
            /* 这种圆角更有对话感 */
            font-size: 14px;
            color: #333;
            line-height: 1.5;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
            border: 1px solid #f0f0f0;
            word-break: break-word;
        }

        /* 加载状态 */
        .voice-pill.loading .voice-icon {
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        /* ================= 语音通话界面样式 (Voice Call Layer) ================= */

        /* ================= 语音来电邀请界面 (Voice Invite Layer) ================= */
        #voice-invite-layer,
        #video-invite-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 99999;
            /* 比通话层更高 */
            display: none;
        }

        #voice-invite-layer.active,
        #video-invite-layer.active {
            display: block;
        }

        .voice-invite-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #000;
            background-size: cover;
            background-position: center;
            filter: blur(30px) brightness(0.4);
            transform: scale(1.1);
        }

        .voice-invite-content {
            position: relative;
            z-index: 1;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 80px 40px 60px 40px;
            color: white;
        }

        .voice-invite-info {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .voice-invite-avatar-wrapper {
            width: 110px;
            height: 110px;
            border-radius: 50%;
            overflow: hidden;
            margin-bottom: 20px;
            box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
            animation: invitePulse 2s infinite;
        }

        @keyframes invitePulse {
            0% {
                box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
            }

            70% {
                box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
            }
        }

        .voice-invite-avatar-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .voice-invite-name {
            font-size: 26px;
            font-weight: bold;
            margin-bottom: 10px;
        }

        .voice-invite-status {
            font-size: 15px;
            color: rgba(255, 255, 255, 0.7);
        }

        .voice-invite-actions {
            display: flex;
            justify-content: space-between;
            padding: 0 20px;
        }

        .voice-invite-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            cursor: pointer;
        }

        .voice-invite-btn svg {
            width: 65px;
            height: 65px;
            border-radius: 50%;
            padding: 15px;
            transition: transform 0.2s;
        }

        .voice-invite-btn:active svg {
            transform: scale(0.9);
        }

        .voice-invite-btn.decline svg {
            background: #ff4757;
        }

        .voice-invite-btn.accept svg {
            background: #2ed573;
            animation: shakeBtn 2s infinite;
        }

        @keyframes shakeBtn {

            0%,
            100% {
                transform: rotate(0);
            }

            10%,
            30%,
            50%,
            70%,
            90% {
                transform: rotate(-5deg);
            }

            20%,
            40%,
            60%,
            80% {
                transform: rotate(5deg);
            }
        }

        .voice-invite-btn span {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.8);
        }

        /* ================= 语音通话界面样式 ================= */
        /* 通话层容器 - 全屏覆盖 */
        #voice-call-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 99998;
            display: none;
            /* 默认隐藏 */
        }

        #voice-call-layer.active {
            display: block;
        }

        /* 模糊背景层 */
        .voice-call-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #2c3e50;
            background-size: cover;
            background-position: center;
            filter: blur(30px) brightness(0.5);
            transform: scale(1.1);
            /* 放大一点避免边缘模糊露出 */
        }

        /* 通话内容层 */
        .voice-call-content {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            z-index: 1;
        }

        /* 顶部信息区 */
        .voice-call-header {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding-top: 60px;
            padding-bottom: 20px;
        }

        /* 头像容器 */
        .voice-call-avatar-wrapper {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 3px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            margin-bottom: 15px;
        }

        .voice-call-avatar {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* 对方名字 */
        .voice-call-name {
            font-size: 22px;
            font-weight: bold;
            color: white;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            margin-bottom: 6px;
        }

        /* 通话状态 */
        .voice-call-status {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.7);
            margin-bottom: 4px;
        }

        /* 计时器 */
        .voice-call-timer {
            font-size: 16px;
            color: rgba(255, 255, 255, 0.9);
            font-family: 'SF Mono', 'Monaco', monospace;
            letter-spacing: 2px;
        }

        /* 右上角扬声器按钮 */
        .voice-call-speaker {
            position: absolute;
            top: 50px;
            right: 20px;
            width: 44px;
            height: 44px;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.2);
            z-index: 10;
        }

        .voice-call-speaker:active {
            transform: scale(0.9);
            background: rgba(255, 255, 255, 0.25);
        }

        .voice-call-speaker.muted {
            opacity: 0.5;
        }

        /* 中间消息区域 */
        .voice-call-bubbles {
            flex: 1;
            padding: 20px 15px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        /* 通话气泡基础样式 */
        .voice-call-bubble {
            max-width: 80%;
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 15px;
            line-height: 1.5;
            word-break: break-word;
            animation: bubbleFadeIn 0.3s ease-out;
        }

        @keyframes bubbleFadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 用户气泡 - 靠右，深色半透明 */
        .voice-call-bubble.user {
            align-self: flex-end;
            background: rgba(30, 30, 30, 0.6);
            backdrop-filter: blur(12px);
            color: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-bottom-right-radius: 6px;
        }

        /* AI气泡 - 靠左，稍微亮一点的半透明 */
        .voice-call-bubble.ai {
            align-self: flex-start;
            background: rgba(60, 60, 60, 0.5);
            backdrop-filter: blur(12px);
            color: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-bottom-left-radius: 6px;
        }

        /* 底部控制区 */
        .voice-call-controls {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px 20px 40px 20px;
            gap: 20px;
        }

        /* 隐藏输入框 - 透明但可用 */
        .voice-call-input {
            width: 100%;
            max-width: 350px;
            padding: 14px 20px;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 30px;
            color: white;
            font-size: 15px;
            outline: none;
            transition: all 0.3s ease;
        }

        .voice-call-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .voice-call-input:focus {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.3);
        }

        /* 挂断按钮 */
        .voice-call-hangup {
            width: 70px;
            height: 70px;
            background: linear-gradient(145deg, #ff4757, #e84141);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 6px 20px rgba(232, 65, 65, 0.5);
            transition: transform 0.2s ease;
            animation: hangupBreathing 2s ease-in-out infinite;
        }

        .voice-call-hangup:active {
            transform: scale(0.9);
        }

        /* 挂断按钮呼吸灯动画 */
        @keyframes hangupBreathing {

            0%,
            100% {
                box-shadow: 0 6px 20px rgba(232, 65, 65, 0.5);
                transform: scale(1);
            }

            50% {
                box-shadow: 0 8px 30px rgba(232, 65, 65, 0.7), 0 0 40px rgba(232, 65, 65, 0.3);
                transform: scale(1.02);
            }
        }

        /* 挂断按钮内的图标旋转一下看起来像挂断 */
        .voice-call-hangup svg {
            transform: rotate(135deg);
        }

        /* 通话时的打字状态指示 */
        .voice-call-bubble.ai.typing::after {
            content: '...';
            animation: typingDots 1.2s infinite;
        }

        @keyframes typingDots {
            0% {
                content: '.';
            }

            33% {
                content: '..';
            }

            66% {
                content: '...';
            }
        }

        /* 语音通话输入栏 */
        .voice-call-input-bar {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            max-width: 380px;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 30px;
            padding: 6px 8px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        /* AI 回复按钮 */
        .voice-call-ai-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: linear-gradient(145deg, #ff6b81, #ff4757);
            color: white;
            font-size: 18px;
            cursor: pointer;
            flex-shrink: 0;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .voice-call-ai-btn:active {
            transform: scale(0.9);
        }

        /* 输入框 */
        .voice-call-input {
            flex: 1;
            background: transparent;
            border: none;
            color: white;
            font-size: 15px;
            outline: none;
            padding: 8px 0;
        }

        .voice-call-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        /* 发送按钮 */
        .voice-call-send-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: linear-gradient(145deg, #60a5fa, #3b82f6);
            color: white;
            font-size: 16px;
            cursor: pointer;
            flex-shrink: 0;
            transition: transform 0.2s ease;
        }

        .voice-call-send-btn:active {
            transform: scale(0.9);
        }

        /* 语音通话正在输入指示器 */
        .voice-call-typing {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 12px 18px;
        }

        .typing-dot {
            width: 8px;
            height: 8px;
            background: rgba(255, 255, 255, 0.7);
            border-radius: 50%;
            animation: typingBounce 1.4s ease-in-out infinite;
        }

        .typing-dot:nth-child(1) {
            animation-delay: 0s;
        }

        .typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes typingBounce {

            0%,
            60%,
            100% {
                transform: translateY(0);
                opacity: 0.5;
            }

            30% {
                transform: translateY(-6px);
                opacity: 1;
            }
        }

        /* ================= 视频通话按钮样式 ================= */
        .video-call-btn {
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: background-color 0.2s, transform 0.2s;
        }

        .video-call-btn:hover {
            background-color: rgba(0, 0, 0, 0.05);
        }

        .video-call-btn:active {
            transform: scale(0.95);
        }

        .icon-camera {
            width: 20px;
            height: 20px;
            fill: currentColor;
        }

        /* ================= 视频通话界面样式 (Video Call Layer) ================= */

        /* 视频通话容器 - 全屏覆盖 */
        #video-call-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 99999;
            display: none;
        }

        #video-call-layer.active {
            display: block;
        }

        /* 模拟视频背景 - 清晰显示AI头像 */
        .video-call-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #1a1a2e;
            background-size: cover;
            background-position: center;
            /* 不模糊，清晰显示 */
        }

        /* 浅色蒙层 - 增加文字可读性 */
        .video-call-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.15);
            pointer-events: none;
        }

        /* 视频通话内容层 */
        .video-call-content {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            z-index: 1;
        }

        /* 顶部迷你信息栏 */
        .video-call-header-mini {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            padding: 50px 20px 15px 20px;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
            z-index: 10;
        }

        .video-call-header-mini .video-call-name {
            font-size: 18px;
            font-weight: bold;
            color: white;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
        }

        .video-call-header-mini .video-call-timer {
            font-size: 13px;
            color: rgba(255, 255, 255, 0.8);
            font-family: 'SF Mono', 'Monaco', monospace;
            letter-spacing: 1px;
            text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
        }

        /* 视频通话消息区域 - 从顶部信息栏下方开始，可滚动 */
        .video-call-bubbles {
            position: absolute;
            top: 100px;
            /* 在顶部信息栏下方 */
            left: 0;
            right: 0;
            bottom: 180px;
            /* 底部控制区上方 */
            padding: 15px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        /* 视频通话气泡 - 复用语音通话气泡样式 */
        .video-call-bubble {
            max-width: 75%;
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 15px;
            line-height: 1.5;
            word-break: break-word;
            animation: bubbleFadeIn 0.3s ease-out;
        }

        /* 用户气泡 */
        .video-call-bubble.user {
            align-self: flex-end;
            background: rgba(30, 30, 30, 0.6);
            backdrop-filter: blur(12px);
            color: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-bottom-right-radius: 6px;
        }

        /* AI气泡 */
        .video-call-bubble.ai {
            align-self: flex-start;
            background: rgba(60, 60, 60, 0.5);
            backdrop-filter: blur(12px);
            color: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-bottom-left-radius: 6px;
        }

        /* 【重点】动作描述框样式 - 显示在AI消息气泡上方 */
        .action-bubble {
            align-self: flex-start;
            max-width: 80%;
            padding: 8px 14px;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(8px);
            border-radius: 12px;
            font-size: 13px;
            font-style: italic;
            color: #555;
            line-height: 1.4;
            margin-bottom: 4px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            animation: actionFadeIn 0.4s ease-out;
        }

        @keyframes actionFadeIn {
            from {
                opacity: 0;
                transform: translateY(5px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 视频通话底部控制区 - 固定在底部 */
        #video-call-layer .voice-call-controls {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
            padding: 30px 20px 40px 20px;
            z-index: 20;
        }

        /* 📹 视频通话打字指示器（三个跳动的点） */
        .video-call-bubble.video-call-typing {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 14px 20px;
            min-width: 60px;
        }

        .video-call-typing .typing-dot {
            width: 8px;
            height: 8px;
            background: rgba(255, 255, 255, 0.7);
            border-radius: 50%;
            animation: videoTypingBounce 1.4s ease-in-out infinite;
        }

        .video-call-typing .typing-dot:nth-child(1) {
            animation-delay: 0s;
        }

        .video-call-typing .typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .video-call-typing .typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes videoTypingBounce {

            0%,
            60%,
            100% {
                transform: translateY(0);
                opacity: 0.5;
            }

            30% {
                transform: translateY(-8px);
                opacity: 1;
            }
        }

        /* ==================== 主题气泡选择样式 ==================== */

        /* 主题选择器容器 */
        .theme-selector {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            padding: 10px;
            background: #fef8f9;
            border-radius: 12px;
            border: 1px solid #FFDEE9;
        }

        /* 主题选项 */
        .theme-option {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 8px;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 2px solid transparent;
        }

        .theme-option:hover {
            background: rgba(255, 183, 197, 0.2);
        }

        .theme-option.selected {
            background: rgba(255, 183, 197, 0.3);
            border-color: #FFB7C5;
        }

        .theme-option span {
            font-size: 11px;
            color: var(--text-brown);
            text-align: center;
        }

        /* 主题预览色块 */
        .theme-preview {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            position: relative;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        /* 预览色块样式 - 斜向对半分/三分显示 */
        .theme-preview::before,
        .theme-preview::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
        }

        /* 默认主题预览 (粉蓝+粉红) */
        .default-preview {
            background: linear-gradient(135deg, #e5f7ff 50%, #ffe5eb 50%);
            border: 2px solid #8bb1d0;
        }

        /* 草莓芭乐预览 */
        .berry-preview {
            background: linear-gradient(135deg, #ffffff 50%, #ffe5eb 50%);
            border: 2px solid #FFDEE9;
        }

        /* 薄荷生巧预览 */
        .mint-preview {
            background: linear-gradient(135deg, #8e867b 50%, #C2E5D3 50%);
            border: 2px solid #a4cbbf;
        }

        /* 葡萄冰奶预览 */
        .grape-preview {
            background: linear-gradient(135deg, #FFFBF0 50%, #f3e5ff 50%);
            border: 2px solid #d2b1f1;
        }

        /* 海盐苏打预览 */
        .ocean-preview {
            background: linear-gradient(135deg, #FFFFFF 50%, #e5f7ff 50%);
            border: 2px solid #D6E4FF;
        }

        /* 茉莉青提预览 */
        .jasmine-preview {
            background: linear-gradient(135deg, #F9FFF9 50%, #e6f9e9 50%);
            border: 2px solid #D8F3DC;
        }

        /* ==================== 5套主题CSS变量 ==================== */

        /* 草莓芭乐 */
        .theme-berry {
            --ai-bg: #ffffff;
            --ai-text: #5e5e5e;
            --ai-border-color: #FFDEE9;
            --ai-border-width: 2px;
            --me-bg: #ffe5eb;
            --me-text: #b76683;
            --me-border-color: #d5aab4;
            --me-border-width: 2px;
            --card-bg: #FFDEE9;
            --card-text: #ec6a8a;
            --card-icon-color: #FF9A9E;
            --card-footer-bg: #FF85A2;
            --card-footer-text: #FFFFFF;
        }

        /* 薄荷生巧 */
        .theme-mint {
            --ai-bg: #8e867b;
            --ai-text: #d6ffec;
            --ai-border-color: #a4cbbf;
            --ai-border-width: 2px;
            --me-bg: #C2E5D3;
            --me-text: #624e37;
            --me-border-color: #A8D8B9;
            --me-border-width: 2px;
            --card-bg: #C2E5D3;
            --card-text: #5E4B35;
            --card-icon-color: #C2E5D3;
            --card-footer-bg: #95856f;
            --card-footer-text: #FFFFFF;
        }

        /* 葡萄冰奶 */
        .theme-grape {
            --ai-bg: #FFFBF0;
            --ai-text: #705496;
            --ai-border-color: #d2b1f1;
            --ai-border-width: 2px;
            --me-bg: #f3e5ff;
            --me-text: #815889;
            --me-border-color: #af9cd3;
            --me-border-width: 2px;
            --card-bg: #EAE4FF;
            --card-text: #543E7A;
            --card-icon-color: #9F86C0;
            --card-footer-bg: #fff4d6;
            --card-footer-text: #6A4C93;
        }

        /* 海盐苏打 */
        .theme-ocean {
            --ai-bg: #FFFFFF;
            --ai-text: #004E89;
            --ai-border-color: #D6E4FF;
            --ai-border-width: 2px;
            --me-bg: #e5f7ff;
            --me-text: #325881;
            --me-border-color: #8bb1d0;
            --me-border-width: 2px;
            --card-bg: #E3F2FD;
            --card-text: #235ba4;
            --card-icon-color: #48CAE4;
            --card-footer-bg: #77bee4;
            --card-footer-text: #FFFFFF;
        }

        /* 茉莉青提 */
        .theme-jasmine {
            --ai-bg: #F9FFF9;
            --ai-text: #2D6A4F;
            --ai-border-color: #D8F3DC;
            --ai-border-width: 2px;
            --me-bg: #e6f9e9;
            --me-text: #1B4332;
            --me-border-color: #95D5B2;
            --me-border-width: 2px;
            --card-bg: #E8F7EE;
            --card-text: #2D6A4F;
            --card-icon-color: #52B788;
            --card-footer-bg: #74C69D;
            --card-footer-text: #FFFFFF;
        }

        /* ==================== 主题应用到气泡样式 ==================== */

        /* AI气泡主题样式 */
        [class*="theme-"] .chat-msg-row.ai .chat-bubble {
            background: var(--ai-bg);
            color: var(--ai-text);
            border: var(--ai-border-width) solid var(--ai-border-color);
        }

        /* 用户气泡主题样式 */
        [class*="theme-"] .chat-msg-row.me .chat-bubble {
            background: var(--me-bg);
            color: var(--me-text);
            border: var(--me-border-width) solid var(--me-border-color);
        }

        /* 转账卡片主题样式 */
        [class*="theme-"] .transfer-card {
            background: var(--card-bg);
            color: var(--card-text);
        }

        [class*="theme-"] .transfer-icon {
            color: var(--card-icon-color);
        }

        [class*="theme-"] .transfer-footer {
            background: var(--card-footer-bg);
            color: var(--card-footer-text);
        }

        [class*="theme-"] .transfer-note,
        [class*="theme-"] .transfer-amount {
            color: var(--card-text);
        }