:root {
  --primary: #1e6bff;
  --primary-d: #1557d6;
  --primary-l: #e8f0ff;
  --danger: #f03e3e;
  --success: #12b886;
  --warning: #f59f00;
  --text: #1f2937;
  --text-2: #4b5563;
  --muted: #8a94a6;
  --border: #e5e7eb;
  --bg: #f5f7fb;
  --card: #fff;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(15, 23, 42, .08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; text-decoration: none !important; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); color: #fff; border-color: var(--primary-d); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c92a2a; border-color: #c92a2a; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-l); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 16px; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.link-danger { color: var(--danger); }

.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 8px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 107, 255, .15); }
.input.invalid { border-color: var(--danger); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; color: var(--text-2); font-weight: 500; }
.field .req { color: var(--danger); margin-left: 2px; }
.field-err { color: var(--danger); font-size: 12px; margin-top: 4px; }
.field-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; margin-right: 14px; }

.avatar { display: inline-block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: #eef1f6; }
.avatar-letter { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; }

.toast-box { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: rgba(17, 24, 39, .92); color: #fff; padding: 10px 18px; border-radius: 8px; box-shadow: var(--shadow); animation: toastIn .2s ease; transition: opacity .4s, transform .4s; font-size: 14px; }
.toast-success { background: rgba(18, 184, 134, .95); }
.toast-error { background: rgba(240, 62, 62, .95); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.modal-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 23, 42, .45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .15s; }
.modal { background: #fff; border-radius: 12px; width: 480px; max-width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal-wide { width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.confirm-text { margin: 0; white-space: pre-wrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty-icon { font-size: 36px; margin-bottom: 6px; opacity: .6; }
.loading { text-align: center; color: var(--muted); padding: 40px 16px; }
.spinner { display: inline-block; width: 22px; height: 22px; border: 3px solid #d6def0; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.tag { display: inline-block; padding: 0 8px; height: 22px; line-height: 22px; border-radius: 11px; font-size: 12px; background: #eef1f6; color: var(--text-2); white-space: nowrap; }
.tag-blue { background: var(--primary-l); color: var(--primary); }
.tag-green { background: #e6fcf5; color: #0ca678; }
.tag-orange { background: #fff4e6; color: #e8590c; }
.tag-red { background: #fff5f5; color: #e03131; }
.tag-gray { background: #f1f3f5; color: #868e96; }
.powered { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 0; }
