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

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f5f6fa;
}

/* ===== 侧边栏 ===== */
#sidebar {
    width: 220px;
    min-height: 100vh;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 15px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

#sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    transition: background 0.2s;
}

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

/* ===== 顶部栏 ===== */
.top-bar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    height: 56px;
}

/* ===== 主内容区 ===== */
#main-content {
    min-height: 100vh;
}

/* ===== 自定义弹窗 ===== */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.custom-modal-dialog {
    background: #fff;
    border-radius: 8px;
    width: 480px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.custom-modal-dialog.modal-lg {
    width: 640px;
}

.custom-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    font-size: 16px;
}

.custom-modal-body {
    padding: 20px;
}

.custom-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.custom-modal-footer .btn {
    margin-left: 8px;
}

/* ===== Toast 消息 ===== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
}

.toast-item {
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: toast-in 0.3s ease;
}

.toast-item.toast-success {
    background: #28a745;
}

.toast-item.toast-error {
    background: #dc3545;
}

.toast-item.toast-info {
    background: #17a2b8;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ===== 表格 ===== */
.table th {
    white-space: nowrap;
}

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

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.login-box h3 {
    text-align: center;
    margin-bottom: 30px;
}

/* ===== 权限树 ===== */
.perm-tree {
    padding-left: 0;
    list-style: none;
}

.perm-tree li {
    margin: 4px 0;
}

.perm-tree .perm-children {
    padding-left: 24px;
    list-style: none;
}

/* ===== 上传预览 ===== */
.upload-preview {
    max-width: 300px;
    max-height: 300px;
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: none;
}
