/* ========================================
   智慧教务系统 - 统一主题样式
   版本: v1.6.0
   最后更新: 2026-07-03
   ======================================== */

/* ========================================
   1. CSS变量 - 设计Token
   ======================================== */

:root {
    /* 主色调 */
    --primary-color: #b30000;
    --primary-hover: #d40000;
    --primary-light-3: #d14d4d;
    --primary-light-5: #d98080;
    --primary-light-7: #e6b3b3;
    --primary-light-8: #ebcccc;
    --primary-light-9: #f0e6e6;
    --primary-dark-2: #8f0000;

    /* 语义色 */
    --success-color: #67c23a;
    --warning-color: #e6a23c;
    --danger-color: #f56c6c;
    --info-color: #909399;

    /* 文本色 */
    --text-primary: #303133;
    --text-regular: #606266;
    --text-secondary: #909399;
    --text-placeholder: #c0c4cc;

    /* 边框色 */
    --border-base: #dcdfe6;
    --border-light: #e4e7ed;
    --border-lighter: #ebeef5;

    /* 背景色 */
    --bg-color: #f0f2f5;
    --bg-white: #ffffff;

    /* 间距系统 (4px基准) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* 阴影 */
    --shadow-light: 0 2px 12px rgba(0, 0, 0, 0.03);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-heavy: 0 6px 20px rgba(0, 0, 0, 0.08);

    /* 布局 */
    --header-height: 64px;
    --sidebar-width: 240px;

    /* 字体 */
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 600;
}

/* Element Plus 主题覆盖 */
:root {
    --el-color-primary: var(--primary-color);
    --el-color-primary-light-3: var(--primary-light-3);
    --el-color-primary-light-5: var(--primary-light-5);
    --el-color-primary-light-7: var(--primary-light-7);
    --el-color-primary-light-8: var(--primary-light-8);
    --el-color-primary-light-9: var(--primary-light-9);
    --el-color-primary-dark-2: var(--primary-dark-2);
    --el-color-success: var(--success-color);
    --el-color-warning: var(--warning-color);
    --el-color-danger: var(--danger-color);
    --el-color-info: var(--info-color);
    --el-border-radius-base: var(--radius-md);
    --el-border-radius-small: var(--radius-sm);
}

/* ========================================
   2. 工具类 - Flex布局
   ======================================== */

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-around {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.flex-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.flex-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.self-center {
    align-self: center;
}

.gap-xs {
    gap: var(--spacing-xs);
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.gap-xl {
    gap: var(--spacing-xl);
}

/* ========================================
   3. 工具类 - 文本
   ======================================== */

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

.text-regular {
    color: var(--text-regular);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-placeholder {
    color: var(--text-placeholder);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-md {
    font-size: var(--font-size-md);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

.font-normal {
    font-weight: var(--font-weight-normal);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* ========================================
   4. 工具类 - 间距
   ======================================== */

.mt-xs {
    margin-top: var(--spacing-xs);
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-xs {
    margin-bottom: var(--spacing-xs);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.ml-xs {
    margin-left: var(--spacing-xs);
}

.ml-sm {
    margin-left: var(--spacing-sm);
}

.ml-md {
    margin-left: var(--spacing-md);
}

.ml-lg {
    margin-left: var(--spacing-lg);
}

.mr-xs {
    margin-right: var(--spacing-xs);
}

.mr-sm {
    margin-right: var(--spacing-sm);
}

.mr-md {
    margin-right: var(--spacing-md);
}

.mr-lg {
    margin-right: var(--spacing-lg);
}

.p-xs {
    padding: var(--spacing-xs);
}

.p-sm {
    padding: var(--spacing-sm);
}

.p-md {
    padding: var(--spacing-md);
}

.p-lg {
    padding: var(--spacing-lg);
}

.p-xl {
    padding: var(--spacing-xl);
}

.px-sm {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

.px-md {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.px-lg {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
}

.py-sm {
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
}

.py-md {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

.py-lg {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

/* ========================================
   5. 工具类 - 尺寸
   ======================================== */

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.min-w-0 {
    min-width: 0;
}

.max-w-full {
    max-width: 100%;
}

/* ========================================
   6. 组件样式 - 筛选容器
   ======================================== */

.filter-container {
    background: var(--bg-white);
    padding: 18px var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-light);
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    border: 1px solid var(--border-lighter);
    transition: box-shadow 0.3s ease;
}

.filter-container:hover {
    box-shadow: var(--shadow-medium);
}

.filter-between {
    justify-content: space-between;
}

/* ========================================
   7. 组件样式 - 弹窗/对话框
   ======================================== */

.dialog-title {
    padding: var(--spacing-lg);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    text-align: center;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-lighter);
}

.dialog-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    background: var(--bg-white);
    border-top: 1px solid var(--border-lighter);
}

/* ========================================
   8. 组件样式 - 课程卡片
   ======================================== */

.course-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md);
}

.course-card {
    flex: 1 1 calc(50% - var(--spacing-xs));
    min-width: 120px;
    border-left-width: 5px;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-light);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.course-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

/* VIP标签 - 修复float问题，使用flex自动对齐 */
.vip-tag {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
}

/* ========================================
   9. 组件样式 - 操作按钮组
   ======================================== */

.action-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.action-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* ========================================
   10. 组件样式 - 设置页彩色竖线
   ======================================== */

.color-bar {
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light-5));
    border-radius: 2px;
    margin-right: var(--spacing-sm);
}

.color-bar-success {
    background: linear-gradient(180deg, var(--success-color), #95d475);
}

.color-bar-warning {
    background: linear-gradient(180deg, var(--warning-color), #eebe77);
}

.color-bar-danger {
    background: linear-gradient(180deg, var(--danger-color), #fab6b6);
}

.color-bar-info {
    background: linear-gradient(180deg, var(--info-color), #b1b3b8);
}

/* ========================================
   11. 组件样式 - 表格
   ======================================== */

.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.table-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    border-bottom: 1px solid var(--border-lighter);
}

/* ========================================
   12. 组件样式 - 表单
   ======================================== */

.form-section {
    margin-bottom: var(--spacing-xl);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-lighter);
}

/* ========================================
   13. 统一高度计算 - 使用dvh
   ======================================== */

html,
body {
    height: 100dvh;
    margin: 0;
    padding: 0;
}

.layout-container,
.main-content {
    height: 100dvh;
}

.schedule-wrapper {
    max-height: calc(100dvh - var(--header-height) - 120px);
}

/* ========================================
   14. 响应式布局
   ======================================== */

/* 平板适配 */
@media (max-width: 1024px) {
    .hide-on-tablet {
        display: none !important;
    }
}

/* 移动适配 */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }

    .filter-container {
        padding: var(--spacing-md);
    }

    .flex-between-mobile {
        justify-content: space-between;
    }
}

/* ========================================
   15. 动画
   ======================================== */

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

.slide-up-enter-active,
.slide-up-leave-active {
    transition: transform 0.3s ease;
}

.slide-up-enter-from,
.slide-up-leave-to {
    transform: translateY(20px);
    opacity: 0;
}

/* ========================================
   16. 其他工具类
   ======================================== */

.cursor-pointer {
    cursor: pointer;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.user-select-none {
    user-select: none;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 清除浮动 */
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* 禁用文本选择 */
.no-select {
    user-select: none;
}

/* 平滑滚动 */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* ========================================
   17. Element Plus 组件覆盖
   ======================================== */

/* 扩大对话框关闭按钮的触摸目标 */
.el-dialog__headerbtn {
    width: 44px !important;
    height: 44px !important;
    top: 10px !important;
    right: 10px !important;
    font-size: 20px !important;
}

/* 统一按钮圆角 */
.el-button {
    border-radius: var(--radius-md);
}

/* 统一输入框圆角 */
.el-input__wrapper {
    border-radius: var(--radius-md);
}

/* 统一卡片样式 */
.el-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-lighter);
}

/* 统一标签样式 */
.el-tag {
    border-radius: var(--radius-sm);
}
