/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

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

.login-container {
    width: 100%;
    max-width: 900px;
}

.login-card {
    display: flex;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    min-height: 500px;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #fff;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

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

.login-logo h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

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

.login-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,192L48,176C96,160,192,128,288,128C384,128,480,160,576,181.3C672,203,768,213,864,202.7C960,192,1056,160,1152,138.7C1248,117,1344,107,1392,101.3L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    pointer-events: none;
}

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

.login-right h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #333;
}

.login-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

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

.alert-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* ========== 后台布局 ========== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: 250px;
    background: #1e1e2d;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #a18cd1, #fbc2eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

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

.menu {
    list-style: none;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #c2c2d0;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    font-size: 15px;
    cursor: pointer;
}

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

.menu-link.active {
    background: rgba(102,126,234,0.2);
    color: #fff;
    border-left-color: #667eea;
}

.menu-icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.arrow {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 14px;
}

.has-submenu.open .arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    background: rgba(0,0,0,0.2);
    padding: 5px 0;
}

.submenu li a {
    display: block;
    padding: 10px 20px 10px 56px;
    color: #aaa;
    font-size: 14px;
    transition: all 0.3s;
}

.submenu li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.submenu li a.active {
    color: #fff;
    background: rgba(102,126,234,0.3);
}

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

.logout-link {
    display: flex;
    align-items: center;
    color: #ff6b6b;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s;
}

.logout-link:hover {
    background: rgba(255,107,107,0.1);
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    margin-left: 250px; /* 侧边栏宽度 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.top-bar {
    background: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-date {
    color: #888;
    font-size: 14px;
}

.page-content {
    padding: 30px;
    flex: 1;
}

/* ========== 欢迎横幅 ========== */
.welcome-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102,126,234,0.3);
    text-align: center;
}

.welcome-banner h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.welcome-banner p {
    font-size: 16px;
    opacity: 0.9;
}

/* ========== 占位页面 ========== */
.placeholder-page {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.placeholder-page h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.placeholder-page p {
    color: #888;
    font-size: 16px;
}

/* ========== 弹窗样式 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.modal-content input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5a6fd6;
}

/* ========== 汉堡菜单按钮 ========== */
.hamburger {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 5px 10px;
    margin-right: 10px;
}

/* 遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ========== 响应式设计（移动端适配） ========== */
@media (max-width: 768px) {
    /* 登录页：左右卡片堆叠 */
    .login-card {
        flex-direction: column;
        min-height: auto;
    }
    .login-left {
        padding: 30px 20px;
    }
    .login-right {
        padding: 30px 20px;
    }
    .login-logo .logo-icon {
        font-size: 48px;
        margin-bottom: 15px;
    }
    .login-logo h1 {
        font-size: 22px;
    }
    .login-logo p {
        font-size: 14px;
    }
    .login-decoration {
        height: 80px;
    }

    /* 后台布局：侧边栏默认隐藏 */
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-overlay.active {
        display: block;
    }

    /* 顶部栏显示汉堡按钮 */
    .hamburger {
        display: inline-block;
    }

    /* 调整主内容区留白 */
    .top-bar {
        padding: 12px 15px;
    }
    .page-content {
        padding: 15px;
    }

    /* 欢迎横幅 */
    .welcome-banner {
        padding: 25px 20px;
    }
    .welcome-banner h1 {
        font-size: 24px;
    }

    /* 占位页面 */
    .placeholder-page {
        padding: 40px 15px;
    }
    .placeholder-icon {
        font-size: 48px;
    }

    /* 弹窗 */
    .modal-content {
        padding: 20px;
        width: 95%;
        max-width: 350px;
    }
}