/* 主色调：白色底 + 蓝色按钮 */
:root {
    --primary-color: #667EEA;
    --primary-hover: #5568D3;
    --gradient-start: #667EEA;
    --gradient-end: #667EEA;
    --text-primary: #2C3E50;
    --text-secondary: #6C757D;
    --shadow-soft: 0 2px 20px rgba(102, 126, 234, 0.15);
    --shadow-medium: 0 4px 30px rgba(102, 126, 234, 0.2);
    --border-radius: 16px;
    --bg-light: #F5F7FA;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #F5F7FA;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* 顶部栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.header-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: auto;
}

.header-logo {
    height: 40px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-points {
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.user-dropdown-toggle:hover {
    background: rgba(102, 126, 234, 0.05);
}

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

.user-name {
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: #FFFFFF;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    z-index: 1100; /* 高于主内容区域和遮罩层，确保菜单显示在最上层 */
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-link:hover {
    background: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.sidebar-link.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    font-weight: 500;
    position: relative;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.sidebar-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
}

.sidebar-text {
    flex: 1;
}

.sidebar-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: 10px;
}

/* 侧边栏分组 */
.sidebar-group {
    margin: 0.25rem 0;
}

.sidebar-group-title {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-group-title:hover {
    background: rgba(102, 126, 234, 0.05);
}

.sidebar-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.sidebar-group.active .sidebar-arrow {
    transform: rotate(-180deg);
}

.sidebar-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-group.active .sidebar-group-content {
    max-height: 500px !important;
}

/* 默认展开已激活的分组 */
.sidebar-group.active {
    background: rgba(102, 126, 234, 0.02);
}

.sidebar-group.active .sidebar-group-title {
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.5rem 0.6rem 3rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-sublink:hover {
    background: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.sidebar-sublink.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-sublink.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

/* 嵌套菜单样式 */
.sidebar-nested-group {
    margin: 0;
}

.sidebar-nested-title {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.5rem 0.6rem 3rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nested-title:hover {
    background: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.sidebar-nested-title .sidebar-arrow {
    margin-left: auto;
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}

.sidebar-nested-group.active .sidebar-nested-title .sidebar-arrow {
    transform: rotate(90deg);
}

.sidebar-nested-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-nested-group.active .sidebar-nested-content {
    max-height: 300px;
}

.sidebar-nested-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem 0.5rem 4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nested-link:hover {
    background: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.sidebar-nested-link.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-nested-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.sidebar-sublink .sidebar-icon {
    font-size: 1rem;
}

.sidebar-divider {
    height: 1px;
    background: #E4E7EB;
    margin: 0.5rem 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E4E7EB;
    background: #FAFAFA;
    margin-top: auto;
    flex-shrink: 0;
}

.sidebar-footer-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
}

/* 主内容区域 */
.main-content {
    margin-top: 60px;
    margin-left: 240px;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s ease;
    position: relative;
    z-index: 1; /* 置于header(1000)下层 */
}

.content-wrapper {
    padding: 1rem 0.5rem;
    width: 100%;
    position: relative;
    z-index: 1; /* 确保在header下层 */
}

/* 遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 850;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* 默认不拦截点击事件 */
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto; /* 激活时才拦截点击事件 */
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.75em;
    margin-left: 0.3rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    min-width: 200px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.dropdown-icon {
    margin-right: 0.75rem;
    font-size: 1.2em;
}

.dropdown-divider {
    height: 1px;
    background: #E4E7EB;
    margin: 0.5rem 0;
    opacity: 1;
}

/* 容器（向后兼容） */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* 卡片 */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-header {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid #E4E7EB;
    padding-bottom: 1rem;
}

/* 按钮 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.btn-secondary:hover {
    background: #E4E7EB;
}

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

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

.btn-warning {
    background: #f59e0b;
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-success {
    background: #10b981;
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-next {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-next::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-next:hover::before {
    left: 100%;
}

.btn-next:hover {
    background: linear-gradient(135deg, #5568D3 0%, #6B3A8F 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-next:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.btn-next::after {
    content: '→';
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.btn-next:hover::after {
    transform: translateX(3px);
}

/* 表单 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #E4E7EB;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: #FFFFFF;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* 提示消息 */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(52, 211, 153, 0.1);
    border-color: #34D399;
    color: #059669;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: #EF4444;
    color: #DC2626;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: #FBBF24;
    color: #D97706;
}

.alert-info {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 网格布局 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col {
    flex: 1;
    padding: 0.5rem;
}

.col-6 {
    flex: 0 0 50%;
    padding: 0.5rem;
}

.col-4 {
    flex: 0 0 33.333%;
    padding: 0.5rem;
}

.col-3 {
    flex: 0 0 25%;
    padding: 0.5rem;
}

/* 统计卡片 */
.stats-card {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-medium);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* 视频播放器 */
.video-player {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    background: #000;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .user-points {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
    }
    
    .header-logo {
        height: 32px;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .col-6, .col-4, .col-3 {
        flex: 0 0 100%;
    }
    
    .user-name {
        display: none;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 0.75rem;
    }
    
    .card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .header-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 渐变文字 */
.gradient-text {
    background: var(--primary-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 图标样式 */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

