/* ========== 全局 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }

/* ========== 登录页 ========== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: white; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.login-header { background: #1a1a2e; padding: 30px; text-align: center; }
.login-header h1 { color: white; font-size: 24px; font-weight: 600; letter-spacing: 2px; }
.login-header p { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 4px; }
.login-body { padding: 30px; }
.login-body .form-group { margin-bottom: 20px; }
.login-body .form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 6px; }
.login-body .form-group input { width: 100%; padding: 10px 14px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: border-color 0.2s; }
.login-body .form-group input:focus { border-color: #1890ff; outline: none; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }
.login-error { background: #fff2f0; color: #ff4d4f; padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 16px; border-left: 3px solid #ff4d4f; }
.login-footer { text-align: center; margin-top: 16px; color: #999; font-size: 12px; }
.btn { display: inline-block; padding: 10px 24px; border: none; border-radius: 4px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-align: center; text-decoration: none; }
.btn-primary { background: #1890ff; color: white; }
.btn-primary:hover { background: #40a9ff; }
.btn-primary:active { background: #096dd9; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-success { background: #52c41a; color: white; }
.btn-success:hover { background: #73d13d; }
.btn-danger { background: #ff4d4f; color: white; }
.btn-danger:hover { background: #ff7875; }
.btn-warning { background: #faad14; color: white; }
.btn-warning:hover { background: #ffc53d; }
.btn-outline { background: transparent; color: #1890ff; border: 1px solid #1890ff; }
.btn-outline:hover { background: #e6f7ff; }

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

/* ========== 侧边栏 ========== */
.sidebar { width: 240px; background: #001529; color: rgba(255,255,255,0.7); display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-header { padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.sidebar-header h2 { color: white; font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.sidebar-header span { font-size: 11px; color: rgba(255,255,255,0.3); margin-left: 8px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a { display: flex; align-items: center; padding: 10px 24px; color: rgba(255,255,255,0.65); text-decoration: none; transition: all 0.2s; font-size: 13px; }
.sidebar-nav a:hover { color: white; background: rgba(255,255,255,0.05); }
.sidebar-nav a.active { color: white; background: #1890ff; }
.sidebar-nav a .nav-icon { width: 24px; font-size: 16px; margin-right: 12px; text-align: center; }
.nav-group { margin-top: 8px; }
.nav-group-title { padding: 8px 24px; font-size: 12px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1px; }
.nav-group a { padding-left: 44px; font-size: 13px; }
.sidebar-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.sidebar-footer .btn-logout { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 13px; padding: 4px 12px; border-radius: 4px; }
.sidebar-footer .btn-logout:hover { color: #ff4d4f; background: rgba(255,77,79,0.1); }

/* ========== 主内容 ========== */
.main-content { flex: 1; min-width: 0; }
.topbar { background: white; padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0; position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 18px; font-weight: 600; color: #1a1a2e; }
.topbar-right { color: #999; font-size: 13px; }
.content-body { padding: 24px 32px; }

/* ========== 统计卡片 ========== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 8px; padding: 20px 24px; display: flex; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-icon { font-size: 32px; margin-right: 16px; opacity: 0.7; }
.stat-info { flex: 1; }
.stat-number { font-size: 28px; font-weight: 600; color: #1a1a2e; line-height: 1.2; }
.stat-label { font-size: 13px; color: #999; margin-top: 2px; }

/* ========== 快速操作 ========== */
.quick-actions { background: white; border-radius: 8px; padding: 20px 24px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.quick-actions h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: #1a1a2e; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-btn { display: block; padding: 12px 16px; background: #f5f7fa; border-radius: 4px; text-align: center; text-decoration: none; color: #333; font-size: 13px; transition: all 0.2s; }
.quick-btn:hover { background: #e6f7ff; color: #1890ff; }

/* ========== 最近活动 ========== */
.recent-activities { background: white; border-radius: 8px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.recent-activities h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: #1a1a2e; }
.activity-list { min-height: 100px; }
.activity-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.activity-item:last-child { border-bottom: none; }
.activity-item .time { color: #999; font-size: 12px; }

/* ========== 表格 ========== */
.table-container { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.table-header { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0; }
.table-header h3 { font-size: 15px; font-weight: 600; }
.table-toolbar { display: flex; gap: 12px; align-items: center; }
.table-toolbar input { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; width: 200px; }
.table-toolbar input:focus { border-color: #1890ff; outline: none; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th { background: #fafafa; padding: 12px 16px; text-align: left; font-weight: 600; color: #555; border-bottom: 1px solid #f0f0f0; }
table td { padding: 12px 16px; border-bottom: 1px solid #f5f5f5; }
table tr:hover { background: #fafafa; }
table .actions { display: flex; gap: 8px; }
.status-tag { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12px; }
.status-normal { background: #e6f7ff; color: #1890ff; }
.status-repairing { background: #fff7e6; color: #fa8c16; }
.status-scrap { background: #f5f5f5; color: #999; }
.status-pending { background: #fff2f0; color: #ff4d4f; }
.status-success { background: #f6ffed; color: #52c41a; }
.status-warning { background: #fff7e6; color: #faad14; }

/* ========== 表单 ========== */
.form-card { background: white; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 6px; }
.form-group label .required { color: #ff4d4f; margin-left: 2px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; transition: border-color 0.2s; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #1890ff; outline: none; box-shadow: 0 0 0 2px rgba(24,144,255,0.1); }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f0; }
.form-actions .btn { min-width: 100px; }

/* ========== 详情页 ========== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.detail-item { display: flex; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.detail-item .label { width: 120px; color: #999; flex-shrink: 0; }
.detail-item .value { flex: 1; font-weight: 500; }
.detail-card { background: white; border-radius: 8px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 16px; }
.detail-card .card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #1a1a2e; }

/* ========== 分页 ========== */
.pagination { display: flex; justify-content: flex-end; align-items: center; padding: 16px 24px; gap: 8px; border-top: 1px solid #f0f0f0; }
.pagination button { padding: 4px 12px; border: 1px solid #d9d9d9; border-radius: 4px; background: white; cursor: pointer; font-size: 13px; }
.pagination button:hover { border-color: #1890ff; color: #1890ff; }
.pagination button.active { background: #1890ff; color: white; border-color: #1890ff; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .info { color: #999; font-size: 13px; margin-right: 12px; }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }

/* ========== 加载 ========== */
.loading { text-align: center; padding: 40px; color: #999; }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .form-row.three { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-header h2, .sidebar-header span, .sidebar-nav a span:not(.nav-icon), .nav-group-title, .sidebar-footer span { display: none; }
    .sidebar-nav a { padding: 12px 18px; justify-content: center; }
    .sidebar-nav a .nav-icon { margin-right: 0; font-size: 20px; }
    .sidebar-footer { justify-content: center; }
    .sidebar-footer .btn-logout { font-size: 20px; }
    .content-body { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}
/* 通知徽标 */
.badge-notification {
    display: inline-block;
    background: #ff4d4f;
    color: white;
    border-radius: 10px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 18px;
    min-width: 18px;
    text-align: center;
    margin-left: auto;
    font-weight: 500;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 侧边栏 a 标签使用 flex 布局以支持徽标右对齐 */
.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 13px;
}

.sidebar-nav a .nav-icon {
    width: 24px;
    font-size: 16px;
    margin-right: 12px;
    text-align: center;
}