/* 模块化版本专用样式 */
/* 版本: 1.0.0 */

/* 模块化数据属性选择器 */
[data-modular="true"] {
    --transition-speed: 0.3s;
    --module-primary: #6a11cb;
    --module-secondary: #2575fc;
    --module-success: #28a745;
    --module-warning: #ffc107;
    --module-error: #dc3545;
}

/* 模块化版本指示器 */
.modular-version-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--module-success) 0%, #20c997 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideInRight 0.5s ease-out;
    pointer-events: none;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 模块加载状态指示器 */
.module-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 30px 40px;
    border-radius: 15px;
    z-index: 10002;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 280px;
}

.module-loading::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--module-primary), var(--module-secondary));
    border-radius: 15px;
    z-index: -1;
    animation: borderRotate 2s linear infinite;
}

@keyframes borderRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* 模块错误提示 */
.module-error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--module-error) 0%, #c82333 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 10003;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: shake 0.5s ease-out;
    cursor: pointer;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    25% { transform: translateX(-50%) translateY(-5px); }
    75% { transform: translateX(-50%) translateY(5px); }
}

/* 模块化增强样式 */
[data-modular="true"] .chat-container {
    transition: all var(--transition-speed) ease;
    position: relative;
}

[data-modular="true"] .chat-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--module-primary), var(--module-secondary));
    border-radius: 27px;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}



[data-device="pc"] {
    --pc-padding: 20px;
}



/* 模块加载动画 */
.module-fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: moduleSlideUp 0.6s ease-out forwards;
}

@keyframes moduleSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模块化按钮增强 */
[data-modular="true"] .settings-button,
[data-modular="true"] .history-button,
[data-modular="true"] .link-panel-button {
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

[data-modular="true"] .settings-button::before,
[data-modular="true"] .history-button::before,
[data-modular="true"] .link-panel-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

[data-modular="true"] .settings-button:hover::before,
[data-modular="true"] .history-button:hover::before,
[data-modular="true"] .link-panel-button:hover::before {
    left: 100%;
}

/* 响应式断点 */
@media (max-width: 768px) {
    .modular-version-indicator {
        top: 5px;
        right: 5px;
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .module-loading {
        padding: 20px 30px;
        min-width: 240px;
    }
    
    .module-error {
        top: 10px;
        font-size: 12px;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .module-loading {
        padding: 15px 20px;
        min-width: 200px;
        margin: 0 10px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .module-loading {
        background: rgba(20, 20, 20, 0.95);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    [data-modular="true"] .chat-container {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
}

/* 模块化调试样式（开发环境使用） */
.debug-module-boundaries {
    outline: 2px dashed var(--module-warning);
    outline-offset: 2px;
}

.debug-module-info {
    position: relative;
}

.debug-module-info::after {
    content: attr(data-module);
    position: absolute;
    top: -20px;
    left: 0;
    background: var(--module-warning);
    color: black;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    font-weight: bold;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .modular-version-indicator,
    .module-loading,
    .module-error {
        border: 2px solid currentColor;
        background: black !important;
        color: white !important;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .modular-version-indicator,
    .module-loading,
    .module-error,
    .module-fade-in {
        animation: none;
        transition: none;
    }
}

/* ===== 链接树面板样式 ===== */

/* 链接树面板容器 - 修改：使用CSS变量跟随主题 */
.link-panel {
    position: fixed;
    top: 0;
    left: -450px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.link-panel.show {
    left: 0;
}

/* 链接树面板头部 */
.link-panel .link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.link-panel .link-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.link-panel .header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 链接树面板内容区 */
.link-panel .link-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
}

/* 按钮样式 */
.link-panel .refresh-button,
.link-panel .close-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.link-panel .refresh-button:hover,
.link-panel .close-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.link-panel .close-button:hover {
    background: rgba(220, 53, 69, 0.6);
}

/* 链接树节点样式 */
.tree-node {
    margin: 4px 0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tree-node .node-content {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.tree-node .node-content:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.tree-node i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

/* 文件夹图标样式 - 修改：黄色文件夹 */
.tree-node .folder-icon {
    color: #ffc107 !important; /* 黄色文件夹 */
    font-size: 16px;
    transition: all 0.2s ease;
}

.tree-node .folder-icon:hover {
    color: #ffd54f !important; /* 悬停时更亮 */
    transform: scale(1.15);
}

.tree-node .node-name {
    flex: 1;
    color: white;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-node .node-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-node .node-content:hover .node-actions {
    opacity: 1;
}

.tree-node .node-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.tree-node .node-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.tree-node .node-btn-danger:hover {
    background: rgba(220, 53, 69, 0.7);
}

.tree-node .node-children {
    margin-left: 24px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 8px;
}

/* 拖拽样式 */
.tree-node.dragging {
    opacity: 0.5;
}

/* 拖拽到上方指示器 - 新增：蓝色横线 */
.tree-node.drag-above .node-content {
    position: relative;
}

.tree-node.drag-above .node-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2196F3, #03A9F4);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.6);
    z-index: 10;
    animation: pulseLine 1s ease-in-out infinite;
}

/* 拖拽到下方指示器 - 新增：蓝色横线 */
.tree-node.drag-below .node-content {
    position: relative;
}

.tree-node.drag-below .node-content::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2196F3, #03A9F4);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.6);
    z-index: 10;
    animation: pulseLine 1s ease-in-out infinite;
}

/* 拖拽到文件夹内部指示器 */
.tree-node.drag-inside .node-content {
    background: rgba(33, 150, 243, 0.2) !important;
    border: 2px dashed #2196F3;
}

/* 指示器脉冲动画 */
@keyframes pulseLine {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(33, 150, 243, 0.6);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 12px rgba(33, 150, 243, 0.9);
    }
}

.tree-node.drag-over {
    background: rgba(255, 193, 7, 0.3);
    border: 2px dashed rgba(255, 193, 7, 0.8);
}

/* 滚动条样式 */
.link-panel .link-content::-webkit-scrollbar {
    width: 8px;
}

.link-panel .link-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.link-panel .link-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.link-panel .link-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 响应式 */
@media (max-width: 768px) {
    .link-panel {
        width: 100vw;
        max-width: 100vw;
        left: -100vw;
    }
    
    .link-panel .link-header h3 {
        font-size: 16px;
    }
    
    .tree-node .node-content {
        padding: 8px 10px;
    }
    
    .tree-node .node-actions {
        opacity: 1;
    }
}

/* ===== 模态框样式 ===== */

/* 模态框背景 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

/* 模态框内容 */
.modal-dialog {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    margin: 0;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 模态框头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.modal-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-header .btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.modal-header .btn-close:hover {
    background: rgba(220, 53, 69, 0.6);
    transform: scale(1.1);
}

/* 模态框主体 */
.modal-body {
    padding: 20px;
    color: white;
}

.modal-body .mb-3 {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-control option {
    background: #1e3c72;
    color: white;
}

/* 模态框底部 */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.modal-footer .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}        
