:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #e2e8f0;
  --ink: #1e293b;
  --muted: #64748b;
  --primary: #3b82f6;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

.container {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  margin: 0 auto;
  background: var(--panel);
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.fixed-header {
  flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 0 16px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 12px;
}

h1 {
  font-size: 1.3rem;
  color: var(--ink);
}

.title-sub {
  color: var(--muted);
  font-size: 0.78rem;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.76rem;
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-input {
  width: 118px;
  padding: 5px 6px;
  font-size: 0.72rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

.action-btn,
.refresh-btn,
#soundToggle {
  padding: 5px 12px;
  font-size: 0.72rem;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  color: #fff;
}

.query-btn {
  background: var(--primary);
}

.reset-btn {
  background: #6b7280;
}

.refresh-btn {
  background: var(--success);
  padding: 4px 10px;
  border-radius: 16px;
}

#soundToggle {
  background: #6b7280;
  padding: 4px 10px;
  border-radius: 16px;
}

#soundToggle.sound-off {
  background: var(--danger);
}

.scrollable-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 0 16px 16px 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  table-layout: auto;
}

th,
td {
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}

th {
  background: #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 10;
}

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 30px;
  font-size: 0.65rem;
}

.badge-win {
  background: #dcfce7;
  color: #15803d;
}

.badge-lose {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-driving {
  background: #fff3cd;
  color: #856404;
}

.profit-positive {
  color: #10b981;
}

.profit-negative {
  color: #ef4444;
}

@media (max-width: 720px) {
  th,
  td {
    font-size: 0.7rem;
    padding: 6px 2px;
  }

  th {
    white-space: normal;
    line-height: 1.2;
  }
}
