:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --text2: #646a73;
  --text3: #8f959e;
  --line: #e8eaed;
  --input: #ffffff;
  --primary: #2b6de5;
  --primary-pressed: #1f5bcc;
  --primary-soft: #eaf2ff;
  --chip: #eef2f7;
  --danger: #d14343;
  --ok: #1f7a4d;
  --radius: 12px;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  width: min(640px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  margin: 0;
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}
.title {
  margin: 1px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.page {
  width: min(640px, calc(100% - 32px));
  margin: 16px auto 36px;
}

.stat-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--primary-soft);
  color: var(--text2);
  border-radius: 10px;
  font-size: 13px;
}
.stat-banner strong {
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px;
  border: 1px solid var(--line);
}
.card.mt { margin-top: 12px; }

.lead {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text3);
}
.section {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.meta {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text3);
  line-height: 1.55;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}

/* 学工号 / 密码 / 验证码 / 其它：统一外观 */
.input {
  width: 100%;
  height: 44px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 44px;
  color: var(--text);
  background-color: #fff;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}
.input::placeholder { color: #b0b6bf; }
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 109, 229, 0.14);
}
/* 消除浏览器自动填充导致的黄底/高度不一致 */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  transition: background-color 99999s ease-out;
  box-shadow: 0 0 0 1000px #fff inset;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
  align-items: stretch;
}
.captcha-btn {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}
.captcha-btn:hover { border-color: var(--primary); }
.captcha-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn {
  border: 0;
  border-radius: 10px;
  height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-pressed); }
.btn.ghost {
  width: 100%;
  background: var(--chip);
  color: var(--text2);
}
.btn.danger {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  background: #fff;
  color: var(--danger);
  border: 1px solid #f0d0d0;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 17px;
  background: var(--chip);
  color: var(--text2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.chip.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.preview, .task-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  background: #f7f8fa;
  border: 1px solid var(--line);
}
.preview h3, .task-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}
.detail {
  margin: 4px 0;
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
}

.task-list { display: grid; gap: 10px; margin-top: 8px; }
.empty { color: var(--text3); font-size: 13px; margin: 4px 0 0; }
.hidden { display: none !important; }

.footer {
  text-align: center;
  color: var(--text3);
  font-size: 12px;
  padding: 0 16px 28px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  max-width: min(90vw, 400px);
  background: rgba(31, 35, 41, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 50;
  text-align: center;
}

@media (max-width: 560px) {
  .page, .topbar-inner { width: calc(100% - 24px); }
  .captcha-row { grid-template-columns: 1fr 100px; }
}
