* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  font-family: 'Segoe UI', 'PingFang SC', Roboto, system-ui, sans-serif;
  background: #eef1f5;
  -webkit-tap-highlight-color: transparent;
}
body {
  padding: 8px 10px;
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  min-height: 100vh;
}
.container {
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 16px;
  padding: 14px 18px 20px;
  padding-bottom: calc(20px + 80px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.container::-webkit-scrollbar {
  display: none;
}
.container.nav-visible {
  padding-bottom: calc(20px + 80px + env(safe-area-inset-bottom, 0px));
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  gap: 4px 8px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-left h1 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}
.header-left .icon {
  font-size: clamp(24px, 3.5vw, 32px);
  -webkit-text-fill-color: initial;
}
.header-right {
  font-size: clamp(12px, 1.5vw, 15px);
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 16px;
  border-radius: 30px;
  font-weight: 500;
  white-space: nowrap;
}
.header-right span {
  color: #1a2a6c;
  font-weight: 700;
}
.market-label {
  font-weight: 600;
  color: #1a2a6c;
  margin-left: 8px;
  background: #eef2ff;
  padding: 0 12px;
  border-radius: 12px;
  line-height: 1.8;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(14px, 1.5vw, 18px);
}
.market-label:hover {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px #bfdbfe;
}
.market-label:active {
  transform: scale(0.94);
}
.header-action-btn {
  font-weight: 600;
  color: #1a2a6c;
  margin-left: 8px;
  background: #eef2ff;
  padding: 0 12px;
  border-radius: 12px;
  line-height: 1.8;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(11px, 1.2vw, 15px);
}
.header-action-btn:hover {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px #bfdbfe;
}
.header-action-btn:active {
  transform: scale(0.94);
}
.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 12px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 10px;
  font-size: clamp(13px, 1.2vw, 15px);
  color: #78350f;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
  flex-shrink: 0;
  position: relative;
}
.notice-bar.hidden {
  display: none;
}
.notice-icon {
  font-size: clamp(14px, 1.4vw, 18px);
  flex-shrink: 0;
}
.notice-content {
  flex: 1;
  min-width: 0;
}
.notice-text {
  display: block;
  font-weight: 500;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}
.notice-close {
  background: transparent;
  border: none;
  color: #92400e;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  font-weight: 700;
  margin-top: 1px;
}
.notice-close:hover {
  background: rgba(146, 64, 14, 0.12);
  color: #78350f;
}
.qq-link,
.copy-qq {
  display: inline-block;
  background: #f59e0b;
  color: #fff !important;
  padding: 1px 8px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  margin: 0 2px;
  font-size: 0.95em;
  border: 1px solid #d97706;
  white-space: nowrap;
  text-decoration: none;
}
.qq-link:hover,
.copy-qq:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
  color: #fff !important;
}
.qq-link:active,
.copy-qq:active {
  transform: scale(0.96);
}
.copy-qq.copied {
  background: #22c55e;
  border-color: #16a34a;
}
.copy-qq.copied::after {
  content: ' ✓';
  font-weight: 700;
}
.main-body {
  display: flex;
  flex: 1;
  gap: 14px;
  overflow: visible;
  min-height: 0;
}
.left-panel {
  flex: 0 0 36%;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow-y: visible;
  padding-right: 4px;
}
.left-panel::-webkit-scrollbar {
  width: 3px;
}
.left-panel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-height: 0;
}
.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 16px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.card-header .title {
  font-size: clamp(14px, 1.4vw, 16px);
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bet-card {
  flex-shrink: 0;
  margin-bottom: 10px;
}
.bet-card:last-child {
  margin-bottom: 0;
}
.bet-card .bet-section {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e9edf5;
}
.bet-card .bet-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.bet-section .section-label {
  font-size: clamp(13px, 1.3vw, 15px);
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bet-section .section-label .badge {
  font-size: 11px;
  background: #f1f5f9;
  padding: 0 10px;
  border-radius: 30px;
  color: #64748b;
  font-weight: 500;
}
.bet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 4px;
}
.bet-row label {
  font-size: clamp(13px, 1.2vw, 14px);
  font-weight: 500;
  color: #475569;
  min-width: 44px;
}
.bet-row input[type="text"],
.bet-row input[type="number"],
.bet-row select {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  font-size: clamp(13px, 1.2vw, 15px);
  font-family: inherit;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  flex: 1;
  min-width: 50px;
}
.bet-row input[type="text"]:focus,
.bet-row input[type="number"]:focus,
.bet-row select:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
  background: #fff;
}
.bet-row input[type="number"] {
  max-width: 70px;
  flex: 0 0 auto;
  -moz-appearance: textfield;
}
.bet-row input[type="number"]::-webkit-inner-spin-button,
.bet-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.bet-row select {
  max-width: 120px;
  flex: 0 0 auto;
  cursor: pointer;
}
.bet-editor,
.zodiac-bet-editor {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  overflow: auto;
  resize: vertical;
  font-size: clamp(13px, 1.2vw, 15px);
  font-family: inherit;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  flex: 1 1 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  color: #1e293b;
}
.bet-editor:focus,
.zodiac-bet-editor:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
  background: #fff;
}
.bet-editor:empty::before,
.zodiac-bet-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
.bet-editor .line-block,
.zodiac-bet-editor .line-block {
  display: block;
  min-height: 1.6em;
}
.bet-editor .line-block.error-line,
.zodiac-bet-editor .line-block.error-line {
  background: #fee2e2 !important;
  border-left: 4px solid #dc2626;
  padding-left: 8px;
  margin: 2px 0;
  color: #b91c1c;
}
.bet-editor {
  height: 140px;
  min-height: 140px;
  max-height: 400px;
}
.zodiac-bet-editor {
  height: 100px;
  min-height: 100px;
  max-height: 300px;
}
.btn-bet {
  padding: 6px 18px;
  border: none;
  border-radius: 20px;
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #fff;
  flex-shrink: 0;
}
.btn-bet:active {
  transform: scale(0.95);
}
.btn-bet:hover {
  transform: translateY(-1px);
}
.btn-bet.btn-bet-purple {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.25);
}
.btn-bet.btn-bet-purple:hover {
  box-shadow: 0 5px 18px rgba(139, 92, 246, 0.35);
}
.btn-bet.btn-bet-throw {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25);
}
.btn-bet.btn-bet-throw:hover {
  box-shadow: 0 5px 18px rgba(220, 38, 38, 0.35);
}
.btn-bet.btn-bet-gold {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.25);
}
.btn-bet.btn-bet-gold:hover {
  box-shadow: 0 5px 18px rgba(245, 158, 11, 0.35);
}
.btn-bet.btn-bet-cyan {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  box-shadow: 0 3px 10px rgba(6, 182, 212, 0.25);
}
.btn-bet.btn-bet-cyan:hover {
  box-shadow: 0 5px 18px rgba(6, 182, 212, 0.35);
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #e9edf5;
}
.action-row .btn {
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  flex-shrink: 0;
}
.action-row .btn:active {
  transform: scale(0.95);
}
.action-row .btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 5px 20px rgba(59, 130, 246, 0.35);
}
.btn-outline {
  background: transparent;
  color: #475569;
  border: 2px solid #e2e8f0;
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  box-shadow: 0 5px 20px rgba(239, 68, 68, 0.3);
}
.history-area {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e9edf5;
  flex-shrink: 0;
}
.history-area .history-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 3px;
}
.history-area .history-list {
  max-height: 60px;
  overflow-y: auto;
  font-size: 12px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.history-area .history-list .h-item {
  padding: 2px 8px;
  background: #f8fafc;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.history-area .history-list .h-item .h-amount {
  color: #1e40af;
  font-weight: 600;
}
.history-area .empty-hint {
  color: #cbd5e1;
  font-style: italic;
  font-size: 12px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 0 2px;
  border-top: 2px solid #e2e8f0;
  margin-top: 6px;
  font-weight: 600;
  font-size: clamp(14px, 1.4vw, 16px);
  color: #0f172a;
  flex-shrink: 0;
}
.total-row .total-amount {
  color: #1e40af;
}
.total-row .copy-total-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 500;
  padding: 2px 10px;
  color: #475569;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  line-height: 1.6;
  min-height: 26px;
}
.total-row .copy-total-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.total-row .copy-total-btn:active {
  transform: scale(0.95);
}
.right-panel .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: auto;
  padding: 8px 8px 10px;
  overflow: visible;
}
.right-panel .card .card-header {
  flex-shrink: 0;
  margin-bottom: 4px;
}
.right-panel .card .card-header .title {
  font-size: clamp(12px, 1.3vw, 14px);
}
.control-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  background: #f1f5f9;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  margin-bottom: 6px;
}
.control-bar .sort-area {
  display: flex;
  align-items: center;
  gap: 8px;
}
.control-bar .sort-area button {
  padding: 6px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #475569;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.control-bar .sort-area button:hover {
  background: #e2e8f0;
}
.control-bar .sort-area button.active {
  background: #1e40af;
  color: #fff;
  border-color: #1e40af;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
}
.control-bar .draw-label {
  font-size: 14px;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 2px;
}
.control-bar .draw-input {
  width: 42px;
  padding: 4px 2px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  background: #ffffff;
  -moz-appearance: textfield;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s;
}
.control-bar .draw-input:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.control-bar .draw-input::-webkit-inner-spin-button,
.control-bar .draw-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.control-bar .draw-input.draw-special {
  border-color: #ea580c;
  background: #fff7ed;
}
.control-bar .draw-btn {
  padding: 6px 18px;
  border: none;
  border-radius: 20px;
  background: #3b82f6;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}
.control-bar .draw-btn:hover {
  background: #2563eb;
}
.control-bar .draw-btn.clear-draw-btn {
  background: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}
.control-bar .draw-btn.clear-draw-btn:hover {
  background: #dc2626;
}
.control-row {
  display: flex;
  align-items: center;
  gap: 6px 10px;
}
.control-row.control-buttons {
  justify-content: flex-start;
}
.control-row.draw-inputs-row {
  gap: 4px 6px;
}
.draw-inputs-row .input-zodiac-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  background: #f8fafc;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 0 4px 0 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.draw-inputs-row .input-zodiac-group:focus-within {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
  background: #fff;
}
.draw-inputs-row .input-zodiac-group .draw-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 5px 2px 5px 0;
  max-width: 38px;
  flex: 0 0 auto;
  outline: none;
  min-width: 26px;
}
.draw-inputs-row .input-zodiac-group .draw-input.draw-special {
  border: none !important;
}
.draw-inputs-row .input-zodiac-group .draw-zodiac {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  padding: 2px 2px 2px 0;
  transition: color 0.2s;
  user-select: none;
  pointer-events: none;
}
.draw-inputs-row .input-zodiac-group .draw-zodiac.has-value {
  color: #1e293b;
  font-weight: 700;
}
.draw-inputs-row .input-zodiac-group .draw-zodiac.special-zodiac.has-value {
  color: #ea580c;
}
.number-grid-wrapper {
  flex: none;
  overflow: visible;
  min-height: auto;
  max-height: none;
  margin: 0 -4px;
  padding: 0 4px;
  scroll-behavior: smooth;
}
.number-grid-wrapper::-webkit-scrollbar {
  display: none;
}
.number-grid-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: clamp(11px, 1.1vw, 13px);
}
.number-grid-table td {
  border: 1px solid #e9edf5;
  padding: 4px 2px;
  text-align: center;
  vertical-align: middle;
  width: 14.28%;
  position: relative;
  background: #fafbfc;
  transition: background 0.15s, transform 0.15s;
  cursor: pointer;
}
.number-grid-table td:hover {
  background: #eef2ff;
  transform: scale(1.02);
  z-index: 2;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.number-grid-table td.special-highlight {
  background: #fef3c7;
  border-color: #f59e0b;
  box-shadow: inset 0 0 0 2px #f59e0b;
}
.number-grid-table td.has-throw {
  background: #fee2e2;
  border-color: #fca5a5;
}
.number-grid-table td.has-throw.special-highlight {
  background: #fef3c7;
  border-color: #f59e0b;
  box-shadow: inset 0 0 0 2px #f59e0b;
}
.number-grid-table .num-cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 0;
}
.num-ball {
  width: 100%;
  height: clamp(30px, 3.8vw, 44px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  margin: 0 auto;
  pointer-events: none;
  user-select: none;
  padding: 0;
  gap: 2px;
}
.num-ball .num {
  font-size: clamp(14px, 1.8vw, 20px);
  line-height: 1;
  font-weight: 700;
}
.num-ball .divider {
  font-size: clamp(12px, 1.4vw, 16px);
  opacity: 0.6;
  line-height: 1;
}
.num-ball .zodiac {
  font-size: clamp(10px, 1.2vw, 14px);
  font-weight: 500;
  opacity: 0.9;
  line-height: 1;
}
.num-ball:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.num-ball.red-wave {
  background: linear-gradient(145deg, #ef4444, #b91c1c);
}
.num-ball.blue-wave {
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}
.num-ball.green-wave {
  background: linear-gradient(145deg, #22c55e, #15803d);
}
.num-ball.special-ball {
  box-shadow: 0 0 0 3px #fbbf24, 0 0 0 6px rgba(251, 191, 36, 0.3);
}
.num-ball.throw-ball {
  box-shadow: 0 0 0 3px #ef4444, 0 0 0 6px rgba(239, 68, 68, 0.25);
}
.num-cell-content .info-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  font-size: clamp(9px, 0.9vw, 11px);
  margin-top: 1px;
  pointer-events: none;
  user-select: none;
}
.num-cell-content .bet-amount {
  font-weight: 600;
  color: #1e40af;
  background: #dbeafe;
  padding: 0 6px;
  border-radius: 10px;
  font-size: clamp(9px, 1vw, 12px);
}
.num-cell-content .bet-amount.throw-amount {
  background: #fee2e2;
  color: #dc2626;
}
.num-cell-content .profit {
  font-weight: 700;
  font-size: clamp(10px, 1.1vw, 14px);
}
.num-cell-content .profit.positive {
  color: #16a34a;
}
.num-cell-content .profit.negative {
  color: #dc2626;
}
.num-cell-content .profit.zero {
  color: #94a3b8;
}
.num-cell-content .throw-badge {
  font-size: 8px;
  background: #fecaca;
  color: #b91c1c;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}
.grid-footer {
  font-size: clamp(9px, 0.9vw, 11px);
  color: #94a3b8;
  text-align: center;
  padding-top: 3px;
  border-top: 1px solid #e9edf5;
  margin-top: 2px;
  flex-shrink: 0;
  line-height: 1.4;
}
.grid-footer span {
  color: #1e40af;
  font-weight: 600;
}
.grid-footer .click-hint {
  color: #ea580c;
  font-weight: 600;
  background: #fff7ed;
  padding: 0 10px;
  border-radius: 12px;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.modal-overlay.active {
  display: flex;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 28px 28px;
  max-width: 620px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  position: relative;
}
.modal-content.settings-modal {
  max-width: 720px;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
  background: none;
  border: none;
  line-height: 1;
}
.modal-close:hover {
  color: #475569;
}
.settings-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e9edf5;
  margin-bottom: 16px;
  padding-bottom: 0;
  flex-wrap: wrap;
}
.settings-tabs .tab-btn {
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}
.settings-tabs .tab-btn.active {
  color: #1e40af;
  border-bottom-color: #1e40af;
}
.settings-tabs .tab-btn:hover {
  color: #475569;
}
.settings-tab-content {
  display: none;
}
.settings-tab-content.active {
  display: block;
}
.settings-tab-content .keyword-settings {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.settings-tab-content .keyword-settings:not(:last-child) {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed #e9edf5;
}
.settings-tab-content .kw-label {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.settings-tab-content .kw-label span {
  font-weight: 400;
  color: #94a3b8;
}
.settings-tab-content .kw-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.settings-tab-content .kw-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 2px 8px 2px 12px;
  border-radius: 14px;
  font-size: 14px;
  color: #1e293b;
  border: 1px solid #e2e8f0;
}
.settings-tab-content .kw-tag .kw-type {
  font-size: 9px;
  padding: 0 6px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
}
.settings-tab-content .kw-tag .kw-type.prefix {
  background: #3b82f6;
}
.settings-tab-content .kw-tag .kw-type.suffix {
  background: #22c55e;
}
.settings-tab-content .kw-tag .kw-del {
  cursor: pointer;
  color: #94a3b8;
  font-weight: 700;
  padding: 0 2px;
  transition: color 0.2s;
}
.settings-tab-content .kw-tag .kw-del:hover {
  color: #dc2626;
}
.settings-tab-content .kw-add-row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.settings-tab-content .kw-add-row input[type="text"] {
  flex: 1;
  min-width: 60px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 12px;
  outline: none;
  background: #f8fafc;
}
.settings-tab-content .kw-add-row input[type="text"]:focus {
  border-color: #94a3b8;
}
.settings-tab-content .kw-add-row select {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 12px;
  outline: none;
  background: #f8fafc;
}
.settings-tab-content .kw-add-row button {
  padding: 4px 14px;
  border: none;
  border-radius: 14px;
  background: #3b82f6;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.settings-tab-content .kw-add-row button:hover {
  background: #2563eb;
}
.settings-tab-content .kw-add-row button.error-btn {
  background: #ef4444;
}
.settings-tab-content .kw-add-row button.error-btn:hover {
  background: #dc2626;
}
.settings-tab-content .error-kw .kw-label {
  color: #b91c1c;
}
.settings-tab-content .error-kw .kw-tag {
  border-color: #fca5a5;
  background: #fee2e2;
}
.settings-tab-content .error-kw .kw-add-row button {
  background: #ef4444;
}
.settings-tab-content .error-kw .kw-add-row button:hover {
  background: #dc2626;
}
.settings-tab-content .placeholder-text {
  color: #94a3b8;
  text-align: center;
  padding: 30px 0;
  font-size: 15px;
}
.odds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.odds-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #f8fafc;
  padding: 8px 12px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.odds-item label {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.odds-item label .sub-label {
  font-weight: 400;
  color: #94a3b8;
  font-size: 10px;
}
.odds-item input {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.odds-item input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.odds-item .odds-hint {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 1px;
}
.odds-group {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #f1f5f9;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.odds-group .odds-group-label {
  flex: 0 0 100%;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  padding: 0;
  margin: 0;
  text-align: center;
}
.odds-group .odds-item {
  flex: 1 1 120px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}
.odds-group .odds-group-keywords {
  flex: 0 0 100%;
}
.odds-group > div[style*="grid-column"] {
  flex: 0 0 100%;
}
.odds-group-label {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  padding: 2px 0 4px 0;
  grid-column: 1 / -1;
  text-align: center;
}
.odds-group-keywords {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.odds-group-keywords .kw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.odds-group-keywords .kw-head .kw-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.odds-group-keywords .kw-head .btype-reset {
  flex-shrink: 0;
  padding: 3px 10px;
  border: 1px solid #ef4444;
  border-radius: 12px;
  background: transparent;
  color: #ef4444;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.4;
}
.odds-group-keywords .kw-head .btype-reset:hover {
  background: #ef4444;
  color: #fff;
}
.odds-group-keywords .kw-head .btype-reset:active {
  transform: scale(0.95);
}
.odds-group-keywords > .kw-tip {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
}
.odds-group-keywords .kw-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
  align-items: center;
}
.odds-group-keywords .kw-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px 6px 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}
.odds-group-keywords .kw-tag:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.odds-group-keywords .kw-tag .kw-del {
  cursor: pointer;
  color: #94a3b8;
  font-weight: 700;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1;
  border-radius: 50%;
  transition: all 0.2s;
}
.odds-group-keywords .kw-tag .kw-del:hover {
  color: #dc2626;
  background: #fee2e2;
}
.odds-group-keywords .kw-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.odds-group-keywords .kw-add-row .btype-input {
  flex: 1;
  min-width: 0;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 12px;
  outline: none;
  background: #f8fafc;
  font-family: inherit;
  transition: all 0.2s;
}
.odds-group-keywords .kw-add-row .btype-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.odds-group-keywords .kw-add-row .btype-input::placeholder {
  color: #cbd5e1;
}
.odds-group-keywords .kw-add-row .btype-add {
  flex-shrink: 0;
  padding: 6px 18px;
  border: none;
  border-radius: 14px;
  background: #3b82f6;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.4;
}
.odds-group-keywords .kw-add-row .btype-add:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.odds-group-keywords .kw-add-row .btype-add:active {
  transform: scale(0.95);
}
.modal-content .result-title {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.modal-content .result-title .trophy {
  font-size: 24px;
}
.modal-content .result-sub {
  font-size: clamp(13px, 1.2vw, 15px);
  color: #475569;
  margin-bottom: 12px;
}
.modal-content .result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e9edf5;
  font-size: clamp(13px, 1.2vw, 15px);
}
.modal-content .result-summary .item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.modal-content .result-summary .item .label {
  color: #64748b;
  font-weight: 500;
}
.modal-content .result-summary .item .value {
  font-weight: 700;
  color: #0f172a;
}
.modal-content .result-summary .item .value.profit-positive {
  color: #16a34a;
}
.modal-content .result-summary .item .value.profit-negative {
  color: #dc2626;
}
.modal-content .result-summary .item .value.profit-zero {
  color: #94a3b8;
}
.modal-content .result-summary .item .value.throw-value {
  color: #dc2626;
}
.modal-content .result-summary .item .payout-formula {
  font-weight: 600;
  color: #0f172a;
  background: #f1f5f9;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 0.95em;
}
.modal-content .result-detail {
  margin-top: 10px;
  font-size: clamp(12px, 1.1vw, 14px);
  color: #475569;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.modal-content .result-detail .detail-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.modal-content .result-detail .detail-item .label {
  color: #64748b;
}
.modal-content .result-detail .detail-item .value {
  font-weight: 600;
}
.modal-content .result-detail .detail-item .value.positive {
  color: #16a34a;
}
.modal-content .result-detail .detail-item .value.negative {
  color: #dc2626;
}
.modal-content .result-detail .detail-item .value.neutral {
  color: #94a3b8;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.modal-actions .btn {
  padding: 6px 18px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-actions .btn.btn-primary {
  background: #3b82f6;
  color: #fff;
}
.modal-actions .btn.btn-primary:hover {
  background: #2563eb;
}
.modal-actions .btn.btn-outline {
  background: transparent;
  color: #475569;
  border: 2px solid #e2e8f0;
}
.modal-actions .btn.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.settle-section {
  margin-top: 12px;
}
.settle-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: #1e293b;
}
.settle-table-wrap {
  overflow-x: auto;
}
.settle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.settle-table th,
.settle-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 6px;
  text-align: center;
}
.settle-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
}
.settle-table td {
  color: #1e293b;
}
.settle-table tbody tr:hover {
  background: #f8fafc;
}
.throw-detail-body {
  font-size: 12px;
  line-height: 1.7;
  color: #334155;
}
.throw-detail-body b {
  color: #0f172a;
}
.throw-detail-body div + div {
  margin-top: 2px;
}
.doc-body {
  max-height: 58vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  font-size: 14px;
  line-height: 1.75;
  color: #334155;
}
.doc-body h3 {
  font-size: 14px;
  color: #1a2a6c;
  margin: 14px 0 6px;
  padding-left: 8px;
  border-left: 3px solid #1a2a6c;
}
.doc-body h3:first-child {
  margin-top: 0;
}
.doc-body p {
  margin: 6px 0;
}
.doc-body ul {
  margin: 6px 0;
  padding-left: 20px;
}
.doc-body li {
  margin: 3px 0;
}
.doc-body code {
  background: #eef2ff;
  color: #1e40af;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.doc-body .tip {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #92400e;
  margin-top: 10px;
}
.toast-container {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  max-width: 480px;
  width: 92%;
}
.toast-item {
  background: #0f172a;
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  font-size: clamp(13px, 1.2vw, 15px);
  line-height: 1.4;
  pointer-events: auto;
  animation: slideDown 0.35s ease;
  border-left: 4px solid #3b82f6;
  width: 100%;
  transition: opacity 0.3s, transform 0.3s;
}
.toast-item.success {
  border-left-color: #22c55e;
}
.toast-item.error {
  border-left-color: #ef4444;
}
.toast-item.warning {
  border-left-color: #f59e0b;
}
.toast-item.info {
  border-left-color: #3b82f6;
}
.toast-item .toast-title {
  font-weight: 600;
  font-size: clamp(13px, 1.2vw, 15px);
}
.toast-item .toast-desc {
  color: #cbd5e1;
  font-size: clamp(11px, 1.1vw, 13px);
}
.toast-item .toast-detail {
  font-size: clamp(10px, 1vw, 12px);
  color: #94a3b8;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2px;
  white-space: pre-wrap;
}
.toast-item.hiding {
  opacity: 0;
  transform: translateY(-30px);
}
@keyframes slideDown {
  0% {
    transform: translateY(-40px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 12px);
  z-index: 9998;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}
.bottom-nav.visible {
  transform: translateY(0);
}
.bottom-nav .nav-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: inherit;
  position: relative;
  min-width: 56px;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav .nav-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}
.bottom-nav .nav-btn.active {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
}
.bottom-nav .nav-btn .nav-icon {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1;
}
.bottom-nav .nav-btn .nav-label {
  font-size: clamp(9px, 1vw, 12px);
  letter-spacing: 0.3px;
}
.zodiac-grid-wrapper {
  margin-top: 12px;
  border-top: 2px solid #e2e8f0;
  padding-top: 10px;
}
.zodiac-grid-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: clamp(14px, 1.4vw, 16px);
}
.zodiac-grid-table td,
.zodiac-grid-table th {
  padding: 4px 6px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zodiac-grid-table th:nth-child(1),
.zodiac-grid-table td:nth-child(1),
.zodiac-grid-table th:nth-child(2),
.zodiac-grid-table td:nth-child(2),
.zodiac-grid-table th:nth-child(3),
.zodiac-grid-table td:nth-child(3),
.zodiac-grid-table th:nth-child(4),
.zodiac-grid-table td:nth-child(4) {
  width: 25%;
}
.zodiac-grid-table .cell-active {
  font-weight: 600;
  color: #1e40af;
}
.zodiac-grid-table .cell-empty {
  color: #94a3b8;
}
.zodiac-grid-table .zodiac-sum-row {
  background: #dbeafe;
  font-weight: 700;
}
.zodiac-grid-table .zodiac-sum-row .zodiac-sum-cell {
  text-align: center;
  white-space: nowrap;
  padding: 6px 8px;
}
.zodiac-grid-table .zodiac-sum-row .zodiac-sum-cell .sum-label {
  color: #475569;
  font-weight: 700;
  margin-right: 4px;
}
.zodiac-grid-table .zodiac-sum-row .zodiac-sum-cell .sum-value {
  color: #1e40af;
  font-weight: 800;
}
.zodiac-grid-table .zodiac-sum-row.zodiac-sum-total {
  background: #f1f5f9;
  border-top: 2px solid #1e40af;
}
.zodiac-grid-table .zodiac-sum-row.zodiac-sum-total .zodiac-sum-cell-total {
  text-align: center;
}
.zodiac-grid-table .zodiac-sum-row.zodiac-sum-total .zodiac-sum-cell-total .sum-label {
  color: #0f172a;
}
.zodiac-grid-table .zodiac-sum-row.zodiac-sum-total .zodiac-sum-cell-total .sum-value {
  color: #1e40af;
  font-weight: 800;
}
.zodiac-grid-table .zodiac-name {
  font-weight: 600;
}
.zodiac-grid-table .zodiac-amount {
  font-weight: 500;
  color: #1e40af;
}
.zodiac-grid-table .zodiac-row.plain-zodiac {
  background: #dbeafe;
}
.batch-stats {
  margin-top: 4px;
  font-size: clamp(12px, 1.1vw, 14px);
  padding: 4px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: none;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.batch-stats .stat-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.batch-stats .stat-item .label {
  color: #64748b;
}
.batch-stats .stat-item .value {
  font-weight: 600;
}
.batch-stats .stat-item .value.success {
  color: #16a34a;
}
.batch-stats .stat-item .value.error {
  color: #dc2626;
}
.batch-stats .stat-item .value.total {
  color: #1e40af;
}
.throw-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 2px;
}
.placeholder-span {
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.kw-label {
  font-size: clamp(13px, 1.3vw, 15px);
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
@media (max-width: 1024px) {
  .left-panel {
    flex: 0 0 38%;
  }
  .number-grid-table td {
    width: 16.66%;
  }
  .num-ball {
    height: clamp(26px, 3.2vw, 38px);
  }
  .num-ball .num {
    font-size: clamp(12px, 1.4vw, 17px);
  }
  .num-ball .divider {
    font-size: clamp(10px, 1.2vw, 14px);
  }
  .num-ball .zodiac {
    font-size: clamp(9px, 1vw, 12px);
  }
  .control-bar .draw-input {
    width: 36px;
    font-size: 13px;
  }
}
@media (max-width: 860px) {
  body {
    padding: 4px 6px;
  }
  .container {
    padding: 8px 8px 12px;
    border-radius: 10px;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: calc(12px + 70px + env(safe-area-inset-bottom, 0px));
  }
  .container::-webkit-scrollbar {
    display: none;
  }
  .main-body {
    flex-direction: column;
    gap: 8px;
    overflow: visible;
    flex: none;
  }
  .left-panel {
    flex: none;
    width: 100%;
    overflow: visible;
    max-height: none;
    padding-right: 0;
  }
  .right-panel {
    min-height: auto;
    flex: none;
    height: auto;
    overflow: visible;
  }
  .right-panel .card {
    min-height: auto;
    flex: none;
    height: auto;
    overflow: visible;
  }
  .number-grid-wrapper {
    max-height: none;
    min-height: auto;
    overflow: visible;
    flex: none;
  }
  .number-grid-table td {
    width: 20%;
    padding: 2px 1px;
  }
  .num-ball {
    height: clamp(22px, 2.8vw, 32px);
  }
  .num-ball .num {
    font-size: clamp(10px, 1.2vw, 14px);
  }
  .num-ball .divider {
    font-size: clamp(9px, 1vw, 12px);
  }
  .num-ball .zodiac {
    font-size: clamp(8px, 0.9vw, 10px);
  }
  .num-cell-content .bet-amount {
    font-size: 9px;
    padding: 0 4px;
  }
  .num-cell-content .profit {
    font-size: clamp(9px, 1vw, 12px);
  }
  .header-left h1 {
    font-size: 16px;
  }
  .header-right {
    font-size: 11px;
    padding: 1px 10px;
  }
  .market-label {
    font-size: 12px;
    padding: 0 8px;
    margin-left: 4px;
  }
  .header-action-btn {
    font-size: 11px;
    padding: 0 8px;
    margin-left: 4px;
  }
  .left-panel .bet-editor {
    height: 90px;
    min-height: 90px;
    max-height: 200px;
    font-size: 12px;
    padding: 6px 10px;
  }
  .left-panel .bet-row label {
    font-size: 12px;
    min-width: 32px;
  }
  .left-panel .bet-row input[type="text"],
  .left-panel .bet-row input[type="number"],
  .left-panel .bet-row select {
    font-size: 12px;
    padding: 4px 8px;
    min-width: 36px;
    border-radius: 14px;
  }
  .left-panel .bet-row input[type="number"] {
    max-width: 46px;
  }
  .left-panel .btn-bet {
    font-size: 12px;
    padding: 4px 14px;
  }
  .left-panel .action-row .btn {
    font-size: 11px;
    padding: 4px 10px;
  }
  .left-panel .section-label {
    font-size: 13px;
  }
  .left-panel .history-area .history-list .h-item {
    font-size: 11px;
    padding: 2px 6px;
  }
  .left-panel .history-area .history-label {
    font-size: 11px;
  }
  .left-panel .history-area .history-list {
    max-height: 50px;
  }
  .left-panel .total-row {
    font-size: 13px;
    padding: 4px 2px;
  }
  .left-panel .total-row .copy-total-btn {
    font-size: 11px;
    padding: 0 8px;
  }
  .left-panel .grid-footer {
    font-size: 8px;
  }
  .left-panel .zodiac-bet-editor {
    height: 60px;
    min-height: 60px;
    max-height: 140px;
    font-size: 12px;
    padding: 4px 8px;
  }
  .left-panel .btn-bet-gold,
  .left-panel .btn-bet-cyan {
    font-size: 12px;
    padding: 4px 12px;
  }
  .left-panel .throw-off-kw .bet-row input[type="number"] {
    max-width: 40px;
  }
  .left-panel .batch-stats {
    font-size: 11px;
    padding: 2px 8px;
  }
  .left-panel .throw-hint {
    font-size: 10px;
  }
  .left-panel .card {
    padding: 6px 8px 8px;
  }
  .left-panel .bet-card .bet-section {
    margin-bottom: 4px;
    padding-bottom: 4px;
  }
  .control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 6px 8px;
  }
  .control-row {
    gap: 4px 6px;
  }
  .control-row.control-buttons {
    justify-content: center;
  }
  .control-row.draw-inputs-row {
    justify-content: center;
    gap: 3px 4px;
  }
  .control-bar .sort-area button {
    font-size: 12px;
    padding: 3px 12px;
  }
  .control-bar .draw-btn {
    font-size: 11px;
    padding: 3px 10px;
  }
  .control-bar .draw-label {
    font-size: 11px;
  }
  .control-bar .draw-input {
    width: 30px;
    font-size: 11px;
    padding: 2px 2px;
  }
  .draw-inputs-row .input-zodiac-group {
    padding: 0 2px 0 6px;
    border-radius: 14px;
  }
  .draw-inputs-row .input-zodiac-group .draw-input {
    max-width: 28px;
    padding: 3px 2px 3px 0;
    font-size: 11px;
    min-width: 20px;
  }
  .draw-inputs-row .input-zodiac-group .draw-zodiac {
    font-size: 9px;
    min-width: 14px;
  }
  .right-panel .card-header .title {
    font-size: 12px;
  }
  .right-panel .card-header span {
    font-size: 11px;
  }
  .modal-content {
    max-width: 95%;
    padding: 16px;
  }
  .modal-content.settings-modal {
    max-width: 95%;
  }
  .settings-tabs .tab-btn {
    font-size: 13px;
    padding: 4px 12px;
  }
  .bottom-nav .nav-btn {
    padding: 4px 8px;
    min-width: 44px;
  }
  .bottom-nav .nav-btn .nav-label {
    font-size: 8px;
  }
  .bottom-nav .nav-btn .nav-icon {
    font-size: 16px;
  }
  .zodiac-grid-table td,
  .zodiac-grid-table th {
    padding: 2px 4px;
    font-size: 14px;
  }
  .odds-grid {
    grid-template-columns: 1fr 1fr;
  }
  .settle-table {
    font-size: 11px;
  }
  .settle-table th,
  .settle-table td {
    padding: 3px 4px;
  }
  .throw-detail-body {
    font-size: 11px;
  }
}
@media (max-width: 600px) {
  .container {
    padding: 6px 6px 10px;
    padding-bottom: calc(10px + 70px + env(safe-area-inset-bottom, 0px));
  }
  .right-panel {
    min-height: auto;
  }
  .right-panel .card {
    min-height: auto;
    padding: 6px 4px 8px;
  }
  .number-grid-wrapper {
    max-height: none;
    min-height: auto;
    overflow: visible;
    flex: none;
  }
  .number-grid-table td {
    width: 25%;
    padding: 1px 1px;
  }
  .num-ball {
    height: clamp(20px, 2.5vw, 28px);
  }
  .num-ball .num {
    font-size: clamp(10px, 1.2vw, 14px);
  }
  .num-ball .divider {
    font-size: clamp(9px, 1vw, 12px);
  }
  .num-ball .zodiac {
    font-size: clamp(8px, 0.9vw, 10px);
  }
  .num-cell-content .bet-amount {
    font-size: 9px;
    padding: 0 3px;
  }
  .num-cell-content .profit {
    font-size: clamp(9px, 1vw, 12px);
  }
  .header-left h1 {
    font-size: 14px;
  }
  .header-left .icon {
    font-size: 16px;
  }
  .header-right {
    font-size: 9px;
    padding: 1px 8px;
  }
  .market-label {
    font-size: 11px;
    padding: 0 8px;
    margin-left: 4px;
  }
  .header-action-btn {
    font-size: 10px;
    padding: 0 8px;
    margin-left: 4px;
  }
  .card {
    padding: 6px 8px 8px;
  }
  .bet-row {
    gap: 4px 8px;
  }
  .bet-row label {
    font-size: 12px;
    min-width: 30px;
  }
  .bet-row input[type="text"],
  .bet-row input[type="number"],
  .bet-row select {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 14px;
    min-width: 30px;
  }
  .bet-row input[type="number"] {
    max-width: 46px;
  }
  .bet-editor {
    height: 80px;
    min-height: 80px;
    max-height: 200px;
    font-size: 12px;
    padding: 6px 10px;
  }
  .btn-bet {
    font-size: 12px;
    padding: 4px 14px;
  }
  .action-row .btn {
    font-size: 11px;
    padding: 4px 10px;
  }
  .section-label {
    font-size: 13px;
  }
  .history-area .history-list .h-item {
    font-size: 11px;
    padding: 2px 8px;
  }
  .history-area .history-list {
    max-height: 60px;
  }
  .total-row {
    font-size: 13px;
    padding: 4px 2px;
  }
  .total-row .copy-total-btn {
    font-size: 11px;
    padding: 0 6px;
  }
  .grid-footer {
    font-size: 7px;
  }
  .zodiac-bet-editor {
    height: 55px;
    min-height: 55px;
    max-height: 140px;
    font-size: 12px;
    padding: 4px 8px;
  }
  .btn-bet-gold,
  .btn-bet-cyan {
    font-size: 12px;
    padding: 4px 10px;
  }
  .throw-off-kw .bet-row input[type="number"] {
    max-width: 38px;
  }
  .batch-stats {
    font-size: 11px;
    padding: 2px 6px;
  }
  .throw-hint {
    font-size: 9px;
  }
  .control-row {
    gap: 3px 4px;
  }
  .control-bar .sort-area button {
    font-size: 11px;
    padding: 2px 10px;
  }
  .control-bar .draw-btn {
    font-size: 11px;
    padding: 2px 10px;
  }
  .control-bar .draw-label {
    font-size: 10px;
  }
  .control-bar .draw-input {
    width: 28px;
    font-size: 10px;
    padding: 2px 2px;
  }
  .draw-inputs-row .input-zodiac-group {
    padding: 0 2px 0 4px;
    border-radius: 12px;
  }
  .draw-inputs-row .input-zodiac-group .draw-input {
    max-width: 22px;
    padding: 2px 2px 2px 0;
    font-size: 10px;
    min-width: 16px;
  }
  .draw-inputs-row .input-zodiac-group .draw-zodiac {
    font-size: 8px;
    min-width: 12px;
  }
  .modal-content {
    max-width: 98%;
    padding: 14px;
  }
  .modal-content.settings-modal {
    max-width: 98%;
  }
  .settings-tabs .tab-btn {
    font-size: 12px;
    padding: 4px 10px;
  }
  .settings-tab-content .kw-label {
    font-size: 12px;
  }
  .settings-tab-content .kw-tag {
    font-size: 14px;
    padding: 1px 6px;
  }
  .settings-tab-content .kw-add-row input[type="text"] {
    font-size: 12px;
    padding: 4px 8px;
    min-width: 40px;
  }
  .settings-tab-content .kw-add-row select {
    font-size: 12px;
    padding: 4px 6px;
  }
  .settings-tab-content .kw-add-row button {
    font-size: 12px;
    padding: 4px 10px;
  }
  .bottom-nav {
    padding: 6px 6px 10px;
  }
  .bottom-nav .nav-btn {
    padding: 4px 6px;
    min-width: 38px;
  }
  .bottom-nav .nav-btn .nav-label {
    font-size: 7px;
  }
  .bottom-nav .nav-btn .nav-icon {
    font-size: 14px;
  }
  .odds-grid {
    grid-template-columns: 1fr 1fr;
  }
  .zodiac-grid-table td,
  .zodiac-grid-table th {
    padding: 2px 3px;
    font-size: 12px;
  }
  .settle-table {
    font-size: 10px;
  }
  .settle-table th,
  .settle-table td {
    padding: 2px 3px;
  }
  .throw-detail-body {
    font-size: 10px;
  }
}
@media (max-width: 400px) {
  .number-grid-table td {
    width: 33.33%;
    padding: 1px 1px;
  }
  .num-ball {
    height: clamp(16px, 2.2vw, 22px);
  }
  .num-ball .num {
    font-size: clamp(9px, 1.2vw, 12px);
  }
  .num-ball .divider {
    font-size: clamp(8px, 1vw, 10px);
  }
  .num-ball .zodiac {
    font-size: clamp(7px, 0.9vw, 9px);
  }
  .num-cell-content .bet-amount {
    font-size: 8px;
    padding: 0 2px;
  }
  .num-cell-content .profit {
    font-size: clamp(8px, 1vw, 10px);
  }
  .right-panel {
    min-height: auto;
  }
  .right-panel .card {
    min-height: auto;
    padding: 4px 3px 6px;
  }
  .bet-row {
    gap: 3px 6px;
  }
  .bet-row label {
    font-size: 11px;
    min-width: 26px;
  }
  .bet-row input[type="text"],
  .bet-row input[type="number"],
  .bet-row select {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 10px;
    min-width: 26px;
  }
  .bet-row input[type="number"] {
    max-width: 36px;
  }
  .bet-editor {
    height: 60px;
    min-height: 60px;
    max-height: 140px;
    font-size: 11px;
    padding: 4px 8px;
  }
  .btn-bet {
    font-size: 11px;
    padding: 3px 12px;
  }
  .action-row .btn {
    font-size: 10px;
    padding: 3px 8px;
  }
  .section-label {
    font-size: 12px;
  }
  .history-area .history-list .h-item {
    font-size: 10px;
    padding: 2px 6px;
  }
  .history-area .history-list {
    max-height: 40px;
  }
  .total-row {
    font-size: 12px;
    padding: 3px 2px;
  }
  .total-row .copy-total-btn {
    font-size: 10px;
    padding: 0 5px;
  }
  .grid-footer {
    font-size: 7px;
  }
  .zodiac-bet-editor {
    height: 45px;
    min-height: 45px;
    max-height: 100px;
    font-size: 11px;
    padding: 3px 6px;
  }
  .btn-bet-gold,
  .btn-bet-cyan {
    font-size: 11px;
    padding: 3px 8px;
  }
  .throw-off-kw .bet-row input[type="number"] {
    max-width: 32px;
  }
  .batch-stats {
    font-size: 10px;
    padding: 1px 4px;
  }
  .throw-hint {
    font-size: 8px;
  }
  .header-left h1 {
    font-size: 13px;
  }
  .header-left .icon {
    font-size: 14px;
  }
  .header-right {
    font-size: 9px;
    padding: 0 6px;
  }
  .market-label {
    font-size: 10px;
    padding: 0 6px;
    margin-left: 3px;
  }
  .header-action-btn {
    font-size: 10px;
    padding: 0 6px;
    margin-left: 3px;
  }
  .control-bar .draw-input {
    width: 24px;
    font-size: 9px;
    padding: 1px 2px;
  }
  .control-bar .draw-label {
    font-size: 9px;
  }
  .control-bar .sort-area button {
    font-size: 10px;
    padding: 2px 8px;
  }
  .control-bar .draw-btn {
    font-size: 10px;
    padding: 2px 8px;
  }
  .right-panel .card-header .title {
    font-size: 10px;
  }
  .right-panel .card-header span {
    font-size: 9px;
  }
  .modal-content {
    max-width: 98%;
    padding: 10px;
  }
  .settings-tabs .tab-btn {
    font-size: 11px;
    padding: 3px 8px;
  }
  .settings-tab-content .kw-label {
    font-size: 11px;
  }
  .settings-tab-content .kw-tag {
    font-size: 14px;
    padding: 1px 4px;
  }
  .settings-tab-content .kw-add-row input[type="text"] {
    font-size: 11px;
    padding: 3px 6px;
    min-width: 30px;
  }
  .settings-tab-content .kw-add-row select {
    font-size: 11px;
    padding: 3px 4px;
  }
  .settings-tab-content .kw-add-row button {
    font-size: 11px;
    padding: 3px 8px;
  }
  .bottom-nav {
    padding: 4px 4px 8px;
  }
  .bottom-nav .nav-btn {
    padding: 3px 4px;
    min-width: 32px;
  }
  .bottom-nav .nav-btn .nav-label {
    font-size: 7px;
  }
  .bottom-nav .nav-btn .nav-icon {
    font-size: 12px;
  }
  .odds-grid {
    grid-template-columns: 1fr;
  }
  .zodiac-grid-table td,
  .zodiac-grid-table th {
    padding: 1px 2px;
    font-size: 12px;
  }
  #throwOffNumber,
  #throwOffAmount {
    max-width: 70px;
  }
  .settle-section {
    margin-top: 8px;
  }
  .settle-title {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .settle-table {
    font-size: 9px;
  }
  .settle-table th,
  .settle-table td {
    padding: 1px 2px;
  }
  .throw-detail-body {
    font-size: 9px;
    line-height: 1.5;
  }
  .throw-detail-body div + div {
    margin-top: 1px;
  }
}
