:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #d9e1ee;
  --text: #172033;
  --muted: #667085;
  --faint: #8a95a7;
  --accent: #3b6ff5;
  --accent-2: #07966a;
  --warn: #b7791f;
  --danger: #d92d20;
  --shadow: 0 16px 36px rgba(31, 44, 71, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

[v-cloak] {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  min-height: 136px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
}

.subtitle {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 20px;
  padding: 22px;
}

.content {
  min-height: 620px;
  padding: 24px;
}

.sidebar h2,
.result-head h2 {
  margin-bottom: 18px;
  font-size: 20px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 13px;
  outline: none;
  overflow-x: auto;
  text-overflow: clip;
}

input:focus,
select:focus {
  border-color: rgba(59, 111, 245, 0.72);
  box-shadow: 0 0 0 3px rgba(59, 111, 245, 0.14);
}

.inline-input {
  min-height: 38px;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.danger-button {
  border: 1px solid rgba(217, 45, 32, 0.28);
  background: #fff5f5;
  color: var(--danger);
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.section-toggle small {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.settings-fields {
  margin-top: 14px;
}

.full {
  width: 100%;
}

.hint,
.notice {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.7;
}

.server-link {
  margin-top: -4px;
  margin-bottom: 12px;
}

.server-link a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.server-link a:hover {
  text-decoration: underline;
}

.notice {
  padding: 12px 14px;
  border: 1px solid rgba(183, 121, 31, 0.28);
  border-radius: 8px;
  color: #8a5200;
  background: #fff8e8;
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.history {
  margin-top: 24px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.history-item {
  width: 100%;
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
}

.history-item span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item small,
.record small {
  color: var(--faint);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.back-button {
  min-height: 40px;
}

.stats {
  min-width: 118px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  text-align: right;
}

.stats span {
  display: block;
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 430px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--accent);
  font-size: 32px;
  font-weight: 900;
}

.loader {
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border: 4px solid rgba(59, 111, 245, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.records,
.monitor-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.monitor-list h2 {
  margin-bottom: 8px;
}

.monitor-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
  border-radius: 8px;
  background: #ffffff;
}

.monitor-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.monitor-main strong {
  font-size: 16px;
}

.monitor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.monitor-item small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-link {
  min-width: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.monitor-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.monitor-item .error {
  color: var(--danger);
}

.site-footer {
  margin: 18px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  box-shadow: var(--shadow);
}

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
}

.record-compact {
  grid-template-columns: minmax(0, 1fr);
}

.record .prize {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-2);
}

.record h3 {
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.record-body {
  min-width: 0;
}

.record p {
  margin-bottom: 4px;
  overflow: visible;
  color: var(--accent-2);
  text-overflow: initial;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.pager button {
  min-width: 86px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

@media (max-width: 940px) {
  .topbar,
  .result-head {
    align-items: stretch;
    flex-direction: column;
  }

  .head-actions {
    justify-content: space-between;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1400px);
    padding: 10px 0;
  }

  .topbar,
  .sidebar,
  .content {
    padding: 16px;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .settings-grid,
  .monitor-item {
    grid-template-columns: 1fr;
  }

  .monitor-actions {
    justify-content: stretch;
  }

  .monitor-actions button {
    flex: 1;
  }

  .record {
    grid-template-columns: minmax(0, 1fr);
  }

  .record .prize {
    display: none;
  }
}

.login-panel {
  width: min(440px, 100%);
  margin: 24px auto 0;
  padding: 24px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-switch { margin-top: 10px; }
.user-badge { color: var(--muted); font-weight: 800; }

.monitor-group { margin-top: 18px; }
.monitor-group-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; color: var(--text); font-weight: 900; }
.monitor-group-title small { color: var(--muted); font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input { width: auto; }

.monitor-preview { border-left-color: var(--accent); background: rgba(37, 99, 235, 0.04); }
