:root {
  --bg: #ffffff;
  --panel: #f7f8fa;
  --line: #e6e8eb;
  --text: #303133;
  --muted: #606266;
  --blue: #2d8cf0;
  --blue-hover: #1e78d9;
  --red: #ed4014;
  --ok: #19be6b;
  --danger: #ed4014;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #fff;
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--blue); }
.nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.nav a { color: #515a6e; }
.nav a.active { color: var(--blue); font-weight: 700; }

.wrap {
  width: min(860px, calc(100% - 32px));
  margin: 28px auto 48px;
}
h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #17233d;
}
.lead { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
}
.row-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.row-form label {
  min-width: 96px;
  color: #515a6e;
  font-size: 14px;
}
input[type="text"], textarea, select {
  flex: 1;
  min-width: 220px;
  background: #fff;
  border: 1px solid #dcdee2;
  border-radius: 4px;
  padding: 8px 10px;
  outline: none;
}
textarea { width: 100%; min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }

.btn {
  appearance: none;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
}
.btn:hover { background: var(--blue-hover); }
.btn.ghost {
  background: #fff;
  color: #515a6e;
  border: 1px solid #dcdee2;
}
.btn:disabled { opacity: 0.6; cursor: wait; }

.code {
  color: var(--red);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}
.remain { color: var(--muted); font-size: 14px; }
.bar {
  margin-top: 10px;
  height: 8px;
  background: #e8eaec;
  border-radius: 4px;
  overflow: hidden;
  max-width: 360px;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--blue);
}

.hint { margin-top: 14px; color: #808695; font-size: 13px; }
.err { color: var(--danger); }
.ok { color: var(--ok); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.mail-list { display: grid; gap: 10px; margin-top: 16px; }
.mail-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  cursor: pointer;
}
.mail-item:hover { border-color: #c5e1ff; }
.mail-item h3 { margin: 0 0 6px; font-size: 15px; color: #17233d; }
.meta { color: #808695; font-size: 12px; }
.codes { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.code-chip {
  background: #fff1f0;
  color: var(--red);
  border: 1px solid #ffd6d2;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.body {
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #515a6e;
  line-height: 1.7;
  max-height: 360px;
  overflow: auto;
  background: #fafafa;
  border: 1px dashed #e8eaec;
  padding: 10px;
}

@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .code { font-size: 28px; }
  .row-form label { min-width: 100%; }
}
