:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #1e3a8a;
  --brand-2: #2563eb;
  --danger: #b91c1c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #e8eefc 0%, #f6f8fb 55%, #eef2f7 100%);
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 18px 56px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  padding: 24px;
  margin-bottom: 20px;
}

.auth-card { max-width: 420px; margin: 8vh auto; }

.brand { text-align: center; margin-bottom: 22px; }
.brand.small { display: flex; align-items: center; gap: 12px; text-align: left; margin: 0; }

.brand-mark {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 22px; font-weight: 700;
  margin: 0 auto 12px;
}
.brand.small .brand-mark { margin: 0; width: 40px; height: 40px; font-size: 18px; }

h1 { font-size: 22px; margin: 0; letter-spacing: .5px; }
h2 { font-size: 17px; margin: 0 0 16px; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.form { display: flex; flex-direction: column; gap: 10px; }
label { font-size: 13px; font-weight: 600; color: #374151; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.btn {
  border: 0; border-radius: 10px;
  padding: 11px 18px;
  font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: transform .05s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand-2); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { background: #f3f4f6; color: #374151; }
.btn.ghost:hover { background: #e5e7eb; }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.form-foot .hint { margin: 0; }

.alerts { margin-bottom: 16px; }
.alert {
  background: #fef2f2; color: var(--danger);
  border: 1px solid #fecaca; border-radius: 10px;
  padding: 10px 12px; font-size: 14px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

.count {
  display: inline-block; min-width: 22px; text-align: center;
  font-size: 12px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  background: #eef2ff; color: var(--brand);
  vertical-align: middle;
}

.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.note { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fbfcfe; }
.note-meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.note-body { white-space: pre-wrap; word-break: break-word; line-height: 1.7; font-size: 15px; }
.empty { color: var(--muted); font-size: 14px; margin: 0; }

@media (max-width: 520px) {
  .page { padding: 20px 12px 40px; }
  .card { padding: 18px; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { width: 100%; }
  .topbar { flex-wrap: wrap; }
}
