﻿:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #152033;
  --muted: #64748b;
  --line: #dbe3ef;
  --accent: #0f766e;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0 0 10px;
}

p {
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

#login {
  max-width: 380px;
  margin: 12vh auto;
}

form,
.config-grid {
  display: grid;
  gap: 12px;
}

.config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
button {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 10px;
  font-size: 14px;
}

button {
  background: var(--accent);
  color: white;
  border: 0;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.metrics strong {
  font-size: 18px;
}

.danger-zone {
  border-color: #fecaca;
}

.danger-zone button {
  background: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
}

td,
th {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.logs {
  min-height: 1500px;
  overflow: visible;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.log-line {
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}

.log-fill-buy {
  color: #15803d;
}

.log-fill-sell {
  color: #b91c1c;
}

.log-fill-buy .log-time,
.log-fill-sell .log-time {
  color: inherit;
  opacity: 0.75;
}
.error {
  color: var(--danger);
}

.runtime-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: var(--danger);
  margin: 0 0 16px;
  padding: 10px 12px;
}

@media (max-width: 820px) {
  .grid,
  .metrics,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}

.testnet-btn {
  background: #2563eb;
}

.diagnostics {
  background: #0f172a;
  border-radius: 6px;
  color: #e2e8f0;
  font-family: Consolas, monospace;
  margin: 0 0 16px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.activity-stack {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.log-time {
  color: var(--muted);
  display: inline-block;
  min-width: 150px;
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

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

.pager button {
  min-height: 32px;
  padding: 0 10px;
}

.pager span {
  color: var(--muted);
  font-size: 13px;
}

.mode-summary {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin: 4px 0 12px;
  padding: 10px 12px;
}

.mode-summary span {
  color: var(--muted);
  font-size: 13px;
}

.mode-summary strong {
  font-size: 20px;
}

.mode-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.mode-actions button {
  width: 100%;
}

.mode-tools {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

.mode-tools button {
  width: 100%;
}

#resetDailyStatsBtn {
  background: #475569;
}

#disableLiveBtn {
  background: #475569;
}

@media (max-width: 520px) {
  .mode-actions {
    grid-template-columns: 1fr;
  }
}


