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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #eee;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    min-height: 70px;
}

.logo h1 {
    font-size: 28px;
    font-weight: bold;
    color: #e74c3c;
    margin: 0;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
}

.nav-list a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 10px 0;
    position: relative;
}

.nav-list a:hover,
.nav-list a:focus {
    color: #e74c3c;
    outline: none;
}

.nav-list a:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #e74c3c;
}

.search-box {
    display: flex;
    position: relative;
}

.search-box input {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px 0 0 25px;
    outline: none;
    width: 250px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    border-color: #e74c3c;
}

.search-box button {
    padding: 12px 25px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.search-box button:hover,
.search-box button:focus {
    background: #c0392b;
    outline: none;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    background: none;
    border: none;
    padding: 10px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: 0.3s ease;
    border-radius: 2px;
}

.breadcrumb {
    background: #f1f2f6;
    padding: 10px 0;
    border-bottom: 1px solid #e1e5e9;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 10px;
    align-items: center;
    margin: 0;
    font-size: 14px;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '>';
    margin-left: 10px;
    color: #666;
}

.breadcrumb-list a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-list a:hover {
    color: #e74c3c;
}

.breadcrumb-list span {
    color: #333;
    font-weight: 500;
}

.main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.movie-detail {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.movie-info {
    display: flex;
    gap: 40px;
    margin-bottom: 50px;
}

.movie-poster {
    flex-shrink: 0;
}

.movie-poster img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.movie-poster img:hover {
    transform: scale(1.02);
}

.movie-content {
    flex: 1;
}

.movie-content h1 {
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 25px;
    font-weight: 700;
    line-height: 1.2;
}

.movie-meta p {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.5;
}

.movie-meta strong {
    color: #e74c3c;
    min-width: 80px;
    display: inline-block;
    font-weight: 600;
}

.movie-meta span {
    margin-right: 8px;
}

.play-btn {
    margin-top: 35px;
}

.btn-primary {
    display: inline-block;
    padding: 18px 40px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
    outline: none;
}

.player-section,
.movie-description {
    margin-bottom: 50px;
}

.player-section h2,
.movie-description h2,
.recommend-section h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 25px;
    border-left: 5px solid #e74c3c;
    padding-left: 20px;
    font-weight: 600;
}

.movie-description p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
    color: #555;
    text-align: justify;
}

.player-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 25px;
    background: #ecf0f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.tab-btn:hover,
.tab-btn:focus {
    background: #d5dbdb;
    outline: none;
}

.tab-btn.active {
    background: #e74c3c;
    color: white;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.tab-content {
    display: none;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.tab-content.active {
    display: block;
}

.episode-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    margin: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.episode-btn:hover,
.episode-btn:focus {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    outline: none;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.movie-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.movie-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.movie-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

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

.movie-item-content {
    padding: 20px;
}

.movie-item h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.movie-item p {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
}

.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

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

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
}

.footer-links a:hover,
.footer-links a:focus {
    color: white;
    outline: none;
}

.footer-text {
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
    line-height: 1.6;
}

.footer-text a {
    color: #e74c3c;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-text a:hover {
    color: #c0392b;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 20px;
    font-weight: bold;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover,
.back-to-top:focus {
    background: #c0392b;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
    outline: none;
}

@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .movie-detail {
        padding: 30px 25px;
    }
    
    .movie-info {
        gap: 30px;
    }
    
    .movie-content h1 {
        font-size: 30px;
    }

    .search-box input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .nav, .search-box {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav.mobile-active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        z-index: 999;
    }

    .nav.mobile-active .nav-list {
        flex-direction: column;
        gap: 15px;
    }

    .header-content {
        padding: 10px 0;
    }

    .movie-info {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }

    .movie-poster {
        align-self: center;
    }

    .movie-poster img {
        max-width: 250px;
    }

    .movie-content h1 {
        font-size: 24px;
    }

    .movie-meta p {
        font-size: 14px;
    }

    .movie-detail {
        padding: 25px 20px;
    }

    .container {
        padding: 0 15px;
    }

    .player-tabs {
        justify-content: center;
    }

    .tab-btn {
        flex: 1;
        min-width: 100px;
        font-size: 13px;
        padding: 10px 15px;
    }

    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }

    .movie-item img {
        height: 250px;
    }

    .movie-item-content {
        padding: 15px;
    }

    .footer-links {
        justify-content: center;
        text-align: center;
        gap: 20px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .breadcrumb-list {
        font-size: 13px;
        flex-wrap: wrap;
    }

    .player-section h2,
    .movie-description h2,
    .recommend-section h2 {
        font-size: 22px;
    }

    .btn-primary {
        padding: 15px 30px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 22px;
    }

    .movie-content h1 {
        font-size: 20px;
    }

    .movie-meta {
        font-size: 13px;
    }

    .movie-meta p {
        font-size: 13px;
    }

    .btn-primary {
        padding: 12px 25px;
        font-size: 14px;
    }

    .player-section h2,
    .movie-description h2,
    .recommend-section h2 {
        font-size: 18px;
        padding-left: 15px;
    }

    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .movie-item img {
        height: 220px;
    }

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

    .movie-item p {
        font-size: 12px;
    }

    .tab-content {
        padding: 20px 15px;
    }

    .episode-btn {
        padding: 8px 15px;
        font-size: 13px;
        margin: 5px;
    }

    .movie-description p {
        font-size: 14px;
        line-height: 1.6;
    }

    .footer {
        padding: 30px 0;
    }

    .footer-links {
        gap: 15px;
        font-size: 13px;
    }

    .footer-text {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }

    .movie-detail {
        padding: 20px 15px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .movie-content h1 {
        font-size: 18px;
    }

    .movie-grid {
        gap: 12px;
    }

    .movie-item img {
        height: 200px;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .movie-content h1 {
        font-size: 40px;
    }

    .search-box input {
        width: 300px;
    }
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

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

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
