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

/* ==================== 登录页面样式 ==================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

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

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-logo p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.login-form {
    margin-bottom: 24px;
}

.login-tips {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-tips p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==================== 用户菜单和退出按钮 ==================== */

.user-info {
    position: relative;
    margin-bottom: 12px;
}

.logout-btn {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.logout-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-color: var(--danger);
    color: var(--danger);
}

/* ==================== 头部行 ==================== */

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-row > div {
    flex: 1;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-group select {
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ==================== 课程列表 ==================== */

.course-list {
    display: grid;
    gap: 16px;
}

.course-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.2s ease;
}

.course-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.course-info h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.15rem;
    font-weight: 600;
}

.course-username {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.course-grade {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.course-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 6px 0;
}

.course-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

.course-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* ==================== 用户列表 ==================== */

.user-list {
    display: grid;
    gap: 16px;
}

.user-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: all 0.2s ease;
}

.user-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.user-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.user-item-avatar {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-item-details h4 {
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 1.05rem;
    font-weight: 600;
}

.user-item-details p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.user-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 8px;
}

.user-badge.admin {
    background: rgba(168, 85, 247, 0.1);
    color: #7c3aed;
}

.user-badge.teacher {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.user-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ==================== 弹窗 ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== Checkbox ==================== */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-text {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --accent: #0ea5e9;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-bottom: 4px;
}

.nav-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

.nav-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-item:hover {
    background: var(--bg-tertiary);
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

.nav-item.active .nav-text {
    color: var(--primary);
    font-weight: 600;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.user-info:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.content-wrapper {
    flex: 1;
    padding: 32px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-header {
    margin-bottom: 28px;
}

.content-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.content-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.config-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.card-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon-wrap svg {
    width: 22px;
    height: 22px;
}

.ai-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: var(--primary);
}

.course-icon {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: var(--accent);
}

.card-title-row h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.label-icon {
    margin-right: 6px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.help-text {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.btn {
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-icon {
    font-size: 1.05rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 8px 12px;
}

.btn-text:hover {
    background: var(--bg-tertiary);
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.create-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.main-form-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.form-card-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-light);
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.step-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.step-active .step-number {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.step-active .step-label {
    color: var(--primary);
    font-weight: 500;
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin-bottom: 20px;
}

.form-card-body {
    padding: 28px;
}

.chat-section {
    padding: 0;
}

.chat-messages {
    max-height: 450px;
    overflow-y: auto;
    padding: 24px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.chat-message {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    max-width: 85%;
    animation: messageIn 0.3s ease;
    line-height: 1.7;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    margin-left: auto;
    box-shadow: var(--shadow-sm);
}

.chat-message.assistant {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    white-space: pre-wrap;
}

.chat-input-area {
    padding: 24px 28px;
}

.chat-input-area textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

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

.chat-actions {
    display: flex;
    gap: 12px;
}

.chat-actions .btn {
    flex: 1;
}

.tips-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-lg);
    padding: 24px;
    height: fit-content;
}

.tips-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.tips-card ul {
    list-style: none;
}

.tips-card li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 10px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.tips-card li:before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--primary);
    font-weight: bold;
}

.lesson-list {
    display: grid;
    gap: 16px;
}

.lesson-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lesson-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.lesson-info h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.lesson-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 4px 0;
}

.lesson-status {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
}

.lesson-status.draft {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.lesson-status.finalized {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.detail-header h3 {
    margin-bottom: 0;
}

.tab-container {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tab-header {
    display: flex;
    background: var(--bg-secondary);
    padding: 8px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    border-radius: var(--radius);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.tab-body {
    padding: 28px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

.tab-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.document-content {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    background: var(--bg-secondary);
    min-height: 350px;
}

.document-content iframe {
    width: 100%;
    height: 600px;
    border: none;
    background: var(--bg-primary);
    border-radius: var(--radius);
}

.detail-footer {
    margin-top: 24px;
    text-align: right;
}

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    font-size: 0.95rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    position: relative;
    width: 70px;
    height: 70px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: var(--primary-light);
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: var(--accent);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 1rem;
    font-weight: 500;
}

@media (max-width: 1024px) {
    .create-container {
        grid-template-columns: 1fr;
    }

    .tips-card {
        order: -1;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .content-wrapper {
        padding: 20px 16px;
    }

    .form-card-header,
    .form-card-body {
        padding: 20px;
    }

    .chat-messages,
    .chat-input-area {
        padding: 20px;
    }

    .step-label {
        display: none;
    }

    .step-line {
        width: 30px;
    }

    .chat-actions {
        flex-direction: column;
    }

    .lesson-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

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

    .tab-toolbar .btn {
        flex: 1;
        min-width: 140px;
    }

    .tab-btn .tab-icon {
        font-size: 1.3rem;
    }

    .tab-btn span:not(.tab-icon) {
        display: none;
    }
}

/* ==================== 课程表单新样式 ==================== */

.modal-large {
    max-width: 700px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.file-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.file-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    color: var(--text-primary);
    font-size: 0.875rem;
    word-break: break-all;
    max-width: 300px;
}

.btn-remove-file {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.btn-remove-file:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.course-code {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.course-desc {
    color: var(--accent);
    font-size: 0.875rem;
}
}
