/* 自定义CSS变量 */
:root {
    --sidebar-width: 260px;
    --header-height: 64px;
    --card-bg-light: rgba(255, 255, 255, 0.9);
    --card-bg-dark: rgba(17, 24, 39, 0.8);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px) rotate3d(1, 1, 0, 3deg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

/* 侧边栏固定宽度 */
.sidebar-width {
    width: var(--sidebar-width);
}

/* 主内容区域的左边距，与侧边栏宽度相同 */
.main-content {
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-open {
    margin-left: var(--sidebar-width);
}

/* 插件卡片样式 */
.plugin-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.plugin-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: all 0.3s ease;
}

.plugin-card.active:before {
    background-color: #10B981;
}

.plugin-card.inactive:before {
    background-color: #6B7280;
}

.plugin-card.unloaded:before {
    background-color: #F59E0B;
}

.plugin-card.disabled:before {
    background-color: #6B7280;
}

.plugin-card.error:before {
    background-color: #EF4444;
}

/* 状态开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.dark .toggle-slider {
    background-color: #475569;
}

input:checked + .toggle-slider {
    background-color: #3b82f6;
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px #3b82f6;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 通知样式 */
.notification {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    color: white;
    font-weight: 500;
    z-index: 100;
    max-width: 24rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-size: 1rem;
    transform: scale(1.05);
    animation: notification-pulse 2s infinite;
}

@keyframes notification-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 153, 225, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(66, 153, 225, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(66, 153, 225, 0);
    }
}

/* 模态窗口样式 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    max-width: 90%;
    width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .modal-content {
    background-color: #1f2937;
    border: 1px solid #374151;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark .modal-header {
    border-bottom-color: #374151;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.dark .modal-footer {
    border-top-color: #374151;
}

/* CodeMirror 高度 */
.CodeMirror {
    height: 400px !important;
}

/* 配置文件列表样式 */
.config-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-file-item {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.dark .config-file-item {
    border-color: #374151;
}

.config-file-item:hover {
    background-color: #f3f4f6;
}

.dark .config-file-item:hover {
    background-color: #2d3748;
}

/* 编辑器容器样式 */
.editor-container {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    overflow: hidden;
    height: 400px;
}

.dark .editor-container {
    border-color: #374151;
}

/* HTML内容iframe样式 */
.html-iframe-container {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    overflow: hidden;
    min-height: 400px;
    width: 100%;
}

.dark .html-iframe-container {
    border-color: #374151;
}

.html-iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    background-color: white;
}

.dark .html-iframe {
    background-color: #1f2937;
}

/* 编辑器标签页 */
.editor-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f3f4f6;
}

.dark .editor-tabs {
    border-bottom-color: #374151;
    background-color: #374151;
}

.editor-tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-right: 1px solid #e5e7eb;
}

.dark .editor-tab {
    border-right-color: #4b5563;
}

.editor-tab.active {
    background-color: white;
    font-weight: 500;
}

.dark .editor-tab.active {
    background-color: #1f2937;
}

/* CodeMirror 主题覆盖 */
.cm-editor {
    height: 100%;
}

.dark .cm-editor {
    background-color: #1f2937;
    color: #e5e7eb;
}