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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ========== 大屏端 ========== */
.screen-body {
    background: #000;
    overflow: hidden;
    height: 100vh;
    color: #fff;
}

/* Electron 透明悬浮层：背景透明、隐藏顶栏，弹幕铺满全屏 */
html.screen-overlay,
html.screen-overlay .screen-body.screen-overlay {
    background: transparent !important;
}

.screen-body.screen-overlay .screen-header {
    display: none;
}

.screen-body.screen-overlay #danmaku-container {
    top: 0;
}

.screen-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 100;
}

.screen-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 2px;
}

.screen-online {
    font-size: 16px;
    color: #aaa;
}

.screen-online span {
    color: #00ffff;
    font-weight: bold;
    font-size: 20px;
}

#danmaku-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.screen-qr-overlay {
    position: fixed;
    z-index: 200;
    pointer-events: none;
}

.screen-qr-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    text-align: center;
    pointer-events: auto;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.screen-qr-overlay.screen-qr--dragging .screen-qr-box {
    cursor: grabbing;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.screen-qr-box canvas,
.screen-qr-box img {
    display: block;
}

.screen-qr-hint {
    margin-top: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
    letter-spacing: 1px;
}

.screen-qr--top-left {
    top: 70px;
    left: 20px;
}

.screen-qr--top-right {
    top: 70px;
    right: 20px;
}

.screen-qr--bottom-left {
    bottom: 20px;
    left: 20px;
}

.screen-qr--bottom-right {
    bottom: 20px;
    right: 20px;
}

.screen-qr--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.screen-qr--middle-left {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.screen-qr--middle-right {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.screen-qr--custom {
    right: auto;
    bottom: auto;
    transform: none;
}

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    font-size: 28px;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8), -1px -1px 3px rgba(0,0,0,0.5);
    animation: danmaku-scroll linear forwards;
    pointer-events: none;
    will-change: transform;
    z-index: 10;
}

@keyframes danmaku-scroll {
    from { transform: translateX(100vw); }
    to { transform: translateX(-100%); }
}

/* ========== 手机端 ========== */
.mobile-body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #fff;
}

.mobile-header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 20px;
}

.mobile-header h1 {
    font-size: 22px;
    margin-bottom: 8px;
}

.mobile-header p {
    font-size: 14px;
    color: #8899aa;
}

.mobile-card {
    background: rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.mobile-card label {
    display: block;
    font-size: 14px;
    color: #aab;
    margin-bottom: 8px;
}

.mobile-card textarea {
    width: 100%;
    height: 100px;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 16px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    resize: none;
    outline: none;
}

.mobile-card textarea::placeholder {
    color: #667;
}

.emoji-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.emoji-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    font-size: 22px;
    cursor: pointer;
    transition: background 0.2s;
}

.emoji-btn:hover, .emoji-btn.active {
    background: rgba(0,255,255,0.2);
}

.color-bar {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.color-dot.active {
    border-color: #fff;
    transform: scale(1.15);
}

.send-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: opacity 0.2s;
}

.send-btn:active {
    opacity: 0.8;
}

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

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    z-index: 999;
    display: none;
    max-width: 85%;
    text-align: center;
    line-height: 1.5;
}

.toast-warn {
    background: rgba(180, 0, 0, 0.92);
    border: 1px solid #ff4444;
    font-weight: 600;
    padding: 18px 24px;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #667;
    margin-top: 6px;
}

/* ========== 管理端 ========== */
.admin-body {
    background: #f0f2f5;
    min-height: 100vh;
    padding: 30px;
    color: #333;
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 28px;
    color: #1a1a2e;
}

.admin-header p {
    color: #888;
    margin-top: 8px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.admin-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
}

.form-group input:focus {
    border-color: #0072ff;
}

.form-group select {
    width: 100%;
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.form-group select:focus {
    border-color: #0072ff;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #333 !important;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
}

.qr-screen-options {
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #f7f9fc;
    border: 1px solid #e8edf5;
    border-radius: 8px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary {
    background: #0072ff;
    color: #fff;
}

.btn-danger {
    background: #ff4757;
    color: #fff;
}

.btn-success {
    background: #2ed573;
    color: #fff;
}

.btn:hover {
    opacity: 0.85;
}

.room-list {
    list-style: none;
}

.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
}

.room-item-info h3 {
    font-size: 16px;
}

.room-item-info p {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

.room-actions {
    display: flex;
    gap: 8px;
}

.qr-section {
    text-align: center;
    margin-top: 16px;
}

#qrcode {
    display: inline-block;
    margin: 16px 0;
}

.qr-links {
    font-size: 13px;
    color: #666;
    word-break: break-all;
}

.qr-links a {
    color: #0072ff;
    text-decoration: none;
}

.qr-links p {
    margin: 6px 0;
}

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-error {
    color: #ff4757;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}
