/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #f0b432;
  --gold-light: #ffd369;
  --gold-dark: #c8901a;
  --bg: #0d0f14;
  --bg2: #161920;
  --bg3: #1e2230;
  --bg4: #252a3a;
  --text: #e8eaf0;
  --text2: #a0a6b8;
  --text3: #6b7290;
  --red: #f05252;
  --blue: #4f8ef5;
  --green: #3ecf8e;
  --border: #2a2f42;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, #0d0f14 0%, #1a1d2a 100%);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: none !important;
  border-radius: 0;
  display: block;
  object-fit: contain;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 11px;
  color: var(--text3);
  margin-left: 2px;
}

.nav { display: flex; gap: 4px; }

.nav a {
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
}

.nav a:hover, .nav a.active {
  background: var(--bg3);
  color: var(--gold);
}

/* ===== Container ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 28px;
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  font-weight: 700;
}

.tab-btn:hover:not(.active) {
  background: var(--bg3);
  color: var(--text);
}

/* ===== Latest Result Card ===== */
.result-card {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.result-title {
  font-size: 13px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--gold);
  border-radius: 2px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.result-main {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.result-number {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 90px;
}

.result-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}

.badge-big { background: rgba(240,82,82,0.15); color: var(--red); border: 1px solid rgba(240,82,82,0.3); }
.badge-small { background: rgba(79,142,245,0.15); color: var(--blue); border: 1px solid rgba(79,142,245,0.3); }
.badge-odd { background: rgba(240,180,50,0.15); color: var(--gold); border: 1px solid rgba(240,180,50,0.3); }
.badge-even { background: rgba(62,207,142,0.15); color: var(--green); border: 1px solid rgba(62,207,142,0.3); }

.result-meta {
  margin-left: auto;
  text-align: right;
  color: var(--text3);
  font-size: 12px;
  line-height: 1.8;
}

.result-time { color: var(--text2); font-size: 13px; }

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  margin-top: 12px;
}

.countdown-num {
  background: var(--bg4);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  min-width: 32px;
  text-align: center;
}

/* ===== Stats Row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
}

.stat-label {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

/* ===== Table ===== */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-actions { display: flex; gap: 8px; }

.btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
}

.btn-gold:hover { filter: brightness(1.1); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
}

.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--bg3);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.5px;
}

td {
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(42,47,66,0.6);
  vertical-align: middle;
  text-align: center;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.td-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.td-block {
  color: var(--text2);
  font-size: 12px;
  font-family: monospace;
}

.td-hash {
  font-family: monospace;
  font-size: 11px;
  color: var(--text3);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-time { color: var(--text2); font-size: 12px; }

.type-badges {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.mini-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.mini-badge + .mini-badge {
  margin-left: 3px;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text3);
}

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}

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

/* ===== Verify Page ===== */
.verify-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.verify-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.verify-card h2::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--gold);
  border-radius: 2px;
}

.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.input-group textarea {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: monospace;
  font-size: 13px;
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.2s;
}

.input-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.input-group textarea::placeholder { color: var(--text3); }

.btn-calc {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s;
  white-space: nowrap;
  align-self: flex-start;
}

.btn-calc:hover { filter: brightness(1.1); }

.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  transition: border-color 0.2s;
}

.step-row.highlight { border-color: var(--gold); }

.step-num {
  width: 26px;
  height: 26px;
  background: var(--bg4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 1px;
}

.step-info { flex: 1; min-width: 0; }
.step-label { font-size: 12px; color: var(--text3); margin-bottom: 4px; }
.step-value {
  font-family: monospace;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

.step-value.big { font-size: 32px; font-weight: 900; color: var(--gold); font-family: inherit; }

.result-final {
  background: linear-gradient(135deg, rgba(240,180,50,0.1), rgba(200,144,26,0.05));
  border: 1px solid rgba(240,180,50,0.3);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-top: 16px;
}

.result-final-num {
  font-size: 72px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 12px;
}

.result-final-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text3);
}

.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .result-main { gap: 14px; }
  .result-number { font-size: 48px; }
  .result-meta { margin-left: 0; text-align: left; }
  .input-group { flex-direction: column; }
  .nav { display: none; }
}

/* ===== 开奖中动画 ===== */
.drawing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.drawing-balls {
  display: flex;
  gap: 3px;
  align-items: center;
}

.drawing-ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg4), var(--bg3));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  animation: drawSpin 0.4s linear infinite;
  box-shadow: 0 0 20px rgba(240,180,50,0.2);
}

.drawing-ball:nth-child(1) { animation-delay: 0s; }
.drawing-ball:nth-child(2) { animation-delay: 0.13s; }
.drawing-ball:nth-child(3) { animation-delay: 0.26s; }

@keyframes drawSpin {
  0%   { content: ''; transform: scale(1);    box-shadow: 0 0 10px rgba(240,180,50,0.2); }
  50%  { transform: scale(1.15);  box-shadow: 0 0 28px rgba(240,180,50,0.6); border-color: var(--gold); }
  100% { transform: scale(1);    box-shadow: 0 0 10px rgba(240,180,50,0.2); }
}

.drawing-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 4px;
  animation: drawBlink 0.8s ease-in-out infinite;
}

@keyframes drawBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.drawing-dots span {
  display: inline-block;
  animation: dotBounce 1s ease-in-out infinite;
}
.drawing-dots span:nth-child(2) { animation-delay: 0.2s; }
.drawing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%            { transform: translateY(-6px); }
}

/* ===== 珠子 ===== */
.balls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 -3px 6px rgba(0,0,0,0.2), inset 0 3px 6px rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.ball-0 { background: linear-gradient(135deg, #6b7290, #4a4f6a); }
.ball-1 { background: linear-gradient(135deg, #4f8ef5, #2563eb); }
.ball-2 { background: linear-gradient(135deg, #3ecf8e, #059669); }
.ball-3 { background: linear-gradient(135deg, #f05252, #dc2626); }
.ball-4 { background: linear-gradient(135deg, #f0b432, #c8901a); }
.ball-5 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.ball-6 { background: linear-gradient(135deg, #fb923c, #ea580c); }
.ball-7 { background: linear-gradient(135deg, #34d399, #065f46); }
.ball-8 { background: linear-gradient(135deg, #f472b6, #be185d); }
.ball-9 { background: linear-gradient(135deg, #38bdf8, #0369a1); }

.ball-op {
  font-size: 22px;
  font-weight: 700;
  color: var(--text3);
  width: auto;
  padding: 0 2px;
}

.ball-eq {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  padding: 0 4px;
}

.ball-result {
  font-size: 36px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 20px rgba(240,180,50,0.4);
}

.num-red {
  color: #ea3a2c;
}

.num-green {
  color: #7ec684;
}

.num-blue {
  color: #77aee6;
}


.result-number.num-red,
.result-number.num-green,
.result-number.num-blue,
.result-final-num.num-red,
.result-final-num.num-green,
.result-final-num.num-blue {
  background: none;
  -webkit-text-fill-color: currentColor;
}

.ball-result.num-red,
.result-number.num-red,
.result-final-num.num-red {
  text-shadow: 0 0 20px rgba(234,58,44,0.42);
}

.ball-result.num-green,
.result-number.num-green,
.result-final-num.num-green {
  text-shadow: 0 0 20px rgba(126,198,132,0.42);
}

.ball-result.num-blue,
.result-number.num-blue,
.result-final-num.num-blue {
  text-shadow: 0 0 20px rgba(119,174,230,0.42);
}


/* ===== 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--gold);
  border-radius: 2px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--bg3); color: var(--text); }

.modal-txid {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: monospace;
  font-size: 11px;
  color: var(--text2);
  word-break: break-all;
  margin-bottom: 16px;
  line-height: 1.6;
}

.modal-steps { display: flex; flex-direction: column; gap: 10px; }

.modal-step {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.modal-step-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.modal-step-value { font-family: monospace; font-size: 12px; color: var(--text); word-break: break-all; }

.modal-result {
  background: linear-gradient(135deg, rgba(240,180,50,0.1), rgba(200,144,26,0.05));
  border: 1px solid rgba(240,180,50,0.3);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ===== Tooltip ===== */
.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.icon-btn:hover { border-color: var(--gold); color: var(--gold); }

.result-badges { gap: 10px; }

.copy-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  transition: all 0.2s;
}

.copy-btn:hover { color: var(--gold); background: var(--bg4); }

/* ===== Notice bar ===== */
.notice {
  background: rgba(240,180,50,0.08);
  border: 1px solid rgba(240,180,50,0.2);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-icon { color: var(--gold); font-size: 14px; }
