/* MCDR WebUI 主样式文件 */

:root {
    /* 全局颜色变量 */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    
    /* 布局变量 */
    --sidebar-width: 260px;
    --header-height: 64px;
    
    /* 背景颜色 */
    --card-bg-light: rgba(255, 255, 255, 0.9);
    --card-bg-dark: rgba(17, 24, 39, 0.8);
    
    /* 文本颜色 */
    --text-primary-light: #1e293b;
    --text-primary-dark: #f1f5f9;
    
    /* 渐变颜色 */
    --gradient-start: #3b82f6;
    --gradient-end: #8b5cf6;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 转场动画时间 */
    --transition-slow: 0.5s;
    --transition-normal: 0.3s;
    --transition-fast: 0.15s;
}

/* 暗色模式变量 */
.dark {
    --card-bg: var(--card-bg-dark);
    --text-primary: var(--text-primary-dark);
}

/* 光亮模式变量 */
:root:not(.dark) {
    --card-bg: var(--card-bg-light);
    --text-primary: var(--text-primary-light);
}

/* 侧边栏和主内容布局 */
.sidebar-width {
    width: var(--sidebar-width);
}

.main-content {
    transition: margin-left var(--transition-normal) ease;
}

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

/* 自定义滚动条 */
::-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;
}

/* 卡片悬停效果 */
.card-hover {
    transition: transform var(--transition-normal) ease, 
                box-shadow var(--transition-normal) ease;
}

.card-hover:hover {
    transform: translateY(-5px) rotate3d(1, 1, 0, 3deg);
    box-shadow: var(--shadow-xl);
}

/* 背景动画 */
.bg-animated {
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end), #06b6d4);
    background-size: 200% 200%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 浮动动画 */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 滑动开关动画 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    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: #ccc;
    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%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-500);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary-500);
}

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

/* 微交互动画 */
.btn-pulse {
    position: relative;
}

.btn-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: inherit;
    border-radius: inherit;
    animation: pulse 1.5s ease-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 页面过渡效果 */
.page-transition {
    animation: page-fade-in 0.3s ease-in-out;
}

@keyframes page-fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式布局辅助类 */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 240px;
    }
} 

/* ======= MCDR 配置表单样式 ======= */

/* 配置区域容器 */
.config-section {
    background-color: var(--card-bg-light);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(229, 231, 235, 0.5);
    transition: all var(--transition-normal) ease;
}

.dark .config-section {
    background-color: var(--card-bg-dark);
    border-color: rgba(75, 85, 99, 0.5);
}

.config-section:hover {
    box-shadow: var(--shadow-lg);
}

/* 配置组 */
.config-group {
    border-top: 1px solid rgba(229, 231, 235, 0.8);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.config-group:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.dark .config-group {
    border-top-color: rgba(75, 85, 99, 0.5);
}

/* 配置项 */
.config-item {
    margin-bottom: 1.5rem;
    animation: fade-in 0.5s ease-out;
}

.config-item:last-child {
    margin-bottom: 0;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 嵌套配置项 */
.config-item-child {
    padding-left: 1.25rem;
    border-left: 2px solid rgba(209, 213, 219, 0.8);
    margin-top: 1rem;
    margin-left: 0.5rem;
}

.dark .config-item-child {
    border-left-color: rgba(75, 85, 99, 0.7);
}

/* 标题样式 */
.config-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(30, 58, 138, 0.1);
    display: flex;
    align-items: center;
}

.config-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background-color: #3b82f6;
    margin-right: 0.75rem;
    border-radius: 2px;
}

.dark .config-title {
    color: #93c5fd;
    border-bottom-color: rgba(147, 197, 253, 0.2);
}

/* 配置组标题 */
.config-group-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.config-group-title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: #60a5fa;
    margin-right: 0.5rem;
    border-radius: 2px;
}

.dark .config-group-title {
    color: #e5e7eb;
}

/* 表单标签 */
.config-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.dark .config-label {
    color: #d1d5db;
}

/* 提示信息 */
.config-tip {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.5rem;
    font-weight: normal;
    display: inline-block;
    opacity: 0.8;
    transition: opacity var(--transition-fast) ease;
}

.config-label:hover .config-tip {
    opacity: 1;
}

.dark .config-tip {
    color: #9ca3af;
}

/* 输入框样式 */
.config-input[type="text"],
.config-input[type="number"],
.config-input.multiple-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(209, 213, 219, 0.8);
    border-radius: 0.5rem;
    background-color: #fff;
    color: #1f2937;
    font-size: 0.9rem;
    transition: all var(--transition-fast) ease;
    box-shadow: var(--shadow-sm);
}

.config-input[type="text"]:focus,
.config-input[type="number"]:focus,
.config-input.multiple-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.dark .config-input[type="text"],
.dark .config-input[type="number"],
.dark .config-input.multiple-input {
    background-color: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.5);
    color: #e5e7eb;
}

.dark .config-input[type="text"]:focus,
.dark .config-input[type="number"]:focus,
.dark .config-input.multiple-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

/* 复选框样式 */
.config-input[type="checkbox"] {
    cursor: pointer;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 0.25rem;
    border: 2px solid #d1d5db;
    position: relative;
    transition: all var(--transition-fast) ease;
    margin-right: 0.5rem;
    appearance: none;
    background-color: #fff;
}

.config-input[type="checkbox"]:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.config-input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 0.5rem;
    height: 0.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='3' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 12.75l6 6 9-13.5' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.dark .config-input[type="checkbox"] {
    border-color: #4b5563;
    background-color: rgba(31, 41, 55, 0.8);
}

.dark .config-input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* 复选框标签样式 */
.config-input[type="checkbox"] + .config-label {
    cursor: pointer;
    display: inline-block;
}

/* 信息列表样式 */
.about-list {
    background-color: rgba(243, 244, 246, 0.7);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 0.75rem 0;
    font-size: 0.875rem;
    border-left: 3px solid #3b82f6;
}

.dark .about-list {
    background-color: rgba(31, 41, 55, 0.5);
    border-left-color: #60a5fa;
}

.about-item {
    margin-bottom: 0.75rem;
}

.about-item:last-child {
    margin-bottom: 0;
}

.about-item a {
    color: #2563eb;
    text-decoration: none;
    transition: color var(--transition-fast) ease;
}

.about-item a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.dark .about-item a {
    color: #60a5fa;
}

.dark .about-item a:hover {
    color: #93c5fd;
}

.about-item ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    list-style-type: disc;
}

.about-item li {
    margin-bottom: 0.25rem;
}

/* 保存按钮样式 */
.btn-save {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #2563eb;
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast) ease;
    box-shadow: var(--shadow);
    display: inline-block;
}

.btn-save:hover {
    background-color: #1d4ed8;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-save:active {
    transform: translateY(0);
}

.dark .btn-save {
    background-color: #3b82f6;
}

.dark .btn-save:hover {
    background-color: #2563eb;
}

/* 配置文件选择按钮 */
.config-file-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all var(--transition-fast) ease;
    cursor: pointer;
}

.config-file-btn.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.dark .config-file-btn.active {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.config-file-btn:hover:not(.active) {
    background-color: rgba(243, 244, 246, 0.8);
}

.dark .config-file-btn:hover:not(.active) {
    background-color: rgba(55, 65, 81, 0.5);
}

/* 下拉选择框样式 */
.config-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(209, 213, 219, 0.8);
    border-radius: 0.5rem;
    background-color: #fff;
    color: #1f2937;
    font-size: 0.9rem;
    transition: all var(--transition-fast) ease;
    box-shadow: var(--shadow-sm);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.config-select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.dark .config-select {
    background-color: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.5);
    color: #e5e7eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

.dark .config-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

.config-select option {
    padding: 0.5rem;
}

.dark .config-select option {
    background-color: #1f2937;
}

/* 标签输入框样式 */
.tags-input-container {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    border-radius: 0.5rem;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background-color: white;
    min-height: 2.75rem;
    transition: all 0.3s;
}

.dark .tags-input-container {
    border-color: #4b5563;
    background-color: #374151;
}

.tags-input-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #e0f2fe;
    color: #0369a1;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.dark .tag-item {
    background-color: #0c4a6e;
    color: #7dd3fc;
}

.tag-item .close {
    margin-left: 0.375rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background-color: #bae6fd;
    color: #0284c7;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.dark .tag-item .close {
    background-color: #075985;
    color: #38bdf8;
}

.tag-item .close:hover {
    background-color: #0284c7;
    color: #e0f2fe;
}

.dark .tag-item .close:hover {
    background-color: #0369a1;
    color: #bae6fd;
}

.tags-input {
    flex-grow: 1;
    outline: none;
    border: none;
    font-size: 0.875rem;
    padding: 0.25rem;
    background-color: transparent;
    color: #1f2937;
    min-width: 8rem;
}

.dark .tags-input {
    color: #f3f4f6;
}

.tags-input::placeholder {
    color: #9ca3af;
}

.dark .tags-input::placeholder {
    color: #6b7280;
}

.add-tag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #3b82f6;
    color: white;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
    cursor: pointer;
}

.dark .add-tag-btn {
    background-color: #2563eb;
}

.add-tag-btn:hover {
    background-color: #2563eb;
}

.dark .add-tag-btn:hover {
    background-color: #1d4ed8;
}

.add-tag-btn i {
    margin-right: 0.375rem;
} 


.menu-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;       /* px-4 py-3 */
  font-size: 0.875rem;         /* text-sm */
  font-weight: 500;            /* font-medium */
  border-radius: 0.5rem;       /* rounded-lg */
  color: #374151;              /* text-gray-700 */
  transition: background-color 0.2s ease-in-out;
  margin-top: 0.5rem;          /* mt-2 if needed */
}

.menu-link:hover {
  background-color: #f3f4f6;   /* hover:bg-gray-100 */
}

.dark .menu-link {
  color: #e5e7eb;              /* dark:text-gray-200 */
}

.dark .menu-link:hover {
  background-color: #374151;   /* dark:hover:bg-gray-700 */
}

/* ✅ 当前激活页面（你想要的效果） */
.menu-link.active {
  background-color: #eff6ff; /* bg-blue-50 */
  color: #1d4ed8;            /* text-blue-700 */
}

.dark .menu-link.active {
  background-color: rgba(30, 58, 138, 0.2); /* dark:bg-blue-900/20 */
  color: #bfdbfe;                          /* dark:text-blue-200 */
}