/* css/style.css */

:root {
    --primary-color: #4e54c8;
    --primary-hover: #3f44a3;
    --secondary-color: #8f94fb;
    --bg-color: #f4f6f9;
    --sidebar-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* 顶部导航栏 */
.navbar {
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
    padding: 0.5rem 1rem !important;
    z-index: 1030;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.5rem;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 60px 0 0; 
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
    background-color: var(--sidebar-bg);
    transition: all var(--transition-speed);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 60px);
    padding-top: 1rem;
    overflow-x: hidden;
    overflow-y: auto; 
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    margin: 0.3rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background-color: rgba(78, 84, 200, 0.05);
    color: var(--primary-color);
    transform: translateX(3px);
}

.sidebar .nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 10px rgba(78, 84, 200, 0.3);
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: #adb5bd;
}

/* 二级菜单动画与样式 */
.nav-link .bi-chevron-down {
    transition: transform var(--transition-speed) ease;
    font-size: 0.8rem;
    width: auto;
    margin-left: auto;
}

.nav-link[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

#elementConfigCollapse .nav-link {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    margin: 0.2rem 1rem;
    font-size: 0.95em;
}

#elementConfigCollapse .nav-link i {
    font-size: 1rem;
}

/* 主内容区域 */
.main-content {
    margin-top: 60px;
    padding: 2rem !important;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 页面标题 */
.page-title {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0;
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-speed);
    margin-bottom: 1.5rem;
    background: #ffffff;
}

.card:hover {
    box-shadow: var(--hover-shadow);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* 统计卡片特殊样式 */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 16px;
}

.stat-card .card-title {
    opacity: 0.9;
    font-size: 1rem;
    font-weight: 500;
}

.stat-card .display-4 {
    font-weight: 700;
    font-size: 2.5rem;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.6rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(143, 148, 251, 0.25);
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(78, 84, 200, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    color: #333;
}

.table-hover tbody tr:hover {
    background-color: rgba(78, 84, 200, 0.03);
}

.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 500;
}

/* Toast 通知样式定制 */
.toast-container {
    z-index: 1056;
}

.toast {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* 代码块样式 */
code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #e83e8c;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
