/* LingCraft 发卡中心 —— 共用样式 */
:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --line: #e7e9f0;
  --text: #0f172a;
  --muted: #6b7280;
  --brand: #6d5efc;
  --brand-2: #8b5cf6;
  --brand-soft: #efedff;
  --green: #15a34a;
  --green-soft: #e8f8ee;
  --amber: #c2740a;
  --amber-soft: #fdf3e2;
  --red: #d92d20;
  --red-soft: #fdeceb;
  --blue-soft: #e8f1ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button { font: inherit; }
code, .mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.w100 { width: 100%; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; font-weight: 600; font-size: 13px;
  transition: .15s ease; white-space: nowrap;
}
.btn:hover { border-color: #d3d7e3; background: #fafbff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(109,94,252,.25);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #f3cbc7; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.icon { width: 32px; height: 32px; padding: 0; }
.btn-link { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; font-size: 12px; font-weight: 600; }
.btn-link.danger { color: var(--red); }

/* 表单 */
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 9px 12px; font: inherit; color: var(--text); outline: none; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,94,252,.12); }
.input.sm, .select.sm { height: 32px; padding: 4px 10px; font-size: 12px; }
.textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; font-weight: 600; color: #475066; margin-bottom: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #475066; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

/* 卡片/面板 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title { font-size: 15px; font-weight: 700; }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 0; }

/* 徽标 */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.gray { background: #f1f2f6; color: #64748b; }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: #8a93a6; font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: #fafbfd; white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid #f1f2f6; vertical-align: middle; }
.table tbody tr:hover { background: #fafaff; }
.table tbody tr:last-child td { border-bottom: 0; }
.code-cell { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* 提示条 */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; max-width: 380px; padding: 12px 16px; border-radius: 12px; color: #fff;
  background: #111827; box-shadow: 0 12px 30px rgba(16,24,40,.22); font-size: 13px;
  animation: toast-in .18s ease-out;
}
.toast.ok { background: #0f7a3d; }
.toast.err { background: #b42318; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 弹窗 */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 900; padding: 24px; }
.modal { width: 100%; max-width: 520px; background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(15,23,42,.28); overflow: hidden; }
.modal.wide { max-width: 820px; }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 22px; max-height: 68vh; overflow: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fbfbfd; }
.close-x { border: 0; background: none; font-size: 22px; line-height: 1; color: #98a1b3; cursor: pointer; }

/* 登录 */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 15% -10%, #ded9ff 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 0%, #d8ecff 0%, transparent 55%), #f4f5f8; }
.auth-card { width: 100%; max-width: 380px; background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(15,23,42,.14); padding: 32px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.auth-title { font-size: 22px; font-weight: 800; margin: 22px 0 6px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px; }

/* 工具类 */
.spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
