/**
 * 桌面端表格布局样式
 *
 * 这是桌面端的主要数据展示方式
 * 移动端会使用卡片布局（lottery-cards.css）
 */

/* ============================================
   表格容器
   ============================================ */

.lottery-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.lottery-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-base);
}

/* ============================================
   表头
   ============================================ */

.lottery-table thead {
    background: var(--primary-color);
    color: var(--text-white);
    position: sticky;
    top: 0;
    z-index: 10;
}

.lottery-table th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    letter-spacing: 0.025em;
    text-transform: uppercase;
    user-select: none;
}

.lottery-table th:first-child {
    border-top-left-radius: var(--radius-lg);
}

.lottery-table th:last-child {
    border-top-right-radius: var(--radius-lg);
}

/* ============================================
   表格主体
   ============================================ */

.lottery-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

.lottery-table tbody:last-child tr:last-child {
    border-bottom: none;
}

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

.lottery-table tbody tr:active {
    background-color: var(--bg-dark);
}

/* ============================================
   表格单元格
   ============================================ */

.lottery-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    vertical-align: middle;
}

/* 日期列 */
.date-cell {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    color: var(--text-light);
    white-space: nowrap;
}

/* 类型列 */
.type-cell {
    white-space: nowrap;
}

/* 期号列 */
.issue-cell {
    font-family: var(--font-family-mono);
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

/* 号码列 */
.number-cell {
    white-space: nowrap;
}

.number-digit {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: var(--primary-gradient);
    color: var(--text-white);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--font-size-base);
    margin: 0 var(--spacing-xs);
    box-shadow: var(--shadow-sm);
}

/* 路数列 */
.road-cell {
    white-space: nowrap;
}

.road-number {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--primary-color);
    font-family: var(--font-family-mono);
    margin-right: var(--spacing-sm);
}

.road-detail {
    display: inline-flex;
    gap: var(--spacing-xs);
}

.road-digit {
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-white);
}

.road-0 {
    background: var(--secondary-color);
}

.road-1 {
    background: var(--primary-color);
}

.road-2 {
    background: var(--danger-color);
}

/* ============================================
   响应式适配
   ============================================ */

/* 移动端隐藏表格 */
@media (max-width: 767px) {
    .lottery-table {
        display: none;
    }
}

/* 小屏幕桌面 */
@media (min-width: 768px) and (max-width: 1023px) {
    .lottery-table table {
        font-size: var(--font-size-sm);
    }

    .lottery-table th,
    .lottery-table td {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .number-digit {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: var(--font-size-sm);
    }
}

/* 大屏幕优化 */
@media (min-width: 1280px) {
    .lottery-table th,
    .lottery-table td {
        padding: var(--spacing-md) var(--spacing-xl);
    }

    .number-digit {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: var(--font-size-lg);
    }
}

/* ============================================
   空状态
   ============================================ */

.lottery-table.empty {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lottery-table.empty::after {
    content: '暂无数据';
    color: var(--text-light);
    font-size: var(--font-size-base);
}

/* ============================================
   表格边框美化
   ============================================ */

.lottery-table {
    border: 1px solid var(--border-color);
}

/* 斑马纹（可选） */
@media (prefers-reduced-motion: no-preference) {
    .lottery-table tbody tr:nth-child(even) {
        background-color: rgba(0, 0, 0, 0.02);
    }

    .lottery-table tbody tr:nth-child(even):hover {
        background-color: var(--bg-color);
    }
}

/* ============================================
   辅助功能
   ============================================ */

/* 焦点可见性 */
.lottery-table tbody tr:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .lottery-table thead {
        background: #000;
    }

    .lottery-table tbody tr {
        border-bottom-width: 2px;
    }
}

/* ============================================
   打印优化
   ============================================ */

@media print {
    .lottery-table {
        box-shadow: none;
        border: 1px solid #000;
    }

    .lottery-table thead {
        background: #ddd;
        color: #000;
    }

    .lottery-table tbody tr {
        page-break-inside: avoid;
    }

    .number-digit {
        background: #ccc;
        color: #000;
        border: 1px solid #000;
    }
}
