/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 导航栏 */
.navbar {
    background: white;
    backdrop-filter: blur(10px);
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e9ecef;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #1e3a8a;
    letter-spacing: -0.5px;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    color: #1e3a8a;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: #f1f5f9;
    color: #1e3a8a;
}

.nav-links a.active {
    background: #1e3a8a;
    color: white;
}

/* 登出按钮样式 */
.nav-logout {
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-logout:hover {
    background: #f1f5f9;
    color: #1e3a8a;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: none;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* 股票表格 */
.stock-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
    font-size: 14px;
}

.stock-table thead {
    background: #f8f9fa;
}

.stock-table th,
.stock-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.stock-table th {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-table tbody tr {
    transition: background 0.15s;
}

.stock-table tbody tr:hover {
    background: #f8f9fa;
}

.price-up {
    color: #dc2626;
    font-weight: 500;
}

.price-down {
    color: #16a34a;
    font-weight: 500;
}

/* 新闻列表 */
.news-list {
    list-style: none;
}

.news-item {
    padding: 16px 0;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.15s;
}

.news-item:hover {
    padding-left: 8px;
}

.news-item:last-child {
    border-bottom: none;
}

.news-title {
    font-weight: 500;
    margin-bottom: 8px;
    color: #212529;
    font-size: 15px;
    line-height: 1.5;
}

.news-meta {
    font-size: 13px;
    color: #6c757d;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* 标签 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #1e3a8a;
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

/* 统计卡片 */
.stat-card {
    text-align: center;
    padding: 24px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

/* 大路网格样式 - 固定6行 */
.big-road-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 30px);
    grid-template-rows: repeat(6, 30px); /* 固定6行，每行30px */
    gap: 0px;
    max-width: 100%;
    justify-content: flex-start;
    padding: 0px;
    border-radius: 0px;
    width: auto;
    min-height: 180px;
    overflow-x: auto; /* 添加水平滚动 */
    overflow-y: hidden; /* 防止垂直滚动 */
    -webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
}

.ball {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    z-index: 2;
    justify-self: center;
    align-self: center;
    margin: 2px;
}

.ball:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ball.banker {
    background: #d32f2f;
}

.ball.player {
    background: #1976d2;
}

.ball.tie {
    background: #388e3c;
}

.ball.red {
    background: #f44336;
}

.ball.blue {
    background: #1976d2;
}

.ball.empty {
    background: #f0f0f0;
    border: 2px dashed #ccc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .navbar .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        flex-wrap: nowrap;
        min-height: 56px;
    }

    .logo {
        gap: 6px;
        flex-shrink: 0;
    }

    .logo-img {
        height: 26px;
    }

    .logo-text {
        font-size: 15px;
    }

    .nav-links {
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 4px;
        width: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 3px 0;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a,
    .nav-logout {
        font-size: 12px;
        padding: 6px 10px;
        white-space: nowrap;
        display: inline-block;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    .section-block .card-title {
        font-size: 18px;
    }

    .section-block {
        scroll-margin-top: 70px;
    }

    .stock-table {
        font-size: 13px;
    }

    .stock-table th,
    .stock-table td {
        padding: 12px 8px;
    }

    .page-title {
        font-size: 28px;
        margin-bottom: 24px;
        margin-top: 20px;
    }

    .container {
        padding: 15px;
    }
    
    /* 移动端大路网格样式 - 与PC端保持一致，移除网格背景 */
    .big-road-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, 30px);
        grid-template-rows: repeat(6, 30px);
        gap: 0px;
        max-width: 100%;
        justify-content: flex-start;
        padding: 0px;
        border-radius: 0px;
        width: auto;
        min-height: 180px;
        background-image: none; /* 移除网格背景 */
        background-size: auto;
        border: none; /* 移除边框 */
        overflow-x: auto; /* 添加水平滚动 */
        overflow-y: hidden; /* 防止垂直滚动 */
        -webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
    }
    
    .ball {
        width: 26px;
        height: 26px;
        margin: 2px;
    }
    
    /* 移动端路单网格样式 */
    .road-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0px;
        max-height: 200px;
        padding: 0px;
        min-height: 180px;
        overflow-x: auto; /* 添加水平滚动 */
        -webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
    }
    
    .road-grid.big-road {
        grid-template-columns: repeat(auto-fill, 30px);
        gap: 0px;
        max-height: 200px;
        padding: 0px;
        min-height: 180px;
        overflow-x: auto; /* 添加水平滚动 */
        -webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 页面标题 */
.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 40px;
    text-align: left;
    letter-spacing: -0.5px;
}

/* 板块区域 */
.section-block {
    margin-bottom: 32px;
    scroll-margin-top: 100px;
}

.section-block .card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

.section-block .card-title::before {
    content: none;
}

.section-description {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 24px;
    padding: 0;
    background: none;
    border-left: none;
    border-radius: 0;
    font-weight: 400;
}

.placeholder-content {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.road-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0px;
    background: #f9f9f9;
    border-radius: 6px;
    align-content: start;
    min-height: 180px;
    overflow-x: auto; /* 添加水平滚动 */
    -webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
}

.road-grid.big-road {
    display: grid;
    grid-template-columns: repeat(auto-fill, 30px);
    grid-auto-flow: row;
    gap: 0px;
    max-width: 100%;
    justify-content: flex-start;
    padding: 0px;
    min-height: 180px;
    overflow-x: auto; /* 添加水平滚动 */
    -webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
}
