/* ===== 新能源汽车管理系统 - 全局样式 ===== */
:root {
    --primary: #1677ff;
    --primary-dark: #0958d9;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1f1f1f;
    --text-secondary: #666;
    --border: #e8e8e8;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 48px 40px;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    text-align: center;
}

.login-card .logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #52c41a, #1677ff);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 36px;
}

.login-card h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.login-card .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-card .domain {
    color: #999;
    font-size: 13px;
    margin-bottom: 32px;
}

.feishu-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1677ff, #0958d9);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.feishu-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22,119,255,0.35);
}

.feishu-login-btn:active {
    transform: translateY(0);
}

.feishu-login-btn svg {
    width: 20px;
    height: 20px;
}

.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: #bbb;
    font-size: 12px;
}

.login-loading {
    display: none;
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-loading.active { display: block; }

.login-error {
    display: none;
    margin-top: 16px;
    color: var(--danger);
    font-size: 13px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    padding: 10px;
}

.login-error.active { display: block; }

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

/* ===== 侧边栏 ===== */
.sidebar {
    width: 240px;
    background: #001529;
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #52c41a, #1677ff);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-header .brand {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
}

.nav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active { color: #fff; background: var(--primary); }
.nav-item .icon { width: 18px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.user-dept {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

.logout-btn {
    margin-left: auto;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.45);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.logout-btn:hover { color: #fff; border-color: #fff; }

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.page-header {
    background: var(--card-bg);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 18px;
    font-weight: 600;
}

.page-body {
    padding: 24px;
    flex: 1;
}

/* ===== 卡片 ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

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

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-card .stat-value.primary { color: var(--primary); }
.stat-card .stat-value.success { color: var(--success); }
.stat-card .stat-value.warning { color: var(--warning); }
.stat-card .stat-value.danger { color: var(--danger); }

/* ===== 表格 ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    color: var(--text-secondary);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover td { background: #fafafa; }

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

.status-badge.active { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.status-badge.pending { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.status-badge.warning { background: #fff2e8; color: #fa8c16; border: 1px solid #ffd591; }
.status-badge.danger { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* ===== 加载 ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .brand { display: none; }
    .nav-item { padding: 12px; justify-content: center; }
    .nav-item span:not(.icon) { display: none; }
    .user-name, .user-dept { display: none; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .login-card { width: 90%; padding: 32px 24px; }
}
