:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #171a1f;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  --bad: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 20px 32px;
}

.topbar h1 {
  font-size: 24px;
  margin: 0 0 4px;
}

.topbar p,
.section-head p {
  color: var(--muted);
  margin: 0;
}

.nav {
  background: #eef2f6;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 32px;
}

.nav a,
.tabs a {
  border-radius: 6px;
  color: #344054;
  padding: 8px 12px;
  white-space: nowrap;
}

.nav a.active,
.tabs a.active {
  background: var(--panel);
  color: var(--accent-dark);
  font-weight: 700;
}

main {
  margin: 0 auto;
  max-width: 1280px;
  padding: 24px 32px 48px;
}

button,
.link-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  justify-content: center;
  padding: 8px 12px;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.secondary,
.link-button {
  background: var(--panel);
  color: var(--accent-dark);
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.stats div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stats strong {
  display: block;
  font-size: 24px;
}

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

.grid.two {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

h3 {
  font-size: 16px;
  margin: 0;
}

.list {
  display: grid;
  gap: 12px;
}

.item,
.rank-row,
.table-wrap,
.report {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.item {
  padding: 16px;
}

.item p {
  margin: 8px 0;
}

.item-head,
.section-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.section-head {
  margin-bottom: 16px;
}

.score {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 999px;
  color: #067647;
  font-weight: 700;
  padding: 4px 9px;
}

.rank-row {
  display: block;
  margin-bottom: 10px;
  padding: 12px;
}

.rank-row span,
.rank-row small {
  display: block;
}

.rank-row small {
  color: var(--muted);
  margin-top: 4px;
}

.feedback {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.feedback button {
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
  padding: 5px 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.tabs {
  display: flex;
  gap: 6px;
}

.empty {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
}

.badge.ok {
  background: #ecfdf3;
  color: #067647;
}

.badge.error {
  background: #fef3f2;
  color: var(--bad);
}

.badge.new {
  background: #f2f4f7;
  color: #475467;
}

.report {
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  overflow: auto;
  padding: 20px;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .topbar,
  .section-head,
  .item-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav,
  main,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .stats,
  .grid.two {
    grid-template-columns: 1fr;
  }
}
.user-badge {
  align-self: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef6fb;
  color: #175f80;
  font-weight: 700;
}
.logout-link {
  align-self: center;
  color: #2279A2;
  font-weight: 700;
  text-decoration: none;
}
.login-card { max-width: 520px; margin: 40px auto; }
.login-form { display: grid; gap: 10px; margin: 18px 0; }
.login-form input { padding: 12px; border: 1px solid #d6dee6; border-radius: 12px; font-size: 16px; }
.error-box { padding: 12px; border-radius: 12px; background: #fff1f1; color: #b42318; font-weight: 700; }
.muted { color: #667085; }
