:root {
    color: #1f2020;
    background: #fbf8f3;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; }

.home-page {
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 38px 24px;
    overflow: hidden;
}

.site-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 106px;
    border-bottom: 1px solid #ddd8d0;
}

.site-brand { display: inline-flex; align-items: center; gap: 12px; color: #cf292b; font-size: 31px; font-weight: 800; letter-spacing: -1px; text-decoration: none; white-space: nowrap; }
.site-brand img { width: 58px; height: 58px; object-fit: contain; }
.site-brand-name { line-height: 1; }
.site-navigation-links { display: flex; align-items: center; gap: 20px; }
.site-navigation-links > a, .site-game-dropdown > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 8px; color: #252525; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.site-navigation-links a[aria-current="page"], .site-game-dropdown.is-current > summary { color: #cf292b; }
.site-navigation-links a[aria-current="page"]::after { position: absolute; right: 8px; bottom: -1px; left: 8px; height: 3px; background: #cf292b; content: ""; }
.site-navigation-links > a { position: relative; }
.site-game-dropdown { position: relative; }
.site-submenu { position: absolute; top: calc(100% + 9px); right: 0; z-index: 10; display: grid; min-width: 160px; padding: 8px; background: #fff; border: 1px solid #e3ddd5; border-radius: 8px; box-shadow: 0 12px 26px rgb(40 28 21 / 12%); }
.site-submenu a { padding: 10px 13px; color: #242424; text-decoration: none; }
.site-submenu a:hover, .site-navigation-links > a:hover { color: #cf292b; background: #fff3f1; }
.site-menu-toggle { display: none; min-height: 42px; padding: 8px 14px; color: #bd2527; font: inherit; font-weight: 700; background: #fff; border: 1px solid #cf292b; border-radius: 6px; cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #1f62c7; outline-offset: 3px; }

.home-hero { position: relative; min-height: 326px; padding: 71px 38px 40px; isolation: isolate; }
/* 背景与下方开奖面板共用内容边界，避免大屏右侧出现错位的额外背景区域。 */
.home-hero::before { position: absolute; z-index: -1; inset: 0; background: url("/static/icons/lottery-trend-grid-bg.png") center / cover no-repeat; content: ""; }
.home-hero-copy { max-width: 665px; }
.home-eyebrow { margin: 0 0 20px; color: #cb292b; font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.home-hero h1 { margin: 0; font-size: clamp(42px, 5vw, 68px); font-weight: 800; letter-spacing: -.065em; line-height: 1.12; }
.home-hero h1 span { color: #d32a2b; }
.home-hero-copy > p:last-child { margin: 23px 0 0; color: #72706c; font-size: 17px; letter-spacing: .12em; }
.home-hero-note { position: absolute; top: 145px; right: 53px; margin: 0; padding-left: 18px; color: #807c75; border-left: 2px solid #d95859; font-size: 14px; line-height: 1.7; }

.home-latest { overflow: hidden; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgb(81 56 38 / 8%); }
.home-latest-header { display: flex; align-items: center; justify-content: space-between; min-height: 91px; padding: 18px 38px; color: #fff; background: #d72a2a; }
.home-latest-header > div { display: flex; align-items: center; gap: 18px; }
.home-latest-kicker { padding-right: 17px; border-right: 1px solid rgb(255 255 255 / 65%); font-size: 14px; }
.home-latest h2 { margin: 0; font-size: 31px; letter-spacing: -.04em; }
.home-latest-header > p { margin: 0; font-size: 16px; }
.lottery-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-game { min-width: 0; padding: 32px 38px 26px; }
.home-game + .home-game { border-left: 1px solid #e5e1dc; }

.lottery-card-result { min-width: 0; overflow: visible; background: transparent; border: 0; border-radius: 0; }
.lottery-card-header { display: flex; align-items: baseline; min-height: 0; gap: 14px; margin-bottom: 25px; padding: 0; background: transparent; border: 0; }
.lottery-card-name { font-size: 32px; font-weight: 800; letter-spacing: -.05em; }
.lottery-card-period { color: #777; font-size: 22px; }
.lottery-card-period strong { color: inherit; font-weight: 600; }
.lottery-card-body { display: flex; align-items: center; justify-content: space-between; min-height: 0; gap: 20px; padding: 0; }
.lottery-balls-row { display: flex; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: clamp(7px, .9vw, 10px); margin: 0; padding: 0; list-style: none; }
/* 七个号码和右侧开奖信息在双列面板中同排展示；限制球径与间距，避免七星彩末位被挤出容器。 */
.lottery-ball { display: inline-grid; flex: 0 0 clamp(42px, 3.75vw, 54px); place-items: center; width: clamp(42px, 3.75vw, 54px); height: clamp(42px, 3.75vw, 54px); color: #fff; border-radius: 50%; box-shadow: inset -4px -4px 7px rgb(0 0 0 / 13%), 1px 3px 6px rgb(0 0 0 / 16%); font-size: clamp(23px, 1.8vw, 29px); font-weight: 800; line-height: 1; }
.lottery-ball-red { background: #df312e; }
.lottery-ball-blue { background: #2465cc; }
.lottery-card-meta { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 9px; color: #73716d; font-size: 13px; white-space: nowrap; }
.lottery-card-date { font-size: 14px; }
.lottery-card-view-hint { color: #d12a2b; font-size: 14px; font-weight: 700; }
.lottery-card-empty { margin: 0; min-height: 58px; padding: 16px 0; color: #6e6b67; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.game-menu { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 27px; padding-top: 18px; border-top: 1px solid #ebe8e4; }
.game-menu a { color: #77746f; font-size: 14px; text-decoration: none; white-space: nowrap; }
.game-menu a:first-child { color: #d12a2b; font-weight: 700; }
.game-menu a + a::before { display: inline-block; width: 1px; height: 14px; margin-right: 16px; vertical-align: -2px; background: #dcd8d2; content: ""; }
.game-menu a:hover { color: #c82728; text-decoration: underline; }

.home-footer { display: grid; justify-items: center; gap: 14px; padding: 54px 20px 8px; color: #7a7772; font-size: 13px; text-align: center; }
.site-brand-story { max-width: 690px; margin: 0; color: #494643; font-size: 15px; font-weight: 600; letter-spacing: .015em; line-height: 1.7; }
.site-brand-story::before { display: inline-block; width: 22px; height: 2px; margin: 0 10px 4px 0; vertical-align: middle; background: #cf292b; content: ""; }
.home-footer-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; color: #8a857e; }
.home-footer a { color: inherit; }
.home-footer a:hover { color: #a92325; }

/* 品牌故事只承担品牌注脚，不与页面主标题和数据说明争夺阅读层级。 */
.brand-story { margin: 0 0 34px; padding: 18px 0 19px 20px; border-top: 1px solid #eee5dc; border-bottom: 1px solid #eee5dc; border-left: 3px solid #cf292b; }
.brand-story-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-story-label { margin: 0; color: #bd2527; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.brand-story-header span { color: #aaa29a; font-size: 11px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.brand-story > p { max-width: 650px; margin: 10px 0 0; color: #514c47; font-size: 15px; font-weight: 600; line-height: 1.8; }

/* 单个彩种在 1280px 以下不足以同时容纳七个号码球与开奖说明，改为单列以保证信息完整。 */
@media (max-width: 1280px) {
    .home-page { padding: 0 24px 24px; }
    .home-hero { padding-right: 20px; padding-left: 20px; }
    .home-game { padding: 28px 25px 22px; }
    .home-latest-header { padding-right: 28px; padding-left: 28px; }
    .lottery-card-grid { grid-template-columns: 1fr; }
    .home-game + .home-game { border-top: 1px solid #e5e1dc; border-left: 0; }
    .lottery-card-body { align-items: center; flex-direction: row; }
    .lottery-card-meta { width: auto; flex-direction: column; justify-content: initial; }
}

@media (max-width: 800px) {
    .home-page { padding: 0 16px 20px; }
    .site-navigation { min-height: 82px; flex-wrap: wrap; gap: 10px; }
    .site-brand { gap: 8px; font-size: 24px; }
    .site-brand img { width: 48px; height: 48px; }
    .site-menu-toggle:not([hidden]) { display: block; }
    .site-navigation-links { width: 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 4px 0 13px; }
    .site-navigation.is-enhanced:not(.menu-open) .site-navigation-links { display: none; }
    .site-navigation-links > a, .site-game-dropdown > summary { padding-left: 6px; }
    .site-submenu { position: static; grid-template-columns: 1fr 1fr; box-shadow: none; }
    .home-hero { min-height: 295px; padding: 51px 10px 30px; }
    .home-hero::before { background-position: 64% center; }
    .home-hero-note { display: none; }
    .lottery-card-body { align-items: flex-start; flex-direction: column; }
    .lottery-card-meta { width: 100%; flex-direction: row; justify-content: space-between; }
}

@media (max-width: 540px) {
    .home-hero h1 { font-size: 36px; }
    .home-hero-copy > p:last-child { font-size: 14px; letter-spacing: .06em; }
    .home-latest-header { min-height: 72px; padding: 14px 18px; }
    .home-latest-header > p, .home-latest-kicker { display: none; }
    .home-latest h2 { font-size: 26px; }
    .home-game { padding: 24px 18px 20px; }
    .lottery-card-header { margin-bottom: 20px; }
    .lottery-card-name { font-size: 28px; }
    .lottery-card-period { font-size: 19px; }
    .lottery-balls-row { gap: 7px; }
    .lottery-ball { flex-basis: clamp(37px, 10.2vw, 46px); width: clamp(37px, 10.2vw, 46px); height: clamp(37px, 10.2vw, 46px); font-size: 21px; }
    .game-menu { gap: 10px 12px; }
    .game-menu a { font-size: 13px; }
    .game-menu a + a::before { margin-right: 12px; }
    .site-brand-story { font-size: 14px; }
    .brand-story { margin-bottom: 28px; padding: 16px 0 17px 15px; }
    .brand-story-header span { font-size: 10px; }
}
