/* 图片复刻风格：橙色底、黑色线、汉仪雅酷黑简 */
@font-face {
  font-family: "HYYaKuHeiJ";
  src: url("./assets/fonts/HYYaKuHeiJ.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --page-bg: #15120f;
  --table-orange: #f47b20;
  --table-orange-dark: #e96f16;
  --ink: #050505;
  --line: #161616;
  --card-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(245,130,32,.22), transparent 32rem),
    radial-gradient(circle at 80% 0%, rgba(255,180,80,.12), transparent 28rem),
    var(--page-bg);
  color: #fff;
  font-family: "HYYaKuHeiJ", "Microsoft YaHei", "SimHei", Arial, sans-serif;
}

.page-shell {
  width: min(1180px, calc(100vw - 24px));
  margin: 24px auto;
}

.table-card {
  background: #24201c;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--card-shadow);
}

.loading-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #ffd4a2;
  opacity: 1;
  transform: scale(1);
  transition: opacity .22s ease, transform .22s ease;
}

.loading-state[hidden] {
  display: none;
}

.loading-state.is-done {
  opacity: 0;
  transform: scale(.98);
}

.loading-state.is-error {
  color: #ffd4a2;
}

.loading-state.is-error .loading-spinner {
  display: none;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(244, 123, 32, .25);
  border-top-color: var(--table-orange);
  border-radius: 50%;
  animation: loading-spin .8s linear infinite;
}

.loading-text {
  font-family: "HYYaKuHeiJ", "Microsoft YaHei", "SimHei", Arial, sans-serif;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: .08em;
  animation: loading-breathe 1.4s ease-in-out infinite;
}

.loading-state.is-error .loading-text {
  animation: none;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@keyframes loading-breathe {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.table-scroll {
  overflow: auto;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--table-orange);
  max-height: calc(100vh - 40px);
}

.table-scroll.is-loading {
  display: none;
}

.export-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  min-width: 104px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--table-orange);
  color: var(--ink);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .38);
  font-family: "HYYaKuHeiJ", "Microsoft YaHei", "SimHei", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, opacity .16s ease;
}

.export-button:hover:not(:disabled) {
  background: #ff923b;
  transform: translateY(-2px);
}

.export-button:active:not(:disabled) {
  transform: translateY(0);
}

.export-button:focus-visible {
  outline: 3px solid rgba(255, 212, 162, .7);
  outline-offset: 3px;
}

.export-button:disabled {
  cursor: wait;
  opacity: .62;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--table-orange);
  color: var(--ink);
  font-family: "HYYaKuHeiJ", "Microsoft YaHei", "SimHei", Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.18;
}

col.date { width: 9.3%; }
col.plan { width: 18.8%; }
col.input { width: 16.8%; }
col.odds { width: 16.8%; }
col.win { width: 16.8%; }
col.result { width: 9.6%; }
col.profit { width: 13.2%; }

th, td {
  border: 1px solid var(--line);
  padding: 4px 6px;
  height: 25px;
  text-align: center;
  vertical-align: middle;
  background: var(--table-orange);
  color: var(--ink);
  word-break: keep-all;
  white-space: nowrap;
}

tr.title-row td,
tr.note-row td {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .02em;
  padding: 5px 8px;
}

tr.header-row th {
  font-size: 17px;
  font-weight: 900;
  background: var(--table-orange);
}

tr.divider-row td {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 5px 8px;
}

tr.no-event td:nth-child(2) {
  font-weight: 900;
}

.loading, .error {
  padding: 28px !important;
  font-size: 18px;
}

.error { color: #6d0000; }

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 50% -10%, rgba(245,130,32,.28), transparent 18rem),
      var(--page-bg);
  }

  .page-shell {
    width: 100%;
    margin: 0;
    padding: 12px 6px;
  }

  .table-card {
    padding: 8px;
    border-radius: 12px;
  }

  .loading-state {
    min-height: 160px;
  }

  .loading-spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
  }

  .loading-text {
    font-size: 16px;
  }

  .export-button {
    right: 12px;
    bottom: 12px;
    min-width: 92px;
    padding: 9px 14px;
    font-size: 14px;
  }


  /* 不改变表格样式和结构，只将完整桌面表格等比缩小。 */
  .table-scroll {
    overflow: hidden;
    max-height: none;
  }

  table {
    width: 840px;
    min-width: 840px;
  }
}
