/*
 * 教学视频平台 - 主样式文件
 * 版本: 1.0
 * 作者: 教学视频平台团队
 */

/* 基础重置和变量定义 */

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --light-gray: #ecf0f1;
    --border-color: #ddd;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
    --border-radius: 8px;
    --transition: 0.3s ease;

    /* 底部导航统一变量（与reader_books.html风格一致） */
    --bottom-nav-h: 64px;
    --bottom-nav-bg: #ffffff;
    --bottom-nav-line: #dbe8f5;
    --bottom-nav-text: #7b8ba1;
    --bottom-nav-active: #2c88ea;
    --bottom-nav-shadow: 0 -4px 18px rgba(31, 45, 61, 0.06);
}

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

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--bottom-nav-h) + 10px);
}

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

/* 工具类 */
.hidden {
    display: none !important;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    font-size: 16px;
}

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

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

/* 头部导航栏 */
.header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
    font-size: 24px;
    font-weight: 700;
}

.logo i {
    color: var(--primary-color);
    font-size: 28px;
    margin-right: 10px;
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-color);
}

.search-box button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 0 20px;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.search-box button:hover {
    background-color: var(--primary-dark);
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav li {
    margin-left: 20px;
}

.nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.nav a i {
    margin-right: 8px;
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark-color);
    cursor: pointer;
}

/* 筛选区域 */
.filter-section {
    background-color: white;
    padding: 5px 0;
    margin: 10px 0;
    margin-top: 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.filter-section h2 {
    margin-bottom: 15px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.filter-section h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
    margin-left: 10px;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item h3 {
    margin-left: 15px;
    margin-bottom: 0;
    color: #555;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
}

.filter-buttons {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    white-space: nowrap;
    padding: 2px 5px 5px;
}

.filter-buttons::-webkit-scrollbar {
    height: 6px;
}

.filter-buttons::-webkit-scrollbar-thumb {
    background-color: var(--gray-color);
    border-radius: 999px;
}

.filter-buttons::-webkit-scrollbar-track {
    background-color: transparent;
}

.filter-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    height: 40px;
    padding: 0 15px;
    background-color: var(--light-gray);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    transition: var(--transition);
    color: #555;
    white-space: nowrap;
    text-align: center;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 筛选区域响应式 */
@media (max-width: 768px) {
    .filter-section {
        padding: 12px 0;
        margin: 10px 0;
        margin-top: 50px;
    }

    .filter-group {
        gap: 12px;
    }

    .filter-item h3 {
        font-size: 15px;
        margin-left: 15px;
    }

    .filter-buttons {
        gap: 8px;
        padding: 2px 12px 8px;
    }

    .filter-btn {
        height: 36px;
        padding: 0 16px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .filter-section {
        margin-top: 50px;
        border-radius: 0;
    }

    .filter-item h3 {
        font-size: 14px;
    }

    .filter-buttons {
        gap: 6px;
        padding: 2px 10px 8px;
    }

    .filter-btn {
        height: 34px;
        padding: 0 14px;
        font-size: 12px;
    }
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding: 20px 0 40px;
}

.section-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    z-index: 1000;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 100px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: bold;
    color: white;
    flex: 1;
    text-align: center;
    margin: 0;
}

/* 视频网格 */
.loading,
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--gray-color);
}

.loading i {
    font-size: 30px;
    margin-bottom: 15px;
}

.no-results i {
    font-size: 50px;
    margin-bottom: 15px;
    color: #ddd;
}

.no-results h3 {
    margin-bottom: 10px;
    color: #777;
}

/* 左侧播放器 */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-hover);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #777;
    transition: var(--transition);
}

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

.modal-content h2 {
    margin-bottom: 25px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.modal-content h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.switch-form {
    margin-top: 20px;
    text-align: center;
    color: #777;
}

.switch-form a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* 页脚 */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: auto;
}

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

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.footer-section p {
    color: #bbb;
    line-height: 1.8;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bbb;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .header .container {
        flex-wrap: wrap;
    }

    .search-box {
        order: 3;
        margin: 20px 0 0;
        max-width: 100%;
    }

    .nav {
        order: 2;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav {
        display: none;
        width: 100%;
        order: 4;
        margin-top: 20px;
    }

    .nav.active {
        display: block;
    }

    .nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .nav li {
        margin-left: 0;
    }

    .nav a {
        justify-content: center;
        padding: 12px;
    }

    .filter-section {
        padding: 12px 0;
        margin: 10px 0;
        margin-top: 50px;
    }

    .filter-group {
        gap: 12px;
    }

    .filter-item h3 {
        font-size: 15px;
        margin-left: 15px;
        margin-bottom: 0;
    }

    .filter-btn {
        height: 36px;
        padding: 0 16px;
        font-size: 13px;
    }
}

.section-header {
    height: 50px;
    padding: 0 15px;
}

/* 视频列表样式 */
.video-list-container {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.video-list {
    display: flex;
    flex-direction: column;
}

.video-list-item:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* 响应式：平板 */
@media (max-width: 992px) {
    .video-list-header {
        display: none;
    }

    .video-list-item {
        flex-wrap: wrap;
        position: relative;
        padding: 15px;
    }
}

/* 响应式：手机 */
@media (max-width: 576px) {
    .filter-section {
        margin-top: 50px;
        border-radius: 0;
    }

    .filter-item h3 {
        font-size: 14px;
    }

    .filter-buttons {
        gap: 6px;
        padding: 2px 10px 8px;
    }

    .filter-btn {
        height: 34px;
        padding: 0 14px;
        font-size: 12px;
    }
}


/* 我的页面样式 */
.user-card {
    position: relative;
    background: linear-gradient(to bottom, #29b6f6, #4fc3f7);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: var(--shadow);
    color: white;
}

.user-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/placeholder.svg') no-repeat center;
    background-size: cover;
    opacity: 0.1;
}

.user-card-content {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1;
}

.user-avatar {
    margin-right: 20px;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.avatar-placeholder i {
    font-size: 30px;
    margin-bottom: 5px;
}

.avatar-placeholder span {
    font-size: 12px;
    font-weight: 500;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.user-login {
    font-size: 14px;
    opacity: 0.9;
    cursor: pointer;
}

.decorations {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.deco-1 {
    width: 100px;
    height: 100px;
    top: -30px;
    right: -30px;
}

.deco-2 {
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 60px;
}

.deco-3 {
    width: 40px;
    height: 40px;
    bottom: -10px;
    right: 120px;
}

/* 功能菜单样式 */
.menu-section {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

.menu-list {
    list-style: none;
}

.menu-item {
    border-bottom: 1px solid var(--border-color);
}

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

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

.menu-item a:hover {
    background-color: var(--light-gray);
}

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--gray-color);
    font-size: 18px;
}

.menu-text {
    flex: 1;
    font-weight: 500;
    font-size: 16px;
}

.menu-arrow {
    color: var(--gray-color);
    font-size: 14px;
}



/* Toast提示样式 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

/* 移动端调整 */
@media (max-width: 768px) {
    .toast {
        bottom: 80px;
        padding: 10px 20px;
        font-size: 13px;
        max-width: 90%;
    }
}

/* ============================================
 * index.html特有样式
 * ============================================ */

/* 返回按钮 */
.back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.back-btn:hover {
    background-color: var(--light-gray);
}

/* 分类列表 */
.category-grid{
    display:grid;
    grid-template-columns:repeat(1, 1fr);
    gap:10px;
    margin-top:10px;
    margin-bottom:10px;
}

.category-card{
    background:#fff;
    border:1px solid #d9e7f7;
    border-radius:12px;
    box-shadow:0 8px 22px rgba(31,45,61,.08);
    padding:14px;
    cursor:pointer;
    transition:transform .18s ease, box-shadow .18s ease;
}

.category-card:hover{
    background:#f8fbff;
    transform:translateY(-2px);
    box-shadow:0 12px 24px rgba(31,45,61,.10);
}

.category-main{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}

.category-text{
    flex:1;
    min-width:0;
}

.category-title{
    font-size:15px;
    line-height:1.45;
    color:#1f2d3d;
    font-weight:600;
    word-break:break-word;
}

.category-sub{
    margin-top:6px;
    font-size:12px;
    color:#6b7a90;
    word-break:break-word;
}

.category-fav-btn{
    flex:0 0 auto;
    width:30px;
    height:30px;
    border:none;
    border-radius:50%;
    background:rgba(232,243,255,.95);
    color:#8ea0b8;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 2px 8px rgba(31,45,61,.08);
    padding:0;
    margin:0;
}

.category-fav-btn i{
    font-size:14px;
    line-height:1;
}

.category-fav-btn.active{
    color:#f5b301;
    background:#fff7d6;
}

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

.card-header {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    margin-bottom: 3px;
}

.card-title h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 4px;
}

.card-content {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--border-color);
    flex-shrink: 0;
    width: 150px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 12px;
    background-color: var(--light-gray);
    border-radius: 30px;
    font-size: 13px;
    color: #555;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .category-grid {
        gap: 12px;
    }

    .video-list-header {
        display: none;
    }
}

@media (max-width: 768px) {
    .category-card {
        flex-direction: row;
        min-height: auto;
    }

    .card-content {
        border-left: 1px solid var(--border-color);
        border-top: none;
        padding: 10px;
        width: 120px;
        flex-shrink: 0;
    }

    .card-header {
        padding: 10px;
        flex: 1;
        min-width: 0;
    }

    .card-title h3 {
        font-size: 16px;
    }
}


/* 视频列表视图新布局 */
.video-list-header-section {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    z-index: 1000;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.video-list-title {
    font-size: 20px;
    font-weight: bold;
    color: white;
    flex: 1;
    text-align: center;
    margin: 0;
}

.fixed-player {
    background-color: #000;
    height: 300px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.player-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
}

.player-prompt {
    margin-top: 15px;
    color: #999;
    font-size: 14px;
    text-align: center;
}

.video-list-header {
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.video-list-subtitle {
    font-size: 18px;
    font-weight: bold;
    color: black;
}

.video-list-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    min-height: 60px;
    cursor: pointer;
}

.video-list-item:hover {
    background-color: #e3f2fd;
}

.video-number {
    font-weight: bold;
    color: #333;
    min-width: 80px;
    font-size: 16px;
}

.video-title {
    flex: 1;
    font-size: 15px;
    color: #333;
    line-height: 1.4;
}

/* 视频列表视图整体布局 */
#video-list-view {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 100px;
}

.player-section {
    flex: 1;
    display: flex;
    gap: 30px;
    height: calc(100vh - 100px);
    margin-bottom: 0;
}

.player-left {
    flex: 2;
    min-width: 0;
    height: 100%;
    position: relative;
}

.fixed-player {
    background-color: #000;
    height: 100%;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-list-right {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-list-header {
    margin-bottom: 15px;
    padding-left: 10px;
    border-bottom: 1px solid #eee;
    background-color: #e3f2fd;
}

.video-list-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    overflow-y: auto;
    padding-left: 10px;
}

/* 视频列表项高亮 */
.video-list-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid var(--primary-color);
}

/* 返回按钮在标题区内的样式 */
.video-list-header-section .back-btn {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

.video-list-header-section .back-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 响应式布局 */


@media (max-width: 768px) {
    .player-section {
        flex-direction: column;
    }

    .player-left {
        max-width: 100%;
        height: 50vh;
    }

    .video-list-right {
        height: 50vh;
    }

    .video-list-header-section {
        height: 50px;
        padding: 0 10px;
    }

    .video-list-title {
        font-size: 16px;
    }

    #video-list-view {
        padding-top: 85px;
    }

    .player-section {
        height: calc(100vh - 85px);
    }
}


