        /* --- Core Variables --- */
        :root {
            --glass-bg: rgba(255, 255, 255, 0.65);
            --glass-border: rgba(255, 255, 255, 0.8);
            --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            --glass-blur: blur(40px) saturate(180%);
            
            --text-main: #1a1a1a;
            --text-sub: #555;
            --btn-black: #000;
            --btn-hover: #333;
        }

        /* --- Global Reset --- */
        * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent;}
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            font-size: 14px;
            color: var(--text-main);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
            background-color: #f0f0f0;
        }

        /* Background Layer */
        #bg-layer {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            z-index: -1;
            background-position: center; background-size: cover; background-repeat: no-repeat;
            transition: filter 0.3s ease;
            transform: scale(1.05); transform-origin: center;
        }

        a { text-decoration: none; color: inherit; }
        button, input { outline: none; font-family: inherit; }

        /* --- Header Navigation --- */
        header {
            display: flex; justify-content: flex-end; align-items: center;
            padding: 15px 25px; height: 60px; z-index: 10;
        }
        
        .nav-link { 
            margin: 0 12px; color: var(--text-main); font-size: 13px; font-weight: 500;
            text-shadow: 0 1px 2px rgba(255,255,255,0.8); cursor: pointer; opacity: 0.8;
            transition: opacity 0.2s;
        }
        .nav-link:hover { opacity: 1; text-decoration: underline; }

        .icon-btn {
            width: 44px; height: 44px; border-radius: 50%;
            display: flex; justify-content: center; align-items: center;
            cursor: pointer; margin-right: 8px; transition: background 0.2s;
        }
        .icon-btn:hover { background-color: rgba(255,255,255,0.4); }
        .icon-svg { fill: #5f6368; width: 24px; height: 24px; }

        /* Avatar */
        .avatar {
            width: 36px; height: 36px; border-radius: 50%;
            background-color: #11111136; color: white;
            display: flex; justify-content: center; align-items: center;
            font-size: 16px; margin-left: 10px; cursor: pointer;
            overflow: hidden; object-fit: cover;
            border: 2px solid rgba(255,255,255,0.9);
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
            transition: transform 0.2s;
        }
        .avatar:hover { transform: scale(1.05); }
        .avatar img { width: 100%; height: 100%; object-fit: cover; }

        /* --- Main Content Area --- */
        main {
            display: flex; flex-direction: column; align-items: center;
            justify-content: center; height: 80%; width: 100%; z-index: 10;
        }

        .logo-img { 
            height: 92px; margin-bottom: 30px; cursor: pointer; user-select: none; 
            filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
        }

        /* Search Container */
        .search-container { 
            width: 100%; max-width: 584px; position: relative; padding: 0 20px; 
            padding-bottom: 60px; 
        }
        
        .search-bar {
            display: flex; align-items: center;
            border: 1px solid rgba(0,0,0,0.1); 
            border-radius: 28px;
            height: 50px; padding: 0 16px; margin: 0 auto;
            background: #fff;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }
        
        .search-bar:hover, .search-bar.focus {
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            transform: translateY(-1px);
        }

        /* Glass Morphism Search Mode */
        .search-bar.glass-mode {
            background: rgba(255, 255, 255, 0.4);
            backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.8);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        }
        .search-bar.glass-mode .search-input { color: #000; text-shadow: 0 0 1px rgba(255,255,255,0.5); }
        .search-bar.glass-mode .search-icon { fill: #333; }

        .search-icon { fill: #9aa0a6; width: 20px; height: 20px; margin-right: 12px; }
        .search-input {
            flex-grow: 1; border: none; outline: none; background: transparent;
            font-size: 16px; color: #222; height: 100%;
        }

        /* Microphone Icon */
        .mic-icon { 
            width: 24px; height: 24px; cursor: pointer; margin: 0 8px; 
            transition: transform 0.2s; opacity: 0.7;
        }
        .mic-icon:hover { transform: scale(1.1); opacity: 1; }

        /* --- Modal System --- */
        .modal-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(4px);
            z-index: 1000;
            display: none; justify-content: center; align-items: center;
            opacity: 0; transition: opacity 0.3s ease;
        }
        .modal-overlay.active { opacity: 1; }
        


        .glass-panel {
            width: 520px; max-width: 92%;
            padding: 35px;
            display: flex; flex-direction: column;
            position: relative;
            

            background: rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(20px) saturate(120%);
            -webkit-backdrop-filter: blur(20px) saturate(120%);
            
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-top: 1px solid rgba(255, 255, 255, 0.35);
            border-bottom: 1px solid rgba(0, 0, 0, 0.4);
            border-radius: 32px;
            

            box-shadow: 
                0 40px 80px -20px rgba(0, 0, 0, 0.6), 
                inset 0 0 0 1px rgba(255, 255, 255, 0.03);
            
            transform: scale(0.92) translateY(10px);
            transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
            overflow: hidden;
        }

        .glass-panel::before {
            content: "";
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(125deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
            pointer-events: none;
            z-index: 0;
            border-radius: 32px;
        }
        .glass-panel > * { position: relative; z-index: 1; }
        .modal-overlay.active .glass-panel { transform: scale(1) translateY(0); }

        .modal-header {
            font-size: 20px; font-weight: 700; margin-bottom: 25px;
            color: #fff; display: flex; align-items: center; gap: 10px;
            padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1);
            text-shadow: 0 4px 8px rgba(0,0,0,0.3);
        }

        .header-icon { width: 24px; height: 24px; fill: #fff; }

        .modal-body { font-size: 14px; color: rgba(255,255,255,0.6); line-height: 1.6; margin-bottom: 25px; }

        /* Button Group */
        .modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: auto; }
        
        .modal-btn {
            padding: 10px 24px; border-radius: 16px; border: none; font-weight: 600; cursor: pointer; 
            transition: all 0.2s; font-size: 13px; letter-spacing: 0.3px;
        }
        /* Primary Button */
        .btn-black {
            background: rgba(255, 255, 255, 0.9); color: #000;
            box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        }
        .btn-black:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 15px 30px rgba(0,0,0,0.3); }
        
        /* Secondary Button */
        .btn-white {
            background: rgba(255, 255, 255, 0.05); color: #fff;
            border: 1px solid rgba(255,255,255,0.1);
            border-top: 1px solid rgba(255,255,255,0.3);
            border-bottom: 1px solid rgba(0,0,0,0.2);
        }
        .btn-white:hover { background: rgba(255, 255, 255, 0.15); border-top-color: rgba(255,255,255,0.5); }

        /* --- Settings Grid --- */
        .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        .setting-card {
            background: rgba(255,255,255,0.03); border-radius: 20px; padding: 25px;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            cursor: pointer; transition: all 0.3s ease;
            border: 1px solid rgba(255,255,255,0.05);
            border-top: 1px solid rgba(255,255,255,0.25);
            border-bottom: 1px solid rgba(0,0,0,0.3);
            height: 130px;
            position: relative;
            overflow: hidden;
        }
        .setting-card::before {
            content: "";
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(125deg, rgba(255,255,255,0.08) 0%, transparent 40%);
            pointer-events: none;
        }
        .setting-card:hover { 
            background: rgba(255,255,255,0.08); transform: translateY(-4px); 
            border-top-color: rgba(255,255,255,0.5);
            box-shadow: 0 20px 40px rgba(0,0,0,0.3); 
        }
        .card-icon-svg { width: 32px; height: 32px; fill: #fff; margin-bottom: 12px; }
        .card-text { font-weight: 600; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }

        /* Engine List */
        .engine-list { 
            display: flex; flex-direction: column; gap: 8px; 
            max-height: 250px; overflow-y: auto; padding-right: 5px;
            scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent;
        }
        .engine-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 16px; background: rgba(255,255,255,0.03); 
            border-radius: 14px; cursor: pointer; transition: all 0.2s;
            border: 1px solid rgba(255,255,255,0.05);
            border-top: 1px solid rgba(255,255,255,0.15);
            border-bottom: 1px solid rgba(0,0,0,0.2);
            color: rgba(255,255,255,0.8);
        }
        .engine-item:hover { background: rgba(255,255,255,0.08); transform: translateX(4px); border-top-color: rgba(255,255,255,0.3); }
        .engine-item.active { 
            background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); color: #fff; font-weight: 600;
            box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        }
        /* Selection Indicator */
        .check-icon { width: 18px; height: 18px; fill: #fff; opacity: 0; transition: opacity 0.2s; }
        .engine-item.active .check-icon { opacity: 1; }

        /* Delete Button */
        .delete-btn {
            width: 24px; height: 24px; border-radius: 50%;
            display: flex; justify-content: center; align-items: center;
            cursor: pointer; transition: all 0.2s;
            background: rgba(231, 76, 60, 0.2);
            border: 1px solid rgba(231, 76, 60, 0.3);
        }
        .delete-btn:hover { background: rgba(231, 76, 60, 0.4); transform: scale(1.1); }
        .delete-btn.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
        .delete-icon { width: 14px; height: 14px; fill: #e74c3c; }

        /* Input Fields */
        .input-group { margin-bottom: 15px; }
        .input-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 12px; color: rgba(255,255,255,0.5); }
        .input-group input { 
            width: 100%; padding: 12px 15px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1);
            border-top: 1px solid rgba(255,255,255,0.2);
            border-bottom: 1px solid rgba(0,0,0,0.3);
            background: rgba(255,255,255,0.05); font-size: 14px; color: #fff;
            transition: all 0.2s;
        }
        .input-group input::placeholder { color: rgba(255,255,255,0.3); }
        .input-group input:focus { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

        /* Range Slider */
        input[type=range] {
            width: 100%; margin: 15px 0; accent-color: #fff;
        }

        /* Hidden File Inputs */
        #avatarInput, #bgInput { display: none; }

        /* Toast */
        .toast {
            position: fixed; bottom: 50px; left: 50%; transform: translateX(-50%) translateY(20px);
            background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(10px);
            color: #fff; padding: 12px 30px; border-radius: 40px;
            font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 2000; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            letter-spacing: 0.5px;
        }
        .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
