/* ============================================================
   GTA5 游戏版本页 · 专属样式（需先引入 common.css）
   ============================================================ */

/* ---------------- 表格 ---------------- */

table {
  width: 100%;
  margin: 18px 0 44px;
  border: 1px solid var(--line-strong);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 14px 34px -20px rgba(16, 32, 64, .45),
              0 1px 3px rgba(16, 32, 64, .05);
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .4px;
  white-space: nowrap;
  color: #eaf2ff;
  background: linear-gradient(180deg, var(--head-from), var(--head-to));
  border-right: 1px solid rgba(255, 255, 255, .07);
  border-bottom: 2px solid rgba(255, 255, 255, .14);
}

th:last-child { border-right: 0; }

th a {
  color: #a9c8ff;
  border-bottom-color: rgba(169, 200, 255, .45);
  background: none;
}

th a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, .14);
  border-bottom-color: #ffffff;
}

td {
  padding: 9px 12px;
  vertical-align: top;
  color: var(--text-cell);
  border-right: 1px solid #f0f4f9;
  border-bottom: 1px solid var(--line);
  transition: background-color .15s ease;
}

td:last-child { border-right: 0; }
table tr:last-child td { border-bottom: 0; }

/* 斑马纹（已修复：不覆盖带 bgcolor 的单元格） */
table tr:nth-child(even):not([bgcolor]) > td:not([bgcolor]) {
  background-color: var(--stripe);
}

table tr:hover > td:not([bgcolor]) {
  background-color: rgba(31, 111, 235, .07);
}

table td:first-child {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

/* 反作弊等特殊提示 */
td[bgcolor="red"] {
  color: #ffffff;
  font-weight: 600;
  background-color: #e5484d;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

/* ---------------- 版本卡片切换 ---------------- */

.version-tabs { margin: 26px 0 0; }

.tab-input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.tab-card {
  position: relative;
  flex: 1 1 200px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px 15px;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 8px 22px -18px rgba(16, 32, 64, .5);
  transition: transform .18s ease, box-shadow .18s ease,
              border-color .18s ease, background-color .18s ease;
  user-select: none;
}

.tab-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #1f6feb, #38bdf8);
  opacity: 0;
  transition: opacity .18s ease;
}

.tab-card:hover {
  transform: translateY(-2px);
  border-color: #b9cdf0;
  box-shadow: 0 14px 28px -18px rgba(31, 111, 235, .55);
}

.tab-card-badge {
  align-self: flex-start;
  padding: 1px 8px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
}

.tab-card-title { font-size: 16px; font-weight: 700; color: #16223a; }
.tab-card-sub   { font-size: 12.5px; color: var(--text-soft); }

#tab-legacy:checked   ~ .tab-bar label[for="tab-legacy"],
#tab-console:checked  ~ .tab-bar label[for="tab-console"],
#tab-enhanced:checked ~ .tab-bar label[for="tab-enhanced"] {
  transform: translateY(-2px);
  border-color: var(--brand);
  background: linear-gradient(180deg, #f5f9ff, #ffffff);
  box-shadow: 0 16px 34px -20px rgba(31, 111, 235, .85),
              inset 0 0 0 1px rgba(31, 111, 235, .22);
}

#tab-legacy:checked   ~ .tab-bar label[for="tab-legacy"]::before,
#tab-console:checked  ~ .tab-bar label[for="tab-console"]::before,
#tab-enhanced:checked ~ .tab-bar label[for="tab-enhanced"]::before { opacity: 1; }

#tab-legacy:focus-visible   ~ .tab-bar label[for="tab-legacy"],
#tab-console:focus-visible  ~ .tab-bar label[for="tab-console"],
#tab-enhanced:focus-visible ~ .tab-bar label[for="tab-enhanced"] {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* ---------------- 面板 ---------------- */

.tab-panel {
  display: none;
  max-height: 78vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 18px 6px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 18px 40px -26px rgba(16, 32, 64, .5);
}

#tab-legacy:checked   ~ .tab-panels #panel-legacy,
#tab-console:checked  ~ .tab-panels #panel-console,
#tab-enhanced:checked ~ .tab-panels #panel-enhanced { display: block; }

.tab-panel > h3 { margin: 22px 0 12px; }

.tab-panel > table { margin: 0 0 20px; box-shadow: none; }

/* 短列不换行 */
.tab-panel td:nth-child(-n+4) { white-space: nowrap; }

/* 清单编号列：等宽字体 */
#panel-legacy td:nth-child(n+5):nth-child(-n+9),
#panel-enhanced td:nth-child(n+5):nth-child(-n+9) {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
  font-size: 11.5px;
  letter-spacing: -.2px;
  color: #4a5a75;
  word-break: break-all;
}

/* 说明列 */
table td:last-child { color: #4a5a75; line-height: 1.65; }

/* 面板内滚动条 */
.tab-panel::-webkit-scrollbar { width: 10px; height: 10px; }
.tab-panel::-webkit-scrollbar-track { background: #f1f5fb; }
.tab-panel::-webkit-scrollbar-thumb {
  background: #c3cedd;
  border: 2px solid #f1f5fb;
  border-radius: 999px;
}
.tab-panel::-webkit-scrollbar-thumb:hover { background: #a8b7cb; }

/* ---------------- 响应式（表格 / 卡片） ---------------- */

@media (max-width: 900px) {
  table { font-size: 12px; margin: 14px 0 34px; }
  th, td { padding: 8px 9px; }
}

@media (max-width: 720px) {
  .tab-card { flex-basis: 100%; }
  .tab-panel { max-height: 72vh; padding: 0 10px 4px; }
  .tab-panel > h3 { margin-top: 16px; }
}