* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --warning: #f72585;
    --danger: #e63946;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    background-color: #f5f7fb;
    color: var(--dark);
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    z-index: 100;
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.logo h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.8rem;
}

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

.nav-links li {
    margin: 8px 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-links a i {
    width: 24px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.header h2 {
    font-weight: 600;
    color: var(--dark);
}

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

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--warning);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* 卡片网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 25px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

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

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
}

.card-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.security .card-icon {
    background: rgba(76, 201, 240, 0.2);
    color: var(--success);
}

.devices .card-icon {
    background: rgba(67, 97, 238, 0.2);
    color: var(--primary);
}

.privacy .card-icon {
    background: rgba(247, 37, 133, 0.2);
    color: var(--warning);
}

.activity .card-icon {
    background: rgba(230, 57, 70, 0.2);
    color: var(--danger);
}

/* 身份概览卡片 */
.identity-overview {
    grid-column: span 2;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: white;
}

.identity-overview .card-header {
    margin-bottom: 15px;
}

.identity-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.identity-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 10px;
}

.identity-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.identity-value {
    font-size: 1.3rem;
    font-weight: 600;
}

/* 安全状态 */
.security-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-good {
    background: #4ade80;
}

.status-warning {
    background: #fbbf24;
}

.status-bad {
    background: var(--danger);
}

/* 设备列表 */
.device-list {
    list-style: none;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--light-gray);
}

.device-item:last-child {
    border-bottom: none;
}

.device-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--primary);
}

.device-info {
    flex: 1;
}

.device-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.device-status {
    font-size: 0.85rem;
    color: var(--gray);
}

/* 活动日志 */
.activity-log {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.log-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    gap: 15px;
}

.log-item:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--gray);
    font-size: 0.85rem;
    min-width: 80px;
}

.log-description {
    flex: 1;
}

/* 隐私设置 */
.privacy-settings {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--light-gray);
}

.privacy-settings:last-child {
    border-bottom: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 数据共享 */
.sharing-partners {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.partner-card {
    background: var(--light-gray);
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.partner-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* 通知中心 */
.notifications-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.notification-card {
    background: var(--light);
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(67, 97, 238, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

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

.notification-time {
    font-size: 0.8rem;
    color: var(--gray);
}

/* 帮助支持 */
.support-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.support-card {
    background: var(--light);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--light-gray);
}

.support-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
    border-color: var(--primary);
}

.support-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(67, 97, 238, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--primary);
    font-size: 1.5rem;
}

.support-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.support-desc {
    font-size: 0.9rem;
    color: var(--gray);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .identity-overview {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px 0;
    }
    
    .logo {
        padding: 0 15px 15px;
    }
    
    .nav-links {
        display: flex;
        overflow-x: auto;
        padding: 0 5px;
    }
    
    .nav-links li {
        margin: 0 5px;
    }
    
    .nav-links a {
        white-space: nowrap;
        padding: 10px 15px;
    }
    
    .main-content {
        padding: 15px;
    }
}