/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f0f2f5;
}

/* 布局样式 */
.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.header {
    height: 60px;
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #1890ff;
}

.h5-switch {
    color: #666;
    text-decoration: none;
}

.h5-switch:hover {
    color: #1890ff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logout {
    color: #666;
    text-decoration: none;
}

.logout:hover {
    color: #1890ff;
}

/* 主体内容区 */
.main {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* 左侧菜单 */
.sidebar {
    width: 200px;
    background-color: #001529;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
}

.menu ul {
    list-style: none;
}

.menu li {
    padding: 12px 24px;
    cursor: pointer;
    position: relative;
}

/* 父级菜单样式 */
.menu li.has-submenu {
    border-left: 3px solid transparent;
    background-color: transparent;
}

.menu li.has-submenu > a {
    font-weight: 600;
    color: #fff;
}

.menu li.has-submenu:hover {
    background-color: transparent;
    border-left-color: #fff;
}

.menu li.has-submenu.expanded {
    background-color: transparent;
    border-left-color: #fff;
}

.menu li.has-submenu.expanded > a {
    color: #fff;
}

/* 没有子菜单的菜单项居中显示 */
.menu li:not(.has-submenu) > a {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.menu li:not(.has-submenu):hover {
    background-color: #002140;
}

.menu li:not(.has-submenu).active {
    background-color: #1890ff;
}

.menu a {
    color: #fff;
    text-decoration: none;
    display: block;
}

/* 子菜单样式 */
.menu li.has-submenu > ul {
    display: none;
    background-color: #00101f;
    padding-left: 0;
    margin-top: 8px;
}

.menu li.has-submenu.expanded > ul {
    display: block;
}

.menu li.has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu li.has-submenu > a .submenu-arrow {
    transition: transform 0.3s;
    font-size: 12px;
    margin-left: 8px;
}

.menu li.has-submenu.expanded > a .submenu-arrow {
    transform: rotate(180deg);
}

/* 二级菜单样式 */
.menu li.has-submenu > ul > li {
    padding-left: 36px;
    font-weight: normal;
}

.menu li.has-submenu > ul > li:hover {
    background-color: #002140;
}

.menu li.has-submenu > ul > li.active {
    background-color: #1890ff;
}

/* 右侧内容区 */
.content {
    flex: 1;
    margin-left: 200px;
    padding: 24px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 500;
}

/* 页面头部带返回按钮的样式 */
.page-header-with-back {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 详情页头部样式（带返回按钮） */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.detail-title {
    font-size: 18px;
    font-weight: bold;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    
    .content {
        margin-left: 80px;
    }
    
    .menu li {
        padding: 12px;
        text-align: center;
    }
    
    .menu span {
        display: none;
    }
}

/* 用户列表样式 */
.user-list {
    background-color: #fff;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    padding-right: 35px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    font-weight: 500;
    background-color: #fafafa;
}

.table tr:hover {
    background-color: #fafafa;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background-color: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    color: #1890ff;
    border-color: #1890ff;
}

.btn-primary {
    background-color: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}

.btn-success {
    background-color: #fff;
    border-color: #d9d9d9;
    color: #666;
}

.btn-success:hover {
    color: #1890ff;
    border-color: #1890ff;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn i {
    margin-right: 4px;
}

.btn-sm i {
    margin-right: 0;
}

.btn-stop {
    background-color: #fff;
    border-color: #ff4d4f;
    color: #ff4d4f;
}

.btn-stop:hover {
    background-color: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}

/* 状态标签 */
.status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.status.active {
    background-color: #e6f7ff;
    color: #1890ff;
}

/* 提醒通知样式 */
.toast-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: slideDown 0.3s ease-out;
    position: relative;
}

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

.toast.success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.toast.warning {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    color: #faad14;
}

.toast.error {
    background-color: #fff1f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.toast-close {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    flex-shrink: 0;
    padding: 0 4px;
    transition: opacity 0.3s;
}

.toast-close:hover {
    opacity: 1;
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

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

/* 响应式布局 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
    }

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

    .content {
        margin-left: 0;
    }

    .content.expanded {
        margin-left: 240px;
    }

    .search-box {
        width: 200px;
    }

    .toast {
        min-width: 280px;
        max-width: 90%;
    }
} 