/* 自定义样式 - 现代化美观设计 */

/* 全局变量 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 登录页面样式 */
.login-page {
    min-height: 100vh;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 动态背景粒子效果 */
.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    animation: backgroundMove 20s ease-in-out infinite;
}

/* 动态浮动圆圈 */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

.floating-shape:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 20s;
}

.floating-shape:nth-child(2) {
    width: 120px;
    height: 120px;
    left: 20%;
    animation-delay: 2s;
    animation-duration: 25s;
}

.floating-shape:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 70%;
    animation-delay: 4s;
    animation-duration: 18s;
}

.floating-shape:nth-child(4) {
    width: 100px;
    height: 100px;
    left: 80%;
    animation-delay: 6s;
    animation-duration: 22s;
}

.floating-shape:nth-child(5) {
    width: 40px;
    height: 40px;
    left: 50%;
    animation-delay: 8s;
    animation-duration: 16s;
}

/* 动画关键帧 */
@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes backgroundMove {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(-5px) translateY(-5px);
    }
    50% {
        transform: translateX(5px) translateY(5px);
    }
    75% {
        transform: translateX(-3px) translateY(3px);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    display: block;
}

.login-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-subtitle {
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 2rem;
}

.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-login {
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-login::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;
}

.btn-login:hover::before {
    left: 100%;
}

/* 后台管理样式 */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-gradient);
    color: white;
    transition: var(--transition);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* 菜单样式 */
.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.menu-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-link.active {
    color: white;
    background-color: rgba(102, 126, 234, 0.3);
}

.menu-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #667eea;
}

.menu-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.sidebar.collapsed .menu-icon {
    margin-right: 0;
}

.menu-text {
    transition: var(--transition);
}

.sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}



/* 二级菜单 */
.submenu {
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(102, 126, 234, 0.3);
    margin-left: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.submenu.show {
    max-height: 300px;
    opacity: 1;
}

.submenu .menu-link {
    padding-left: 3rem;
    font-size: 0.9rem;
    transform: translateX(-10px);
    transition: var(--transition);
}

.submenu.show .menu-link {
    transform: translateX(0);
}

.sidebar.collapsed .submenu {
    display: none;
}

/* 菜单箭头动画 */
.menu-arrow {
    margin-left: auto;
    transition: var(--transition);
    transform: rotate(0deg);
}

.menu-link[aria-expanded="true"] .menu-arrow {
    transform: rotate(180deg);
}

/* 菜单项悬停效果增强 */
.menu-link {
    position: relative;
    overflow: hidden;
}

.menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.menu-link:hover::before {
    left: 100%;
}

/* 活动菜单项脉冲效果 */
.menu-link.active {
    position: relative;
}

.menu-link.active::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

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

/* 顶部导航栏 */
.top-navbar {
    background: white;
    height: var(--header-height);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    margin-right: 1rem;
    cursor: pointer;
}

.navbar-toggle:hover {
    color: #495057;
}

.navbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    font-size: 0.9rem;
}

.user-role {
    color: #6c757d;
    margin: 0;
    font-size: 0.8rem;
}

/* 内容区域 */
.content-area {
    padding: 2rem;
}

.page-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 2rem;
}

/* 卡片样式 */
.custom-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: none;
    transition: var(--transition);
}

.custom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .login-card {
        margin: 1rem;
        padding: 2rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 统计卡片边框样式 */
.border-left-primary {
    border-left: 4px solid #667eea !important;
}

.border-left-success {
    border-left: 4px solid #198754 !important;
}

.border-left-info {
    border-left: 4px solid #0dcaf0 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    border-radius: 50px;
}

/* 列表组样式 */
.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* 图表区域 */
.chart-area {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    color: #6c757d;
    font-size: 1.1rem;
}

.chart-area::before {
    content: "📊 图表区域 (可集成Chart.js等图表库)";
}
