:root {
    color-scheme: dark;
    --bg: #07111f;
    --panel: rgba(15, 28, 46, .92);
    --line: rgba(255, 255, 255, .09);
    --text: #f4f7fb;
    --muted: #91a1b7;
    --gold: #e7ba67;
    --gold-strong: #ffd88e;
    --blue: #2f7df4;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 0, rgba(47, 125, 244, .18), transparent 32rem),
        radial-gradient(circle at 90% 12%, rgba(231, 186, 103, .12), transparent 28rem),
        var(--bg);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 17, 31, .86);
    backdrop-filter: blur(16px);
}

.header-inner, main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 12px; }

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(231, 186, 103, .45);
    border-radius: 13px;
    color: var(--gold-strong);
    background: linear-gradient(145deg, rgba(231, 186, 103, .22), rgba(231, 186, 103, .04));
    font-weight: 800;
}

.main-site, .refresh-button, .back-button, .load-more {
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
}

.main-site { padding: 10px 15px; }
.main-site:hover, button:hover { border-color: rgba(231, 186, 103, .55); }

.hero { padding: 76px 0 42px; text-align: center; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .24em; }
.hero h1 { margin: 12px 0; font-size: clamp(34px, 6vw, 58px); }
.hero > p:last-child { color: var(--muted); }

.panel {
    margin-bottom: 28px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
}

.toolbar, .history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

h2 { margin: 0 0 7px; font-size: 22px; }
.toolbar p { margin: 0; color: var(--muted); font-size: 13px; }

.search {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
}

.search input {
    width: 220px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: rgba(0, 0, 0, .18);
}

.search input:focus { border-color: var(--blue); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 18px; }
.tab {
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}
.tab.active { border-color: var(--gold); color: #171006; background: var(--gold); }

.lottery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.lottery-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .025);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease;
}

.lottery-card:hover { transform: translateY(-2px); border-color: rgba(231, 186, 103, .45); }
.card-title { display: flex; justify-content: space-between; gap: 12px; }
.card-title strong { font-size: 17px; }
.card-title span, .issue, .open-time { color: var(--muted); font-size: 12px; }
.issue { margin: 13px 0 9px; }
.numbers { display: flex; flex-wrap: wrap; gap: 6px; min-height: 31px; }
.ball {
    display: grid;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    place-items: center;
    border-radius: 8px;
    color: #0a1422;
    background: linear-gradient(145deg, #f6d89f, #d9a84e);
    font-weight: 800;
}
.open-time { margin-top: 11px; }

.history-panel { scroll-margin-top: 90px; }
.back-button, .refresh-button, .load-more { padding: 9px 13px; }
.back-button { margin-bottom: 13px; color: var(--gold-strong); }
.table-wrap { margin-top: 22px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 500; }
.load-more { display: block; width: 180px; margin: 22px auto 0; }
.empty { padding: 42px; color: var(--muted); text-align: center; }
footer { padding: 12px 20px 38px; color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 820px) {
    .lottery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .header-inner, main { width: min(100% - 20px, 1180px); }
    .main-site { padding: 8px 10px; font-size: 13px; }
    .hero { padding: 48px 0 28px; }
    .panel { padding: 18px; border-radius: 16px; }
    .toolbar, .history-heading { align-items: stretch; flex-direction: column; }
    .search { width: 100%; }
    .search input { width: 100%; }
    .lottery-grid { grid-template-columns: 1fr; }
    th, td { padding: 13px 9px; }
}
