/* ==================== 弹幕页 - 简约模块化设计 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { width: 100%; height: 100%; overflow: hidden; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif; 
    background: #f5f5f5; 
    color: #333; 
    line-height: 1.5; 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    user-select: none; 
    -webkit-user-select: none; 
}

/* 已登录主播横幅 */
.host-banner { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    height: 44px; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 16px; 
    z-index: 1001; 
}
.host-info { display: flex; align-items: center; gap: 8px; }
.host-label { font-size: 12px; opacity: 0.8; }
.host-name { font-size: 15px; font-weight: 600; }
.host-uid { font-size: 12px; opacity: 0.8; }
.print-queue-badge { 
    background: rgba(255,255,255,0.3); 
    padding: 2px 8px; 
    border-radius: 10px; 
    font-size: 11px; 
    margin-left: 8px;
    display: none; /* 默认隐藏，有打印任务时显示 */
}
.host-switch { 
    background: rgba(255,255,255,0.2); 
    border: none; 
    color: #fff; 
    padding: 4px 12px; 
    border-radius: 4px; 
    font-size: 12px; 
    cursor: pointer; 
}

/* 头部 - 房间号显示 */
.header { 
    position: fixed; 
    top: 44px; 
    left: 0; 
    right: 0; 
    height: 50px; 
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); 
    color: #fff; 
    display: flex; 
    align-items: center; 
    padding: 0 16px; 
    z-index: 1000; 
}
.header-content { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.header-left { display: flex; align-items: center; gap: 8px; }
.room-label { font-size: 12px; opacity: 0.7; }
.room-id { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; background: #999; }
.status-indicator.active { background: #52c41a; box-shadow: 0 0 6px rgba(82,196,26,0.5); }
.danmu-count { font-size: 12px; opacity: 0.8; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 10px; }

/* 设置栏 */
.settings-bar { 
    position: fixed; 
    top: 94px; 
    left: 0; 
    right: 0; 
    height: 50px; 
    background: #fff; 
    border-bottom: 1px solid #e5e5e5; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 12px; 
    z-index: 999; 
}
.setting-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #666; }
.setting-item select { 
    border: 1px solid #d9d9d9; 
    border-radius: 4px; 
    padding: 4px 8px; 
    font-size: 12px; 
    background: #fff; 
}
.setting-actions { display: flex; gap: 6px; }
.btn-small { 
    border: 1px solid #d9d9d9; 
    background: #fff; 
    padding: 6px 12px; 
    border-radius: 4px; 
    font-size: 12px; 
    color: #666; 
    cursor: pointer; 
}

.btn-small:active { background: #f5f5f5; }
.btn-small.active { 
    background: #1677ff; 
    color: #fff; 
    border-color: #1677ff; 
}

/* 弹幕容器 */
.danmu-container { 
    position: fixed; 
    top: 144px; 
    left: 0; 
    right: 0; 
    bottom: 60px; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
    background: #f5f5f5;
}
.danmu-list { 
    display: flex; 
    flex-direction: column; 
}

/* 空消息 */
.empty-message { 
    text-align: center; 
    padding: 60px 20px; 
    color: #999; 
    font-size: 14px; 
}

/* 弹幕项 - 模块化设计：左4/5 右1/5 */
.danmu-item-wrapper { 
    position: relative; 
    overflow: hidden; 
    background: #fff;
}
.danmu-item { 
    position: relative; 
    z-index: 1; 
    background: #fff; 
    border-bottom: 1px solid #e5e5e5; 
    transition: transform 0.15s ease-out;
    min-height: 70px;
    display: flex;
    align-items: stretch;
}
.danmu-item.swiped { transform: translateX(-70px); }

/* 左侧内容区 - 占4/5 */
.danmu-left {
    flex: 4;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 8px 10px 12px;
    gap: 4px;
}

/* 右侧按钮区 - 占1/5，固定 */
.danmu-right {
    flex: 1;
    min-width: 50px;
    max-width: 70px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 10px 10px 10px 0;
}

/* 上行：用户信息 + 时间 */
.danmu-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
}
.danmu-user { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
    flex: 1; 
    min-width: 0;
}
.danmu-nickname { 
    font-size: 14px; 
    font-weight: 600; 
    color: #1677ff; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}
.danmu-uid { 
    font-size: 11px; 
    color: #999; 
}
.danmu-time { 
    font-size: 11px; 
    color: #bbb; 
    white-space: nowrap; 
    flex-shrink: 0;
    margin-left: 8px;
}

/* 下行：消息内容 */
.danmu-bottom { 
    display: flex; 
    align-items: flex-start; 
}
.danmu-message { 
    font-size: 14px; 
    color: #333; 
    line-height: 1.5; 
    word-wrap: break-word; 
    word-break: break-all;
}

/* 订单价格和数量 */
.danmu-order-info {
    font-size: 13px;
    color: #f5222d;
    font-weight: 600;
    margin-top: 4px;
}

/* 上传时间 */
.danmu-upload-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* 打印按钮 - 方形设计，占上下两行 */
.btn-print { 
    width: 100%;
    flex: 1;
    border: 1px solid #d9d9d9; 
    background: #fff; 
    border-radius: 4px; 
    font-size: 12px; 
    color: #666; 
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.btn-print:active { background: #1677ff; color: #fff; border-color: #1677ff; }

/* 滑动露出的操作区 - 向左滑显示活动订单 */
.danmu-swipe-actions { 
    position: absolute; 
    right: 0; 
    top: 0; 
    bottom: 0; 
    width: 70px; 
    display: flex; 
    background: #ff4d4f;
}

/* 向左滑动手动定价按钮 */
.danmu-swipe-actions-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 70px;
    display: flex;
    background: #52c41a;
}
.btn-price {
    width: 100%;
    height: 100%;
    border: none;
    background: #52c41a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.btn-price:active { background: #73d13d; }
.btn-price-icon { font-size: 16px; }

.btn-order { 
    width: 100%; 
    height: 100%; 
    border: none; 
    background: #ff4d4f; 
    color: #fff; 
    font-size: 12px; 
    font-weight: 600;
    cursor: pointer; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.btn-order:active { background: #ff7875; }
.btn-order-icon { font-size: 16px; }

/* 底部导航 */
.bottom-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    height: 60px; 
    background: #fff; 
    display: flex; 
    border-top: 1px solid #e5e5e5; 
    z-index: 1000; 
}
.nav-container { width: 100%; display: flex; justify-content: space-around; align-items: center; height: 100%; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; cursor: pointer; height: 100%; }
.nav-item.active { color: #1677ff; }
.nav-item-icon { font-size: 22px; margin-bottom: 2px; }
.nav-item-text { font-size: 10px; }

/* 隐藏 */
.hidden { display: none !important; }

/* 滚动条样式 - 红色轨道 */
.danmu-container::-webkit-scrollbar { width: 4px; }
.danmu-container::-webkit-scrollbar-track { background: transparent; }
.danmu-container::-webkit-scrollbar-thumb { background: #ff4d4f; border-radius: 2px; }

/* 手动定价弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 85%;
    max-width: 320px;
    padding: 20px;
}
.modal-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}
.modal-body {
    margin-bottom: 20px;
}
.input-group {
    margin-bottom: 16px;
}
.input-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}
.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}
.input-group input:focus {
    outline: none;
    border-color: #1677ff;
}
.modal-actions {
    display: flex;
    gap: 12px;
}
.modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    border: none;
}
.btn-cancel {
    background: #f5f5f5;
    color: #666;
}
.btn-confirm {
    background: #1677ff;
    color: #fff;
}
