* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #0b1015; color: #e6eef7;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* ========== Header ========== */
.page-header { padding: 24px 16px 8px; text-align: center; }
.page-header h1 { margin: 0; font-size: 28px; }
.subtitle { color: #a8c1d8; margin-top: 6px; }
.subtitle .tag { background: #1f2c3a; padding: 2px 6px; border-radius: 6px; }

/* Header actions：按钮容器 */
.header-actions {
  margin-top: 12px; display:flex; justify-content:center; gap:8px; flex-wrap: wrap;
}

/* 基础按钮（供 QQ/KOOK 等公用） */
.btn {
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius:12px;
  text-decoration:none; font-weight:600;
}
.btn .ico { width:18px; height:18px; fill: currentColor; }

/* 漂亮的“查看矿石掉落概率”按钮（备用，如果首页需要） */
.btn-cta{
  --ring1: rgba(59,130,246,.7);
  --ring2: rgba(139,92,246,.7);
  --bg1: #0d1524;
  --bg2: #0b1220;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px; font-weight: 700; letter-spacing: .2px;
  color: #eaf2ff; text-decoration: none; position: relative;
  border: 1px solid #223248; background: linear-gradient(180deg, var(--bg1), var(--bg2));
  box-shadow: 0 10px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-cta .ico{ width: 18px; height: 18px; fill: currentColor; opacity: .95; }
.btn-cta::before{
  content:""; position:absolute; inset:-1px; border-radius:inherit; padding:1px;
  background: linear-gradient(135deg, var(--ring1), var(--ring2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events:none; opacity:.65; transition: opacity .25s ease;
}
.btn-cta::after{
  content:""; position:absolute; left:-30%; top:-150%; width:60%; height:400%;
  transform: rotate(25deg);
  background: linear-gradient(to right, transparent, rgba(255,255,255,.12), transparent);
  opacity:0; transition: transform .65s ease, opacity .65s ease;
}
.btn-cta:hover{ transform: translateY(-1px); box-shadow: 0 14px 34px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06); filter: brightness(1.02); }
.btn-cta:hover::before{ opacity:1; }
.btn-cta:hover::after{ transform: translateX(250%) rotate(25deg); opacity:.9; }
.btn-cta:active{ transform: translateY(0); filter: brightness(1.0); }
.btn-cta:focus-visible{ outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,.35), 0 10px 28px rgba(0,0,0,.35); }
@media (max-width: 480px){
  .btn-cta{ padding: 9px 14px; gap: 8px; }
  .btn-cta .ico{ width:16px; height:16px; }
}

/* ========== Cards & Tables ========== */
.card {
  max-width: 1100px; margin: 12px auto;
  background: #121821; border: 1px solid #1f2c3a; border-radius: 14px;
  padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.card h2 { margin: 4px 0 12px; font-size: 18px; color: #cfe6ff; }
.note { color: #9fb3c8; }

.toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
button {
  background: #1f3b62; color:#e6eef7; border: 1px solid #2d4e7a;
  border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
button:hover { background: #24456f; }

.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; color: #9fb3c8; font-weight: 600; padding: 8px 6px; }
tbody td { padding: 6px; }

input[type="number"]{
  width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #2a3e56; background: #0f141b; color: #e6eef7;
}

.result-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.result { font-family: Consolas, ui-monospace, monospace; font-size: 16px; }
.muted { color: #7b93ab; }
.actions { display: flex; gap: 8px; }

#viz {
  width: 100%; height: auto; display:block;
  background: #0f1114; border: 1px solid #2a3e56; border-radius: 10px;
}

.tooltip {
  position: fixed; background: #0e1116; color: #e6eef7;
  padding: 6px 8px; border: 1px solid #223247; border-radius: 8px;
  font-size: 12px; pointer-events: none; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.page-footer { text-align: center; padding: 20px; color: #6e859d; }
kbd { background:#101827; border:1px solid #203047; padding:2px 6px; border-radius:4px; }
code { background:#101827; padding:2px 6px; border-radius:6px; }

/* ========== Ad hero ========== */
.ad-hero {
  max-width: 1100px; margin: 16px auto; padding: 18px;
  background:
    radial-gradient(1200px 400px at 20% -20%, rgba(99,102,241,0.2), rgba(0,0,0,0)),
    linear-gradient(90deg, #0f1724, #111a29);
  border:1px solid #223248; border-radius: 16px;
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  align-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
.ad-hero__left { display:flex; align-items:center; justify-content:center; }
.ad-logo {
  width: 96px; height: 96px; border-radius: 20px;
  background:#0b1220; border:1px solid #243b58; padding:12px;
}
.ad-hero__right { min-width: 0; }
.ad-eyebrow { color:#9fb3c8; font-size:13px; letter-spacing: .06em; text-transform:uppercase; }
.ad-title { margin:6px 0 8px; font-size: 24px; color:#d7e7ff; }
.ad-desc { margin:0 0 12px; color:#c1d7f0; }
.ad-cta { display:flex; gap:10px; flex-wrap: wrap; margin-bottom: 8px; }
.btn-qq { background:#0b3572; border:1px solid #174b99; color:#e6f0ff; }
.btn-qq:hover { background:#0e3f86; }
.btn-kook { background:#2f244a; border:1px solid #4b3b7a; color:#efe7ff; }
.btn-kook:hover { background:#3a2b5c; }
.ad-meta { color:#7b93ab; font-size: 13px; }
.ad-meta .sep { opacity:.5; padding:0 6px; }
@media (max-width: 680px) {
  .ad-hero { grid-template-columns: 1fr; text-align: left; }
  .ad-hero__left { justify-content: flex-start; }
  .ad-logo { width:78px; height:78px; }
}

/* ========== Probabilities page (probabilities.html) ========== */

/* 页面内容宽度容器 */
.page-width { max-width: 1100px; margin: 0 auto; padding: 0 12px 24px; }

/* 返回按钮 & 徽章 */
.back-link {
  color:#a8c1d8; text-decoration:none;
  border:1px solid #223248; padding:6px 10px; border-radius:10px;
}
.back-link:hover { background:#0f1724; }
.badge {
  display:inline-block; padding:2px 8px;
  border:1px solid #203047; background:#0f141b;
  border-radius:999px; color:#9fb3c8; font-size:12px;
}

/* segmented 切换 */
.seg,
.header-actions .seg {
  display:inline-flex; background:#0f141b;
  border:1px solid #203047; border-radius:12px; overflow:hidden;
}
.seg button {
  border:0; background:transparent; padding:8px 12px;
  color:#cfe6ff; cursor:pointer; font-weight:600;
}
.seg button[aria-pressed="true"] { background:#1a2740; }

/* 概率表格 */
.table-wrapper.compact { overflow-x: auto; }
.tbl-prob { width: 100%; border-collapse: collapse; font-size: 13px; }

/* 表头居中，名称列例外左对齐 */
.tbl-prob thead th {
  text-align: center; font-weight: 700; padding: 8px 10px;
  color: #cfe6ff; background: #0f1724; border-bottom: 1px solid #223248;
  white-space: nowrap;
}
.tbl-prob thead th:first-child { text-align: left; }

/* 表体行样式 */
.tbl-prob tbody td { padding: 8px 10px; border-bottom: 1px solid #1d2a3a; }
.tbl-prob tbody tr:nth-child(odd) td { background: #0c1119; }
.tbl-prob tbody tr:hover td { background: #0f1724; }

/* 对齐修正：第2~4列（百分比）居中，第1列左对齐 */
.tbl-prob tbody td:nth-child(1) { text-align: left; }
.tbl-prob tbody td:nth-child(2),
.tbl-prob tbody td:nth-child(3),
.tbl-prob tbody td:nth-child(4) { text-align: center; }

/* 高亮模式（只看深板岩/石头） */
.tbl-prob.mode-deepslate thead th:nth-child(3),
.tbl-prob.mode-deepslate tbody td:nth-child(3) { background:#102036; color:#e8f2ff; }
.tbl-prob.mode-stone thead th:nth-child(4),
.tbl-prob.mode-stone tbody td:nth-child(4) { background:#14243c; color:#e8f2ff; }

/* 脚注列表 */
.legend {
  margin: 10px 0 0 18px; padding: 0;
  color: #9fb3c8; font-size: 12px; line-height: 1.6;
}
