/* ============================================================================
   青训营项目管理系统 · 完整视觉设计系统 v2（纯前端叠加层，不改数据与业务结构）
   设计目标：饱满、统一、高级的教培产品感。仅作用于颜色/背景/阴影/圆角/排版/
   空间节奏与呈现方式，不修改任何业务数据、模块名称与交互逻辑。
   路由作用域由增强脚本挂在 body 上：qx-route-login / select / projects / inside
============================================================================ */
:root {
  --qx-brand-1: #6366f1;
  --qx-brand-2: #7c3aed;
  --qx-brand-grad: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  --qx-blue: #3b82f6;
  --qx-emerald: #10b981;
  --qx-teal: #0d9488;
  --qx-ink: #0f172a;
  --qx-ink-2: #334155;
  --qx-muted: #64748b;
  --qx-line: #e6e9f2;
  --qx-shadow-sm: 0 1px 2px rgba(16, 24, 64, .05), 0 8px 22px rgba(16, 24, 64, .06);
  --qx-shadow-md: 0 4px 10px rgba(16, 24, 64, .07), 0 18px 40px rgba(16, 24, 64, .12);
  --qx-shadow-brand: 0 10px 26px rgba(99, 102, 241, .32);
  --qx-radius: 18px;
}

/* ====== 全局背景：淡彩光晕 + 极淡点阵，衬托毛玻璃 ====== */
body, body.bg-gray-50 {
  background-color: #f3f5fc !important;
  background-image:
    radial-gradient(1200px 620px at 86% -10%, rgba(99, 102, 241, .14), transparent 60%),
    radial-gradient(960px 560px at -10% 108%, rgba(124, 58, 237, .12), transparent 62%),
    radial-gradient(700px 420px at 50% 116%, rgba(16, 185, 129, .08), transparent 60%),
    radial-gradient(rgba(99, 102, 241, .05) 1px, transparent 1px) !important;
  background-size: auto, auto, auto, 22px 22px !important;
  background-attachment: fixed, fixed, fixed, fixed !important;
  color: var(--qx-ink) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .section-title { color: var(--qx-ink) !important; letter-spacing: .01em; }

/* ====== 通用毛玻璃顶栏 ====== */
#root > div > div.bg-white.border-b,
header.bg-white {
  background: rgba(255, 255, 255, .96) !important;
  border-bottom: 1px solid rgba(226, 232, 240, .85) !important;
  box-shadow: 0 2px 18px rgba(16, 24, 64, .04);
  z-index: 20;
}
#root > div > div.bg-white.border-b h1 { font-weight: 800 !important; letter-spacing: .02em; }
/* 顶栏角色文字做成胶囊 */
#root > div > div.bg-white.border-b span.text-gray-500 {
  background: rgba(99, 102, 241, .1);
  color: #4338ca !important;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12.5px;
}

/* ============================================================================
   登录页
============================================================================ */
body.qx-route-login #root > div {
  background:
    radial-gradient(900px 480px at 18% 12%, rgba(99, 102, 241, .18), transparent 60%),
    radial-gradient(820px 520px at 88% 92%, rgba(16, 185, 129, .14), transparent 62%),
    linear-gradient(160deg, #eef1ff 0%, #f6f4ff 48%, #eefaf5 100%) !important;
}
body.qx-route-login .card.max-w-sm {
  max-width: 420px !important;
  width: calc(100% - 40px);
  padding: 42px 40px 36px !important;
  border-radius: 26px !important;
  border: 1px solid rgba(226, 232, 240, .9) !important;
  background: #ffffff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: 0 30px 70px -20px rgba(79, 70, 229, .38), 0 8px 24px rgba(16, 24, 64, .1) !important;
  position: relative;
  overflow: hidden;
}
body.qx-route-login .card.max-w-sm::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: var(--qx-brand-grad);
}
body.qx-route-login h1 {
  font-size: 25px !important;
  font-weight: 800 !important;
  margin-bottom: 6px !important;
  color: #4338ca !important;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  body.qx-route-login h1,
  #qx-select-hero .qx-hero-title,
  .stat-card .stat-value, .stat-card .kpi-number,
  .stat-card .text-3xl, .stat-card .text-4xl {
    background: linear-gradient(120deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
  }
  #qx-select-hero .qx-hero-title {
    background: linear-gradient(120deg, #1e1b4b 0%, #4f46e5 52%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}
body.qx-route-login label.text-sm { color: var(--qx-ink-2) !important; font-weight: 600; }
body.qx-route-login .input { padding: .72rem .95rem !important; font-size: 15px !important; }
body.qx-route-login form button[type="submit"],
body.qx-route-login form .btn-primary { width: 100%; padding: .8rem !important; font-size: 15px !important; margin-top: 4px; }

/* ============================================================================
   系统选择页 /select —— 饱满品牌化重塑
============================================================================ */
body.qx-route-select #root > div { background: transparent !important; }
body.qx-route-select #root > div > div.flex.items-center.justify-center {
  min-height: calc(100vh - 70px);
  padding: 196px 24px 96px;
  box-sizing: border-box;
  align-items: center;
}
body.qx-route-select .grid.grid-cols-2.max-w-2xl {
  max-width: none !important;
  width: min(1140px, 94vw);
  gap: clamp(22px, 3.2vw, 40px);
  align-items: stretch;
}
/* 入口大卡 */
body.qx-route-select .grid > button.card {
  padding: 0 !important;
  min-height: 270px;
  border-radius: 26px !important;
  border: 1px solid rgba(226, 232, 240, .9) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--qx-shadow-sm) !important;
}
body.qx-route-select .grid > button.card::after {
  content: "进入系统  →";
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 7px 18px;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
  transition: transform .22s ease, opacity .22s ease;
}
body.qx-route-select .grid > button.card:hover {
  transform: translateY(-7px);
  box-shadow: var(--qx-shadow-md) !important;
}
body.qx-route-select .grid > button.card:hover::after { transform: translateX(-50%) scale(1.05); }
/* 大图标底座 */
body.qx-route-select .grid > button.card .text-5xl {
  width: 96px; height: 96px;
  display: flex !important;
  align-items: center; justify-content: center;
  font-size: 46px !important;
  line-height: 1;
  border-radius: 26px;
  margin-bottom: 18px !important;
  box-shadow: 0 10px 24px rgba(16, 24, 64, .1);
  position: relative;
}
body.qx-route-select .grid > button.card h2 {
  font-size: clamp(21px, 2.1vw, 27px) !important;
  font-weight: 800 !important;
  margin-bottom: 8px !important;
}
body.qx-route-select .grid > button.card p {
  font-size: 14.5px !important;
  color: var(--qx-muted) !important;
  max-width: 80%;
  line-height: 1.6;
  padding-bottom: 30px;
}
/* 卡 1：靛蓝 */
body.qx-route-select .grid > button.card:nth-child(1) { border-top: 4px solid transparent; }
body.qx-route-select .grid > button.card:nth-child(1) .text-5xl {
  background: linear-gradient(145deg, #eef0ff, #e2e5ff);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .22), 0 10px 24px rgba(99, 102, 241, .16);
}
body.qx-route-select .grid > button.card:nth-child(1)::before {
  content: ""; position: absolute; top: -90px; right: -70px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.18), transparent 70%);
}
body.qx-route-select .grid > button.card:nth-child(1)::after { background: linear-gradient(135deg, #6366f1, #4f46e5); }
body.qx-route-select .grid > button.card:nth-child(1):hover { border-color: rgba(99,102,241,.45) !important; }
/* 卡 2：翠绿 */
body.qx-route-select .grid > button.card:nth-child(2) .text-5xl {
  background: linear-gradient(145deg, #ecfdf5, #d6f6ea);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .24), 0 10px 24px rgba(16, 185, 129, .16);
}
body.qx-route-select .grid > button.card:nth-child(2)::before {
  content: ""; position: absolute; top: -90px; right: -70px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,.18), transparent 70%);
}
body.qx-route-select .grid > button.card:nth-child(2)::after { background: linear-gradient(135deg, #10b981, #0d9488); }
body.qx-route-select .grid > button.card:nth-child(2):hover { border-color: rgba(16,185,129,.45) !important; }
/* 外挂品牌 hero / 页脚（脚本挂到 body 下 #root 之外） */
#qx-select-hero {
  position: fixed;
  top: clamp(78px, 12vh, 118px);
  left: 0; right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  padding: 0 20px;
}
#qx-select-hero .qx-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .14em;
  color: #4f46e5;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  padding: 6px 16px; border-radius: 999px;
  margin-bottom: 18px;
}
#qx-select-hero .qx-hero-title {
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1.15;
  color: #1e1b4b;
  margin: 0 0 14px;
}
#qx-select-hero .qx-hero-sub {
  font-size: clamp(14px, 1.5vw, 17px);
  color: var(--qx-muted);
  margin: 0; letter-spacing: .02em;
}
#qx-select-foot {
  position: fixed; left: 0; right: 0; bottom: 26px;
  text-align: center; pointer-events: none; z-index: 5;
  font-size: 12.5px; color: #94a3b8; letter-spacing: .03em;
}
#qx-select-foot .qx-dot { color: #c7d2fe; margin: 0 9px; }

/* ============================================================================
   项目列表 /projects
============================================================================ */
body.qx-route-projects .max-w-4xl { max-width: 1180px !important; }
body.qx-route-projects .grid.grid-cols-2 { gap: 20px; }
body.qx-route-projects .grid > .card {
  border-radius: 18px !important;
  padding: 22px 24px !important;
  position: relative; overflow: hidden;
}
body.qx-route-projects .grid > .card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--qx-brand-grad);
  opacity: 0; transition: opacity .2s ease;
}
body.qx-route-projects .grid > .card:hover::before { opacity: 1; }
body.qx-route-projects .grid > .card h3 { font-size: 17px !important; font-weight: 800 !important; }
body.qx-route-projects .grid > .card a.block { position: relative; z-index: 1; }

/* ============================================================================
   项目内框架（aside + main）—— 撑满、节奏统一
============================================================================ */
aside.w-48 {
  background: rgba(255, 255, 255, .97) !important;
  border-right: 1px solid rgba(226, 232, 240, .9) !important;
  box-shadow: 4px 0 24px rgba(16, 24, 64, .05);
}
aside.w-48 > div.p-3 { background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(124,58,237,.06)); }
aside.w-48 button { transition: background-color .18s ease, color .18s ease !important; }
aside.w-48 button:hover { background-color: rgba(99, 102, 241, .08) !important; color: #4338ca !important; }
aside.w-48 button.bg-blue-50.text-blue-700,
aside.w-48 button.border-blue-600 {
  background-image: linear-gradient(135deg, var(--qx-brand-1) 0%, var(--qx-brand-2) 100%) !important;
  background-color: transparent !important;
  color: #fff !important;
  border-right-color: transparent !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 1px rgba(76, 29, 149, .18);
}
/* 主内容容器撑满、合理上限居中 */
main.flex-1 > div.p-6 {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  box-sizing: border-box;
}
main.flex-1 .max-w-sm, main.flex-1 .max-w-md, main.flex-1 .max-w-lg,
main.flex-1 .max-w-xl, main.flex-1 .max-w-2xl, main.flex-1 .max-w-3xl,
main.flex-1 .max-w-4xl { max-width: 100% !important; }
/* 弹窗保持原有窄宽度，不被上一条拉满 */
.fixed.inset-0 .max-w-sm { max-width: 24rem !important; }
.fixed.inset-0 .max-w-md { max-width: 28rem !important; }
.fixed.inset-0 .max-w-lg { max-width: 32rem !important; }
.fixed.inset-0 .max-w-xl { max-width: 36rem !important; }
/* 面包屑 */
main.flex-1 > div.text-sm { font-weight: 500; }
main.flex-1 > div.text-sm a { color: var(--qx-brand-1); }
/* 让网格与表格填满，消除右侧空洞 */
main.flex-1 .grid { width: 100%; }
main.flex-1 table { width: 100% !important; }

/* ====== 卡片（近实色白底，不依赖毛玻璃合成，全环境可靠渲染） ====== */
.card, .stat-card {
  border-radius: var(--qx-radius) !important;
  border: 1px solid rgba(226, 232, 240, .85) !important;
  background: #ffffff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: var(--qx-shadow-sm) !important;
  transition: transform .22s cubic-bezier(.22,.7,.3,1), box-shadow .22s ease, border-color .22s ease !important;
}
.card:hover, .stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, .26) !important;
  box-shadow: var(--qx-shadow-md) !important;
}

/* ====== KPI 指标卡：顶部渐变条 + 渐变数字 ====== */
.stat-card { position: relative; overflow: hidden; padding: 20px !important; }
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--qx-brand-grad);
  opacity: .9;
}
.stat-card .stat-value, .stat-card .kpi-number, .stat-card .text-3xl, .stat-card .text-4xl {
  color: #4338ca !important;
}
.stat-card .stat-label { font-weight: 600; letter-spacing: .02em; }

/* ====== 裸表格卡片化（未被 .card 包裹的 table） ====== */
main.flex-1 table {
  border-collapse: separate !important;
  border-spacing: 0;
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, .9) !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: var(--qx-shadow-sm);
}
/* 表格头部与行 */
.table-light thead th, main.flex-1 table thead th {
  background: linear-gradient(180deg, #eef0ff 0%, #f6f7ff 100%) !important;
  color: #4338ca !important;
  text-transform: none !important;
  letter-spacing: .02em !important;
  font-weight: 600 !important;
  padding: .85rem 1rem !important;
  border-bottom: 1px solid #e3e7fb !important;
  white-space: nowrap;
}
.table-light thead th:first-child, main.flex-1 table thead th:first-child { border-top-left-radius: 14px; }
.table-light thead th:last-child, main.flex-1 table thead th:last-child { border-top-right-radius: 14px; }
.table-light tbody td, main.flex-1 table tbody td {
  padding: .78rem 1rem !important;
  border-bottom: 1px solid #f1f3f9 !important;
}
.table-light tbody tr, main.flex-1 table tbody tr { transition: background-color .15s ease; }
.table-light tbody tr:hover, main.flex-1 table tbody tr:hover { background-color: rgba(99, 102, 241, .06) !important; }
.table-light tbody tr:last-child td, main.flex-1 table tbody tr:last-child td { border-bottom: none !important; }

/* ====== 标签页（Day / 会场等） ====== */
.flex.gap-1.border-b button, .border-b button { border-radius: 10px 10px 0 0; }

/* ====== 徽章 ====== */
.badge {
  padding: .24rem .72rem !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}

/* ====== 按钮 ====== */
.btn { border-radius: 11px !important; font-weight: 600 !important; transition: all .2s cubic-bezier(.22,.7,.3,1) !important; }
.btn-primary {
  background: var(--qx-brand-grad) !important;
  box-shadow: 0 8px 18px rgba(99, 102, 241, .30) !important;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #5457e5, #6d28d9) !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(99, 102, 241, .40) !important;
}
.btn-success { box-shadow: 0 8px 16px rgba(5, 150, 105, .24) !important; }
.btn-danger { box-shadow: 0 8px 16px rgba(220, 38, 38, .22) !important; }
.btn-ghost { background: rgba(241,243,249,.9) !important; color: #475569 !important; }
.btn-ghost:hover { background: #e7eaf4 !important; }
.btn-outline { border-radius: 11px !important; }
.btn-outline:hover { border-color: var(--qx-brand-1) !important; color: var(--qx-brand-1) !important; background: rgba(99,102,241,.05) !important; }

/* ====== 输入 / 下拉 / 文本域 ====== */
.input, input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  border-radius: 11px !important;
}
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--qx-brand-1) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .16) !important;
  outline: none !important;
}

/* ====== 弹窗 / 通知（实色兜底，不依赖毛玻璃） ====== */
.fixed.inset-0 > div { border-radius: 20px !important; overflow: hidden; }
.fixed.inset-0 .bg-white {
  background: #ffffff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: 0 30px 80px -20px rgba(16, 24, 64, .45) !important;
}
.toast-box {
  background: #ffffff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ====== 链接 / 进度条细节 ====== */
.link { color: var(--qx-brand-1) !important; }

/* ====== 滚动条 ====== */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8cde0; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9b0cc; background-clip: content-box; }

/* ============================================================================
   账号管理 · 角色分组筛选条
============================================================================ */
#qx-role-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 0 0 16px; padding: 14px 16px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 16px; box-shadow: var(--qx-shadow-sm);
}
#qx-role-bar .qx-role-title { font-size: 13px; font-weight: 600; color: var(--qx-muted); margin-right: 4px; letter-spacing: .02em; }
.qx-role-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--qx-line); background: #fff; color: #475569;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .18s cubic-bezier(.22,.7,.3,1); user-select: none;
}
.qx-role-chip:hover { border-color: var(--qx-brand-1); color: var(--qx-brand-1); transform: translateY(-1px); }
.qx-role-chip .qx-role-count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: #eef0f7; color: #64748b; font-size: 12px; font-weight: 700;
  text-align: center; font-variant-numeric: tabular-nums;
}
.qx-role-chip.qx-active {
  background: var(--qx-brand-grad); border-color: transparent; color: #fff;
  box-shadow: 0 7px 16px rgba(99, 102, 241, .34);
}
.qx-role-chip.qx-active .qx-role-count { background: rgba(255,255,255,.25); color: #fff; }
.qx-role-empty-tip { width: 100%; text-align: center; color: #94a3b8; font-size: 13px; padding: 6px 0 2px; }

/* ============================================================================
   响应式（≤ 桌面宽时保证不溢出、单列可读）
============================================================================ */
@media (max-width: 900px) {
  main.flex-1 .grid.grid-cols-4, main.flex-1 .grid.grid-cols-5, main.flex-1 .grid.grid-cols-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 760px) {
  body.qx-route-select #root > div > div.flex.items-center.justify-center { padding: 150px 16px 72px; }
  body.qx-route-select .grid.grid-cols-2 { grid-template-columns: 1fr !important; width: 100%; }
  body.qx-route-projects .grid.grid-cols-2 { grid-template-columns: 1fr !important; }
  main.flex-1 > div.p-6 { padding: 1rem !important; }
  #qx-role-bar { gap: 8px; padding: 12px; }
  .qx-role-chip { padding: 6px 12px; font-size: 12px; }

  /* 顶栏 / 页头：窄屏纵向排布，按钮换行，不再挤压标题 */
  #root > div > div.bg-white.border-b { padding: 12px 16px !important; flex-wrap: wrap; row-gap: 10px; }
  #root > div > div.bg-white.border-b h1 { font-size: 15px !important; white-space: normal; }
  #root > div > div.bg-white.border-b > div { flex-wrap: wrap; row-gap: 8px; gap: 8px !important; }
  #root .flex.items-center.justify-between.mb-8 {
    flex-direction: column !important; align-items: stretch !important; gap: 14px;
  }
  #root .flex.items-center.justify-between.mb-8 h1 { font-size: 20px !important; line-height: 1.35; white-space: normal; }
  #root .flex.items-center.justify-between.mb-8 > div { flex-wrap: wrap; row-gap: 8px; }

  /* 系统选择入口卡：内容顶部排列，给底部胶囊留出独立空间，杜绝重叠 */
  body.qx-route-select .grid > button.card {
    min-height: 0 !important;
    padding: 30px 20px 22px !important;
    justify-content: flex-start !important;
    gap: 4px;
  }
  body.qx-route-select .grid > button.card .text-5xl {
    width: 72px !important; height: 72px !important;
    font-size: 34px !important; border-radius: 20px;
    margin-bottom: 12px !important;
  }
  body.qx-route-select .grid > button.card h2 { margin-bottom: 4px !important; }
  body.qx-route-select .grid > button.card p { max-width: 92%; padding-bottom: 54px !important; }
  body.qx-route-select .grid > button.card::after { bottom: 18px; }
}
@media (max-width: 480px) {
  main.flex-1 .grid.grid-cols-3, main.flex-1 .grid.grid-cols-4, main.flex-1 .grid.grid-cols-5 {
    grid-template-columns: 1fr !important;
  }
}
