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

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-hover: #1f3460;
    --accent-primary: #e94560;
    --accent-secondary: #0f3460;
    --accent-gradient: linear-gradient(135deg, #e94560, #533483);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --border-color: #2a2a4a;
    --success: #00d26a;
    --warning: #ffb800;
    --danger: #ff4757;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
}

.nav-icon {
    font-size: 18px;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--success);
}

.status-dot.offline {
    background: var(--danger);
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.view-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 8px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 40px;
    background: var(--accent-gradient);
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 最近开奖 */
.recent-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.recent-rounds {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.round-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.round-card:hover {
    border-color: var(--accent-primary);
}

.dice-result {
    font-size: 48px;
    margin-bottom: 8px;
}

.round-number {
    font-size: 12px;
    color: var(--text-secondary);
}

.round-group {
    font-size: 11px;
    color: var(--accent-primary);
    margin-top: 4px;
}

/* 群组列表 */
.groups-list {
    display: grid;
    gap: 16px;
}

.group-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.group-card:hover {
    border-color: var(--accent-primary);
}

.group-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.group-meta {
    color: var(--text-secondary);
    font-size: 14px;
}

.group-meta span {
    margin-right: 16px;
}

.group-actions {
    display: flex;
    gap: 12px;
}

.group-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.group-status.active {
    background: rgba(0, 210, 106, 0.15);
    color: var(--success);
}

.group-status.inactive {
    background: rgba(255, 71, 87, 0.15);
    color: var(--danger);
}

/* 历史表格 */
.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.history-table th,
.history-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table tbody tr:hover {
    background: var(--bg-hover);
}

.dice-cell {
    font-size: 28px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: var(--bg-hover);
}

.pagination button.active {
    background: var(--accent-gradient);
    border-color: transparent;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-icon {
    padding: 10px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* 下拉框 */
.select {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    min-width: 200px;
}

.select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    width: 90%;
    max-width: 480px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-primary);
}

/* 表单 */
form {
    padding: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: 16px 8px;
    }

    .logo-text,
    .nav-item span:not(.nav-icon),
    .bot-status span {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 14px;
    }

    .main-content {
        padding: 20px;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .group-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* 赔率表 */
.odds-section {
    margin-bottom: 32px;
}

.odds-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.odds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.odds-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.odds-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.odds-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.odds-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* 投注统计 */
.bet-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.total-stats {
    margin-top: 32px;
}

.total-stats h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.stat-card.profit .stat-icon {
    background: linear-gradient(135deg, #00d26a, #00a854);
}

.profit-positive {
    color: var(--success) !important;
}

.profit-negative {
    color: var(--danger) !important;
}

/* 中奖类型标签 */
.win-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.win-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent-primary);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}