* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-info {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
}

/* 主内容区 */
.main-content {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: white;
    padding: 1.5rem 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: #555;
}

.nav-item:hover {
    background: #f0f2f5;
    color: #667eea;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 内容区 */
.content-area {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-y: auto;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
}

.page h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.3rem;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

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

.stat-card.online {
    border-left: 4px solid #52c41a;
}

.stat-card.offline {
    border-left: 4px solid #ff4d4f;
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
}

/* 快捷操作 */
.quick-actions {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.quick-actions h3 {
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-warning {
    background: #faad14;
    color: white;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-secondary {
    background: #f0f2f5;
    color: #555;
}

.btn-info {
    background: #1890ff;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-search {
    background: #667eea;
    color: white;
}

.btn-reset {
    background: #f0f2f5;
    color: #555;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

/* 筛选标签 */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 用户列表 */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #666;
    font-weight: bold;
}

.user-avatar.online {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    color: white;
}

.user-basic h4 {
    margin-bottom: 0.25rem;
}

.user-uuid {
    font-size: 0.8rem;
    color: #888;
    word-break: break-all;
}

.user-status {
    margin-left: auto;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.user-status.online {
    background: #f6ffed;
    color: #52c41a;
}

.user-status.offline {
    background: #fff2f0;
    color: #ff4d4f;
}

.user-details p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f2f5;
}

/* 命令列表 */
.command-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.command-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.command-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.command-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.command-mode {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.mode-single {
    background: #e6f7ff;
    color: #1890ff;
}

.mode-all {
    background: #fff7e6;
    color: #fa8c16;
}

.mode-offline {
    background: #f6ffed;
    color: #52c41a;
}

.command-time {
    margin-left: auto;
    color: #888;
    font-size: 0.85rem;
}

.command-code code {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    display: block;
    overflow-x: auto;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
}

.command-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #888;
}

/* 发送命令表单 */
.send-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.radio-group {
    display: flex;
    gap: 2rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f0f2f5;
}

.modal-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin-bottom: 0.75rem;
    word-break: break-all;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #52c41a;
}

.toast.error {
    background: #ff4d4f;
}

.toast.warning {
    background: #faad14;
}

.toast.info {
    background: #1890ff;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: #888;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 1rem 0;
    }
    
    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 0.5rem;
    }
    
    .nav-item {
        white-space: nowrap;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}