/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B35;  /* 主桔色 */
    --secondary-color: #FF9F1C;  /* 浅桔色 */
    --success-color: #2EC4B6;  /* 保持原有的成功色 */
    --danger-color: #E71D36;  /* 保持原有的危险色 */
    --light-color: #FFF5F0;  /* 浅桔色背景 */
    --dark-color: #2D2D2D;  /* 深色文字 */
    --font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --primary-dark: #E55A2B;  /* 深桔色 */
    --border-color: #e0e0e0;  /* 边框颜色 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);  /* 小阴影 */
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);  /* 中阴影 */
    --transition-base: all 0.3s ease;  /* 基础过渡效果 */
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    position: relative;
    z-index: 1;
}

.main-header .container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem 20px;
    gap: 2rem;
}

.logo {
    margin-right: 0;
}

.logo a {
    text-decoration: none;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.logo img {
    height: 46px;
    width: auto;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

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

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin: 0 1rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--secondary-color);  /* 悬停时使用浅桔色 */
}

.header-right {
    margin-left: auto;
}

.language-selector a {
    margin: 0 0.5rem;
    text-decoration: none;
    color: var(--secondary-color);
}

.language-selector a.active {
    color: var(--secondary-color);  /* 活动语言使用浅桔色 */
    font-weight: bold;
}

/* Button Styles */
a.btn,
button.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

a.btn-primary,
button.btn-primary {
    background-color: var(--primary-color);
    color: white !important;
    border: none;
}

a.btn-primary:hover,
button.btn-primary:hover {
    background-color: var(--secondary-color) !important;
    color: white !important;
    border: none;
}

a.btn-outline,
button.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

a.btn-outline:hover,
button.btn-outline:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: 2px solid var(--primary-color);
}

a.btn-lg,
button.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #FFF5F0 0%, #FFD6C2 100%);  /* 桔色渐变背景 */
}

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

.hero-content {
    flex: 1;
    padding-right: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    text-align: right;
}

.hero-image img {
    max-width: 100%;
    height: auto;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: #fff;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--dark-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 8px;
    background-color: #FFF5F0;  /* 浅桔色背景 */
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #FFF5F0 0%, #FFD6C2 100%);
    color: var(--dark-color);
    padding: 4rem 0 2rem;
    text-align: center;
}

.welcome-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--dark-color);
}

.welcome-subtitle {
    font-size: 1.25rem;
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

/* Stats Section */
.stats-section {
    padding: 3rem 0;
    background-color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: #FFF5F0;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Activity Section */
.activity-section {
    padding: 3rem 0;
    background-color: #f8f9fa;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background-color: #FFF5F0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon i {
    color: var(--primary-color);
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

.activity-time {
    display: block;
    font-size: 0.825rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

/* Courses Section */
.courses {
    padding: 4rem 0;
    background-color: #FFF5F0;  /* 浅桔色背景 */
}

/* Home page courses grid - 4 cards per row */
.home .courses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* Courses page grid - 3 cards per row */
.course-categories .courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .home .courses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .course-categories .courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .home .courses-grid,
    .course-categories .courses-grid {
        grid-template-columns: 1fr;
    }
}

.course-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-card h3 {
    padding: 1rem;
    color: var(--dark-color);
}

.course-card p {
    padding: 0 1rem 1rem;
    color: var(--secondary-color);
}

/* App Download Section */
.app-download {
    padding: 4rem 0;
    background-color: #fff;
}

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

.app-content {
    flex: 1;
    padding-right: 2rem;
}

.app-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.app-content p {
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.app-buttons {
    display: flex;
    gap: 1rem;
}

.app-store-btn img,
.play-store-btn img {
    height: 40px;
}

.app-preview {
    flex: 1;
    text-align: right;
}

.app-preview img {
    max-width: 100%;
    height: auto;
}

/* Footer Styles */
.main-footer {
    background-color: var(--dark-color);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    color: white;
    font-size: 1.5rem;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        padding: 1rem;
    }

    .main-nav {
        margin: 1rem 0;
    }

    .header-right {
        margin-top: 1rem;
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .app-download .container {
        flex-direction: column;
        text-align: center;
    }

    .app-content {
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .app-buttons {
        justify-content: center;
    }
}

/* Language Selector Dropdown */
.language-selector {
    margin-right: 20px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

/* Language dropdown: plain text style, larger font, no border or background */
.language-selector .dropdown-toggle {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    font-size: 16px; /* Larger font */
    color: #222;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
}

.language-selector .dropdown-toggle:focus {
    outline: none;
}

.language-selector .dropdown-toggle:hover {
    text-decoration: underline;
    background: none;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 100px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    color: #333;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item.active {
    background-color: #e9ecef;
    color: #333;
}

.fa-chevron-down {
    font-size: 12px;
}

/* System Message Styles */
.system-message {
    position: relative;
    padding: 10px 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.system-message .container {
    padding: 0 40px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.system-message p {
    margin: 0;
    padding: 0;
    flex: 1;
    text-align: center;
}

.system-message .close-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
}

.system-message .close-btn:hover {
    color: #333;
}

.system-message.success {
    background-color: #d1edda;
    color: #155726;
}

.system-message.error {
    background-color: #f8d7da;
    color: #721c26;
}

.system-message.warning {
    background-color: #fff3cd;
    color: #856606;
}

.system-message.info {
    background-color: #d1ecf1;
    color: #0c5660;
}

/* Add active class styling for the navigation menu */
.main-nav ul li a.active {
    color: #fff;
    font-weight: bold;
    background-color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 4px;
}

.main-nav ul li a.active:hover {
    color: #fff;
}

/* Language and user info group: horizontally aligned */
.lang-user-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    min-width: 0 !important;
}

/* Language selector: icon and text aligned */
.language-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    position: relative;
}

/* User info: icon in green circle and email */
.user-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: 0 !important;
}

.user-avatar, .user-email {
    display: inline-flex !important;
    vertical-align: middle !important;
    min-width: 0 !important;
}

.user-avatar {
    background: var(--primary-color); /* 橘色背景 */
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff; /* 白色字体 */
    font-size: 20px;
}

.user-email {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

/* Responsive: stack vertically on small screens */
@media (max-width: 600px) {
    .lang-user-group {
        flex-direction: column;
        gap: 10px;
        align-items: flex-end;
    }
    .user-email {
        max-width: 70px;
        font-size: 14px;
    }
}

/* User dropdown menu (header) */
.user-dropdown {
    position: relative;
    cursor: pointer;
}

.user-dropdown .user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 4px;
    min-width: 200px;
    z-index: 1000;
    margin-top: 5px;
}

/* 只保留active状态 */
.user-dropdown.active .user-menu {
    display: block;
}

.user-header {
    display: flex;
    align-items: center;
    padding: 0 16px 8px 16px;
    border-bottom: 1px solid #f5f5f5;
}

.user-header .user-avatar {
    background: var(--primary-color); /* 橘色背景 */
    color: #fff; /* 白色字体 */
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 20px;
}

.user-header .user-email {
    font-weight: bold;
    color: var(--dark-color);
}

.user-menu-list {
    list-style: none;
    margin: 0;
    padding: 0 16px;
}

.user-menu-list li {
    margin: 10px 0;
}

.user-menu-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    border-radius: 4px;
    padding: 4px 8px;
    transition: background 0.2s, color 0.2s;
}

.user-menu-list a:hover {
    background: var(--light-color);
    color: var(--secondary-color);
}

.user-logout {
    border-top: 1px solid #f5f5f5;
    margin-top: 8px;
    padding: 8px 16px 0 16px;
}

.user-logout a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    border-radius: 4px;
    padding: 4px 8px;
    transition: background 0.2s, color 0.2s;
}

.user-logout a:hover {
    background: var(--light-color);
    color: var(--secondary-color);
}

.user-menu .user-email {
    max-width: none;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
}

/* Student Management Page Styles */
.page-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.students-section {
    padding: 2rem 0;
}

.action-bar {
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-end;
}

/* Table Styles */
.table {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    padding: 1rem;
    color: var(--dark-color);
    font-weight: 500;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

/* Button Styles for Student Management */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0 0.25rem;
}

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

.btn-info:hover {
    background-color: #25a99e;
    border-color: #25a99e;
    color: white;
}

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

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Modal Styles */
.modal-content {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: none;
}

.modal-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    padding: 1rem 1.5rem;
}

.modal-title {
    color: var(--dark-color);
    font-weight: 500;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    color: var(--dark-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Responsive Table */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .table-responsive {
        margin: 0 -1rem;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-bar .btn {
        margin-bottom: 0.5rem;
    }
    
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 1rem;
    }
}

/* Icon Spacing */
.fas {
    margin-right: 0.25rem;
}

/* Main Content Styles */
.main-content {
    padding-top: 60px;
    min-height: calc(100vh - 60px);
    background-color: #f8f9fa;
}

/* Hero Section Enhancement */
.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 600;
}

/* Table Enhancement */
.table-hover tbody tr:hover {
    background-color: var(--light-color);
    transition: background-color 0.2s ease;
}

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

/* Button Group Styles */
.btn-group {
    display: inline-flex;
    gap: 0.5rem;
}

/* Form Enhancement */
.student-form {
    padding: 1rem 0;
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Modal Enhancement */
.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

.modal-content {
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
}

/* Responsive Enhancement */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Dashboard Layout - Updated for optimized side-by-side display */
.dashboard-container {
    display: flex;
    flex-wrap: nowrap;
    min-height: calc(100vh - 64px); /* Adjust based on your header height */
    position: relative;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    transition: all 0.3s ease;
    overflow-y: auto;
    height: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-directory {
    width: 280px;
    min-width: 280px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    transition: all 0.3s ease;
    overflow-y: auto;
    height: 100vh;
    display: none; /* Hide by default */
    position: sticky;
    top: 0;
    z-index: 99;
}

/* Only show content directory when it has the expanded class or we're on a page that needs it */
.content-directory.expanded {
    display: block;
}

.dashboard-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fff;
    min-height: calc(100vh - 64px);
}

/* Directory toggle button for mobile */
.directory-toggle {
    display: none;
    padding: 10px 15px;
    background: #f1f1f1;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 15px;
}

/* Adjustments for different screen sizes */
@media (max-width: 1200px) {
    .sidebar {
        width: 200px;
        min-width: 200px;
    }
    
    .content-directory {
        width: 240px;
        min-width: 240px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 180px;
        min-width: 180px;
    }
    
    .content-directory {
        width: 220px;
        min-width: 220px;
    }
    
    .dashboard-content {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }
    
    .sidebar-nav ul {
        display: flex;
        padding: 10px 0;
    }
    
    .content-directory {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 0;
        border-right: none;
        position: relative;
        overflow: hidden;
    }
    
    .content-directory.expanded {
        max-height: 300px;
        overflow-y: auto;
        border-bottom: 1px solid #e9ecef;
    }
    
    .dashboard-content {
        width: 100%;
        padding: 15px 10px;
    }
    
    .directory-toggle {
        display: flex;
        align-items: center;
    }
    
    .nav-item a {
        padding: 10px 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .nav-item i {
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 1.1rem;
    }
}

/* Tree container styles */
.tree-container {
    padding: 3px;
}

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

/* Add orange color to tree header icon */
.tree-header i {
    color: var(--primary-color);
}

/* Make plus icon white in primary button */
.tree-header .btn-primary i {
    color: white;
}

.directory-tree {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

/* Tree styles - Enhanced with content.jsp styles */
.tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tree-item {
    list-style: none;
    margin: 2px 0;
    padding: 0;
}

.tree-item-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tree-item-content:hover {
    background-color: #f8f9fa;
}

.tree-item-content.selected {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.tree-item-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.tree-indent {
    display: inline-block;
    height: 1px;
    width: 0;
}

/* + - 号展开/折叠图标样式 */
.tree-item-content .expand-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    color: #666 !important;
    font-size: 12px;
    text-align: center;
    line-height: 16px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 1px;
    background-color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tree-item-content .expand-icon:hover {
    background-color: #f0f0f0;
    border-color: #999;
    color: #333 !important;
}

/* 叶子节点占位符 */
.tree-placeholder {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    display: inline-block;
}

.dir-name {
    font-size: 14px;
    color: #333;
    margin-left: 2px;
    flex: 1;
}

.sub-tree {
    list-style: none;
    margin: 0;
    padding: 0 0 0 12px; /* 每一级缩进24px */
    display: none;
}

/* Show sub-tree for expanded items by default */
.tree-item.expanded > .sub-tree {
    display: block;
}

.empty-tree {
    opacity: 0.6;
    color: #6c757d;
}

/* Tree action buttons */
.tree-actions {
    display: flex;
    gap: 8px;
}

.tree-actions button {
    padding: 4px 8px;
}

.tree-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dir-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-item-content:hover .dir-actions {
    opacity: 1;
}

/* Ensure all expand icons in tree items have consistent styling */
.tree-item-content i {
    color: var(--primary-color);
}

/* 响应式设计 - Tree specific */
@media (max-width: 768px) {
    .tree-item-content {
        padding: 12px 8px !important;
    }
    
    .sub-tree {
        padding-left: 6px; /* 移动设备上减小缩进 */
    }
    
    .dir-actions {
        opacity: 1;
        display: none;
    }
    
    .tree-item-content:hover .dir-actions {
        display: flex;
    }
}

/* Add this to make the sidebar automatically visible on larger screens */
@media (min-width: 769px) {
    .sidebar {
        display: block !important;
    }
    
    body.content-page .content-directory {
        display: block !important;
    }
}

/* Adding specific page styles */
body.content-page .content-directory {
    display: block; /* Always show on content pages */
}

/* Sidebar Styles */
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 5px 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-item a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-item.active a {
    background-color: rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

/* Main Content Styles */
.dashboard-content {
    flex: 1;
    margin-left: 0;
    padding: 20px;
    background-color: #f8f9fa;
    min-height: calc(100vh - 60px);
    width: calc(100% - 550px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-nav span {
        display: none;
    }
    
    .dashboard-content {
        margin-left: 60px;
    }
    
    .nav-item a {
        justify-content: center;
        padding: 12px;
    }
    
    .nav-item i {
        margin-right: 0;
    }
}

/* Content Directory Responsive Styles */
.content-directory {
    transition: all 0.3s ease;
}

/* Ensure proper layout for the three-column structure */
@media (max-width: 1200px) {
    .content-directory {
        width: 250px !important;
        min-width: 250px !important;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 200px;
        min-width: 200px;
    }
    
    .content-directory {
        width: 200px !important;
        min-width: 200px !important;
    }
    
    .dashboard-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        min-height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .content-directory {
        width: 100% !important;
        height: auto;
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        display: block !important;
    }
    
    .dashboard-content {
        margin-left: 0;
        padding: 15px;
        width: 100%;
    }
}

/* Fixes for tree view on mobile */
@media (max-width: 576px) {
    .tree-item-content {
        padding: 6px 8px;
    }
    
    .dir-actions {
        opacity: 1;
        display: none;
    }
    
    .tree-item-content:hover .dir-actions {
        display: flex;
    }
}

/* Additional missing styles */
.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Sidebar Styles */
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 5px 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition-base);
}

.nav-item a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-item.active a {
    background-color: rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

/* Content Directory Responsive Styles */
.content-directory {
    transition: var(--transition-base);
}

/* Ensure proper layout for the three-column structure */
@media (max-width: 1200px) {
    .content-directory {
        width: 250px !important;
        min-width: 250px !important;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 200px;
        min-width: 200px;
    }
    
    .content-directory {
        width: 200px !important;
        min-width: 200px !important;
    }
    
    .dashboard-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        min-height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .content-directory {
        width: 100% !important;
        height: auto;
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        display: block !important;
    }
    
    .dashboard-content {
        margin-left: 0;
        padding: 15px;
        width: 100%;
    }
}

/* Fixes for tree view on mobile */
@media (max-width: 576px) {
    .tree-item-content {
        padding: 6px 8px;
    }
    
    .dir-actions {
        opacity: 1;
        display: none;
    }
    
    .tree-item-content:hover .dir-actions {
        display: flex;
    }
}

/* User Task Section */
.user-task-section {
    padding: 2rem 0;
}

/* User Task Progress Bar */
.progress-bar {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--dark-color);
    text-align: center;
    font-weight: 500;
}

/* User Task Type and Status Badges */
.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.type-0 {
    background-color: #e3f2fd;
    color: #1565c0;
}

.type-1 {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Courses Section */
.courses-section {
    padding: 3rem 0;
    background-color: #fff;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.course-content {
    padding: 1.25rem;
}

.course-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.progress-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 1rem 0 0.5rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

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

/* Assignments Section */
.assignments-section {
    padding: 3rem 0;
    background-color: #f8f9fa;
}

.assignments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.assignment-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.assignment-header h3 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin: 0;
}

.due-date {
    font-size: 0.875rem;
    color: #dc3545;
    font-weight: 500;
}

.assignment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.course-name {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Dashboard Layout */
.dashboard {
    padding-bottom: 3rem;
}

/* Content wrapper for better layout */
.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Content Management Table Styles */
.content-table-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.table {
    margin-bottom: 0;
    width: 100%;
}

.table thead th {
    background-color: #fafafa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: var(--dark-color);
    padding: 15px;
    white-space: nowrap;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
    background-color: #fcfcfc;
}

/* Column specific styles */
.col-id {
    width: 60px;
    text-align: center;
}

.col-contentId {
    width: 100px;
}

.col-name {
    width: 150px;
}

.col-dirPath {
    width: 200px;
}

.col-content {
    width: auto;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-lang {
    width: 80px;
    text-align: center;
}

.col-type {
    width: 100px;
    text-align: center;
}

.col-status {
    width: 100px;
    text-align: center;
}

.col-createTime {
    width: 150px;
    text-align: center;
}

.col-actions {
    width: 120px;
    text-align: center;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active,
.status-Enabled {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-inactive,
.status-Disabled {
    background-color: #ffebee;
    color: #c62828;
}

.status-draft {
    background-color: #fff3e0;
    color: #ef6c00;
}

.status-0 {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-1 {
    background-color: #ffebee;
    color: #c62828;
}

/* Content type badges */
.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.type-text {
    background-color: #e3f2fd;
    color: #1565c0;
}

.type-image {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.type-video {
    background-color: #fce4ec;
    color: #c2185b;
}

/* Language badges */
.lang-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.lang-zh {
    background-color: #e3f2fd;
    color: #1565c0;
}

.lang-en {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-buttons .btn {
    padding: 4px 8px;
    font-size: 12px;
}

.action-buttons .btn i {
    margin-right: 4px;
}

/* Empty state */
.empty-message {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.empty-message i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-message p {
    margin: 0;
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .col-content {
        max-width: 200px;
    }
    
    .col-dirPath {
        width: 150px;
    }
}

@media (max-width: 992px) {
    .table-responsive {
        margin: 0 -15px;
    }
    
    .content-table-wrapper {
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
    }
    
    .table tbody td {
        display: flex;
        padding: 12px 15px;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .table tbody td:last-child {
        border-bottom: none;
    }
    
    .table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        width: 120px;
        flex-shrink: 0;
    }
    
    .col-actions {
        width: 100%;
    }
    
    .action-buttons {
        justify-content: flex-start;
    }
}

/* Smooth transitions */
* {
    transition: none;
}

.tree-item,
.tree-item-content,
.dir-actions,
.sub-tree,
.content-directory,
.directory-toggle,
.btn,
.modal {
    transition: all 0.3s ease;
}

/* Safari specific fixes */
.is-safari .dashboard-container {
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    flex-direction: row;
}

.is-safari .sidebar,
.is-safari .content-directory,
.is-safari .dashboard-content {
    position: relative;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.is-safari .content-directory {
    display: block;
    visibility: visible;
}

.is-safari .tree-container {
    min-height: 200px;
    height: auto;
    max-height: calc(100vh - 180px);
}

.is-safari .directory-tree {
    min-height: 100px;
    height: auto;
    max-height: calc(100vh - 240px);
}

/* Safari grid fallback */
@supports not (display: grid) {
    .dashboard-container {
        display: -webkit-box;
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        flex-direction: row;
    }
    
    .sidebar {
        width: 250px;
        -webkit-box-flex: 0;
        flex: 0 0 250px;
    }
    
    .content-directory {
        width: 300px;
        -webkit-box-flex: 0;
        flex: 0 0 300px;
    }
    
    .dashboard-content {
        -webkit-box-flex: 1;
        flex: 1;
    }
}

/* Fix gap property for Safari */
.dir-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.dir-actions > * + * {
    margin-left: 4px;
}

@supports (gap: 4px) {
    .dir-actions {
        gap: 4px;
    }
    
    .dir-actions > * + * {
        margin-left: 0;
    }
}

/* Safari scroll fixes */
.is-safari .sidebar,
.is-safari .content-directory,
.is-safari .dashboard-content,
.is-safari .directory-tree {
    -webkit-overflow-scrolling: touch;
}

/* Height calculation fixes for Safari */
.is-safari .sidebar {
    height: -webkit-calc(100vh - 60px);
    height: calc(100vh - 60px);
}

.is-safari .content-directory {
    height: -webkit-calc(100vh - 60px);
    height: calc(100vh - 60px);
}

.is-safari .dashboard-content {
    height: -webkit-calc(100vh - 60px);
    height: calc(100vh - 60px);
}

/* Content Selection Table Styles (from user-task.jsp) */
.content-selection-table .content-row {
    cursor: pointer;
}

.content-selection-table .content-row:hover {
    background-color: #f8f9fa;
}

.content-selection-table .table-active {
    background-color: #e3f2fd !important;
}

.content-selection-table .table-active:hover {
    background-color: #e3f2fd !important;
}

.content-selection-table th {
    background-color: #f8f9fa !important;
    font-weight: 600;
}

.content-selection-table td {
    vertical-align: middle;
}

.content-selection-table .form-check-input {
    margin: 0;
}

/* Task Progress Bar Styles */
.task-progress-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.task-progress-bar {
    width: 80px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 0;
}

.task-progress-text {
    font-size: 0.75rem;
    color: var(--dark-color);
    font-weight: 500;
}