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

:root {
    --primary-color: #ff0000;
    --secondary-color: #282828;
    --success-color: #00a651;
    --background-color: #f9f9f9;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    margin: -20px -20px 0 -20px;
    padding: 40px 20px;
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 700;
    color: white;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.95;
    color: white;
}

/* 标签页样式 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
}

.tab-btn i {
    margin-right: 8px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 0, 0, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(255, 0, 0, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

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

main {
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow);
    margin: 0 -20px;
    padding: 30px 40px;
}

section {
    margin-bottom: 40px;
}

h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.video-input {
    flex: 2;
    min-width: 300px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

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

.time-input {
    flex: 0 0 150px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

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

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

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.video-item {
    display: flex;
    flex-direction: column;
    background: var(--background-color);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 15px;
    transition: all 0.3s;
}

.video-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.video-preview {
    position: relative;
    width: 100%;
}

.remove-video-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #00bcd4;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.remove-video-btn:hover {
    background: #0097a7;
    transform: scale(1.1);
}

.remove-video-btn i {
    pointer-events: none;
}

.youtube-player {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.time-input-wrapper {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9em;
    width: 100%;
}

.time-input-wrapper label {
    color: #666;
    font-weight: 500;
}

.time-input-wrapper span {
    color: #666;
    font-weight: 500;
}

.time-input-wrapper input.time-input {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}

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

.time-input-wrapper span {
    color: #666;
}

/* 直播标记样式 */
.live-badge {
    margin-top: 10px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    text-align: center;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.live-badge i {
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 2px 15px rgba(255, 0, 0, 0.6);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.action-section {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 20px 0;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-card {
    padding: 20px;
    background: var(--background-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.info-card p {
    margin-top: 10px;
    color: #666;
}

footer {
    text-align: center;
    padding: 20px 0;
    margin: 0 -20px -20px -20px;
    color: #999;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

.footer-links {
    margin-top: 10px;
    font-size: 0.85em;
}

.logout-link {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.logout-link:hover {
    color: #ff4444;
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.link-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.link-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
}

/* Watch Page Styles */
.watch-page {
    background-color: #181818;
    color: white;
}

.watch-container {
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.watch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
}

.watch-header h1 {
    font-size: 1.8em;
    color: white;
}

.controls-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background-color: #202020;
    border-bottom: 1px solid #333;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.volume-control label {
    color: white;
}

.volume-control input[type="range"] {
    width: 150px;
}

#volumeValue {
    color: white;
    min-width: 45px;
}

.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 15px;
    padding: 20px;
    overflow-y: auto;
}

.video-grid.single {
    grid-template-columns: 1fr;
}

.video-grid.two {
    grid-template-columns: repeat(2, 1fr);
}

.video-wrapper {
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.loading-message {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.2em;
}

.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #202020;
    border-top: 1px solid #333;
}

#syncStatus {
    color: #0f0;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1200px) and (min-width: 769px) {
    .video-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .input-group {
        flex-direction: column;
    }

    .video-input,
    .time-input {
        width: 100%;
        min-width: auto;
    }

    .video-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .video-item {
        padding: 12px;
    }

    .youtube-player {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .action-section {
        flex-direction: column;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .controls-bar {
        flex-wrap: wrap;
    }

    .volume-control {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }
}

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

.video-item {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
