:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #15171c;
  --ink-2: #3d424d;
  --muted: #8a909c;
  --line: #ebedf1;
  --line-2: #f4f5f7;
  --brand: #e0443b;
  --brand-soft: #fdeceb;
  --gold: #e9a23b;
  --gold-soft: #fdf4e5;
  --green: #0f9d63;
  --green-soft: #e7f7ef;
  --blue: #3574e0;
  --blue-soft: #eaf1fe;
  --sidebar: #16171e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 23, 31, 0.04), 0 8px 24px -12px rgba(20, 23, 31, 0.12);
  --shadow-lg: 0 24px 60px -24px rgba(20, 23, 31, 0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: #ffd9d5; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: -0.01em; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { border-color: #d9dce2; background: #fcfcfd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #e8503f, #d33a31);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(224, 68, 59, 0.9);
}
.btn-primary:hover { background: linear-gradient(135deg, #ef5a49, #dc4038); border-color: transparent; }

.btn-dark { background: #1c1e25; border-color: transparent; color: #fff; }
.btn-dark:hover { background: #2a2d36; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f2f3f6; color: var(--ink); border-color: transparent; }

.btn-danger { color: var(--brand); border-color: #f6d7d4; background: #fff; }
.btn-danger:hover { background: var(--brand-soft); border-color: #f0c3bf; }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-lg { height: 46px; font-size: 15px; border-radius: 12px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px 24px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 0;
}
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.input, .select, textarea.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: #b4b9c2; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: #e9a7a2;
  box-shadow: 0 0 0 4px rgba(224, 68, 59, 0.08);
}
.input:disabled { background: #f7f8fa; color: var(--muted); }
.input-group { position: relative; }
.input-group .input { padding-right: 42px; }
.input-affix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; cursor: pointer; background: none; border: 0;
}
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--brand); margin-top: 6px; display: none; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-gold { background: var(--gold-soft); color: #b97a14; }
.badge-red { background: var(--brand-soft); color: var(--brand); }
.badge-gray { background: #f2f3f6; color: #6d737e; }
.badge-blue { background: var(--blue-soft); color: var(--blue); }

/* ---------------- 表格 ---------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  padding: 11px 14px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tb th:first-child { padding-left: 24px; }
table.tb th:last-child { padding-right: 24px; }
table.tb td {
  padding: 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
table.tb td:first-child { padding-left: 24px; }
table.tb td:last-child { padding-right: 24px; }
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb tbody tr:hover { background: #fcfcfd; }
table.tb .t-strong { color: var(--ink); font-weight: 600; }
table.tb .t-muted { color: var(--muted); font-size: 12.5px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; }
.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-btns { display: flex; gap: 6px; }
.pager-btns button {
  min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 12.5px; cursor: pointer; padding: 0 8px;
}
.pager-btns button:hover:not(:disabled) { border-color: #d6dae1; }
.pager-btns button.active { background: #1c1e25; color: #fff; border-color: #1c1e25; }
.pager-btns button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-ico {
  width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 14px;
  display: grid; place-items: center; background: #f4f5f8; color: #b0b5c0;
}
.empty p { font-size: 13.5px; }
.empty span { font-size: 12px; color: #b0b5c0; display: block; margin-top: 4px; }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #1b1d24; color: #fff; padding: 11px 16px; border-radius: 11px;
  font-size: 13.5px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.5);
  animation: toastIn 0.26s cubic-bezier(0.2, 0.8, 0.3, 1);
  max-width: 90vw;
}
.toast.err { background: #b8302a; }
.toast.ok { background: #16794f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.97); } }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 18, 24, 0.48);
  backdrop-filter: blur(3px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.18s ease;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg);
  animation: modalIn 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.modal.wide { max-width: 760px; }
.modal-head { padding: 22px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.modal-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 0 24px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-x {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: #f4f5f8;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none;
}
.modal-x:hover { background: #eceef2; color: var(--ink); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

/* ---------------- 加载 ---------------- */
.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2.5px solid #e8eaee;
  border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 登录页 ---------------- */
.auth { display: grid; grid-template-columns: 1.02fr 1fr; min-height: 100vh; }
.auth-side {
  position: relative; overflow: hidden; background: #14151c; color: #fff;
  padding: 52px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side::before {
  content: ""; position: absolute; width: 720px; height: 720px; right: -240px; top: -280px;
  background: radial-gradient(circle, rgba(233, 162, 59, 0.22), transparent 62%);
  pointer-events: none;
}
.auth-side::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 20%, #000 30%, transparent 78%);
  pointer-events: none;
}
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(140deg, #f6c164, #e0443b 78%);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
  box-shadow: 0 8px 20px -8px rgba(224, 68, 59, 0.8);
}
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.auth-hero { padding: 40px 0; }
.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px;
  color: #f0c48a; background: rgba(233, 162, 59, 0.12);
  border: 1px solid rgba(233, 162, 59, 0.24); padding: 5px 11px; border-radius: 999px; margin-bottom: 22px;
}
.auth-h1 { font-size: 42px; line-height: 1.22; font-weight: 700; letter-spacing: -0.025em; }
.auth-h1 em { font-style: normal; background: linear-gradient(100deg, #f7cf8d, #ef8a4d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-p { color: rgba(255,255,255,.56); font-size: 14.5px; margin-top: 18px; max-width: 420px; line-height: 1.8; }
.auth-feats { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.auth-feat { display: flex; align-items: center; gap: 9px; font-size: 13px; color: rgba(255,255,255,.72); }
.auth-feat i { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.07); display: grid; place-items: center; font-style: normal; color: #f0c48a; }
.auth-foot { display: flex; gap: 36px; }
.auth-foot div strong { display: block; font-size: 22px; letter-spacing: -0.02em; }
.auth-foot div span { font-size: 12px; color: rgba(255,255,255,.42); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; position: relative; }
.auth-box { width: 100%; max-width: 392px; }
.auth-mobile-brand { display: none; }
.auth-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.auth-tab {
  background: none; border: 0; padding: 0 0 12px; font-size: 16px; font-weight: 500;
  color: var(--muted); cursor: pointer; position: relative;
}
.auth-tab.active { color: var(--ink); font-weight: 600; }
.auth-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.auth-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.auth-desc { font-size: 13px; color: var(--muted); margin-top: 6px; margin-bottom: 24px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-switch button { background: none; border: 0; color: var(--brand); font-size: 13px; cursor: pointer; padding: 0 2px; font-weight: 500; }
.auth-demo {
  margin-top: 22px; padding: 12px 14px; border-radius: 10px; background: #f8f9fb;
  border: 1px dashed #e3e6eb; font-size: 12px; color: var(--muted); line-height: 1.8;
}
.auth-demo b { color: var(--ink-2); font-weight: 600; }
.auth-demo code { background: #fff; border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; color: var(--brand); font-size: 11.5px; }
.auth-admin-link { position: absolute; top: 22px; right: 26px; font-size: 12.5px; color: var(--muted); }
.auth-admin-link:hover { color: var(--ink); }
.invite-hint {
  display: flex; align-items: center; gap: 8px; background: var(--gold-soft);
  border: 1px solid #f6e3c4; color: #9a6a12; border-radius: 9px; padding: 8px 11px;
  font-size: 12.5px; margin-bottom: 16px;
}

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand {
    display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 30px;
  }
  .auth-mobile-brand .brand-name { color: var(--ink); }
  .auth-main { padding: 32px 20px 48px; align-items: flex-start; }
  .auth-box { max-width: 420px; }
  .auth-admin-link { top: 18px; right: 18px; }
  .auth-h1 { font-size: 34px; }
}

/* ---------------- 登录页：移动端功能导览 ---------------- */
.auth-tags { display: none; }
@media (max-width: 960px) {
  .auth-tags {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    margin: 24px auto 0; max-width: 420px;
  }
  .auth-tags span {
    font-size: 12px; color: var(--ink-2); background: #f6f7fa;
    border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  }
  .auth-tags-title { display: block; text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }
}
