:root {
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #191815;
  --muted: #686158;
  --line: #dfd6c7;
  --red: #b51f2a;
  --gold: #d29a24;
  --green: #1b7b61;
  --blue: #27628f;
  --shadow: 0 18px 45px rgba(44, 35, 23, 0.12);
  font-family: "Segoe UI", "Noto Sans TC", "Noto Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(181, 31, 42, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(27, 123, 97, 0.08), transparent 30%),
    var(--bg);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  max-width: 1180px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 188px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--red), #e25b36);
  box-shadow: inset 0 -8px 18px rgba(0, 0, 0, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.top-nav a {
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

.top-nav a:hover {
  background: rgba(181, 31, 42, 0.08);
  color: var(--red);
}

.top-nav a.active {
  background: var(--red);
  color: #ffffff;
}

/* Tab 分頁控制 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.35s ease-out;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
  animation: tabFadeIn 0.25s ease-out;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.language-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.language-menu-button {
  min-height: 40px;
  width: 190px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.language-menu-button:hover,
.language-menu-button:focus-visible {
  border-color: rgba(181, 31, 42, 0.5);
  outline: none;
  box-shadow: 0 0 0 3px rgba(181, 31, 42, 0.12);
}

.language-menu-current,
.language-menu-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.language-menu-current {
  overflow: hidden;
}

.language-menu-arrow {
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.language-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 240px;
  max-height: min(420px, calc(100vh - 120px));
  padding: 6px;
  display: none;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.language-picker.open .language-menu-list {
  display: grid;
  gap: 2px;
}

.language-menu-option {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.language-menu-option:hover,
.language-menu-option:focus-visible,
.language-menu-option.active {
  background: rgba(181, 31, 42, 0.1);
  outline: none;
}

.language-flag {
  width: 22px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(25, 24, 21, 0.12);
}

.language-flag-auto {
  display: inline-grid;
  place-items: center;
  height: 22px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 18px;
  line-height: 1;
}

.language-code {
  display: none;
}

.language-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select,
button {
  font: inherit;
}

select {
  min-height: 40px;
  max-width: 190px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 56px;
}

.hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: end;
  padding: 42px;
  border: 1px solid rgba(181, 31, 42, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 253, 248, 0.96), rgba(255, 253, 248, 0.72)),
    repeating-linear-gradient(90deg, rgba(181, 31, 42, 0.08) 0 1px, transparent 1px 72px),
    linear-gradient(135deg, rgba(210, 154, 36, 0.2), rgba(39, 98, 143, 0.16));
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 820px;
  margin: 8px 0 14px;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hero-link {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-panel {
  min-height: 124px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.hero-panel p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.status-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(27, 123, 97, 0.14);
}

.section {
  margin-top: 34px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.section h2 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.refresh-button {
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  font-weight: 900;
  cursor: pointer;
}

.refresh-button:hover {
  background: #981a23;
}

.lotto-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.lotto-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 12px 30px rgba(44, 35, 23, 0.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.game-name {
  margin: 0;
  font-size: 24px;
}

.meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.status-pill,
.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--green);
  border: 1px solid rgba(27, 123, 97, 0.24);
  border-radius: 999px;
  background: rgba(27, 123, 97, 0.08);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 18px;
}

.ball {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ff837a 0%, var(--red) 75%, #7a0c14 100%);
  font-weight: 900;
  box-shadow: inset 0 -8px 14px rgba(0, 0, 0, 0.2);
}

.ball.special {
  background: radial-gradient(circle at 30% 30%, #ffdf85 0%, var(--gold) 75%, #94680b 100%);
  color: #231a08;
}

.jackpot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.jackpot strong {
  color: var(--ink);
}

.card-reference {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.card-reference strong {
  color: var(--blue);
}

.card-rules-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 0 14px;
  border: 1px solid rgba(39, 98, 143, 0.18);
  border-radius: 6px;
  background: rgba(39, 98, 143, 0.06);
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.card-rules-link:hover,
.card-rules-link:focus-visible {
  border-color: rgba(181, 31, 42, 0.28);
  background: rgba(181, 31, 42, 0.06);
  color: var(--red);
}

.source-list {
  display: none !important;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.source-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.section-muted {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

/* 歷史紀錄搜尋控制列 */
.history-filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px 20px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(44, 35, 23, 0.04);
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group.game {
  min-width: 160px;
  flex: 1;
}

.filter-group.search {
  min-width: 240px;
  flex: 2;
}

.filter-group label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-filters select,
.history-filters input {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.history-filters select:focus,
.history-filters input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(181, 31, 42, 0.1);
}

.filter-actions {
  display: flex;
  gap: 10px;
  align-self: flex-end;
}

.filter-actions button {
  min-height: 42px;
  margin: 0;
  font-size: 14px;
}

#historyResetBtn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  padding: 0 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

#historyResetBtn:hover {
  background: rgba(181, 31, 42, 0.08);
  color: var(--red);
  border-color: rgba(181, 31, 42, 0.2);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.mini-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-ball {
  min-width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.mini-ball.special {
  color: #241900;
  background: var(--gold);
}

.rules-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
}

.tool-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
}

.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.quickstart-card {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.quickstart-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: var(--blue);
  font-weight: 900;
}

.quickstart-card h3 {
  margin: 14px 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

.quickstart-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.quickstart-card.is-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.quickstart-card.is-clickable:hover {
  transform: translateY(-3px);
  border-color: rgba(39, 98, 143, 0.3);
  box-shadow: 0 16px 34px rgba(44, 35, 23, 0.1);
}

.quickstart-action {
  width: 100%;
  margin-top: 16px;
}

.quickstart-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.quickstart-tags span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(27, 123, 97, 0.09);
  font-size: 12px;
  font-weight: 900;
}

.quickstart-tags a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(39, 98, 143, 0.18);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(39, 98, 143, 0.06);
  font-size: 12px;
  font-weight: 900;
}

.resident-help-section {
  background:
    linear-gradient(135deg, rgba(39, 98, 143, 0.08), rgba(27, 123, 97, 0.07)),
    rgba(255, 253, 248, 0.9);
}

.resident-starter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.resident-guide-card {
  width: 100%;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
  color: inherit;
  text-align: left;
}

.resident-guide-trigger {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.resident-guide-trigger:hover {
  transform: translateY(-3px);
  border-color: rgba(39, 98, 143, 0.3);
  box-shadow: 0 16px 34px rgba(44, 35, 23, 0.1);
}

.resident-guide-trigger:focus-visible {
  outline: 3px solid rgba(39, 98, 143, 0.24);
  outline-offset: 3px;
}

.resident-guide-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.resident-guide-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.resident-guide-head span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(39, 98, 143, 0.08);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.resident-guide-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.resident-card-action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 11px;
  border: 1px solid rgba(39, 98, 143, 0.22);
  border-radius: 6px;
  color: var(--blue);
  background: rgba(39, 98, 143, 0.06);
  font-size: 13px;
  font-weight: 900;
}

.resident-guide-trigger:hover .resident-card-action {
  border-color: rgba(181, 31, 42, 0.28);
  color: var(--red);
  background: rgba(181, 31, 42, 0.06);
}

.resident-modal-panel {
  width: min(980px, 100%);
}

.resident-guide-content {
  display: grid;
  gap: 16px;
}

.resident-modal-summary {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(39, 98, 143, 0.16);
  border-radius: 8px;
  background: rgba(39, 98, 143, 0.05);
}

.resident-modal-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.resident-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.resident-guide-block {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.resident-guide-block strong,
.resident-next-step span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.resident-guide-block ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.resident-guide-block li::marker {
  color: var(--red);
  font-weight: 900;
}

.resident-next-step {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(27, 123, 97, 0.18);
  border-radius: 8px;
  background: rgba(27, 123, 97, 0.06);
}

.resident-source-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.resident-source-panel > strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.resident-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resident-source-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid rgba(39, 98, 143, 0.22);
  border-radius: 6px;
  color: var(--blue);
  background: rgba(39, 98, 143, 0.06);
  font-size: 13px;
  font-weight: 900;
}

.resident-source-links a:hover {
  border-color: rgba(181, 31, 42, 0.28);
  color: var(--red);
  background: rgba(181, 31, 42, 0.06);
}

.game-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.85fr;
  gap: 14px;
}

.game-latest-card,
.game-history-card,
.game-tools-card,
.game-reference-card {
  grid-column: 1 / -1;
}

.game-history-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.game-page-heading {
  justify-content: flex-end;
}

.official-jackpot-banner {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 128px;
  padding: 22px 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #a80000 0%, #cf2830 56%, #8f151d 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(181, 31, 42, 0.18);
}

.official-jackpot-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(181, 31, 42, 0.24);
}

.official-jackpot-kicker {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.official-jackpot-title {
  display: block;
  color: #fff;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.official-jackpot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 700;
}

.official-jackpot-action {
  justify-self: end;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.member-panel {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 18px;
  align-items: start;
}

.notification-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.notification-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.notification-form input,
.notification-form select {
  width: 100%;
  max-width: none;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

.notification-form .check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  text-transform: none;
  color: var(--ink);
  font-size: 14px;
}

.notification-form .check-row input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.life-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.life-guide-grid article {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.life-guide-grid h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.life-guide-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.guide-action-button {
  min-height: 42px;
  margin-top: auto;
  padding: 0 14px;
  border: 1px solid rgba(39, 98, 143, 0.22);
  border-radius: 6px;
  color: var(--blue);
  background: rgba(39, 98, 143, 0.06);
  font-weight: 900;
  cursor: pointer;
}

.guide-action-button:hover {
  border-color: rgba(181, 31, 42, 0.28);
  color: var(--red);
  background: rgba(181, 31, 42, 0.06);
}

.guide-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guide-detail-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.guide-detail-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.guide-detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.guide-detail-card ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.guide-detail-card li::marker {
  color: var(--red);
  font-weight: 900;
}

.phrase-box {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(39, 98, 143, 0.18);
  border-radius: 8px;
  background: rgba(39, 98, 143, 0.06);
}

.phrase-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.phrase-box strong {
  color: var(--blue);
  line-height: 1.45;
}

.youbike-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.youbike-card {
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.youbike-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.youbike-card ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.youbike-card li::marker {
  color: var(--red);
  font-weight: 900;
}

.youbike-card-links {
  background:
    linear-gradient(135deg, rgba(39, 98, 143, 0.08), rgba(27, 123, 97, 0.08)),
    var(--surface-strong);
}

.youbike-links {
  display: grid;
  gap: 10px;
}

.youbike-links a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(39, 98, 143, 0.22);
  border-radius: 6px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.62);
  font-weight: 900;
  line-height: 1.35;
}

.youbike-links a:hover {
  border-color: rgba(181, 31, 42, 0.28);
  color: var(--red);
}

.invoice-modal-panel {
  width: min(1120px, 100%);
}

.invoice-guide-content {
  display: grid;
  gap: 16px;
}

.invoice-explainer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: stretch;
}

.invoice-picture-card,
.invoice-info-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.invoice-picture-card h3,
.invoice-info-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.invoice-picture-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.invoice-sample-image {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  display: block;
  margin-bottom: 14px;
  border: 1px solid rgba(27, 123, 97, 0.16);
  border-radius: 8px;
  background: var(--surface);
}

.invoice-visual {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid rgba(27, 123, 97, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(27, 123, 97, 0.08), rgba(210, 154, 36, 0.1)),
    var(--surface);
}

.invoice-paper {
  width: min(280px, 100%);
  padding: 18px 16px 20px;
  border: 1px solid rgba(25, 24, 21, 0.12);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(44, 35, 23, 0.16);
  color: #25221d;
}

.invoice-paper-top {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(25, 24, 21, 0.28);
  text-align: center;
}

.invoice-paper-top strong {
  font-size: 22px;
}

.invoice-paper-top span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.invoice-paper-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(223, 214, 199, 0.8);
  font-size: 14px;
}

.invoice-paper-row span {
  color: var(--muted);
}

.invoice-paper-barcode {
  height: 46px;
  margin: 14px 0 12px;
  background: repeating-linear-gradient(90deg, #1f1b17 0 2px, transparent 2px 5px, #1f1b17 5px 6px, transparent 6px 10px);
}

.invoice-paper-qr {
  display: grid;
  grid-template-columns: repeat(2, 58px);
  justify-content: center;
  gap: 12px;
}

.invoice-paper-qr span {
  width: 58px;
  height: 58px;
  border: 6px solid #1f1b17;
  background:
    linear-gradient(90deg, transparent 42%, #1f1b17 42% 58%, transparent 58%),
    linear-gradient(transparent 42%, #1f1b17 42% 58%, transparent 58%),
    #ffffff;
}

.invoice-period-list {
  display: grid;
  gap: 12px;
}

.invoice-period-card {
  padding: 14px;
  border: 1px solid rgba(181, 31, 42, 0.16);
  border-radius: 8px;
  background: rgba(181, 31, 42, 0.035);
}

.invoice-period-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.invoice-period-head h4 {
  margin: 0;
  font-size: 18px;
}

.invoice-period-head span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  text-align: right;
}

.invoice-period-card dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 9px 12px;
  margin: 0;
}

.invoice-period-card dt {
  color: var(--muted);
  font-weight: 900;
}

.invoice-period-card dd {
  margin: 0;
  font-weight: 900;
  line-height: 1.5;
}

.invoice-period-card a {
  display: inline-block;
  margin-top: 12px;
  color: var(--blue);
  font-weight: 900;
}

.invoice-prize-grid {
  display: grid;
  gap: 8px;
}

.invoice-prize-row {
  display: grid;
  grid-template-columns: 96px 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(223, 214, 199, 0.82);
  border-radius: 6px;
  background: rgba(247, 243, 234, 0.52);
}

.invoice-prize-row strong {
  color: var(--red);
}

.invoice-prize-row b {
  color: var(--ink);
}

.invoice-prize-row span {
  color: var(--muted);
  line-height: 1.45;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  padding: 28px;
}

.modal.active {
  display: grid;
  place-items: center;
}

#tourismDetailModal {
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 24, 21, 0.48);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(82vh, 780px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 28px 70px rgba(25, 24, 21, 0.28);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.modal-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--red);
  border-color: rgba(181, 31, 42, 0.28);
}

body.modal-open {
  overflow: hidden;
}

.tourism-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.tourism-actions label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.tourism-actions select {
  min-height: 34px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
}

.section-note {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.temple-fair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.temple-fair-card {
  min-height: 300px;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(181, 31, 42, 0.045), rgba(210, 154, 36, 0.08)),
    var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.temple-fair-rank {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--red);
  font-weight: 900;
}

.temple-fair-body {
  min-width: 0;
}

.temple-fair-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.temple-fair-top span:first-child {
  color: var(--green);
}

.temple-fair-card h3 {
  margin: 10px 0 8px;
  font-size: 22px;
  line-height: 1.3;
}

.temple-fair-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.temple-fair-card dl {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 8px 12px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid rgba(223, 214, 199, 0.85);
  border-bottom: 1px solid rgba(223, 214, 199, 0.85);
}

.temple-fair-card dt {
  color: var(--muted);
  font-weight: 900;
}

.temple-fair-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.5;
}

.temple-fair-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.temple-fair-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid rgba(39, 98, 143, 0.24);
  border-radius: 6px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.62);
  font-weight: 900;
  line-height: 1.3;
}

.temple-fair-links a:hover {
  border-color: rgba(181, 31, 42, 0.28);
  color: var(--red);
}

.tourism-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.official-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.official-link-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(39, 98, 143, 0.07), rgba(27, 123, 97, 0.06)), var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.official-link-card span {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.official-link-card h3 {
  margin: 8px 0 8px;
  font-size: 19px;
}

.official-link-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.official-link-card a {
  color: var(--blue);
  font-weight: 900;
}

.tourism-card {
  min-height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tourism-card-media {
  width: 100%;
  aspect-ratio: 1.4;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(39, 98, 143, 0.12), rgba(27, 123, 97, 0.1)),
    var(--surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tourism-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tourism-card-media-empty {
  display: grid;
  place-items: center;
}

.tourism-card-media-empty span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.76);
  font-weight: 900;
}

.tourism-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 12px 2px 4px 2px;
}

.tourism-card-title {
  margin: 0 0 8px 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: auto;
  transition: color 0.2s ease;
}

.tourism-card-badge-wrap {
  margin-bottom: 6px;
  display: flex;
}

.tourism-card-category {
  display: inline-block;
  padding: 4px 10px;
  background-color: rgba(224, 242, 241, 0.7);
  color: #00796b;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
}

.tourism-card-date {
  color: #c62828;
  font-size: 13px;
  font-weight: 700;
  margin-top: auto;
}

.tourism-card p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.tourism-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tourism-card a,
.tourism-card-detail-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid rgba(39, 98, 143, 0.2);
  border-radius: 6px;
  color: var(--blue);
  background: rgba(39, 98, 143, 0.06);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.tourism-card a:hover,
.tourism-card-detail-link:hover {
  border-color: rgba(181, 31, 42, 0.28);
  color: var(--red);
  background: rgba(181, 31, 42, 0.05);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.insight-card,
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.insight-card {
  min-height: 230px;
  padding: 18px;
}

.insight-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.insight-head h3 {
  margin: 0;
  font-size: 20px;
}

.insight-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.insight-card dl {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  margin: 0;
}

.insight-card dt {
  color: var(--muted);
  font-weight: 900;
}

.insight-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.tool-panel {
  padding: 18px;
}

.invoice-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  align-items: start;
}

.invoice-guide {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(39, 98, 143, 0.06);
}

.invoice-guide h3 {
  margin: 0 0 10px;
}

.invoice-guide p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.invoice-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.invoice-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.invoice-form input,
.invoice-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

.invoice-form textarea {
  resize: vertical;
}

.wide-field {
  grid-column: 1 / -1;
}

.invoice-result {
  grid-column: 1 / -1;
  min-height: 72px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(247, 243, 234, 0.62);
}

.invoice-result strong {
  color: var(--muted);
}

.invoice-result strong.win {
  color: var(--red);
}

.invoice-result span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.tool-controls label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tool-controls select {
  max-width: none;
}

.lucky-result {
  min-height: 118px;
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(39, 98, 143, 0.05);
}

.lucky-result .numbers {
  margin: 0 0 12px;
}

.lucky-result p,
.tool-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.stats-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stats-columns article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 243, 234, 0.48);
}

.stats-columns h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.stat-row {
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.stat-row strong {
  color: var(--muted);
  font-size: 13px;
}

.rules-section .source-badge {
  text-decoration: none;
}

.rules-note {
  max-width: 900px;
  margin: -4px 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rule-card {
  min-height: 245px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(44, 35, 23, 0.06);
}

.rule-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.2;
}

.rule-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.58;
}

.redemption-card {
  grid-column: 1 / -1;
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(39, 98, 143, 0.08), rgba(27, 123, 97, 0.08)),
    var(--surface-strong);
}

.redemption-card ul {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
}

.rule-source {
  margin: 14px 0 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.lifestyle {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(25, 24, 21, 0.92), rgba(25, 24, 21, 0.72)),
    linear-gradient(135deg, var(--green), var(--blue));
}

.lifestyle p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.lifestyle .eyebrow {
  color: #ffd66b;
}

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

.lifestyle-grid article {
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.lifestyle-grid strong,
.lifestyle-grid span {
  display: block;
}

.lifestyle-grid strong {
  font-size: 20px;
}

.lifestyle-grid span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.lifestyle-grid a {
  display: inline-block;
  margin-top: 10px;
  color: #ffd66b;
  font-weight: 900;
  text-decoration: none;
}

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px 34px;
  color: var(--muted);
  font-size: 14px;
}

.about-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 24px;
  align-items: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.about-section h2 {
  margin: 4px 0 0;
}

.about-content p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.about-content dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 16px;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.about-content dt {
  color: var(--muted);
  font-weight: 900;
}

.about-content dd {
  margin: 0;
  font-weight: 800;
}

.legal-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

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

.legal-grid article {
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.legal-grid h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.legal-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 12px 30px rgba(44, 35, 23, 0.08);
}

.admin-hero h1 {
  margin: 4px 0 8px;
  font-size: 34px;
  letter-spacing: 0;
}

.admin-hero p {
  margin: 0;
  color: var(--muted);
}

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

.admin-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.admin-panel h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.admin-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.admin-panel-heading h2 {
  margin: 0;
}

.compact-button {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.admin-panel dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 14px;
  margin: 0;
}

.admin-panel dt {
  color: var(--muted);
  font-weight: 800;
}

.admin-panel dd {
  margin: 0;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

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

.source-row.stacked {
  grid-template-columns: 1fr;
  gap: 5px;
}

.error-row strong,
.error-row span {
  color: var(--red);
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .hero,
  .lifestyle {
    grid-template-columns: 1fr;
  }

  .lotto-grid {
    grid-template-columns: 1fr;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .quickstart-grid,
  .resident-starter-grid,
  .resident-modal-grid,
  .life-guide-grid,
  .guide-detail-grid,
  .game-detail-grid,
  .official-links-grid,
  .youbike-guide-grid,
  .invoice-explainer-grid,
  .temple-fair-grid,
  .tourism-grid,
  .invoice-panel,
  .member-panel {
    grid-template-columns: 1fr;
  }

  .redemption-card ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .header-inner {
    padding: 12px 16px;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .language-label {
    display: none;
  }

  .language-menu-button {
    width: 150px;
  }

  .language-menu-list {
    width: min(240px, calc(100vw - 28px));
  }

  main {
    padding: 20px 14px 44px;
  }

  .hero {
    padding: 26px 20px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-button {
    width: 100%;
  }

  .section-muted,
  .lifestyle,
  .rules-section {
    padding: 18px;
  }

  .lifestyle-grid {
    grid-template-columns: 1fr;
  }

  .quickstart-grid,
  .resident-starter-grid,
  .resident-modal-grid,
  .life-guide-grid,
  .guide-detail-grid,
  .game-detail-grid,
  .official-links-grid,
  .youbike-guide-grid,
  .invoice-explainer-grid,
  .temple-fair-grid,
  .tourism-grid,
  .stats-columns,
  .invoice-form,
  .notification-form {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 12px;
  }

  .modal-panel {
    max-height: 88vh;
    padding: 18px;
  }

  .invoice-visual {
    min-height: 300px;
    padding: 12px;
  }

  .invoice-period-head {
    flex-direction: column;
  }

  .invoice-period-head span {
    text-align: left;
  }

  .invoice-prize-row,
  .invoice-period-card dl,
  .temple-fair-card dl {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .temple-fair-card {
    grid-template-columns: 1fr;
  }

  .temple-fair-rank {
    width: 48px;
    height: 48px;
  }

  .temple-fair-top {
    flex-direction: column;
  }

  .about-section {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .about-content dl {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .legal-section {
    padding: 18px;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .source-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* ==========================================================================
   觀光活動卡片互動與詳情彈窗自訂樣式 (Premium Aesthetics)
   ========================================================================== */

.tourism-grid .tourism-card {
  cursor: pointer;
  outline: none;
}

.tourism-grid .tourism-card:hover .tourism-card-media {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.tourism-grid .tourism-card:hover .tourism-card-media img {
  transform: scale(1.05);
}

.tourism-grid .tourism-card:hover .tourism-card-title {
  color: var(--blue);
}

.tourism-grid .tourism-card:focus-visible .tourism-card-media {
  outline: 3px solid rgba(39, 98, 143, 0.4);
  outline-offset: 3px;
}

.translation-pending-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(220, 160, 40, 0.08);
  border: 1px solid rgba(220, 160, 40, 0.25);
  border-radius: 8px;
  color: #a06a00;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

.translation-pending-banner .warning-icon {
  font-size: 16px;
}

.tourism-modal-content-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
  align-items: start;
}

.tourism-modal-main {
  display: grid;
  gap: 16px;
}

.tourism-modal-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.tourism-modal-description {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-line;
}

.tourism-modal-side {
  display: grid;
  gap: 20px;
}

.tourism-modal-details dl {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tourism-modal-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: center;
}

.tourism-modal-details dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
}

.tourism-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 768px) {
  .tourism-modal-content-inner {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Lotto168 彩券專網 Pilio 優化樣式 (字體大小與歷史列表)
   ========================================================================== */

/* 彩種專網標題控制列 */
.game-header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.font-size-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(223, 214, 199, 0.3); /* 搭配 var(--line) */
  padding: 4px 6px;
  border-radius: 20px;
}

.font-picker-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 4px;
}

.font-size-btn {
  min-width: 32px;
  min-height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.font-size-btn:hover {
  color: var(--red);
  background: rgba(255, 255, 255, 0.6);
}

.font-size-btn.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(181, 31, 42, 0.24);
}

/* 字體大小縮放機制 */
#gameView.font-size-small {
  --lotto-font-scale: 0.88;
}
#gameView.font-size-medium {
  --lotto-font-scale: 1;
}
#gameView.font-size-large {
  --lotto-font-scale: 1.18;
}

/* 小字體樣式覆蓋 */
#gameView.font-size-small .lotto-card,
#gameView.font-size-small .insight-card,
#gameView.font-size-small .quickstart-card,
#gameView.font-size-small .game-history-card {
  font-size: 14px;
}
#gameView.font-size-small .game-name {
  font-size: 20px;
}
#gameView.font-size-small .ball {
  width: 38px;
  height: 38px;
  font-size: 14px;
}
#gameView.font-size-small .mini-ball {
  min-width: 26px;
  min-height: 26px;
  font-size: 11px;
}
#gameView.font-size-small td, 
#gameView.font-size-small th {
  padding: 10px 12px;
}

/* 大字體樣式覆蓋 */
#gameView.font-size-large .lotto-card,
#gameView.font-size-large .insight-card,
#gameView.font-size-large .quickstart-card,
#gameView.font-size-large .game-history-card {
  font-size: 18px;
}
#gameView.font-size-large .game-name {
  font-size: 28px;
}
#gameView.font-size-large .ball {
  width: 54px;
  height: 54px;
  font-size: 22px;
}
#gameView.font-size-large .mini-ball {
  min-width: 36px;
  min-height: 36px;
  font-size: 16px;
}
#gameView.font-size-large td, 
#gameView.font-size-large th {
  padding: 18px 20px;
  font-size: 16px;
}

/* 歷史開獎專用微調 */
.game-history-card .table-wrap {
  border-color: rgba(223, 214, 199, 0.6);
  box-shadow: 0 4px 16px rgba(44, 35, 23, 0.04);
}

.game-history-card th,
.game-history-card td {
  border-bottom: 1px solid rgba(223, 214, 199, 0.4);
}

/* 歷史開獎表格兩欄樣式 */
.history-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}

.history-meta-cell .draw-no {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.history-meta-cell .draw-date {
  font-size: 12px;
  color: var(--muted);
}

#gameView.font-size-small .history-meta-cell .draw-no { font-size: 12px; }
#gameView.font-size-small .history-meta-cell .draw-date { font-size: 10px; }

#gameView.font-size-large .history-meta-cell .draw-no { font-size: 16px; }
#gameView.font-size-large .history-meta-cell .draw-date { font-size: 14px; }

/* 行動端 (手機版) 專屬極致優化 (Pilio 風格一目了然) */
@media (max-width: 560px) {
  /* 彩券專頁整體精簡 */
  #gameView.page-view {
    padding: 0 4px;
  }
  
  #gameView .section.tool-section {
    padding: 10px 12px !important;
    border-radius: 6px;
    margin-top: 10px;
  }

  #gameView .section-heading {
    margin-bottom: 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  #gameView .game-page-heading {
    align-items: stretch;
  }

  #gameView .game-header-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  #gameView .font-size-picker {
    padding: 2px 4px;
  }

  #gameView .font-size-btn {
    min-width: 28px;
    min-height: 24px;
    font-size: 12px;
  }

  .official-jackpot-banner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 18px;
  }

  .official-jackpot-action {
    justify-self: start;
  }

  /* 最新開獎、下期參考與歷史表格卡片精簡 */
  #gameView .lotto-card, 
  #gameView .insight-card,
  #gameView .game-history-card {
    min-height: auto !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(44, 35, 23, 0.04);
  }

  /* 讓威力彩/大樂透的開獎球能在手機版一列排列，並調整至適度大小 */
  #gameView .numbers {
    margin: 12px 0 10px;
    gap: 5px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto; /* 萬一螢幕極窄容許微滾動 */
    padding-bottom: 4px;
  }

  #gameView .ball {
    width: 34px !important;
    height: 34px !important;
    font-size: 13px !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.2);
  }

  /* 獎金與說明欄位更精簡 */
  #gameView .jackpot {
    padding: 8px 0;
    font-size: 13px;
  }

  /* 下期參考 (insight-card) 行動端簡化 */
  #gameView .insight-card dl {
    margin: 4px 0 0;
    gap: 6px;
  }
  #gameView .insight-card dt {
    font-size: 12px;
  }
  #gameView .insight-card dd {
    font-size: 13px;
    margin-bottom: 4px;
  }

  /* 專網歷史開獎表格精簡 */
  #gameView .game-history-card table {
    min-width: 100%;
  }
  #gameView .game-history-card th,
  #gameView .game-history-card td {
    padding: 8px 6px;
  }
  
  #gameView .history-meta-cell .draw-no {
    font-size: 12px;
  }
  #gameView .history-meta-cell .draw-date {
    font-size: 10px;
  }

  #gameView .mini-balls {
    gap: 3px;
  }

  #gameView .mini-ball {
    min-width: 22px !important;
    min-height: 22px !important;
    font-size: 10px !important;
  }

  /* 手機版隱藏專網的快速工具卡片，以極大釋放高度空間 */
  #gameView .quickstart-card {
    display: none !important;
  }
}

/* 觀光與活動入口卡片排版 */
.tourism-activities-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.tourism-activities-grid .quickstart-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
}

.tourism-activities-grid .quickstart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(44, 35, 23, 0.12);
  border-color: rgba(181, 31, 42, 0.28);
}

.tourism-activities-grid .quickstart-action {
  margin-top: auto;
  align-self: flex-start;
}

/* Modal 滾動內容與排版優化 */
.modal-scroll-content {
  max-height: min(65vh, 600px);
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 10px;
}

.modal-scroll-content::-webkit-scrollbar {
  width: 6px;
}

.modal-scroll-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-scroll-content::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

/* Modal 內部的響應式調整 */
@media (max-width: 1024px) {
  #tourismEventsModal .tourism-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .tourism-activities-grid {
    grid-template-columns: 1fr;
  }
  #templeFairModal .temple-fair-grid {
    grid-template-columns: 1fr !important;
  }
  #tourismEventsModal .tourism-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #tourismEventsModal .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  #tourismEventsModal .tourism-actions {
    margin-right: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  #tourismEventsModal .tourism-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   仿「樂透幸運網」專頁表格顯示樣式
   ========================================================================== */

/* 1. 列表與表格基礎樣式 */
.latest-jackpot-banner {
  background: #fff3d4;
  border: 1px solid rgba(210, 154, 36, 0.4);
  color: var(--muted);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(210, 154, 36, 0.05);
}

.latest-jackpot-banner strong {
  color: var(--red);
  font-weight: 800;
}

.lotto-lucky-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
}

/* 深紅色表頭，文字白色 */
.lotto-lucky-table th {
  background-color: var(--red);
  color: #ffffff;
  font-weight: 900;
  font-size: 16px;
  padding: 12px 16px;
  text-align: center;
  border: none;
}

.lotto-lucky-table th.date-header {
  width: 25%;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.lotto-lucky-table th.balls-header {
  width: 75%;
}

.lotto-lucky-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

/* 日期儲存格與號碼儲存格的對齊 */
.lotto-lucky-table td.lotto-date-cell {
  text-align: center;
  border-right: 1px solid var(--line);
  font-weight: 700;
}

.lotto-date {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 4px;
}

.lotto-draw-info {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* 2. 背景色配置（暖色調） */
/* 奇數列為淡粉橘色，偶數列為白色 */
.lotto-lucky-table tr.history-row:nth-child(odd) {
  background-color: #fff9f3;
}

.lotto-lucky-table tr.history-row:nth-child(even) {
  background-color: #ffffff;
}

/* 最新期的特別背景：柔和的粉黃色，邊框微帶金黃色 */
.lotto-lucky-table tr.latest-row {
  background-color: #fff3d4;
  border-bottom: 2px solid rgba(210, 154, 36, 0.4);
}

/* 最新期 Badge */
.latest-badge {
  background-color: #d29a24;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(210, 154, 36, 0.2);
}

/* 3. 獎號彩球樣式 - 一致尺寸且支持調整大小 */
.game-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

/* 統一開獎球樣式 */
.game-ball {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ff837a 0%, var(--red) 75%, #7a0c14 100%);
  font-weight: 900;
  font-size: 15px;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
}

.game-ball.special {
  background: radial-gradient(circle at 30% 30%, #ffdf85 0%, var(--gold) 75%, #94680b 100%);
  color: #231a08;
}

/* 最新期的特別發光效果 */
.latest-row .game-ball {
  box-shadow: 0 0 10px rgba(181, 31, 42, 0.5), inset 0 -6px 12px rgba(0, 0, 0, 0.25);
}

/* 4. 字體大小縮放控制（小、中、大） */

/* 預設中字體尺寸 (桌機) */
.game-text-numbers {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap !important; /* 確保主獎號絕對不折行！ */
  overflow-x: auto;  /* 超過寬度時可橫向滑動 */
  gap: 2px;
  font-weight: 900;
  font-family: Consolas, Monaco, monospace, sans-serif;
  font-size: 24px;
  letter-spacing: 0;
  white-space: nowrap !important;
}

.num-text {
  color: var(--red);
  font-weight: 900 !important;
  display: inline-block;
  transition: all 0.2s ease;
}

.num-text.special {
  color: var(--gold);
  font-weight: 900 !important;
}

.num-separator {
  color: var(--muted);
  opacity: 0.4;
  margin: 0 1px;
  font-size: 0.7em;
}

/* 小字體 (small) 縮放 (桌機) */
#gameView.font-size-small .game-ball {
  width: 32px;
  height: 32px;
  font-size: 12px;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

#gameView.font-size-small .game-text-numbers {
  font-size: 18px;
}

#gameView.font-size-small .lotto-date {
  font-size: 14px;
}

#gameView.font-size-small .lotto-draw-info {
  font-size: 11px;
}

#gameView.font-size-small .lotto-lucky-table th,
#gameView.font-size-small .lotto-lucky-table td {
  padding: 8px 10px;
}

/* 大字體 (large) 縮放 (桌機) */
#gameView.font-size-large .game-ball {
  width: 64px;
  height: 64px;
  font-size: 23px;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.25), 0 5px 10px rgba(0, 0, 0, 0.15);
}

#gameView.font-size-large .game-text-numbers {
  font-size: 34px;
}

#gameView.font-size-large .lotto-date {
  font-size: 24px;
}

#gameView.font-size-large .lotto-draw-info {
  font-size: 16px;
}

#gameView.font-size-large .lotto-lucky-table th,
#gameView.font-size-large .lotto-lucky-table td {
  padding: 18px 22px;
}

/* 5. 手機版/行動端響應式調整 */
@media (max-width: 560px) {
  .lotto-lucky-table td {
    padding: 10px 8px;
  }
  .lotto-lucky-table td.lotto-date-cell {
    padding: 10px 4px;
  }
  .lotto-date {
    font-size: 15px;
  }
  .lotto-draw-info {
    font-size: 11px;
  }
  
  /* 手機版中字體 */
  .game-text-numbers {
    font-size: 20px;
  }
  
  /* 手機版小字體 */
  #gameView.font-size-small .game-text-numbers {
    font-size: 15px;
  }
  #gameView.font-size-small .lotto-date {
    font-size: 13px;
  }
  
  /* 手機版大字體 */
  #gameView.font-size-large .game-ball {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }
  #gameView.font-size-large .game-text-numbers {
    font-size: 26px;
  }
  #gameView.font-size-large .lotto-date {
    font-size: 18px;
  }
  #gameView.font-size-large .lotto-draw-info {
    font-size: 13px;
  }
}

/* ==========================================================================
   6. 對獎與統計工具合併排版 & 端午節加開專頁樣式
   ========================================================================== */

/* 兩欄式排版 */
.tools-layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 900px) {
  .tools-layout-grid {
    grid-template-columns: 1fr;
  }
}

.panel-header {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.panel-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--ink);
}

/* 端午節專頁主題樣式 */
#promoView {
  --promo-green: #155e4b;
  --promo-green-light: #e8f5f1;
  --promo-gold: #c68a0c;
  --promo-gold-light: #fdf6e2;
  --promo-gradient: linear-gradient(135deg, var(--promo-green), #2d8a70);
  background:
    linear-gradient(135deg, rgba(27, 123, 97, 0.05), transparent 40%),
    var(--bg);
}

.promo-header-card {
  padding: 24px;
  border: 1px solid rgba(27, 123, 97, 0.2);
  border-radius: 8px;
  background: var(--promo-gradient);
  color: #ffffff;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.promo-header-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.promo-header-card p {
  margin: 0;
  line-height: 1.7;
  opacity: 0.92;
}

/* 一對多對獎面板 */
.promo-checker-panel {
  border-left: 4px solid var(--promo-gold);
}

.promo-list-panel {
  border-left: 4px solid var(--promo-green);
}

.promo-history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(21, 94, 75, 0.18);
  border-radius: 6px;
  background: rgba(232, 245, 241, 0.65);
}

.promo-history-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--promo-green);
}

.promo-history-select {
  min-width: min(520px, 72vw);
  min-height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid rgba(21, 94, 75, 0.35);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.promo-history-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* 100組號碼列表 */
.promo-draws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
  max-height: 500px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.promo-draw-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.promo-draw-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
}

.promo-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.promo-winner-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--promo-gold-light);
  color: #8f6000;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.promo-group-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.promo-group-balls .mini-ball {
  background: radial-gradient(circle at 30% 30%, #ff837a 0%, var(--red) 75%, #7a0c14 100%);
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.2);
}

/* 中獎高亮樣式 */
.promo-draw-card.highlight {
  border-color: var(--promo-gold);
  background: var(--promo-gold-light);
  box-shadow: 0 0 0 3px rgba(198, 138, 12, 0.25);
  animation: promoPulse 1.5s infinite alternate;
}

.promo-draw-card.highlight .promo-group-header {
  color: #8f6000;
  border-color: rgba(198, 138, 12, 0.2);
}

.promo-draw-card.highlight .mini-ball {
  background: radial-gradient(circle at 30% 30%, #ffdf85 0%, var(--gold) 75%, #94680b 100%);
  color: #231a08;
}

@keyframes promoPulse {
  from {
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(198, 138, 12, 0.25);
  }
  to {
    transform: scale(1.03);
    box-shadow: 0 0 0 6px rgba(198, 138, 12, 0.4);
  }
}

.promo-win-item {
  color: #1b5e20;
}

/* 自訂捲軸樣式 */
.promo-draws-grid::-webkit-scrollbar {
  width: 6px;
}
.promo-draws-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 99px;
}
.promo-draws-grid::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}
.promo-draws-grid::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* 端午加開列表排序按鈕 */
.sort-btn {
  min-height: 32px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sort-btn:hover {
  border-color: var(--promo-green);
  color: var(--promo-green);
  transform: translateY(-1px);
}

.sort-btn.active {
  background: var(--promo-green);
  border-color: var(--promo-green);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(21, 94, 75, 0.2);
}

.sort-btn.active:hover {
  background: #114c3d;
  border-color: #114c3d;
  color: #ffffff;
}

@media (max-width: 600px) {
  .promo-list-controls {
    width: 100%;
    justify-content: space-between;
  }

  .promo-history-field,
  .promo-history-select {
    width: 100%;
  }

  .promo-history-field {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 拍照識別按鈕與 OCR 載入動畫 */
#promoOcrBtn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#promoOcrBtn:hover {
  background: #114c3d !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21, 94, 75, 0.25);
}

#promoOcrBtn:active {
  transform: translateY(1px);
}

.ocr-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--promo-green-light);
  border: 1px solid rgba(27, 123, 97, 0.2);
  border-radius: 6px;
  margin-top: 10px;
  color: var(--promo-green);
}

.spinner-mini {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(21, 94, 75, 0.2);
  border-top-color: var(--promo-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   頁尾連結與法務條款 Modal 樣式
   ========================================================================== */

.footer-links {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.footer-links a:hover {
  color: var(--red);
  text-decoration: underline;
}

.footer-separator {
  color: var(--line);
  user-select: none;
}

.legal-content h3 {
  margin: 20px 0 10px;
  font-size: 18px;
  color: var(--ink);
}

.legal-content p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.75;
}

.legal-content ul, .legal-content ol {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.75;
}

/* Footer Q&A 樣式 */
.footer-qa {
  margin-top: 24px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.footer-qa-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.footer-qa-answer {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

