* {
    box-sizing: border-box;
}

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

body {
    background: #fff;
    color: #425164;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

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

.site-width {
    width: calc(100% - 30px);
    max-width: 1100px;
    margin: 0 auto;
}

.top-info {
    height: 35px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ddd;
    color: #555;
}

.header {
    background: #d63b06;
}

.header-inner {
    min-height: 50px;
    display: flex;
    align-items: center;
}

.logo {
    width: 360px;
    font-size: 29px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -1px;
}

.logo .yellow {
    color: #ffd521;
}

.logo .white {
    color: #fff;
}

.logo .black {
    color: #111;
}

.nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

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

.main-grid {
    display: grid;
    grid-template-columns: 310px minmax(0, 640px);
    gap: 18px;
    padding-top: 18px;
    padding-bottom: 180px;
}

.side-card {
    margin-bottom: 18px;
    background: #fff;
    border-radius: 9px 9px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}

.side-title {
    padding: 12px 10px;
    background: #d83b05;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.province-list a {
    display: block;
    position: relative;
    padding: 8px 15px 8px 35px;
    border-bottom: 1px dotted #ddd;
    color: #666;
}

.province-list a::before {
    content: "○";
    position: absolute;
    left: 17px;
    color: #ef5a55;
}

.province-list span {
    margin-left: 10px;
    color: #ff8a00;
}

.number-meaning {
    padding: 8px 0 18px;
}

.animal-row {
    display: grid;
    grid-template-columns: 1fr 36px 36px 36px;
    min-height: 36px;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.animal-row > span {
    padding-left: 12px;
    color: #555;
}

.animal-row b {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
}

.gray {
    background: #bbb;
}

.blue-ball {
    background: #29a1df;
}

.green-ball {
    background: #36c975;
}

.red-ball {
    background: #f14c42;
}

.yellow-ball {
    background: #ffc600;
}

.calendar-card {
    padding-bottom: 18px;
}

.calendar {
    width: calc(100% - 50px);
    margin: 30px auto 0;
    padding: 12px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 8px rgba(0,0,0,.12);
}

.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.calendar-head button {
    background: transparent;
    border: 0;
    font-weight: 700;
}

.calendar-week,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.calendar-week {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 10px;
}

.calendar-days span {
    padding: 6px 2px;
    border: 1px solid #eee;
    font-size: 12px;
}

.calendar-days .sun {
    color: #f44336;
}

.calendar-days .selected {
    background: #3889c9;
    color: #fff;
    font-weight: 700;
}

.result-box {
    border: 1px solid #ddd;
}

.result-header {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
    font-weight: 700;
    background: #fff;
}

.lottery-statistics {
    width: 100%;
}

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

.lottery-statistics th,
.lottery-statistics td {
    border: 1px solid #ddd;
    padding: 11px 5px;
    text-align: center;
    vertical-align: middle;
    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: #e74c3c;
    font-weight: 800;
}

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

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

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

.prediction-card {
    width: 82%;
    margin: 65px auto 35px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 3px 14px rgba(0,0,0,.15);
}

.prediction-title {
    background: #d83b05;
    color: #fff;
    padding: 16px;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
}

.prediction-content {
    padding: 18px;
}

.prediction-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    text-align: center;
}

.prediction-top > div {
    padding: 0 12px 18px;
}

.prediction-top > div + div {
    border-left: 1px solid #ddd;
}

.prediction-top strong,
.prediction-636 strong {
    color: #444;
    font-size: 12px;
}

.balls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 13px;
}

.balls span {
    min-width: 29px;
    height: 29px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.balls .red-text {
    color: #f44336;
}

.prediction-636 {
    border-top: 1px dashed #ddd;
    border-bottom: 1px solid #eee;
    padding: 18px 0;
    text-align: center;
}

.prediction-links {
    padding-top: 13px;
}

.prediction-links a {
    display: block;
    position: relative;
    padding: 6px 0 6px 17px;
    color: #555;
    font-size: 12px;
}

.prediction-links a::before {
    content: "›";
    position: absolute;
    left: 0;
    color: #f44336;
    font-weight: 900;
}

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

#datePickerHistory {
    width: 260px;
    max-width: 100%;
    padding: 10px;
    margin-bottom: 14px;
    background: #f2f6fa;
    border: 1px solid #c6d0db;
    border-radius: 5px;
    color: #5d6d7e;
    font-size: 15px;
}

.footer {
    background: #fff4c9;
    color: #888;
    padding: 14px 0;
    text-align: center;
    line-height: 1.7;
    font-size: 12px;
}

@media (max-width: 900px) {
    .logo {
        width: auto;
        margin-right: 30px;
        font-size: 23px;
    }

    .nav {
        overflow-x: auto;
    }

    .main-grid {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .site-width {
        width: 100%;
        padding-left: 8px;
        padding-right: 8px;
    }

    .top-info {
        font-size: 11px;
    }

    .header-inner {
        display: block;
        padding-top: 8px;
    }

    .logo {
        padding-bottom: 8px;
    }

    .nav {
        padding: 10px 0;
        gap: 20px;
    }

    .main-grid {
        display: block;
        padding-top: 10px;
        padding-bottom: 80px;
    }

    .left-sidebar {
        display: none;
    }

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

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

    .prediction-card {
        width: 100%;
        margin: 25px auto;
    }

    #datePickerHistory {
        width: 100%;
    }
}