:root {
  --page-background: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #edf3f7;
  --text: #17212b;
  --muted: #64717d;
  --border: #dbe2e8;

  --primary: #075985;
  --primary-dark: #0c4a6e;
  --primary-light: #e0f2fe;

  --green: #07833e;
  --green-light: #f1f9ef;

  --special: #ef6f78;

  --shadow: 0 10px 30px rgba(20, 35, 50, 0.08);
  --radius: 16px;
  --container: 1080px;
}

/* ===== 基本設定 ===== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page-background);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

img {
  max-width: 100%;
}

.container {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}

/* ===== 頁首導覽 ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(219, 226, 232, 0.9);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: #095aa4;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.main-nav a {
  padding: 22px 0 18px;
  border-bottom: 3px solid transparent;
  color: #172b46;
  font-size: 0.98rem;
  font-weight: 800;
  text-decoration: none;
}

.main-nav a:hover {
  color: #dc2626;
  border-bottom-color: #dc2626;
}

/* ===== 首頁主視覺 ===== */

.hero {
  padding: 72px 0 64px;
  color: #ffffff;
  background:
    radial-gradient(
      circle at 82% 28%,
      rgba(92, 210, 255, 0.28),
      transparent 26%
    ),
    linear-gradient(135deg, #0560bd, #003f91);
}

.hero-inner {
  max-width: 1080px;
}

.hero h1 {
  max-width: 760px;
  margin: 10px 0 14px;
  font-size: clamp(2.15rem, 6vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.hero-text {
  max-width: 700px;
  margin: 0;
  color: #ffe61a;
  font-size: clamp(1.05rem, 2.5vw, 1.55rem);
  font-weight: 800;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #bae6fd;
}

.button {
  min-height: 46px;
  padding: 10px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button-light {
  color: #ffffff;
  background: #ef2727;
}

.button-outline {
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;
  background: transparent;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

/* ===== 通用區塊 ===== */

.section {
  padding: 58px 0;
}

.section-alt {
  background: var(--surface-alt);
}

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

.section-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  line-height: 1.2;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* =========================================================
   最新開獎
   ========================================================= */

#latest {
  background: #ffffff;
}

#latest .container {
  width: min(calc(100% - 24px), 1160px);
}

#latest .section-heading {
  margin-bottom: 0;
  padding: 12px 18px;
  align-items: center;
  color: #ffffff;
  background: linear-gradient(90deg, #07833e, #079447);
  border-radius: 12px 12px 0 0;
}

#latest .section-heading .eyebrow {
  display: none;
}

#latest .section-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.35rem;
}

#latest .section-heading h2::before {
  content: "★";
  margin-right: 9px;
}

#latest .status {
  color: rgba(255, 255, 255, 0.94);
  font-weight: 700;
}

.lottery-list {
  display: block;
  overflow: hidden;
  border: 1px solid #8cc899;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #ffffff;
}

.lottery-row {
  min-height: 126px;
  padding: 16px 22px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid #a7d2ae;
  background:
    linear-gradient(
      90deg,
      #ffffff 0%,
      #ffffff 64%,
      var(--green-light) 100%
    );
}

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

/* 彩種標示 */

.lottery-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lottery-mark {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #146fc2, #073b82);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.lottery-name {
  color: #153c69;
  font-size: 1.35rem;
  font-weight: 900;
  white-space: nowrap;
}

.lottery-638 .lottery-mark {
  background: linear-gradient(145deg, #20ae62, #08743d);
}

.lottery-638 .lottery-name {
  color: #dc2626;
}

.lottery-539 .lottery-mark {
  background: linear-gradient(145deg, #ff9b18, #ed4c14);
}

.lottery-539 .lottery-name {
  color: #f05a16;
}

.lottery-4d .lottery-mark,
.lottery-3d .lottery-mark {
  border-radius: 18px;
  background: linear-gradient(145deg, #a95ce4, #6421b7);
}

.lottery-4d .lottery-name,
.lottery-3d .lottery-name {
  color: #6526a8;
}

/* 期數、日期與球號 */

.lottery-content {
  min-width: 0;
}

.lottery-information {
  margin-bottom: 10px;
}

.lottery-period {
  color: #111827;
  font-size: 1.08rem;
  font-weight: 900;
}

.lottery-date {
  margin-top: 2px;
  color: #374151;
  font-size: 0.96rem;
}

.draw-numbers {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.draw-number {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #101010;
  font-size: 1.07rem;
  font-weight: 900;
  box-shadow:
    inset 0 -5px 8px rgba(0, 0, 0, 0.08),
    0 3px 7px rgba(0, 0, 0, 0.12);
}

.ball-cyan {
  background: linear-gradient(145deg, #61e9f1, #20c7dd);
}

.ball-pink {
  background: linear-gradient(145deg, #ffa1a5, #ff7078);
}

.ball-green {
  background: linear-gradient(145deg, #7be171, #3fc54b);
}

.ball-orange {
  background: linear-gradient(145deg, #ffd070, #f5a630);
}

.ball-purple {
  background: linear-gradient(145deg, #cab0fb, #9870e7);
}

.ball-special {
  background: linear-gradient(145deg, #ffa5a9, #f56d76);
}

.number-plus {
  flex: 0 0 auto;
  margin-inline: 2px;
  color: #111827;
  font-size: 1.55rem;
  font-weight: 900;
}

.star-number {
  width: 55px;
  height: 55px;
  flex-basis: 55px;
  border-radius: 0;
  color: #fff337;
  background: linear-gradient(145deg, #b66aff, #6624d4);
  clip-path: polygon(
    50% 0%,
    61% 34%,
    98% 35%,
    68% 56%,
    79% 94%,
    50% 72%,
    21% 94%,
    32% 56%,
    2% 35%,
    39% 34%
  );
  box-shadow: none;
}

/* ===== 數據分析 ===== */

#analysis .container {
  width: min(calc(100% - 24px), 1160px);
}

#analysis .section-heading {
  margin-bottom: 0;
  padding: 11px 18px;
  color: #ffffff;
  background: linear-gradient(90deg, #0758bd, #0565c9);
  border-radius: 12px 12px 0 0;
}

#analysis .section-heading .eyebrow {
  display: none;
}

#analysis .section-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.3rem;
}

.analysis-panel {
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  align-items: center;
  gap: 32px;
  border: 1px solid #9ec0ed;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background:
    linear-gradient(
      120deg,
      #ffffff,
      #edf5ff
    );
}

.analysis-copy h3 {
  margin: 10px 0;
  color: #0758bd;
  font-size: 1.65rem;
}

.analysis-copy p {
  max-width: 600px;
  margin: 0;
  color: #34465e;
}

.analysis-label {
  padding: 4px 10px;
  border-radius: 999px;
  color: #0758bd;
  background: #dbeafe;
  font-size: 0.78rem;
  font-weight: 900;
}

.period-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.period-options button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #377ee0;
  border-radius: 8px;
  color: #0758bd;
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.period-options button:hover {
  color: #ffffff;
  background: #0758bd;
}

.analysis-panel > .button {
  grid-column: 2;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #0767cf, #004ba6);
}

/* ===== 彩券分析程式 ===== */

#software .container {
  width: min(calc(100% - 24px), 1160px);
}

#software .section-heading {
  margin-bottom: 0;
  padding: 11px 18px;
  color: #ffffff;
  background: linear-gradient(90deg, #762bc0, #6320b4);
  border-radius: 12px 12px 0 0;
}

#software .section-heading .eyebrow {
  display: none;
}

#software .section-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.3rem;
}

.software-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  border: 1px solid #cbb8e8;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #f8f4fd;
}

.info-card {
  position: relative;
  min-height: 225px;
  padding: 24px;
  border: 1px solid #d9dce2;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(25, 45, 70, 0.07);
}

.card-number {
  width: 43px;
  height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: #22a447;
  font-size: 1.1rem;
  font-weight: 900;
}

.info-card:nth-child(2) .card-number {
  background: #fb9800;
}

.info-card:nth-child(3) .card-number {
  background: #1f97d4;
}

.info-card h3 {
  margin: 18px 0 8px;
  color: #172b46;
  font-size: 1.35rem;
}

.info-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.info-card a {
  padding: 7px 16px;
  display: inline-flex;
  border: 1px solid #22a447;
  border-radius: 7px;
  color: #138735;
  font-weight: 800;
  text-decoration: none;
  pointer-events: none;
}

.info-card:nth-child(2) a {
  border-color: #fb9800;
  color: #e58100;
}

.info-card:nth-child(3) a {
  border-color: #1676cc;
  color: #0758bd;
}

/* ===== 頁尾 ===== */

.site-footer {
  padding: 24px 0;
  color: #d5e2ea;
  background: linear-gradient(90deg, #062948, #001d3a);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.site-footer p {
  margin: 0;
}

/* ===== 錯誤訊息 ===== */

.error-message {
  padding: 20px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #991b1b;
  background: #fef2f2;
}

/* =========================================================
   平板與手機
   ========================================================= */

@media (max-width: 820px) {
  .analysis-panel {
    grid-template-columns: 1fr;
  }

  .analysis-panel > .button {
    grid-column: auto;
  }

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

@media (max-width: 720px) {
  .container {
    width: min(calc(100% - 20px), var(--container));
  }

  .header-inner {
    min-height: 60px;
  }

  .brand {
    font-size: 1.35rem;
  }

  .main-nav {
    gap: 14px;
  }

  .main-nav a {
    padding: 18px 0 14px;
    font-size: 0.82rem;
  }

  .hero {
    padding: 48px 0 44px;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero-text {
    font-size: 1.02rem;
  }

  .section {
    padding: 42px 0;
  }

  #latest .container,
  #analysis .container,
  #software .container {
    width: min(calc(100% - 12px), 1160px);
  }

  #latest .section-heading {
    padding: 10px 12px;
  }

  #latest .section-heading h2 {
    font-size: 1.12rem;
  }

  #latest .status {
    font-size: 0.75rem;
  }

  .lottery-row {
    min-height: 122px;
    padding: 12px 10px;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .lottery-identity {
    display: block;
    text-align: center;
  }

  .lottery-mark {
    width: 43px;
    height: 43px;
    min-width: 43px;
    margin: 0 auto;
    font-size: 0.66rem;
  }

  .lottery-name {
    margin-top: 4px;
    display: block;
    font-size: 0.77rem;
  }

  .lottery-information {
    margin-bottom: 8px;
  }

  .lottery-period {
    font-size: 0.82rem;
  }

  .lottery-date {
    font-size: 0.74rem;
  }

  .draw-numbers {
    width: 100%;
    gap: 4px;
  }

  .draw-number {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    font-size: 0.76rem;
  }

  .number-plus {
    margin-inline: 0;
    font-size: 0.9rem;
  }

  .star-number {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .analysis-panel {
    padding: 22px;
    gap: 22px;
  }

  .period-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    text-align: center;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 430px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .lottery-row {
    grid-template-columns: 70px minmax(0, 1fr);
    padding-inline: 6px;
    gap: 5px;
  }

  .lottery-mark {
    width: 37px;
    height: 37px;
    min-width: 37px;
    font-size: 0.59rem;
  }

  .lottery-name {
    font-size: 0.68rem;
  }

  .lottery-period {
    font-size: 0.72rem;
  }

  .lottery-date {
    font-size: 0.65rem;
  }

  .draw-numbers {
    gap: 3px;
  }

  .draw-number {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    font-size: 0.67rem;
  }

  .number-plus {
    font-size: 0.78rem;
  }

  .star-number {
    width: 33px;
    height: 33px;
    flex-basis: 33px;
  }

  .period-options {
    grid-template-columns: 1fr;
  }

  .software-grid {
    padding: 10px;
  }
}

@media (max-width: 350px) {
  .lottery-row {
    grid-template-columns: 60px minmax(0, 1fr);
    padding-inline: 4px;
    gap: 3px;
  }

  .lottery-mark {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .lottery-name {
    font-size: 0.62rem;
  }

  .draw-numbers {
    gap: 2px;
  }

  .draw-number {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 0.59rem;
  }

  .number-plus {
    font-size: 0.68rem;
  }

  .star-number {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
}
/* =========================================================
   彩券分析程式與購買資訊
   ========================================================= */

.software-intro {
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border: 1px solid #cbb8e8;
  border-top: 0;
  background:
    linear-gradient(
      120deg,
      #ffffff,
      #f3edff
    );
}

.software-copy {
  max-width: 680px;
}

.software-tag {
  padding: 5px 11px;
  display: inline-flex;
  border-radius: 999px;
  color: #6520b3;
  background: #eee2ff;
  font-size: 0.78rem;
  font-weight: 900;
}

.software-copy h3 {
  margin: 10px 0 8px;
  color: #552099;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.software-copy p {
  margin: 6px 0;
  color: #4b5563;
}

.software-actions {
  min-width: 230px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}

.software-actions span {
  color: #6b7280;
  font-size: 0.87rem;
}

.software-download-button {
  width: 100%;
  min-height: 50px;
  padding: 12px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #ffffff;
  background:
    linear-gradient(
      90deg,
      #7029c4,
      #4e17a3
    );
  box-shadow: 0 8px 18px rgba(99, 32, 180, 0.22);
  font-weight: 900;
  text-decoration: none;
}

.software-download-button:hover {
  transform: translateY(-1px);
}

.software-feature-card,
.purchase-card,
.install-card {
  min-height: auto;
}

.software-list,
.install-steps {
  margin: 16px 0 0;
  padding-left: 22px;
  color: #4b5563;
}

.software-list li,
.install-steps li {
  margin: 7px 0;
}

.purchase-method {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
}

.purchase-method:first-of-type {
  border-top: 0;
}

.purchase-method strong {
  color: #d62121;
}

.purchase-method p {
  margin: 4px 0;
  color: #374151;
}

.purchase-method b {
  color: #ef1616;
  font-size: 1.05rem;
}

.purchase-phone p {
  margin-top: 8px;
}

.purchase-phone a {
  padding: 0;
  border: 0 !important;
  color: #ef1616 !important;
  font-size: 1.15rem;
  font-weight: 900;
  pointer-events: auto;
}

.install-download-link {
  margin-top: 20px;
  padding: 9px 18px !important;
  display: inline-flex;
  border: 1px solid #1676cc !important;
  border-radius: 7px;
  color: #0758bd !important;
  font-weight: 900;
  text-decoration: none;
  pointer-events: auto !important;
}

.purchase-note {
  margin: 16px 0 0;
  padding: 13px 18px;
  border-left: 5px solid #ef2727;
  color: #8b1c1c;
  background: #fff1f1;
  font-weight: 800;
}

/* 手機版 */

@media (max-width: 720px) {
  .software-intro {
    padding: 22px 18px;
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }

  .software-actions {
    min-width: 0;
    width: 100%;
  }

  .software-download-button {
    width: 100%;
  }

  .purchase-phone a {
    display: inline;
    font-size: 1rem;
  }

  .purchase-method {
    margin-top: 14px;
    padding-top: 13px;
  }
}
/* =========================================================
   精英好朋友
   ========================================================= */

.software-main-grid {
  grid-template-columns: repeat(2, 1fr);
}

.download-card {
  border-color: #b8cfee;
}

.trial-highlight {
  margin: 12px 0 16px !important;
  padding: 9px 14px;
  border-left: 5px solid #ef2727;
  color: #b91c1c !important;
  background: #fff1f1;
  font-size: 1.08rem;
  font-weight: 900;
}

.download-card .software-download-button {
  margin-top: 20px;
  width: 100%;
  border-radius: 9px;
  pointer-events: auto;
}

.purchase-section {
  margin-top: 18px;
  border: 1px solid #d6c3eb;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.purchase-title {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  background: linear-gradient(90deg, #762bc0, #6320b4);
}

.purchase-number {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: #fb9800;
  font-size: 1.05rem;
  font-weight: 900;
}

.purchase-title h3 {
  margin: 0;
  font-size: 1.35rem;
}

.purchase-title p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.84);
}

.purchase-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  background: #faf8fd;
}

.purchase-grid .purchase-method {
  margin: 0;
  padding: 20px;
  border: 1px solid #ddd7e5;
  border-radius: 9px;
  background: #ffffff;
}

.purchase-grid .purchase-method strong {
  display: block;
  margin-bottom: 10px;
  color: #d62121;
  font-size: 1.05rem;
}

.purchase-grid .purchase-method p {
  margin: 5px 0;
}

.purchase-phone a {
  pointer-events: auto !important;
}

@media (max-width: 720px) {
  .software-main-grid {
    grid-template-columns: 1fr;
  }

  .purchase-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .purchase-title {
    padding: 15px 16px;
  }

  .purchase-grid .purchase-method {
    padding: 17px;
  }
}