* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

/* 顶部导航条 */
.navbar {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #e94560, #c23a51);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(233, 69, 96, 0.2);
    color: #fff;
}

.nav-link.active {
    background: rgba(233, 69, 96, 0.3);
    color: #e94560;
}

.main-content {
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1100px;
}

.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    color: #e94560;
    font-size: 2.2rem;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    margin-bottom: 8px;
}

.header p {
    color: #a0a0a0;
    font-size: 0.95rem;
}

.input-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 280px;
}

.input-wrapper label {
    display: block;
    color: #e0e0e0;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

.input-wrapper input::placeholder {
    color: #666;
}

.btn-play {
    padding: 12px 35px;
    background: linear-gradient(135deg, #e94560, #c23a51);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
    white-space: nowrap;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
}

.btn-play:active {
    transform: translateY(0);
}

.player-section {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.size-label {
    color: #888;
    font-size: 0.8rem;
    margin-right: 4px;
}

.size-btn {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #aaa;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.size-btn.active {
    background: rgba(233, 69, 96, 0.3);
    border-color: rgba(233, 69, 96, 0.5);
    color: #e94560;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.now-playing {
    color: #888;
    font-size: 0.75rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-wrapper {
    display: flex;
    gap: 0;
    transition: all 0.3s ease;
}

.player-wrapper.size-small #playerFrame,
.player-wrapper.size-small .placeholder {
    height: 400px;
}

.player-wrapper.size-large .episode-sidebar {
    display: none;
}

.player-wrapper.size-large .player-main {
    width: 100%;
}

.player-wrapper.size-large #playerFrame,
.player-wrapper.size-large .placeholder {
    height: 600px;
}

.player-wrapper.size-full {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: #000;
}

.player-wrapper.size-full .player-main {
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-wrapper.size-full #playerFrame,
.player-wrapper.size-full .placeholder {
    height: 100%;
    max-height: none;
}

.player-wrapper.size-full .episode-sidebar {
    display: none;
}

/* 全屏模式下的工具栏 */
.player-section.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: #000;
    border-radius: 0;
}

.player-section.fullscreen-mode .player-toolbar {
    background: rgba(0, 0, 0, 0.8);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.player-section.fullscreen-mode .player-wrapper {
    height: 100%;
    padding-top: 46px;
}

.player-section.fullscreen-mode .player-wrapper.size-full {
    position: static;
    padding-top: 0;
}

.player-section.fullscreen-mode .player-main {
    height: 100%;
}

.player-section.fullscreen-mode #playerFrame,
.player-section.fullscreen-mode .placeholder {
    height: 100%;
}

.player-section.fullscreen-mode .episode-sidebar {
    display: none;
}

.player-main {
    flex: 1;
    min-width: 0;
}

#playerFrame {
    width: 100%;
    height: 550px;
    border: none;
    display: block;
    background: #000;
}

.placeholder {
    width: 100%;
    height: 550px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
}

.placeholder svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder p {
    font-size: 1.1rem;
}

/* 剧集列表侧边栏 */
.episode-sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.episode-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.episode-title {
    color: #e94560;
    font-size: 0.9rem;
    font-weight: 600;
}

.episode-actions {
    display: flex;
    gap: 6px;
}

.episode-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #aaa;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.episode-btn:hover {
    background: rgba(233, 69, 96, 0.3);
    color: #fff;
}

.episode-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.episode-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 10px;
}

.episode-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.episode-item.active {
    background: rgba(233, 69, 96, 0.3);
    border: 1px solid rgba(233, 69, 96, 0.5);
}

.episode-num {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.episode-item.active .episode-num {
    background: #e94560;
    color: #fff;
}

.episode-info {
    flex: 1;
    min-width: 0;
}

.episode-name {
    color: #ccc;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-item.active .episode-name {
    color: #fff;
}

.episode-item-btns {
    display: none;
    gap: 4px;
}

.episode-item:hover .episode-item-btns {
    display: flex;
}

.episode-item .ep-edit,
.episode-item .ep-del {
    padding: 2px 6px;
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 3px;
    color: #888;
    font-size: 0.65rem;
    cursor: pointer;
}

.episode-item .ep-del:hover {
    background: rgba(239, 68, 68, 0.5);
    color: #fff;
}

.episode-item .ep-edit:hover {
    background: rgba(233, 69, 96, 0.5);
    color: #fff;
}

.episode-empty {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

.episode-empty p {
    margin-bottom: 10px;
}

.episode-empty .add-btn {
    padding: 8px 16px;
    background: rgba(233, 69, 96, 0.3);
    border: 1px solid rgba(233, 69, 96, 0.5);
    border-radius: 6px;
    color: #e94560;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.episode-empty .add-btn:hover {
    background: rgba(233, 69, 96, 0.5);
    color: #fff;
}

.tips {
    margin-top: 20px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tips h3 {
    color: #e94560;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.tips ul {
    list-style: none;
    color: #888;
    font-size: 0.85rem;
    line-height: 1.9;
}

.tips li::before {
    content: "•";
    color: #e94560;
    margin-right: 8px;
}

.status {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: none;
}

.status.loading {
    display: block;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.status.success {
    display: block;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.history {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    display: none;
}

.history.show {
    display: block;
}

.history-title {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #aaa;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 250px;
}

.history-item:hover {
    background: rgba(233, 69, 96, 0.3);
    color: #fff;
}

.history-item .item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item .item-btns {
    display: none;
    flex-shrink: 0;
    gap: 4px;
}

.history-item:hover .item-btns {
    display: flex;
}

.history-item .edit-btn,
.history-item .delete-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
}

.history-item .delete-btn {
    background: rgba(239, 68, 68, 0.6);
}

.history-item .edit-btn:hover {
    background: rgba(233, 69, 96, 0.8);
}

.history-item .delete-btn:hover {
    background: rgba(239, 68, 68, 0.9);
}

/* 标题编辑弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-title {
    color: #e94560;
    font-size: 1rem;
    margin-bottom: 15px;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.modal-input:focus {
    outline: none;
    border-color: #e94560;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-cancel {
    background: rgba(255,255,255,0.1);
    color: #aaa;
}

.modal-btn-cancel:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.modal-btn-save {
    background: #e94560;
    color: #fff;
}

.modal-btn-save:hover {
    background: #c23a51;
}

/* 平台链接区域 */
.platform-links {
    margin-top: 20px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.platform-title {
    color: #e94560;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.platform-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.platform-item:hover {
    background: rgba(233, 69, 96, 0.2);
    color: #fff;
    transform: translateY(-2px);
}

.platform-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
}

.platform-icon.qq { background: #FF6A00; color: #fff; }
.platform-icon.iqiyi { background: #00BE06; color: #fff; }
.platform-icon.youku { background: #1A9BFF; color: #fff; }
.platform-icon.mgtv { background: #FF7F00; color: #fff; }
.platform-icon.bilibili { background: #FB7299; color: #fff; }
.platform-icon.sohu { background: #FF6600; color: #fff; }
.platform-icon.pptv { background: #00A0E9; color: #fff; }
.platform-icon.m1905 { background: #D81E06; color: #fff; }

@media (max-width: 900px) {
    .player-toolbar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .toolbar-right {
        width: 100%;
    }

    .now-playing {
        max-width: 100%;
    }

    .player-wrapper {
        flex-direction: column;
    }

    .episode-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 250px;
    }

    .episode-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }

    .episode-item {
        width: calc(25% - 6px);
        min-width: 60px;
        padding: 8px;
        justify-content: center;
    }

    .episode-num {
        margin: 0 auto;
    }

    .episode-name {
        display: none;
    }

    .episode-item-btns {
        display: none !important;
    }

    .player-wrapper.size-small #playerFrame,
    .player-wrapper.size-small .placeholder {
        height: 250px;
    }

    .player-wrapper.size-medium #playerFrame,
    .player-wrapper.size-medium .placeholder {
        height: 350px;
    }

    .player-wrapper.size-large #playerFrame,
    .player-wrapper.size-large .placeholder {
        height: 450px;
    }
}

@media (max-width: 600px) {
    .navbar-inner {
        padding: 0 15px;
        height: 50px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-play {
        width: 100%;
    }

    #playerFrame, .placeholder {
        height: 280px;
    }

    .episode-item {
        width: calc(20% - 7px);
    }

    .size-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .size-label {
        font-size: 0.75rem;
    }
}
