.lottery-widget {
  --lw-green: #18b61b;
  --lw-red: #ec160a;
  --lw-blue: #2588e9;
  --lw-active: #51b967;
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 1px solid #e1e4e9;
  border-radius: 8px;
  box-shadow: 0 2px 5px #26334708;
  color: #20252b;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-weight: 400;
  text-align: left;
}

.lottery-widget *, .lottery-history * { box-sizing: border-box; }
.lottery-widget [hidden], .lottery-history [hidden] { display: none !important; }
.lottery-widget button, .lottery-history button { font: inherit; cursor: pointer; }
.lottery-widget button:focus-visible, .lottery-history button:focus-visible {
  outline: 3px solid #1d7a42;
  outline-offset: 3px;
}

.lottery-widget .lw-toolbar { display: flex; align-items: center; gap: 8px; }
.lottery-widget .lw-lotteries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1; min-width: 0; gap: 7px; }
.lottery-widget .lw-lottery-button {
  min-width: 0;
  padding: 3px 7px;
  border: 0;
  border-radius: 5px;
  background: #eeeef0;
  color: #272c33;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
}
.lottery-widget .lw-lottery-button:hover { background: #e5e8e6; }
.lottery-widget .lw-lottery-button[aria-pressed="true"] { background: var(--lw-active); color: #fff; }
.lottery-widget .lw-size-toggle {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid #dce7df;
  border-radius: 4px;
  background: #f7faf8;
  color: #2a7d40;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
.lottery-widget .lw-size-toggle:hover { background: #ebf5ed; color: #216e35; }

.lottery-widget .lw-draw { padding: 12px 0 1px; }
.lottery-widget .lw-draw-body { display: flex; align-items: flex-start; gap: 8px; }
.lottery-widget .lw-small-summary { flex: 0 0 52px; padding-top: 0; font-size: 12px; line-height: 18px; }
.lottery-widget .lw-short-name { display: block; white-space: nowrap; }
.lottery-widget .lw-short-issue { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.lottery-widget .lw-refresh-small {
  display: block;
  margin: 3px 0 0;
  padding: 0 4px;
  border: 0;
  border-radius: 2px;
  background: #e80f05;
  color: #fff;
  font-size: 11px;
  line-height: 17px;
}
.lottery-widget .lw-number-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: start; flex: 1; gap: 6px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.lottery-widget .lw-number-item { display: flex; flex-direction: column; align-items: center; min-width: 0; color: #666; font-size: 12px; }
.lottery-widget .lw-number-item[data-color="green"] { --lw-ball-color: var(--lw-green); --lw-ring: #28be5c; }
.lottery-widget .lw-number-item[data-color="red"] { --lw-ball-color: var(--lw-red); --lw-ring: #f1454d; }
.lottery-widget .lw-number-item[data-color="blue"] { --lw-ball-color: var(--lw-blue); --lw-ring: #309be7; }
.lottery-widget .lw-number-item[data-color="gray"] { --lw-ball-color: #a0a7b0; --lw-ring: #b2b9c3; }
.lottery-widget .lw-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--lw-ring);
  border-right-width: 4px;
  border-bottom-width: 4px;
  border-radius: 50%;
  background: #fff;
  color: #252525;
  font-family: Arial, sans-serif;
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.lottery-widget .lw-attributes { margin-top: 5px; line-height: 18px; white-space: nowrap; }
.lottery-widget .lw-draw-header, .lottery-widget .lw-draw-footer { display: none; }
.lottery-widget .lw-notice { min-height: 18px; margin-top: 7px; color: #607465; font-size: 11px; line-height: 18px; }
.lottery-widget .lw-notice:empty { display: none; }
.lottery-widget .lw-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.lottery-widget[data-size="large"] .lw-draw { padding-top: 10px; }
.lottery-widget[data-size="large"] .lw-small-summary { display: none; }
.lottery-widget[data-size="large"] .lw-draw-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; line-height: 22px; }
.lottery-widget[data-size="large"] .lw-full-title { margin: 0; font: inherit; }
.lottery-widget[data-size="large"] .lw-issue-number { color: #f01910; }
.lottery-widget[data-size="large"] .lw-countdown { margin-left: auto; color: #242a32; font-family: Arial, sans-serif; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lottery-widget[data-size="large"] .lw-refresh-large { padding: 0; border: 0; background: transparent; color: #f05221; font-size: 13px; line-height: 22px; }
.lottery-widget[data-size="large"] .lw-number-item { min-height: 62px; padding: 4px 2px 5px; border-radius: 4px; background: var(--lw-ball-color); }
.lottery-widget[data-size="large"] .lw-number { width: auto; height: 30px; border: 0; border-radius: 0; background: transparent; color: #fff; font-size: 28px; font-weight: 800; }
.lottery-widget[data-size="large"] .lw-attributes { margin-top: 2px; padding: 0 5px; border-radius: 1px; background: #fff; color: #252525; font-size: 13px; line-height: 18px; }
.lottery-widget[data-size="large"] .lw-draw-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 14px; line-height: 22px; }
.lottery-widget .lw-next-info { min-width: 0; }
.lottery-widget .lw-next-issue { color: #ef2019; }
.lottery-widget .lw-history-button { flex-shrink: 0; padding: 0; border: 0; background: transparent; color: #f2261c; font-size: 14px; line-height: 22px; }
.lottery-widget .lw-history-button:hover { text-decoration: underline; }

.lottery-history { width: min(560px, calc(100% - 28px)); padding: 22px; border: 1px solid #dce2de; border-radius: 10px; color: #27332b; background: #fff; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
.lottery-history::backdrop { background: #1e293d66; }
.lottery-history .lw-history-title { margin: 0; font-size: 19px; }
.lottery-history .lw-history-note { margin: 9px 0 18px; color: #68766c; font-size: 12px; line-height: 1.7; }
.lottery-history table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.8; text-align: left; }
.lottery-history th, .lottery-history td { padding: 10px 0; border-bottom: 1px solid #e8ede9; }
.lottery-history th { color: #738078; font-size: 12px; font-weight: 400; }
.lottery-history .lw-history-values { word-spacing: 4px; font-family: Arial, sans-serif; font-variant-numeric: tabular-nums; }
.lottery-history .lw-history-special { color: #d92922; font-weight: 700; }
.lottery-history .lw-close-history { display: block; margin: 20px 0 0 auto; padding: 7px 22px; border: 0; border-radius: 5px; background: #edf3ef; color: #27753e; }

@media (max-width: 540px) {
  .lottery-widget { padding: 8px; }
  .lottery-widget .lw-toolbar { gap: 8px; }
  .lottery-widget .lw-lotteries { gap: 4px; }
  .lottery-widget .lw-lottery-button { padding: 3px 2px; font-size: 14px; }
  .lottery-widget .lw-size-toggle { padding: 3px 4px; font-size: 11px; }
  .lottery-widget .lw-number-list { gap: 4px; }
  .lottery-widget .lw-draw-body { gap: 3px; }
  .lottery-widget .lw-small-summary { flex-basis: 43px; font-size: 11px; line-height: 17px; }
  .lottery-widget .lw-number { width: clamp(25px, 6.8vw, 36px); height: clamp(25px, 6.8vw, 36px); font-size: clamp(15px, 4.2vw, 20px); }
  .lottery-widget .lw-attributes { font-size: 11px; }
  .lottery-widget[data-size="large"] .lw-draw-header { gap: 5px; font-size: 13px; }
  .lottery-widget[data-size="large"] .lw-countdown { font-size: 13px; }
  .lottery-widget[data-size="large"] .lw-refresh-large { font-size: 12px; }
  .lottery-widget[data-size="large"] .lw-number { height: 28px; width: auto; font-size: 24px; }
  .lottery-widget[data-size="large"] .lw-number-item { min-height: 57px; }
  .lottery-widget[data-size="large"] .lw-attributes { padding: 0 3px; font-size: 11px; line-height: 16px; }
  .lottery-widget[data-size="large"] .lw-draw-footer { gap: 5px; font-size: 11px; line-height: 20px; }
  .lottery-widget .lw-history-button { font-size: 11px; }
}

@media (pointer: coarse) {
  .lottery-widget .lw-lottery-button { min-height: 42px; }
  .lottery-widget .lw-size-toggle { min-height: 32px; }
  .lottery-widget .lw-refresh-small { min-height: 28px; }
  .lottery-widget .lw-refresh-large, .lottery-widget .lw-history-button { min-height: 36px; }
}

@media (prefers-reduced-motion: no-preference) {
  .lottery-widget .lw-lottery-button, .lottery-widget .lw-size-toggle { transition: background-color 140ms, color 140ms; }
}

.lottery-widget[data-navigation="regions"] .lw-toolbar { display: block; }
.lottery-widget[data-navigation="regions"] .lw-lotteries { gap: 7px; border: 1px solid transparent; border-radius: 0; }
.lottery-widget[data-navigation="regions"] .lw-lottery-button { display: flex; align-items: center; justify-content: center; column-gap: 6px; min-height: 44px; padding: 8px 4px; border: 1px solid #d8d4ed; border-radius: 22px; background: #f0eff9; color: #271f9e; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; font-size: 16px; font-weight: 700; line-height: 24px; }
.lottery-widget[data-navigation="regions"] .lw-lottery-button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.lottery-widget[data-navigation="regions"] .lw-lottery-badge { display: block; flex: 0 0 auto; width: 24px; height: 24px; object-fit: contain; pointer-events: none; }
.lottery-widget[data-navigation="regions"] .lw-lottery-button[aria-pressed="true"] { border-color: #271f9e; background: #271f9e; color: #fff; }
.lottery-widget[data-navigation="regions"] .lw-lottery-button:hover:not([aria-pressed="true"]) { border-color: #b8aee3; background: #e4e0f7; }
.lottery-widget[data-navigation="regions"] .lw-lottery-button:focus-visible { outline: 2px solid #6256c9; outline-offset: 2px; }
@media (max-width: 540px) {
  .lottery-widget[data-navigation="regions"] .lw-lotteries { gap: 4px; }
  .lottery-widget[data-navigation="regions"] .lw-lottery-button { min-height: 42px; padding: 7px 2px; font-size: 14px; line-height: 26px; }
  .lottery-widget[data-navigation="regions"] .lw-lottery-badge { width: 22px; height: 22px; }
  .lottery-widget[data-navigation="regions"] { padding-bottom: 6px; }
  .lottery-widget[data-navigation="regions"] .lw-draw { padding: 8px 0 0; }
  .lottery-widget[data-navigation="regions"] .lw-small-summary { font-size: 10px; line-height: 14px; }
  .lottery-widget[data-navigation="regions"] .lw-refresh-small { min-height: 0; height: 17px; margin-top: 2px; padding: 0 3px; font-size: 10px; line-height: 17px; }
  .lottery-widget[data-navigation="regions"] .lw-attributes { margin-top: 3px; line-height: 16px; }
}
