/* 全局 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background: #000;
  overflow: hidden;
}

body {
  font-family: 'Courier New', Courier, monospace;
  color: #00ff00;
  line-height: 1.5;
}

#matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.15;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

/* 终端头部 */
.terminal-header {
  background: #1a1a1a;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #333;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  font-size: 12px;
  color: #888;
}

/* 步骤通用 */
.step {
  flex: 1;
  display: none;
}

.step.active {
  display: flex;
  flex-direction: column;
}

.content, .scan-content, .report-content {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
}

/* ASCII Logo */
.ascii-logo {
  text-align: center;
  margin-bottom: 8px;
}

.logo-text {
  font-size: 8px;
  line-height: 1.2;
  color: #00ff00;
  letter-spacing: 1px;
}

.subtitle {
  text-align: center;
  font-size: 14px;
  color: #00ff00;
  margin-bottom: 24px;
  letter-spacing: 2px;
}

.blink {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 输入区域 */
.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 12px;
  color: #00ff00;
  margin-bottom: 10px;
}

.url-input-wrap {
  display: flex;
  align-items: center;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px 16px;
}

.protocol {
  color: #666;
  font-size: 14px;
  margin-right: 4px;
}

.url-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.url-input-wrap input::placeholder {
  color: #444;
}

/* 扫描按钮 */
.btn-scan {
  width: 100%;
  padding: 16px;
  background: transparent;
  border: 2px solid #00ff00;
  border-radius: 8px;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 2px;
}

.btn-scan:disabled {
  border-color: #333;
  color: #555;
}

.btn-scan:not(:disabled):active {
  background: #00ff00;
  color: #000;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: #00ff00;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* 扫描页面 */
.scan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.target-url {
  font-size: 12px;
  color: #888;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-percent {
  font-size: 24px;
  font-weight: bold;
  color: #00ff00;
}

.progress-wrap {
  margin-bottom: 20px;
}

.progress-bar {
  height: 8px;
  background: #111;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff00, #ff0000);
  width: 0;
  transition: width 0.3s;
  border-radius: 4px;
}

.scan-log {
  background: #0a0a0a;
  border-radius: 8px;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 12px;
  border: 1px solid #222;
}

.log-line {
  margin-bottom: 4px;
  color: #666;
}

.log-line.success { color: #00ff00; }
.log-line.warning { color: #ff0000; }
.log-line.info { color: #ffd700; }

/* 报告页面 */
.report-header {
  margin-bottom: 16px;
}

.report-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.report-status.warning {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid #ff0000;
  color: #ff0000;
}

.report-status.success {
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid #00ff00;
  color: #00ff00;
}

.status-icon {
  font-size: 18px;
}

.report-stats {
  background: #111;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #222;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.stat-label {
  font-size: 12px;
  color: #888;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
}

.stat-value.critical { color: #ff0000; }
.stat-value.success { color: #00ff00; }

.report-title {
  font-size: 14px;
  color: #00ff00;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

/* 预测网格 */
.prediction-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.pred-card {
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid;
}

.pred-card.banker {
  background: rgba(255, 0, 0, 0.1);
  border-left-color: #ff0000;
}

.pred-card.player {
  background: rgba(0, 0, 255, 0.1);
  border-left-color: #0000ff;
}

.pred-card.tie {
  background: rgba(255, 170, 0, 0.1);
  border-left-color: #ffaa00;
}

.pred-card.locked {
  background: rgba(100, 100, 100, 0.2);
  border-left-color: #666;
}

.pred-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pred-round {
  font-size: 12px;
  color: #888;
}

.pred-result {
  font-size: 20px;
  font-weight: 800;
}

.pred-result.banker { color: #ff0000; }
.pred-result.player { color: #0000ff; }
.pred-result.tie { color: #ffaa00; }

.pred-amount {
  font-size: 14px;
  color: #ffd700;
  margin-bottom: 6px;
}

.pred-rate {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pred-rate-label {
  font-size: 11px;
  color: #666;
}

.pred-rate-bar {
  flex: 1;
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
}

.pred-rate-fill {
  height: 100%;
  background: #00ff00;
}

.pred-rate-text {
  font-size: 12px;
  color: #00ff00;
  min-width: 40px;
  text-align: right;
}

/* 锁定状态 */
.locked-notice {
  text-align: center;
  padding: 16px;
  background: rgba(255, 0, 0, 0.05);
  border: 1px dashed #ff0000;
  border-radius: 8px;
}

.lock-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.lock-text {
  font-size: 14px;
  color: #ff0000;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

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

.modal-card {
  background: #111;
  border: 1px solid #ff0000;
  border-radius: 12px;
  padding: 24px;
  max-width: 320px;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-icon {
  font-size: 32px;
}

.modal-title {
  font-size: 18px;
  color: #ff0000;
  font-weight: 600;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-body p {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 8px;
  line-height: 1.6;
}

.hl-red { color: #ff0000; font-weight: 600; }
.hl-green { color: #00ff00; font-weight: 600; }

.btn-copy-bat {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #ff0000, #cc0000);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-copy-bat:active {
  transform: scale(0.98);
}

/* 联系区域 */
.contact-section {
  background: #111;
  border: 1px solid #ffd700;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.contact-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
}

.contact-id {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.bat-icon {
  font-size: 24px;
}

.bat-number {
  font-size: 24px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 2px;
}

.btn-copy-final {
  width: 100%;
  padding: 14px;
  background: #ffd700;
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-copy-final:active {
  transform: scale(0.98);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #00ff00;
  color: #000;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
