/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 移动端优先 - 默认布局 */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航栏 - 移动端显示 */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-header h1 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.mobile-header h1::before {
    content: "📚";
    margin-right: 10px;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* 侧边栏 - 移动端默认隐藏 */
.sidebar {
    width: 100%;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

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

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-header h2::before {
    content: "📚";
    margin-right: 10px;
    font-size: 1.6rem;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 5px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 3px solid #4CAF50;
}

.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 3px solid #4CAF50;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    margin: 15px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    font-weight: 600;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
}

.welcome {
    background-color: #e8f4fd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 5px solid #2196F3;
}

.welcome a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.welcome a:hover {
    color: #0b7dda;
    text-decoration: underline;
}

.edu-section {
    margin-top: 25px;
}

.edu-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.edu-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.edu-table thead {
    background-color: #4b6cb7;
    color: white;
}

.edu-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    position: relative;
    font-size: 0.9rem;
}

.edu-table th .sup {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.6rem;
    opacity: 0.8;
}

.edu-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.edu-table tbody tr {
    transition: background-color 0.2s;
}

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

.edu-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.edu-table tbody tr:nth-child(even):hover {
    background-color: #e9ecef;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

/* 用户信息区域 */
.user-info {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    margin-top: 20px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 1.2rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 平板设备样式 */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
    }
    
    .mobile-header {
        display: none;
    }
    
    .sidebar {
        width: 250px;
        transform: translateX(0);
        position: relative;
        height: auto;
    }
    
    .close-menu {
        display: none;
    }
    
    .main-content {
        flex: 1;
        padding: 25px;
        margin: 20px;
    }
    
    .edu-table th,
    .edu-table td {
        padding: 12px 15px;
        font-size: 1rem;
    }
}

/* 桌面设备样式 */
@media (min-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        padding: 30px;
        margin: 25px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .edu-section h2 {
        font-size: 1.5rem;
    }
}

/* 超大屏幕样式 */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .sidebar {
        width: 300px;
    }
    
    .main-content {
        padding: 40px;
    }
}

/* 表格在小屏幕上的响应式处理 */
@media (max-width: 767px) {
    .edu-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .edu-table thead {
        display: none;
    }
    
    .edu-table tbody, 
    .edu-table tr, 
    .edu-table td {
        display: block;
        width: 100%;
    }
    
    .edu-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    
    .edu-table td {
        padding: 8px 10px;
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        white-space: normal;
    }
    
    .edu-table td:last-child {
        border-bottom: none;
    }
    
    .edu-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        font-weight: bold;
        color: #4b6cb7;
    }
}

/* 遮罩层 - 移动端菜单打开时 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}




/* 词库页面特定样式 */
.wordbank-content {
    margin-top: 20px;
}

.word-list {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.word-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #4b6cb7;
    transition: transform 0.2s ease;
}

.word-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.word-item h3 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.word-item p {
    margin: 5px 0;
    color: #555;
}

.word-tag {
    display: inline-block;
    background: #4b6cb7;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-top: 8px;
}