        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif;
            background: linear-gradient(135deg, #fdf5e6 0%, #f5e6d3 50%, #fff8e7 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            color: #4a3f2e;
            position: relative;
        }
        
        /* SDG2 草和作物裝飾 */
        body::before {
            content: '';
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 150px;
            background: linear-gradient(to top, 
                rgba(218, 165, 32, 0.2) 0%, 
                rgba(218, 165, 32, 0.12) 50%,
                transparent 100%);
            pointer-events: none;
            z-index: 0;
        }
        
        body::after {
            content: '🌾 🌽 🌾 🌱 🌾 🌽 🌾 🌱 🌾 🌽 🌾 🌱 🌾 🌽 🌾 🌱 🌾 🌽 🌾 🌱 🌾 🌽 🌾 🌱 🌾 🌽 🌾 🌱 🌾 🌽 🌾 🌱 🌾 🌽 🌾';
            position: fixed;
            bottom: 15px;
            left: 0;
            right: 0;
            text-align: center;
            font-size: 2.2rem;
            opacity: 0.4;
            pointer-events: none;
            z-index: 0;
            letter-spacing: 1rem;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        }
        /* 書封輪播樣式 */
        .book-carousel-section {
            margin: 2rem 0;
            padding: 2rem 1rem;
            background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
            border-radius: 1rem;
            box-shadow: 0 4px 20px rgba(221, 166, 58, 0.15);
            border: 2px solid #dda63a;
            position: relative;
            z-index: 1;
        }
        
        .book-carousel-title {
            text-align: center;
            margin-bottom: 2rem;
            color: #4a3f2e;
            font-size: 1.5rem;
            font-weight: 700;
            background: linear-gradient(135deg, #dda63a 0%, #c5933a 50%, #b88a2f 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .book-carousel {
            position: relative;
            width: 100%;
            overflow: hidden;
            border-radius: 0.75rem;
        }
        
        .book-carousel-container {
            display: flex;
            transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            will-change: transform;
        }
        
        .book-slide {
            min-width: 100%;
            display: none;
            justify-content: center;
            align-items: center;
            gap: 2rem;
            padding: 2rem;
        }
        
        .book-slide.active {
            display: flex;
        }
        
        .book-item {
            text-align: center;
            transition: transform 0.3s ease;
            cursor: pointer;
            max-width: 180px;
        }
        
        .book-item:hover {
            transform: translateY(-10px) scale(1.05);
        }
        
        .book-cover {
            width: 150px;
            height: 200px;
            object-fit: cover;
            border-radius: 0.5rem;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
            transition: all 0.3s ease;
            border: 2px solid #e2e8f0;
        }
        
        .book-item:hover .book-cover {
            box-shadow: 0 12px 36px rgba(221, 166, 58, 0.35);
            border-color: #dda63a;
        }
        
        .book-title {
            margin-top: 1rem;
            font-size: 0.9rem;
            font-weight: 600;
            color: #2c3e50;
            line-height: 1.4;
            min-height: 2.8rem;
            max-height: 7rem;
            overflow: hidden;
            display: -webkit-box;
            -webkit-line-clamp: 5;
            line-clamp: 5;
            -webkit-box-orient: vertical;
            word-break: break-word;
        }
        
        .book-author {
            font-size: 0.8rem;
            color: #64748b;
            margin-top: 0.5rem;
            font-weight: 400;
        }
        
        .carousel-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255, 255, 255, 0.9);
            border: 2px solid #e2e8f0;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            z-index: 10;
            font-size: 1.2rem;
            color: #64748b;
            backdrop-filter: blur(10px);
        }
        
        .carousel-nav:hover {
            background: rgba(221, 166, 58, 0.15);
            border-color: #dda63a;
            color: #dda63a;
            transform: translateY(-50%) scale(1.1);
        }
        
        .carousel-nav.prev {
            left: 1rem;
        }
        
        .carousel-nav.next {
            right: 1rem;
        }
        
        .carousel-dots {
            display: flex;
            justify-content: center;
            gap: 0.75rem;
            margin-top: 2rem;
        }
        
        .carousel-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #cbd5e1;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }
        
        .carousel-dot.active {
            background: #dda63a;
            transform: scale(1.2);
            border-color: rgba(221, 166, 58, 0.3);
            box-shadow: 0 0 0 4px rgba(221, 166, 58, 0.15);
        }
        
        .carousel-dot:hover:not(.active) {
            background: #94a3b8;
            transform: scale(1.1);
        }
        
        @media (max-width: 768px) {
            .book-slide {
                gap: 1rem;
                padding: 1rem;
                flex-wrap: wrap;
            }
            
            .book-item {
                max-width: 140px;
            }
            
            .book-cover {
                width: 120px;
                height: 160px;
            }
            
            .carousel-nav {
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }
            
            .carousel-nav.prev {
                left: 0.5rem;
            }
            
            .carousel-nav.next {
                right: 0.5rem;
            }
        }


        .header {
            background: linear-gradient(135deg, #fff9e6 0%, #fef6e0 100%);
            border-bottom: 5px solid #dda63a;
            padding: 2rem 1.5rem;
            box-shadow: 0 4px 20px rgba(221, 166, 58, 0.15);
            position: relative;
            overflow: hidden;
            z-index: 1;
        }
        .header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(120deg, 
                rgba(221, 166, 58, 0.08) 0%, 
                rgba(197, 147, 58, 0.06) 50%,
                rgba(184, 138, 47, 0.04) 100%);
            z-index: 0;
        }
        
        .header::after {
            content: '🌾';
            position: absolute;
            font-size: 4rem;
            opacity: 0.08;
            top: 50%;
            left: 10%;
            transform: translateY(-50%) rotate(-15deg);
            z-index: 0;
        }
        
        /* 右側裝飾 */
        .header-content::before {
            content: '🌽';
            position: absolute;
            font-size: 3.5rem;
            opacity: 0.1;
            top: 20%;
            right: 5%;
            transform: rotate(20deg);
            z-index: 0;
        }
        
        .header-content::after {
            content: '🌱';
            position: absolute;
            font-size: 2.5rem;
            opacity: 0.12;
            bottom: 15%;
            right: 12%;
            z-index: 0;
        }
        .header-content {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            justify-content: center;
            flex-wrap: wrap;
            position: relative;
            z-index: 1;
        }
        .header-logo {
            width: 90px;
            height: 90px;
            object-fit: contain;
            animation: float 3s ease-in-out infinite;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
        }
        @keyframes float {
            0%, 100% { transform: translateY(0px) rotate(0deg); }
            50% { transform: translateY(-12px) rotate(2deg); }
        }
        .header-text {
            flex: 1;
            min-width: 300px;
        }
        .language-selector {
            position: fixed;
            bottom: 20px;
            right: 20px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(255, 255, 255, 0.95);
            padding: 0.75rem 1rem;
            border-radius: 0.5rem;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            z-index: 1000;
        }
        .language-selector label {
            font-size: 0.9rem;
            color: #5a6c7d;
            font-weight: 500;
        }
        .language-selector select {
            padding: 0.5rem 0.75rem;
            border: 2px solid #e0e0e0;
            border-radius: 0.375rem;
            background: white;
            color: #2c3e50;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .language-selector select:hover {
            border-color: #dda63a;
        }
        .language-selector select:focus {
            outline: none;
            border-color: #dda63a;
            box-shadow: 0 0 0 3px rgba(221, 166, 58, 0.15);
        }
        .header h1 {
            background: linear-gradient(135deg, #dda63a 0%, #c5933a 50%, #b88a2f 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-size: 2.5rem;
            font-weight: 900;
            margin-bottom: 0.5rem;
            text-shadow: none;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
            letter-spacing: 0.5px;
        }
        .header .subtitle {
            color: #5a6c7d;
            font-size: 1.1rem;
            font-weight: 600;
            letter-spacing: 2px;
        }
        .status {
            background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
            color: #2e7d32;
            padding: 1rem;
            border-radius: 0.75rem;
            font-size: 0.95rem;
            border: 2px solid #81c784;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
        }
        .status.raw-mode {
            background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
            color: #e65100;
            border: 2px solid #ffb74d;
        }
        .status.error {
            background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
            color: #c62828;
            border: 2px solid #e57373;
        }
        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
        }
        .feature {
            background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
            padding: 0.85rem;
            border-radius: 0.75rem;
            text-align: center;
            color: #2c3e50;
            font-size: 0.9rem;
            border: 2px solid transparent;
            background-clip: padding-box;
            position: relative;
            font-weight: 500;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            transition: all 0.3s ease;
        }
        .feature::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 0.75rem;
            padding: 2px;
            background: linear-gradient(135deg, #26bde2, #56c02b, #fcc30b, #e5243b);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .feature:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        }
        .feature:hover::before {
            opacity: 1;
        }
        .chat-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            max-width: 1000px;
            margin: 1.5rem auto 3.5rem auto;
            width: calc(100% - 3rem);
            background: #ffffff;
            border-radius: 1.2rem;
            box-shadow: 0 8px 32px rgba(221, 166, 58, 0.2);
            overflow: hidden;
            min-height: 80vh;
            height: auto;
            border: 3px solid #dda63a;
            background-clip: padding-box;
            position: relative;
            z-index: 1;
        }
        .chat-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 1.2rem;
            padding: 3px;
            background: linear-gradient(135deg, 
                #dda63a 0%, #c5933a 50%, #b88a2f 100%);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask-composite: exclude;
            z-index: -1;
        }
        .model-selector {
            padding: 1rem 1.5rem;
            border-bottom: 2px solid #e3f2fd;
            background: linear-gradient(135deg, #f0f9ff 0%, #e3f2fd 100%);
        }
        .model-selector h3 {
            color: #0077b6;
            font-size: 1rem;
            margin-bottom: 0.75rem;
            font-weight: 600;
        }
        .model-controls {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }
        .model-dropdown {
            padding: 0.5rem 1rem;
            border: 2px solid #56c1ff;
            border-radius: 0.5rem;
            background: #ffffff;
            font-size: 0.9rem;
            color: #0077b6;
            cursor: pointer;
            transition: all 0.2s ease;
            min-width: 200px;
            font-weight: 500;
        }
        .model-dropdown:hover {
            border-color: #009edb;
            box-shadow: 0 0 0 3px rgba(0, 158, 219, 0.1);
        }
        .model-dropdown:focus {
            outline: none;
            border-color: #009edb;
            box-shadow: 0 0 0 3px rgba(0, 158, 219, 0.2);
        }
        .current-model {
            font-size: 0.85rem;
            color: #0077b6;
            background: #e3f2fd;
            padding: 0.35rem 0.85rem;
            border-radius: 1.5rem;
            border: 2px solid #56c1ff;
            font-weight: 500;
        }
        .quick-actions {
            padding: 1.5rem;
            background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
            border-bottom: none;
        }
        .quick-actions h3 {
            color: #4a3f2e;
            font-size: 1.2rem;
            margin-bottom: 1rem;
            font-weight: 700;
            text-align: center;
        }
        .preset-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        .preset-button {
            background: linear-gradient(135deg, #dda63a 0%, #c5933a 100%);
            color: white;
            border: none;
            padding: 0.65rem 1.3rem;
            border-radius: 2rem;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(221, 166, 58, 0.3);
            font-weight: 600;
            border: 2px solid transparent;
            position: relative;
            overflow: hidden;
        }
        .preset-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.5s;
        }
        .preset-button:hover::before {
            left: 100%;
        }
        /* 所有快速按鈕統一使用 SDG2 金黃色系 hover 效果 */
        .preset-button:hover {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 100%) !important;
            box-shadow: 0 6px 20px rgba(221, 166, 58, 0.5) !important;
            transform: translateY(-2px);
            border-color: rgba(255, 255, 255, 0.3);
        }
        /* SDG12 - 負責任的消費與生產（永續時尚）*/
        .preset-button.sdg12-button:hover {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 100%) !important;
            box-shadow: 0 6px 20px rgba(221, 166, 58, 0.5) !important;
            transform: translateY(-2px);
        }
        /* SDG13 - 氣候行動（氣候變遷/氣候行動）*/
        .preset-button.sdg13-button:hover {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 100%) !important;
            box-shadow: 0 6px 20px rgba(221, 166, 58, 0.5) !important;
            transform: translateY(-2px);
        }
        /* SDG7 - 負擔得起的清潔能源（永續能源）*/
        .preset-button.sdg7-button:hover {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 100%) !important;
            box-shadow: 0 6px 20px rgba(221, 166, 58, 0.5) !important;
            transform: translateY(-2px);
        }
        /* SDG5 - 性別平等 */
        .preset-button.sdg5-button:hover {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 100%) !important;
            box-shadow: 0 6px 20px rgba(221, 166, 58, 0.5) !important;
            transform: translateY(-2px);
        }
        /* SDG4 - 優質教育（英語練習活動）*/
        .preset-button.sdg4-button:hover {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 100%) !important;
            box-shadow: 0 6px 20px rgba(221, 166, 58, 0.5) !important;
            transform: translateY(-2px);
        }
        /* SDG3 - 良好健康與福祉（放鬆身心）*/
        .preset-button.sdg3-button:hover {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 100%) !important;
            box-shadow: 0 6px 20px rgba(221, 166, 58, 0.5) !important;
            transform: translateY(-2px);
        }
        /* ASF - 非洲豬瘟 */
        .preset-button.asf-button:hover {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 100%) !important;
            box-shadow: 0 6px 20px rgba(221, 166, 58, 0.5) !important;
            transform: translateY(-2px);
        }
        .messages {
            flex: 1;
            overflow-y: auto;
            padding: 1.5rem 1.5rem 8rem 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            min-height: 400px;
            background: #ffffff;
        }
        .message {
            max-width: 85%;
            padding: 1rem 1.25rem;
            border-radius: 1rem;
            line-height: 1.6;
            animation: slideIn 0.3s ease-out;
            word-wrap: break-word;
            min-height: 20px;
            flex-shrink: 0;
        }
        @keyframes slideIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes slideOut {
            from { opacity: 1; transform: translateY(0); }
            to { opacity: 0; transform: translateY(-10px); }
        }
        .message.user {
            align-self: flex-end;
            background: linear-gradient(135deg, #26bde2 0%, #0a97d9 100%);
            color: white;
            box-shadow: 0 4px 16px rgba(38, 189, 226, 0.3);
            white-space: pre-line;
            border: none;
            position: relative;
            overflow: hidden;
        }
        .message.user::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: shimmer 3s infinite;
        }
        @keyframes shimmer {
            0%, 100% { transform: translate(0, 0); }
            50% { transform: translate(-20%, -20%); }
        }
        .message.assistant {
            align-self: flex-start;
            background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
            color: #2c3e50;
            border: 2px solid #e9ecef;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
        }
        .message.tool {
            align-self: center;
            background: linear-gradient(135deg, #56c02b 0%, #4c9f38 100%);
            color: white;
            font-size: 0.9em;
            max-width: 90%;
            box-shadow: 0 4px 16px rgba(86, 192, 43, 0.3);
        }
        .message.warning {
            align-self: center;
            background: linear-gradient(135deg, #fcc30b 0%, #dda63a 100%);
            color: #664d00;
            font-size: 0.95em;
            max-width: 95%;
            box-shadow: 0 4px 16px rgba(252, 195, 11, 0.3);
            border-left: 4px solid #bf8b2e;
            font-weight: 600;
        }
        .message.error {
            align-self: center;
            background: linear-gradient(135deg, #e5243b 0%, #c5192d 100%);
            color: white;
            font-size: 0.95em;
            max-width: 95%;
            box-shadow: 0 4px 16px rgba(229, 36, 59, 0.3);
            font-weight: 600;
        }
        .input-area {
            padding: 1.5rem 1.5rem 2rem 1.5rem;
            border-top: 2px solid #f5e6d3;
            background: linear-gradient(135deg, #fffbf0 0%, #ffffff 100%);
        }
        .input-container {
            display: flex;
            gap: 0.75rem;
            align-items: stretch;
        }
        .message-input {
            flex: 1;
            padding: 1rem 1.25rem;
            border: 2px solid #dda63a;
            border-radius: 0.75rem;
            outline: none;
            font-size: 1rem;
            transition: all 0.2s ease;
            background: white;
            resize: none;
            min-height: 50px;
            max-height: 120px;
            font-family: inherit;
            color: #1d1d1d;
        }
        .message-input:focus {
            border-color: #c5933a;
            box-shadow: 0 0 0 4px rgba(221, 166, 58, 0.15);
        }
        .button-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        /* 自動完成樣式 */
        .autocomplete-container {
            position: relative;
            width: 100%;
        }
        .autocomplete-dropdown {
            display: none;
            position: absolute;
            bottom: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 2px solid #dda63a;
            border-radius: 0.75rem;
            margin-bottom: 0.5rem;
            max-height: 320px;
            overflow-y: auto;
            box-shadow: 0 -4px 16px rgba(221, 166, 58, 0.2);
            z-index: 1000;
        }
        .autocomplete-dropdown.show {
            display: block;
        }
        .autocomplete-item {
            padding: 0.75rem 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            border-bottom: 1px solid #f0f0f0;
            color: #2c3e50;
            font-size: 0.95rem;
        }
        .autocomplete-item:last-child {
            border-bottom: none;
        }
        .autocomplete-item:hover,
        .autocomplete-item.selected {
            background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
            color: #dda63a;
            font-weight: 500;
        }
        .autocomplete-dropdown::-webkit-scrollbar {
            width: 8px;
        }
        .autocomplete-dropdown::-webkit-scrollbar-track {
            background: #f0f0f0;
            border-radius: 0.75rem;
        }
        .autocomplete-dropdown::-webkit-scrollbar-thumb {
            background: #dda63a;
            border-radius: 0.75rem;
        }
        .autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
            background: #c5933a;
        }
        .send-button {
            padding: 1.1rem 2.5rem;
            background: linear-gradient(135deg, #dda63a 0%, #c5933a 50%, #b88a2f 100%);
            color: white;
            border: none;
            border-radius: 3rem;
            cursor: pointer;
            font-size: 1.05rem;
            font-weight: 700;
            letter-spacing: 0.5px;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 
                0 6px 20px rgba(221, 166, 58, 0.4),
                inset 0 -2px 8px rgba(0, 0, 0, 0.15),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
            white-space: nowrap;
            position: relative;
            overflow: hidden;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        
        /* 光澤效果 */
        .send-button::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(
                45deg,
                transparent 30%,
                rgba(255, 255, 255, 0.3) 50%,
                transparent 70%
            );
            transform: rotate(45deg);
            transition: all 0.6s ease;
        }
        
        /* 脈衝效果 */
        .send-button::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
            transform: translate(-50%, -50%) scale(0);
            border-radius: 50%;
            transition: transform 0.5s ease;
            opacity: 0;
        }
        
        .send-button:hover::before {
            left: 150%;
        }
        
        .send-button:active::after {
            transform: translate(-50%, -50%) scale(2);
            opacity: 1;
            transition: transform 0s, opacity 0.3s;
        }
        
        .send-button:hover:not(:disabled) {
            background: linear-gradient(135deg, #c5933a 0%, #b88a2f 50%, #a67928 100%);
            transform: translateY(-3px) scale(1.03);
            box-shadow: 
                0 10px 30px rgba(221, 166, 58, 0.5),
                inset 0 -2px 8px rgba(0, 0, 0, 0.2),
                inset 0 2px 6px rgba(255, 255, 255, 0.4),
                0 0 20px rgba(221, 166, 58, 0.3);
        }
        
        .send-button:active:not(:disabled) {
            transform: translateY(-1px) scale(0.98);
            box-shadow: 
                0 4px 15px rgba(221, 166, 58, 0.4),
                inset 0 2px 8px rgba(0, 0, 0, 0.25);
            transition: all 0.1s ease;
        }
        
        .send-button:disabled {
            background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
            cursor: not-allowed;
            transform: none;
            box-shadow: 
                0 2px 8px rgba(0, 0, 0, 0.1),
                inset 0 1px 3px rgba(255, 255, 255, 0.2);
            opacity: 0.6;
            color: #6b7280;
        }
        
        /* 按鈕圖標動畫 */
        .send-button:hover .button-icon {
            animation: fly 0.6s ease-in-out;
        }
        
        @keyframes fly {
            0%, 100% { transform: translateX(0) translateY(0); }
            25% { transform: translateX(3px) translateY(-3px); }
            50% { transform: translateX(6px) translateY(-6px); opacity: 0.7; }
            75% { transform: translateX(3px) translateY(-3px); }
        }
        
        /* 思考過程樣式 - 全域隱藏 */
        .thinking-process,
        .thinking-message {
            display: none !important;
        }
        
        /* 保留樣式定義以防需要 */
        .thinking-process-legacy {
            margin: 15px 0;
            padding: 0;
            background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
            border: 2px solid #fcc30b;
            border-radius: 0.75rem;
            font-size: 14px;
            color: #6d4c00;
            overflow: hidden;
            animation: slideIn 0.3s ease-out;
            max-width: 90%;
            align-self: flex-start;
            flex-shrink: 0;
        }
        
        .thinking-header {
            background: rgba(252, 195, 11, 0.15);
            padding: 12px 16px;
            font-weight: 600;
            border-bottom: 2px solid #fcc30b;
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            transition: all 0.2s ease;
            user-select: none;
        }
        
        .thinking-header:hover {
            background: rgba(252, 195, 11, 0.25);
        }
        
        .thinking-header .toggle-icon {
            font-size: 0.9em;
            transition: transform 0.3s ease;
            color: #bf8b2e;
        }
        
        .thinking-steps {
            padding: 12px 16px;
        }
        
        .thinking-step {
            margin: 8px 0;
            padding: 10px 12px;
            background: #ffffff;
            border-radius: 0.5rem;
            border-left: 3px solid #fcc30b;
            line-height: 1.5;
            animation: fadeInStep 0.4s ease-out;
        }
        
        @keyframes fadeInStep {
            from { opacity: 0; transform: translateX(-10px); }
            to { opacity: 1; transform: translateX(0); }
        }
        
        /* 工具執行結果樣式 - 全域隱藏 */
        .tool-execution {
            display: none !important;
        }
        
        /* 保留樣式定義以防需要 */
        .tool-execution-legacy {
            margin: 15px 0;
            border: 2px solid #56c1ff;
            border-radius: 0.75rem;
            overflow: hidden;
            animation: slideIn 0.3s ease-out;
            max-width: 90%;
            align-self: flex-start;
            background: white;
            box-shadow: 0 4px 12px rgba(0, 119, 182, 0.1);
            min-height: 60px;
            flex-shrink: 0;
        }
        
        .tool-header {
            background: linear-gradient(135deg, #e3f2fd 0%, #f0f9ff 100%);
            padding: 14px 18px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 600;
            color: #0077b6;
            transition: all 0.2s ease;
            user-select: none;
            min-height: 52px;
            border-bottom: 2px solid #56c1ff;
        }
        
        .tool-header:hover {
            background: linear-gradient(135deg, #d4edfe 0%, #e3f2fd 100%);
        }
        
        .tool-header.executing {
            background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
            color: #bf8b2e;
        }
        
        .tool-header.completed {
            background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
            color: #2e7d32;
        }
        
        .tool-header.error {
            background: linear-gradient(135deg, #ffebee 0%, #fef5f5 100%);
            color: #c62828;
        }
        
        .tool-title {
            display: flex;
            align-items: center;
            gap: 10px; /* 增加間距 */
            font-size: 14px; /* 調整標題字體大小 */
        }
        
        .tool-toggle {
            font-size: 16px; /* 增大切換按鈕字體 */
            transition: transform 0.3s ease;
            color: #495057;
            cursor: pointer;
            padding: 4px 8px; /* 增加點擊區域 */
            border-radius: 4px;
            user-select: none;
        }
        
        .tool-toggle:hover {
            background-color: rgba(0,0,0,0.1);
        }
        
        .tool-toggle.expanded {
            transform: rotate(180deg);
        }
        
        .tool-content {
            overflow-y: auto;
            max-height: 600px;
            background: #f8fafc;
            padding: 16px;
        }
        
        .tool-result {
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 12px;
            white-space: pre-wrap;
            background: white;
            padding: 16px;
            border-radius: 0.5rem;
            border: 1px solid #e2e8f0;
            line-height: 1.4;
            max-height: 550px;
            min-height: 150px;
            overflow-y: auto;
            word-wrap: break-word;
        }
        
        .tool-result-item {
            margin-bottom: 12px;
            padding: 12px;
            border-left: 3px solid #22c55e;
            background: #f0fdf4;
            border-radius: 0.25rem;
            min-height: 60px;
        }
        
        .tool-result-item.error {
            border-left-color: #ef4444;
            background: #fef2f2;
        }
        
        .tool-result-item.executing {
            border-left-color: #f59e0b;
            background: #fffbeb;
        }
        
        .result-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px; /* 增加間距 */
            font-size: 12px;
            color: #6c757d;
        }
        
        .result-timestamp {
            font-family: monospace;
            background: #e9ecef;
            padding: 2px 6px;
            border-radius: 3px;
        }
        
        .result-status {
            background: #3b82f6;
            color: white;
            padding: 2px 6px;
            border-radius: 0.25rem;
            font-size: 11px;
            text-transform: uppercase;
        }
        
        .result-content {
            margin-top: 8px;
            padding: 8px;
            background: white;
            border-radius: 0.25rem;
            border: 1px solid #e2e8f0;
            min-height: 40px;
        }
        
        .tool-loading {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #6c757d;
            font-style: italic;
        }
        
        .tool-id {
            font-size: 10px;
            color: #6c757d;
            margin-left: 8px;
        }
        
        /* 載入動畫 */
        .loading-dots {
            display: inline-block;
        }
        
        .loading-dots::after {
            content: '';
            animation: dots 1.5s infinite;
        }
        
        @keyframes dots {
            0%, 20% { content: ''; }
            40% { content: '.'; }
            60% { content: '..'; }
            80%, 100% { content: '...'; }
        }
        
        /* 進度指示器 */
        .progress-indicator {
            margin: 15px 0;
            padding: 12px 16px;
            background: linear-gradient(135deg, #e3f2fd 0%, #f0f9ff 100%);
            border: 2px solid #56c1ff;
            border-radius: 0.75rem;
            color: #0077b6;
            font-size: 14px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
            animation: slideIn 0.3s ease-out;
            max-width: 85%;
            align-self: flex-start;
            flex-shrink: 0;
            box-shadow: 0 4px 12px rgba(0, 119, 182, 0.1);
        }
        
        .progress-icon {
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        .typing {
            align-self: flex-start;
            background: linear-gradient(135deg, #fff5f0 0%, #ffe8e0 100%);
            color: #d2421a;
            font-style: normal;
            border: 2px solid #ff6b35;
            border-left: 4px solid #ff6b35;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            max-width: 85%;
            box-shadow: 0 4px 16px rgba(255, 107, 53, 0.2);
        }
        .typing-dots {
            display: inline-flex;
            gap: 0.25rem;
        }
        .typing-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #009edb;
            animation: typing 1.4s infinite ease-in-out;
        }
        .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 typing {
            0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
            40% { transform: scale(1); opacity: 1; }
        }
        
        /* 打字機效果樣式 */
        .typewriter-cursor::after {
            content: '|';
            opacity: 1;
            animation: blink 1s infinite;
            color: #009edb;
            font-weight: bold;
        }
        
        @keyframes blink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0; }
        }
        
        /* 底部免責聲明樣式 */
        .bottom-disclaimer {
            background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
            border-top: 3px solid transparent;
            border-image: linear-gradient(90deg, 
                #e5243b 0%, #26bde2 25%, #56c02b 50%, #fcc30b 75%, #dd1367 100%) 1;
            color: #5a6c7d;
            padding: 0.6rem 1rem;
            text-align: center;
            margin-top: auto;
            font-size: 0.8rem;
            position: sticky;
            bottom: 0;
            z-index: 100;
            font-weight: 500;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        }
        
        /* Markdown 內容樣式 */
        .markdown-content {
            line-height: 1.6;
            word-wrap: break-word;
            overflow-wrap: break-word;
            word-break: break-word;
            white-space: normal;
        }
        
        /* 移除第一個和最後一個元素的外邊距 */
        .markdown-content > *:first-child {
            margin-top: 0 !important;
        }
        
        .markdown-content > *:last-child {
            margin-bottom: 0 !important;
        }
        
        .markdown-content a {
            background: linear-gradient(135deg, #26bde2, #0a97d9);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-decoration: underline;
            text-decoration-color: #26bde2;
            cursor: pointer;
            transition: all 0.2s ease;
            font-weight: 600;
        }
        
        .markdown-content a:hover {
            background: linear-gradient(135deg, #56c02b, #4c9f38);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-decoration-color: #56c02b;
            transform: translateX(2px);
        }
        
        .markdown-content a:visited {
            color: #005f8d;
        }
        
        .markdown-content p {
            margin: 0.5em 0;
            line-height: 1.6;
        }
        
        /* 移除空段落 */
        .markdown-content p:empty {
            display: none;
        }
        
        .markdown-content h1, .markdown-content h2, .markdown-content h3,
        .markdown-content h4, .markdown-content h5, .markdown-content h6 {
            margin: 0.8em 0 0.4em 0;
            font-weight: 600;
            line-height: 1.3;
        }
        
        .markdown-content h2 {
            font-size: 1.5em;
            border-bottom: 2px solid #e9ecef;
            padding-bottom: 0.3em;
        }
        
        .markdown-content ul, .markdown-content ol {
            margin: 0.5em 0;
            padding-left: 2em;
            line-height: 1.6;
        }
        
        .markdown-content li {
            margin: 0.3em 0;
            line-height: 1.6;
        }
        
        /* 列表項目內的段落 */
        .markdown-content li > p {
            margin: 0.2em 0;
        }
        
        /* 移除列表項目之間的多餘空白 */
        .markdown-content li + li {
            margin-top: 0.3em;
        }
        
        /* 強調文字 */
        .markdown-content strong {
            font-weight: 700;
            color: #2c3e50;
        }
        
        .markdown-content em {
            font-style: italic;
            color: #5a6c7d;
        }
        
        .markdown-content pre {
            background: linear-gradient(135deg, #f0f9ff 0%, #e3f2fd 100%);
            border: 2px solid #56c1ff;
            border-radius: 0.5rem;
            padding: 1rem;
            overflow-x: auto;
            margin: 0.8em 0;
            line-height: 1.4;
        }
        
        .markdown-content code {
            background: #e3f2fd;
            padding: 0.2em 0.4em;
            border-radius: 0.25rem;
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 0.9em;
            color: #0077b6;
        }
        
        .markdown-content pre code {
            background: none;
            padding: 0;
        }
        
        .markdown-content blockquote {
            border-left: 4px solid #56c1ff;
            padding-left: 1rem;
            margin: 0.8em 0;
            color: #0077b6;
            font-style: italic;
        }
        
        /* 確保表情符號和特殊字符正確顯示 */
        .markdown-content {
            font-feature-settings: "liga" 1, "calt" 1;
        }
        
        /* 工具結果內容樣式 */
        .json-content {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 4px;
            padding: 12px;
            margin: 8px 0;
            font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
            font-size: 12px;
            line-height: 1.4;
            color: #495057;
            overflow-x: auto;
            white-space: pre-wrap;
        }
        
        .text-content {
            background: #f8f9fa;
            border-left: 3px solid #007bff;
            padding: 12px;
            margin: 8px 0;
            font-size: 13px;
            line-height: 1.5;
            color: #495057;
            white-space: pre-wrap;
        }
        
        .content-item {
            padding: 8px;
            margin: 4px 0;
            background: #fff;
            border: 1px solid #e9ecef;
            border-radius: 3px;
            font-size: 12px;
            color: #6c757d;
        }
        
        .step-content {
            font-size: 14px;
            line-height: 1.5;
        }
        
        .step-text {
            color: #495057;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        
        /* 響應式設計：手機端優化 */
        @media (max-width: 768px) {

            /* 語言選擇器在小螢幕上的調整 */
            .language-selector {
                width: 100%;
                justify-content: center;
                margin-top: 1rem;
            }

            /* 改善後的語言選擇器 - 行動裝置 */
            .language-selector {
                position: static !important;  /* 改為靜態定位，隨頁面內容流動 */
                width: 100% !important;
                max-width: 100% !important;
                justify-content: center !important;
                padding: 0.75rem 1rem !important;
                margin: 0.5rem auto !important;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
                background: rgba(255, 249, 230, 0.95) !important;
                border-radius: 0.5rem !important;
            }

            .language-selector select {
                min-width: 150px;
                padding: 0.6rem 0.8rem;
                font-size: 0.9rem;
            }

            .header-content {
                flex-wrap: wrap;
            }

            /* 思考過程和工具執行已在全域隱藏 */
            
            /* 頁面整體優化 */
            body {
                font-size: 14px;
            }
            
            /* 標題區域優化 */
            .header {
                padding: 1rem;
                text-align: center;
            }
            
            .header-content {
                flex-direction: column;
                gap: 1rem;
            }
            
            .header-logo {
                width: 60px;
                height: 60px;
            }
            
            .header-text {
                min-width: unset;
                text-align: center;
            }
            
            .header h1 {
                font-size: 1.3rem;
                line-height: 1.3;
                margin-bottom: 0.3rem;
            }
            
            .header .subtitle {
                font-size: 0.85rem;
                margin-bottom: 0.5rem;
            }
            
            /* 功能卡片響應式 */
            .features {
                grid-template-columns: 1fr 1fr;
                gap: 0.5rem;
                margin-top: 0.75rem;
            }
            
            .feature {
                padding: 0.5rem;
                font-size: 0.8rem;
            }
            
            /* 聊天容器優化 */
            .chat-container {
                margin: 1rem auto;
                width: calc(100% - 2rem);
                border-radius: 0.75rem;
                min-height: 75vh;
            }
            
            /* 模型選擇區域優化 */
            .model-selector {
                padding: 0.75rem 1rem;
            }
            
            .model-selector h3 {
                font-size: 0.9rem;
                margin-bottom: 0.5rem;
            }
            
            .model-controls {
                gap: 0.5rem;
                flex-direction: column;
                align-items: stretch;
            }
            
            .model-dropdown {
                min-width: unset;
                width: 100%;
                padding: 0.75rem;
                font-size: 0.85rem;
            }
            
            .current-model {
                font-size: 0.75rem;
                padding: 0.25rem 0.5rem;
                text-align: center;
            }
            
            /* 快捷操作優化 */
            .quick-actions {
                padding: 0.75rem 1rem;
            }
            
            .quick-actions h3 {
                font-size: 0.9rem;
                margin-bottom: 0.5rem;
            }
            
            .preset-buttons {
                gap: 0.4rem;
                justify-content: space-between;
            }
            
                        .preset-button {
                flex: 1;
                padding: 0.8rem 0.6rem;
                font-size: 0.75rem;
                text-align: center;
                min-width: 0;
                min-height: 44px;  /* 最小觸控目標 */
                white-space: normal;  /* 允許換行 */
                line-height: 1.3;
                word-break: keep-all;  /* 保持完整的詞語 */
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            /* 訊息區域優化 */
            .messages {
                padding: 1rem;
                gap: 0.75rem;
                min-height: 300px;
            }
            
            .message {
                max-width: 95%;
                padding: 0.75rem 1rem;
                border-radius: 0.75rem;
                font-size: 0.9rem;
                line-height: 1.5;
            }
            
            /* 輸入區域優化 */
            .input-area {
                padding: 1rem;
                border-top: 1px solid #e2e8f0;
                background: #f8fafc;
                padding-bottom: 1.5rem;  /* 減少底部空間，避免過多留白 */
                position: sticky;
                bottom: 0;
                z-index: 10;
            }
            
            .input-container {
                gap: 0.5rem;
                flex-direction: column;
            }
            
            .message-input {
                padding: 0.75rem 1rem;
                font-size: 0.9rem;
                border-radius: 0.5rem;
                min-height: 45px;
                max-height: 100px;
            }
            
            .button-group {
                flex-direction: row;
                gap: 0.5rem;
                justify-content: space-between;
            }
            
                        .send-button {
                flex: 2;
                padding: 1rem 1.5rem;  /* 增加觸控面積 */
                font-size: 1rem;
                border-radius: 2.5rem;
                box-shadow: 0 4px 12px rgba(86, 192, 43, 0.35);
                min-height: 48px;  /* 確保最小觸控目標 */
            }
            
            .send-button:hover:not(:disabled) {
                transform: translateY(-2px) scale(1.02);
            }
            
            .send-button:active:not(:disabled) {
                transform: translateY(0) scale(0.98);
            }
            
            /* 工具呼叫優化 */
            .tool-call {
                padding: 0.5rem;
                margin: 0.5rem 0;
                font-size: 0.8rem;
            }
            
            .tool-content {
                padding: 0.5rem;
                font-size: 0.8rem;
                line-height: 1.4;
            }
            
            /* 代碼區塊優化 */
            .markdown-content pre {
                font-size: 0.8rem;
                padding: 0.5rem;
                border-radius: 0.4rem;
                overflow-x: auto;
                white-space: pre;
            }
            
            .markdown-content code {
                font-size: 0.85rem;
                padding: 0.2rem 0.3rem;
            }
            
            /* 狀態區域優化 */
            .status {
                padding: 0.75rem;
                font-size: 0.85rem;
                border-radius: 0.5rem;
            }
            
            /* 確保觸控友好 */
            button, select, .preset-button {
                min-height: 44px;
                touch-action: manipulation;
            }
            
            /* 防止縮放 */
            input, textarea, select {
                font-size: 16px !important;
            }
            
            /* 底部免責聲明手機端優化 */
            .bottom-disclaimer {
                padding: 0.4rem 0.75rem;
                font-size: 0.7rem;
                position: sticky;
                bottom: 0;
            }

            /* 改善觸控體驗 */
            .message-input:focus {
                transform: scale(1.01);
                transition: transform 0.2s ease;
            }

            /* 改善快速操作區域 */
            .quick-actions {
                margin-bottom: 0.5rem;
            }

            /* 改善訊息區域，減少過大的底部間距 */
            .messages {
                padding-bottom: 1rem;
                margin-bottom: 1rem;  /* 減少底部間距，改善滾動體驗 */
            }

            /* 改善書籍輪播標題 */
            .book-carousel-title {
                font-size: 1.1rem;
                padding: 0.75rem 1rem;
            }

            /* 確保輪播按鈕有足夠的觸控面積 */
            .carousel-nav {
                min-width: 44px !important;
                min-height: 44px !important;
            }

            /* 平滑滾動 */
            html {
                scroll-behavior: smooth;
            }

            /* 改善對話氣泡 */
            .message.user {
                margin-left: 5%;
            }

            .message.assistant {
                margin-right: 5%;
            }
        
        }
        
        /* 超小螢幕優化 (iPhone SE等) */
        @media (max-width: 375px) {
            /* 語言選擇歡迎畫面超小螢幕優化 */
            .language-welcome-modal {
                padding: 1.5rem 1rem;
            }

            .welcome-logo {
                width: 60px;
                height: 60px;
                margin-bottom: 1rem;
            }

            .welcome-title {
                font-size: 1.5rem;
            }

            .welcome-subtitle {
                font-size: 0.9rem;
                margin-bottom: 1.5rem;
            }

            .language-prompt {
                font-size: 1rem;
                margin-bottom: 1rem;
            }

            .language-options {
                gap: 0.75rem;
            }

            .language-option-btn {
                padding: 1rem 0.75rem;
            }

            .language-flag {
                font-size: 2rem;
            }

            .language-name {
                font-size: 1rem;
            }

            .language-desc {
                font-size: 0.75rem;
            }

            .chat-container {
                margin: 0.5rem auto;
                width: calc(100% - 1rem);
            }
            
            .header {
                padding: 0.75rem;
            }
            
            .header h1 {
                font-size: 1.2rem;
            }
            
            .features {
                grid-template-columns: 1fr;
            }
            
            .preset-buttons {
                flex-direction: column;
            }
            
            .preset-button {
                flex: none;
                width: 100%;
            }
            
            .button-group {
                flex-direction: column;
            }
            
            .send-button {
                flex: none;
                width: 100%;
                padding: 1rem 1.5rem;
                font-size: 1rem;
                border-radius: 2.5rem;
            }
            
            /* 超小螢幕底部免責聲明優化 */
            .bottom-disclaimer {
                padding: 0.3rem 0.5rem;
                font-size: 0.65rem;
                line-height: 1.4;
            }

            /* 超小螢幕訊息改善 */
            .message {
                font-size: 0.85rem;
                padding: 0.65rem 0.85rem;
            }

            /* 改善輸入框大小 */
            .message-input {
                font-size: 0.875rem;
                padding: 0.65rem 0.85rem;
            }

            /* 改善模型選擇器 */
            .model-dropdown {
                font-size: 0.8rem;
            }

            /* 確保語言選擇器在超小螢幕上也能正常顯示 */
            .language-selector {
                padding: 0.6rem 0.75rem !important;
            }

            .language-selector select {
                font-size: 0.85rem;
                padding: 0.5rem 0.7rem;
            }
        }



        /* 滾動提示動畫 */
        .scroll-indicator {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            color: #26bde2;
            font-size: 2rem;
            animation: bounce 2s infinite;
            z-index: 10001;
            opacity: 0.7;
            display: none;
        }

        .language-welcome-overlay .scroll-indicator {
            display: block;
        }

        .language-welcome-overlay.hidden .scroll-indicator {
            display: none;
        }

        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {
                transform: translateX(-50%) translateY(0);
            }
            40% {
                transform: translateX(-50%) translateY(-10px);
            }
            60% {
                transform: translateX(-50%) translateY(-5px);
            }
        }

        /* 手機端優化 */
        @media (max-width: 768px) {
            .scroll-indicator {
                display: block;
            }

            /* 改善聊天容器在行動裝置上的顯示 */
            .chat-container {
                max-height: none;  /* 移除最大高度限制，讓內容自然流動 */
                display: flex;
                flex-direction: column;
            }

            /* 改善快捷按鈕的視覺回饋 */
            .preset-button:active {
                transform: scale(0.95);
                transition: transform 0.1s ease;
            }

            .send-button:active {
                transform: scale(0.95) !important;
                transition: transform 0.1s ease;
            }

            /* 改善訊息氣泡的可讀性 */
            .message {
                line-height: 1.6;  /* 增加行高，提升可讀性 */
                word-break: break-word;  /* 確保長文字正確換行 */
            }

            /* 改善模型選擇器的間距 */
            .model-selector {
                margin-bottom: 0.75rem;
            }

            /* 優化底部免責聲明的顯示 */
            .bottom-disclaimer {
                position: relative;  /* 改為相對定位，避免固定在底部 */
                margin-top: 1rem;
            }

            /* 確保輸入框在鍵盤彈出時可見 */
            .message-input:focus {
                scroll-margin-bottom: 1rem;
            }

            /* 改善頁面滾動性能 */
            * {
                -webkit-overflow-scrolling: touch;
            }
        }
