/* 套利计算器 — 与锐榜主站一致的卡片式仪表盘风格 */

.arb-app {
  min-height: 100vh;
  background: linear-gradient(165deg, #f5f3ff 0%, var(--bg) 38%, #eef2ff 100%);
}

[data-theme="stake"] .arb-app {
  background: linear-gradient(165deg, #0a1620 0%, var(--bg) 45%, #121f2a 100%);
}

.arb-topbar {
  grid-template-columns: auto 1fr auto;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.arb-topbar-spacer {
  min-width: 0;
}

.arb-shell {
  flex: 1;
  padding: clamp(1rem, 3vw, 2rem) var(--page-pad) 3rem;
}

.arb-page {
  max-width: 880px;
  margin: 0 auto;
}

.arb-step-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
}

.arb-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  flex-shrink: 0;
}

.arb-scenario {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.arb-scenario-btn {
  text-align: left;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  box-shadow: var(--shadow-sm);
}

.arb-scenario-btn:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  color: var(--text);
}

.arb-scenario-btn.active {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent);
}

.arb-sc-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.arb-sc-desc {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-3);
  font-weight: 500;
}

.arb-scenario-panel {
  margin-top: 0.25rem;
}

.arb-advanced {
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.arb-advanced summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
}

.arb-advanced summary::-webkit-details-marker {
  display: none;
}

.arb-advanced summary::before {
  content: "▸ ";
  color: var(--brand);
}

.arb-advanced[open] summary::before {
  content: "▾ ";
}

@media (max-width: 720px) {
  .arb-scenario {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}

.arb-hero {
  margin-bottom: 1.35rem;
}

.arb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
}

.arb-back:hover {
  color: var(--brand-2);
  text-decoration: none;
}

.arb-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.arb-lead {
  margin: 0;
  max-width: 42rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-2);
}

.arb-lead strong {
  color: var(--text);
  font-weight: 600;
}

/* 分段切换 */
.arb-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--surface) 70%, var(--line));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.arb-tabs button {
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.arb-tabs button:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.arb-tabs button.active {
  color: var(--brand);
  font-weight: 600;
  background: var(--surface);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

[data-theme="stake"] .arb-tabs button.active {
  background: var(--surface-2);
  box-shadow: none;
}

.arb-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 卡片 */
.arb-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}

.arb-card-form h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.arb-card-desc {
  margin: 0 0 1.1rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-2);
}

.arb-card-desc strong {
  color: var(--text);
}

.arb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.1rem;
}

.arb-field-wide {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  .arb-grid {
    grid-template-columns: 1fr;
  }
}

.arb-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-3);
}

.arb-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.arb-field input::placeholder {
  color: var(--text-3);
}

.arb-field input:hover {
  border-color: var(--line-2);
}

.arb-field input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

.arb-actions {
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.arb-btn-calc {
  min-width: 8.5rem;
  padding: 0.62rem 1.5rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}

.arb-btn-calc:hover {
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

/* 结果区 */
.arb-result {
  display: none;
  animation: arbFadeIn 0.28s ease;
}

.arb-result.visible {
  display: block;
}

@keyframes arbFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.arb-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.arb-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.arb-badge.yes {
  background: var(--up-bg);
  color: var(--up);
  border: 1px solid color-mix(in srgb, var(--up) 25%, transparent);
}

.arb-badge.no {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

[data-theme="stake"] .arb-badge.no {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}

.arb-result-context {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-2);
}

.arb-result-context strong {
  color: var(--text);
}

.arb-profit-hero {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--up-bg) 0%, color-mix(in srgb, var(--brand-bg) 60%, var(--up-bg)) 100%);
  border: 1px solid color-mix(in srgb, var(--up) 20%, var(--line));
}

.arb-profit-hero .label {
  font-size: 0.85rem;
  color: var(--text-2);
}

.arb-profit-hero .value {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  color: var(--up);
  letter-spacing: -0.02em;
}

.arb-stat-list {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.arb-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.arb-stat-row:last-child {
  border-bottom: none;
}

.arb-stat-row span:first-child {
  color: var(--text-2);
}

.arb-stat-row strong {
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--text);
  text-align: right;
}

.arb-stat-row .pos {
  color: var(--up);
}

.arb-stat-row .neg {
  color: var(--down);
}

.arb-formula {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px dashed var(--line);
}

.arb-hint {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-2);
}

.arb-result .arb-hint.error {
  color: var(--down);
  margin: 0;
}

.arb-foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-3);
  text-align: center;
}

/* 已下注边选择 */
.arb-side-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-bottom: 1.1rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.arb-side-pick-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-right: 0.15rem;
}

.arb-side-pick button {
  padding: 0.42rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.arb-side-pick button:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  color: var(--text);
}

.arb-side-pick button.active {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  color: var(--brand);
  font-weight: 600;
}

/* 场景说明 */
.arb-callout {
  margin-bottom: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-2);
  background: color-mix(in srgb, var(--brand-bg) 55%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
}

.arb-callout strong {
  color: var(--text);
}
