* { box-sizing: border-box; }
html { background: #ddd; color: #333; font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif; }
body { margin: 0; background: #ddd; }
a { color: inherit; text-decoration: none; }
.history-shell { width: min(720px, 100%); min-height: 100vh; margin: 0 auto; background: #f4f4f4; }
.history-topbar { display: grid; height: 46px; grid-template-columns: 70px 1fr 70px; align-items: center; background: #1111e8; color: #fff; }
.history-topbar a { padding: 13px 10px; color: #fff; font-size: 14px; }
.history-topbar h1 { margin: 0; font-size: 20px; font-weight: 500; text-align: center; }
.history-controls { margin: 6px 5px 0; border: 1px solid #d6d6b2; background: #fffecf; }
.history-filter-row { display: grid; min-height: 40px; grid-template-columns: 58px minmax(0, 1fr); align-items: center; padding: 4px 8px 4px 18px; }
.history-filter-row strong { align-self: start; padding-top: 7px; color: #ed1515; font-size: 15px; }
.history-filter-options { display: flex; flex-wrap: wrap; gap: 8px 13px; align-items: center; }
.history-lottery-switch { min-height: 48px; border-bottom: 1px solid #e2dfad; }
.history-lottery-switch a,
.history-filter-button,
.history-filter-reset { min-width: 37px; height: 29px; padding: 0 10px; border: 1px solid #d7d7b8; border-radius: 4px; background: #fffde1; color: #333; font: inherit; line-height: 27px; text-align: center; cursor: pointer; }
.history-lottery-switch a { font-weight: 700; }
.history-lottery-switch a.is-active { border-color: #1111e8; background: #1111e8; color: #fff; }
.history-filter-button.is-active { border-color: #f15b3a; background: #f15b3a; color: #fff; font-weight: 900; }
.history-filter-reset { border-color: #1111e8; background: #1111e8; color: #fff; font-weight: 900; }
.history-filter-button:focus-visible,
.history-filter-reset:focus-visible,
.history-lottery-switch a:focus-visible { outline: 2px solid #ff9800; outline-offset: 2px; }
.history-year-switch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 7px 4px; background: #ddd; }
.history-year-switch a,
.history-year-switch span,
.history-year-switch button { display: grid; min-height: 25px; place-items: center; border: 0; border-radius: 7px; background: #ff9800; color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.history-year-switch a.is-active { background: #fff; color: #555; font-weight: 900; }
.history-year-switch .is-extra { display: none; }
.history-year-switch.is-expanded .is-extra { display: grid; }
.history-list { margin: 0 5px 8px; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; border-left: 1px solid #ccc; background: #fff; }
.history-list-heading { display: flex; min-height: 34px; align-items: center; justify-content: space-between; padding: 5px 8px; border-bottom: 1px solid #bbb; background: #ececec; }
.history-list-heading strong { color: #1111e8; }
.history-list-heading span { color: #777; font-size: 12px; }
.history-draw { padding: 3px 3px 6px; border-bottom: 1px solid #d6d6d6; scroll-margin-top: 4px; }
.history-draw:last-child { border-bottom: 0; }
.history-draw.is-highlighted { background: #fff8a9; box-shadow: inset 4px 0 #ff7a00; }
.history-draw > header { display: flex; min-height: 25px; align-items: center; gap: 5px; color: #666; font-size: 13px; }
.history-draw > header strong { color: #333; }
.history-number-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.history-number { position: relative; display: grid; min-width: 0; min-height: 39px; grid-template-rows: 23px 16px; place-items: center; overflow: hidden; border: 1px solid #ddd; background: #f8f8f8; transition: opacity .15s ease; }
.history-number b { display: grid; width: 100%; height: 23px; place-items: center; color: #fff; font-size: 15px; line-height: 1; }
.history-number small { color: #555; font-size: 11px; }
.history-number--red b { background: #f20d18; }
.history-number--blue b { background: #1008ee; }
.history-number--green b { background: #078710; }
.history-number.is-special { border: 1px solid #ddd; }
.history-list.has-active-filter .history-number.is-filtered-out { opacity: .12; }
.history-list.has-active-filter .history-number.is-filter-match { opacity: 1; }
.history-empty { margin: 0; padding: 42px 12px; color: #777; text-align: center; }
.history-footer { display: grid; gap: 7px; padding: 12px; background: #eee; color: #777; font-size: 11px; text-align: center; }
.history-footer a { color: #1111e8; font-size: 13px; font-weight: 700; }
@media (max-width: 520px) {
    .history-topbar { height: 42px; grid-template-columns: 55px 1fr 55px; }
    .history-topbar h1 { font-size: 18px; }
    .history-filter-row { grid-template-columns: 44px minmax(0, 1fr); padding: 4px 5px 4px 8px; }
    .history-filter-row strong { font-size: 14px; }
    .history-filter-options { gap: 6px; }
    .history-lottery-switch a,
    .history-filter-button,
    .history-filter-reset { min-width: 36px; padding: 0 8px; }
    .history-lottery-switch a { flex: 0 1 auto; }
    .history-year-switch { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .history-number-grid { gap: 2px; }
    .history-number { min-height: 37px; }
    .history-number b { font-size: 14px; }
    .history-number small { font-size: 10px; }
    .history-draw > header { flex-wrap: wrap; font-size: 11px; }
}
