:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #6b7a90;
  --line: #e6edf5;
  --brand: #1677ff;
  --brand-dark: #0e5fd6;
  --ok: #17a34a;
  --warn: #d97706;
  --danger: #e11d48;
  --shadow: 0 10px 30px rgba(22, 40, 72, .08);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  font-size: 14px; font-weight: 600; background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-dark); }
.btn-ghost { background: #eef4ff; color: var(--brand); }
.btn-ghost:hover { background: #dce9ff; }
.btn-ok { background: var(--ok); }
.btn-danger { background: var(--danger); }
.btn-block { width: 100%; height: 46px; font-size: 16px; }
.input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; background: #fff; color: var(--ink);
}
.input:focus, textarea:focus, select:focus { outline: 2px solid #b7d4ff; border-color: var(--brand); }
label { display: block; font-size: 13px; color: #3d4d66; margin-bottom: 6px; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.alert { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.alert-err { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.alert-ok { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fff7ed; color: #c2410c; }
.badge-signed { background: #ecfdf3; color: #15803d; }
.badge-failed { background: #fff1f2; color: #be123c; }

.login-wrap { min-height: 100vh; display: flex; }
.login-left {
  flex: 1; background: linear-gradient(135deg, #e8f4ff 0%, #d7e8ff 45%, #efe8ff 100%);
  padding: 72px; display: flex; flex-direction: column; justify-content: center;
}
.login-left h1 { font-size: 48px; letter-spacing: -1px; }
.login-left h1 em { font-style: normal; color: var(--brand); }
.login-left p { margin-top: 16px; color: #4b5d78; font-size: 16px; max-width: 420px; }
.login-right {
  width: 480px; background: #fff; display: flex; flex-direction: column; justify-content: center;
  padding: 48px 52px; box-shadow: -8px 0 32px rgba(20,40,80,.06);
}
.login-right h2 { font-size: 26px; margin-bottom: 8px; }
.login-right .sub { color: var(--muted); margin-bottom: 28px; }
.field { margin-bottom: 16px; }

.admin-shell { min-height: 100vh; display: flex; }
.side {
  width: 232px; background: #122033; color: #d7e3f4; padding: 22px 16px; flex-shrink: 0;
}
.side .brand { font-size: 20px; font-weight: 800; color: #fff; padding: 8px 10px 22px; }
.side a {
  display: block; color: #c9d7ea; padding: 10px 12px; border-radius: 10px; margin-bottom: 6px;
}
.side a.active, .side a:hover { background: #1d3554; color: #fff; }
.main { flex: 1; padding: 28px 32px 48px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.topbar h2 { font-size: 22px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; }
.stat .n { font-size: 28px; font-weight: 800; }
.stat .t { color: var(--muted); font-size: 13px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; background: #f8fafc; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.section-title { font-size: 16px; margin: 8px 0 14px; }
.choice-row { display: flex; gap: 12px; flex-wrap: wrap; }
.choice {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #f8fafc; cursor: pointer; font-weight: 600;
}
.choice:has(input:checked) { border-color: var(--brand); background: #eef4ff; color: var(--brand); }
.choice input { width: 16px; height: 16px; }
.result-box { margin-top: 14px; padding: 14px; border: 1px solid #bbf7d0; background: #ecfdf3; border-radius: 12px; }
.result-title { font-weight: 700; color: #166534; margin-bottom: 10px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.sign-page {
  min-height: 100vh;
  background: radial-gradient(1200px 500px at 10% -10%, #d7e8ff 0%, transparent 50%),
              radial-gradient(900px 400px at 100% 0%, #efe8ff 0%, transparent 46%),
              #f5f8fc;
  padding: 28px 16px 48px;
}
.sign-card {
  max-width: 480px; margin: 0 auto; background: #fff; border-radius: 20px;
  box-shadow: var(--shadow); padding: 28px 22px 24px;
}
.sign-card .logo { font-weight: 800; color: var(--brand); letter-spacing: .5px; }
.sign-card h1 { font-size: 26px; margin: 10px 0 8px; }
.sign-card .lead { color: var(--muted); margin-bottom: 22px; }
.trust { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.trust span { font-size: 12px; color: #4b5d78; background: #f3f7fc; border-radius: 999px; padding: 4px 10px; }

@media (max-width: 900px) {
  .login-wrap { flex-direction: column; }
  .login-left { padding: 36px 24px; min-height: 220px; }
  .login-left h1 { font-size: 32px; }
  .login-right { width: 100%; padding: 28px 22px 40px; }
  .admin-shell { flex-direction: column; }
  .side { width: 100%; display: flex; gap: 8px; overflow: auto; padding: 12px; }
  .side .brand { display: none; }
  .main { padding: 16px; }
  .grid-3, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
