/* Reference: https://h1131.cc/ — Newapp source parity, 2026-09-24. */
:root {
  --brand: #1f4fa3;
  --brand-dark: #183c7c;
  --accent: #f2c94c;
  --page: #eef3ff;
  --surface: #ffffff;
  --soft: #dfe9ff;
  --text: #15213a;
  --muted: #5f6d8a;
  --line: #c5d3ec;
}

:root {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--page);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--page);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

.maintenance-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 247, 210, 0.92)),
    var(--page);
}

.maintenance-panel {
  width: min(100%, 420px);
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.maintenance-panel strong {
  display: block;
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}

.maintenance-panel p {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

.maintenance-page--loading .maintenance-panel strong {
  color: var(--muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  align-items: center;
  grid-template-columns: 108px minmax(0, 1fr) 108px;
  gap: 8px;
  height: 52px;
  max-height: 52px;
  padding: 0 8px;
  background: var(--brand);
  color: #fff;
}

.site-header--no-backup {
  grid-template-columns: minmax(0, 1fr);
}

.site-header--no-backup .site-title-wrap {
  position: relative;
  justify-content: center;
  width: 100%;
  padding: 0 64px;
}

.header-backup-site {
  display: grid;
  place-items: center;
  align-content: center;
  width: 100%;
  height: 36px;
  border-radius: 5px;
  background: #10c56d;
  color: #fff;
  line-height: 1.05;
  text-align: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.header-backup-site strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 900;
}

.header-backup-site span {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.site-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 8px;
}

.site-title {
  min-width: 0;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-back {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.site-header--no-backup .site-back {
  position: absolute;
  left: 0;
}

.swiper-tabs button,
.tab-strip button,
.detail-toolbar button,
.search-row button,
select {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.back-top {
  position: fixed;
  right: max(12px, calc((100vw - 720px) / 2 + 12px));
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 90%, #111 10%);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  opacity: 0.92;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.home-page,
.gallery-page {
  display: grid;
  /* gap: 8px; */
}

.notice-bar {
    position: relative;
    height: 36px;
    overflow: hidden;
    /* border: 1px solid var(--line); */
    /* background: linear-gradient(90deg, var(--soft),  */
    /* color-mix(in srgb, var(--accent) 28%, var(--soft) 72%)); */
    color: var(--brand-dark);
    line-height: 36px;
    font-size: 13px;
    margin: 0 5px;
}

.notice-marquee {
  display: block;
  width: 100%;
  height: 36px;
  line-height: 36px;
  white-space: nowrap;
}

.notice-marquee span {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  animation: notice-scroll 22s linear infinite;
}

@keyframes notice-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

.home-banner-swiper {
  position: relative;
  overflow: hidden;
  border: 0;
  background: #111;
}

.home-banner-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 750 / 338;
}

.home-banner-slide {
  height: 100%;
  background: #111;
}

.home-banner-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.domain-box {
  overflow: hidden;
  border: 1px solid #d7c469;
  background: #fff;
}

.domain-ribbon {
  height: 24px;
  background:
    repeating-linear-gradient(90deg, rgba(211, 47, 47, 0.12) 0 18px, rgba(255, 213, 79, 0.35) 18px 36px),
    #f3f3ae;
}

.domain-box table {
  width: 100%;
  border-collapse: collapse;
}

.domain-box th {
  height: 34px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
}

.domain-box td {
  width: 50%;
  height: 36px;
  border: 1px solid var(--line);
  text-align: center;
}

.domain-box a {
  color: #006bd6;
  font-weight: 800;
}

.domain-box p {
  margin: 0;
  min-height: 34px;
  padding: 8px 10px;
  background: #fffbd1;
  color: var(--brand-dark);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.swiper-tabs,
.tab-strip {
  display: flex;
  background: #fff;
}

.draw-list {
  position: relative;
  overflow: hidden;
  /* padding: 10px 7px 0; */
  /* border: 1px solid #d7c469; */
  background: #f3f3ae;
}

.draw-list-inner {
  display: grid;
  gap: 0;
}

.draw-more-toggle {
  position: relative;
  z-index: 2;
  display: block;
  width: 100px;
  min-height: 24px;
  margin: -1px auto -26px;
  border: 1px solid #b22b30;
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 2px 4px rgba(0, 0, 0, 0.22);
  color: #333;
  font-size: 13px;
  font-weight: 900;
  line-height: 24px;
  cursor: pointer;
}

.quick-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1;
  padding: 2px 0;
}

.quick-entry-grid :is(button, a) {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.panel,
.draw-card {
  /* border: 1px solid var(--line); */
  background: var(--surface);
}

.draw-card {
  position: relative;
  padding: 14px;
  overflow: hidden;
  /* border-color: rgba(0, 0, 0, 0.08); */
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid #b22b30;
}

.draw-card > * {
  position: relative;
  z-index: 1;
}

.draw-title,
.panel-head,
.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.draw-title {
  display: grid;
  width: 100%;
  color: inherit;
  grid-template-columns: minmax(96px, 1fr) auto minmax(128px, 1fr);
  align-items: start;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
  text-align: left;
}

.draw-title strong {
  min-width: 0;
  overflow: hidden;
  color: #1b2430;
  text-overflow: ellipsis;
  font-size: clamp(13px, 3.7vw, 16px);
  font-weight: 900;
}

.draw-title span {
  color: #9aa0aa;
  font-size: clamp(12px, 3.4vw, 15px);
}

.draw-title p {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: #999;
  text-align: right;
  text-overflow: ellipsis;
  font-size: clamp(12px, 3.2vw, 14px);
}

.draw-title b {
  color: #ff5b13;
  font-size: clamp(13px, 3.7vw, 16px);
}

.article-detail h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.detail-toolbar button,
.search-row button {
  min-height: 32px;
  padding: 0 12px;
  color: var(--brand);
  font-weight: 800;
}

.balls-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  align-items: start;
  margin-top: 10px;
}

.ball-wrap {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.ball {
  display: grid;
  place-items: center;
  min-width: 0;
  width: clamp(44px, 9.6vw, 62px);
  height: clamp(44px, 9.6vw, 62px);
  color: #fff;
  border-radius: 50%;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.16);
}

.ball strong {
  font-size: clamp(17px, 4.2vw, 24px);
  line-height: 1;
}

.ball-meta {
  color: #333;
  line-height: 1.1;
  font-size: 12px;
  white-space: nowrap;
}

.ball.red {
  background: linear-gradient(#ff6969, #ca1010);
}

.ball.blue {
  background: linear-gradient(#5aa7ff, #0f63cf);
}

.ball.green {
  background: linear-gradient(#55cb87, #06914b);
}

.ball.blank {
  border: 1px solid var(--line);
  background: linear-gradient(#ffffff, #f1f3f6);
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.08);
}

.ball.waiting {
  border: 1px solid #e4c76a;
  background: linear-gradient(#fffdf2, #f1f3f6);
  color: #6b7280;
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.08);
}

.draw-info,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.draw-info {
  align-items: center;
  margin-top: 10px;
  color: #222;
  font-size: clamp(12px, 3.3vw, 14px);
  line-height: 1.25;
  white-space: nowrap;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.draw-info b {
  color: #ff5b13;
  font-size: clamp(13px, 3.5vw, 15px);
}

.draw-info a {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(22, 131, 255, 0.22);
  border-radius: 999px;
  background: rgba(22, 131, 255, 0.08);
  color: #1683ff;
  font-size: clamp(12px, 3.3vw, 14px);
  font-weight: 900;
}

.panel-head {
  min-height: 38px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--soft));
}

.panel-head strong {
  color: var(--brand);
  font-size: 16px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.panel-head a {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #fff;
}

.material-grid a {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #333;
  font-size: 13px;
  font-weight: 700;
}

.material-grid a:nth-child(4n) {
  border-right: 0;
}

.doc-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.doc-item {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 42px;
  padding: 7px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: center;
}

.doc-item:hover {
  background: var(--soft);
}

.doc-item:nth-child(3n) {
  border-right: 0;
}

.doc-item strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--brand-dark);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-swiper {
  overflow: hidden;
}

.embedded-swiper {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.swiper-frame {
  position: relative;
  display: grid;
  place-items: center;
  height: 260px;
  overflow: hidden;
  background: #fff;
}

.swiper-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
}

.swiper-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.swiper-image-link {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.swiper-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 28px;
  height: 46px;
  border: 0;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  transform: translateY(-50%);
  font-size: 26px;
}

.swiper-arrow.prev {
  left: 0;
}

.swiper-arrow.next {
  right: 0;
}

.slide-left-enter-active,
.slide-left-leave-active,
.slide-right-enter-active,
.slide-right-leave-active {
  transition: transform 0.32s ease, opacity 0.32s ease;
}

.slide-left-enter-from {
  opacity: 0.7;
  transform: translateX(100%);
}

.slide-left-leave-to {
  opacity: 0.7;
  transform: translateX(-100%);
}

.slide-right-enter-from {
  opacity: 0.7;
  transform: translateX(-100%);
}

.slide-right-leave-to {
  opacity: 0.7;
  transform: translateX(100%);
}

.image-fallback,
.empty-panel {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.swiper-tabs button,
.tab-strip button {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  color: #666;
  font-size: 13px;
  font-weight: 700;
}

.swiper-tabs button.active,
.tab-strip button.active {
  color: var(--brand);
  box-shadow: inset 0 -3px 0 var(--brand);
}

.picture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.picture-grid a {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.picture-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 5px;
  background: var(--soft);
  object-fit: cover;
}

.picture-grid span {
  color: #444;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.pic-panel {
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.pic-list {
  column-count: 2;
  column-gap: 8px;
  padding: 8px;
  background: #fff;
}

.pic-card {
  display: inline-grid;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 8px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.pic-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--soft);
  object-fit: cover;
}

.pic-card span {
  min-height: 32px;
  padding: 0 6px;
  overflow: hidden;
  color: #111;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  line-height: 32px;
}

.pic-more-text {
  display: block;
  width: 120px;
  height: 36px;
  margin: 8px auto 16px;
  border: 0;
  border-radius: 18px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  line-height: 36px;
}

.pic-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}

.pic-modal img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  object-fit: contain;
}

.pic-modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.title-list {
  display: grid;
}

.title-list a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border-bottom: 1px dashed var(--line);
}

.title-list a:last-child {
  border-bottom: 0;
}

.title-list span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.title-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 14px;
}

.article-section {
  overflow: hidden;
  border-color: var(--line);
}

.article-section-title {
  height: 38px;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #fff;
  line-height: 38px;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.article-tab-strip {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.article-tab-strip button {
  position: relative;
  min-height: 40px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.article-tab-strip button:last-child {
  border-right: 0;
}

.article-tab-strip button.active {
  color: var(--brand);
  background: var(--soft);
  box-shadow: inset 0 -3px 0 var(--brand);
}

.reference-title-list {
  background: var(--surface);
}

.reference-title-list a {
  grid-template-columns: 30px minmax(0, 1fr) 40px;
  min-height: 44px;
  padding: 0 10px;
  border-bottom: 1px dashed var(--line);
  background:
    linear-gradient(90deg, var(--soft), transparent 46%),
    var(--surface);
}

.reference-title-list a:nth-child(even) {
  background: var(--surface);
}

.reference-title-list a:hover {
  background:
    linear-gradient(90deg, rgba(255, 245, 214, 0.88), transparent 56%),
    #fff;
}

.reference-title-list a:active {
  background: var(--soft);
}

.reference-title-list span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, var(--accent), var(--brand));
  font-size: 12px;
}

.reference-title-list strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.reference-title-list em {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(201, 24, 24, 0.08);
  color: var(--brand);
  font-style: normal;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
}

.article-list-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.article-list-filter strong {
  color: var(--brand);
}

.article-list-filter select {
  max-width: 120px;
  min-height: 30px;
  padding: 0 8px;
}

.reference-detail {
  padding: 0;
  background: var(--surface);
}

.reference-detail .detail-toolbar {
  min-height: 40px;
  margin: 0;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.reference-detail h1 {
  margin: 0;
  padding: 14px 12px 8px;
  color: var(--brand);
  text-align: center;
  font-size: 20px;
  font-weight: 900;
}

.reference-detail .article-meta {
  justify-content: center;
  margin: 0;
  padding: 0 10px 12px;
  border-bottom: 1px dashed var(--line);
}

.reference-detail .article-meta span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
}

.home-content-section,
.home-feed-section {
  background: var(--surface);
}

.home-flat-title-list {
  border-bottom: 6px solid var(--page);
}

.home-flat-title-list:last-child {
  border-bottom: 0;
}

.home-content-item {
  border-bottom: 6px solid var(--page);
  background: var(--surface);
}

.home-content-item:last-of-type {
  border-bottom: 0;
}

.home-content-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border-bottom: 1px dashed var(--line);
  background: var(--soft);
}

.home-content-title strong {
  overflow: hidden;
  color: var(--brand);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 900;
}

.tool-panel {
  overflow: hidden;
  background: var(--surface);
}

.sxsx-wrap {
  background: #fff;
  color: #111;
  font-size: 14px;
}

.sxsx-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.sxsx-zodiac-table th {
  height: 34px;
  border-bottom: 1px solid #ddd;
  background: #f1f1f1;
  color: #111;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
}

.sxsx-zodiac-table tr,
.sxsx-ref-table tr {
  border-bottom: 1px solid #ececec;
}

.sxsx-name,
.sxsx-ref-name {
  width: 74px;
  padding: 6px 6px;
  border-right: 1px solid #ececec;
  background: #fffdf5;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.sxsx-name strong,
.sxsx-name span {
  display: block;
}

.sxsx-name strong {
  color: #111;
  font-size: 15px;
  line-height: 1.2;
}

.sxsx-name span {
  margin-top: 2px;
  color: #777;
  font-size: 11px;
  line-height: 1.2;
}

.sxsx-ref-name {
  color: #3366ff;
  font-weight: 900;
}

.sxsx-balls {
  padding: 5px 6px;
  text-align: left;
  vertical-align: middle;
}

.sxsx-ball {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 2px 3px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.18);
}

.sxsx-ball.red {
  background: linear-gradient(#ff6a6a, #d81717);
}

.sxsx-ball.blue {
  background: linear-gradient(#5ba8ff, #1267d4);
}

.sxsx-ball.green {
  background: linear-gradient(#58cc86, #07934b);
}

.sxsx-title {
  height: 30px;
  margin: 10px 0 4px;
  background: #f1f1f1;
  color: #111;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  line-height: 30px;
}

.tool-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.tool-list a {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
}

.tool-list strong,
.tool-list span {
  display: block;
}

.tool-list strong {
  color: var(--brand);
  font-size: 14px;
}

.tool-list span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.site-footer {
  padding: 14px 8px calc(14px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.site-footer a {
  color: var(--brand);
  font-weight: 800;
}

.site-footer p {
  margin: 10px 0 0;
}

.page-panel {
  min-height: calc(100vh - 122px);
}

.number-attributes-page {
  padding-bottom: 12px;
}

.number-attributes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.number-attribute-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.number-attribute-ball {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.18);
}

.number-attribute-ball.red { background: linear-gradient(#ff6a6a, #d81717); }
.number-attribute-ball.blue { background: linear-gradient(#5ba8ff, #1267d4); }
.number-attribute-ball.green { background: linear-gradient(#58cc86, #07934b); }

.number-attribute-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  margin: 0;
  min-width: 0;
  font-size: 12px;
}

.number-attribute-card dl div {
  display: flex;
  gap: 4px;
  min-width: 0;
}

.number-attribute-card dt { color: var(--muted); }
.number-attribute-card dd { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.search-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.search-row input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.search-row button.active {
  color: #fff;
  background: var(--brand);
}

.article-page-list a {
  min-height: 42px;
}

.article-detail {
  padding: 10px;
}

.detail-toolbar {
  margin-bottom: 10px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.gallery-grid figure {
  margin: 0;
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 5px;
  background: var(--soft);
}

.gallery-grid figcaption {
  padding-top: 6px;
  text-align: center;
  color: #555;
  font-size: 13px;
}

.history-filter-panel {
  margin: 10px 8px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.history-filter-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.history-filter-row:last-child {
  border-bottom: 0;
}

.history-filter-label {
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.chip-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px;
  border-bottom: 0;
  background: #fff;
  scrollbar-width: none;
  white-space: nowrap;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.year-filter,
.trend-type-filter,
.trend-value-filter {
  background: #fff;
}

.chip-row button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.chip-row button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.log-list {
  position: relative;
  display: grid;
  margin: 0 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.05);
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.log-trend-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  pointer-events: none;
}

.log-table-header,
.log-row {
  display: grid;
  grid-template-columns: minmax(62px, 0.95fr) repeat(7, minmax(40px, 1fr));
  min-width: 344px;
}

.log-table-header {
  position: relative;
  z-index: 6;
  min-height: 38px;
  border-bottom: 2px solid var(--brand);
  background: var(--soft);
}

.log-table-header-cell {
  display: grid;
  place-items: center;
  padding: 6px 1px;
  border-right: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.log-table-header-cell:last-child {
  border-right: 0;
}

.log-row {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--line);
}

.log-issue-cell,
.log-ball-cell {
  display: grid;
  min-height: 56px;
  align-items: center;
  justify-items: center;
  padding: 5px 1px 4px;
  border-right: 1px solid var(--line);
}

.log-table-header-issue,
.log-issue-cell {
  position: sticky;
  left: 0;
}

.log-table-header-issue {
  z-index: 8;
  background: var(--soft);
  color: var(--brand);
}

.log-issue-cell {
  z-index: 5;
  justify-items: center;
  padding-inline: 5px;
  background: var(--soft);
  box-shadow: 1px 0 0 var(--line);
}

.log-row > :last-child {
  border-right: 0;
}

.log-issue-cell strong {
  display: block;
}

.log-issue-cell strong {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.log-ball-cell {
  position: relative;
  align-content: center;
  gap: 3px;
  background: #fff;
}

.log-row:nth-of-type(even) .log-ball-cell:not(.is-special-cell) {
  background: #fffdf8;
}

.log-ball-cell.is-special-cell,
.log-table-header-cell.is-special-cell {
  border-left: 2px solid var(--brand);
  background: var(--soft);
}

.log-ball-cell.is-trend-match-cell {
  background: rgba(255, 91, 19, 0.14);
}

.log-ball-cell span {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 5px rgba(0, 0, 0, 0.12);
}

.log-list.is-trend-active .log-ball-cell span:not(.is-trend-match) {
  opacity: 0.28;
}

.log-ball-cell span.red {
  background: #e93543;
}

.log-ball-cell span.blue {
  background: #1299d8;
}

.log-ball-cell span.green {
  background: #55bd6a;
}

.log-ball-meta {
  position: relative;
  z-index: 4;
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #222;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.1;
}

.load-more {
  display: block;
  width: max-content;
  min-width: 128px;
  min-height: 38px;
  margin: 14px auto;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.load-more:hover {
  border-color: var(--brand);
}

.load-more:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

@media (min-width: 720px) {
  body {
    background:
      linear-gradient(180deg, rgba(255, 250, 188, 0.9), rgba(232, 232, 232, 0.95) 120px),
      #e9e9e9;
  }

  .app-shell {
    width: min(100%, 760px);
    margin-block: 16px;
    border-radius: 8px;
    overflow: clip;
  }

  .swiper-frame {
    height: 380px;
  }

  .back-top {
    right: max(18px, calc((100vw - 760px) / 2 + 18px));
  }
}

@media (min-width: 900px) {
  .home-page {
    gap: 8px;
  }

  .draw-card {
    padding: 14px 16px 28px;
    
  }

  .ball {
    width: 62px;
    height: 62px;
  }

  .quick-entry-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-entry-grid :is(button, a) {
    min-height: 46px;
    font-size: 13px;
  }

  .swiper-frame {
    height: 390px;
  }
}

@media (max-width: 420px) {
  .site-header {
    grid-template-columns: 94px minmax(0, 1fr) 94px;
    gap: 5px;
    padding-inline: 6px;
  }

  .site-header--no-backup {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-backup-site {
    height: 34px;
  }

  .header-backup-site strong {
    font-size: 13px;
  }

  .header-backup-site span {
    font-size: 11px;
  }

  .site-title {
    font-size: 16px;
  }

  .balls-row {
    gap: 3px;
  }

  .quick-entry-grid,
  .material-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .number-attributes-grid {
    grid-template-columns: 1fr;
  }
}

.content-html,
.home-content-html {
  overflow-x: auto;
  margin-top: 12px;
  padding: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
}

.home-content-html {
  margin: 0;
  border-radius: 0;
  font-size: 14px;
}

.reference-detail .content-html {
  margin: 0;
  padding: 10px;
  border-radius: 0;
}

.content-html p,
.home-content-html p {
  margin: 0 0 8px;
}

.content-html table,
.home-content-html table {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 10px;
  border-color: var(--line);
  border-collapse: collapse;
}

.home-content-html table {
  margin-bottom: 8px;
}

.reference-detail .content-html table {
  border-color: var(--line);
}

.content-html td,
.content-html th,
.home-content-html td,
.home-content-html th {
  padding: 6px;
  border: 1px solid var(--line);
  border-color: var(--line);
  text-align: center;
  font-weight: 700;
}

.content-html th,
.home-content-html th {
  background: var(--soft);
  color: var(--brand);
}

.content-html img,
.home-content-html img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.content-html a,
.home-content-html a {
  color: var(--brand);
  text-decoration: underline;
}

.prediction-hit,
.prediction-result-strong {
  padding: 0 2px;
  border-radius: 2px;
  background: #fff0b8;
  color: #c1121f;
  font-weight: 900;
}

.prediction-result-miss {
  color: #59616b;
  font-weight: 700;
}

/* Homeweb behavior hooks; original visual rules above are copied unchanged. */
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.site-back { display: inline-grid; place-items: center; }
.swiper-tabs [aria-selected="true"] { color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }
.home-modal { width: 100%; height: 100%; max-width: 100vw; max-height: 100dvh; padding: 20px; margin: 0; border: 0; background: transparent; color: #fff; }
.home-modal[open] { display: grid; place-items: center; }
.home-modal::backdrop { background: rgba(0,0,0,.78); }
.home-modal img { max-width: 100%; max-height: calc(100dvh - 40px); object-fit: contain; }
.home-modal [data-action="close-modal"] { position: fixed; top: 16px; right: 16px; border: 0; border-radius: 50%; width: 44px; height: 44px; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .notice-marquee span { animation: none; padding-left: 0; } }
