/* =========================================================
   Check page — 查奖结果独立子页面
   ========================================================= */

.check-page {
  padding: 40px 0 80px;
  background: var(--cream);
}

/* breadcrumb + title */
.cp-head {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(18, 33, 26, 0.1);
}

.cp-breadcrumb {
  margin: 0 0 14px;
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.cp-breadcrumb a {
  color: var(--jade-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cp-breadcrumb span + span {
  margin-left: 6px;
}

.cp-title {
  margin: 0;
  font-family: var(--font-thai);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--jade-900);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.cp-date {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* layout */
.cp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.65fr);
  gap: 40px;
  align-items: start;
}

/* =========================================================
   Main — 开奖结果表
   ========================================================= */

/* 核心开奖号码（一等奖 + 相邻奖 + 前后3位 + 后2位） */
.cp-core {
  background: #fff;
  border: 1px solid rgba(18, 33, 26, 0.1);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 18px 50px -36px rgba(11, 51, 37, 0.45);
}

.cp-core-table {
  width: 100%;
  border-collapse: collapse;
}

.cp-core-table th,
.cp-core-table td {
  padding: 16px 20px;
  text-align: left;
  vertical-align: middle;
  border-right: 1px solid rgba(18, 33, 26, 0.06);
}

.cp-core-table th:last-child,
.cp-core-table td:last-child {
  border-right: 0;
}

.cp-core-table thead th {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: rgba(11, 51, 37, 0.035);
  border-bottom: 1px solid rgba(18, 33, 26, 0.08);
}

.cp-core-table thead th .prize-col {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  display: block;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* 一等奖特殊样式 */
.cp-core-table tr td:first-child {
  background: linear-gradient(145deg, #fffbf0, #fff);
}

.cp-first-num {
  font-family: var(--font-thai);
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 700;
  color: var(--gold-deep);
  letter-spacing: 0.08em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(215, 181, 109, 0.25);
}

/* 相邻奖 / 前后3位 / 后2位 */
.cp-cell-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-thai);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 600;
  color: var(--jade-800);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.cp-cell-nums.tight {
  gap: 10px;
}

/* =========================================================
   二 / 三 / 四 / 五 等奖 block
   ========================================================= */

.cp-block {
  background: #fff;
  border: 1px solid rgba(18, 33, 26, 0.1);
  border-radius: 14px;
  padding: 22px 24px 20px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px -26px rgba(11, 51, 37, 0.35);
}

.cp-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed rgba(18, 33, 26, 0.12);
}

.cp-block-head h2 {
  font-family: var(--font-thai);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  font-weight: 600;
  color: var(--jade-900);
  margin: 0;
  letter-spacing: 0.01em;
}

.cp-prize {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-deep);
  background: rgba(215, 181, 109, 0.12);
  border: 1px solid rgba(215, 181, 109, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* 二等奖：单行 5 个号码 */
.cp-num-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* 三等奖以上：网格 */
.cp-num-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.cp-num {
  font-family: var(--font-thai);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 600;
  color: var(--jade-800);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  background: rgba(11, 51, 37, 0.04);
  border: 1px solid rgba(11, 51, 37, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  min-width: 0;
}

.cp-num.is-6 {
  /* 6位号码更紧凑 */
}

/* 四 / 五等奖默认折叠 */
.cp-num-grid-many {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}

.cp-block.is-expanded .cp-num-grid-many {
  max-height: 2000px;
}

.cp-toggle {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  border: 1px dashed rgba(11, 51, 37, 0.18);
  background: transparent;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--jade-700);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cp-toggle:hover {
  background: rgba(11, 51, 37, 0.04);
  color: var(--gold-deep);
}

/* =========================================================
   Side — 右侧查奖栏
   ========================================================= */

.cp-side {
  position: sticky;
  top: calc(var(--header-h, 78px) + 24px);
  display: grid;
  gap: 18px;
  align-content: start;
}

.cp-side-card {
  background: #fff;
  border: 1px solid rgba(18, 33, 26, 0.1);
  border-radius: 16px;
  padding: 26px 24px;
  box-shadow: 0 20px 50px -36px rgba(11, 51, 37, 0.5);
}

.cp-side-card h3 {
  font-family: var(--font-thai);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--jade-900);
  margin: 0;
  letter-spacing: 0.01em;
}

.cp-side-card h4 {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 12px;
}

.cp-side-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 6px 0 20px;
}

.cp-side-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.cp-side-select,
.cp-side-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(18, 33, 26, 0.14);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  color: var(--jade-900);
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 16px;
}

.cp-side-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%234c5b53' stroke-width='1.8' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.cp-side-select:focus,
.cp-side-input:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(215, 181, 109, 0.14);
}

.cp-side-input::placeholder {
  color: var(--ink-faint);
}

.cp-side-btn {
  width: 100%;
  padding: 15px 24px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(150deg, #f3d795, #d7b56d 52%, #b9944b);
  color: #2a1e08;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 28px -14px rgba(215, 181, 109, 0.85);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.cp-side-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px -12px rgba(242, 212, 147, 0.9);
}

.cp-side-btn:active {
  transform: translateY(1px);
}

/* 查奖结果 */
.cp-side-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(11, 51, 37, 0.12);
  animation: resultIn 0.35s var(--ease);
}

.cp-side-result.is-win {
  background: linear-gradient(150deg, rgba(215, 181, 109, 0.16), rgba(232, 145, 47, 0.08));
  border-color: rgba(168, 135, 63, 0.45);
}

.cp-side-result.is-lose {
  background: rgba(18, 33, 26, 0.03);
}

.cpr-title {
  font-family: var(--font-thai);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}

.cpr-amount {
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-deep);
}

.cpr-detail {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* 往期列表 */
.cp-side-past ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.cp-side-past li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 2px;
  border-bottom: 1px dashed rgba(18, 33, 26, 0.08);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

.cp-side-past li:last-child {
  border-bottom: 0;
}

.cp-side-past li:hover {
  color: var(--gold-deep);
}

.cp-side-past li b {
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--jade-700);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 920px) {
  .cp-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cp-main,
  .cp-side {
    min-width: 0; /* 防止表格最小内容宽度撑破移动端布局 */
  }
  .cp-side {
    position: static;
    order: -1; /* 移动端查奖栏显示在结果表上方 */
  }
  .cp-num-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cp-core-table th,
  .cp-core-table td {
    padding: 12px 10px;
  }
}

@media (max-width: 560px) {
  .cp-core-table {
    display: block;
    overflow-x: auto;
  }
  .cp-core-table thead,
  .cp-core-table tbody {
    display: block;
  }
  .cp-core-table tr {
    display: flex;
  }
  .cp-core-table th,
  .cp-core-table td {
    flex: 1 0 auto;
    min-width: 110px;
    font-size: 13px;
  }
  .cp-num-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cp-num {
    font-size: 15px;
  }
}
