/* ============================================================
   粉丝后援会管理台 · 深色玻璃拟态主题
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #070a14;
  --card: rgba(255, 255, 255, .045);
  --card-hover: rgba(255, 255, 255, .075);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #eef1ff;
  --dim: #97a0bf;
  --faint: #626b8d;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --amber: #f5a524;
  --green: #2fd48a;
  --red: #f4516a;
  --grad: linear-gradient(135deg, #8b5cf6, #ec4899);
  --r: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(.22, .68, .32, 1);
  color-scheme: dark;
}

html { scrollbar-color: #343b5e #0d1120; }
html, body { scrollbar-width: thin; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, .45); }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid rgba(139, 92, 246, .8); outline-offset: 2px; border-radius: 6px; }
body.no-scroll { overflow: hidden; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c3354; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4372; }

/* ---------- 背景光斑 + 纹理 ---------- */
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(720px 480px at 10% -8%, rgba(139, 92, 246, .20), transparent 65%),
    radial-gradient(660px 440px at 96% 6%, rgba(236, 72, 153, .15), transparent 65%),
    radial-gradient(800px 540px at 55% 118%, rgba(34, 211, 238, .09), transparent 65%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9, 12, 24, .72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 22px; height: 64px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); cursor: pointer; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 18px;
  box-shadow: 0 6px 20px rgba(139, 92, 246, .45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.brand-text em { font-style: normal; font-size: 10px; letter-spacing: 2.4px; color: var(--faint); }

.nav {
  display: flex; gap: 6px; margin-left: auto;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px;
}
.nav-btn {
  padding: 7px 18px; border-radius: 999px; font-size: 14px; color: var(--dim);
  transition: all .25s var(--ease); white-space: nowrap; font-weight: 500;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active {
  color: #fff; background: var(--grad);
  box-shadow: 0 4px 16px rgba(236, 72, 153, .35);
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--dim); border: 1px solid var(--border); background: rgba(255, 255, 255, .04);
  transition: all .3s var(--ease); font-size: 16px;
}
.icon-btn:hover { color: #fff; transform: rotate(180deg); border-color: var(--border-strong); }

/* ---------- 内容区 ---------- */
.content { max-width: 1200px; margin: 0 auto; padding: 34px 22px 80px; }
.view { display: none; animation: viewIn .4s var(--ease); }
.view.active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 26px; flex-wrap: wrap;
}
.view-head h2 {
  font-size: 26px; font-weight: 800; letter-spacing: .4px;
  background: linear-gradient(120deg, #fff, #b9a8ff 55%, #ff9fd0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.view-head p { color: var(--dim); font-size: 13.5px; margin-top: 4px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  transition: all .25s var(--ease); border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(139, 92, 246, .38); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(236, 72, 153, .45); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: rgba(255, 255, 255, .06); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-danger { background: rgba(244, 81, 106, .14); border-color: rgba(244, 81, 106, .4); color: #ff8da0; }
.btn-danger:hover { background: rgba(244, 81, 106, .28); }
.btn-mini {
  padding: 5px 12px; border-radius: 8px; font-size: 12.5px; color: var(--dim);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border);
  transition: all .2s var(--ease);
}
.btn-mini:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.btn-mini.danger:hover { color: #ff8da0; border-color: rgba(244, 81, 106, .5); background: rgba(244, 81, 106, .14); }
.btn-mini:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- 成员管理 ---------- */
.member-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px;
}
.member-card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 12px;
  transition: all .3s var(--ease); animation: cardUp .5s var(--ease) both;
  backdrop-filter: blur(10px);
}
@keyframes cardUp {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.member-card:hover {
  transform: translateY(-4px); background: var(--card-hover);
  border-color: var(--border-strong); box-shadow: 0 18px 44px rgba(0, 0, 0, .38);
}
.avatar {
  --av: #8b5cf6; width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, var(--av), color-mix(in srgb, var(--av), #000 25%));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--av), transparent 55%);
}
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.member-main { display: flex; align-items: center; gap: 14px; }
.member-main h3 { font-size: 16.5px; font-weight: 700; }
.role-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--rc, #94a3b8), transparent 84%);
  color: var(--rc, #94a3b8);
  border: 1px solid color-mix(in srgb, var(--rc, #94a3b8), transparent 65%);
}
.member-note { font-size: 13px; color: var(--dim); line-height: 1.6; min-height: 40px; }
.member-foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.joined { font-size: 12px; color: var(--faint); }
.card-actions { display: flex; gap: 8px; opacity: 0; transform: translateY(4px); transition: all .25s var(--ease); }
.member-card:hover .card-actions { opacity: 1; transform: none; }
@media (hover: none) { .card-actions { opacity: 1; transform: none; } }
.muted { color: var(--faint); }

/* ---------- 任务看板 ---------- */
.kanban { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 10px; }
.kanban-col {
  flex: 0 0 340px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); display: flex; flex-direction: column; backdrop-filter: blur(10px);
}
.col-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.col-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.c-todo { background: var(--amber); box-shadow: 0 0 10px rgba(245, 165, 36, .6); }
.c-doing { background: var(--cyan); box-shadow: 0 0 10px rgba(34, 211, 238, .6); }
.c-done { background: var(--green); box-shadow: 0 0 10px rgba(47, 212, 138, .6); }
.col-head h3 { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.col-head .count {
  margin-left: auto; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--dim);
  background: rgba(255, 255, 255, .07);
}
.col-body {
  min-height: 120px; padding: 6px 12px 14px; display: flex; flex-direction: column;
  gap: 10px; border-radius: 0 0 var(--r) var(--r); transition: background .25s;
}
.col-body.drag-over {
  background: rgba(139, 92, 246, .12);
  outline: 2px dashed rgba(139, 92, 246, .5); outline-offset: -6px; border-radius: var(--r-sm);
}
.col-empty {
  border: 1px dashed var(--border-strong); border-radius: var(--r-sm); padding: 18px;
  text-align: center; color: var(--faint); font-size: 12.5px;
}
.task-card {
  background: rgba(255, 255, 255, .055); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 15px; display: flex; flex-direction: column; gap: 8px; cursor: grab;
  transition: all .25s var(--ease); animation: cardUp .4s var(--ease) both;
}
.task-card:hover {
  border-color: var(--border-strong); background: rgba(255, 255, 255, .09); transform: translateY(-2px);
}
.task-card.dragging { opacity: .45; transform: scale(.97); border-style: dashed; }
.task-card:active { cursor: grabbing; }
.task-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.priority { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; letter-spacing: .4px; }
.p-high { background: rgba(244, 81, 106, .16); color: #ff8da0; border: 1px solid rgba(244, 81, 106, .35); }
.p-mid { background: rgba(245, 165, 36, .15); color: #ffc76e; border: 1px solid rgba(245, 165, 36, .35); }
.p-low { background: rgba(47, 212, 138, .13); color: #6fe7b4; border: 1px solid rgba(47, 212, 138, .32); }
.overdue-tag {
  font-size: 11px; font-weight: 700; color: #ff8da0;
  background: rgba(244, 81, 106, .14); padding: 2px 8px; border-radius: 999px;
  border: 1px solid rgba(244, 81, 106, .4);
}
.task-due { margin-left: auto; font-size: 12px; color: var(--faint); }
.task-title { font-size: 14.5px; font-weight: 700; line-height: 1.4; }
.task-desc {
  font-size: 12.5px; color: var(--dim); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.assignee { display: inline-flex; align-items: center; gap: 8px; }
.assignee .avatar { width: 24px; height: 24px; font-size: 10px; }
.assignee em { font-style: normal; font-size: 12.5px; color: var(--dim); }
.task-move { display: flex; gap: 6px; }

/* ---------- 数据总览 ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; display: flex; align-items: center; gap: 14px; backdrop-filter: blur(10px);
  transition: all .3s var(--ease);
}
.stat-card:hover {
  transform: translateY(-3px); border-color: var(--border-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}
.stat-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; flex: none; }
.i1 { background: rgba(139, 92, 246, .16); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .35); }
.i2 { background: rgba(34, 211, 238, .13); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .35); }
.i3 { background: rgba(245, 165, 36, .14); box-shadow: inset 0 0 0 1px rgba(245, 165, 36, .35); }
.i4 { background: rgba(47, 212, 138, .13); box-shadow: inset 0 0 0 1px rgba(47, 212, 138, .35); }
.stat-card b { font-size: 26px; font-weight: 800; line-height: 1.1; display: block; }
.stat-card > div > span { font-size: 12.5px; color: var(--dim); }

.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px; backdrop-filter: blur(10px);
}
.panel.wide { grid-column: 1 / -1; }
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.panel-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }

.donut-wrap { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.donut {
  width: 150px; height: 150px; border-radius: 50%; position: relative; flex: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.donut-hole {
  position: absolute; inset: 26px; border-radius: 50%; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.donut-hole b { font-size: 24px; font-weight: 800; }
.donut-hole span { font-size: 11px; color: var(--faint); }
.legend { list-style: none; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--dim); }
.legend-dot { width: 10px; height: 10px; border-radius: 4px; background: var(--lc); flex: none; }
.legend b { margin-left: auto; color: var(--text); font-size: 14px; }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 28px; align-items: center; gap: 12px; }
.bar-label { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.bar-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; transition: width .8s var(--ease); }
.bar-row b { text-align: right; font-size: 14px; }

.load-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.load-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border);
}
.load-info { flex: 1; min-width: 0; }
.load-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; }
.load-head b { font-weight: 600; }
.load-head span { color: var(--faint); font-size: 11.5px; }
.load-track { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.load-track i { display: block; height: 100%; border-radius: 99px; transition: width .8s var(--ease); }

/* ---------- 空状态 ---------- */
.empty-state {
  grid-column: 1 / -1; border: 1.5px dashed var(--border-strong); border-radius: var(--r);
  padding: 56px 20px; text-align: center; color: var(--dim); font-size: 14px;
  background: rgba(255, 255, 255, .02);
}
.empty-ico { font-size: 40px; margin-bottom: 12px; opacity: .8; }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(5, 7, 16, .62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity .28s var(--ease);
}
.modal-backdrop.open { opacity: 1; }
.modal {
  width: 100%; max-width: 520px; max-height: 86vh; overflow: auto;
  background: linear-gradient(160deg, rgba(30, 33, 58, .96), rgba(18, 20, 38, .96));
  border: 1px solid var(--border-strong); border-radius: 20px; padding: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  transform: translateY(18px) scale(.96); opacity: 0;
  transition: all .3s var(--ease);
}
.modal-backdrop.open .modal { transform: none; opacity: 1; }
.modal-title { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.modal-text { color: var(--dim); font-size: 14px; margin-bottom: 20px; }
.modal-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--dim); letter-spacing: .3px; }
.field input, .field select, .field textarea {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--border); border-radius: 11px;
  padding: 10px 13px; font-size: 14px; transition: all .25s var(--ease); width: 100%;
}
.field select option { background: #171a30; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .22);
  background: rgba(255, 255, 255, .08);
}
.field textarea { resize: vertical; min-height: 70px; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

.task-detail { display: flex; flex-direction: column; gap: 14px; }
.detail-top { display: flex; align-items: center; gap: 10px; }
.status-pill {
  font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--sc), transparent 84%); color: var(--sc);
  border: 1px solid color-mix(in srgb, var(--sc), transparent 60%);
}
.detail-desc {
  color: var(--dim); font-size: 14px; background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.detail-meta { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; }
.detail-row span { color: var(--faint); }
.detail-row b { font-weight: 600; text-align: right; }

/* ---------- 提示 ---------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 320px;
  background: rgba(24, 27, 48, .92); border: 1px solid var(--border-strong); border-radius: 13px;
  padding: 12px 16px; font-size: 13.5px; color: var(--text);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5); backdrop-filter: blur(12px);
  transform: translateX(24px); opacity: 0; transition: all .3s var(--ease);
}
.toast.show { transform: none; opacity: 1; }
.toast-ico {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; flex: none; font-weight: 700;
}
.toast.ok .toast-ico { background: rgba(47, 212, 138, .18); color: #6fe7b4; }
.toast.err .toast-ico { background: rgba(244, 81, 106, .18); color: #ff8da0; }
.toast.warn .toast-ico { background: rgba(245, 165, 36, .18); color: #ffc76e; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .panel.wide { grid-column: auto; }
}
@media (max-width: 720px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: stretch; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn { flex: 1; padding: 7px 10px; font-size: 13px; }
  .content { padding: 24px 16px 90px; }
  .view-head h2 { font-size: 22px; }
  .member-grid { grid-template-columns: 1fr; }
  .kanban { gap: 12px; margin: 0 -4px; padding: 4px; }
  .kanban-col { flex: 0 0 80vw; }
  .field-row { grid-template-columns: 1fr; }
  .modal { padding: 20px; }
  .toasts { right: 14px; bottom: 14px; left: 14px; }
  .toast { width: 100%; }
  .donut-wrap { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
