:root {
    --bg-color: #0b0c15;
    --sidebar-bg: #151621;
    --card-bg: #1f2029;
    --text-color: #e1e1e6;
    --accent-color: #d4af37;
    --hover-color: #f1c40f;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'PingFang TC', 'Microsoft JhengHei', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }

img { max-width: 100%; display: block; }

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
    padding-bottom: 30px;
    border-bottom: 1px solid #2a2b36;
    margin-bottom: 20px;
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: block;
    padding: 15px 25px;
    color: #888;
    font-size: 16px;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.1);
    border-right: 3px solid var(--accent-color);
}

.search-box {
    padding: 20px;
    border-top: 1px solid #2a2b36;
}

.search-input {
    width: 100%;
    background: #000;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 4px;
    color: #fff;
}

/* Main Content */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 30px;
    width: calc(100% - 240px);
}

/* Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.m-item {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.m-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.poster-wrap {
    position: relative;
    padding-top: 140%;
    overflow: hidden;
}

.poster-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m-info {
    padding: 10px;
}

.m-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.m-meta {
    font-size: 12px;
    color: #666;
}

/* Section Header */
.sec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-color);
    padding-left: 15px;
}

.sec-title {
    font-size: 20px;
    font-weight: 600;
}

.more-btn {
    font-size: 12px;
    color: #666;
}

/* Player */
.player-box {
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.ep-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.ep-btn {
    background: var(--card-bg);
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.ep-btn:hover, .ep-btn.active {
    background: var(--accent-color);
    color: #000;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .mobile-header {
        display: flex; /* only on mobile */
        justify-content: space-between;
        padding: 15px;
        background: var(--sidebar-bg);
        margin: -15px -15px 15px -15px;
    }
}
@media (min-width: 769px) {
    .mobile-header { display: none; }
}
