:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #222631;
  --text: #e6e8ec;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid #2a2f3a;
}

.brand { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; }
.brand .logo { height: 26px; width: 26px; margin-right: 8px; }
.brand .spark { color: #ff6a00; }   /* 红橙色 星火 */
.sub { color: var(--muted); font-size: 13px; margin-left: 8px; }
.uname { color: var(--text); font-size: 14px; margin-right: 6px; }

button.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
button.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
button.btn.block { width: 100%; margin-top: 6px; }
a.btn.ghost { padding: 8px 14px; }

/* 模态框 */
.modal-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  align-items: center; justify-content: center;
  z-index: 50;
}
.modal {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #2a2f3a;
  font-weight: 700;
}
.modal-x {
  background: none; border: none; color: var(--muted);
  font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-body input {
  width: 100%;
  background: #0b0d11;
  color: #d6e1ff;
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.msg { font-size: 13px; color: var(--yellow); min-height: 18px; }
.code {
  background: var(--panel-2);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: monospace;
  color: var(--green);
  word-break: break-all;
}
.muted { color: var(--muted); font-size: 13px; }
.switch { font-size: 13px; color: var(--muted); text-align: center; margin: 4px 0 0; }
.switch a { color: var(--accent); }
.result .row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 10px 12px; background: var(--panel-2); border-radius: 8px; }
.result .row input { width: auto; }

/* 密码相关表单 */
.pwd-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pwd-form input {
  width: 100%;
  background: #0b0d11;
  color: #d6e1ff;
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.pwd-form input:focus { outline: none; border-color: var(--accent); }
.pwd-meter { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pwd-meter .bar { flex: 1; height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.pwd-meter .bar > i { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.2s, background 0.2s; }
.pwd-meter .bar > i.level-1 { width: 25%; background: var(--red); }
.pwd-meter .bar > i.level-2 { width: 50%; background: var(--yellow); }
.pwd-meter .bar > i.level-3 { width: 75%; background: #7ee787; }
.pwd-meter .bar > i.level-4 { width: 100%; background: var(--green); }
.pwd-hint { font-size: 12px; color: var(--muted); margin: 0; }
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.divider { height: 1px; background: #2a2f3a; margin: 20px 0; }
.security-note {
  background: rgba(79,140,255,0.08);
  border: 1px solid rgba(79,140,255,0.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 16px;
}
.security-note b { color: var(--text); }

.container { max-width: 860px; margin: 0 auto; padding: 24px; }

.problem-list { display: flex; flex-direction: column; gap: 12px; }

.card {
  display: block;
  background: var(--panel);
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.05s;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13px; }

.problem-detail h1 { margin-top: 8px; }
.problem-detail pre {
  background: var(--panel-2);
  padding: 14px;
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 14px;
}

.editor { margin-top: 24px; }
.editor h3 { margin-bottom: 8px; }

textarea#code {
  width: 100%;
  min-height: 280px;
  background: #0b0d11;
  color: #d6e1ff;
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.actions { margin-top: 12px; display: flex; align-items: center; gap: 14px; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

.status { font-size: 14px; color: var(--muted); }
.status.loading { color: var(--yellow); }

.result {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 16px;
}
.result h3 { margin-top: 0; }
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
}
.badge.AC { background: rgba(63,185,80,0.15); color: var(--green); }
.badge.WA, .badge.RE, .badge.CE, .badge.TLE, .badge.MLE, .badge.IE, .badge.SERVER_ERROR {
  background: rgba(248,81,73,0.15); color: var(--red);
}
.result pre {
  background: var(--panel-2);
  padding: 12px;
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 13px;
  color: #cdd6e4;
}

.back { color: var(--accent); text-decoration: none; font-size: 14px; }
.loading { color: var(--muted); }
