/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.logo-container h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.nav-links {
    list-style: none;
    padding: 15px 0;
}

.nav-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px 5px;
    color: #adb5bd;
}

.nav-links li {
    position: relative;
}

.nav-links li.active {
    background-color: rgba(255,255,255,0.1);
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-links li a:hover {
    background-color: rgba(255,255,255,0.05);
}

.nav-links li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 900;
}

.search-container {
    position: relative;
    width: 350px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

.search-input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: #4a6cf7;
}

.user-menu {
    display: flex;
    align-items: center;
}

/* 通知图标样式 */
.notifications {
    position: relative;
    margin-right: 20px;
}

.notification-icon {
    cursor: pointer;
    color: #495057;
    position: relative;
    display: block;
    padding: 5px;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 通知下拉菜单 */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: -10px;
    width: 320px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
}

.notification-dropdown.show {
    display: block;
}

.notification-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 15px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eaeaea;
}

.notification-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.mark-all-read {
    font-size: 0.8rem;
    color: #4a6cf7;
    text-decoration: none;
}

.mark-all-read:hover {
    text-decoration: underline;
}

.notification-items {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.notification-item.unread {
    background-color: #f0f7ff;
}

.notification-title {
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.notification-text {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.notification-time {
    font-size: 0.75rem;
    color: #999;
    display: block;
}

.no-notifications {
    padding: 25px;
    text-align: center;
    color: #999;
}

.dropdown-divider {
    height: 1px;
    background-color: #eaeaea;
    margin: 5px 0;
}

.view-all {
    display: block;
    text-align: center;
    padding: 10px;
    color: #4a6cf7;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.view-all:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

/* 用户信息样式 */
.user-info {
    position: relative;
}

.user-info-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #4a6cf7;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

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

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border-radius: 5px;
    width: 200px;
    padding: 5px 0;
    display: none;
    z-index: 1000;
    margin-top: 10px;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 15px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-dropdown a:hover {
    background-color: #f8f9fa;
}

.user-dropdown a i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.login-link, .register-link {
    color: #4a6cf7;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
}

.login-link:hover, .register-link:hover {
    text-decoration: underline;
}

/* 内容区域 */
.content-wrapper {
    flex: 1;
    padding: 20px;
    background-color: #f0f2f5;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }

    .logo-container h2 {
        display: none;
    }

    .nav-links li a span {
        display: none;
    }

    .main-content {
        margin-left: 70px;
    }

    .user-details {
        display: none;
    }

    .search-container {
        width: 200px;
    }

    .notification-dropdown,
    .user-dropdown {
        position: fixed;
        right: 10px;
        width: calc(100% - 80px);
        max-width: 320px;
    }
}
