* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: #ffffff;
    color: #34495e;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    background: #ffffff;
    border-top: 1px solid #ddd;
}

.header-inner {
    width: calc(100% - 30px);
    max-width: 1180px;
    height: 95px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-icon {
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
    color: #e4b500;
}

.brand-text {
    display: flex;
    align-items: center;
    font-size: 36px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -2px;
}

.brand-text span {
    color: #ed1111;
}

.brand-text strong {
    margin-left: 8px;
    color: #064c26;
}

.login {
    color: #333;
    font-weight: 700;
}

.main-nav {
    background: #f40000;
}

.nav-inner {
    width: calc(100% - 30px);
    max-width: 900px;
    min-height: 48px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 23px;
}

.nav-inner a {
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.page-container {
    width: calc(100% - 30px);
    max-width: 1180px;
    min-height: 1880px;
    margin: 20px auto 0;
    display: grid;
    grid-template-columns:
        minmax(0, 560px)
        210px
        minmax(260px, 330px);
    gap: 20px;
    align-items: start;
}

.content-column,
.province-column,
.right-column {
    min-width: 0;
}

.lottery-card {
    width: 100%;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 1px 7px rgba(0, 0, 0, .08);
}

.result-title {
    min-height: 43px;
    padding: 12px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #445365;
    font-weight: 700;
}

.lottery-statistics {
    width: 100%;
}

.lottery-statistics table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
}

.lottery-statistics th,
.lottery-statistics td {
    height: 46px;
    padding: 8px 5px;
    border: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
    color: #405066;
    font-weight: 700;
}

.lottery-statistics th {
    background: #f2f2f2;
    color: #333;
}

.lottery-statistics th:first-child,
.lottery-statistics td:first-child {
    width: 48%;
}

#resultG1,
#resultG7_1,
#resultG7_2,
#resultG7_3,
#resultG7_4,
#resultG1History,
#resultG7_1History,
#resultG7_2History,
#resultG7_3History,
#resultG7_4History {
    color: #f44336;
    font-weight: 800;
}

#resultDB,
#resultDBHistory {
    color: #333;
    font-weight: 800;
}

.loading {
    width: 19px;
    height: 19px;
    display: inline-block;
    vertical-align: middle;
    border: 3px solid #d2d2d2;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.history-section {
    margin-top: 52px;
}

#datePickerHistory {
    width: 305px;
    max-width: 100%;
    height: 42px;
    padding: 8px 12px;
    margin-bottom: 14px;
    border: 1px solid #c7d0d8;
    border-radius: 5px;
    background: #f4f8fb;
    color: #53657a;
    font-size: 15px;
}

.sidebar-box,
.stat-box {
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 1px 10px rgba(0, 0, 0, .10);
}

.sidebar-title,
.stat-title {
    min-height: 54px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    background: #f50000;
    color: #fff;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
}

.waiting-icon,
.stat-title span {
    margin-right: 4px;
}

.province-links {
    padding: 2px 0;
}

.province-links a {
    position: relative;
    display: block;
    padding: 12px 12px 12px 31px;
    color: #27558d;
}

.province-links a::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-radius: 50%;
    background: #ffa51f;
}

.long-list a {
    padding-top: 11px;
    padding-bottom: 11px;
}

.number-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 14px;
}

.number-tags span {
    padding: 8px 6px;
    border-radius: 4px;
    background: #ffa51f;
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}

.article-links {
    padding: 7px 12px 15px;
}

.article-links a {
    position: relative;
    display: block;
    padding: 9px 5px 9px 20px;
    color: #333;
    line-height: 1.35;
}

.article-links a::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 15px;
    width: 6px;
    height: 6px;
    background: #ffa51f;
    border-radius: 50%;
}

.footer {
    min-height: 42px;
    display: flex;
    align-items: center;
    background: #f50000;
    color: #fff;
}

.footer-inner {
    width: calc(100% - 30px);
    max-width: 1180px;
    margin: 0 auto;
}

@media (max-width: 1000px) {
    .page-container {
        grid-template-columns:
            minmax(0, 1fr)
            210px;
    }

    .right-column {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-box {
        margin-bottom: 0;
    }
}

@media (max-width: 700px) {
    .header-inner {
        height: 75px;
    }

    .brand-icon {
        width: 45px;
        height: 45px;
        font-size: 32px;
    }

    .brand-text {
        font-size: 25px;
    }

    .login {
        font-size: 12px;
    }

    .nav-inner {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 10px;
        gap: 20px;
    }

    .page-container {
        width: 100%;
        min-height: 1000px;
        display: block;
        margin-top: 10px;
        padding: 0 7px;
    }

    .province-column,
    .right-column {
        display: none;
    }

    .lottery-statistics th,
    .lottery-statistics td {
        height: 42px;
        padding: 6px 3px;
        font-size: 12px;
    }

    .lottery-statistics th:first-child,
    .lottery-statistics td:first-child {
        width: 39%;
    }

    .result-title {
        font-size: 12px;
    }

    .history-section {
        margin-top: 30px;
    }

    #datePickerHistory {
        width: 100%;
    }

    .footer {
        margin-top: 60px;
        font-size: 11px;
    }
}