/* QQ机器人管理平台样式 */

:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --sidebar-width: 260px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
}

/* 认证页面 */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container { width: 100%; max-width: 400px; padding: 20px; }

.auth-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h1 { font-size: 24px; margin-bottom: 8px; }
.auth-header p { color: var(--gray-500); }

.auth-form .form-group { margin-bottom: 20px; }
.auth-form label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-700); }
.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-footer { text-align: center; margin-top: 20px; color: var(--gray-500); }
.auth-footer a { color: var(--primary); text-decoration: none; }

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

.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}
.sidebar-header h1 { font-size: 18px; }

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.2s;
}
.nav-item:hover { background: var(--gray-100); }
.nav-item.active { background: var(--primary); color: white; }
.nav-icon { margin-right: 10px; font-size: 16px; }

.nav-divider { height: 1px; background: var(--gray-200); margin: 16px 0; }
.nav-title { font-size: 12px; color: var(--gray-500); padding: 0 12px; margin-bottom: 8px; text-transform: uppercase; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.user-info { display: flex; align-items: center; gap: 8px; }
.user-avatar { font-size: 20px; }
.user-name { font-weight: 500; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-100); }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2 { font-size: 16px; }
.card-body { padding: 20px; }

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-700); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* 提示框 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-icon { font-size: 32px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 14px; color: var(--gray-500); }

/* 机器人卡片 */
.bot-grid { display: grid; gap: 16px; }
.bot-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 10px;
    transition: background 0.2s;
}
.bot-card:hover { background: var(--gray-100); }
.bot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}
.bot-avatar img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.bot-info h3 { font-size: 15px; margin-bottom: 2px; }
.bot-appid { font-size: 12px; color: var(--gray-500); font-family: monospace; }
.bot-desc { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.bot-status { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.bot-actions { display: flex; gap: 8px; }

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.status-active { background: #d1fae5; color: #059669; }
.status-inactive { background: #fee2e2; color: #dc2626; }
.env-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--gray-200);
    color: var(--gray-700);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--gray-500); margin-bottom: 20px; }

/* 页面头部 */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; margin-bottom: 4px; }
.page-header p { color: var(--gray-500); }

/* 消息发送表单 */
.message-form { max-width: 600px; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.tab:hover { background: var(--gray-200); }
.tab.active { background: var(--primary); color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 消息日志 */
.message-log {
    background: var(--gray-900);
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    max-height: 400px;
    overflow-y: auto;
}
.log-item { padding: 8px 0; border-bottom: 1px solid #333; }
.log-time { color: #888; }
.log-in { color: #10b981; }
.log-out { color: #60a5fa; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--gray-200); }
.table th { font-weight: 600; color: var(--gray-700); background: var(--gray-50); }
.table tr:hover { background: var(--gray-50); }

/* 分页 */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--gray-700);
    background: white;
    border: 1px solid var(--gray-300);
}
.pagination a:hover { background: var(--gray-100); }
.pagination .active { background: var(--primary); color: white; border-color: var(--primary); }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .bot-card { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

