body.dark {
    background: #181818;
    color: #eee;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
}
.container {
    max-width: 960px;
    margin: 30px auto;
    background: #232323;
    border-radius: 12px;
    box-shadow: 0 2px 16px #000a;
    padding: 24px;
}
header, footer {
    text-align: center;
    margin-bottom: 16px;
}
.subtitle {
    color: #aaa;
    font-weight: normal;
    margin-top: -10px;
    margin-bottom: 18px;
    font-size: 1.2em;
    letter-spacing: 1px;
}
.video-area {
    position: relative;
    margin-bottom: 32px;
}
.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    min-height: 320px;
    max-height: 70vh;
}
.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    background: #000;
}
#danmu-layer {
    pointer-events: none;
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    z-index: 10;
    overflow: hidden;
}
#danmu-form {
    display: flex;
    margin-top: 8px;
}
#danmu-input {
    flex: 1;
    padding: 8px;
    border-radius: 6px 0 0 6px;
    border: none;
    background: #222;
    color: #fff;
}
#danmu-form button {
    border: none;
    background: #444;
    color: #fff;
    padding: 8px 18px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}
.comments-section {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
}
#comments-list {
    min-height: 80px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 270px; /* 保持最大高度，超出时滚动 */
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
#comments-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}
#comment-form {
    display: flex;
}
#comment-input {
    flex: 1;
    padding: 8px;
    border-radius: 6px 0 0 6px;
    border: none;
    background: #222;
    color: #fff;
}
#comment-form button {
    border: none;
    background: #444;
    color: #fff;
    padding: 8px 18px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}
.danmu-item {
    position: absolute;
    white-space: nowrap;
    color: #fff;
    font-size: 20px;
    text-shadow: 1px 1px 2px #000, 0 0 4px #fff;
    pointer-events: none;
    opacity: 0.92;
    animation: danmu-move 8s linear forwards;
}
@keyframes danmu-move {
    from { left: 100%; }
    to { left: -100%; }
}
.comment {
    padding: 0;
    border: none;
    background: none;
}
.comment:last-child {
    border-bottom: none;
}

/* 评论气泡样式，竖直排列 */
.comment-bubble {
    display: block;
    background: #282c34;
    color: #fff;
    border-radius: 18px;
    padding: 8px 18px;
    border: 1px solid #333;
    box-shadow: 0 2px 8px #0003;
    font-size: 1em;
    max-width: 80%;
    word-break: break-all;
    position: relative;
    margin: 0 auto 0 0;
}
/* 删除气泡尾巴 */
.comment-bubble:before {
    display: none;
}

/* 弹窗样式 */
.popup-mask {
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    /* 动画淡入 */
    animation: popup-mask-fadein 0.3s;
}
@keyframes popup-mask-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}
.popup-content {
    background: #232323;
    color: #fff;
    padding: 32px 28px 24px 28px;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 4px 32px #000a;
    font-size: 1.1em;
    position: relative;
    overflow-y: auto;
    /* 弹窗缩放+淡入动画 */
    animation: popup-content-zoom 0.35s cubic-bezier(.4,1.6,.6,1) both;
}
@keyframes popup-content-zoom {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 600px) {
    .container {
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
        padding: 8px 2vw 16px 2vw;
        box-shadow: none;
    }
    header, footer {
        margin-bottom: 10px;
    }
    .subtitle {
        font-size: 1em;
        margin-bottom: 10px;
    }
    .video-wrapper {
        min-height: 180px;
        aspect-ratio: 16/9;
        max-height: 40vh;
        border-radius: 6px;
    }
    #danmu-form, #comment-form {
        flex-direction: column;
        gap: 6px;
    }
    #danmu-input, #comment-input {
        border-radius: 6px;
        margin-bottom: 0;
        font-size: 1em;
    }
    #danmu-form button, #comment-form button {
        border-radius: 6px;
        padding: 10px 0;
        font-size: 1em;
        margin-left: 0;
    }
    .comments-section {
        padding: 10px;
        border-radius: 6px;
    }
    #comments-list {
        max-height: 180px;
        font-size: 0.98em;
    }
    .comment-bubble {
        font-size: 0.98em;
        padding: 7px 12px;
        border-radius: 14px;
        max-width: 98%;
    }
    .auth-btns {
        top: 8px;
        right: 8px;
    }
    .auth-btns button {
        padding: 6px 10px;
        font-size: 0.98em;
    }
    .auth-modal {
        width: 96vw;
        min-height: 260px;
        padding: 0;
        border-radius: 10px;
    }
    .auth-form {
        padding: 24px 10px 18px 10px;
        min-height: 260px;
    }
    .popup-content {
        padding: 18px 8px 14px 8px;
        font-size: 1em;
        border-radius: 8px;
        max-width: 98vw;
    }
    .admin-form {
        padding: 12px 4vw 8px 4vw;
        border-radius: 8px;
        max-width: 100vw;
    }
    .admin-form input[type="text"], .admin-form textarea {
        font-size: 1em;
        padding: 7px;
        border-radius: 6px;
    }
    .admin-form button {
        padding: 10px 0;
        font-size: 1em;
        border-radius: 6px;
    }
    .admin-table th, .admin-table td {
        padding: 6px 2px;
        font-size: 0.95em;
    }
}

/* 禁止用户双指缩放和双击缩放 */
html, body {
    touch-action: manipulation;
    overscroll-behavior: none;
}
