/* ==================== 魔法课程平台 - 全局样式 ==================== */
/* 主题：灵性、可爱、神秘 */
/* 主色调：淡紫色/深紫色渐变 (#8B5CF6, #A78BFA, #E9D5FF) */

/* ==================== CSS变量定义 ==================== */
:root {
    /* 主色调 - 紫色魔法主题 */
    --primary-color: #8B5CF6;
    --primary-hover: #A78BFA;
    --primary-light: #E9D5FF;
    --primary-dark: #7C3AED;
    --primary-gradient: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 50%, #E9D5FF 100%);
    --primary-gradient-dark: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
    
    /* 辅助色 */
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #3B82F6;
    
    /* 粉色点缀 */
    --pink-light: #FCE7F3;
    --pink-medium: #F9A8D4;
    --pink-accent: #EC4899;
    
    /* 文字颜色 */
    --text-color: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-light: #FFFFFF;
    
    /* 背景颜色 */
    --bg-color: #FAF5FF;
    --bg-secondary: #F3E8FF;
    --bg-dark: #1E1B4B;
    --card-bg: #FFFFFF;
    --card-bg-dark: rgba(30, 27, 75, 0.95);
    
    /* 边框和阴影 */
    --border-color: #E5E7EB;
    --border-color-light: #DDD6FE;
    --shadow-sm: 0 1px 2px 0 rgba(139, 92, 246, 0.05);
    --shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.1), 0 2px 4px -1px rgba(139, 92, 246, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(139, 92, 246, 0.15), 0 4px 6px -2px rgba(139, 92, 246, 0.1);
    --shadow-magic: 0 0 30px rgba(139, 92, 246, 0.3);
    
    /* 圆角 - 大圆角卡片设计 */
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
    
    /* 字体大小 - 使用rem单位 */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* 间距 */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* 动画 */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* 移动端底部导航高度 */
    --bottom-nav-height: 64px;
    --navbar-height: 60px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(180deg, #FAF5FF 0%, #F3E8FF 50%, #E9D5FF 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 魔法背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(167, 139, 250, 0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==================== 导航栏 ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 0 var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--navbar-height);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color-light);
}

.navbar-admin {
    background: rgba(30, 27, 75, 0.95);
    border-bottom-color: rgba(139, 92, 246, 0.3);
}

.navbar-admin .navbar-brand a,
.navbar-admin .nav-link {
    color: var(--text-light);
}

.navbar-brand {
    font-size: var(--text-xl);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand a {
    color: inherit;
}

.navbar-menu {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: var(--text-sm);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.navbar-admin .nav-link:hover,
.navbar-admin .nav-link.active {
    color: var(--text-light);
    background: rgba(139, 92, 246, 0.3);
}

/* ==================== 移动端底部导航 ==================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color-light);
    box-shadow: 0 -4px 20px rgba(139, 92, 246, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    padding: 0 var(--space-4);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-xs);
    padding: var(--space-2);
    min-width: 56px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.mobile-nav-item i,
.mobile-nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--primary-color);
}

.mobile-nav-item.active {
    background: var(--primary-light);
}

/* ==================== 主容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-5);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-5);
}

.main-content {
    min-height: calc(100vh - var(--navbar-height) - 80px);
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-5));
}

/* ==================== 登录页面 ==================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--primary-gradient-dark);
    position: relative;
    overflow: hidden;
}

/* 魔法装饰元素 */
.login-container::before {
    content: '✦';
    position: absolute;
    top: 10%;
    left: 10%;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.2);
    animation: twinkle 3s ease-in-out infinite;
}

.login-container::after {
    content: '✧';
    position: absolute;
    bottom: 15%;
    right: 15%;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.15);
    animation: twinkle 4s ease-in-out infinite 1s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    padding: var(--space-10);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-magic), 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-title {
    text-align: center;
    font-size: var(--text-3xl);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
    margin-top: var(--space-6);
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    font-size: var(--text-base);
}

.login-form {
    margin-bottom: var(--space-6);
}

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

.login-links a {
    color: var(--primary-color);
    font-size: var(--text-sm);
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--text-color);
    font-size: var(--text-sm);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-color-light);
    border-radius: var(--radius);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
    background: var(--card-bg);
    color: var(--text-color);
    min-height: 48px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

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

.form-text {
    display: block;
    margin-top: var(--space-1);
    color: var(--text-secondary);
    font-size: var(--text-xs);
}

.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
    flex-wrap: wrap;
}

.form-row {
    display: flex;
    gap: var(--space-4);
}

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

/* 移动端表单优化 */
.form-control[type="tel"],
.form-control[type="number"] {
    font-size: var(--text-base);
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 48px;
    min-width: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-light);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    background: var(--primary-gradient-dark);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    color: var(--text-light);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--primary-dark);
    border: 2px solid var(--border-color-light);
}

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

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: var(--text-light);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    color: var(--text-light);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    color: var(--text-light);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    min-height: 36px;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-5);
    border: 1px solid var(--border-color-light);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color-light);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(233, 213, 255, 0.1) 100%);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-body {
    padding: var(--space-6);
}

/* 特殊卡片样式 */
.continue-card {
    background: var(--primary-gradient);
    color: var(--text-light);
    border: none;
}

.continue-card .card-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.continue-card .card-header h3 {
    color: var(--text-light);
}

.continue-card .btn {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
}

.continue-card .btn:hover {
    background: var(--text-light);
}

/* ==================== 提示消息 ==================== */
.flash-messages {
    max-width: 1200px;
    margin: var(--space-5) auto;
    padding: 0 var(--space-5);
}

.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

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

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

.alert-success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.alert-success::before {
    content: '✓';
}

.alert-danger {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.alert-danger::before {
    content: '✕';
}

.alert-warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
}

.alert-warning::before {
    content: '⚠';
}

.alert-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

.alert-info::before {
    content: 'ℹ';
}

/* ==================== 表格样式 ==================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border-color-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    min-width: 640px;
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-color-light);
}

.table th {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(233, 213, 255, 0.05) 100%);
    font-weight: 600;
    color: var(--text-color);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background: rgba(139, 92, 246, 0.03);
}

.table tr.locked {
    background: #FEF2F2;
}

/* 移动端表格卡片化 */
.mobile-table-card {
    display: none;
}

/* ==================== 徽章 ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-secondary {
    background: #F3F4F6;
    color: #6B7280;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ==================== 课程网格 ==================== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
}

.course-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition-base);
    border: 1px solid var(--border-color-light);
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.15);
}

.course-card.locked {
    opacity: 0.75;
}

.course-card a {
    display: block;
    color: inherit;
}

.course-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--primary-gradient);
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.course-card:hover .course-thumbnail img {
    transform: scale(1.05);
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: var(--text-light);
    font-size: var(--text-4xl);
    font-weight: 700;
}

.lock-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
}

.course-info {
    padding: var(--space-5);
}

.course-info h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-3);
}

/* ==================== 播放器页面 ==================== */
.play-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-5);
}

.play-header {
    margin-bottom: var(--space-5);
}

.play-header h1 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-wrapper video {
    display: block;
    max-width: 100%;
    max-height: 70vh;
}

/* 全屏时移除高度限制 */
.player-wrapper.is-player-fullscreen video,
.player-wrapper:fullscreen video,
.player-wrapper:-webkit-full-screen video {
    max-height: none !important;
}

.no-video {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
    color: var(--text-light);
    font-size: var(--text-lg);
}

/* 播放列表 */
.playlist {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color-light);
}

.playlist h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.playlist h3::before {
    content: '📋';
}

.playlist-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.playlist-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color-light);
}

.playlist-item.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.playlist-number {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.playlist-item.active .playlist-number {
    background: var(--primary-color);
    color: var(--text-light);
}

.playlist-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playing-badge {
    background: var(--primary-gradient);
    color: var(--text-light);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ==================== 章节列表 ==================== */
.chapter-list {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color-light);
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-color-light);
    transition: background var(--transition-fast);
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-item:hover {
    background: var(--bg-secondary);
}

.chapter-number {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    color: var(--text-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.chapter-info {
    flex: 1;
    min-width: 0;
}

.chapter-info h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-1);
    color: var(--text-color);
}

.chapter-info p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.chapter-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color-light);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-1);
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
}

/* ==================== 页面头部 ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ==================== 搜索表单 ==================== */
.search-form {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.search-form .form-control {
    min-width: 200px;
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
}

.modal.active,
.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-magic);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-5);
    color: var(--text-secondary);
}

.empty-state::before {
    content: '✨';
    font-size: 4rem;
    display: block;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

/* ==================== 进度条 ==================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--space-3) 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

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

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    min-width: 44px;
    text-align: center;
}

.pagination a {
    background: var(--card-bg);
    border: 1px solid var(--border-color-light);
    color: var(--text-color);
}

.pagination a:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-gradient);
    color: var(--text-light);
}

/* ==================== 历史记录项 ==================== */
.history-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-color-light);
    transition: background var(--transition-fast);
}

.history-item:hover {
    background: var(--bg-secondary);
}

.history-item:last-child {
    border-bottom: none;
}

.history-thumb {
    width: 120px;
    height: 68px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--primary-gradient);
}

.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-info h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-1);
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-info p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.history-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* ==================== 页脚 ==================== */
.footer {
    text-align: center;
    padding: var(--space-6) var(--space-5);
    color: var(--text-secondary);
    background: var(--card-bg);
    border-top: 1px solid var(--border-color-light);
    margin-top: auto;
}

/* ==================== 管理后台特殊样式 ==================== */
.admin-sidebar {
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: calc(100vh - var(--navbar-height));
    padding: var(--space-5);
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-light);
}

/* ==================== 视频管理页面样式 ==================== */
.video-list-table {
    overflow-x: auto;
}

.video-thumbnail-sm {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.thumbnail-placeholder-sm {
    width: 80px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    color: var(--text-light);
}

.file-id-code {
    font-size: var(--text-xs);
    background: var(--bg-secondary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    word-break: break-all;
    font-family: monospace;
}

.info-box {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-left: 4px solid var(--info-color);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-5);
    border-radius: var(--radius);
}

.info-box h4 {
    margin-top: 0;
    color: var(--info-color);
    font-size: var(--text-base);
    margin-bottom: var(--space-2);
}

.info-box ul {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
}

.info-box li {
    margin: var(--space-1) 0;
    font-size: var(--text-sm);
}

/* ==================== 复选框样式 ==================== */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.p-4 { padding: var(--space-4); }

/* 隐藏元素 */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

/* ==================== 动画效果 ==================== */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

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

/* ==================== 错误页面 ==================== */
.error-container {
    text-align: center;
    padding: var(--space-12) var(--space-5);
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-4);
}

.error-container h1 {
    margin-bottom: var(--space-3);
    font-size: var(--text-2xl);
}

.error-container p {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* ==================== 移动端响应式设计 ==================== */
@media (max-width: 1024px) {
    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    /* 基础调整 */
    html {
        font-size: 15px;
    }
    
    .container,
    .admin-container {
        padding: var(--space-4);
    }
    
    .main-content {
        padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
    }
    
    /* 导航栏调整 */
    .navbar {
        padding: 0 var(--space-4);
        height: 56px;
    }
    
    .navbar-menu {
        display: none; /* 移动端隐藏顶部导航菜单 */
    }
    
    .navbar-brand {
        font-size: var(--text-lg);
    }
    
    /* 显示底部导航 */
    .mobile-bottom-nav {
        display: block;
    }
    
    /* 登录页面 */
    .login-box {
        margin: var(--space-4);
        padding: var(--space-6);
        max-width: none;
    }
    
    .login-title {
        font-size: var(--text-2xl);
    }
    
    /* 表单调整 */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* 课程网格 - 移动端单列 */
    .course-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .course-info h3 {
        font-size: var(--text-base);
    }
    
    /* 播放器页面 */
    .play-container {
        padding: var(--space-3);
    }
    
    .play-header h1 {
        font-size: var(--text-lg);
    }
    
    .player-wrapper {
        border-radius: var(--radius);
        margin-bottom: var(--space-4);
    }
    
    .playlist {
        padding: var(--space-4);
    }
    
    .playlist-item {
        padding: var(--space-3);
    }
    
    /* 章节列表 */
    .chapter-item {
        padding: var(--space-3) var(--space-4);
    }
    
    .chapter-number {
        width: 36px;
        height: 36px;
        font-size: var(--text-xs);
    }
    
    .chapter-actions {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .chapter-actions .btn {
        padding: var(--space-1) var(--space-2);
        font-size: var(--text-xs);
        min-height: 32px;
    }
    
    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .stat-card {
        padding: var(--space-4);
    }
    
    .stat-value {
        font-size: var(--text-2xl);
    }
    
    /* 页面头部 */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .page-header h1 {
        font-size: var(--text-xl);
    }
    
    /* 搜索表单 */
    .search-form {
        width: 100%;
    }
    
    .search-form .form-control {
        flex: 1;
        min-width: 0;
    }
    
    /* 表格卡片化 */
    .table-responsive {
        border: none;
        background: transparent;
    }
    
    .table {
        display: none;
    }
    
    .mobile-table-card {
        display: block;
    }
    
    .mobile-card {
        background: var(--card-bg);
        border-radius: var(--radius-lg);
        padding: var(--space-4);
        margin-bottom: var(--space-3);
        box-shadow: var(--shadow);
        border: 1px solid var(--border-color-light);
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: var(--space-3);
        padding-bottom: var(--space-3);
        border-bottom: 1px solid var(--border-color-light);
    }
    
    .mobile-card-title {
        font-weight: 600;
        color: var(--text-color);
        font-size: var(--text-base);
    }
    
    .mobile-card-body {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: var(--text-sm);
    }
    
    .mobile-card-label {
        color: var(--text-secondary);
    }
    
    .mobile-card-value {
        color: var(--text-color);
        font-weight: 500;
    }
    
    .mobile-card-actions {
        display: flex;
        gap: var(--space-2);
        margin-top: var(--space-3);
        padding-top: var(--space-3);
        border-top: 1px solid var(--border-color-light);
    }
    
    .mobile-card-actions .btn {
        flex: 1;
        min-height: 40px;
    }
    
    /* 模态框 */
    .modal-content {
        margin: var(--space-3);
        max-height: calc(100vh - var(--space-6));
    }
    
    /* 历史记录 */
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .history-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    
    .history-info {
        width: 100%;
    }
    
    /* 分页 */
    .pagination {
        gap: var(--space-1);
    }
    
    .pagination a,
    .pagination span {
        padding: var(--space-2) var(--space-3);
        min-width: 40px;
        font-size: var(--text-sm);
    }
    
    /* 错误页面 */
    .error-code {
        font-size: 5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container,
    .admin-container {
        padding: var(--space-3);
    }
    
    .login-box {
        padding: var(--space-5) var(--space-4);
    }
    
    /* 统计卡片单列 */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* 按钮全宽 */
    .btn {
        width: 100%;
    }
    
    .btn-sm {
        width: auto;
    }
    
    /* 卡片padding减小 */
    .card-body {
        padding: var(--space-4);
    }
    
    .card-header {
        padding: var(--space-4);
    }
    
    /* 播放列表紧凑 */
    .playlist-item {
        padding: var(--space-2) var(--space-3);
    }
    
    .playlist-number {
        width: 28px;
        height: 28px;
        font-size: var(--text-xs);
    }
}

/* ==================== 横屏优化 ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-bottom-nav {
        display: none;
    }
    
    .main-content {
        padding-bottom: var(--space-5);
    }
    
    .login-container {
        padding: var(--space-4);
    }
    
    .login-box {
        max-width: 400px;
    }
}

/* ==================== 安全区域适配 (iPhone X+) ==================== */
@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        padding-bottom: max(env(safe-area-inset-bottom), 0px);
    }
    
    .container,
    .admin-container {
        padding-left: max(var(--space-4), env(safe-area-inset-left));
        padding-right: max(var(--space-4), env(safe-area-inset-right));
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .navbar,
    .mobile-bottom-nav,
    .footer,
    .btn {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==================== 减少动画偏好 ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== 深色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    /* 如需深色模式可取消注释
    :root {
        --text-color: #F9FAFB;
        --text-secondary: #D1D5DB;
        --bg-color: #111827;
        --card-bg: #1F2937;
        --border-color: #374151;
    }
    */
}
/* 管理后台移动端额外样式 */

/* 移动端菜单抽屉 */
#mobile-menu-drawer {
    transition: opacity 0.3s ease;
}

#mobile-menu-drawer.hidden {
    opacity: 0;
    pointer-events: none;
}

#mobile-menu-drawer:not(.hidden) {
    opacity: 1;
}

#mobile-menu-panel {
    transition: transform 0.3s ease;
}

/* 移动端统计卡片 */
@media (max-width: 768px) {
    .admin-container .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .admin-container .stat-card {
        padding: 1rem;
    }
    
    .admin-container .stat-value {
        font-size: 1.5rem;
    }
    
    .admin-container .stat-label {
        font-size: 0.75rem;
    }
}

/* ===== Unified mall theme overrides ===== */
:root {
    --primary-color: #9c6737;
    --primary-hover: #87572f;
    --primary-light: #f0e2d2;
    --primary-dark: #6f4728;
    --primary-gradient: linear-gradient(135deg, #c98778 0%, #9c6737 52%, #758a73 100%);
    --primary-gradient-dark: linear-gradient(135deg, #6f4728 0%, #9c6737 58%, #3c6d71 100%);
    --success-color: #758a73;
    --warning-color: #b67d4d;
    --danger-color: #c46357;
    --info-color: #3c6d71;
    --pink-light: #f4e2dd;
    --pink-medium: #d8b39c;
    --pink-accent: #c98778;
    --text-color: #2f2419;
    --text-secondary: #6c5b46;
    --text-muted: #907d67;
    --text-light: #fffaf3;
    --bg-color: #fbf6ef;
    --bg-secondary: #f7efe3;
    --bg-dark: #2f2419;
    --card-bg: rgba(255, 250, 243, 0.92);
    --card-bg-dark: rgba(47, 36, 25, 0.94);
    --border-color: rgba(156, 103, 55, 0.18);
    --border-color-light: rgba(156, 103, 55, 0.14);
    --shadow-sm: 0 8px 20px rgba(47, 36, 25, 0.06);
    --shadow: 0 18px 40px rgba(47, 36, 25, 0.10);
    --shadow-lg: 0 24px 56px rgba(47, 36, 25, 0.16);
    --shadow-magic: 0 0 0 1px rgba(156, 103, 55, 0.14), 0 22px 48px rgba(60, 109, 113, 0.10);
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --radius-xl: 40px;
    --navbar-height: 68px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text-color);
    background:
        radial-gradient(circle at top, rgba(201, 135, 120, 0.18), transparent 32%),
        radial-gradient(circle at 84% 12%, rgba(117, 138, 115, 0.16), transparent 26%),
        linear-gradient(180deg, #fbf6ef 0%, #f7efe3 54%, #f2e7d8 100%);
    background-attachment: fixed;
}

body::before {
    background-image:
        radial-gradient(circle at 12% 18%, rgba(201, 135, 120, 0.12) 0%, transparent 24%),
        radial-gradient(circle at 88% 12%, rgba(117, 138, 115, 0.10) 0%, transparent 22%),
        radial-gradient(circle at 50% 100%, rgba(156, 103, 55, 0.08) 0%, transparent 30%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.10) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.14), transparent 38%);
    pointer-events: none;
    z-index: -1;
}

h1,
h2,
h3,
h4,
.navbar-brand,
.login-title,
.card-header h2,
.card-header h3,
.page-header h1,
.stat-value,
.error-code {
    font-family: Georgia, "STKaiti", "KaiTi", serif;
    letter-spacing: 0.02em;
}

a {
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-dark);
}

.navbar {
    background: rgba(251, 246, 239, 0.88);
    border-bottom: 1px solid rgba(156, 103, 55, 0.14);
    box-shadow: 0 14px 34px rgba(47, 36, 25, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.navbar-admin {
    background: rgba(47, 36, 25, 0.92);
    border-bottom-color: rgba(156, 103, 55, 0.22);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    background: none;
    color: var(--primary-color);
    -webkit-text-fill-color: currentColor;
}

.navbar-brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: inherit;
}

.nav-link {
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    color: var(--text-secondary);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(156, 103, 55, 0.10);
}

.navbar-admin .nav-link:hover,
.navbar-admin .nav-link.active {
    color: var(--text-light);
    background: rgba(156, 103, 55, 0.22);
}

.mobile-bottom-nav {
    background: rgba(255, 250, 243, 0.96);
    border-top: 1px solid rgba(156, 103, 55, 0.14);
    box-shadow: 0 -16px 34px rgba(47, 36, 25, 0.08);
}

.mobile-nav-item {
    border-radius: 16px;
    color: var(--text-muted);
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--primary-color);
}

.mobile-nav-item.active {
    background: rgba(156, 103, 55, 0.10);
}

.container,
.admin-container {
    max-width: 1280px;
}

.main-content {
    position: relative;
}

.login-container {
    background:
        radial-gradient(circle at 15% 12%, rgba(201, 135, 120, 0.22), transparent 26%),
        radial-gradient(circle at 86% 14%, rgba(117, 138, 115, 0.18), transparent 24%),
        linear-gradient(180deg, #f7efe3 0%, #efe2cf 100%);
}

.login-container::before,
.login-container::after {
    content: "";
    border-radius: 999px;
    filter: blur(8px);
}

.login-container::before {
    width: 18rem;
    height: 18rem;
    top: -4rem;
    left: -5rem;
    background: rgba(201, 135, 120, 0.18);
    animation: none;
}

.login-container::after {
    width: 16rem;
    height: 16rem;
    right: -4rem;
    bottom: -5rem;
    background: rgba(117, 138, 115, 0.16);
    animation: none;
}

.magic-stars,
.star,
.login-hat {
    display: none !important;
}

.login-box {
    max-width: 460px;
    padding: 2.5rem;
    background: rgba(255, 250, 243, 0.94);
    border: 1px solid rgba(156, 103, 55, 0.16);
    border-radius: 2rem;
    box-shadow: var(--shadow-magic);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-title {
    margin-top: 0;
    margin-bottom: 0.75rem;
    background: none;
    color: var(--primary-color);
    -webkit-text-fill-color: currentColor;
}

.login-subtitle,
.login-links a,
.form-text {
    color: var(--text-secondary);
}

.form-group label {
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.form-control {
    border: 1px solid rgba(156, 103, 55, 0.16);
    background: rgba(255, 255, 255, 0.88);
    border-radius: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.form-control:focus {
    border-color: rgba(156, 103, 55, 0.55);
    box-shadow: 0 0 0 4px rgba(156, 103, 55, 0.12);
}

.btn {
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(47, 36, 25, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, #b67d4d 0%, #9c6737 60%, #87572f 100%);
    color: #fffaf3;
    box-shadow: 0 16px 28px rgba(156, 103, 55, 0.24);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #87572f 0%, #9c6737 50%, #6f4728 100%);
    color: #fffaf3;
    box-shadow: 0 18px 32px rgba(156, 103, 55, 0.30);
}

.btn-secondary {
    background: rgba(255, 250, 243, 0.84);
    border: 1px solid rgba(156, 103, 55, 0.18);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(156, 103, 55, 0.08);
    border-color: rgba(156, 103, 55, 0.34);
}

.btn-success {
    background: linear-gradient(135deg, #7e977c 0%, #758a73 100%);
    box-shadow: 0 16px 26px rgba(117, 138, 115, 0.24);
}

.btn-danger {
    background: linear-gradient(135deg, #cf8071 0%, #c46357 100%);
    box-shadow: 0 16px 26px rgba(196, 99, 87, 0.20);
}

.btn-warning {
    background: linear-gradient(135deg, #d8b086 0%, #b67d4d 100%);
    color: #fffaf3;
}

.card,
.course-card,
.playlist,
.chapter-list,
.table,
.table-responsive,
.mobile-card,
.modal-content,
.stat-card,
.footer {
    background: var(--card-bg);
    border-color: rgba(156, 103, 55, 0.12);
    box-shadow: var(--shadow);
}

.card,
.course-card,
.playlist,
.chapter-list,
.mobile-card,
.modal-content,
.stat-card {
    border-radius: var(--radius-lg);
}

.card:hover,
.course-card:hover,
.stat-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header,
.table th,
.mobile-card-header,
.modal-header {
    background: linear-gradient(135deg, rgba(201, 135, 120, 0.06) 0%, rgba(117, 138, 115, 0.08) 100%);
    border-bottom-color: rgba(156, 103, 55, 0.10);
}

.continue-card {
    background: linear-gradient(135deg, #c98778 0%, #9c6737 54%, #758a73 100%);
    color: #fffaf3;
}

.continue-card .card-header {
    background: rgba(255, 255, 255, 0.10);
}

.continue-card .btn {
    background: rgba(255, 250, 243, 0.94);
    color: var(--primary-color);
}

.alert {
    border-radius: 1.25rem;
    border-width: 1px;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: rgba(117, 138, 115, 0.10);
    border-color: rgba(117, 138, 115, 0.20);
    color: #4e674c;
}

.alert-danger {
    background: rgba(201, 135, 120, 0.10);
    border-color: rgba(201, 135, 120, 0.22);
    color: #8e5347;
}

.alert-warning {
    background: rgba(156, 103, 55, 0.10);
    border-color: rgba(156, 103, 55, 0.20);
    color: #6f4728;
}

.alert-info {
    background: rgba(60, 109, 113, 0.10);
    border-color: rgba(60, 109, 113, 0.18);
    color: #2f5f63;
}

.badge {
    padding: 0.35rem 0.7rem;
}

.badge-primary {
    background: rgba(156, 103, 55, 0.10);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(117, 138, 115, 0.12);
    color: #4e674c;
}

.badge-danger {
    background: rgba(201, 135, 120, 0.14);
    color: #8e5347;
}

.badge-warning {
    background: rgba(156, 103, 55, 0.12);
    color: #6f4728;
}

.badge-secondary {
    background: rgba(47, 36, 25, 0.08);
    color: var(--text-secondary);
}

.course-card {
    overflow: hidden;
}

.course-thumbnail,
.thumbnail-placeholder,
.history-thumb,
.thumbnail-placeholder-sm {
    background: linear-gradient(135deg, #efe2cf 0%, #e3c7ad 52%, #c98778 100%);
}

.lock-badge {
    background: rgba(47, 36, 25, 0.64);
}

.course-info,
.card-body,
.playlist,
.modal-body {
    color: var(--text-color);
}

.playlist h3::before,
.empty-state::before {
    content: "";
    width: 0.7rem;
    height: 0.7rem;
    display: inline-block;
    border-radius: 999px;
    margin-right: 0.35rem;
    background: var(--primary-gradient);
    opacity: 1;
}

.empty-state::before {
    display: block;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1rem;
    background: radial-gradient(circle at 30% 30%, rgba(201, 135, 120, 0.35), rgba(156, 103, 55, 0.15) 55%, rgba(117, 138, 115, 0.10) 100%);
}

.player-wrapper {
    background: linear-gradient(180deg, #201710 0%, #110d09 100%);
    border: 1px solid rgba(156, 103, 55, 0.12);
}

.no-video {
    background: linear-gradient(135deg, #3c2e21 0%, #2f2419 55%, #3c6d71 100%);
}

.playlist-item,
.chapter-item,
.history-item {
    border-radius: 1.15rem;
}

.playlist-item:hover,
.chapter-item:hover,
.history-item:hover {
    background: rgba(156, 103, 55, 0.06);
}

.playlist-item.active {
    background: rgba(156, 103, 55, 0.10);
    border-color: rgba(156, 103, 55, 0.28);
}

.playlist-number,
.chapter-number {
    background: rgba(156, 103, 55, 0.10);
    color: var(--primary-color);
}

.playlist-item.active .playlist-number,
.chapter-number {
    background-image: linear-gradient(135deg, #c98778 0%, #9c6737 60%, #87572f 100%);
    color: #fffaf3;
}

.playing-badge,
.progress-fill,
.stat-value {
    background: linear-gradient(135deg, #c98778 0%, #9c6737 52%, #758a73 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.playing-badge {
    color: #fffaf3;
}

.progress-bar {
    background: rgba(156, 103, 55, 0.10);
}

.page-header h1,
.play-header h1,
.history-info h4,
.course-info h3 {
    color: var(--text-color);
}

.table tr:hover {
    background: rgba(156, 103, 55, 0.04);
}

.table tr.locked {
    background: rgba(201, 135, 120, 0.08);
}

.file-id-code,
.info-box {
    border-radius: 1rem;
}

.info-box {
    background: linear-gradient(135deg, rgba(60, 109, 113, 0.08) 0%, rgba(117, 138, 115, 0.10) 100%);
    border-left-color: var(--info-color);
}

.footer {
    background: rgba(255, 250, 243, 0.70);
}

#mobile-menu-panel {
    background: rgba(47, 36, 25, 0.97) !important;
    border-left: 1px solid rgba(156, 103, 55, 0.20);
}

#mobile-menu-panel a,
#mobile-menu-panel button,
#mobile-menu-panel span {
    color: rgba(255, 250, 243, 0.76);
}

#mobile-menu-panel a:hover,
#mobile-menu-panel button:hover,
#mobile-menu-panel .text-red-400 {
    color: #f2dccd !important;
}

#mobile-menu-panel .border-b,
#mobile-menu-panel .border-t {
    border-color: rgba(156, 103, 55, 0.18) !important;
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 58px;
    }

    .navbar {
        height: var(--navbar-height);
        padding: 0 1rem;
    }

    .login-box {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .playlist,
    .card-body,
    .card-header,
    .mobile-card {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .btn {
        width: auto;
    }

    .btn.btn-block,
    .form-actions .btn,
    .mobile-card-actions .btn {
        width: 100%;
    }

    .login-box {
        padding: 1.75rem 1.25rem;
    }
}
