/* 设置容器样式 */
.toggle-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
    color: #1E90FF;
}
.toggle-button {
    color: #1E90FF; /* 普通状态下的天蓝色 */
}

/* 桌面设备 */
@media (hover: hover) and (pointer: fine) {
    .toggle-button:hover {
        color: #0066CC; /* hover 时稍微加深的蓝色 */
    }

    .toggle-button.enabled:hover {
        color: #45a049; /* enabled 状态下 hover 时稍微加深的绿色 */
    }
}

.toggle-button.enabled {
    color: #4CAF50; /* enabled 状态下的绿色 */
}

/* 移动设备 */
@media (hover: none) and (pointer: coarse) {
    .toggle-button:active {
        color: #0066CC; /* 触摸时的颜色变化 */
    }

    .toggle-button.enabled:active {
        color: #45a049; /* enabled 状态下触摸时的颜色变化 */
    }
}
/* disable Android设备中点击后的矩形高亮 */
.toggle-button {
    user-select: none;
    -webkit-touch-callout: none;
}



.toggle-button {
    text-align: left; /* 使按钮文本左对齐 */
    width: auto; /* 让按钮撑满其父容器的宽度 */
    /* font-size: 16px; /* 设置字体大小 */
    background-color: transparent; /* 设置背景色 */
    border: none; /* 去掉边框 */
    padding: 5px; /* 设置内边距 */
    padding-left: 7px;
    padding-right: 7px;
    margin: 0; /* 去掉外边距 */
    border-radius: 5px; /* 设置圆角 */
    transition: background-color 0.3s ease; /* 添加过渡效果 */
    outline: none; /* 去掉聚焦时的轮廓 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
}


.setting-container {
    position: fixed;
    top: 0px;
    right: -100%; /* 初始状态在屏幕右侧之外 */
    height: auto;
    max-height: 80%;
    width: 230px;
    background-color: #fff;
    overflow-y: auto;
    transition: right 0.5s;
    z-index: 1000;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    font-size: 13.5px;
    border-radius: 4px;
    padding: 10px;
    margin: 13px auto;
    margin-top: 0;
    max-width: 600px;
    font-family: Arial, sans-serif;
    list-style: none;
    border: 0px solid #ddd;
}

/* 显示状态的样式 */
.setting-container-visible {
    right: 0; /* 移动到可视区域内 */
}

.setting-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
    display: none;
}

.setting-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.setting-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.setting-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 24px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 15px;
    color: #333;
    margin-right: 10px;
}

.setting-item input {
    width: 80%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.setting-item input[type="number"],
.setting-item input[type="range"] {
    width: 50px;
    padding: 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13.5px;
}

.setting-item input[type="range"] {
    -webkit-appearance: none;
    width: 120px;
    height: 6px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    margin-right: 10px;
}

.setting-item input[type="range"]:hover {
    opacity: 1;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
}

.setting-item #temperatureValue {
    display: inline-block;
    width: 25px;
    text-align: right;
    font-size: 13.5px;
}

/* 按钮样式 */
.setting-item-button {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.setting-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    font-size: 15px;
    border: none;
    cursor: pointer;
    background: none;
    color: #333;
    font-weight: bold;
    text-align: left;
    transition: color 0.3s;
}

.setting-button:hover {
    color: #007bff;
}

.setting-button.active {
    color: #28a745;
}

#saveSettingsBtn {
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

#saveSettingsBtn:hover {
    background-color: #45a049;
}

.full-width {
    width: 100%;
}

.midjourney-icon {
    display: inline-block;
    background-image: url('../img/midjourney.png');
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sd-icon {
    display: inline-block;
    background-image: url('../img/flux.png');
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.photo-prompts-icon {
    display: inline-block;
    background-image: url('../img/photo_prompts.png');
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.chat-prompts-icon {
    display: inline-block;
    background-image: url('../img/chat_prompts.png');
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 账户信息容器样式 */
.account-info {
    margin-top: 13px;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.account-row.logged-in,
.account-row.logged-out {
    display: none;
}

.account-row.active {
    display: flex;
}

.account-avatar {
    display: flex;
    align-items: center;
    position: relative;
    width: 30px;
    height: 30px;
    margin-right: 15px;
}

.account-avatar svg {
    width: 100%;
    height: 100%;
}

.user-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4500;
    color: white;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 0.7em;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-button {
    flex: 1;
    background: none;
    border: none;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: color 0.3s;
}

.account-button:hover {
    color: #007bff;
}

.login-button,
.logout-button {
    background: none;
    color: #333;
    margin-left: 10px;
    margin-right: 10px;
}

#logoutBtn {
    display: none;
}

/* 用户自定义设置行样式 */
.setting-row.user-define-row {
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    height: 100px;
    border: 0;
}

.user-define-row .setting-item {
    flex: 1;
    margin-right: 10px;
    flex-direction: column;
}

.user-define-row .setting-item:last-child {
    margin-right: 0;
}

.user-define-row label {
    margin-bottom: 3px;
    font-weight: bold;
    font-size: 0.85em;
}

.user-define-row input {
    width: 100%;
    padding: 4px 6px;
    box-sizing: border-box;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 3px;
}

#logoutDialog, #loginDialog {
    padding: 20px;
    border-radius: 5px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#logoutDialog::backdrop, #loginDialog::backdrop {
    background-color: rgba(0,0,0,0.5);
}

#logoutDialog button, #loginDialog button {
    margin: 5px;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#logoutDialog button:hover, #loginDialog button:hover {
    background-color: #f0f0f0;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .setting-container {
        padding: 0 10px;
    }
    
    .setting-item label,
    .setting-button,
    .account-button {
        font-size: 15px;
    }
    
    .setting-item input[type="number"],
    .setting-item input[type="range"] {
        width: 40px;
    }
    
    .setting-item input[type="range"] {
        width: 80px;
    }
    
    .account-avatar {
        width: 35px;
        height: 35px;
        margin-right: 10px;
    }

    .user-badge {
        font-size: 0.6em;
        min-width: 16px;
        height: 16px;
        padding: 1px 1px;
    }

    .user-define-row {
        flex-direction: column;
    }

    .user-define-row .setting-item {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

/* 新的紧凑设置样式 */
.compact-settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.compact-settings-row.border-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    border-bottom: 1px solid #e0e0e0;
}

.compact-setting-item {
    flex: 1;
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.compact-setting-item:last-child {
    margin-right: 0;
}

.compact-setting-item label {
    width: 45px;
    margin-right: 5px;
    white-space: nowrap;
}

.compact-setting-item input[type="number"],
.compact-setting-item select {
    width: 45px;
    font-size: 13px;
    padding: 2px;
}

.compact-setting-item input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

.compact-setting-item input[type="number"]::-webkit-inner-spin-button, 
.compact-setting-item input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

/* 添加鼠标悬停提示 */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .compact-settings-row {
        font-size: 12px;
    }
    
    .compact-setting-item input[type="number"],
    .compact-setting-item select {
        width: 40px;
        font-size: 12px;
    }
}

.button-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.button-group .setting-button {
    flex: 1;
}

.external-link-button {
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.external-link-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

