/* --- 基础与布局 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    color: white;
    position: relative;
    font-family: "Poppins", sans-serif;
    background-color: #111;
}
#panoramaContainer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.barrage-container { position: relative; width: 100%; height: 100vh; overflow: hidden; pointer-events: none; }
.barrage-container.hidden .barrage { opacity: 0; pointer-events: none; }

/* --- 用户头像菜单 --- */
.user-area { position: fixed; top: 20px; right: 20px; z-index: 1001; }
.avatar-container { position: relative; cursor: pointer; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.8); background-size: cover; background-position: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.avatar-container:hover .avatar { transform: scale(1.08); box-shadow: 0 0 15px rgba(255, 255, 255, 0.5); }
.menu { position: absolute; top: 56px; right: 0; width: 180px; background: rgba(30, 30, 30, 0.6); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-20px) scale(0.95); transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); overflow: hidden; }
.avatar-container:hover .menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.menu ul { list-style: none; }
.menu li { display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: white; cursor: pointer; border-radius: 10px; transition: background-color 0.25s; font-size: 0.95em; }
.menu li:hover { background-color: rgba(255, 255, 255, 0.15); }
.initial-avatar { display: flex; justify-content: center; align-items: center; font-weight: bold; color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); text-align: center; }

/* --- 弹窗 --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: none; justify-content: center; align-items: center; z-index: 2000; background: rgba(0,0,0,0.3); backdrop-filter: blur(5px); }
.modal-overlay.active .glass-modal { animation: zoomIn 0.3s forwards; }
.modal-overlay.closing .glass-modal { animation: zoomOut 0.3s forwards; }
.glass-modal { position: relative; width: 400px; padding: 40px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 20px; backdrop-filter: blur(20px); transition: box-shadow 0.3s; color: #fff; transform: scale(0.5); opacity: 0; }
.glass-modal:hover { box-shadow: 0 0 30px rgba(255,255,255,0.2); }
.glass-modal h2 { font-size: 2em; text-align: center; margin-bottom: 30px; }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #aaa; transition: transform 0.3s, color 0.3s; }
.modal-close:hover { transform: rotate(90deg); color: #fff; }
.input-box { position: relative; width: 100%; margin: 30px 0; border-bottom: 2px solid #888; transition: border-color 0.3s; }
.input-box:focus-within { border-bottom-color: #3483fd; }
.input-box input { width: 100%; height: 50px; background: transparent; outline: none; border: none; font-size: 1em; color: #fff; padding: 0 40px 0 5px; }
.input-box label { position: absolute; top: 50%; left: 5px; transform: translateY(-50%); font-size: 1em; color: #aaa; pointer-events: none; transition: 0.3s; }
.input-box input:focus ~ label, .input-box input:valid ~ label { top: -5px; color: #3498db; }
.input-box .icon { position: absolute; right: 8px; color: #aaa; font-size: 1.2em; line-height: 57px; }
.modal-button { width: 100%; height: 45px; background: #fff; outline: none; border: none; border-radius: 40px; cursor: pointer; font-size: 1.1em; font-weight: 500; color: #000; margin-top: 10px; transition: box-shadow 0.3s; }
.modal-button:hover { box-shadow: 0 0 20px rgba(255,255,255,0.5); }
.message-box { margin-top: 15px; padding: 10px; border-radius: 5px; display: none; text-align: center; font-weight: bold; }
.message-box.success { background-color: rgba(0, 255, 0, 0.3); }
.message-box.error { background-color: rgba(255, 0, 0, 0.3); }
@keyframes zoomIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes zoomOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.5); opacity: 0; } }

/* --- 弹幕与右键菜单 --- */
.barrage { position: absolute; display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 25px; white-space: nowrap; opacity: 0.9; will-change: transform; cursor: pointer; transition: opacity 0.3s; pointer-events: auto; }
.barrage-avatar { width: 32px; height: 32px; border-radius: 50%; background-size: cover; background-position: center; flex-shrink: 0; }
.barrage-user { font-weight: bold; font-size: 15px; opacity: 0.8; }
.barrage-content { font-weight: normal; font-size: 16px; }
.barrage.paused, .barrage:hover { animation-play-state: paused !important; z-index: 999; }
.move-right { left: 0; transform: translateX(-100%); animation: moveRight linear; }
.move-left { right: 0; transform: translateX(100%); animation: moveLeft linear; }
.static-center { left: 50%; transform: translateX(-50%); }
@keyframes moveRight { to { transform: translateX(100vw); } }
@keyframes moveLeft { to { transform: translateX(-100vw); } }
.custom-context-menu { position: fixed; background: rgba(30, 30, 30, 0.8); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); padding: 6px; z-index: 3000; opacity: 0; visibility: hidden; transform: scale(0.95); }
.custom-context-menu.active { opacity: 1; visibility: visible; transform: scale(1); transition: all 0.15s ease-out; }
.custom-context-menu ul { list-style: none; padding: 0; margin: 0; }
.custom-context-menu li { padding: 8px 12px; color: #fff; cursor: pointer; border-radius: 6px; font-size: 0.9em; display: flex; align-items: center; gap: 8px; }
.custom-context-menu li:hover { background-color: rgba(255, 255, 255, 0.15); }

/* --- 可折叠控制面板 --- */
.control-panel { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 95%; max-width: 800px; background: rgba(28, 28, 30, 0.4); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.1); border-bottom: none; border-radius: 20px 20px 0 0; padding: 10px 20px; z-index: 1000; transition: all 0.4s ease-out; }
.panel-main-row { display: flex; align-items: center; gap: 15px; min-height: 54px; }
.panel-options-row { display: flex; flex-wrap: wrap; align-items: center; gap: 15px 25px; max-height: 0; opacity: 0; overflow: hidden; padding-top: 0; transition: max-height 0.4s ease-out, opacity 0.3s ease-out, padding-top 0.4s ease-out; }
.control-panel.is-open .panel-options-row { max-height: 120px; opacity: 1; padding-top: 15px; }
.panel-toggle-button { position: absolute; top: 0; left: 50%; transform: translate(-50%, -100%); width: 60px; height: 25px; background: inherit; backdrop-filter: inherit; border: 1px solid rgba(255, 255, 255, 0.1); border-bottom: none; border-radius: 10px 10px 0 0; color: white; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.panel-toggle-button i { transition: transform 0.4s ease; }
.control-panel.is-open .panel-toggle-button i { transform: rotate(180deg); }

/* --- 波浪动效输入框 --- */
.wave-group { position: relative; flex: 1; }
.wave-group .input { width: 100%; border: none; border-bottom: 2px solid #7e7e7e; background: transparent; padding: 0.9rem 0.5rem; font-size: 1rem; color: #f5f5f5; }
.wave-group .input:focus { outline: none; }
.wave-group .label { color: #999; font-size: 1rem; font-weight: normal; position: absolute; pointer-events: none; left: 5px; top: 0.9rem; display: flex; transition: 0.2s ease all; }
.wave-group .label-char { transition: 0.2s ease all; transition-delay: calc(var(--index) * .05s); }
.wave-group .input:focus ~ .label .label-char, .wave-group .input:valid ~ .label .label-char { transform: translateY(-22px); font-size: 0.8rem; color: #3498db; }
.wave-group .bar { position: relative; display: block; width: 100%; }
.wave-group .bar:before, .wave-group .bar:after { content: ''; height: 2px; width: 0; bottom: 0; position: absolute; background: #3483fd; transition: 0.3s ease all; }
.wave-group .bar:before { left: 50%; }
.wave-group .bar:after { right: 50%; }
.wave-group .input:focus ~ .bar:before, .wave-group .input:focus ~ .bar:after { width: 50%; }

/* --- 字数计数器 --- */
.char-counter {
    position: absolute;
    top: -5px;
    right: 5px;
    font-size: 0.75rem;
    color: #ffffff;
    transition: color 0.3s;
}

.char-counter.warning {
    color: #ff9800;
    font-weight: bold;
}

.char-counter.error {
    color: #f44336;
    font-weight: bold;
}

/* --- 颜色选择器 --- */
.color-picker-group .pcr-button {
width: 32px;
height: 32px;
transition: transform 0.2s;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.color-picker-group .pcr-button:hover {
transform: scale(1.1);
}

/* 让 Pickr 弹出的面板也拥有玻璃特效 */
.pcr-app {
    background: rgba(50, 50, 50, 0.5) !important;
    backdrop-filter: blur(10px);
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}

.color-pickers-wrapper {
    display: flex;
    align-items: center;
    gap: 20px; /* 设置两个颜色组之间的间距 */
}

/* --- 模式与速度选项卡 --- */
.tab-input, .radio-input { position: relative; display: flex; align-items: center; border-radius: 99px; background-color: rgba(0,0,0,0.2); color: #fff; border: 1px solid rgba(255, 255, 255, 0.1); }
.tab-input { --container_width: 240px; --num_options: 3; width: var(--container_width); }
.radio-input { --container_width: 250px; --num_options: 5; width: var(--container_width); }
.tab-input input, .radio-input input { display: none; }
.tab-input label, .radio-input label { width: 100%; padding: 10px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 5px; z-index: 1; font-weight: 500; font-size: 14px; transition: color 0.25s ease; }
.tab-input .selection, .radio-input .selection { display: block; position: absolute; height: 100%; width: calc(var(--container_width) / var(--num_options)); z-index: 0; left: 0; top: 0; border-radius: 99px; background-color: #3483fd; box-shadow: 0 0 10px rgba(52, 131, 253, 0.5); transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tab-input label:has(input:checked), .radio-input label:has(input:checked) { color: #fff; }
.tab-input label:nth-child(1):has(input:checked) ~ .selection { transform: translateX(calc(var(--container_width) * 0/3)); }
.tab-input label:nth-child(2):has(input:checked) ~ .selection { transform: translateX(calc(var(--container_width) * 1/3)); }
.tab-input label:nth-child(3):has(input:checked) ~ .selection { transform: translateX(calc(var(--container_width) * 2/3)); }
.radio-input label:nth-child(1):has(input:checked) ~ .selection { transform: translateX(calc(var(--container_width) * 0/5)); }
.radio-input label:nth-child(2):has(input:checked) ~ .selection { transform: translateX(calc(var(--container_width) * 1/5)); }
.radio-input label:nth-child(3):has(input:checked) ~ .selection { transform: translateX(calc(var(--container_width) * 2/5)); }
.radio-input label:nth-child(4):has(input:checked) ~ .selection { transform: translateX(calc(var(--container_width) * 3/5)); }
.radio-input label:nth-child(5):has(input:checked) ~ .selection { transform: translateX(calc(var(--container_width) * 4/5)); }

/* --- 开关 --- */
.switch-group { display: flex; align-items: center; gap: 5px; color: #ccc; font-size: 14px; }
.switch { font-size: 17px; position: relative; display: inline-block; width: 3.5em; height: 2em; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.2); border: 1px solid rgba(255, 255, 255, 0.1); transition: .4s; border-radius: 1.5em; }
.switch .slider:before { position: absolute; content: ""; height: 1.4em; width: 1.4em; border-radius: 50%; left: 0.3em; top: 50%; transform: translateY(-50%); background-color: white; transition: .4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.switch input:checked + .slider { background-color: #3483fd; }
.switch input:checked + .slider:before { transform: translateX(1.5em) translateY(-50%); }

/* --- 发送按钮 --- */
.send-button { font-family: inherit; font-size: 1rem; background: #3483fd; color: white; padding: 0.9rem 1em; padding-left: 0.9em; display: flex; align-items: center; border: none; border-radius: 12px; overflow: hidden; transition: all 0.2s; cursor: pointer; }
.send-button span {
    display: block;
    margin-left: 0.6em;
    transition: all 0.3s ease-in-out;
}
.send-button svg { display: block; transform-origin: center center; transition: transform 0.3s ease-in-out; }
.send-button:hover .svg-wrapper { animation: fly-1 0.6s ease-in-out infinite alternate; }
.send-button:hover svg {
    transform: translateX(1.2em) rotate(45deg) scale(1.4);
}
.send-button:hover span { transform: translateX(5em); }
.send-button:active { transform: scale(0.95); }
.send-button:disabled { background: #555; color: #999; cursor: not-allowed; }
.send-button:disabled:hover .svg-wrapper, .send-button:disabled:hover svg, .send-button:disabled:hover span { animation: none; transform: none; }
@keyframes fly-1 { from { transform: translateY(0.1em); } to { transform: translateY(-0.1em); } }

/* --- 移动端调整 --- */
@media (max-width: 768px) {
    .barrage-content { font-size: 18px; }
    .barrage-user { font-size: 16px; }
    .control-panel { padding: 10px; gap: 10px; }
    .panel-options-row { gap: 10px; }
}