/* =====================================================
   职业规划大赛评分系统 - 管理后台通用样式
   参考"用户中心"模板：蓝白配色、圆角卡片、简洁扁平
   ===================================================== */
:root {
  --primary: #1677ff;
  --primary-dark: #125fd9;
  --primary-light: #ecf3ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #f43f5e;
  --text: #303133;
  --text-sub: #909399;
  --border: #e4e7ed;
  --bg: #f5f7fa;
  --card-shadow: 0 2px 12px rgba(22, 119, 255, .08);

  /* Element Plus 主题联动：主色与功能色全部同步为企业蓝四色系，避免两套色 */
  --el-color-primary: #1677ff;
  --el-color-primary-light-3: #4693ff;
  --el-color-primary-light-5: #80b8ff;
  --el-color-primary-light-7: #bad6ff;
  --el-color-primary-light-8: #d5e6ff;
  --el-color-primary-light-9: #ecf3ff;
  --el-color-primary-dark-2: #125fd9;
  --el-color-success: #10b981;
  --el-color-success-light-3: #4dc49a;
  --el-color-success-light-5: #7fd6bb;
  --el-color-success-light-7: #b2e8d5;
  --el-color-success-light-8: #cbefe0;
  --el-color-success-light-9: #e7f8f1;
  --el-color-success-dark-2: #0d9467;
  --el-color-warning: #f59e0b;
  --el-color-warning-light-3: #f7b54c;
  --el-color-warning-light-5: #fbcf85;
  --el-color-warning-light-7: #fde3c2;
  --el-color-warning-light-8: #fee9d3;
  --el-color-warning-light-9: #fff4e6;
  --el-color-warning-dark-2: #c67e09;
  --el-color-danger: #f43f5e;
  --el-color-danger-light-3: #f7728b;
  --el-color-danger-light-5: #fa9faf;
  --el-color-danger-light-7: #fcc8d2;
  --el-color-danger-light-8: #fdd8de;
  --el-color-danger-light-9: #feecef;
  --el-color-danger-dark-2: #c3324b;
  --el-color-error: #f43f5e;
  --el-color-error-light-3: #f7728b;
  --el-color-error-light-5: #fa9faf;
  --el-color-error-light-7: #fcc8d2;
  --el-color-error-light-8: #fdd8de;
  --el-color-error-light-9: #feecef;
  --el-color-error-dark-2: #c3324b;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

/* ---------- 整体布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar .logo {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  letter-spacing: 1px;
}
.sidebar .logo .dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, #1677ff, #3d8bff);
  margin-right: 10px;
  display: inline-block;
}
.menu { flex: 1; padding: 14px 10px; overflow-y: auto; }
.menu a {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .25s;
}
.menu a:hover { background: var(--primary-light); color: var(--primary); }
.menu a.active {
  background: linear-gradient(135deg, #1677ff, #3d8bff);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(22, 119, 255, .35);
}
.menu .menu-group {
  font-size: 12px;
  color: var(--text-sub);
  padding: 14px 14px 6px;
}
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-footer .user { color: var(--text-sub); font-size: 13px; }
.sidebar-footer .user b { color: var(--text); font-weight: 600; }

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 99;
}
.topbar .page-title { font-size: 17px; font-weight: 600; animation: pageTitleIn .4s ease both; }
.topbar .top-actions { display: flex; align-items: center; gap: 14px; color: var(--text-sub); font-size: 13px; }
.content { padding: 20px 28px 40px; flex: 1; animation: pageIn .45s cubic-bezier(.22, 1, .36, 1) both; }

/* 页面切换过渡：内容区淡入上移，标题左侧滑入 */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pageTitleIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
/* 卡片与竞赛条目跟随入场，形成层次感 */
.content .card,
.content .contest-item,
.content .stat-grid {
  animation: pageIn .5s cubic-bezier(.22, 1, .36, 1) both;
}
.content .card:nth-child(2),
.content .contest-item:nth-child(2) { animation-delay: .06s; }
.content .card:nth-child(3),
.content .contest-item:nth-child(3) { animation-delay: .12s; }
.content .card:nth-child(4) { animation-delay: .18s; }

/* ---------- 通用卡片 ---------- */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; }
.card-title::before {
  content: "";
  width: 4px; height: 16px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 8px;
}

/* ---------- 竞赛列表（自定义展开动画） ---------- */
.contest-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow .3s;
}
.contest-item:hover { box-shadow: 0 6px 20px rgba(22, 119, 255, .15); }
.contest-head {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  gap: 14px;
}
.chevron {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .45s cubic-bezier(.22, 1.2, .36, 1);
}
.chevron::before {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(-45deg) translate(-1px, -1px);
}
.contest-item.open .chevron { transform: rotate(90deg); background: var(--primary); }
.contest-item.open .chevron::before { border-color: #fff; }
.contest-name { font-size: 15px; font-weight: 600; }
.contest-meta { display: flex; gap: 22px; color: var(--text-sub); font-size: 13px; flex-wrap: wrap; }
.contest-head-actions { margin-left: auto; display: flex; gap: 8px; }

/* 展开区域：grid-rows 动画，丝滑符合物理惯性 */
.fold {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .5s cubic-bezier(.22, 1, .3, 1);
}
.fold.open { grid-template-rows: 1fr; }
.fold > .fold-inner { overflow: hidden; min-height: 0; }
.module-panel {
  margin: 0 20px 18px;
  padding: 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f6ff, #ecf3ff);
  border: 1px solid #d5e6ff;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .4s ease .08s, transform .45s cubic-bezier(.22, 1, .36, 1) .08s;
}
.contest-item.open .module-panel { opacity: 1; transform: translateY(0); }
.module-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.module-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: all .3s;
}
.module-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #3d8bff);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(22, 119, 255, .35);
  transform: translateY(-2px);
}
.module-btn .en { font-size: 12px; color: var(--text-sub); }
.module-btn:hover .en { color: rgba(255,255,255,.85); }

/* ---------- 首页看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.stat-card .num { font-size: 30px; font-weight: 700; line-height: 1.2; }
.stat-card .label { opacity: .9; margin-top: 4px; font-size: 13px; }
.stat-card .deco {
  position: absolute; right: -14px; bottom: -18px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.stat-card .deco::after {
  content: ""; position: absolute; right: 22px; top: 22px;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.bg-blue { background: linear-gradient(135deg, #1677ff, #3d8bff); }
.bg-green { background: linear-gradient(135deg, #10b981, #34d399); }
.bg-orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.bg-red { background: linear-gradient(135deg, #f43f5e, #fb7185); }

/* ---------- 展示页（大屏 / 排行榜） ---------- */
.screen-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #0d1b3d 0%, #10275e 45%, #0a1530 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.screen-page.has-bg { background-size: cover; background-position: center; }
.screen-header {
  text-align: center;
  padding: 26px 20px 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}
.screen-sub { text-align: center; color: #9db6e8; padding-bottom: 6px; font-size: 14px; letter-spacing: 2px; }
.current-player {
  margin: 18px auto 8px;
  text-align: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  padding: 22px 60px;
  backdrop-filter: blur(6px);
  transition: all .6s cubic-bezier(.22, 1, .36, 1);
}
.current-player .no { font-size: 74px; font-weight: 800; line-height: 1; color: #ffd66b; }
.current-player .no small { font-size: 26px; font-weight: 600; margin-right: 8px; color: #ffe7a3; }
.current-player .track {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1677ff, #3d8bff);
  font-size: 20px;
  letter-spacing: 2px;
}
.judge-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 20px 40px;
}
.judge-card {
  width: 170px;
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: all .5s cubic-bezier(.22, 1, .36, 1);
}
.judge-card .j-name { font-size: 18px; font-weight: 600; }
.judge-card .j-code { font-size: 13px; color: #9db6e8; margin-top: 2px; }
.judge-card .j-state { margin-top: 10px; font-size: 14px; color: #8ea6d8; }
.judge-card.submitted { background: rgba(47, 191, 113, .16); border-color: rgba(47, 191, 113, .5); }
.judge-card.submitted .j-state { color: #6fe3a5; font-weight: 600; }
.judge-card .j-score { font-size: 26px; font-weight: 700; color: #6fe3a5; margin-top: 4px; }
.final-score-wrap {
  text-align: center;
  padding: 8px 20px 46px;
}
.final-score {
  display: inline-block;
  font-size: 96px;
  font-weight: 800;
  color: #ffd66b;
  text-shadow: 0 4px 30px rgba(255, 214, 107, .35);
  animation: scorePop .9s cubic-bezier(.18, 1.25, .4, 1);
}
@keyframes scorePop {
  0% { opacity: 0; transform: scale(.3); }
  60% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
.screen-empty { text-align: center; color: #8ea6d8; padding: 70px 20px; font-size: 18px; letter-spacing: 2px; }

/* 排行榜 */
.rank-columns { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 40px 50px; justify-content: center; }
.rank-col {
  flex: 1;
  min-width: 320px;
  max-width: 560px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(6px);
}
.rank-col-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.rank-row {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, .05);
  transition: all .5s cubic-bezier(.22, 1, .36, 1);
}
.rank-row .r-rank { width: 46px; font-size: 18px; font-weight: 700; color: #9db6e8; }
.rank-row.top1 .r-rank { color: #ffd66b; }
.rank-row.top2 .r-rank { color: #d8e3ff; }
.rank-row.top3 .r-rank { color: #ffb08c; }
.rank-row .r-no { width: 56px; color: #9db6e8; font-size: 14px; }
.rank-row .r-name { flex: 1; font-size: 17px; font-weight: 600; }
.rank-row .r-score { font-size: 20px; font-weight: 700; color: #6fe3a5; }
.roadshow-bar {
  margin: 10px auto 4px;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 214, 107, .12);
  border: 1px solid rgba(255, 214, 107, .45);
  border-radius: 14px;
  padding: 10px 28px;
  font-size: 17px;
}
.roadshow-bar .tag { color: #ffd66b; font-weight: 700; letter-spacing: 2px; }

/* 密码遮罩 */
.pwd-mask {
  position: fixed; inset: 0;
  background: rgba(8, 15, 35, .92);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.pwd-box {
  background: #fff;
  border-radius: 16px;
  padding: 34px 40px;
  width: 360px;
  text-align: center;
}
.pwd-box h3 { margin: 0 0 6px; color: var(--text); }
.pwd-box p { color: var(--text-sub); font-size: 13px; margin: 0 0 18px; }

/* ---------- 展示文件按钮 ---------- */
.file-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 通用小工具 ---------- */
.muted { color: var(--text-sub); font-size: 12px; }
.mb10 { margin-bottom: 10px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.el-table { --el-table-header-bg-color: #f5f7fa; --el-table-header-text-color: #303133; }
.el-table th.el-table__cell { font-weight: 600; }
.dialog-footer-center { text-align: center; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
