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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.5;
}

/* ── 登录页 ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}

.login-logo { font-size: 48px; margin-bottom: 12px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-sub { color: #6b7280; font-size: 14px; margin-bottom: 28px; }

/* ── 顶栏 ── */
.topbar {
    background: white;
    border-bottom: 1px solid #e8ecf1;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand { font-size: 18px; font-weight: 700; color: #1a1a2e; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 14px; color: #6b7280; }

/* ── 容器 ── */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header p { color: #6b7280; font-size: 14px; margin-top: 4px; }

/* ── 卡片 ── */
.card {
    background: white;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* ── 工具栏 ── */
.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar .search-input {
    flex: 1;
    min-width: 200px;
}

/* ── 表单 ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: white;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── 按钮 ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a6fd6; }
.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: white; color: #374151; border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px; }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: #f8f9fc;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 2px solid #e8ecf1;
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

tbody tr:hover { background: #fafafa; }

.qq-cell { color: #7c3aed; font-weight: 600; font-family: monospace; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-on { background: #d1fae5; color: #065f46; }
.badge-off { background: #f3f4f6; color: #6b7280; }

.actions { display: flex; gap: 6px; }

/* ── 提示 ── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.api-info {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
    color: #5b21b6;
    line-height: 1.8;
}

.api-info code {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 14px;
}

.count-label { color: #6b7280; font-size: 13px; }

/* ── 弹窗 ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal h2 { font-size: 18px; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
}
