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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-inner {
    max-width: 100%;
    margin: 0;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.nav-menu {
    display: none;
}

.expand-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.expand-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-expanded {
    display: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-expanded.active {
    display: block;
}

.expanded-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
}

.expanded-content a {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.expanded-content a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.nav-menu a {
    color: white;
    font-size: 14px;
    opacity: 0.95;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 15px;
    transition: all 0.3s;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 6px 12px;
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 150px;
    font-size: 13px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.user-section {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-size: 14px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    transition: all 0.3s;
}

.user-name:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-name .icon {
    font-size: 16px;
}

.logout-btn, .login-btn {
    color: white;
    font-size: 13px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    transition: all 0.3s;
}

.logout-btn:hover, .login-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

/* Main Container */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 15px 20px;
}

/* Section */
.section {
    margin-bottom: 30px;
}

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

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.more-link {
    color: #667eea;
    font-size: 13px;
}

.more-link:hover {
    color: #764ba2;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-poster {
    position: relative;
    width: 100%;
    padding-top: 140%;
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
    overflow: hidden;
}

.video-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-poster img[src*="no_pic"] {
    object-fit: contain;
    padding: 20%;
}

.video-poster .play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 15px solid #667eea;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 3px;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 12px;
}

/* Banner */
.banner {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 40px;
    position: relative;
}

.banner-slide {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: bold;
}

/* Footer */
.footer {
    background: #2d3748;
    color: #a0aec0;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #a0aec0;
}

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

.copyright {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav-menu {
        width: 100%;
        margin: 10px 0 0 0;
    }
    
    .search-box {
        width: 100%;
        justify-content: center;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .banner-slide {
        height: 250px;
        font-size: 24px;
    }
}

/* 分页样式 */
.paging-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.paging-info {
    color: #999;
    font-size: 14px;
}

.paging-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.paging-link,
.paging-current {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.paging-link {
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.paging-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.paging-current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
}

.paging-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* 自定义提示框样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #10b981;
    color: white;
}

.toast-error .toast-icon {
    background: #ef4444;
    color: white;
}

.toast-warning .toast-icon {
    background: #f59e0b;
    color: white;
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.toast-close {
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #667eea;
}

/* 响应式 */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* Banner Carousel */
.banner-section {
    margin-bottom: 25px;
}

.carousel-container {
    display: flex;
    gap: 15px;
}

.carousel-main {
    flex: 1.5;
    max-width: 100%;
    height: 260px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: white;
    padding: 18px 15px;
}

.carousel-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.carousel-desc {
    font-size: 13px;
    opacity: 0.95;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.carousel-nav {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: white;
    width: 25px;
    border-radius: 5px;
}

.carousel-sidebar {
    width: 350px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sidebar-item {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/10;
}

.sidebar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-item:hover img {
    transform: scale(1.05);
}

.sidebar-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 10px;
    font-size: 12px;
}

@media (max-width: 768px) {
    /* Header */
    .header-inner {
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .logo {
        font-size: 15px;
        flex: 0 0 auto;
    }
    
    .header-right {
        gap: 8px;
        flex: 1;
        justify-content: flex-end;
    }
    
    .search-box {
        padding: 4px 8px;
        flex: 0 1 auto;
        min-width: 80px;
    }
    
    .search-box input {
        width: 70px;
        font-size: 11px;
    }
    
    .search-box button {
        font-size: 14px;
        padding: 2px;
    }
    
    .user-section {
        flex: 0 0 auto;
    }
    
    .user-info {
        gap: 6px;
    }
    
    .user-name {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px;
    }
    
    .user-name .name {
        display: none;
    }
    
    .user-name .icon {
        display: block;
        font-size: 14px;
    }
    
    .logout-btn, .login-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .nav-menu {
        gap: 6px;
        padding: 6px 5px 15px 5px;
        order: 3;
        width: 100%;
        flex: 0 0 100%;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.4) transparent;
    }
    
    .nav-menu::-webkit-scrollbar {
        height: 4px;
    }
    
    .nav-menu::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .nav-menu::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.4);
        border-radius: 2px;
    }
    
    .nav-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(255,255,255,0.6);
    }
    
    .nav-menu a {
        font-size: 12px;
        padding: 5px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Main Container */
    .container {
        padding: 10px 15px;
    }
    
    /* Video Grid */
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
    
    .video-info {
        padding: 10px;
    }
    
    .video-title {
        font-size: 13px;
    }
    
    .video-meta {
        font-size: 11px;
    }
    
    /* Carousel */
    .carousel-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .carousel-main {
        max-width: 100%;
        height: 220px;
    }
    
    .carousel-title {
        font-size: 18px;
    }
    
    .carousel-desc {
        font-size: 13px;
    }
    
    .carousel-sidebar {
        width: 100%;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .sidebar-caption {
        padding: 8px;
        font-size: 11px;
    }
    
    /* Section */
    .section {
        margin-bottom: 25px;
    }
    
    .section-header {
        margin-bottom: 12px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .more-link {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Header */
    .header-inner {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .logo {
        font-size: 13px;
    }
    
    .header-right {
        gap: 6px;
    }
    
    .search-box {
        padding: 3px 6px;
        min-width: 70px;
    }
    
    .search-box input {
        width: 50px;
        font-size: 10px;
    }
    
    .search-box button {
        font-size: 12px;
    }
    
    .user-name {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .logout-btn, .login-btn {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .nav-menu {
        gap: 5px;
        padding: 5px 3px 8px 3px;
    }
    
    .nav-menu a {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Video Grid */
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .video-info {
        padding: 8px;
    }
    
    .video-title {
        font-size: 12px;
    }
    
    .video-meta {
        font-size: 10px;
    }
    
    /* Carousel */
    .carousel-main {
        height: 200px;
    }
    
    .carousel-sidebar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Main Container */
    .container {
        padding: 8px 10px;
    }
}

/* Category Modal */
.category-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.category-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 900px;
    margin: 50px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 100px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    padding: 16px 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

.category-home {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
}

.category-home:hover {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
}

.category-icon {
    font-size: 24px;
}

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

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px 15px;
        max-height: calc(100vh - 40px);
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 16px 18px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 18px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
    
    .category-item {
        padding: 14px 10px;
        font-size: 13px;
    }
    
    .category-icon {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 10px;
        border-radius: 10px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
        gap: 8px;
    }
    
    .category-item {
        padding: 12px 8px;
        font-size: 12px;
    }
}
