/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f3f4f6; color: #1a1a2e; font-size: 14px; line-height: 1.5;
}

a { color: #3b82f6; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #e5e7eb; padding: 2px 6px; border-radius: 3px; font-size: 13px; }

/* ===== 导航 ===== */
.nav {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff; padding: 0 24px; display: flex; align-items: center;
    height: 56px; position: sticky; top: 0; z-index: 100;
}
.nav-brand { font-size: 18px; font-weight: 700; margin-right: 32px; white-space: nowrap; }
.nav-items { display: flex; gap: 4px; flex: 1; }
.nav-items a {
    color: rgba(255,255,255,0.7); padding: 8px 14px; border-radius: 6px;
    font-size: 14px; transition: all 0.15s; text-decoration: none;
}
.nav-items a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-items a.active { background: rgba(255,255,255,0.15); color: #fff; font-weight: 600; }
.nav-status { font-size: 12px; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: #22c55e; }
.dot-err { background: #ef4444; }

/* ===== 主体 ===== */
.main { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* ===== 页面头部 ===== */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: #fff; border-radius: 12px; padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #d1d5db;
}
.stat-value { font-size: 32px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: #888; margin-top: 4px; }
.stat-pending { border-left-color: #f59e0b; }
.stat-pending .stat-value { color: #f59e0b; }
.stat-running { border-left-color: #3b82f6; }
.stat-running .stat-value { color: #3b82f6; }
.stat-completed { border-left-color: #22c55e; }
.stat-completed .stat-value { color: #22c55e; }
.stat-failed { border-left-color: #ef4444; }
.stat-failed .stat-value { color: #ef4444; }

/* ===== 卡片 ===== */
.card {
    background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px; overflow: hidden;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid #f3f4f6;
}
.card-header h3 { font-size: 16px; font-weight: 600; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    background: #f9fafb; padding: 10px 16px; text-align: left;
    font-weight: 600; font-size: 12px; text-transform: uppercase;
    color: #666; letter-spacing: 0.05em; border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; color: #374151; }
.form-control {
    width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 14px; transition: border-color 0.15s; background: #fff;
}
.form-control:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
select.form-control { cursor: pointer; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px;
    border-radius: 6px; font-size: 14px; font-weight: 500; border: none;
    cursor: pointer; transition: all 0.15s; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.btn-outline:hover { background: #f3f4f6; border-color: #9ca3af; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ===== 徽标 ===== */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 600;
}
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fef3c7; color: #92400e; }
.badge-running { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #f3f4f6; color: #6b7280; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }

/* ===== 模态框 ===== */
.modal {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.5);
    z-index: 1000; justify-content: center; align-items: center;
}
.modal.show { display: flex; }
.modal-content {
    background: #fff; border-radius: 12px;
    max-width: 600px; width: 90%;
    max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #888; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid #eee; }

/* ===== TAB 导航 ===== */
.config-tabs {
    display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px;
    border-bottom: 2px solid #e5e7eb; padding-bottom: 0;
}
.config-tab {
    padding: 8px 16px; border: none; background: transparent; cursor: pointer;
    font-size: 13px; font-weight: 500; color: #666;
    border-radius: 8px 8px 0 0; transition: all 0.15s; position: relative; bottom: -2px;
}
.config-tab:hover { background: #f3f4f6; color: #333; }
.config-tab.active {
    background: #fff; color: #3b82f6; border: 2px solid #e5e7eb;
    border-bottom-color: #fff; font-weight: 600;
}
.config-tab-content { display: none; }
.config-tab-content.active { display: block; }

/* ===== 指南样式 ===== */
.guide-steps { margin-top: 20px; }
.guide-step {
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 20px 24px; margin-bottom: 16px;
}
.guide-step h4 { margin-bottom: 12px; font-size: 16px; color: #1f2937; }
.guide-step ul { margin-left: 20px; line-height: 1.8; }
.guide-step li { margin-bottom: 4px; }
.platform-card {
    padding: 28px 32px; border-radius: 14px; color: #fff; margin-bottom: 24px;
}
.screenshot {
    background: #1f2937; color: #d1d5db; padding: 12px 16px; border-radius: 8px;
    font-family: 'Courier New', monospace; font-size: 14px; margin: 12px 0;
    line-height: 1.7;
}
.note-box {
    background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px;
    padding: 12px 16px; font-size: 14px; color: #92400e; margin: 12px 0;
}
.guide-section h2 {
    font-size: 22px; font-weight: 700; margin: 0 0 4px;
}
.guide-section > p { font-size: 14px; opacity: 0.9; }

/* ===== 警告框 ===== */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.alert-success { background: #d1fae5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-warning { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; }
.alert-error { background: #fee2e2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ===== 工具 ===== */
.text-center { text-align: center; }
.text-muted { color: #888; font-size: 13px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
