/* * 极码云学生素质评价平台 V0.7 - 全局样式表
 * 遵循 Google Material Design 3 规范
 * 核心特征：大圆角、柔和阴影、动态色彩、响应式布局
 */

/* -------------------------------------------------------------------------- */
/* 1. 字体与变量定义 (Variables & Typography) */
/* -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
    /* MD3 核心色板 */
    --md-sys-color-primary: #006492;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #cae6ff;
    --md-sys-color-on-primary-container: #001e30;
    
    --md-sys-color-secondary: #50606e;
    --md-sys-color-secondary-container: #d3e5f5;
    
    --md-sys-color-tertiary: #65587b;
    --md-sys-color-tertiary-container: #ecdcff;

    --md-sys-color-error: #ba1a1a;
    --md-sys-color-error-container: #ffdad6;
    
    --md-sys-color-background: #f0f4f9; /* 指定的浅灰色背景 */
    --md-sys-color-surface: #ffffff;    /* 卡片白色背景 */
    --md-sys-color-surface-variant: #dde3ea; /* 表格边框/分割线 */
    
    --md-sys-color-outline: #72787e;
    --md-sys-color-on-surface: #1f1f1f; /* 主要文字颜色 */
    --md-sys-color-on-surface-variant: #42474e; /* 次要文字颜色 */

    /* 形状与间距 */
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 24px; /* 卡片标准圆角 */
    --md-sys-shape-corner-full: 999px; /* 按钮/胶囊形状 */

    /* 阴影 (Elevation) */
    --md-sys-elevation-0: none;
    --md-sys-elevation-1: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-2: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.3);

    /* 字体 */
    --font-family-base: 'Google Sans', 'Noto Sans SC', sans-serif;
}

/* -------------------------------------------------------------------------- */
/* 2. 全局重置 (Global Reset) */
/* -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-surface);
    font-family: var(--font-family-base);
    margin: 0;
    padding: 0;
    font-size: 14px; /* 基础字号 */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #004a6f;
}

/* -------------------------------------------------------------------------- */
/* 3. 布局系统 (Layout System) */
/* -------------------------------------------------------------------------- */

/* 登录页全屏居中布局 */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* 后台管理页面的两栏布局 */
.app-container {
    display: flex;
    flex: 1;
    height: 100vh;
    overflow: hidden; /* 防止body滚动 */
}

/* 左侧导航栏 (Sidebar) */
.sidebar {
    width: 280px;
    background-color: var(--md-sys-color-surface);
    /* MD3 侧边栏通常悬浮或具有右下圆角 */
    margin: 16px 0 16px 16px; 
    border-radius: var(--md-sys-shape-corner-extra-large);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    box-shadow: var(--md-sys-elevation-1);
    z-index: 10;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* 右侧主内容区 */
.main-content {
    flex: 1;
    padding: 16px 24px;
    overflow-y: auto;
    position: relative;
}

/* -------------------------------------------------------------------------- */
/* 4. 组件：导航 (Navigation) */
/* -------------------------------------------------------------------------- */
.nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    margin-bottom: 32px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 24px; /* 宽大的点击区域 */
    border-radius: var(--md-sys-shape-corner-full); /* 胶囊状 */
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f0f4f9; /* Hover 浅灰 */
    color: var(--md-sys-color-on-surface);
}

.nav-link.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 700;
}

/* 底部用户信息区 */
.nav-user {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--md-sys-color-surface-variant);
}

/* -------------------------------------------------------------------------- */
/* 5. 组件：卡片 (Cards) */
/* -------------------------------------------------------------------------- */
.card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large); /* 24px */
    padding: 24px;
    box-shadow: var(--md-sys-elevation-1);
    margin-bottom: 24px;
    border: 1px solid transparent;
    transition: box-shadow 0.2s;
}

/* 登录卡片特定样式 */
.login-card {
    width: 420px;
    max-width: 100%;
    padding: 40px;
    box-shadow: var(--md-sys-elevation-2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    color: var(--md-sys-color-on-surface);
}

/* 统计数据网格 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--md-sys-color-surface);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--md-sys-elevation-1);
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 32px;
    font-weight: 400; /* Google Sans 风格 */
    color: var(--md-sys-color-primary);
    margin: 10px 0;
}

.stat-label {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
}

/* -------------------------------------------------------------------------- */
/* 6. 组件：表单 (Forms) */
/* -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: var(--font-family-base);
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-background); /* 输入框微灰背景 */
    border: 1px solid transparent;
    border-radius: 12px; /* 输入框圆角 12px */
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    background-color: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* -------------------------------------------------------------------------- */
/* 7. 组件：按钮 (Buttons) */
/* -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--md-sys-shape-corner-full); /* 纯圆角 */
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-primary:hover {
    box-shadow: var(--md-sys-elevation-1);
    background-color: #004a6f; /* 变暗 */
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-primary);
}

.btn-outline:hover {
    background-color: var(--md-sys-color-primary-container);
    border-color: transparent;
}

.btn-danger {
    background-color: var(--md-sys-color-error);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
}

/* -------------------------------------------------------------------------- */
/* 8. 组件：数据表格 (Data Tables) */
/* -------------------------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th {
    text-align: left;
    padding: 16px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    font-size: 13px;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #e6f4ea;
    color: #137333;
}

.badge-warning {
    background-color: #fef7e0;
    color: #ea8600;
}

.badge-danger {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

/* -------------------------------------------------------------------------- */
/* 9. 移动端兼容性 (Mobile Responsiveness) */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: auto;
    }

    .sidebar {
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 16px;
        flex-direction: row; /* 移动端改为横向排列或汉堡菜单 */
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    .nav-brand {
        margin-bottom: 0;
        font-size: 18px;
    }
    
    /* 简单的移动端导航处理：隐藏菜单，实际项目可加JS Toggle */
    .nav-menu {
        display: none; /* 暂时隐藏，需配合JS实现展开 */
    }

    /* 如果需要在移动端显示简单的横向菜单，可取消注释以下逻辑
    .nav-menu {
        display: flex;
        overflow-x: auto;
    }
    */

    .main-content {
        padding: 16px;
    }

    .card {
        padding: 16px;
        border-radius: 16px; /* 移动端稍微减小圆角 */
    }
    
    .stat-grid {
        grid-template-columns: 1fr; /* 单列显示 */
    }
}

/* -------------------------------------------------------------------------- */
/* 10. 页脚与工具类 (Footer & Utilities) */
/* -------------------------------------------------------------------------- */
.app-footer {
    margin-top: 40px;
    border-top: 1px solid var(--md-sys-color-surface-variant);
}

.app-footer a {
    color: var(--md-sys-color-outline);
    text-decoration: underline;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* 模态框遮罩 (用于后续新增功能) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none; /* JS控制显示 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: var(--md-sys-color-surface);
    padding: 30px;
    border-radius: 28px;
    width: 90%;
    max-width: 500px;
    animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
