* { box-sizing: border-box; }

:root {
    --bg: #f4f7fb;
    --card: #fff;
    --text: #162235;
    --muted: #738096;
    --line: #e7ecf3;
    --blue: #2f6bea;
    --red: #ef4548;
    --green: #22a47a;
    --orange: #d47a17;
    --shadow: 0 5px 20px rgba(35, 55, 85, .045);
}

html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.dark {
    --bg: #101521;
    --card: #171e2c;
    --text: #f2f5fb;
    --muted: #9aa6b9;
    --line: #283244;
    --shadow: 0 5px 20px rgba(0, 0, 0, .18);
}
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
    height: 72px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    width: min(1180px, calc(100% - 28px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.menu-btn {
    width: 42px;
    height: 42px;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    flex: 0 0 auto;
}
.menu-btn span { width: 30px; height: 3px; border-radius: 4px; background: var(--text); }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-logo {
    width: 43px;
    height: 43px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: linear-gradient(145deg, #3b8cf5, #1767db);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -1px;
    border: 2px solid #e8f1ff;
    box-shadow: 0 3px 9px rgba(47, 107, 234, .16);
}
.brand-logo span { color: #ffe45e; }
.brand-name { font-size: 22px; font-weight: 800; white-space: nowrap; letter-spacing: 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.theme-btn, .header-btn {
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--card);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.theme-btn { width: 42px; font-size: 25px; line-height: 1; }
.header-btn { padding: 0 13px; font-size: 16px; font-weight: 600; }
.login-btn { min-width: 54px; }
.register-btn { min-width: 58px; background: var(--blue); color: #fff; border-color: var(--blue); }

.mobile-menu {
    position: fixed;
    inset: 72px 0 auto 0;
    z-index: 45;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    transition: transform .2s ease;
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu-inner { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 10px 0 14px; display: flex; gap: 8px; }
.mobile-menu a { padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.mobile-menu a:hover { background: var(--bg); }

.page { width: min(1120px, calc(100% - 28px)); margin: 14px auto 35px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }

.countdown-card { padding: 26px 30px 20px; }
.countdown-top, .countdown-bottom { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 18px; }
.countdown-top strong { color: var(--muted); font-size: 20px; font-weight: 600; }
.countdown-value { margin: 20px 0 17px; text-align: center; font-size: 58px; line-height: 1; font-weight: 800; letter-spacing: 1px; }
.countdown-bottom { font-size: 16px; }
.countdown-bottom b { font-weight: 500; color: var(--muted); }
.progress-track { height: 7px; margin-top: 18px; background: #edf1f7; border-radius: 8px; overflow: hidden; }
body.dark .progress-track { background: #293244; }
.progress-bar { width: 0; height: 100%; background: var(--blue); border-radius: inherit; transition: width .35s linear; }

.latest-card { margin-top: 14px; padding: 25px 30px 22px; }
.section-heading { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 18px; font-weight: 500; white-space: nowrap; }
.section-heading strong { color: var(--muted); font-weight: 600; }
.latest-main { margin-top: 24px; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 14px; flex-wrap: nowrap; min-width: 0; }
.numbers { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; flex: 0 0 auto; }
.number, .sum-box {
    width: 68px;
    height: 68px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: #f7f9fc;
    border: 1px solid #edf1f6;
    font-size: 34px;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(30, 50, 80, .035);
    flex: 0 0 auto;
}
body.dark .number, body.dark .sum-box { background: #1d2636; border-color: #2b3546; }
.plus, .equals { font-size: 20px; color: #8b97aa; font-weight: 600; flex: 0 0 auto; }
.sum-box { width: 78px; background: var(--red); border-color: var(--red); color: #fff; }
.result-tags { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; flex: 0 0 auto; }
.tag { min-width: 64px; height: 58px; padding: 0 12px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 800; flex: 0 0 auto; }
.tag-red { background: var(--red); }
.tag-blue { background: var(--blue); }

.latest-meta {
    margin-top: 19px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
}
.meta-item { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 15px; }
.meta-item + .meta-item { border-left: 1px solid var(--line); }
.meta-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 30px; padding: 0 9px; border-radius: 9px; font-size: 14px; font-weight: 800; }
.meta-shape.meta-orange { background: #fff4df; color: var(--orange); }
.meta-shape.meta-green { background: #e8f8f2; color: var(--green); }
.meta-shape.meta-gray { background: #eef1f5; color: #68758a; }
.meta-span { background: #edf4ff; color: var(--blue); }
.meta-dragon.meta-red { background: #fff0f0; color: var(--red); }
.meta-dragon.meta-blue { background: #edf4ff; color: var(--blue); }
.meta-dragon.meta-gray { background: #eef1f5; color: #68758a; }
body.dark .meta-shape.meta-orange, body.dark .meta-shape.meta-green, body.dark .meta-shape.meta-gray, body.dark .meta-span, body.dark .meta-dragon.meta-red, body.dark .meta-dragon.meta-blue, body.dark .meta-dragon.meta-gray { background: #263143; }

.history-card { margin-top: 14px; padding: 28px 18px 22px; }
.history-title { display: flex; justify-content: space-between; align-items: center; padding: 0 3px 18px; }
.history-title h2 { margin: 0; font-size: 27px; }
.history-title p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.refresh-btn { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 11px; padding: 10px 18px; cursor: pointer; font-size: 15px; }
.table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.col-issue { width: 17%; }
.col-time { width: 15%; }
.col-number { width: 31%; }
.col-combo { width: 15%; }
.col-shape { width: 12%; }
.col-dragon { width: 10%; }
th, td { height: 70px; padding: 0 5px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
th { background: #f8fafc; color: #68758a; font-size: 15px; font-weight: 700; }
body.dark th { background: #1d2636; }
tbody tr:last-child td { border-bottom: 0; }
td { font-size: 15px; font-weight: 600; }
.issue { font-weight: 800; }
.draw-number { font-weight: 800; letter-spacing: 0; }
.table-tag { display: inline-block; padding: 7px 8px; border-radius: 8px; font-weight: 800; margin: 0 1px; font-size: 13px; }
.table-red { background: #fff0f0; color: var(--red); }
.table-blue { background: #edf4ff; color: var(--blue); }
.table-green { background: #ebfaf5; color: var(--green); }
.table-orange { background: #fff6ea; color: var(--orange); }
.table-gray { background: #f0f2f5; color: #68758a; }
body.dark .table-red { background: rgba(239,69,72,.15); }
body.dark .table-blue { background: rgba(47,107,234,.16); }
body.dark .table-green { background: rgba(34,164,122,.15); }
body.dark .table-orange { background: rgba(212,122,23,.15); }
body.dark .table-gray { background: #273143; color: #aab4c5; }
.loading, .error { color: var(--muted); padding: 24px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 17px; }
.pagination button { min-width: 84px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text); font-size: 14px; cursor: pointer; }
.pagination button:disabled { opacity: .42; cursor: default; }
.pagination span { min-width: 65px; text-align: center; color: var(--muted); font-size: 14px; }
.site-footer { width: min(1120px, calc(100% - 28px)); margin: 0 auto 28px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 760px) {
    .site-header { height: 64px; }
    .header-inner { width: calc(100% - 18px); gap: 6px; }
    .menu-btn { width: 38px; height: 38px; }
    .menu-btn span { width: 27px; height: 3px; }
    .brand { gap: 7px; }
    .brand-logo { width: 40px; height: 40px; font-size: 13px; }
    .brand-name { font-size: 19px; }
    .header-actions { gap: 5px; }
    .theme-btn, .header-btn { height: 40px; border-radius: 12px; }
    .theme-btn { width: 40px; font-size: 23px; }
    .header-btn { padding: 0 10px; font-size: 15px; }
    .login-btn { min-width: 49px; }
    .register-btn { min-width: 51px; }
    .mobile-menu { inset: 64px 0 auto 0; }
    .mobile-menu-inner { width: calc(100% - 18px); }
    .page { width: calc(100% - 18px); margin-top: 9px; }
    .countdown-card { padding: 22px 16px 17px; border-radius: 20px; }
    .countdown-top { font-size: 16px; }
    .countdown-top strong { font-size: 17px; }
    .countdown-value { margin: 20px 0 18px; font-size: 52px; }
    .countdown-bottom { font-size: 14px; }
    .progress-track { margin-top: 15px; height: 6px; }
    .latest-card { padding: 21px 12px 17px; border-radius: 20px; }
    .section-heading { gap: 5px; font-size: 16px; }
    .latest-main { margin-top: 20px; gap: 9px; width: 100%; }
    .numbers { gap: 5px; width: auto; }
    .number, .sum-box { width: 52px; height: 52px; border-radius: 12px; font-size: 27px; }
    .sum-box { width: 60px; }
    .plus, .equals { font-size: 16px; }
    .result-tags { gap: 5px; }
    .tag { min-width: 54px; height: 44px; border-radius: 11px; font-size: 19px; }
    .latest-meta { margin-top: 16px; padding-top: 13px; }
    .meta-item { gap: 5px; font-size: 13px; }
    .meta-badge { min-width: 34px; height: 29px; padding: 0 7px; font-size: 13px; }
    .history-card { padding: 25px 5px 18px; border-radius: 20px; }
    .history-title { padding: 0 7px 17px; }
    .history-title h2 { font-size: 26px; }
    .history-title p { font-size: 14px; }
    .refresh-btn { padding: 9px 16px; font-size: 14px; }
    .table-wrap { border-radius: 14px; }
    th, td { height: 70px; padding: 0 2px; }
    th { font-size: 14px; }
    td { font-size: 14px; }
    .table-tag { padding: 6px 5px; font-size: 12px; border-radius: 7px; }
    .draw-number { font-size: 14px; letter-spacing: 0; }
    .pagination { gap: 12px; padding-top: 15px; }
    .pagination button { min-width: 78px; height: 36px; }
}

@media (max-width: 430px) {
    .brand-name { font-size: 17px; }
    .header-actions { gap: 3px; }
    .theme-btn { width: 36px; }
    .header-btn { padding: 0 7px; font-size: 14px; }
    .login-btn { min-width: 44px; }
    .register-btn { min-width: 47px; }
    .latest-card { padding-left: 9px; padding-right: 9px; }
    .latest-main { gap: 4px; }
    .numbers { gap: 2px; }
    .number, .sum-box { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; }
    .sum-box { width: 46px; }
    .plus, .equals { font-size: 12px; }
    .result-tags { gap: 3px; }
    .tag { min-width: 45px; height: 40px; padding: 0 7px; font-size: 17px; border-radius: 10px; }
    .meta-item { gap: 3px; font-size: 12px; }
    .meta-badge { min-width: 31px; padding: 0 6px; font-size: 12px; }
    .col-issue { width: 18%; }
    .col-time { width: 15%; }
    .col-number { width: 31%; }
    .col-combo { width: 15%; }
    .col-shape { width: 12%; }
    .col-dragon { width: 10%; }
    th, td { font-size: 12px; }
    .table-tag { font-size: 11px; padding: 5px 4px; }
    .draw-number { font-size: 12px; }
}

/* 实时分析大厅 */
.analysis-card { margin-top: 14px; padding: 25px 18px 20px; }
.analysis-title { display: flex; align-items: center; justify-content: space-between; padding: 0 3px 17px; }
.analysis-title h2 { margin: 0; font-size: 27px; }
.analysis-title p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.analysis-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.analysis-tabs button { height: 42px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; }
.analysis-tabs button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.analysis-list { display: grid; gap: 10px; }
.analysis-item { border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; background: var(--card); }
.analysis-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.analysis-algorithm { font-size: 16px; font-weight: 800; }
.analysis-issue { color: var(--muted); font-size: 13px; }
.analysis-main { display: flex; align-items: center; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.analysis-label { color: var(--muted); font-size: 13px; }
.analysis-value { display: inline-flex; align-items: center; min-height: 31px; padding: 0 10px; border-radius: 8px; background: #edf4ff; color: var(--blue); font-size: 14px; font-weight: 800; }
.analysis-value.red { background: #fff0f0; color: var(--red); }
.analysis-value.orange { background: #fff6ea; color: var(--orange); }
.analysis-value.green { background: #ebfaf5; color: var(--green); }
.analysis-exclude { color: var(--red); background: #fff0f0; }
.analysis-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 13px; }
.analysis-stat { min-width: 0; padding: 9px 5px; border-radius: 9px; background: #f7f9fc; text-align: center; }
body.dark .analysis-stat { background: #1d2636; }
.analysis-stat span { display: block; color: var(--muted); font-size: 11px; }
.analysis-stat b { display: block; margin-top: 3px; font-size: 14px; }
.analysis-method { margin-top: 10px; color: var(--muted); font-size: 12px; }
.analysis-status { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.analysis-status.pending { background: #edf4ff; color: var(--blue); }
.analysis-status.hit { background: #ebfaf5; color: var(--green); }
.analysis-status.miss { background: #fff0f0; color: var(--red); }
.analysis-loading, .analysis-empty { color: var(--muted); text-align: center; padding: 28px 10px; }
.analysis-note { margin-top: 13px; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }

@media (max-width: 760px) {
    .analysis-card { padding: 24px 8px 18px; border-radius: 20px; }
    .analysis-title { padding: 0 6px 16px; }
    .analysis-title h2 { font-size: 26px; }
    .analysis-title p { font-size: 13px; }
    .analysis-tabs { gap: 5px; }
    .analysis-tabs button { height: 40px; font-size: 14px; }
    .analysis-item { padding: 14px 12px; }
    .analysis-algorithm { font-size: 15px; }
    .analysis-stats { gap: 5px; }
}

.analysis-page-card { margin-top: 0; min-height: 60vh; }
@media (max-width: 760px) { .analysis-page-card { margin-top: 0; } }
