/* DS随心转 AI聊天页面 - 组件与模态框样式 */

/* 自定义确认弹窗按钮样式 - 让右侧确定按钮高亮 */
.layui-layer-btn .layui-layer-btn0 {
    background-color: #f0f0f0 !important;
    color: #666 !important;
    border-color: #d0d0d0 !important;
}

.layui-layer-btn .layui-layer-btn0:hover {
    background-color: #e0e0e0 !important;
    color: #333 !important;
}

.layui-layer-btn .layui-layer-btn1 {
    background-color: #1976d2 !important;
    color: white !important;
    border-color: #1976d2 !important;
}

.layui-layer-btn .layui-layer-btn1:hover {
    background-color: #1565c0 !important;
}

/* 登录模态窗口样式 */
#loginModal,
#wechatGroupModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal-content,
#loginModal .login-modal-content,
#wechatGroupModal .login-modal-content {
    background: white !important;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    animation: modalFadeIn 0.3s ease-out;
    position: relative !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
}

/* 微信群二维码模态窗口特殊样式 */
#wechatGroupModal .login-modal-content.wechat-group-modal {
    max-width: 380px;
}

#wechatGroupModal .login-modal-body {
    background: #fafbfc;
}

#wechatGroupModal img {
    transition: transform 0.3s ease;
}

#wechatGroupModal img:hover {
    transform: scale(1.02);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

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

.login-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.login-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.login-modal-body {
    padding: 24px;
}

/* Login Tabs */
.login-type-tabs {
    display: flex;
    margin-bottom: 24px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
}

.login-type-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.login-type-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-type-tab:hover:not(.active) {
    color: #333;
}

/* Login Form */
.login-form {
    animation: formFadeIn 0.3s ease-out;
}

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #999;
}

.verify-code-group {
    display: flex;
    gap: 12px;
}

.verify-code-group .form-input {
    flex: 1;
}

.login-set-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

.login-set-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.login-set-submit-btn:active {
    transform: translateY(0);
}

/* Set Password */
.set-password-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #e8f4fd;
    border: 1px solid #b3d8ff;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #1890ff;
    font-size: 14px;
}

.set-password-tip i {
    font-size: 16px;
}

.set-password-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.login-form .back-login-btn {
    padding: 14px 24px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    flex: 0 0 auto;
}

.login-form .back-login-btn:hover {
    background: #e8e8e8;
}

.set-password-actions .login-set-submit-btn {
    flex: 1;
    margin-bottom: 0;
}

.login-tips {
    text-align: center;
    font-size: 12px;
    color: #999;
    line-height: 1.5;
}

.login-tips a {
    color: #667eea;
    text-decoration: none;
}

.login-tips a:hover {
    text-decoration: underline;
}

/* Password Input */
.password-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-group .form-input {
    width: 100%;
    padding-right: 50px;
    box-sizing: border-box;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.password-toggle-btn i {
    font-size: 16px;
}

/* Login footer actions */
.login-actions {
    text-align: center;
    margin: 20px auto;
}

.set-password-link-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.set-password-link-btn:hover {
    background-color: rgba(102, 126, 234, 0.1);
    text-decoration: none;
}

/* 双11活动弹窗样式 */
#double11PromoModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(5px);
    display: none;
}

.double11-promo-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90%;
    max-width: 420px;
    background: white !important;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 100000 !important;
    animation: double11ModalSlideIn 0.4s ease-out;
    overflow: hidden;
}

@keyframes double11ModalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.double11-promo-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    z-index: 100001 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

.double11-promo-close:hover {
    background: white !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.double11-promo-close .layui-icon {
    font-size: 18px !important;
    color: #666 !important;
}

.double11-promo-link {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.2s ease !important;
}

.double11-promo-link:hover {
    transform: scale(1.02) !important;
    text-decoration: none !important;
    color: inherit !important;
}

.double11-promo-image {
    width: 100% !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: #fff !important;
}

.double11-promo-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 12px !important;
    transition: transform 0.3s ease !important;
}

.double11-promo-image img:hover {
    transform: scale(1.02) !important;
}

/* Tooltip Styles */
.upload-btn {
    position: relative;
}

.upload-btn .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    margin-bottom: 8px;
    z-index: 1000;
}

.upload-btn .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.upload-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.upload-btn.uploading .tooltip {
    display: none;
}

.message-tools .tool-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    animation: tooltipFadeIn 0.3s ease-out;
    margin-bottom: 8px;
}

.message-tools .tool-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    margin-bottom: 4px;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 编辑提问面板样式 */
.edit-question-content {
    position: relative;
    padding: 24px;
}

.edit-question-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #9CA3AF;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.edit-question-close:hover {
    background: #F3F4F6;
    color: #4B5563;
}

.edit-question-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: #2563EB;
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 12px;
}

.edit-question-textarea {
    width: 100%;
    height: 200px;
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    background: #FFFFFF;
    transition: all 0.2s ease;
    line-height: 1.6;
    color: #2B2B2B;
}

.edit-question-textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.edit-question-actions {
    margin-top: 20px;
    text-align: right;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 输入框扩展编辑模态窗口 */
#chatInputExpandModal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
}

.chat-input-expand-modal-content {
    width: min(860px, 92vw);
    margin: 6vh auto 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.chat-input-expand-header {
    background: #FAF9F6;
}

.chat-input-expand-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-expand-title .layui-icon {
    font-size: 18px;
    color: #2563EB;
}

.chat-input-expand-close.panel-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 20px;
}

.chat-input-expand-body {
    padding: 16px 18px 10px;
}

.chat-input-expand-textarea {
    width: 100%;
    height: min(58vh, 560px);
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    outline: none;
    resize: vertical;
    color: #1F2937;
}

.chat-input-expand-textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.chat-input-expand-actions {
    padding: 12px 18px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}