:root {
  --ink: #173e35;
  --green: #164c40;
  --muted: #72877e;
  --gold: #b59653;
  --paper: #f7f7f0;
  --line: #e0e7df;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.7 -apple-system,
    BlinkMacSystemFont,
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
header {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 4px;
}
.seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 50px;
  background: var(--green);
  border: 1px solid var(--gold);
  outline: 3px solid #e8e2cb;
  border-radius: 13px;
  color: #e9d8a9;
  font-family: serif;
  font-size: 29px;
}
nav {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 14px;
}
nav a {
  padding: 7px 0;
  border-bottom: 2px solid transparent;
}
nav a.active {
  border-color: var(--gold);
  color: #886a29;
}
#menu {
  display: none;
}
main {
  max-width: 1152px;
  margin: auto;
  padding: 0 20px 48px;
}
.hero {
  min-height: 370px;
  border-radius: 24px;
  padding: 60px;
  color: #f8f4e7;
  position: relative;
  overflow: hidden;
  background: linear-gradient(100deg, #0c322d, #21604e);
}
.hero:before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #0e352edf, transparent),
    url('/hero-gold.png') center/cover;
  opacity: 0.92;
}
.hero > * {
  position: relative;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 4px;
  color: #dcc58b;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 3px;
  margin: 18px 0;
}
.hero p {
  color: #d5e3d8;
  margin: 10px 0 25px;
}
.button {
  display: inline-block;
  border: 0;
  background: var(--green);
  color: white;
  border-radius: 9px;
  padding: 10px 20px;
}
.hero .button {
  background: #e1cd99;
  color: #123e32;
  margin-right: 12px;
}
.button.secondary {
  background: transparent;
  color: inherit;
  border: 1px solid var(--line);
}
.notice {
  margin: 20px 0 30px;
  font-size: 13px;
  padding: 12px 18px;
  border-left: 3px solid var(--gold);
  background: #eeefe5;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 15px;
}
.section-head h2 {
  font-size: 23px;
  margin: 0;
}
.section-head a {
  font-size: 13px;
  color: var(--muted);
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 25px;
}
.draw-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.tag {
  background: #edf3ec;
  color: #41705d;
  padding: 3px 10px;
  border-radius: 30px;
  font-size: 12px;
}
.balls {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 30px auto;
}
.ball {
  aspect-ratio: 1;
  max-width: 70px;
  width: 100%;
  border: 3px solid #c7d7c9;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: auto;
  color: #aac0ae;
  background: linear-gradient(145deg, #fff, #eff4eb);
  font-size: 28px;
}
.subtle {
  font-size: 13px;
  color: var(--muted);
}
.center {
  text-align: center;
}
.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}
.quick a {
  background: #e9eee4;
  padding: 25px;
  border-radius: 12px;
  transition:
    transform 0.2s,
    background 0.2s;
}
.quick a:hover {
  transform: translateY(-3px);
  background: #dfe8d9;
}
.quick b {
  display: block;
}
.quick span {
  font-size: 13px;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.image-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.image-card img {
  width: 100%;
  height: auto;
  display: block;
}
.image-card .blank {
  height: 230px;
  background: linear-gradient(145deg, #fafbf7, #f0f3eb);
}
.image-card p {
  padding: 12px 15px;
  margin: 0;
}
.image-card small {
  display: block;
  color: var(--muted);
}
.material {
  margin: 14px 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.material h3 {
  background: #e6eddf;
  margin: 0;
  padding: 12px 20px;
  font-size: 17px;
}
.material .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 20px;
}
.material .meta {
  padding: 0 20px 15px;
  font-size: 12px;
  color: var(--muted);
}
.page-title {
  padding: 30px 0 15px;
}
.page-title h1 {
  margin: 0;
  font-size: 30px;
}
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
footer {
  background: #153b32;
  color: #d6dfd5;
  padding: 35px 24px;
  text-align: center;
  font-size: 13px;
}
footer b {
  font-size: 20px;
  color: #ead9ae;
}
footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.admin-form label {
  font-size: 14px;
}
.admin-form input,
.admin-form select,
.admin-form textarea {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #c3d4c6;
  border-radius: 7px;
  background: white;
  color: var(--ink);
}
.admin-form .full {
  grid-column: 1/-1;
}
.admin-form textarea {
  min-height: 300px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
.admin-item {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.admin-item small {
  display: block;
  color: var(--muted);
}
.feedback {
  min-height: 30px;
  color: #825b1c;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid #caad68;
  outline-offset: 3px;
}
@media (max-width: 800px) {
  header {
    padding: 18px 20px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 21px;
  }
  #menu {
    display: block;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    color: var(--ink);
    font-size: 21px;
  }
  nav {
    display: none;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 10px 24px;
  }
  nav.open {
    display: flex;
  }
  .hero {
    padding: 32px 25px;
    min-height: 330px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 14px;
    max-width: 260px;
  }
  .quick {
    grid-template-columns: 1fr;
  }
  .quick a {
    padding: 18px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .balls {
    gap: 8px;
  }
  .ball {
    font-size: 20px;
    border-width: 2px;
  }
  .panel {
    padding: 18px;
  }
  .draw-head {
    font-size: 14px;
    align-items: center;
  }
  .image-card .blank {
    height: 210px;
  }
  .admin-form {
    grid-template-columns: 1fr;
  }
  .admin-form .full {
    grid-column: auto;
  }
  .hero:before {
    background-position: 65% center;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
[hidden] {
  display: none !important;
}
.hero h1 {
  white-space: pre-line;
}
/* 香槟金主题 */
:root {
  --ink: #4c3212;
  --green: #8d5b12;
  --muted: #92794d;
  --gold: #cda94b;
  --paper: #fff8e5;
  --line: #ebd39b;
}
body {
  background: radial-gradient(ellipse at 50% 0, #fff4c7 0, transparent 52%), #fffaf0;
}
header {
  border-bottom: 1px solid #dec28b;
  margin-bottom: 22px;
}
.brand {
  color: #76460c;
  text-shadow: 0 1px #fff;
}
.seal {
  background: linear-gradient(140deg, #ffedac, #c89a35 52%, #875319);
  color: #fff9db;
  outline-color: #f2dda7;
  border-color: #9e6a1f;
  box-shadow: 0 5px 15px #ad803f30;
}
.hero {
  background: #3f260e;
  border: 2px solid #d8b45d;
  box-shadow:
    0 12px 35px #a7792828,
    inset 0 0 0 5px #f5dc9d;
}
.hero:before {
  background-image: linear-gradient(90deg, #281504d9, #28150410), url('/hero-gold.png');
}
.hero h1 {
  color: #ffe7a0;
  text-shadow: 0 2px 5px #0008;
}
.hero .eyebrow {
  color: #f7d98c;
}
.hero p {
  color: #ffefc7;
}
.hero .button {
  background: linear-gradient(120deg, #ffe9a5, #c99b3b, #f7df96);
  box-shadow: 0 4px 15px #07030055;
  border: 1px solid #f7df9a;
  color: #54330d;
  font-weight: 600;
}
.hero .button.secondary {
  background: #38250b66;
  color: #ffebbe;
}
.notice {
  background: linear-gradient(90deg, #fff0bc, #fff9e8);
  border: 1px solid #edcf85;
  border-left: 4px solid #bd8a2a;
  color: #806022;
  border-radius: 9px;
}
.panel {
  background: linear-gradient(145deg, #fffef9, #fff9e8);
  box-shadow: 0 5px 18px #ad80300b;
}
.tag {
  background: #f7e7b9;
  color: #895e19;
}
.ball {
  border-color: #d8b560;
  background: linear-gradient(145deg, #fffef1, #f5e2ac);
  box-shadow:
    inset 0 0 0 3px #fff9df,
    0 3px 8px #c1973c22;
}
.quick a {
  border: 1px solid #dfbf71;
  background: linear-gradient(115deg, #f7e5b5, #fff9e6, #ead18f);
}
.quick a:hover {
  background: #f7e4a9;
}
.section-head {
  border-left: 4px solid #be8a2c;
  padding-left: 13px;
}
.section-head h2 {
  color: #6b4611;
}
.material h3 {
  background: linear-gradient(100deg, #d3b46a, #fff0c4, #d6b975);
  color: #57390f;
}
.image-card {
  box-shadow: 0 4px 14px #9b712115;
}
.image-card .blank {
  background: linear-gradient(135deg, #fffdf7, #fcf3db);
}
footer {
  background: linear-gradient(120deg, #3a250c, #644111, #30200b);
  border-top: 3px solid #cca247;
  color: #e0c795;
}
footer b {
  color: #ffe2a2;
}
.button {
  background: linear-gradient(120deg, #997022, #b58a34);
}
.button.secondary {
  background: #fffaf0;
}
.admin-form input,
.admin-form select,
.admin-form textarea {
  border-color: #dbc38e;
}
.hero:after {
  content: '';
  position: absolute;
  right: 8%;
  top: 15%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff4b0;
  box-shadow:
    -24px 88px 9px 2px #ffecb5,
    75px 42px 5px #ffe8a2,
    -110px 200px 6px #fff1b5,
    30px 230px 8px #ffe795,
    135px 160px 5px #fff6cf;
  animation: goldglow 3.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes goldglow {
  50% {
    opacity: 0.2;
    filter: blur(1px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero:after {
    animation: none;
  }
}

/* 开奖展示：七球与生肖 */
.result-panel {
  max-width: 820px;
  margin: auto;
  background: #fffefb;
  border-color: #e7c796;
  padding: 22px 24px;
  color: #242424;
}
.result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
  align-items: center;
}
.draw-red {
  color: #d71916;
}
.result-balls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 18px minmax(0, 1fr);
  gap: 10px;
  margin: 22px auto 8px;
  max-width: 650px;
  align-items: start;
}
.draw-cell {
  min-width: 0;
  text-align: center;
}
.result-ball {
  --ball: #ed242e;
  width: clamp(30px, 6vw, 58px);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: auto;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 27% 15%, #fff 0 5%, transparent 24%),
    radial-gradient(ellipse at 70% 85%, #ffffffdb 0 5%, transparent 22%),
    linear-gradient(135deg, var(--ball), #fff 47%, var(--ball) 56%, var(--ball));
  box-shadow:
    inset -3px -4px 6px #0003,
    inset 2px 2px 3px #fff8,
    0 2px 5px #0001;
}
.result-ball.green {
  --ball: #20b934;
}
.result-ball.blue {
  --ball: #3457d6;
}
.result-ball .number {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 40% 30%, #fff, #f8f8f8 65%, #ddd);
  width: 65%;
  height: 65%;
  border-radius: 50%;
  font-size: clamp(18px, 3vw, 30px);
  font-weight: 750;
  line-height: 1;
  color: #111;
}
.draw-zodiac {
  font-size: 21px;
  margin-top: 10px;
  line-height: 1.4;
  min-height: 30px;
}
.draw-plus {
  font-weight: 800;
  color: #d71916;
  font-size: 25px;
  line-height: 58px;
  text-align: center;
}
.result-status {
  text-align: center;
  font-size: 12px;
  color: #92794d;
  margin: 6px 0;
}
.result-next {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding-top: 8px;
}
.result-top b {
  white-space: nowrap;
}
@media (max-width: 540px) {
  .result-panel {
    padding: 15px 10px;
  }
  .result-top {
    font-size: 12px;
    gap: 5px;
  }
  .result-balls {
    gap: 5px;
    grid-template-columns: repeat(6, minmax(0, 1fr)) 10px minmax(0, 1fr);
    margin-top: 18px;
  }
  .result-ball {
    width: min(100%, 42px);
  }
  .draw-plus {
    font-size: 20px;
    line-height: 38px;
  }
  .draw-zodiac {
    font-size: 18px;
    margin-top: 8px;
  }
  .result-next {
    font-size: 12px;
  }
  .result-top .draw-red {
    font-size: 12px;
  }
}

.nine-material {
  border: 1px solid #c89b37;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin: 18px 0;
}
.nine-material h3 {
  margin: 0;
  text-align: center;
  background: linear-gradient(100deg, #ffe69b, #ffce42);
  color: #653a0b;
  padding: 13px;
  font-size: 18px;
}
.nine-period + .nine-period {
  border-top: 2px solid #d8b365;
}
.nine-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 85px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 49px;
  border-bottom: 1px solid #f0e4d4;
}
.nine-row:nth-child(even) {
  background: #fffbf5;
}
.nine-label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
}
.issue-badge {
  background: #a92213;
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 700;
}
.nine-value {
  text-align: center;
  font-size: 15px;
  font-weight: 650;
  color: #292929;
  overflow-wrap: anywhere;
  min-width: 0;
}
.nine-result {
  text-align: right;
  font-size: 12px;
  color: #92794d;
  white-space: nowrap;
}
.nine-empty {
  text-align: center;
  font-size: 12px;
  color: #92794d;
  padding: 8px;
}
.nine-material mark {
  background: #ffe569;
  color: inherit;
}
@media (max-width: 600px) {
  .nine-row {
    grid-template-columns: 104px minmax(0, 1fr) 42px;
    gap: 4px;
    padding: 10px 6px;
  }
  .nine-label {
    gap: 4px;
    font-size: 11px;
  }
  .issue-badge {
    font-size: 10px;
    padding: 2px 3px;
  }
  .nine-value {
    font-size: 12px;
    line-height: 1.7;
  }
  .nine-result {
    font-size: 10px;
  }
  .nine-material h3 {
    font-size: 16px;
  }
}

.simulation-label {
  color: #8b3e16;
  background: #fff0cc;
  border: 1px solid #d9ad51;
  border-radius: 8px;
  padding: 5px 10px;
  white-space: nowrap;
}
.result-panel .draw-zodiac {
  font-size: clamp(10px, 2.7vw, 18px);
}
.actions select {
  padding: 10px;
  max-width: 100%;
}

.draw-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 20px;
  align-items: stretch;
}
.draw-overview > .result-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  min-width: 0;
}
.draw-overview > .quick {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, 1fr);
  margin: 0;
  gap: 12px;
}
.draw-overview > .quick a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 22px;
}
.draw-overview .result-balls {
  gap: 6px;
}
@media (max-width: 760px) {
  .draw-overview {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .draw-overview > .quick {
    grid-template-rows: repeat(3, auto);
    gap: 8px;
  }
  .draw-overview > .quick a {
    padding: 12px 16px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  .draw-overview > .quick span {
    font-size: 12px;
  }
}

/* 紧凑开奖记录：日期期号与七球同行 */
.history-layout {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.history-years {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: sticky;
  top: 16px;
}
.history-years h2 {
  font-size: 18px;
  margin: 0 0 8px;
  color: #906623;
}
.history-years button {
  border: 0;
  background: transparent;
  color: #6d5b3b;
  font-size: 17px;
  border-radius: 7px;
  padding: 8px;
  text-align: left;
}
.history-years button.active {
  background: #f3e1ad;
  color: #67420e;
  font-weight: 700;
}
.history-content {
  min-width: 0;
}
.history-toolbar {
  margin: 0 0 12px;
}
.history-toolbar select {
  display: none;
}
.history-list {
  background: #fffefb;
  border: 1px solid #e8d7b6;
  border-radius: 10px;
  overflow: hidden;
}
.history-row {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  align-items: center;
  padding: 12px 14px;
  gap: 14px;
  color: #262626;
}
.history-row + .history-row {
  border-top: 1px solid #e8dfcf;
}
.history-row:nth-child(even) {
  background: #fffcf5;
}
.history-date {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}
.history-date b {
  font-weight: 600;
  font-size: 14px;
}
.history-row .result-balls {
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 6px;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 14px minmax(0, 1fr);
}
.history-row .result-ball {
  width: min(100%, 43px);
}
.history-row .result-ball .number {
  font-size: 23px;
}
.history-row .draw-zodiac {
  font-size: 15px;
  line-height: 1.3;
  min-height: 0;
  margin-top: 5px;
  white-space: nowrap;
}
.history-row .draw-plus {
  font-size: 22px;
  line-height: 43px;
}
@media (max-width: 900px) {
  .history-layout {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 14px;
  }
  .history-row {
    grid-template-columns: 150px minmax(0, 1fr);
    padding: 10px;
    gap: 8px;
  }
  .history-date {
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
  }
  .history-row .result-ball .number {
    font-size: 20px;
  }
  .history-row .draw-zodiac {
    font-size: 12px;
  }
}
@media (max-width: 640px) {
  .history-layout {
    display: block;
  }
  .history-years {
    display: none;
  }
  .history-toolbar select {
    display: block;
    padding: 6px 10px;
  }
  .history-toolbar {
    font-size: 13px;
  }
  .history-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 9px;
  }
  .history-date {
    flex-direction: row;
    justify-content: space-between;
    font-size: 13px;
  }
  .history-date b {
    font-size: 13px;
  }
  .history-row .result-balls {
    gap: 4px;
    grid-template-columns: repeat(6, minmax(0, 1fr)) 10px minmax(0, 1fr);
  }
  .history-row .result-ball {
    width: min(100%, 36px);
  }
  .history-row .result-ball .number {
    font-size: 20px;
  }
  .history-row .draw-zodiac {
    font-size: 12px;
    margin-top: 4px;
  }
  .history-row .draw-plus {
    line-height: 36px;
    font-size: 19px;
  }
}

@media (max-width: 350px) {
  .history-row {
    padding: 9px 7px;
  }
  .history-row .result-balls {
    gap: 2px;
    grid-template-columns: repeat(6, minmax(0, 1fr)) 9px minmax(0, 1fr);
  }
  .history-row .draw-zodiac {
    font-size: 10px;
  }
  .history-row .result-ball .number {
    font-size: 17px;
  }
  .history-row .draw-plus {
    font-size: 16px;
    line-height: 30px;
  }
}

/* 品牌区与正文统一边界 */
header {
  max-width: 1152px;
  padding: 24px 20px;
  border-bottom: 0;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.brand {
  font-size: 48px;
  line-height: 1.12;
  gap: 14px;
}
.brand small {
  font-size: 11px;
  letter-spacing: 4px;
  margin-top: 10px;
}
.seal {
  flex-shrink: 0;
  outline: 0;
  box-shadow: none;
  border: 0;
  background: linear-gradient(140deg, #f1d58d, #bb872c);
  border-radius: 12px;
}
header nav {
  margin-left: auto;
}
@media (max-width: 800px) {
  header {
    padding: 20px;
    gap: 12px;
  }
  .brand {
    font-size: 42px;
    gap: 10px;
  }
  .seal {
    width: 40px;
    height: 46px;
    font-size: 28px;
  }
  .brand small {
    font-size: 10px;
    letter-spacing: 2px;
  }
  #menu {
    margin-left: auto;
  }
  header nav {
    margin-left: 0;
  }
}
@media (max-width: 380px) {
  .brand {
    font-size: 36px;
    gap: 8px;
  }
  .seal {
    width: 34px;
    height: 40px;
    font-size: 25px;
  }
  header {
    gap: 8px;
  }
  #menu {
    font-size: 18px;
    padding: 1px 5px;
  }
}

/* 用户选择的04号品牌 */
.brand {
  display: block;
  width: 400px;
  max-width: calc(100% - 48px);
  line-height: 0;
}
.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}
header {
  padding-top: 8px;
  padding-bottom: 8px;
}
@media (max-width: 800px) {
  .brand {
    width: 340px;
  }
}
@media (max-width: 380px) {
  .brand {
    max-width: calc(100% - 38px);
  }
}

.managed-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #301c0b;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}
.managed-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.managed-hero h1 {
  white-space: pre-line;
}

/* 球环厚度由17.5%减至10.5%，号码不随球环转动。 */
.result-ball {
  background: none;
  box-shadow: none;
  isolation: isolate;
}
.result-ball::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: -1;
  background:
    radial-gradient(ellipse at 27% 15%, #fff 0 5%, transparent 24%),
    radial-gradient(ellipse at 70% 85%, #ffffffdb 0 5%, transparent 22%),
    linear-gradient(135deg, var(--ball), #fff 47%, var(--ball) 56%, var(--ball));
  box-shadow:
    inset -3px -4px 6px #0003,
    inset 2px 2px 3px #fff8,
    0 2px 5px #0001;
}
.result-ball .number {
  width: 79%;
  height: 79%;
}
.draw-overview .result-ball::before {
  animation: result-ring-spin 3s linear infinite;
}
@keyframes result-ring-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .draw-overview .result-ball::before {
    animation: none;
  }
}

/* 开奖历史上下留白缩小30%，保持球和字体原尺寸。 */
.history-row {
  padding-top: 8.4px;
  padding-bottom: 8.4px;
}
.history-row .draw-zodiac {
  margin-top: 3.5px;
}
@media (max-width: 900px) {
  .history-row {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}
@media (max-width: 640px) {
  .history-row {
    row-gap: 5.6px;
  }
  .history-row .draw-zodiac {
    margin-top: 2.8px;
  }
}
@media (max-width: 350px) {
  .history-row {
    padding-top: 6.3px;
    padding-bottom: 6.3px;
  }
}

.nine-value mark {
  background: #ffe04a;
  color: #222;
  padding: 1px 2px;
  border-radius: 3px;
}
.nine-result.announced {
  color: #a73522;
}
@media (max-width: 600px) {
  .nine-row {
    grid-template-columns: 100px minmax(0, 1fr) 65px;
  }
}

.nine-value .wave-red {
  color: #c62828;
}
.nine-value .wave-blue {
  color: #2255b6;
}
.nine-value .wave-green {
  color: #13843c;
}

.asia-twelve-value {
  color: #23459c;
  white-space: nowrap;
  letter-spacing: -0.25px;
}
.asia-twelve-value mark {
  color: #23459c;
}
@media (max-width: 600px) {
  .nine-row:has(.asia-twelve-value) {
    grid-template-columns: 42px minmax(0, 1fr) 64px;
    gap: 3px;
  }
  .asia-twelve-value {
    font-size: clamp(8px, 2.45vw, 12px);
  }
}

.six-ten-period {
  margin: 10px 0;
  background: #fffaf0;
  border-radius: 10px;
  overflow: hidden;
}
.six-ten-period:nth-child(odd) {
  background: #fffaf0;
}
.six-ten-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f5e2ad;
  padding: 10px 12px;
  color: #71501f;
}
.six-ten-head span {
  font-size: 12px;
}
.six-ten-period .nine-row {
  border: 0;
  min-height: 36px;
  padding: 8px 10px;
}
.six-ten-period .nine-row:nth-child(odd) {
  background: #ffffff70;
}
.six-ten-numbers {
  color: #24469a;
  white-space: nowrap;
}
.six-ten-numbers mark {
  color: #24469a;
}
@media (max-width: 600px) {
  .six-ten-period .nine-row {
    grid-template-columns: 63px minmax(0, 1fr) 62px;
    gap: 3px;
  }
  .six-ten-numbers {
    font-size: clamp(9px, 2.5vw, 12px);
    letter-spacing: -0.3px;
  }
}

/* Keep every row of 七肖14码 on the same center column. */
.asia-seven-fourteen .nine-row {
  grid-template-columns: 125px minmax(0, 1fr) 64px;
}
.asia-fourteen-value {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1px 0.4em;
  font-variant-numeric: tabular-nums;
}
.asia-fourteen-value > span {
  white-space: nowrap;
}
@media (max-width: 600px) {
  .asia-seven-fourteen .nine-row {
    grid-template-columns: 90px minmax(0, 1fr) 50px;
  }
  .asia-seven-fourteen .nine-value {
    font-size: 14px;
  }
}

.asia-nine-zodiac .nine-row {
  grid-template-columns: 70px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 3px;
}
.asia-nine-zodiac .nine-label,
.asia-nine-zodiac .nine-value,
.asia-nine-zodiac .nine-result {
  white-space: nowrap;
}
.asia-nine-zodiac .nine-value {
  text-align: center;
  letter-spacing: 0;
  font-size: 13px;
}
.asia-nine-zodiac .nine-row > :last-child {
  white-space: nowrap;
}
@media (max-width: 420px) {
  .asia-nine-zodiac .nine-row {
    grid-template-columns: 58px minmax(0, 1fr) 66px;
    padding-inline: 4px;
  }
  .asia-nine-zodiac .nine-value {
    font-size: 11px;
  }
  .asia-nine-zodiac .nine-label {
    font-size: 10px;
  }
}

/* 首页三个入口压缩高度，文字保持原有大小 */
main > .quick > a {
  height: 71px;
  padding: 8px 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
@media (max-width: 760px) {
  main > .quick > a {
    height: 61px;
    padding: 4px 18px;
  }
}

/* 首页金色横幅高度缩减约三成 */
.hero {
  min-height: 280px;
  padding: 20px 60px;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.25;
  margin: 10px 0;
}
.hero p {
  margin: 8px 0 14px;
}
@media (max-width: 640px) {
  .hero {
    min-height: 231px;
    padding: 16px 20px;
  }
  .hero h1 {
    font-size: 28px;
    line-height: 1.2;
    margin: 8px 0;
  }
  .hero p {
    font-size: 12px;
    margin: 6px 0 10px;
  }
  .hero .button {
    padding: 8px 14px;
    font-size: 14px;
  }
}

.compact-draw {
  margin-top: 18px;
  padding: 18px 20px 12px;
  border: 1px solid #b2e8c6;
  border-radius: 15px;
  background: linear-gradient(140deg, #f9fffb, #fff);
  color: #257047;
}
.compact-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.compact-countdown {
  color: #f47824;
  font-size: 12px;
}
.compact-balls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 12px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  margin: 16px 0 12px;
}
.compact-cell {
  text-align: center;
  min-width: 0;
}
.compact-ball {
  --ball: #16cf39;
  position: relative;
  width: clamp(30px, 6vw, 64px);
  aspect-ratio: 1;
  margin: auto;
  isolation: isolate;
}
.compact-ball.red {
  --ball: #ff263d;
}
.compact-ball.blue {
  --ball: #11baff;
}
.compact-ball i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 10deg,
    var(--ball) 0 20%,
    #fff 24%,
    var(--ball) 28% 48%,
    #fff 52%,
    var(--ball) 56% 76%,
    #fff 80%,
    var(--ball) 84%
  );
  box-shadow: inset 0 0 0 1px #ffffff70;
  animation: compact-spin 3s linear infinite;
}
.compact-ball i:after {
  content: '';
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background: #fff;
}
.compact-ball b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #080808;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.compact-zodiac {
  display: block;
  margin-top: 5px;
  color: #527660;
  font-size: 14px;
  white-space: nowrap;
}
.compact-plus {
  color: #ff3447;
  font-weight: bold;
  align-self: center;
  margin-top: -22px;
  text-align: center;
}
.compact-dates {
  border-top: 1px solid #e7efea;
  text-align: center;
  padding-top: 9px;
  font-size: 12px;
  line-height: 1.9;
}
.compact-dates > div + div {
  color: #788d80;
}
@keyframes compact-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 640px) {
  .compact-draw {
    padding: 12px 10px 9px;
  }
  .compact-heading {
    font-size: 11px;
    gap: 4px;
  }
  .compact-countdown {
    font-size: 10px;
  }
  .compact-balls {
    gap: 2px;
    grid-template-columns: repeat(6, minmax(0, 1fr)) 8px minmax(0, 1fr);
    margin-top: 12px;
  }
  .compact-ball {
    width: 100%;
    max-width: 48px;
  }
  .compact-ball b {
    font-size: clamp(21px, 6vw, 30px);
  }
  .compact-zodiac {
    font-size: 12px;
  }
  .compact-dates {
    font-size: 10px;
  }
}

/* 开奖框与首页金色主题统一 */
.compact-draw {
  border-color: #e3bd70;
  background: linear-gradient(125deg, #fff9e9, #fffdf6 58%, #faedc9);
  color: #714a18;
  box-shadow: 0 3px 12px #b88b2210;
}
.compact-countdown {
  color: #b77217;
}
.compact-heading > a {
  color: #95651f;
}
.compact-zodiac {
  color: #816b47;
}
.compact-dates {
  border-top-color: #ead9b5;
  color: #926720;
}
.compact-dates > div + div {
  color: #958260;
}

.nine-row:has(:is(.asia-thirty-six-value, .asia-thirty-five-value)) {
  grid-template-columns: 62px minmax(0, 1fr) 62px;
  gap: 4px;
}
.asia-thirty-six-value,
.asia-thirty-five-value {
  display: grid;
  justify-items: center;
  font-variant-numeric: tabular-nums;
}
:is(.asia-thirty-six-value, .asia-thirty-five-value) > span {
  white-space: nowrap;
}
@media (max-width: 600px) {
  .nine-row:has(:is(.asia-thirty-six-value, .asia-thirty-five-value)) {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
  .asia-thirty-six-value {
    font-size: clamp(10px, 3.4vw, 13px);
  }
}

.asia-thirty-five-value {
  container-type: inline-size;
}
.asia-thirty-five-value > span {
  font-size: min(15px, 2.95cqi);
}

/* 号码固定两行；27码按14＋13个分行，保持标黄与数字居中 */
.asia-split-number-value {
  display: grid;
  justify-items: center;
  container-type: inline-size;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}
.asia-split-number-value > span {
  white-space: nowrap;
  font-size: min(15px, 4.5cqi);
}
.asia-split-number-value mark {
  padding-inline: 0;
}
@media (max-width: 600px) {
  .nine-row:has(.asia-split-number-value) {
    grid-template-columns: 60px minmax(0, 1fr) 55px;
    gap: 4px;
  }
  .nine-row:has(.asia-split-number-value) .nine-label {
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
  }
  .asia-split-number-value > span {
    font-size: min(12px, 4.5cqi);
  }
}

/* 七肖14码与图库亚洲使用相同的分期结构 */
.seven-fourteen-period {
  --period-bg: #e5f3eb;
  --period-head: #c5e5d2;
  --period-text: #285d43;
  background: var(--period-bg);
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
  color: var(--period-text);
}
.seven-fourteen-period:nth-of-type(4n + 2) {
  --period-bg: #e8effb;
  --period-head: #cfddf7;
  --period-text: #304f8b;
}
.seven-fourteen-period:nth-of-type(4n + 3) {
  --period-bg: #fcf0e3;
  --period-head: #f3d5b5;
  --period-text: #805127;
}
.seven-fourteen-period:nth-of-type(4n + 4) {
  --period-bg: #f1ebf9;
  --period-head: #e0d3ef;
  --period-text: #65477d;
}
.seven-fourteen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  background: var(--period-head);
  font-size: 14px;
}
.seven-fourteen-head span {
  font-size: 11px;
}
.seven-fourteen-period .nine-row {
  grid-template-columns: 78px minmax(0, 1fr) 66px;
  gap: 4px;
  padding: 6px;
  min-height: 32px;
  border: 0;
  container-type: normal;
}
.seven-fourteen-period .nine-row:nth-child(odd) {
  background: #ffffff66;
}
.seven-fourteen-period .nine-label {
  color: inherit;
  font-size: 11px;
}
.seven-fourteen-period .nine-label b {
  display: block !important;
}
.seven-fourteen-period .nine-value {
  display: block;
  text-align: center;
  container-type: inline-size;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.5;
}
.seven-fourteen-period .seven-fourteen-numbers > span {
  font-size: min(13px, 3.9cqi);
  color: #24469a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.15px;
}
.seven-fourteen-period mark {
  padding-inline: 0;
}
.seven-fourteen-period .nine-result {
  font-size: 10px;
}
@media (max-width: 400px) {
  .seven-fourteen-period .nine-row {
    grid-template-columns: 64px minmax(0, 1fr) 54px;
    gap: 2px;
    padding: 6px 3px;
  }
  .seven-fourteen-period .nine-label {
    font-size: 10px;
  }
  .seven-fourteen-period .nine-result {
    font-size: 9px;
  }
}

/* 号码隐藏行内重复名称，按容器宽度保持完整居中 */
.nine-row:has(.asia-split-number-value) .nine-label b {
  display: none;
}
.asia-split-number-value > span {
  font-size: calc(min(15px, 4.5cqi) + 1px);
}
@media (max-width: 600px) {
  .asia-split-number-value > span {
    font-size: calc(min(12px, 4.5cqi) + 1px);
  }
}

/* 指定13项正文增大2px；标题和期号徽标保持原字号 */
.enlarged-material .nine-label {
  font-size: 15px;
}
.enlarged-material .nine-value {
  font-size: 17px;
}
.enlarged-material .nine-result {
  font-size: 14px;
}
.enlarged-material.asia-nine-zodiac .nine-value {
  font-size: 15px;
}
@media (max-width: 600px) {
  .enlarged-material .nine-label {
    font-size: 13px;
  }
  .enlarged-material .nine-value {
    font-size: 14px;
  }
  .enlarged-material .nine-result {
    font-size: 12px;
  }
  .enlarged-material .nine-row {
    grid-template-columns: 100px minmax(0, 1fr) 72px;
  }
  .enlarged-material.asia-nine-zodiac .nine-row {
    grid-template-columns: 62px minmax(0, 1fr) 72px;
  }
  .enlarged-material.asia-nine-zodiac .nine-value {
    font-size: 15px;
    letter-spacing: 0;
  }
}
@media (max-width: 420px) {
  .enlarged-material.asia-nine-zodiac .nine-value {
    font-size: 13px;
  }
  .enlarged-material.asia-nine-zodiac .nine-label {
    font-size: 12px;
  }
}

/* Enlarged body copy: fixed aligned columns and single-line value runs. */
.enlarged-material .nine-row {
  align-items: center;
}
.enlarged-material .nine-label,
.enlarged-material .nine-result {
  white-space: nowrap;
}
.enlarged-material .nine-value {
  white-space: nowrap;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
}
.material-single-line {
  display: inline-block;
  flex: none;
  white-space: nowrap;
  transform-origin: center;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .enlarged-material .nine-row {
    grid-template-columns: 96px minmax(0, 1fr) 64px;
    gap: 3px;
  }
  .enlarged-material .nine-label {
    font-size: 13px;
    letter-spacing: -0.35px;
  }
  .enlarged-material:has(.asia-twelve-value) .nine-row {
    grid-template-columns: 38px minmax(0, 1fr) 64px;
  }
  .enlarged-material .six-ten-period .nine-row {
    grid-template-columns: 62px minmax(0, 1fr) 64px;
  }
  .enlarged-material.asia-nine-zodiac .nine-row {
    grid-template-columns: 58px minmax(0, 1fr) 64px;
  }
}

/* 图库按原图比例连续排列，卡片不再按行拉伸。 */
.grid:has(> .image-card) {
  display: block;
  column-count: 3;
  column-gap: 18px;
}
.grid > .image-card {
  display: inline-block;
  vertical-align: top;
  width: 100%;
  height: auto;
  break-inside: avoid;
  margin: 0 0 18px;
}
.grid > .image-card > a {
  display: block;
}
.grid > .image-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
@media (max-width: 800px) {
  .grid:has(> .image-card) {
    column-count: 2;
    column-gap: 12px;
  }
  .grid > .image-card {
    margin-bottom: 12px;
  }
}

#back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 1000;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5ad59;
  border-radius: 50%;
  background: #fff8e8;
  color: #885719;
  box-shadow: 0 3px 14px #6c471825;
  cursor: pointer;
  touch-action: manipulation;
}
#back-to-top:hover {
  background: #ffe9af;
}
#back-to-top:focus-visible {
  outline: 3px solid #b27d23;
  outline-offset: 3px;
}
@media (max-width: 600px) {
  #back-to-top {
    right: 12px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
  }
}

.parent-navigation {
  display: flex;
  margin: 4px 0 12px;
  border-bottom: 1px solid #e5c985;
  color: #78501c;
  font-size: 14px;
}
.parent-return {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 12px;
  font-weight: 600;
  border-radius: 8px;
}
.parent-return:hover,
.parent-return:focus-visible {
  background: #fff0c5;
}

/* 27码两行完整居中；14个两位数及分隔符不裁切。 */
.asia-split-number-value > span {
  font-size: calc(min(16px, 3.65cqi) + 3px);
  text-align: center;
}

/* 窄屏给14＋13个号码完整宽度，避免左右期号和结果把字号压小。 */
@media (max-width: 600px) {
  .nine-row:has(.asia-split-number-value) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
  }
  .nine-row:has(.asia-split-number-value) .nine-label {
    grid-column: 1;
    grid-row: 1;
  }
  .nine-row:has(.asia-split-number-value) .nine-result {
    grid-column: 2;
    grid-row: 1;
  }
  .asia-split-number-value {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .asia-split-number-value > span {
    font-size: calc(min(14px, 3.65cqi) + 3px);
  }
}

/* 桌面27码行缩小期号空位，将空间留给加大后的两行号码。 */
@media (min-width: 601px) {
  .nine-row:has(.asia-split-number-value) {
    grid-template-columns: 60px minmax(0, 1fr) 75px;
    gap: 8px;
  }
}

/* 字号保留增加3px；窄屏每行41个字符略收字距，避免末尾号码超宽。 */
@media (max-width: 600px) {
  .asia-split-number-value > span {
    letter-spacing: -0.6px;
  }
}

/* 极窄屏保留提高3px后的字号，再收0.2px字距以完整容纳14个号码。 */
@media (max-width: 360px) {
  .asia-split-number-value > span {
    letter-spacing: -0.8px;
  }
}

/*
 * 亚洲福利彩首页：方案七黑金典藏。
 * 只作用于包含首页横幅的页面；开奖和后台资料继续使用原有数据与功能。
 */
body:has(#app > .managed-hero) {
  background: #1e1918;
  color: #f4e7cc;
}

body:has(#app > .managed-hero) > header {
  max-width: 1152px;
  color: #f4e7cc;
}

body:has(#app > .managed-hero) nav a {
  color: #cfbea1;
}

body:has(#app > .managed-hero) nav a.active {
  color: #f2d797;
  border-color: #d2ab65;
}

body:has(#app > .managed-hero) #menu {
  color: #f2d797;
  border-color: #765f41;
  background: #2a2422;
}

body:has(#app > .managed-hero) > main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* 横幅和资料使用整行；保留后台配置的栏目顺序及内容。 */
body:has(#app > .managed-hero) .managed-hero,
body:has(#app > .managed-hero) main > section:not(.compact-draw):not(.quick) {
  grid-column: 1 / -1;
}

body:has(#app > .managed-hero) .managed-hero {
  min-height: 210px;
  padding: 35px 45px;
  border: 1px solid #69543a;
  border-radius: 3px;
  background: linear-gradient(120deg, #241b1b, #57402c);
}

body:has(#app > .managed-hero) .managed-hero::before {
  background: linear-gradient(110deg, #211817f2, #4d382ad9);
  opacity: 1;
}

body:has(#app > .managed-hero) .hero-backdrop {
  opacity: 0.14;
}

body:has(#app > .managed-hero) .managed-hero h1 {
  margin: 10px 0;
  color: #f5dfb3;
  font-family: Georgia, 'Songti SC', 'Noto Serif SC', serif;
  letter-spacing: 0.12em;
}

body:has(#app > .managed-hero) .managed-hero p {
  color: #d3bfa2;
}

body:has(#app > .managed-hero) .hero .button {
  background: #dfbd7b;
  color: #2c2118;
  border-radius: 3px;
}

body:has(#app > .managed-hero) .hero .button.secondary {
  border-color: #d4b47a;
  background: transparent;
  color: #f5dfb3;
}

body:has(#app > .managed-hero) .compact-draw,
body:has(#app > .managed-hero) .quick a {
  background: #2a2422;
  border: 1px solid #594b38;
  border-radius: 3px;
  color: #f4e7cc;
  box-shadow: none;
}

body:has(#app > .managed-hero) .compact-draw {
  margin: 0;
  width: 100%;
}

body:has(#app > .managed-hero) .compact-heading > a,
body:has(#app > .managed-hero) .compact-countdown,
body:has(#app > .managed-hero) .compact-zodiac,
body:has(#app > .managed-hero) .compact-dates,
body:has(#app > .managed-hero) .compact-dates > div + div {
  color: #ddc69d;
}

body:has(#app > .managed-hero) .compact-dates {
  border-top-color: #594b38;
}

body:has(#app > .managed-hero) .quick {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

body:has(#app > .managed-hero) .quick a {
  min-height: 65px;
  padding: 12px 18px;
}

body:has(#app > .managed-hero) .quick a:hover {
  border-color: #d6b676;
  background: #392e27;
}

body:has(#app > .managed-hero) .quick b,
body:has(#app > .managed-hero) .section-head a {
  color: #e5c98e;
}

body:has(#app > .managed-hero) .quick span {
  color: #bba990;
}

body:has(#app > .managed-hero) .section-head h2 {
  color: #f4e7cc;
  font-family: Georgia, 'Songti SC', serif;
}

body:has(#app > .managed-hero) > footer {
  background: #211b19;
  border-top: 1px solid #594b38;
  color: #c6b697;
}

@media (max-width: 800px) {
  body:has(#app > .managed-hero) nav.open {
    background: #2a2422;
    border: 1px solid #594b38;
  }

  body:has(#app > .managed-hero) > main {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-inline: 12px;
  }

  body:has(#app > .managed-hero) .managed-hero {
    min-height: 0;
    padding: 25px 20px;
  }

  body:has(#app > .managed-hero) .quick {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:has(#app > .managed-hero) .quick a {
    min-height: 78px;
    padding: 10px;
  }
}

/*
 * 亚洲福利彩资料框方案十：深蓝标题、金色顶线和浅蓝期号。
 * 只调整资料框的外观，不修改记录、开奖结果或命中标黄。
 */
.nine-material {
  border: 1px solid #bfcbe0;
  border-top: 4px solid #dfa95a;
  border-radius: 0;
  background: #fbfcff;
}

.nine-material h3 {
  background: #263e6b;
  color: #fff;
  text-align: left;
  letter-spacing: 0.04em;
}

.nine-period + .nine-period {
  border-top: 1px solid #dae2ef;
}

.nine-period > .nine-row {
  background: #fbfcff;
  border-bottom-color: #dae2ef;
}

.nine-period:nth-of-type(even) > .nine-row {
  background: #f0f4fb;
}

.nine-material .issue-badge {
  background: #e9eff9;
  border: 1px solid #bacbe1;
  border-radius: 20px;
  color: #253651;
}

.nine-material .nine-result.announced {
  color: #ba3934;
}

/* 用户选择的黄色标注只由已有判奖数据决定。 */
.nine-material mark {
  background: #ffe569;
  color: inherit;
}

/* 为期号和统一名称保留宽度，避免文字挤入生肖列。 */
.enlarged-material.asia-nine-zodiac .nine-row {
  grid-template-columns: 90px minmax(0, 1fr) 78px;
}

@media (max-width: 600px) {
  .enlarged-material.asia-nine-zodiac .nine-row {
    grid-template-columns: 64px minmax(0, 1fr) 64px;
  }
}

/* 精准六肖每行文字较原样式加大 3 像素，栏目标题保持原样。 */
.nine-material[data-project='199'] .nine-label {
  font-size: 1rem;
}

.nine-material[data-project='199'] .issue-badge,
.nine-material[data-project='199'] .nine-result {
  font-size: 0.9375rem;
}

.nine-material[data-project='199'] .nine-value {
  font-size: 1.125rem;
}

@media (max-width: 600px) {
  .nine-material[data-project='199'] .nine-row {
    grid-template-columns: 106px minmax(0, 1fr) 70px;
  }

  .nine-material[data-project='199'] .nine-label {
    font-size: 0.875rem;
  }

  .nine-material[data-project='199'] .issue-badge,
  .nine-material[data-project='199'] .nine-result {
    font-size: 0.8125rem;
  }

  .nine-material[data-project='199'] .nine-value {
    font-size: 0.9375rem;
  }
}

/* 四个指定栏目的正文比现有显示增加 1 像素，标题不参与调整。 */
.nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='176'], [data-project='174'], [data-project='175'], [data-project='173'], [data-project='195']) .nine-label {
  font-size: 1rem;
}

.nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='176'], [data-project='174'], [data-project='175'], [data-project='173'], [data-project='195']) .issue-badge {
  font-size: 0.8125rem;
}

.nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='176'], [data-project='174'], [data-project='175'], [data-project='173'], [data-project='195']) .nine-value {
  font-size: 1.125rem;
}

.nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='176'], [data-project='174'], [data-project='175'], [data-project='173'], [data-project='195']) .nine-result {
  font-size: 0.9375rem;
}

@media (max-width: 600px) {
  .nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='176'], [data-project='174'], [data-project='175'], [data-project='173'], [data-project='195']) .nine-label {
    font-size: 0.875rem;
  }

  .nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='176'], [data-project='174'], [data-project='175'], [data-project='173'], [data-project='195']) .issue-badge {
    font-size: 0.6875rem;
  }

  .nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='176'], [data-project='174'], [data-project='175'], [data-project='173'], [data-project='195']) .nine-value {
    font-size: 0.9375rem;
  }

  .nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='176'], [data-project='174'], [data-project='175'], [data-project='173'], [data-project='195']) .nine-result {
    font-size: 0.8125rem;
  }
}

/* 精选36码中特只放大期号和开奖结果，号码内容及标题保持原样。 */
.nine-material[data-project='196'] .issue-badge,
.nine-material[data-project='196'] .nine-result {
  font-size: 0.875rem;
}

@media (max-width: 600px) {
  .nine-material[data-project='196'] .issue-badge,
  .nine-material[data-project='196'] .nine-result {
    font-size: 0.75rem;
  }
}

/* 九肖正文各加 1 像素；窄屏优先保持内容可见。 */
.nine-material[data-project='172'] .nine-label {
  font-size: 1rem;
}

.nine-material[data-project='172'] .issue-badge {
  font-size: 0.8125rem;
}

.nine-material[data-project='172'] .nine-value {
  font-size: 1rem;
}

.nine-material[data-project='172'] .nine-result {
  font-size: 0.9375rem;
}

.nine-material[data-project='173'] .six-ten-head b {
  font-size: 1.0625rem;
}

.nine-material[data-project='173'] .six-ten-head span {
  font-size: 0.8125rem;
}

@media (max-width: 600px) {
  /* 扩大左右栏，避免放大后的期号、栏目名和开奖结果被挤压。 */
  .nine-material:is([data-project='198'], [data-project='178'], [data-project='197'], [data-project='174'], [data-project='175'], [data-project='195']) .nine-row {
    grid-template-columns: 110px minmax(0, 1fr) 72px;
  }

  .nine-material[data-project='176'] .nine-row,
  .nine-material[data-project='196'] .nine-row {
    grid-template-columns: 48px minmax(0, 1fr) 72px;
  }

  .nine-material[data-project='197'] .nine-row {
    grid-template-columns: 114px minmax(0, 1fr) 72px;
  }

  /* 三行长号码占用整行，避免期号与开奖结果覆盖号码。 */
  .nine-material[data-project='196'] .nine-row {
    grid-template-columns: 1fr auto;
  }

  .nine-material[data-project='196'] .nine-label {
    grid-column: 1;
    grid-row: 1;
  }

  .nine-material[data-project='196'] .nine-result {
    grid-column: 2;
    grid-row: 1;
  }

  .nine-material[data-project='196'] .nine-value {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nine-material[data-project='173'] .six-ten-period .nine-row {
    grid-template-columns: 68px minmax(0, 1fr) 72px;
  }

  .nine-material[data-project='172'] .nine-label,
  .nine-material[data-project='172'] .nine-result {
    font-size: 0.8125rem;
  }

  .nine-material[data-project='172'] .issue-badge {
    font-size: 0.6875rem;
  }

  .nine-material[data-project='172'] .nine-value {
    font-size: 1rem;
  }
}

@media (max-width: 420px) {
  .nine-material[data-project='172'] .nine-label {
    font-size: 0.8125rem;
  }

  .nine-material[data-project='172'] .nine-value {
    font-size: 0.875rem;
  }
}

/* 手机窄屏让家禽野兽名称换行，避免期号和名称挤压。 */
@media (max-width: 600px) {
  .nine-material[data-project='201'] .nine-label {
    flex-wrap: wrap;
    white-space: normal;
    gap: 2px 4px;
  }
}

/* 亚洲福利彩分页主题：沿用首页黑金外框，资料框继续使用既定蓝金样式。 */
body {
  background: #1e1918;
  color: #f4e7cc;
}

body > header {
  max-width: 1152px;
  color: #f4e7cc;
}

body > header nav a {
  color: #cfbea1;
}

body > header nav a.active {
  color: #f2d797;
  border-color: #d2ab65;
}

body > header #menu {
  color: #f2d797;
  border-color: #765f41;
  background: #2a2422;
}

/* 页面标题、说明和内容容器共用主页色系，不覆盖资料内的中奖标记。 */
#app .page-title h1 {
  color: #f4e7cc;
  font-family: Georgia, 'Songti SC', serif;
}

#app .page-title p {
  color: #cfbea1;
}

#app .parent-navigation {
  border-color: #a88a58;
  color: #e5d1aa;
}

#app .parent-return:hover,
#app .parent-return:focus-visible {
  background: #493a2c;
}

#app .managed-text,
#app .image-card {
  background: #2a2422;
  border-color: #594b38;
  color: #f4e7cc;
  border-radius: 3px;
}

#app .image-card small {
  color: #cfbea1;
}

#app .image-card .blank {
  background: linear-gradient(145deg, #392f28, #241e1c);
}

/* 历史开奖数字球保持原色，深色背景仅作用于记录容器及文字。 */
#app .history-years h2,
#app .history-years button,
#app .history-toolbar,
#app .history-content > .actions {
  color: #e5d1aa;
}

#app .history-years button.active {
  background: #d2ab65;
  color: #211a17;
}

#app .history-list {
  background: #2a2422;
  border-color: #765f41;
  border-radius: 3px;
}

#app .history-row {
  color: #f4e7cc;
}

#app .history-row:nth-child(even) {
  background: #342b26;
}

#app .history-row + .history-row {
  border-color: #594b38;
}

#app .history-row .draw-zodiac {
  color: #e5d1aa;
}

#app .history-content select,
#app .history-content .button.secondary {
  background: #2a2422;
  border: 1px solid #a88a58;
  color: #f4e7cc;
}

#app .history-content button:disabled {
  color: #a99c89;
}

body > footer {
  background: #211b19;
  border-top: 1px solid #594b38;
  color: #c6b697;
}

@media (max-width: 800px) {
  body > header nav.open {
    background: #2a2422;
    border: 1px solid #765f41;
  }
}

/* 图片加载前预留比例，避免卡片塌陷导致屏外原图同时下载。 */
#app .grid > .image-card img {
  aspect-ratio: auto 4 / 5;
}

/* 方案 01。样式仅匹配公开首页横幅，幕布由伪元素绘制，不新增媒体请求。 */
#app > .hero.managed-hero.hero-curtain {
  min-height: clamp(225px, 28vw, 330px);
  padding: clamp(22px, 5vw, 46px) clamp(12px, 5vw, 48px);
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  border: 1px solid #6b384a;
  border-radius: 6px;
  background: radial-gradient(ellipse at 50% 88%, #7d2934, #190c19 64%);
}

#app > .hero.managed-hero.hero-curtain::before,
#app > .hero.managed-hero.hero-curtain::after {
  content: '';
  position: absolute;
  inset: 0 50% 0 0;
  z-index: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  background: repeating-linear-gradient(90deg, #631729, #280b1b 16%, #631729 30%);
  transform: translateX(-90%);
  animation: none;
  pointer-events: none;
}

#app > .hero.managed-hero.hero-curtain::after {
  inset: 0 0 0 50%;
  transform: translateX(90%) scaleX(-1);
}

#app > .hero.managed-hero.hero-curtain > :not(.hero-backdrop) {
  position: relative;
  z-index: 1;
}

#app > .hero.managed-hero.hero-curtain h1 {
  margin: 9px 0 6px;
  font-family: 'Songti SC', 'Noto Serif SC', Georgia, serif;
  font-size: clamp(26px, 5.6vw, 50px);
  line-height: 1.18;
  color: #ffe5ab;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

#app > .hero.managed-hero.hero-curtain p {
  margin: 6px 0 16px;
  color: #f5dcbd;
  overflow-wrap: anywhere;
}

#app > .hero.managed-hero.hero-curtain .hero-curtain-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

#app > .hero.managed-hero.hero-curtain .hero-curtain-links .button {
  margin: 0;
  padding: 9px 14px;
  background: #e9c47f;
  color: #2c1521;
  border: 1px solid #e9c47f;
  border-radius: 4px;
}

#app > .hero.managed-hero.hero-curtain .hero-curtain-links .secondary {
  background: #281523;
  color: #ffe5ab;
}

/* 开幕结束后停在完整标题；按钮在播放期间仍可操作。 */
@media (prefers-reduced-motion: no-preference) {
  #app > .hero.managed-hero.hero-curtain::before {
    animation: welfare-curtain-left 2.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #app > .hero.managed-hero.hero-curtain::after {
    animation: welfare-curtain-right 2.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #app > .hero.managed-hero.hero-curtain h1 {
    animation: welfare-curtain-title 2.6s cubic-bezier(0.25, 0.5, 0.24, 1);
  }
}

@keyframes welfare-curtain-left {
  0%,
  8% {
    transform: translateX(0);
  }
  86%,
  100% {
    transform: translateX(-90%);
  }
}

@keyframes welfare-curtain-right {
  0%,
  8% {
    transform: translateX(0) scaleX(-1);
  }
  86%,
  100% {
    transform: translateX(90%) scaleX(-1);
  }
}

@keyframes welfare-curtain-title {
  0% {
    transform: scale(0.38);
    opacity: 0.24;
  }
  82%,
  100% {
    transform: none;
    opacity: 1;
  }
}
