* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #222; background: #f7f7fa; }
a { color: #2762d8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #1f2a44; color: #fff; padding: 12px 24px;
  position: sticky; top: 0; z-index: 50;
}
.brand { font-size: 16px; font-weight: 600; }
.userbox { font-size: 13px; color: #cfd6e6; }
.userbox button, .userbox a.nav-link {
  margin-left: 12px; background: transparent; color: #cfd6e6;
  border: 1px solid #4a5b7e; padding: 3px 10px; border-radius: 4px;
  font-size: 12px; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.userbox button:hover, .userbox a.nav-link:hover {
  background: #2a3858; color: #fff; text-decoration: none;
}

.rank-trend-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 16px; }
.rank-trend-card h3 { margin-top: 0; }
.rank-trend-card .chart-wrap { position: relative; height: 280px; }
.rank-trend-card .empty-hint { color: #888; font-size: 13px; text-align: center; padding: 20px 0; }

main { padding: 20px 24px; max-width: 900px; margin: 0 auto; }

h2 { margin: 0 0 16px 0; font-size: 18px; }
h3 { margin: 16px 0 8px; font-size: 15px; color: #333; }

.card {
  background: #fff; border-radius: 8px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 16px;
}

button, .btn {
  display: inline-block; padding: 6px 14px; border: 1px solid #ccd; background: #fff;
  border-radius: 4px; cursor: pointer; font-size: 14px; color: #222;
}
button:hover, .btn:hover { background: #f0f3fa; }
button.primary, .btn.primary { background: #2762d8; color: #fff; border-color: #2762d8; }
button.primary:hover, .btn.primary:hover { background: #1a4fb8; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select {
  padding: 8px 10px; border: 1px solid #ccd; border-radius: 4px; font-size: 14px;
  background: #fff;
}
label { font-size: 13px; color: #555; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
th { background: #f4f6fa; color: #444; font-weight: 600; }
tr:hover td { background: #fbfbff; }

.muted { color: #888; font-size: 13px; }
.error { color: #c1373a; }
.ok { color: #2c7a3d; }

#toast {
  position: fixed; right: 24px; top: 64px; background: #333; color: #fff;
  padding: 10px 16px; border-radius: 4px; opacity: 0; transition: opacity 0.3s;
  z-index: 100; pointer-events: none;
}
#toast.show { opacity: 1; }

.form { max-width: 360px; margin: 24px auto; }
.form .form-row { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.form input { width: 100%; }
.form button { width: 100%; padding: 10px; }
.form .hint { color: #888; font-size: 12px; margin-top: 8px; }

.exam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.exam-card {
  background: #fff; border-radius: 8px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.exam-card:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.08); }
.exam-card .name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.exam-card .date { color: #888; font-size: 12px; margin-bottom: 10px; }
.exam-card .score-row {
  display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px;
}
.exam-card .my-total { font-size: 26px; font-weight: 600; color: #2762d8; }
.exam-card .my-total .of { color: #999; font-weight: 400; font-size: 14px; margin-left: 4px; }
.exam-card .ranks { color: #555; font-size: 13px; text-align: right; }

.q-correct { color: #2c7a3d; font-weight: 600; }
.q-wrong { color: #c1373a; font-weight: 600; }
.q-partial { color: #a87600; font-weight: 600; }

.summary-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.summary-cell {
  background: #fff; border-radius: 8px; padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.summary-cell .label { color: #888; font-size: 12px; }
.summary-cell .value { font-size: 22px; font-weight: 600; margin-top: 4px; }
