﻿:root {
    --body-bg: #F7FBFF;
    --card-bg: #FFFFFF;
    --toggle-bg: #FFFFFF;
    --text-primary: #1C529B;
    --text-secondary: #333;
    --text-tertiary: #555;
    --text-placeholder: #AEB8C9;
    --text-description: #b1b1b1;
    --param-text: #878787;
    --active-item-bg: #F1F1F1;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --input-shadow: rgba(0, 0, 0, 0.07);
    --toggle-shadow: rgba(0, 0, 0, 0.1);
}
:root.dark-mode {
    --body-bg: #111827;
    --card-bg: #1F2937;
    --toggle-bg: #374151;
    --text-primary: #A5C9FF;
    --text-secondary: #F3F4F6;
    --text-tertiary: #D1D5DB;
    --text-placeholder: #9CA3AF;
    --text-description: #9CA3AF;
    --param-text: #9CA3AF;
    --active-item-bg: #374151;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --input-shadow: rgba(0, 0, 0, 0.2);
    --toggle-shadow: rgba(0, 0, 0, 0.25);
}

#saved-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 18px;
    padding: 20px 40px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2000;
}
#saved-dialog.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.dark-mode #saved-dialog {
    background: var(--card-bg);
    color: var(--text-secondary);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: var(--body-bg);
    height: 100vh;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease;
}

#backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}
#backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-toggle-btn, .theme-toggle-btn {
    position: fixed;
    top: 40px;
    z-index: 1001;
    background: var(--toggle-bg);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 12px var(--toggle-shadow);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.sidebar-toggle-btn { left: 40px; }
.theme-toggle-btn { right: 40px; }

.sidebar-toggle-btn:hover, .theme-toggle-btn:hover {
    transform: scale(1.1);
}

.sidebar-toggle-btn i, .theme-toggle-btn i {
    font-size: 24px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}
.theme-toggle-btn .ri-moon-clear-line { display: none; }
.dark-mode .theme-toggle-btn .ri-moon-clear-line { display: block; }
.dark-mode .theme-toggle-btn .ri-sun-line { display: none; }

.sidebar {
    width: 328px;
    height: 740px;
    background-color: var(--card-bg);
    padding: 40px 20px;
    box-sizing: border-box;
    border-radius: 24px;
    box-shadow: 0 10px 40px var(--shadow-color);
    position: fixed;
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    z-index: 1000;
    transition: transform 0.4s ease-in-out, background-color 0.3s ease;
}

.sidebar.sidebar-hidden {
    transform: translateY(-50%) translateX(-120%);
}

.sidebar h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 30px;
    padding-left: 15px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    display: block;
    text-decoration: none;
    color: var(--text-tertiary);
    padding: 12px 15px;
    border-radius: 10px;
    margin: 0 10px 10px;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar ul li.active a {
    background-color: var(--active-item-bg);
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar ul li a:hover {
    background-color: var(--active-item-bg);
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 1300px;
    height: 100%;
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0 60px;
}

.input-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    z-index: 2; 
}

.input-container input {
    width: 100%;
    padding: 18px 60px 18px 70px; 
    border: none;
    border-radius: 33px;
    font-size: 16px;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    box-shadow: 4px 3px 45px 5px var(--input-shadow);
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
}

.input-container input:focus {
    outline: none;
}

.input-container input::placeholder {
    color: var(--text-placeholder);
}

.help-container {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.help-btn {
    background: var(--toggle-bg);
    border: none;
    border-radius: 50%;
    width: 44px; 
    height: 44px;
    box-shadow: 0 2px 8px var(--toggle-shadow);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
    padding: 0;
}

.help-btn:hover {
    transform: scale(1.1);
}

.help-btn i {
    font-size: 22px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.help-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 320px;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.help-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: var(--card-bg) transparent transparent transparent;
    transition: border-color 0.3s ease;
}

.help-btn:hover + .help-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.help-tooltip h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.help-tooltip p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.help-tooltip .usage-tip {
    margin-top: 12px;
    font-size: 13px;
    opacity: 0.9;
}

.send-btn {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg); 
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.send-icon {
    font-size: 24px;
    color: var(--text-placeholder);
    transition: color 0.3s ease;
}
.send-btn:hover .send-icon {
    color: #3B82F6;
}

.description {
    font-size: 17px;
    color: var(--text-description);
    margin-top: 30px;
    margin-bottom: 40px; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: color 0.3s ease, font-size 0.3s ease;
    text-align: center;
}

/* =========================================
   涓昏淇敼鍖猴細鎸夐挳缁勬牱寮?
   ========================================= */

.action-buttons {
    display: flex;
    flex-wrap: wrap;        
    justify-content: center;/* 灞呬腑瀵归綈 */
    gap: 20px;              
    width: 100%;
    max-width: 1100px;      /* 闄愬埗鏈€澶у搴?*/
    margin: 0 auto;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    border-radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    
    /* 鍔ㄦ€佸昂瀵歌皟鏁达紝浠ラ€傚簲5涓寜閽?*/
    font-size: 19px;        
    min-width: 220px;       /* 鏈€灏忓搴﹀噺灏忥紝闃叉鎹㈣杩囦簬绐佸厐 */
    flex: 1 1 220px;        /* Flex 甯冨眬鑷€傚簲 */
    max-width: 300px;       /* 闄愬埗鏈€澶у搴?*/
    min-height: 90px;       
    padding: 15px 20px;
    position: relative;
}

.btn i {
    font-size: 22px;
    margin-right: 10px;
}

.check-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #4CAF50;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 18px;
    color: white;
    border: 3px solid var(--card-bg);
    transition: border-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-vrp { background: linear-gradient(45deg, #fe988b, #f56f87, #f78a9e); }
.btn-vrp:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(250, 112, 154, 0.3); }

.btn-tcm { background: linear-gradient(45deg, rgba(124, 115, 243, 0.86), rgba(232, 119, 174, 0.86)); }
.btn-tcm:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(122, 136, 255, 0.3); }

.btn-pd { background: linear-gradient(45deg, #56ccf2, #2f80ed); }
.btn-pd:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(47, 128, 237, 0.3); }

.btn-kb { background: linear-gradient(45deg, #11998e, #38ef7d); }
.btn-kb:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(56, 239, 125, 0.3); }

.btn-coming-soon { background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%); color: #666; }
/* .btn-coming-soon { background: linear-gradient(142deg, rgba(200, 227, 250, 0.6), rgba(230, 36, 144, 0.6)); } */

.btn-coming-soon:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(0,0,0, 0.1); }

#dev-toast {
    position: fixed;
    transform: translateX(-50%) translateY(10px) scale(0.9);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2000;
    white-space: nowrap;
}
#dev-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}


/* ############################################### */
/* ############################################### */

@media (max-width: 768px) {
    body {
        overflow-y: auto; 
    }

    .main-content {
        position: static;
        width: 100%;
        height: auto;
        min-height: 100vh;
        transform: none;
        padding: 80px 20px 40px 20px; 
        justify-content: flex-start;
    }

    .sidebar-toggle-btn, .theme-toggle-btn {
        top: 20px;
        width: 40px;    
        height: 40px;
    }
    .sidebar-toggle-btn { left: 20px; }
    .theme-toggle-btn { right: 20px; }

    .sidebar {
        width: 280px;
        height: 100vh;
        border-radius: 0;
        left: 0;
        top: 0;
        transform: translateX(-100%);
    }
    .sidebar.sidebar-hidden {
        transform: translateX(-100%);
    }
    .sidebar:not(.sidebar-hidden) {
        transform: translateX(0);
    }
    
    .logo-title {
        margin: 20px 0 30px 0; /* 鍑忓皬闂磋窛 */
    }
    .logo-title img {
        max-width: 80%;        /* 鍥剧墖瀹藉害鑷€傚簲 */
        margin-bottom: 10px;
    }
    .logo-text-cn {
        font-size: 32px !important; /* 寮哄埗瑕嗙洊澶у睆瀛楀彿 */
    }
    .logo-text-en {
        font-size: 14px !important;
    }

    .input-container {
        width: 100%;
        margin-bottom: 20px;
    }
    .input-container input {
        padding: 12px 50px 12px 55px; 
        font-size: 14px;
    }
    .help-container {
        left: 5px;
    }
    .help-btn {
        width: 36px;
        height: 36px;
    }
    .help-btn i { font-size: 18px; }
    
    .help-tooltip {
        width: 260px;
        left: 50%;
        transform: translateX(-40%) translateY(10px); /* 寰皟浣嶇疆 */
        bottom: 130%; 
    }
    .help-btn:hover + .help-tooltip {
        transform: translateX(-40%) translateY(0);
    }

    .send-btn {
        right: 15px;
    }

    .description {
        font-size: 14px;
        margin-top: 10px;
        margin-bottom: 30px;
        padding: 0 10px;
    }

    .action-buttons {
        flex-direction: row; 
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    .btn {
        flex: 1 1 calc(50% - 10px); 
        min-width: auto;       
        max-width: none;       
        min-height: 70px;      /* 楂樺害绋嶅井鍑忓皬 */
        font-size: 16px;       /* 瀛椾綋鍑忓皬 */
        padding: 10px 15px;
        border-radius: 16px;
    }
    
    @media (max-width: 360px) {
        .btn {
            flex: 1 1 100%;
        }
    }

    .btn i {
        font-size: 20px;
        margin-right: 8px;
    }
    
    .historyTitle {
        padding-top: 50px; 
    }
}

/* =========================
   鏂板锛氱敤鎴疯彍鍗曟牱寮?
   ========================= */

.user-menu-container {
    position: absolute;
    top: 40px;
    right: 40px; 
    z-index: 1100;
}

.theme-toggle-btn {
    right: 110px !important; 
}
@media (max-width: 768px) {
    .theme-toggle-btn { right: 80px !important; }
    .user-menu-container { right: 20px; top: 20px; }
}

.user-avatar-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    box-shadow: 0 4px 12px var(--toggle-shadow);
    background: var(--text-primary);
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.user-avatar-btn:hover {
    transform: scale(1.1);
}

.user-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 180px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}
.user-menu-container:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    gap: 10px;
}
.dropdown-item:hover {
    background: var(--active-item-bg);
}
.dropdown-item i { font-size: 16px; }

.chat-main .user-menu-container {
    position: fixed;
}
