/* ============================================================================
 * appai-system 样式
 * 简约风格，不限制看板自定义样式
 * ============================================================================ */

:root {
    --primary: #5470c6;
    --primary-dark: #3b5199;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-secondary: #666666;
    --border: #e0e0e0;
    --error: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ======== 顶部导航栏 ======== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 0 24px;
    height: 50px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.topbar-left .brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user-info { color: var(--text-secondary); font-size: 14px; }
.btn-logout {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}
.btn-logout:hover { color: var(--error); border-color: var(--error); }

/* ======== 主内容区 ======== */
.main-content { max-width: 1400px; margin: 0 auto; }

/* ======== 登录页 ======== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    background: #fff;
    padding: 40px 36px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 380px;
    max-width: 90vw;
}
.login-box h1 { text-align: center; font-size: 24px; margin-bottom: 4px; }
.login-box .subtitle { text-align: center; color: var(--text-secondary);
                       font-size: 14px; margin-bottom: 28px; }

.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fde8e8; color: var(--error); border: 1px solid #f5c6cb; }

.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; margin-bottom: 6px; font-size: 14px;
                    color: var(--text-secondary); }
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 15px; transition: border-color 0.2s;
}
.login-form input:focus { outline: none; border-color: var(--primary);
                          box-shadow: 0 0 0 3px rgba(84,112,198,0.15); }

.btn-primary {
    background: var(--primary); color: #fff; border: none;
    padding: 10px 20px; border-radius: 6px; font-size: 15px;
    cursor: pointer; transition: background 0.2s; text-decoration: none;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-full { width: 100%; padding: 12px; font-size: 16px; }

/* ======== 看板列表 ======== */
.dashboard-list-page { padding: 24px; }
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; }
.dashboard-count { color: var(--text-secondary); font-size: 14px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.dashboard-card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); text-decoration: none;
    color: var(--text); transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}
.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.card-header { display: flex; gap: 8px; margin-bottom: 10px; }
.card-badge {
    padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.badge-demo { background: #fff3cd; color: #856404; }
.badge-prod { background: #d4edda; color: #155724; }
.card-chart-type {
    font-size: 11px; color: var(--text-secondary);
    padding: 2px 8px; background: #f0f0f0; border-radius: 10px;
}
.card-title { font-size: 16px; margin-bottom: 6px; }
.card-desc {
    font-size: 13px; color: var(--text-secondary); margin-bottom: 14px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-footer {
    display: flex; justify-content: space-between;
    font-size: 12px; color: #999; padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ======== 空状态 ======== */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); line-height: 1.8; }
.empty-state code {
    background: #f0f0f0; padding: 2px 8px; border-radius: 4px; font-size: 13px;
}

/* ======== 数据表格 ======== */
.data-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: #fff; border-radius: var(--radius); overflow: hidden;
}
.data-table th {
    background: #f8f9fa; padding: 10px 12px; text-align: left;
    border-bottom: 2px solid var(--border); font-weight: 600;
    white-space: nowrap;
}
.data-table td {
    padding: 8px 12px; border-bottom: 1px solid #f0f0f0;
    max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.data-table tr:hover { background: #f8f9ff; }
