/* 伟贤问卷系统 · 三端共用基础样式 */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #243043;
  --text-2: #68758a;
  --line: #e2e8f0;
  --brand: #1565c0;
  --brand-2: #0d47a1;
  --brand-soft: #e8f1fd;
  --danger: #c62828;
  --danger-soft: #fdecea;
  --success: #2e7d32;
  --success-soft: #e8f5e9;
  --warn: #ef6c00;
  --shadow: 0 4px 20px rgba(28, 54, 94, .08);
  --shadow-lg: 0 16px 48px rgba(28, 54, 94, .16);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 16px; border: 1px solid transparent; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .18s ease;
  background: var(--brand); color: #fff; line-height: 1.2; white-space: nowrap;
}
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.plain { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.plain:hover { background: #eef2f7; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #9b1c1c; }
.btn.sm { min-height: 30px; padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn.lg { min-height: 46px; padding: 11px 24px; font-size: 16px; }
.btn.block { width: 100%; }

.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 101, 192, .12);
}
.textarea { resize: vertical; min-height: 88px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; margin-bottom: 5px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.hint { font-size: 12px; color: var(--text-2); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.tag.green { background: var(--success-soft); color: var(--success); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.gray { background: #eef1f5; color: var(--text-2); }

.wj-toast-wrap { position: fixed; right: 18px; top: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.wj-toast {
  min-width: 200px; max-width: 360px; padding: 11px 15px; border-radius: 10px;
  background: #243043; color: #fff; font-size: 14px; box-shadow: var(--shadow-lg);
  animation: wjToastIn .22s ease both; pointer-events: auto;
}
.wj-toast.ok { background: #1b5e20; }
.wj-toast.err { background: #9b1c1c; }
@keyframes wjToastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.modal-mask { position: fixed; inset: 0; z-index: 9000; background: rgba(18, 30, 48, .48); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; padding: 22px; }
.modal.wide { max-width: 900px; }
.modal h3 { margin: 0 0 14px; font-size: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.empty { padding: 48px 16px; text-align: center; color: var(--text-2); }
.empty .big { font-size: 42px; opacity: .35; margin-bottom: 8px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: wjSpin .7s linear infinite; margin: 0 auto; }
@keyframes wjSpin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .btn { min-height: 42px; }
  .modal { padding: 16px; border-radius: 12px; }
  .wj-toast-wrap { right: 10px; left: 10px; top: 10px; }
  .wj-toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
