/* 引入字体 */
@import url('https://img.penlife.cn/font/OPPO%20Sans%204/result.css');

/* Lucide 图标 */
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; margin-right: 6px; }
.icon-sm { width: 16px; height: 16px; vertical-align: -2px; }
.btn .icon { margin-right: 6px; }
.nav-link .icon { margin-right: 8px; }
.card-title .icon { margin-right: 6px; }
.sidebar-brand .icon { margin-right: 8px; }

/* 重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

html { font-size: 14px; }
body {
    font-family: 'OPPO Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 登录页面 ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background: #111827;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.login-left h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.login-left p {
    font-size: 1.1rem;
    opacity: 0.9;
    text-align: center;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-left .logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.login-right {
    width: 480px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
}

.login-right h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.login-right .subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* 角色选择 - 改为标签页风格 */
.role-tabs {
    display: flex;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    overflow: hidden;
}

.role-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    background: white;
    border: none;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: all 0.2s;
    font-family: inherit;
}

.role-tab:hover { background: var(--gray-50); }
.role-tab.active {
    background: var(--primary);
    color: white;
}

.role-tab + .role-tab {
    border-left: 1px solid var(--gray-200);
}

/* 表单 */
.form-item {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder { color: var(--gray-400); }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-50); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 0.8125rem; }

/* 提示 */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

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

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.sidebar-brand span {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 8px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: all 0.15s;
}

.nav-link:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    text-decoration: none;
}

.nav-link.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-100);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--gray-50);
    border-radius: 6px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name { font-weight: 500; font-size: 0.875rem; }
.user-role { font-size: 0.75rem; color: var(--gray-500); }

/* 主内容 */
.main {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
}

.main-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 28px;
}

.main-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.main-header p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.main-body {
    padding: 24px 28px;
}

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

.stat-box {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.stat-box .num {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-box .text {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* 卡片组件 */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body { padding: 20px; }

/* 表格 */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.8125rem;
}

th {
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    background: var(--gray-50);
}

td { color: var(--gray-700); }
tr:hover td { background: var(--gray-50); }

/* 标签 */
.tag {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 4px;
}

.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #166534; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-yellow { background: #fef3c7; color: #92400e; }
.tag-gray { background: var(--gray-100); color: var(--gray-600); }

/* 课程卡片 */
.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.course-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: box-shadow 0.2s;
}

.course-item:hover {
    box-shadow: var(--shadow-lg);
}

.course-item .hd {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.course-item .cat {
    font-size: 0.6875rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.course-item .name {
    font-weight: 600;
    font-size: 1rem;
}

.course-item .bd {
    padding: 16px;
}

.course-item .meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.course-item .ft {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.course-item .quota {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

/* 模态框 */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-bg.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal-bg.show .modal {
    transform: translateY(0);
}

.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-weight: 600;
    font-size: 1rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--gray-500);
}

.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 20px; }

.modal-foot {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 表单增强 */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
}

.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    min-height: 100px;
    resize: vertical;
}

/* 筛选栏 */
.filter-bar {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar .form-item {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.filter-bar .form-item.w-auto {
    flex: 0 0 auto;
    min-width: auto;
}

/* 分页 */
.pager {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pager a, .pager span {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
}

.pager a:hover {
    background: var(--gray-50);
    text-decoration: none;
    border-color: var(--gray-300);
}

.pager .curr {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-400);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-text {
    font-size: 0.9375rem;
}

/* 进度条 */
.progress {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
}

/* 复选框 */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 响应式 */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.menu-toggle:hover { background: var(--gray-200); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
}

@media (max-width: 900px) {
    .menu-toggle { display: flex; }
    .login-left { display: none; }
    .login-right { width: 100%; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .login-right { padding: 32px 24px; }
    .main-body { padding: 16px; }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .course-list { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-item { min-width: 100%; }
}
