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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #e8e8e8;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 顶部信息栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 8px 15px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.header-info {
    flex: 1;
}

.header-info.center {
    text-align: center;
}

.header-info.right {
    text-align: right;
}

.header .label {
    color: #666;
    font-size: 12px;
}

.header .value {
    font-weight: bold;
    font-size: 14px;
}

.header .period {
    color: #e74c3c;
    font-size: 15px;
}

.header .countdown {
    color: #e74c3c;
    font-size: 15px;
}

/* 主内容区 */
.main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 聊天区域 */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    min-width: 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    font-size: 14px;
}

.online-count {
    color: #2ecc71;
    font-size: 12px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 消息样式 */
.message {
    display: flex;
    gap: 8px;
    max-width: 85%;
}

.message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.system {
    align-self: center;
    max-width: 95%;
}

.message.robot {
    align-self: flex-start;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.avatar.robot {
    background: #00bcd4;
}

.avatar.user {
    background: #9b59b6;
}

.avatar.system {
    display: none;
}

.message-content {
    background: #fff;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.own .message-content {
    background: #dcf8c6;
}

.message.system .message-content {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    text-align: center;
    font-size: 13px;
}

.message.robot .message-content {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.message-username {
    font-weight: bold;
    font-size: 12px;
    color: #333;
}

.message-time {
    font-size: 10px;
    color: #999;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 聊天输入区 */
.chat-input-area {
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 10px 15px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.user-info input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    width: 120px;
}

.balance {
    font-size: 13px;
    color: #e74c3c;
    font-weight: bold;
}

.input-row {
    display: flex;
    gap: 8px;
}

.input-row input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    outline: none;
}

.input-row input:focus {
    border-color: #00bcd4;
}

.input-row button {
    background: #00bcd4;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
}

.input-row button:hover {
    background: #00acc1;
}

.bet-hints {
    margin-top: 6px;
    font-size: 11px;
    color: #999;
}

.bet-hints code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 0 3px;
    color: #666;
}

/* 右侧面板 */
.side-panel {
    width: 320px;
    background: #fff;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

/* 开奖结果卡片 */
.result-card {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.result-title {
    font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

.result-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.result-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.ball {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.result-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 8px;
}

.res-value {
    width: 40px;
    height: 40px;
    background: #e74c3c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    border-radius: 4px;
}

.res-label {
    margin-top: 3px;
    font-size: 11px;
    color: #666;
}

/* 路子图 */
.trend-section {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.panel-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.trend-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
}

.trend-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    border-radius: 3px;
    min-height: 22px;
}

.trend-cell.empty {
    background: transparent;
}

/* 历史记录 */
.history-section {
    padding: 12px;
    flex: 1;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 12px;
}

.history-item .period {
    color: #666;
    min-width: 40px;
}

.history-item .numbers {
    display: flex;
    gap: 3px;
}

.history-item .mini-ball {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
}

.history-item .result {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.history-item .combo {
    color: #666;
    font-size: 11px;
}

/* 数字颜色 */
.num-0, .num-5 { background: #3498db; }
.num-1, .num-6 { background: #2ecc71; }
.num-2, .num-7 { background: #e74c3c; }
.num-3, .num-8 { background: #9b59b6; }
.num-4, .num-9 { background: #f39c12; }

.res-0 { background: #95a5a6; }
.res-1 { background: #3498db; }
.res-2 { background: #2ecc71; }
.res-3 { background: #f1c40f; color: #333; }
.res-4 { background: #e74c3c; }
.res-5 { background: #9b59b6; }
.res-6 { background: #1abc9c; }
.res-7 { background: #e67e22; }
.res-8 { background: #34495e; }
.res-9 { background: #c0392b; }

/* 响应式 */
@media (max-width: 768px) {
    .side-panel {
        display: none;
    }

    .message {
        max-width: 90%;
    }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
