@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #6d28d9;
    --secondary-color: #8b5cf6;
    --background-color: #121212;
    --glass-background: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #e2e8f0;
    --text-secondary: #94a3b8;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

/* 3D背景 */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 毛玻璃 */
.glass {
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* 主内容区 */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* 标题区 */
.title-section {
    text-align: center;
    padding: 40px 0 20px;
}

.graduation-title {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff5e7d, #ffcb57, #36cfc9, #722ed1, #ff80ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
}

.graduation-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 12px;
    letter-spacing: 4px;
}

/* 视频区 */
.video-section {
    width: 100%;
    border-radius: 16px;
    padding: 20px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* 弹幕层 */
.danmaku-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    animation: danmaku-scroll linear forwards;
    will-change: transform;
}

@keyframes danmaku-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-100vw - 300px));
    }
}

/* 弹幕输入区 */
.danmaku-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.danmaku-input {
    flex: 1;
    min-width: 200px;
    border-radius: 24px;
    padding: 10px 18px;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 14px;
    transition: box-shadow 0.3s;
}

.danmaku-input:focus {
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.danmaku-input::placeholder {
    color: var(--text-secondary);
}

.danmaku-color-picker {
    display: flex;
    gap: 6px;
    align-items: center;
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.color-dot:hover {
    transform: scale(1.2);
}

.color-dot.active {
    transform: scale(1.25);
    border-color: #fff;
    box-shadow: 0 0 8px currentColor;
}

.danmaku-send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.danmaku-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.5);
}

.danmaku-send-btn:active {
    transform: translateY(0);
}

/* 选集区 */
.episode-section {
    width: 100%;
    border-radius: 16px;
    padding: 20px;
}

.episode-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 14px;
}

.episode-list {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.episode-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 14px 24px;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.episode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.episode-btn.active {
    border-color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

.episode-btn i {
    font-size: 20px;
    color: var(--secondary-color);
}

/* 简介区 */
.description-section {
    width: 100%;
    border-radius: 16px;
    padding: 20px;
}

.description-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 14px;
}

.description-content {
    color: var(--text-secondary);
    line-height: 1.8;
    min-height: 60px;
}

/* 返回链接 */
.back-section {
    padding: 20px 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--secondary-color);
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

.toast:not(.hidden) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 烟花容器 */
#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.firework-particle-wrap {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: firework-burst 1.8s ease-out forwards;
}

@keyframes firework-burst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    60% {
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .graduation-title {
        font-size: 2rem;
    }

    .graduation-subtitle {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .main-content {
        padding: 40px 12px 30px;
        gap: 24px;
    }

    .danmaku-input-area {
        gap: 8px;
    }

    .danmaku-input {
        min-width: 140px;
        font-size: 13px;
    }

    .danmaku-color-picker {
        gap: 4px;
    }

    .color-dot {
        width: 18px;
        height: 18px;
    }

    .danmaku-send-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .danmaku-item {
        font-size: 14px;
    }

    .episode-list {
        gap: 10px;
    }

    .episode-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* 投票弹窗 */
.vote-modal {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vote-modal.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.vote-modal:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.vote-content {
    position: relative;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 14px;
    min-width: 240px;
    max-width: 280px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.vote-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.vote-close-btn:hover {
    color: #fff;
}

.vote-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
    text-align: center;
}

.vote-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vote-option {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-option:hover {
    background: rgba(139, 92, 246, 0.3);
}

.vote-option.selected {
    background: linear-gradient(135deg, #1890ff, #722ed1);
}

.vote-text {
    flex: 1;
    text-align: left;
}

.vote-percentage {
    font-size: 14px;
    font-weight: 700;
    min-width: 48px;
    text-align: right;
    opacity: 0;
    transition: opacity 0.3s;
}

.vote-option.selected .vote-percentage,
.vote-option:not(.vote-selectable) .vote-percentage {
    opacity: 1;
}

.vote-option.vote-selectable .vote-percentage {
    opacity: 0;
}

.vote-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #999;
}

.vote-divider {
    color: rgba(255, 255, 255, 0.3);
}
