/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    position: relative;
}

/* 手机端背景 */
@media (max-width: 768px) {
    body {
        background: url('22.jpg') no-repeat center center fixed;
        background-size: cover;
    }
}

/* 电脑端背景 */
@media (min-width: 769px) {
    body {
        background: url('11.jpg') no-repeat center center fixed;
        background-size: cover;
    }
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    z-index: -1;
}

/* 弹幕容器 */
.danmaku-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* 弹幕显示区域 */
.danmaku-area {
    position: fixed;
    top: 100px;
    left: 0;
    width: 100%;
    height: calc(100vh - 200px);
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

/* 弹幕样式 */
.danmaku {
    position: absolute;
    left: 100vw;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    animation: danmakuMove linear forwards;
    pointer-events: auto;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.danmaku:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.8);
    animation-play-state: paused;
}

.danmaku {
    animation-play-state: running;
}

.danmaku-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #667eea;
    object-fit: cover;
}

.danmaku-author {
    font-weight: 600;
    color: #667eea;
    margin-right: 10px;
}

.danmaku-content {
    color: white;
}

/* 弹幕动画 */
@keyframes danmakuMove {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-200vw);
    }
}

/* 弹幕输入框 */
.danmaku-input-container {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.danmaku-input-container input {
    width: 400px;
    padding: 12px 20px;
    border: 2px dashed rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    background: transparent;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.danmaku-input-container input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.danmaku-input-container input:focus {
    outline: none;
    border-color: #667eea;
    border-style: solid;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

#sendButton {
    padding: 12px 25px;
    border: 2px dashed rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#sendButton:hover {
    transform: translateY(-2px);
    border-color: #667eea;
    border-style: solid;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

#sendButton:active {
    transform: translateY(0);
}

/* 用户控制区 */
.user-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.login-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.skin-btn,
.code-btn,
.logout-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: 10px;
}

.skin-btn:hover,
.code-btn:hover,
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.user-points {
    color: #ffd700;
    font-weight: 600;
    margin-left: 10px;
    font-size: 14px;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #667eea;
    object-fit: cover;
}

.username {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.logout-btn {
    padding: 5px 15px;
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.close:hover {
    color: #667eea;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 25px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.modal-toggle {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.modal-toggle a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.modal-toggle a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .danmaku-input-container input {
        width: 300px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .danmaku-input-container input {
        width: 250px;
    }
    
    .danmaku {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .danmaku-avatar {
        width: 25px;
        height: 25px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* 皮肤选择样式 */
.skin-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-top: 40px;
}

.skin-option {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.skin-option:hover {
    transform: translateY(-3px);
}

.skin-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 25px;
    margin-bottom: 12px;
    white-space: nowrap;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.skin-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.skin-author {
    font-weight: 600;
    margin-right: 8px;
}

.skin-content {
    font-weight: 400;
}

.skin-option p {
    margin: 0;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* 模态框样式调整 */
#skinModal .modal-content {
    background: rgba(30, 30, 40, 0.95);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

#skinModal h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 0;
    font-size: 20px;
    font-weight: 600;
}

/* 默认皮肤 */
.default-skin {
    background: rgba(0, 0, 0, 0.8);
}

.default-skin .skin-icon {
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.default-skin .skin-author {
    color: #667eea;
}

.default-skin .skin-content {
    color: white;
}

/* 彩色皮肤 */
.colorful-skin {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.8), rgba(78, 205, 196, 0.8));
}

.colorful-skin .skin-icon {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.colorful-skin .skin-author {
    color: white;
}

.colorful-skin .skin-content {
    color: white;
}

/* 浅色皮肤 */
.light-skin {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 200, 200, 0.3);
}

.light-skin .skin-icon {
    background: rgba(79, 172, 254, 0.3);
    color: #4facfe;
}

.light-skin .skin-author {
    color: #4facfe;
}

.light-skin .skin-content {
    color: #333;
}

/* 霓虹皮肤 */
.neon-skin {
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 10px #00f2fe, 0 0 20px #00f2fe;
}

.neon-skin .skin-icon {
    background: rgba(0, 242, 254, 0.3);
    color: #00f2fe;
    box-shadow: 0 0 5px #00f2fe;
}

.neon-skin .skin-author {
    color: #00f2fe;
    text-shadow: 0 0 5px #00f2fe;
}

.neon-skin .skin-content {
    color: white;
    text-shadow: 0 0 5px #00f2fe;
}

/* 银河星空皮肤 */
.galaxy-skin {
    background: linear-gradient(135deg, rgba(10, 10, 30, 0.9), rgba(30, 10, 50, 0.9));
    box-shadow: 0 0 10px rgba(100, 100, 255, 0.5), 0 0 20px rgba(100, 100, 255, 0.3);
}

.galaxy-skin .skin-icon {
    background: rgba(100, 100, 255, 0.3);
    color: #8888ff;
    box-shadow: 0 0 5px #8888ff;
}

.galaxy-skin .skin-author {
    color: #8888ff;
    text-shadow: 0 0 5px #8888ff;
}

.galaxy-skin .skin-content {
    color: white;
    text-shadow: 0 0 5px #8888ff;
}

/* 烈火燎原皮肤 */
.fire-skin {
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.9), rgba(255, 50, 0, 0.9));
    box-shadow: 0 0 10px rgba(255, 100, 0, 0.7), 0 0 20px rgba(255, 50, 0, 0.5);
}

.fire-skin .skin-icon {
    background: rgba(255, 255, 255, 0.3);
    color: #ff6600;
    box-shadow: 0 0 5px #ff6600;
}

.fire-skin .skin-author {
    color: #ffcc00;
    text-shadow: 0 0 5px #ff6600;
}

.fire-skin .skin-content {
    color: white;
    text-shadow: 0 0 5px #ff6600;
}

/* 水晶梦境皮肤 */
.crystal-skin {
    background: linear-gradient(135deg, rgba(170, 210, 255, 0.9), rgba(200, 220, 255, 0.9));
    box-shadow: 0 0 10px rgba(170, 210, 255, 0.7), 0 0 20px rgba(200, 220, 255, 0.5);
}

.crystal-skin .skin-icon {
    background: rgba(255, 255, 255, 0.5);
    color: #4da6ff;
    box-shadow: 0 0 5px #4da6ff;
}

.crystal-skin .skin-author {
    color: #4da6ff;
    text-shadow: 0 0 5px #4da6ff;
}

.crystal-skin .skin-content {
    color: #333;
    text-shadow: 0 0 5px #4da6ff;
}

/* 彩虹天堂皮肤 */
.rainbow-skin {
    background: linear-gradient(90deg, 
        rgba(255, 0, 0, 0.8), 
        rgba(255, 165, 0, 0.8), 
        rgba(255, 255, 0, 0.8), 
        rgba(0, 128, 0, 0.8), 
        rgba(0, 0, 255, 0.8), 
        rgba(75, 0, 130, 0.8), 
        rgba(238, 130, 238, 0.8)
    );
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(255, 255, 255, 0.5);
}

.rainbow-skin .skin-icon {
    background: rgba(255, 255, 255, 0.5);
    color: #ff00ff;
    box-shadow: 0 0 5px #ff00ff;
}

.rainbow-skin .skin-author {
    color: white;
    text-shadow: 0 0 5px #ff00ff;
}

.rainbow-skin .skin-content {
    color: white;
    text-shadow: 0 0 5px #ff00ff;
}

/* 皮肤应用样式 */
.danmaku.skin-colorful {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.8), rgba(78, 205, 196, 0.8));
}

.danmaku.skin-colorful .danmaku-avatar {
    border-color: white;
    background: rgba(255, 255, 255, 0.3);
}

.danmaku.skin-colorful .danmaku-author {
    color: #fff;
    font-weight: bold;
}

.danmaku.skin-colorful .danmaku-content {
    color: #fff;
}

.danmaku.skin-light {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 200, 200, 0.3);
}

.danmaku.skin-light .danmaku-avatar {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.3);
}

.danmaku.skin-light .danmaku-author {
    color: #4facfe;
}

.danmaku.skin-light .danmaku-content {
    color: #333;
}

.danmaku.skin-neon {
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 10px #00f2fe, 0 0 20px #00f2fe;
}

.danmaku.skin-neon .danmaku-avatar {
    border-color: #00f2fe;
    box-shadow: 0 0 5px #00f2fe;
    background: rgba(0, 242, 254, 0.3);
}

.danmaku.skin-neon .danmaku-author {
    color: #00f2fe;
    text-shadow: 0 0 5px #00f2fe;
}

.danmaku.skin-neon .danmaku-content {
    color: #fff;
    text-shadow: 0 0 5px #00f2fe;
}

/* 银河星空皮肤应用 */
.danmaku.skin-galaxy {
    background: linear-gradient(135deg, rgba(10, 10, 30, 0.9), rgba(30, 10, 50, 0.9));
    box-shadow: 0 0 10px rgba(100, 100, 255, 0.5), 0 0 20px rgba(100, 100, 255, 0.3);
}

.danmaku.skin-galaxy .danmaku-avatar {
    border-color: #8888ff;
    box-shadow: 0 0 5px #8888ff;
    background: rgba(100, 100, 255, 0.3);
}

.danmaku.skin-galaxy .danmaku-author {
    color: #8888ff;
    text-shadow: 0 0 5px #8888ff;
}

.danmaku.skin-galaxy .danmaku-content {
    color: white;
    text-shadow: 0 0 5px #8888ff;
}

/* 烈火燎原皮肤应用 */
.danmaku.skin-fire {
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.9), rgba(255, 50, 0, 0.9));
    box-shadow: 0 0 10px rgba(255, 100, 0, 0.7), 0 0 20px rgba(255, 50, 0, 0.5);
}

.danmaku.skin-fire .danmaku-avatar {
    border-color: #ff6600;
    box-shadow: 0 0 5px #ff6600;
    background: rgba(255, 255, 255, 0.3);
}

.danmaku.skin-fire .danmaku-author {
    color: #ffcc00;
    text-shadow: 0 0 5px #ff6600;
}

.danmaku.skin-fire .danmaku-content {
    color: white;
    text-shadow: 0 0 5px #ff6600;
}

/* 水晶梦境皮肤应用 */
.danmaku.skin-crystal {
    background: linear-gradient(135deg, rgba(170, 210, 255, 0.9), rgba(200, 220, 255, 0.9));
    box-shadow: 0 0 10px rgba(170, 210, 255, 0.7), 0 0 20px rgba(200, 220, 255, 0.5);
}

.danmaku.skin-crystal .danmaku-avatar {
    border-color: #4da6ff;
    box-shadow: 0 0 5px #4da6ff;
    background: rgba(255, 255, 255, 0.5);
}

.danmaku.skin-crystal .danmaku-author {
    color: #4da6ff;
    text-shadow: 0 0 5px #4da6ff;
}

.danmaku.skin-crystal .danmaku-content {
    color: #333;
    text-shadow: 0 0 5px #4da6ff;
}

/* 彩虹天堂皮肤应用 */
.danmaku.skin-rainbow {
    background: linear-gradient(90deg, 
        rgba(255, 0, 0, 0.8), 
        rgba(255, 165, 0, 0.8), 
        rgba(255, 255, 0, 0.8), 
        rgba(0, 128, 0, 0.8), 
        rgba(0, 0, 255, 0.8), 
        rgba(75, 0, 130, 0.8), 
        rgba(238, 130, 238, 0.8)
    );
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(255, 255, 255, 0.5);
}

.danmaku.skin-rainbow .danmaku-avatar {
    border-color: #ff00ff;
    box-shadow: 0 0 5px #ff00ff;
    background: rgba(255, 255, 255, 0.5);
}

.danmaku.skin-rainbow .danmaku-author {
    color: white;
    text-shadow: 0 0 5px #ff00ff;
}

.danmaku.skin-rainbow .danmaku-content {
    color: white;
    text-shadow: 0 0 5px #ff00ff;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .modal-content {
        background: #2a2a3e;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .form-group label {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .form-group input {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: rgba(255, 255, 255, 0.9);
    }
    
    .modal-toggle {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .skin-option p {
        color: rgba(255, 255, 255, 0.8);
    }
}