:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --brand: #1f6feb;
  --brand-dark: #1a5fd0;
  --danger: #dc2626;
  --ok: #059669;
  --warn: #b45309;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ---------------- 落地页 ---------------- */

.lp {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #eef2f8 0%, var(--bg) 320px);
}

.lp-head {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.lp-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.lp-body {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

.lp-copy h1 {
  font-size: 30px;
  line-height: 1.35;
  margin: 24px 0 12px;
  font-weight: 500;
}

.lp-copy p {
  color: var(--text-2);
  font-size: 15px;
  margin: 0 0 16px;
  white-space: pre-wrap;
}

.lp-points {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 10px;
  color: var(--text-2);
}

.lp-points li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 10px;
  vertical-align: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lp-form {
  padding: 22px;
}

.lp-form h2 {
  font-size: 16px;
  margin: 0 0 4px;
  font-weight: 500;
}

.lp-form .sub {
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 18px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field label .req { color: var(--danger); }

.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}

.field input:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}

.checkline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-2);
  margin: 14px 0;
}

.checkline input { margin-top: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}

.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; padding: 11px; }
.btn.ghost { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn.ghost:hover { background: #f9fafb; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12px; }

.msg {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

.msg.show { display: block; }
.msg.err { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.msg.ok { background: #ecfdf5; color: var(--ok); border: 1px solid #a7f3d0; }

.lp-done {
  padding: 40px 22px;
  text-align: center;
}

.lp-done .tick {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ecfdf5;
  color: var(--ok);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 22px;
}

.lp-foot {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  padding: 20px;
}

@media (max-width: 820px) {
  .lp-body { grid-template-columns: 1fr; gap: 24px; padding-top: 0; }
  .lp-copy h1 { font-size: 24px; margin-top: 8px; }
}

/* ---------------- 登录入口 ---------------- */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: linear-gradient(180deg, #eef2f8 0%, var(--bg) 60%);
}

.gate-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 6px 24px rgba(16, 24, 40, .06);
}

.gate-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.gate-head .lp-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.gate-head h1 { font-size: 17px; margin: 0; font-weight: 500; }
.gate-sub { color: var(--text-3); font-size: 12px; margin: 0 0 22px; }

.gate-roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 18px; }
.gate-role {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  font-size: 13px;
  color: var(--text-2);
  transition: all .15s;
}
.gate-role:hover { border-color: var(--brand); color: var(--brand); }
.gate-role.on { border-color: var(--brand); background: #eff5ff; color: var(--brand); }

.gate-alt {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------- 管理端外壳 ---------------- */

.shell { display: flex; min-height: 100vh; }

.side {
  width: 208px;
  flex: 0 0 208px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.side-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.side-group { font-size: 11px; color: var(--text-3); padding: 12px 10px 6px; }

.side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  margin-bottom: 2px;
  font-size: 13px;
}
.side-item:hover { background: #f3f4f6; color: var(--text); }
.side-item.on { background: #eff5ff; color: var(--brand); font-weight: 500; }
.side-item .tag {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 400;
}

.side-foot { padding: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.side-foot .who { color: var(--text-2); margin-bottom: 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.top h2 { font-size: 15px; margin: 0; font-weight: 500; }
.top .spacer { flex: 1; }

.view { padding: 22px; max-width: 1320px; width: 100%; }

/* ---------------- 卡片与表格 ---------------- */

.grid { display: grid; gap: 14px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.stat .k { font-size: 12px; color: var(--text-3); }
.stat .v { font-size: 26px; font-weight: 500; margin-top: 4px; letter-spacing: -.5px; }
.stat .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 14px; margin: 0; font-weight: 500; }
.panel-head .spacer { flex: 1; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
}
.tab:hover { background: #f3f4f6; }
.tab.on { background: #eff5ff; color: var(--brand); border-color: #cfe0ff; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; font-size: 13px; }
th {
  background: #fafbfc;
  color: var(--text-3);
  font-weight: 400;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { border-bottom: 1px solid #f1f2f4; color: var(--text-2); }
tbody tr:hover { background: #fafbfc; cursor: pointer; }
tbody tr:last-child td { border-bottom: none; }
td .name { color: var(--text); font-weight: 500; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
}
.b-new { background: #eff5ff; color: #1a5fd0; }
.b-assigned { background: #fff7ed; color: var(--warn); }
.b-following { background: #f0fdf4; color: #15803d; }
.b-won { background: #ecfdf5; color: var(--ok); }
.b-pool { background: #f3f4f6; color: var(--text-2); }
.b-invalid { background: #f9fafb; color: var(--text-3); }

.empty { padding: 56px 20px; text-align: center; color: var(--text-3); }
.empty p { margin: 4px 0; }
.empty .big { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }

/* ---------------- 抽屉 ---------------- */

.mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .32);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  z-index: 40;
}
.mask.on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 520px;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 41;
  display: flex;
  flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.drawer-head h3 { margin: 0; font-size: 15px; font-weight: 500; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.kv { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); }

.timeline { list-style: none; padding: 0; margin: 16px 0 0; }
.timeline li {
  position: relative;
  padding: 0 0 16px 18px;
  border-left: 1px solid var(--line);
  font-size: 13px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}
.timeline li.hot::before { background: var(--brand); }
.timeline .when { color: var(--text-3); font-size: 12px; }
.timeline .what { color: var(--text); margin-top: 2px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 12px);
  background: #111827;
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all .2s;
  z-index: 60;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 2px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}
.pg-info { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.pg-size {
  padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 5px;
  background: #fff; color: var(--text-2); font-size: 12px; outline: none;
}
.pg-btns { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.pg-num {
  min-width: 30px; padding: 5px 9px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer;
}
.pg-num:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pg-num.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg-num:disabled { opacity: .45; cursor: not-allowed; }

/* 设置页：一行一条规则，左侧说明、右侧操作 */
.set-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.set-row:last-of-type { border-bottom: 0; }
.set-copy { flex: 1; min-width: 0; }
.set-copy .t { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.set-copy .d { font-size: 12px; color: var(--text-3); line-height: 1.85; }
.set-field { flex: 0 0 150px; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.set-field input {
  width: 88px; flex: 0 0 88px; padding: 8px 11px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); outline: none;
}
.set-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 111, 235, .12); }
.set-field input:disabled { background: #f9fafb; color: var(--text-3); }
.set-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 0 2px; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 42px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d6d9de; border-radius: 12px; transition: background .18s; }
.switch span::after {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .18s;
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(31, 111, 235, .2); }

@media (max-width: 1100px) {
  .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .side { display: none; }
  .view { padding: 14px; }
  .grid.k2 { grid-template-columns: 1fr; }
}
