@font-face {
            font-family: 'Classic-Lucida';
            src: url('assets/fonts/LucidaGrande.woff2') format('woff2');
            font-weight: normal;
            font-style: normal;
            font-display: swap;
            unicode-range: U+0000-00FF;
        }

        @font-face {
            font-family: 'Classic-Lucida';
            src: url('assets/fonts/LucidaGrande-Bold.woff2') format('woff2');
            font-weight: bold;
            font-style: normal;
            font-display: swap;
            unicode-range: U+0000-00FF;
        }

        :root {
            --aqua-blue-top: #73b6e7;
            --aqua-blue-bot: #1c62b5;
            --metal-grey-top: #e8e8e8;
            --metal-grey-bot: #b0b0b0;
            --pinstripe: #e0e0e0;
        }

        body,
        input,
        button {
            font-family: 'Classic-Lucida', "Noto Sans SC", "Noto Sans TC", "PingFang SC", "STHeiti", "华文黑体", sans-serif;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-shadow: 0 0 0.5px rgba(0, 0, 0, 0.2);
            letter-spacing: 0.2px;
        }

        body.dark-mode,
        body.dark-mode input,
        body.dark-mode button {
            -webkit-font-smoothing: subpixel-antialiased;
            text-shadow: 0 0 0.5px rgba(255, 255, 255, 0.2);
        }

        body {
            background-color: #c5c5c5;
            background-image: repeating-linear-gradient(0deg,
                    transparent,
                    transparent 5px,
                    rgba(255, 255, 255, 0.3) 5px,
                    rgba(255, 255, 255, 0.3) 7px);
            background-size: 100% 7px;
            height: 100vh;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .window-frame {
            width: 100%;
            max-width: 650px;
            height: 72vh;
            background: #ececec;
            border-radius: 5px 5px 3px 3px;
            box-shadow:
                0 20px 50px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        .modal-header {
            background: linear-gradient(to bottom,
                    #d8d8d8 0%,
                    #cccccc 30%,
                    #b3b3b3 70%,
                    #9f9f9f 100%);
            height: 16px;
            border-bottom: 1px solid #333;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
            width: 100%;
            flex-shrink: 0;
            border-radius: 4px 4px 0 0;
        }

        .header {
            background: linear-gradient(to bottom,
                    #d8d8d8 0%,
                    #cccccc 30%,
                    #b3b3b3 70%,
                    #9f9f9f 100%);
            padding: 0 15px;
            height: 31px;
            border-bottom: 1px solid #333;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
            flex-shrink: 0;
            cursor: default;
            position: relative;
            user-select: none;
            -webkit-user-select: none;
            position: relative;
            z-index: 10;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.1),
                0 1px 2px rgba(0, 0, 0, 0.4),
                0 8px 20px -5px rgba(0, 0, 0, 0.25);
        }

        .header h1 {
            margin: 0;
            font-size: 14px;
            color: #333;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 8px;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
        }

        .responsive-title {
            cursor: default !important;
            pointer-events: none;
            user-select: none;
            -webkit-user-select: none;
        }

        .window-controls {
            display: flex;
            gap: 7.2px;
            align-items: center;
        }

        .win-btn {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            position: relative;
            border: 1px solid rgba(0, 0, 0, 0.25);
            box-shadow:
                0 1px 2px rgba(0, 0, 0, 0.25),
                inset 0 2px 4px rgba(0, 0, 0, 0.35),
                inset 0 -3px 4px rgba(255, 255, 255, 0.7);
        }

        .win-btn::after {
            content: '';
            position: absolute;
            top: 1px;
            left: 2.5px;
            right: 2.5px;
            height: 4.5px;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.1) 100%);
            border-radius: 6px 6px 3px 3px;
        }

        .close {
            background: radial-gradient(circle at 50% 85%, #ffb3b3 0%, #ff2a2a 45%, #9a0000 90%);
            border: 1px solid #800000;
        }

        .min {
            background: radial-gradient(circle at 50% 85%, #ffee8c 0%, #ffaa00 45%, #a64b00 90%);
            border: 1px solid #854500;
        }

        .max {
            background: radial-gradient(circle at 50% 85%, #a9f274 0%, #3cc706 45%, #105c00 90%);
            border: 1px solid #114a02;
        }

        .status {
            font-size: 11px;
            color: #444;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
            white-space: nowrap;
            display: flex;
            align-items: center;
            justify-content: flex-end;
        }

        #chat-container {
            flex: 1;
            overflow-y: auto;
            padding: 18.5px 6.5px 18.5px 18.5px;
            display: flex;
            flex-direction: column;
            gap: 17px;
            background-color: #fbf9f9;
            box-shadow:
                inset 12px 0 15px -10px rgba(0, 0, 0, 0.25),
                inset -12px 0 15px -10px rgba(0, 0, 0, 0.25);
            scroll-behavior: smooth;
            scrollbar-gutter: stable;
        }

        #chat-container::-webkit-scrollbar {
            width: 12px;
        }

        #chat-container::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-left: 1px solid #ccc;
        }

        #chat-container::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 6px;
            border: 2px solid #f1f1f1;
        }

        #chat-container::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

        .message-row {
            display: flex;
            gap: 10px;
            width: 100%;
            align-items: flex-end;
        }

        .message-row.user {
            justify-content: flex-end;
        }

        .avatar {
            width: 40px;
            height: 40px;
            flex-shrink: 0;
            border-radius: 3px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 12px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.8);
        }

        .ai-avatar {
            background: linear-gradient(to bottom, #dcdcdc 0%, #a0a0a0 100%);
            color: #444;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
        }

        .user-avatar {
            background: linear-gradient(to bottom, #8dbce8 0%, #296bb1 100%);
            color: white;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
        }

        .bubble {
            padding: 5px 15px;
            border-radius: 20px;
            font-size: 13px;
            line-height: 1.4;
            box-sizing: border-box;
            max-width: calc(100% - 190px);
            position: relative;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(0, 0, 0, 0.3);
            overflow: hidden;
            z-index: 1;
            font-feature-settings: "palt" 1;
            -webkit-font-feature-settings: "palt" 1;
        }

        .bubble::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background: linear-gradient(to bottom,
                    rgba(255, 255, 255, 0.7) 0%,
                    rgba(255, 255, 255, 0.15) 100%);
            border-radius: 20px 20px 10px 10px;
            pointer-events: none;
        }

        .time-divider {
            font-family: "Lucida Grande", "Lucida Sans Unicode", "STHeiti", "华文黑体", Helvetica, Arial, sans-serif;
            text-shadow: 0 0 0.1px rgba(0, 0, 0, 0.2) !important;
            letter-spacing: normal !important;
            -webkit-font-smoothing: auto !important;
            -moz-osx-font-smoothing: auto !important;
            display: flex;
            align-items: center;
            text-align: center;
            color: #909090;
            font-size: 11px;
            font-weight: bold;
            margin: 10px 0;
            width: 100%;
        }

        .time-divider::before,
        .time-divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid #d0d0d0f4;
        }

        .time-divider::before {
            margin-right: 15px;
        }

        .time-divider::after {
            margin-left: 15px;
        }

        body.dark-mode .time-divider {
            color: #666;
            text-shadow: 0 0 0.3px rgba(255, 255, 255, 0.25) !important;
        }

        body.dark-mode .time-divider::before,
        body.dark-mode .time-divider::after {
            border-bottom: 1px solid #333;
        }

        .ai-bubble {
            color: #262626;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
            border-color: #99aab5;
            background-image:
                linear-gradient(to bottom,
                    rgba(255, 255, 255, 0.6) 0%,
                    rgba(255, 255, 255, 0.1) 100%),
                linear-gradient(to bottom,
                    #f2f6f8 0%,
                    #d8e1e7 50%,
                    #b5c6d0 51%,
                    #e0eff9 100%);
            background-size: 100% 50%, 100% 100%;
            background-repeat: no-repeat;
        }

        .ai-bubble::after {
            display: none;
        }

        .user-bubble {
            background: linear-gradient(to bottom,
                    #8ec1f5 0%,
                    #529df3 50%,
                    #267ce8 51%,
                    #4e9af2 100%);
            color: #fff;
            border-color: #16569e;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
        }

        .input-wrapper {
            background: linear-gradient(to bottom, #d0d0d0 0%, #a4a4a4 100%);
            padding: 10px 15px;
            border-top: 1px solid #777;
            display: flex;
            align-items: center;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
            height: 30px;
            flex-shrink: 0;
            position: relative;
            position: relative;
            z-index: 10;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
        }

        body.dark-mode .input-wrapper {
            background: linear-gradient(to bottom, #3a3a3a 0%, #222222 100%);
            border-top: 1px solid #0d0d0d;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }

        .input-wrapper::after {
            content: '';
            position: absolute;
            bottom: 3px;
            right: 3px;
            width: 14px;
            height: 14px;
            background-image: linear-gradient(135deg,
                    transparent 0px, transparent 10px,
                    rgba(0, 0, 0, 0.4) 10px, rgba(0, 0, 0, 0.4) 11px,
                    rgba(255, 255, 255, 0.9) 11px, rgba(255, 255, 255, 0.9) 12px,
                    transparent 12px, transparent 14px,
                    rgba(0, 0, 0, 0.4) 14px, rgba(0, 0, 0, 0.4) 15px,
                    rgba(255, 255, 255, 0.9) 15px, rgba(255, 255, 255, 0.9) 16px,
                    transparent 16px, transparent 18px,
                    rgba(0, 0, 0, 0.4) 18px, rgba(0, 0, 0, 0.4) 19px,
                    rgba(255, 255, 255, 0.9) 19px, rgba(255, 255, 255, 0.9) 20px);
            pointer-events: none;
        }

        .input-box {
            width: 95%;
            max-width: 10000px;
            margin: 0 auto;
            display: flex;
            gap: 10px;
            align-items: center;
        }

        input {
            flex: 1;
            background: #fefbfb;
            border: 1px solid #777;
            border-bottom-color: #999;
            color: #333;
            padding: 0 12px;
            height: 30px;
            box-sizing: border-box;
            border-radius: 3px;
            outline: none;
            font-size: 13px;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.5);
        }

        input[type="search"]::-webkit-search-decoration,
        input[type="search"]::-webkit-search-cancel-button,
        input[type="search"]::-webkit-search-results-button,
        input[type="search"]::-webkit-search-results-decoration {
            display: none;
            -webkit-appearance: none;
        }

        input[type="search"] {
            -webkit-appearance: none;
            appearance: none;
            box-sizing: border-box;
        }

        input:focus {
            box-shadow: 0 0 3px 2px rgba(130, 190, 255, 0.8), inset 0 2px 4px rgba(0, 0, 0, 0.2);
            border-color: #518cca;
        }

        button {
            background: linear-gradient(to bottom, #ffffff 0%, #f1f1f1 49%, #e1e1e1 51%, #f6f6f6 100%);
            color: #333;
            border: 1px solid #888;
            border-radius: 15px;
            font-weight: bold;
            font-size: 12px;
            cursor: pointer;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 1);
            text-shadow: 0 1px 0 #fff;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            height: 28px;
            line-height: 1;
            padding: 0 20px;
            box-sizing: border-box;
            -webkit-appearance: none;
            appearance: none;
            transition: background 0.1s, box-shadow 0.1s;
        }

        button:active,
        button.pressed {
            background: linear-gradient(to bottom, #d0d0d0 0%, #e0e0e0 100%);
            box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
            padding: 0 20px !important;
            transform: none !important;
            margin: 0 !important;
            border: 1px solid #888 !important;
        }

        button.primary {
            background: linear-gradient(to bottom, #8fcaf9 0%, #6cb4f2 49%, #348cdb 51%, #2778c1 100%);
            color: white;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
            border: 1px solid #1a5189;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
        }

        button.primary:hover {
            filter: brightness(1.05);
        }

        button.primary:active,
        button.primary.pressed {
            background: linear-gradient(to bottom, #2c6fb5 0%, #468ccf 100%);
            box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
        }

        .similarity-score {
            font-size: 0.7em;
            color: #666;
            margin-top: 5px;
            display: block;
            text-align: right;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
        }

        ul {
            margin: 5px 0 5px 20px;
            padding: 0;
        }

        b {
            color: #000;
        }

        @keyframes aquaPop {
            0% {
                opacity: 0;
                transform: translateY(20px) scale(0.9);
            }

            50% {
                opacity: 1;
            }

            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .message-row {
            animation: aquaPop 0.5s cubic-bezier(0.15, 1, 0.5, 1) forwards;
            opacity: 0;
            transform-origin: center bottom;
            will-change: transform, opacity;
        }

        .message-row.user {
            transform-origin: right bottom;
        }

        .message-row.ai {
            transform-origin: left bottom;
        }

        @media screen and (min-width: 768px) and (max-width: 1366px) {
            body {
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                height: 100vh !important;
                height: 100dvh !important;
                margin: 0 !important;
                overflow: hidden !important;
                background-color: #c5c5c5 !important;
                background-image: repeating-linear-gradient(0deg,
                        transparent,
                        transparent 5px,
                        rgba(255, 255, 255, 0.3) 5px,
                        rgba(255, 255, 255, 0.3) 7px) !important;
                background-size: 100% 7px !important;
            }

            .window-frame {
                width: 85% !important;
                height: 80% !important;
                max-width: 700px !important;
                max-height: 900px !important;
                border-radius: 4px !important;
                box-shadow:
                    0 20px 50px rgba(0, 0, 0, 0.5),
                    0 0 0 1px rgba(0, 0, 0, 0.5) !important;
                margin: 0 !important;
                position: static !important;
                transform: none !important;
                top: 0 !important;
            }
        }

        @media screen and (max-width: 768px) {
            #chat-container {
                padding-left: 10px !important;
                padding-right: 10px !important;
                scrollbar-width: none !important;
                -ms-overflow-style: none !important;
                --mobile-gap: 32px;
                gap: var(--mobile-gap) !important;
            }

            .time-divider {
                margin-top: calc(35px - var(--mobile-gap)) !important;
                margin-bottom: calc(35px - var(--mobile-gap)) !important;
                font-size: 11.5px !important;
            }

            #chat-container::-webkit-scrollbar {
                display: none !important;
                width: 0 !important;
                height: 0 !important;
            }

            .header h1 {
                cursor: pointer;
                user-select: none;
                text-decoration: underline dotted #666;
                position: static;
                transform: none;
                left: auto;
                margin: 0;
                letter-spacing: -0.2px !important;
            }

            .responsive-title {
                cursor: pointer !important;
                pointer-events: auto;
            }

            .status {
                margin-left: auto;
            }

            .modal-window .header h1 {
                text-decoration: none;
                padding-right: 0 !important;
                cursor: default;
                position: absolute;
                left: 50%;
                transform: translateX(-50%);
                margin: 0;
                text-align: center;
            }

            body {
                height: 100%;
                display: block;
                background: #ececec;
            }

            .window-frame {
                width: 100%;
                height: 100vh;
                height: 100dvh;
                max-width: none;
                border-radius: 0;
                box-shadow: none;
                animation-name: macBootFadeMobile;
            }

            .bubble {
                max-width: calc(100% - 87px);
                font-size: 15px;
                padding: 8px 14px;
            }

            .header {
                height: 44px;
            }

            .header h1 {
                font-size: 16px;
            }

            input {
                font-size: 16px;
                padding: 0 12px;
                height: 37.5px;
                line-height: normal;
                box-sizing: border-box;
                border-radius: 5px;
            }

            .input-wrapper {
                padding: 12px 10px;
                height: 42px;
            }

            .input-box button.primary {
                height: 37.5px !important;
                font-size: 14px !important;
                flex-shrink: 0 !important;
                white-space: nowrap !important;
                min-width: 64px !important;
                padding: 0 12px !important;
                border-radius: 6px !important;
                background: linear-gradient(to bottom,
                        #95c5f5 0%,
                        #75aef0 45%,
                        #3484e6 55%,
                        #78b1f2 100%) !important;
                border: 1px solid #16569e !important;
                color: #fff !important;
                text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3) !important;
                box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
            }

            .input-box button.primary:active,
            .input-box button.primary.pressed {
                background: linear-gradient(to bottom, #267ce8 0%, #4e9af2 100%) !important;
                box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4) !important;
            }

            .window-controls {
                display: none;
            }
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(2px);
            z-index: 9999;
            display: none;
            align-items: center;
            justify-content: center;
        }

        .modal-window {
            width: 420px;
            height: auto;
            max-width: 90%;
            background: #ececec;
            border-radius: 5px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            animation: aquaPop 0.2s cubic-bezier(0.15, 1, 0.5, 1);
        }

        .modal-header {
            background: linear-gradient(to bottom,
                    #ffffff 0%,
                    #eeeeee 25%,
                    #d4d4d4 70%,
                    #b5b5b5 100%);
            height: 21px;
            border-bottom: 1px solid #666;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
            width: 100%;
            flex-shrink: 0;
            border-radius: 4px 4px 0 0;
        }

        body.dark-mode .modal-header {
            background: linear-gradient(to bottom,
                    #5a5a5a 0%,
                    #3d3d3d 40%,
                    #262626 100%);
            border-bottom: 1px solid #000;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }

        .modal-body {
            display: flex;
            padding: 17px 25px;
            gap: 15px;
        }

        .modal-icon {
            width: 55px;
            height: 55px;
            flex-shrink: 0;
            filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
        }

        .modal-text {
            flex: 1;
            text-align: left;
            color: #333;
            line-height: 1.4;
        }

        .modal-text h2 {
            font-size: 14px;
            font-weight: bold;
            margin: 0 0 8px 0;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
        }

        .modal-text p {
            margin: 0;
            font-size: 11px;
        }

        .modal-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            padding: 0 25px 18px 25px;
        }

        .modal-buttons button {
            min-width: 88px;
            height: 23px;
            border-radius: 4px !important;
            padding: 0 15px !important;
            font-size: 12.3px;
        }

        button.secondary {
            background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 45%, #e0e0e0 55%, #f4f4f4 100%);
            border: 1px solid #888;
            color: #333;
            box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
        }

        .modal-buttons button.primary {
            background: linear-gradient(to bottom,
                    #95c5f5 0%,
                    #75aef0 45%,
                    #3484e6 55%,
                    #78b1f2 100%) !important;
            border: 1px solid #16569e !important;
            color: #fff !important;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3) !important;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
        }

        .modal-buttons button.primary:active {
            background: linear-gradient(to bottom, #267ce8 0%, #4e9af2 100%) !important;
            box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4) !important;
        }

        body.dark-mode .modal-window {
            background: #2b2b2b;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 0 1px #000;
        }

        body.dark-mode .modal-header {
            background: linear-gradient(to bottom, #444 0%, #333 100%);
            border-bottom: 1px solid #111;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }

        body.dark-mode .modal-text {
            color: #ddd;
        }

        body.dark-mode .modal-text h2 {
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.8);
        }

        body.dark-mode {
            background-color: #1a1a1a !important;
            background-image:
                repeating-linear-gradient(90deg,
                    transparent 0px,
                    transparent 2px,
                    rgba(0, 0, 0, 0.2) 2px,
                    rgba(0, 0, 0, 0.2) 4px),
                linear-gradient(to bottom, #2a2a2a, #1a1a1a) !important;
            background-size: 8px 100%, 100% 100% !important;
        }

        body.dark-mode .window-frame {
            background: #282828;
            box-shadow:
                0 30px 60px rgba(0, 0, 0, 0.6),
                0 0 0 1px #000,
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            border-radius: 4px;
        }

        body.dark-mode .win-btn {
            border: 1px solid #000;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 1px 2px rgba(0, 0, 0, 0.5);
        }

        body.dark-mode .win-btn::after {
            display: none;
        }

        body.dark-mode .close {
            background: linear-gradient(to bottom, #6b2e2e 0%, #400b0b 100%);
        }

        body.dark-mode .close:hover {
            filter: brightness(1.2);
        }

        body.dark-mode .min {
            background: linear-gradient(to bottom, #755f26 0%, #423208 100%);
        }

        body.dark-mode .min:hover {
            filter: brightness(1.2);
        }

        body.dark-mode .max {
            background: linear-gradient(to bottom, #366639 0%, #122b14 100%);
        }

        body.dark-mode .max:hover {
            filter: brightness(1.2);
        }

        body.dark-mode .header {
            background: linear-gradient(to bottom,
                    #444444 0%,
                    #333333 100%);
            border-bottom: 1px solid #000;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }

        body.dark-mode .header h1 {
            color: #ccc;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 1);
            font-weight: bold;
        }

        body.dark-mode .status {
            color: #999;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.8);
        }

        body.dark-mode #chat-container {
            background: #3e3e3e00;
            box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
        }

        body.dark-mode #chat-container::-webkit-scrollbar-track {
            background: #2a2a2a;
            border-left: 1px solid #111;
        }

        body.dark-mode #chat-container::-webkit-scrollbar-thumb {
            background: #444;
            border: 2px solid #2a2a2a;
        }

        body.dark-mode #chat-container::-webkit-scrollbar-thumb:hover {
            background: #666;
        }

        body.dark-mode .ai-bubble {
            color: #bfbfbf;
            text-shadow: 0 -1px 0 #000;
            border: 1px solid #000;
            background-image:
                radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                linear-gradient(to bottom, #363636 0%, #212121 100%);
            background-size: 3px 3px, 100% 100%;
            box-shadow:
                0 2px 5px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.08),
                inset 0 0 15px rgba(0, 0, 0, 0.2);
        }

        body.dark-mode .ai-bubble::after {
            display: none;
        }

        body.dark-mode b {
            color: #fff;
        }

        body.dark-mode .user-bubble {
            color: #c0c8d0;
            text-shadow: 0 -1px 0 #000;
            border: 1px solid #0d1218;
            background-image:
                repeating-linear-gradient(90deg,
                    rgba(255, 255, 255, 0.02) 0px,
                    rgba(255, 255, 255, 0.02) 1px,
                    transparent 1px,
                    transparent 2px),
                linear-gradient(to bottom, #2c3e50 0%, #15202b 100%);
            background-size: 100% 100%;
            box-shadow:
                0 2px 5px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.08),
                inset 0 0 10px rgba(0, 0, 0, 0.2);
        }

        body.dark-mode .user-bubble::after {
            display: none !important;
        }

        body.dark-mode .input-wrapper {
            background: linear-gradient(to bottom, #444 0%, #2a2a2a 100%);
            border-top: 1px solid #111;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }

        body.dark-mode .input-wrapper::after {
            background-image: linear-gradient(135deg,
                    transparent 0px, transparent 10px,
                    rgba(0, 0, 0, 0.8) 10px, rgba(0, 0, 0, 0.8) 11px,
                    rgba(255, 255, 255, 0.15) 11px, rgba(255, 255, 255, 0.15) 12px,
                    transparent 12px, transparent 14px,
                    rgba(0, 0, 0, 0.8) 14px, rgba(0, 0, 0, 0.8) 15px,
                    rgba(255, 255, 255, 0.15) 15px, rgba(255, 255, 255, 0.15) 16px,
                    transparent 16px, transparent 18px,
                    rgba(0, 0, 0, 0.8) 18px, rgba(0, 0, 0, 0.8) 19px,
                    rgba(255, 255, 255, 0.15) 19px, rgba(255, 255, 255, 0.15) 20px);
        }

        body.dark-mode input {
            background: #252525;
            color: #fff;
            border: 1px solid #111;
            border-bottom-color: #444;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.1);
        }

        body.dark-mode button.primary {
            color: #d9d9d9;
            text-shadow: 0 -1px 0 #000;
            border: 1px solid #000;
            background-image:
                radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                linear-gradient(to bottom, #464646 0%, #2a2a2a 100%);
            background-size: 3px 3px, 100% 100%;
            box-shadow:
                0 2px 4px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }

        body.dark-mode button.primary:hover {
            filter: brightness(1.1);
        }

        body.dark-mode button.primary:active,
        body.dark-mode button.primary.pressed {
            background: #222;
            box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.5);
            border-color: #000 !important;
            transform: translateY(1px);
        }

        body.dark-mode .modal-window {
            background: #2b2b2b;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
            border: 1px solid #000;
        }

        body.dark-mode .modal-content {
            color: #ccc;
        }

        body.dark-mode .ai-avatar {
            background: linear-gradient(to bottom,
                    #5e5e5e 0%,
                    #3d3d3d 100%);
            color: #ddd;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.8);
            border: 1px solid #222;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 1px 2px rgba(0, 0, 0, 0.4);
        }

        body.dark-mode .user-avatar {
            background: linear-gradient(to bottom,
                    #527090 0%,
                    #32465c 100%);
            color: #efefef;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.8);
            border: 1px solid #1a2633;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 1px 2px rgba(0, 0, 0, 0.4);
        }

        @keyframes macBootFade {
            0% {
                opacity: 0;
                transform: scale(0.96);
            }

            100% {
                opacity: 1;
                transform: scale(1);
            }
        }

        @keyframes macBootFadeMobile {
            0% {
                opacity: 0;
            }

            100% {
                opacity: 1;
            }
        }

        .window-frame {
            animation: macBootFade 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
            backface-visibility: hidden;
            -webkit-font-smoothing: subpixel-antialiased;
            transform: translateZ(0);
            will-change: transform, opacity;
        }

        @media screen and (max-width: 768px) {
            .window-frame {
                animation-name: macBootFadeMobile;
            }
        }

        .preload,
        .preload * {
            transition: none !important;
        }

        body,
        .window-frame,
        .header,
        .header h1,
        .status,
        .win-btn,
        #chat-container,
        .bubble,
        .input-wrapper,
        input,
        button,
        .avatar,
        .modal-window,
        .modal-content,
        ::-webkit-scrollbar-track,
        ::-webkit-scrollbar-thumb {
            transition:
                background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background-image 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                text-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .close,
        .min,
        .max {
            transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s;
        }

        @media screen and (min-width: 769px) {
            #send-btn {
                display: none !important;
            }

            .input-box {
                gap: 0;
            }

            .input-box input {
                width: 100%;
            }
        }

        #user-input {
            padding-right: 45px !important;
        }

        .emoji-item {
            cursor: pointer;
            font-size: 20px;
            padding: 4px;
            border-radius: 4px;
            text-align: center;
            transition: background 0.1s;
        }

        .emoji-item:hover {
            background: rgba(0, 0, 0, 0.1);
        }

        body.dark-mode #emoji-panel {
            background: #2b2b2b;
            border-color: #000;
        }

        body.dark-mode #emoji-btn svg path,
        body.dark-mode #emoji-btn svg circle,
        body.dark-mode #emoji-btn svg line {
            stroke: #ccc;
            fill: none;
        }

        body.dark-mode #emoji-btn svg path[fill="#333"] {
            fill: #ccc;
            stroke: none;
        }

        .resize-handle {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 20px;
            height: 20px;
            cursor: default;
            z-index: 100;
            background: transparent;
        }

        .win-btn::before {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.15s ease-in-out;
            color: rgba(0, 0, 0, 0.55);
            font-family: system-ui, -apple-system, sans-serif;
            font-weight: 900;
            z-index: 10;
            pointer-events: none;
        }

        .window-controls:hover .win-btn::before {
            opacity: 1;
        }

        .close::before {
            content: '\00D7';
            font-size: 10px;
        }

        .min::before {
            content: '\2212';
            font-size: 10px;
        }

        .max::before {
            content: '\002B';
            font-size: 11px;
        }

        body.dark-mode .win-btn::before {
            color: rgba(0, 0, 0, 0.85);
        }

        .typing-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            height: 18px;
            padding: 0 8px;
        }

        .typing-dot {
            width: 6px;
            height: 6px;
            background-color: #666;
            border-radius: 50%;
            animation: typingBounce 1.4s infinite ease-in-out both;
        }

        .typing-dot:nth-child(1) {
            animation-delay: -0.32s;
        }

        .typing-dot:nth-child(2) {
            animation-delay: -0.16s;
        }

        .typing-dot:nth-child(3) {
            animation-delay: 0s;
        }

        @keyframes typingBounce {

            0%,
            80%,
            100% {
                transform: scale(0);
            }

            40% {
                transform: scale(1);
            }
        }

        body.dark-mode .typing-dot {
            background-color: #ccc;
        }

        @keyframes textFadeIn {
            0% {
                opacity: 0;
                transform: translateY(3px);
            }

            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .retro-emoji {
            height: 1.4em;
            width: 1.4em;
            vertical-align: -0.25em;
            margin: 0 0.1em;
            display: inline-block;
            filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
        }

        body.dark-mode .modal-buttons button.primary,
        body.dark-mode .input-box button.primary {
            background: linear-gradient(to bottom, #2c4463 0%, #182a40 100%) !important;
            border: 1px solid #0a131d !important;
            color: #d0d8e0 !important;
            text-shadow: 0 -1px 0 #000 !important;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
            background-image: linear-gradient(to bottom, #2c4463 0%, #182a40 100%) !important;
        }

        body.dark-mode .modal-buttons button.primary:active,
        body.dark-mode .input-box button.primary:active,
        body.dark-mode .input-box button.primary.pressed {
            background: linear-gradient(to bottom, #111e2e 0%, #192b40 100%) !important;
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6) !important;
            border-color: #000 !important;
        }