/* assets/css/style.css */
:root {
    --sidebar-width: 260px;
    --primary-color: #4e73df;
    --primary-dark: #2e59d9;
    --sidebar-bg: #1f2937;
    --sidebar-text: #d1d5db;
    --sidebar-active: #4e73df;
    --topbar-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fc;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* 登录页面 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 900px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    color: #fff;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.login-left .logo {
    font-size: 64px;
    margin-bottom: 20px;
}

.login-left h2 {
    font-weight: 700;
    margin-bottom: 10px;
}

.login-left p {
    opacity: 0.9;
    font-size: 16px;
}

.login-right {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-right h3 {
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

.login-right .form-label {
    font-weight: 500;
}

.login-right .btn-primary {
    background-color: #4e73df;
    border: none;
    padding: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background 0.3s;
}

.login-right .btn-primary:hover {
    background-color: #2e59d9;
}

/* 后台布局 */
.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

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

.brand-logo {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.brand-text h5 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.brand-text small {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(78,115,223,0.2);
    color: #fff;
    border-left-color: var(--primary-color);
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 0;
}

.sidebar-footer .nav-link {
    color: var(--sidebar-text);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: all 0.3s;
}

.sidebar-footer .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.top-bar {
    height: var(--topbar-height);
    background: #fff;
    padding: 0 30px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 10;
}

.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f8f9fc;
}

/* 欢迎卡片 */
.welcome-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    text-align: center;
}

.welcome-card h1 {
    font-weight: 700;
    color: #4e73df;
    margin-bottom: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .login-card {
        flex-direction: column;
        max-width: 400px;
    }
    .sidebar {
        position: fixed;
        left: -260px;
        transition: left 0.3s;
        z-index: 100;
    }
    .sidebar.show {
        left: 0;
    }
    .main-content {
        margin-left: 0;
    }
}

/* ========== 移动端适配 ========== */
@media (max-width: 991.98px) {
    /* 后台布局：侧边栏固定定位，默认隐藏 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1040;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    /* 主内容区占满全宽 */
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    /* 遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1030;
    }
    .sidebar-overlay.show {
        display: block;
    }
    /* 汉堡按钮显示 */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        color: #333;
        background: transparent;
        border: none;
        cursor: pointer;
        margin-right: 10px;
    }
}

@media (min-width: 992px) {
    /* 桌面端隐藏汉堡按钮 */
    .menu-toggle {
        display: none;
    }
    .sidebar-overlay {
        display: none !important;
    }
}

/* 登录页面移动端调整 */
@media (max-width: 767.98px) {
    .login-card {
        flex-direction: column;
        max-width: 400px;
        margin: 20px;
    }
    .login-left {
        padding: 30px 20px;
    }
    .login-left .logo {
        font-size: 48px;
    }
    .login-left h2 {
        font-size: 1.5rem;
    }
    .login-right {
        padding: 30px 20px;
    }
    .login-right h3 {
        font-size: 1.3rem;
    }
    .content-area {
        padding: 20px;
    }
    .top-bar {
        padding: 0 15px;
    }
    .welcome-card {
        padding: 20px;
    }
    .welcome-card h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 575.98px) {
    .login-card {
        max-width: 100%;
        border-radius: 15px;
    }
    .login-left, .login-right {
        padding: 20px 15px;
    }
    .form-control {
        font-size: 0.9rem;
    }
    .btn {
        font-size: 0.9rem;
    }
}