/* 仪表板样式 */
.dashboard {
    padding-top: 70px;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.dashboard .container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 2rem 1rem;
}

/* 侧边栏 */
.sidebar {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover,
.menu-item.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

/* 主要内容区域 */
.main-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.tab-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, var(--accent-color), #d97706);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* 仪表板网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-actions select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: white;
}

.card-body {
    padding: 1.5rem;
}

/* 策略表现 */
.strategy-performance {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.strategy-name {
    font-weight: 500;
    color: var(--text-primary);
}

.strategy-return {
    font-weight: 600;
    font-size: 1.125rem;
}

.strategy-return.positive {
    color: var(--success-color);
}

.strategy-return.negative {
    color: var(--danger-color);
}

/* 策略列表 */
.strategies-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.strategy-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.strategy-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.strategy-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.strategy-item-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.strategy-item-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.strategy-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background: var(--success-color);
    color: white;
}

.status-paused {
    background: var(--warning-color);
    color: white;
}

.status-stopped {
    background: var(--danger-color);
    color: white;
}

.strategy-item-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-item h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-item span {
    font-size: 0.75rem;
    color: var(--text-light);
}

.strategy-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* 收益分析 */
.performance-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.performance-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.summary-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--border-light);
}

.summary-item h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.amount.positive {
    color: var(--success-color);
}

.amount.negative {
    color: var(--danger-color);
}

.percentage {
    font-size: 1.25rem;
    font-weight: 600;
}

.percentage.positive {
    color: var(--success-color);
}

.percentage.negative {
    color: var(--danger-color);
}

.performance-chart {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

/* 订单表格 */
.orders-table {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.orders-table table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.orders-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.orders-table td {
    color: var(--text-secondary);
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-completed {
    background: var(--success-color);
    color: white;
}

.status-pending {
    background: var(--warning-color);
    color: white;
}

.status-cancelled {
    background: var(--danger-color);
    color: white;
}

/* 收藏夹网格 */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.favorite-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.favorite-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 设置表单 */
.settings-form {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-info h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.setting-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 用户头像下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 100;
    display: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-light);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .dashboard .container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar {
        position: static;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .menu-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .menu-item:hover,
    .menu-item.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .performance-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .strategy-item-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .favorites-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .performance-summary {
        grid-template-columns: 1fr;
    }
    
    .strategy-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .strategy-item-stats {
        grid-template-columns: 1fr;
    }
}