/* ========================================
   智慧校园管理系统 - 全局样式
   ======================================== */

:root {
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 64px;
    --header-height: 60px;
    --sidebar-bg: #304156;
    --sidebar-text: #bfcbd9;
    --sidebar-active: #409EFF;
    --header-bg: #fff;
    --main-bg: #f0f2f5;
    --primary-color: #409EFF;
    --success-color: #67C23A;
    --warning-color: #E6A23C;
    --danger-color: #F56C6C;
    --info-color: #909399;
    --text-primary: #303133;
    --text-secondary: #606266;
    --text-muted: #909399;
    --border-color: #e6e6e6;
    --card-radius: 8px;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* 登录页背景（开发指南 §9.4）：默认灰色 #f0f2f5。
       换图片背景 = ①把图片放进 wwwroot/images/login-bg.jpg ②取消下面注释：
       --login-bg-image: url('../images/login-bg.jpg'); */
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--main-bg);
}

#app { height: 100%; }

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

.app-aside {
    background-color: var(--sidebar-bg);
    overflow: hidden;
    transition: width 0.3s;
    display: flex;
    flex-direction: column;
}

.aside-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    white-space: nowrap;
}

.logo-small { font-size: 18px; letter-spacing: 0; }

.app-aside .el-menu { border-right: none; overflow-y: auto; }

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 0 20px;
    height: var(--header-height) !important;
}

.header-left { display: flex; align-items: center; }

.header-right { display: flex; align-items: center; }

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.user-info:hover { color: var(--primary-color); }

/* Main content */
.app-main {
    background-color: var(--main-bg);
    padding: 20px;
    overflow-y: auto;
}

/* ========================================
   登录页
   ======================================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* 灰色纯色底（Element 标准 #f0f2f5）；--login-bg-image 未定义=纯灰，定义 url(...) 即图片背景（cover 居中） */
    background-color: #f0f2f5;
    background-image: var(--login-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-card {
    width: 420px;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.login-header { text-align: center; margin-bottom: 30px; }

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-btn { width: 100%; }

/* ========================================
   仪表盘
   ======================================== */
.dashboard-welcome { margin-bottom: 24px; }

.dashboard-welcome h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-welcome p { color: var(--text-muted); margin-top: 4px; }

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card { border-radius: var(--card-radius); }

.stat-card .stat-icon { font-size: 48px; margin-bottom: 8px; }

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

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Quick links */
.quick-links { margin-top: 24px; }

.quick-links h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.quick-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    border-radius: var(--card-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-secondary);
}

.quick-link-item:hover {
    background-color: #ecf5ff;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-link-item .q-icon { font-size: 28px; margin-bottom: 8px; }

.quick-link-item .q-label { font-size: 13px; }

/* ========================================
   页面通用
   ======================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   CRUD 工具栏
   ======================================== */
.crud-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.crud-toolbar-left { display: flex; align-items: center; gap: 8px; }

.crud-toolbar-right { display: flex; align-items: center; gap: 8px; }

.crud-pagination {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ========================================
   详情页
   ======================================== */
.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.detail-item { display: flex; }

.detail-item .label {
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.detail-item .value { color: var(--text-primary); }

/* ========================================
   403 页面
   ======================================== */
.forbidden-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.forbidden-container .error-code {
    font-size: 100px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 16px;
}

.forbidden-container h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.forbidden-container p { color: var(--text-muted); margin-bottom: 24px; }

/* ========================================
   入口页（校园简约风：清爽浅蓝白渐变，2026-08-12 调整）
   ======================================== */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(165deg, #eaf3ff 0%, #f6faff 50%, #eef8f1 100%);
    color: #333;
    text-align: center;
}

.landing-container h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #409eff;              /* 主蓝：清新校园感 */
    letter-spacing: 2px;
}

.landing-container p {
    font-size: 18px;
    color: #8a94a6;
    margin-bottom: 40px;
}

.landing-buttons { display: flex; gap: 16px; }

/* ========================================
   工具类
   ======================================== */
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
/* ========================================
   通知铃铛（NotificationBell 组件，§9）
   ======================================== */
.header-bell { margin-right: 18px; cursor: pointer; color: #bfcbd9; display: flex; align-items: center; }
.header-bell:hover { color: #409EFF; }
.notif-panel { width: 320px; background: #fff; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid #ebeef5; font-weight: 600; }
.notif-title-main { font-size: 14px; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.notif-item:hover { background: #f5f7fa; }
.notif-unread { background: #ecf5ff; }
.notif-item-title { font-size: 13px; color: #303133; display: flex; align-items: center; gap: 6px; }
.notif-item-time { font-size: 12px; color: #909399; margin-top: 4px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #f56c6c; display: inline-block; flex-shrink: 0; }
.notif-empty { padding: 30px 0; text-align: center; color: #909399; font-size: 13px; }
.notif-footer { padding: 8px 0; text-align: center; color: #909399; font-size: 12px; border-top: 1px solid #ebeef5; }

/* ========================================
   文件上传组件（UploadFile，§9）
   ======================================== */
.upload-list { margin-top: 8px; }
.upload-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #ebeef5; border-radius: 4px; margin-bottom: 6px; background: #fafafa; }
.upload-img-icon { color: #67C23A; cursor: pointer; font-size: 18px; }
.upload-file-icon { color: #909399; font-size: 18px; }
.upload-name { flex: 1; font-size: 13px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-act { cursor: pointer; color: #909399; font-size: 15px; }
.upload-act:hover { color: #f56c6c; }
