/* 确保按钮默认隐藏，通过active类控制显示 */
.site-tools .gotodown {
    display: none;
}
.site-tools .gotodown.active {
    display: block;
}

/* 主题图标控制 - 修复选择器问题 */
.site-tools .js-toggle-theme .dark-icon {
    display: none;
}
.site-tools .js-toggle-theme .light-icon {
    display: inline-block;
}
/* 将 body.dark-theme 改为 .dark-theme */
.dark-theme .site-tools .js-toggle-theme .light-icon {
    display: none;
}
.dark-theme .site-tools .js-toggle-theme .dark-icon {
    display: inline-block;
}

/* ================ AI助手按钮美化 ================ */
.site-tools .ai-assistant-btn {
    display: none;
    position: relative;
    overflow: visible;
    background: none;
    box-shadow: none;
    border-radius: 50%;
}

.site-tools .ai-assistant-btn-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-tools .ai-assistant-btn-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    z-index: 10;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.site-tools .ai-assistant-btn-aura {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    z-index: 1;
    opacity: 0.8;
    animation: pulseAura 3s infinite;
    filter: blur(8px);
}

.site-tools .ai-assistant-btn-hover-text {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s, top 0.3s;
    z-index: 100;
    pointer-events: none;
}

.site-tools .ai-assistant-btn:hover .ai-assistant-btn-hover-text {
    opacity: 1;
    top: -45px;
}

@keyframes pulseAura {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

.site-tools .ai-assistant-btn:hover .ai-assistant-btn-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(106, 17, 203, 0.5);
}

.site-tools .ai-assistant-btn.active {
    display: block;
}

/* ================ 在线状态指示器 ================ */
.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-left: 8px;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.7);
    animation: pulseOnline 1.5s infinite;
}

@keyframes pulseOnline {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.7; transform: scale(1); }
}

/* ================ 聊天窗口美化 ================ */
.ai-chat-window {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 380px;
    max-width: 90vw;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(106, 17, 203, 0.1);
}

.ai-chat-window.active {
    display: flex;
}

.ai-chat-header {
    padding: 15px 20px;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ai-chat-controls {
    display: flex;
    gap: 5px;
}

.ai-chat-setting {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-setting:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-chat-messages {
    flex: 1;
    padding: 15px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9f9ff;
    -webkit-overflow-scrolling: touch;
}

.ai-chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 14px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ai-message {
    background: #ffffff;
    align-self: flex-start;
    border-top-left-radius: 4px;
    border: 1px solid #e9ecef;
}

.user-message {
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    align-self: flex-end;
    border-top-right-radius: 4px;
}

.message-content {
    padding-bottom: 0;
}

.message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ai-chat-message:hover .message-actions {
    opacity: 1;
}

.message-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 28px;
    height: 28px;
    color: #555;
}

.user-message .message-action-btn {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
}

.user-message .message-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ================ 输入框美化 ================ */
.ai-chat-input {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    position: relative;
    background: #f5f7ff;
}

.ai-chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-chat-input-field {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    box-sizing: border-box;
    background: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    height: 46px;
}

.ai-chat-input-field:focus {
    border-color: #6a11cb;
    box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.2);
}

.ai-chat-send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(106, 17, 203, 0.3);
}

.ai-chat-send:hover {
    background: linear-gradient(to right, #5a0db5, #1c65e6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(106, 17, 203, 0.4);
}

/* ================ 暗色模式适配 ================ */
.dark-theme .ai-chat-window {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
}

.dark-theme .ai-chat-header {
    background: linear-gradient(to right, #4a0da5, #1a55cc);
    color: #fff;
    border-bottom-color: #3a3a3a;
}

.dark-theme .ai-chat-close {
    color: #e0e0e0;
}

.dark-theme .ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .ai-chat-messages {
    background: #1f1f2e;
}

.dark-theme .ai-message {
    background: #333344;
    border-color: #444;
}

.dark-theme .welcome-message {
    background: #333344;
    color: #e0e0e0;
}

.dark-theme .ai-chat-input {
    background: #1a1a2a;
    border-top-color: #444;
}

.dark-theme .ai-chat-input-field {
    background: #333344;
    color: #e0e0e0;
    border-color: #444;
}

.dark-theme .ai-chat-input-field:focus {
    border-color: #8a4fff;
    box-shadow: 0 0 0 2px rgba(138, 79, 255, 0.3);
}

/* ================ 移动端适配 ================ */
@media (max-width: 768px) {
    /* 小工具按钮适配 */
    .site-tools {
        bottom: 20px;
        right: 15px;
        z-index: 9998;
    }
    
    .site-tools .item {
        width: 44px;
        height: 44px;
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    /* 在移动端隐藏直达底部按钮 */
    .site-tools .gotodown {
        display: none !important;
    }
    
    /* AI聊天窗口全屏模式 */
    .ai-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
        bottom: auto;
        right: auto;
    }
    
    .ai-chat-messages {
        padding: 15px;
        height: calc(100% - 120px);
    }
    
    .ai-chat-input {
        padding: 10px 15px;
    }
    
    .ai-chat-input-field {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    /* 移动端键盘弹出时调整布局 */
    .keyboard-open .ai-chat-messages {
        height: calc(100% - 60px);
    }
    
    .keyboard-open .ai-chat-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 10000;
        background: white;
        padding: 10px;
        border-top: 1px solid #eee;
    }
    
    .dark-theme.keyboard-open .ai-chat-input {
        background: #1a1a1a;
        border-top-color: #333;
    }
    
    /* 移动端按钮调整 */
    .message-actions {
        gap: 6px;
    }
    
    .message-action-btn {
        padding: 4px;
        font-size: 11px;
        width: 16px;
        height: 16px;
    }
    
    /* 设置菜单位置调整 */
    .ai-settings-menu {
        top: 60px;
        right: 15px;
    }
}

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    .ai-chat-message {
        max-width: 90%;
        padding: 10px 14px;
    }
    
    .ai-chat-header h3 {
        font-size: 16px;
    }
    
    .ai-avatar {
        width: 28px;
        height: 28px;
    }
    
    .message-action-btn {
        width: 22px;
        height: 22px;
        font-size: 11px;
        padding: 3px;
    }
}

/* 横向设备优化 */
@media (max-height: 480px) and (orientation: landscape) {
    .ai-chat-window {
        top: 0;
        bottom: 0;
    }
    
    .ai-chat-messages {
        height: calc(100% - 80px);
    }
}

/* 其他样式 */
.welcome-message {
    font-size: 14px;
    text-align: center;
    color: #6c757d;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.dark-theme .welcome-message {
    background: #333344;
    color: #e0e0e0;
}

.ai-settings-menu {
    position: absolute;
    top: 50px;
    right: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    padding: 15px;
    width: 220px;
    z-index: 10000;
    display: none;
}

.dark-theme .ai-settings-menu {
    background: #333344;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.ai-settings-menu.active {
    display: block;
}

.setting-item {
    padding: 8px 5px;
    display: flex;
    align-items: center;
    position: relative;
}

.setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
}

.setting-item input {
    margin-right: 8px;
}

.setting-item span {
    flex: 1;
}

/* 深度思考模式提示位置调整 - 现在在输入框上方 */
.deep-thought-indicator {
    position: absolute;
    bottom: 60px; /* 放在输入框上方 */
    left: 10px;
    background: rgba(106, 17, 203, 0.9);
    color: white;
    padding: 5px 10px 5px 30px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10000;
    display: none;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    0% { transform: translateX(-10px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.deep-thought-pulse {
    position: absolute;
    left: 8px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(0.9); opacity: 1; }
}

.deep-thought-text {
    margin-left: 5px;
}

/* 设置提示样式 */
.setting-tip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    cursor: pointer;
}

.setting-tip .tip-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    width: 200px;
    font-size: 12px;
    line-height: 1.4;
    z-index: 100;
    white-space: normal;
}

.setting-tip:hover .tip-content {
    display: block;
}

.info-tip-icon {
    color: #6c757d;
    font-size: 14px;
    margin-left: 5px;
    cursor: pointer;
}

.dark-theme .info-tip-icon {
    color: #a0a0a0;
}


/* 底部左右分栏设计 */
.dn-footer-wrapper {
    border-radius: 8px;
    overflow: hidden;
    margin-top: 30px;
    box-shadow: var(--light-shadow);
}

.dn-modern-footer {
    background: var(--background-color-alt);
    color: var(--text-color);
    padding: 35px 0;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    position: relative;
}

.dn-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.dn-footer-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.dn-footer-column {
    margin-bottom: 20px;
}

/* 左侧网站信息栏 */
.dn-info-column {
    flex: 1 1 45%; /* 占据约一半宽度，留出间距 */
    text-align: left;
}

.dn-footer-brand {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.dn-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    background: var(--background-color-hover);
}

.dn-brand-text {
    padding-top: 3px;
}

.dn-wb-site-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--primary-color-60));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.2;
}

.dn-site-tagline {
    font-size: 0.9rem;
    color: var(--text-color-muted);
    margin: 3px 0 0;
}

.dn-site-description {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.85;
    margin-bottom: 12px;
}

.dn-social-links {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.dn-social-link {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--background-linear);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--light-shadow);
    cursor: pointer;
}

.dn-social-link:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--light-shadow);
}

/* 右侧版权信息栏 */
.dn-copyright-column {
    flex: 1 1 45%; /* 占据约一半宽度，留出间距 */
    display: flex;
    align-items: center;
}

.dn-copyright-section {
    width: 100%;
    padding: 15px 0;
    background: var(--background-color-alt);
}

.dn-copyright-content {
    width: 100%;
}

.dn-copyright-text {
    font-size: 0.85rem;
    margin-bottom: 8px;
    opacity: 0.8;
    color: var(--text-color-muted);
}

.dn-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.dn-legal-links a {
    color: var(--text-color-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0 3px;
    display: inline-flex;
    align-items: center; /* 确保图标和文字垂直居中 */
}

.dn-legal-links a:hover {
    color: var(--text-color);
}

.dn-legal-links a:not(:last-child)::after {
    content: '?';
    position: absolute;
    right: -9px;
    top: 0;
    color: var(--line-color);
}

.dn-deepnavi-ai-badge {
    margin-top: 15px;
    padding: 8px 15px;
    background: var(--background-linear);
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.5;
    border: 1px solid var(--line-color);
}

.dn-deepnavi-ai-badge a {
    text-decoration: underline;
    font-weight: 600;
    color: var(--primary-color-60);
    transition: all 0.3s ease;
}

.dn-deepnavi-ai-badge a:hover {
    color: var(--primary-color);
}

.dn-deepnavi-ai-badge strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* 响应式设计 - 移动端高度压缩至一半 */
@media (max-width: 768px) {
    .dn-modern-footer {
        padding: 12px 0 !important;  /* 大幅减少垂直内边距 */
    }
    
    .dn-footer-wrapper {
        margin-top: 15px;  /* 减少顶部外边距 */
    }
    
    .dn-footer-columns {
        flex-direction: column;
        gap: 5px;  /* 大幅减少间隙 */
    }
    
    .dn-info-column, .dn-copyright-column {
        flex: 1 1 100%;
        text-align: center;
    }
    
    .dn-footer-brand {
        justify-content: center;
        margin-bottom: 5px;  /* 大幅减少底部间距 */
    }
    
    .dn-logo-icon {
        width: 30px;  /* 缩小logo */
        height: 30px;
        margin-right: 8px;
    }
    
    .dn-wb-site-title {
        font-size: 1.1rem;  /* 大幅缩小标题字体 */
        line-height: 1.1;
    }
    
    .dn-site-tagline {
        font-size: 0.7rem;  /* 大幅缩小字体 */
        margin-top: 1px;
    }
    
    .dn-site-description {
        display: none;  /* 移动端完全隐藏描述文本 */
    }
    
    .dn-social-links {
        justify-content: center;
        margin-top: 5px;  /* 大幅减少顶部间距 */
        gap: 8px;  /* 减少间隙 */
    }
    
    .dn-social-link {
        width: 28px;  /* 大幅缩小社交图标 */
        height: 28px;
    }
    
    .dn-social-link img {
        width: 18px;  /* 缩小图标 */
        height: 18px;
    }
    
    .dn-copyright-section {
        padding: 8px 0;  /* 大幅减少内边距 */
    }
    
    .dn-copyright-text {
        font-size: 0.7rem;  /* 大幅缩小字体 */
        margin-bottom: 4px;
        line-height: 1.3;
    }
    
    .dn-legal-links {
        justify-content: center;
        gap: 8px;  /* 减少间隙 */
        margin-bottom: 8px;  /* 大幅减少底部间距 */
    }
    
    .dn-legal-links a {
        font-size: 0.7rem;  /* 大幅缩小字体 */
    }
    
    .dn-legal-links a:not(:last-child)::after {
        right: -6px;
        font-size: 0.7rem;
    }
    
    .dn-legal-links img {
        width: 12px;  /* 缩小备案图标 */
        height: 12px;
    }
    
    .dn-deepnavi-ai-badge {
        display: none;  /* 移动端完全隐藏AI授权标识 */
    }
}

@media (max-width: 480px) {
    .dn-footer-wrapper {
        border-radius: 8px;
        margin-top: 10px;
    }
    
    .dn-modern-footer {
        padding: 8px 0 !important;  /* 进一步减少垂直内边距 */
    }
    
    .dn-wb-site-title {
        font-size: 1rem;
    }
    
    .dn-legal-links {
        gap: 6px;
    }
}

/* 简洁二维码弹窗样式 */
.dn-qrcode-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.dn-qrcode-modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 280px;
    text-align: center;
    position: relative;
}

.dn-close-modal {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
}

.dn-close-modal:hover {
    color: #333;
}

#dn-qrcode-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
}

.dn-qrcode-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dn-qrcode-image {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 6px;
}

.dn-qrcode-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
}

#dn-modal-title {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

#dn-modal-description {
    color: #666;
    font-size: 0.8rem;
    margin-top: 3px;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .dn-qrcode-modal-content {
        width: 85%;
        padding: 15px;
    }
    
    .dn-qrcode-image {
        width: 90px;
        height: 90px;
    }
}


