:root {
  --main-color: #07c160;
  --main-dark: #05a552;
  --main-red: #c10707;
  --text-primary: #222;
  --text-muted: #7a7a7a;
  --line: #ececec;
  --page-bg: #f3f4f5;
  --surface: #fff;
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-size: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #f1f1f1; color: var(--text-primary); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { overflow-x: hidden; }
html { font-size: 14px; }
button, input { font: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }
.is-hidden { display: none !important; }

.boot-page {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: #f8f8f8; overflow: hidden;
}
.boot-card { display: flex; flex-direction: column; align-items: center; color: #555; font-size: 15px; }
.route-logo { width: 138px; height: 138px; margin-bottom: 18px; }
.config-page { background: #0c3022; }
.config-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(1px); transform: scale(1.02); }
.config-mask { position: absolute; inset: 0; background: rgba(0,0,0,.34); }
.config-card { position: relative; z-index: 1; color: #fff; gap: 8px; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.38); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.phone-shell { position: relative; max-width: 480px; min-height: 100vh; margin: 0 auto; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
.site-header { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 30; width: min(480px, 100vw); background: var(--surface); overflow: hidden; }
.header-main { height: 44.8px; display: grid; grid-template-columns: 100px minmax(0, 1fr) 126px; align-items: center; padding: 0 10px; border-bottom: 1px solid #e6e6e6; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.03); }
.backup-domain { width: 92px; height: 34px; border-radius: 4px; background: var(--main-color); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; line-height: 1.05; box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
.backup-domain strong { font-size: 13px; font-weight: 700; letter-spacing: .1px; }
.backup-domain span { margin-top: 2px; font-size: 10px; display: flex; align-items: center; gap: 2px; opacity: .98; }
.backup-domain i { font-style: normal; font-size: 10px; }
.site-header h1 { margin: 0; text-align: center; font-size: 18px; font-weight: 500; white-space: nowrap; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.header-actions button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 28px; max-width: 36px; color: #333; overflow: hidden; }
.header-actions .icon { width: 16px; height: 16px; display: grid; place-items: center; font-size: 16px; line-height: 16px; color: #4d4d4d; }
.header-actions svg,
.notice-icon svg,
.tabbar svg { width: 100%; height: 100%; display: block; }
.header-actions em { font-style: normal; font-size: 11px; transform: scale(.92); }
.app-download-top { height: 45px; display: grid; grid-template-columns: 32px 1fr 44px 22px; gap: 8px; align-items: center; padding: 6px 10px; background: rgba(39,86,61,.8); border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #fff; }
.download-logo { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; }
.download-action { height: 26px; line-height: 26px; text-align: center; border-radius: 13px; color: #fff; background: var(--main-color); font-size: 12px; }
#topDownloadClose { color: #999; font-size: 22px; line-height: 1; }

.page-main { min-height: 100vh; padding-top: 44.8px; padding-bottom: calc(50px + var(--safe-bottom)); }
.hero-swiper { height: 141.4px; overflow: hidden; position: relative; background: #fff; }
.swiper-track { height: 100%; display: flex; transition: transform .42s ease; }
.swiper-slide { min-width: 100%; height: 100%; background: #eee; }
.swiper-slide img { width: 100%; height: 100%; object-fit: cover; }
.swiper-dots { position: absolute; right: 9px; bottom: 6px; display: flex; gap: 4px; }
.swiper-dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.7); box-shadow: 0 0 2px rgba(0,0,0,.25); }
.swiper-dots span.active { width: 12px; border-radius: 8px; background: #fff; }
.notice-bar { height: 29.3px; display: grid; grid-template-columns: 30px 1fr; align-items: center; background: #fff; border-top: 1px solid #f5f5f5; border-bottom: 1px solid #eee; overflow: hidden; }
.notice-icon { width: 30px; text-align: center; color: #ef5151; font-size: 15px; }
.notice-window { overflow: hidden; white-space: nowrap; padding-right: 10px; }
.notice-text { display: inline-block; color: #666; font-size: 13px; padding-left: 100%; animation: marquee 16s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

.content-card { background: #fff; overflow: hidden; padding-top: 8px; }
.placeholder-block { display:none; height: 32px; background: #f2f2f2; }
.province-pills { display: none; background: transparent; padding: 0; overflow-x: auto; scrollbar-width: none; margin-top: 0; }
.province-pills::-webkit-scrollbar, .lottery-tabs::-webkit-scrollbar, .year-strip::-webkit-scrollbar, .series-strip::-webkit-scrollbar { display: none; }
.province-pills ul { display: flex; gap: 7px; min-width: max-content; }
.province-pills li { width: 71px; height: 42px; border: 1px solid var(--main-color); border-radius: 5px; background: #fff; color: var(--main-color); display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 12px; }
.province-pills li.red { border-color: var(--main-red); color: var(--main-red); }
.province-pills li.active { color: #fff; background: var(--main-color); }
.province-pills li.red.active { background: var(--main-red); }
.province-pills img { width: 21px; height: 21px; object-fit: contain; }
.lottery-tabs { overflow-x: auto; border-top: 0; border-bottom: 1px solid #efefef; background: #fff; }
.lottery-tabs ul { display: flex; min-width: max-content; }
.lottery-tabs li { width: 92px; min-height: 53px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid #f1f1f1; color: #666; position: relative; }
.lottery-tabs li.active { color: var(--main-color); font-weight: 600; }
.lottery-tabs li.active::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; border-radius: 3px; background: var(--main-color); }
.lottery-tabs .name { font-size: 14px; margin-bottom: 4px; }
.lottery-tabs .time { font-size: 11px; color: #999; font-weight: 400; transform: scale(.94); }

.lottery-panel { background: #fff; padding: 0 10px 4px; }
.tk-main-lottery { border: 1px solid var(--main-color); border-radius: 5px; overflow: hidden; background: #fff; }
.lottery-head { min-height: 31px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px; border-bottom: 1px solid #f0f0f0; font-size: 12px; color: #666; }
.lottery-head strong { color: #333; font-size: 14px; }
.lottery-countdown { color: var(--main-color); white-space: nowrap; }
.history-link { color: #999; white-space: nowrap; }
.balls { display: flex; justify-content: space-between; align-items:flex-start; gap: 2px; padding: 9px 7px 5px; }
.ball-item { width: calc((100% - 40px) / 7); text-align: center; }
.ball { width: 34px; height: 34px; margin: 0 auto 4px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 700; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.ball.red { background: #e44545; }
.ball.blue { background: #3087d8; }
.ball.green { background: #19af5e; }
.ball.gray { background: #bbb; }
.zodiac { display: block; color: #777; font-size: 11px; white-space: nowrap; transform: scale(.9); }
.next-issue { height: 29px; line-height: 29px; text-align: center; background: #fafafa; color: #777; border-top: 1px solid #f0f0f0; font-size: 13px; }
.text-ad-grid { background: #fff; border-top: 1px solid #f0f0f0; padding: 16px 10px 17px; }
.text-ad-grid ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 7px; }
.text-ad-grid a { display: block; height: 26px; line-height: 26px; text-align: center; border-radius: 3px; color: var(--main-color); background: #f3fff8; border: 1px solid #d7f2e2; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.section-gap { height: 5px; background: #eee; }
.game-grid, .feature-grid { padding: 18px 0 18px; background: #fff; }
.game-grid ul { display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 12px; }
.feature-grid ul { display: grid; grid-template-columns: repeat(5, 1fr); row-gap: 18px; }
.game-grid li, .feature-grid li { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; min-height: 70px; color: #444; font-size: 12px; position: relative; }
.game-grid li { min-height: 80px; }
.grid-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; background: linear-gradient(180deg, #35d685, #07b75d); box-shadow: 0 4px 10px rgba(7,193,96,.2); overflow: hidden; }
.game-grid .grid-icon { width: 42px; height: 42px; border-radius: 13px; }
.grid-icon img { width: 100%; height: 100%; object-fit: cover; }
.hot-badge { position: absolute; top: -4px; right: 12px; min-width: 26px; height: 14px; line-height: 14px; padding: 0 4px; border-radius: 7px; color: #fff; background: #ff3b30; font-size: 9px; transform: scale(.9); }
.year-strip { overflow: hidden; padding: 8px 10px 7px; background: #fff; border-bottom: 1px solid #efefef; }
.year-strip ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px 8px; }
.year-strip li { height: 32px; min-width: 0; padding: 0 10px; border-radius: 16px; border: 1px solid #e3e3e3; display: flex; align-items: center; justify-content: center; gap: 5px; color: #555; font-size: 13px; background: #fff; }
.year-strip li.active { border-color: var(--main-color); color: var(--main-color); background: #effff6; }
.year-strip li.bw.active { border-color: #555; color: #111; background: #f4f4f4; }
.series-strip { position: sticky; top: 44.8px; z-index: 20; overflow-x: auto; display: flex; gap: 8px; align-items: center; padding: 9px 10px 8px; background: #fff; border-bottom: 1px solid #ededed; }
.series-strip button { min-width: 70px; height: 32px; padding: 0 12px; border-radius: 16px; color: #555; background: #f5f5f5; font-size: 13px; }
.series-strip button.active { color: #fff; background: var(--main-color); }
.series-strip .more { margin-left: auto; color: var(--main-color); background: #eefaf3; }
.picture-section { padding: 8px 10px 10px; background: var(--page-bg); }
.waterfall { column-count: 2; column-gap: 10px; }
.picture-card { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 10px; background: #fff; border-radius: 5px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); position: relative; }
.picture-card img { width: 100%; min-height: 120px; object-fit: cover; background: #e9e9e9; }
.picture-card .name { min-height: 32px; display: flex; align-items: center; justify-content: center; color: #333; font-size: 13px; padding: 0 6px; }
.picture-card .advss { position: absolute; right: 5px; top: 5px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 3px; }
.load-more { color: #999; text-align: center; font-size: 12px; padding: 10px 0 4px; }

.major-menu { display: none; position: fixed; left: calc(50% + min(212px, 50vw - 58px)); bottom: 35%; z-index: 35; width: 54px; height: 54px; }
.major-open, .major-close { position: absolute; right: 0; bottom: 0; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 32px; background: var(--main-color); box-shadow: var(--shadow-soft); transition: transform .18s ease, opacity .18s ease; }
.major-close { opacity: 0; pointer-events: none; background: #fff; color: var(--main-color); border: 1px solid #d4f4e1; }
.major-menu.open .major-open { opacity: 0; pointer-events: none; transform: scale(.8); }
.major-menu.open .major-close { opacity: 1; pointer-events: auto; transform: rotate(180deg); }
.major-menu ul { position: absolute; right: 2px; bottom: 56px; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.major-menu.open ul { pointer-events: auto; }
.major-menu li { opacity: 0; transform: translateY(14px) scale(.9); transition: .22s ease; display: flex; align-items: center; justify-content: flex-end; gap: 7px; white-space: nowrap; }
.major-menu.open li { opacity: 1; transform: translateY(0) scale(1); }
.major-menu li span { min-width: 70px; height: 28px; line-height: 28px; border-radius: 15px; text-align: center; color: #fff; background: rgba(0,0,0,.68); font-size: 12px; padding: 0 8px; }
.major-menu li img, .major-menu li .mini-icon { width: 44px; height: 44px; border-radius: 50%; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.18); display: grid; place-items: center; color: var(--main-color); font-weight: 700; }
.activity-float { display: none; position: fixed; left: calc(50% + min(208px, 50vw - 62px)); bottom: 35%; z-index: 34; width: 50px; height: 57px; place-items: center; border-radius: 16px 16px 18px 18px; color: #fff600; background: linear-gradient(180deg,#ff624c,#d91e18); font-size: 25px; font-weight: 800; box-shadow: 0 6px 16px rgba(217,30,24,.35); }
.app-download-bottom { position: fixed; left: 50%; bottom: calc(50px + var(--safe-bottom)); transform: translateX(-50%); z-index: 29; width: min(480px, 100vw); height: 46px; display: grid; grid-template-columns: 1fr 1fr 104px; align-items: stretch; color: #fff; background: rgba(5,169,82,.95); box-shadow: 0 -2px 8px rgba(0,0,0,.12); }
.app-download-bottom a, .app-download-bottom button { display: grid; place-items: center; color: #fff; font-size: 14px; border-right: 1px solid rgba(255,255,255,.25); }
.app-download-bottom button { border-right: 0; font-size: 13px; }
.tabbar { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 31; width: min(480px, 100vw); height: calc(101.8px + var(--safe-bottom)); padding: 52.8px 0 var(--safe-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid #e5e5e5; }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 49px; color: #777; font-size: 11px; }
.tabbar span { font-size: 20px; line-height: 20px; }
.tabbar .tab-icon { width: 20px; height: 20px; }
.tabbar em { font-style: normal; }
.tabbar button.active { color: var(--main-color); }

.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); }
.announcement-dialog { width: min(312px, calc(100vw - 48px)); height: min(514px, 78vh); background: #fff; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; }
.announcement-dialog h2 { height: 40px; line-height: 40px; margin: 0; text-align: center; font-size: 16px; font-weight: 600; color: #222; border-bottom: 1px solid #f1f1f1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 12px; }
.announcement-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 12px 6px; font-size: 13px; line-height: 1.55; color: #222; }
.announcement-content p { margin: 0 0 8px; }
.announcement-content img { width: 100%; height: auto; margin: 0 auto 8px; }
.dialog-dots { display: flex; justify-content: center; gap: 5px; padding: 2px 0 8px; }
.dialog-dots span { width: 6px; height: 6px; border-radius: 50%; background: #ddd; }
.dialog-dots span.active { background: var(--main-color); }
.announcement-actions { flex: 0 0 44px; height: 44px; border-top: 1px solid #efefef; display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; }
.announcement-actions button { height: 100%; font-size: 14px; }
.announcement-actions button:first-child { color: #999; }
.announcement-actions button:last-child { color: var(--main-color); }
.announcement-actions i { display: block; height: 22px; background: #e5e5e5; }
.search-sheet { width: min(480px, 100vw); height: 100%; background: #f7f7f7; display: flex; flex-direction: column; }
.search-header { height: 50px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; background: #fff; border-bottom: 1px solid #e8e8e8; }
.search-header button { font-size: 34px; color: #555; }
.search-header h2 { margin: 0; text-align: center; font-size: 17px; font-weight: 500; }
.search-form { position: relative; margin: 10px; height: 42px; display: grid; grid-template-columns: 72px 1fr 54px; gap: 8px; align-items: center; }
.color-select { height: 38px; border-radius: 5px; background: #fff; border: 1px solid #e5e5e5; color: #333; font-size: 14px; display: flex; justify-content: center; align-items: center; gap: 5px; }
.color-menu { position: absolute; top: 42px; left: 0; z-index: 3; width: 92px; background: #fff; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.14); overflow: hidden; }
.color-menu button { width: 100%; height: 36px; padding: 0 10px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.color-menu button.active { color: var(--main-color); }
.color-menu button.active span { width: 11px; height: 11px; border-radius: 50%; border: 3px solid var(--main-color); }
#searchInput { width: 100%; height: 38px; border: 1px solid #e5e5e5; border-radius: 5px; padding: 0 32px 0 12px; background: #fff; outline: none; }
#searchInput:focus { border-color: var(--main-color); }
.clear-search { position: absolute; right: 64px; width: 22px; height: 22px; border-radius: 50%; background: #ddd; color: #fff; }
.submit-search { height: 38px; border-radius: 5px; color: #fff; background: var(--main-color); font-size: 14px; }
.search-result { margin: 0 10px; padding: 14px; min-height: 80px; background: #fff; border-radius: 5px; color: #777; font-size: 14px; line-height: 1.6; }
.bottom-overlay { align-items: flex-end; }
.share-sheet { width: min(480px, 100vw); background: #fff; border-radius: 12px 12px 0 0; padding-top: 14px; }
.share-sheet h2 { margin: 0; text-align: center; font-size: 16px; font-weight: 500; }
.share-options { display: grid; grid-template-columns: repeat(3, 1fr); padding: 18px 20px; }
.share-options button { display: flex; flex-direction: column; align-items: center; gap: 7px; color: #555; font-size: 13px; }
.share-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; }
.share-icon.wx { background: #20c25a; }
.share-icon.pyq { background: #60d341; }
.share-icon.sms { background: #4aa9ff; }
.sheet-cancel { width: calc(100% - 24px); margin: 0 12px 12px; height: 40px; border-radius: 20px; color: #fff; background: var(--main-color); }
.chat-dialog { width: 290px; border-radius: 8px; background: #fff; padding: 16px 14px 12px; box-shadow: var(--shadow-soft); }
.chat-dialog h2 { margin: 0 0 12px; text-align: center; font-size: 17px; }
.chat-dialog button { width: 100%; height: 40px; border-radius: 5px; margin-top: 8px; background: #f5f5f5; color: #444; }
.chat-dialog button:last-child { color: #999; background: #fff; border: 1px solid #eee; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px); z-index: 150; max-width: 80vw; padding: 8px 13px; border-radius: 18px; color: #fff; background: rgba(0,0,0,.72); font-size: 13px; opacity: 0; pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .header-main { grid-template-columns: 104px 1fr 126px; padding: 0 8px; }
  .header-actions { gap: 8px; }
  .backup-domain { width: 90px; }
  .feature-grid li { font-size: 11px; }
}

@media (min-width: 481px) {
  .major-menu { left: calc(50% + 184px); }
  .activity-float { left: calc(50% + 180px); }
}


.bottom-lottery-tabs { position: fixed; left: 50%; bottom: calc(118px + var(--safe-bottom)); transform: translateX(-50%); z-index: 30; width: min(480px, 100vw); display: flex; justify-content:center; background: transparent; padding: 0 9.8px; }
.bottom-lottery-tabs ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4.8px; width: 100%; margin-top: 0; }
.bottom-lottery-tabs li { min-width: 0; height: 40px; border-radius: 5px 5px 0 0; border: 1px solid var(--main-color); background: #fff; display:flex; align-items:center; justify-content:center; gap: 3px; color:#666; }
.bottom-lottery-tabs li.active { background: var(--main-color); color:#fff; }
.bottom-lottery-tabs img { width: 21px; height: 21px; object-fit: contain; }
.bottom-lottery-tabs .name { font-size: 12px; line-height: 1; }
.bottom-lottery-tabs .time { font-size: 10px; transform: scale(.9); line-height: 1; }

.bottom-lottery-tabs li:nth-child(2) { border-color: var(--main-red); color: var(--main-red); }
.bottom-lottery-tabs li:nth-child(2).active { background: var(--main-red); color: #fff; }

.balls .plus { align-self: center; width: 16px; line-height: 34px; text-align: center; font-size: 26px; color: #111; margin-top: 0; }
