/* 车间大屏看板:Dark Mode(OLED)高级深色风,1920x1080(16:9)铺满整屏 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-0: #04060f;
  --bg-1: #0a1024;
  --panel-1: rgba(20, 32, 66, 0.55);
  --panel-2: rgba(12, 20, 44, 0.35);
  --line: rgba(120, 170, 255, 0.16);
  --line-strong: rgba(120, 190, 255, 0.4);
  --text: #eaf2ff;
  --text-dim: #8ba1c8;
  --text-faint: #5a6b8c;
  --cyan: #2ee6ff;
  --green: #34f5b0;
  --amber: #ffd24a;
  --red: #ff6b6b;
  --blue: #4aa8ff;
  --purple: #a78bfa;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  overflow: hidden;
}

/* 数字统一用等宽对齐,科技感更强 */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#board {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  padding: 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background:
    radial-gradient(1400px 760px at 50% -12%, rgba(46, 230, 255, 0.1), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(167, 139, 250, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

/* 背景动态网格 */
#board::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 170, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 40%, transparent 100%);
  animation: gridDrift 24s linear infinite;
  pointer-events: none;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

/* ===== 顶部信息条 ===== */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  padding-bottom: 12px;
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.top-title {
  text-align: center;
}

.top-title h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(90deg, #7fdcff, #ffffff 45%, #a78bfa 80%, #7fdcff);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(46, 230, 255, 0.35));
  animation: titleSheen 8s linear infinite;
}

@keyframes titleSheen {
  to { background-position: 220% center; }
}

.top-sub {
  margin-top: 6px;
  font-size: 19px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.top-side {
  display: flex;
  gap: 26px;
  min-width: 600px;
}

/* 给左上角"看板切换"按钮让出空间,避免与班长/班组信息重叠 */
#topLeft {
  padding-left: 165px;
}

.top-right {
  justify-content: flex-end;
  /* 给右上角班组下拉让出空间 */
  padding-right: 150px;
}

/* 班组下拉选择器(右上角) */
.group-select {
  position: absolute;
  top: 26px;
  right: 32px;
  z-index: 20;
  padding: 8px 34px 8px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: rgba(46, 230, 255, 0.08)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%232ee6ff' stroke-width='1.6'/></svg>")
    no-repeat right 14px center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
}

.group-select:hover {
  background-color: rgba(46, 230, 255, 0.16);
  box-shadow: 0 0 16px rgba(46, 230, 255, 0.25);
}

.group-select option {
  background: #0e1838;
  color: var(--text);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-item .label {
  font-size: 15px;
  color: var(--text-faint);
  letter-spacing: 1px;
}

.info-item .value {
  font-size: 23px;
  font-weight: 600;
  color: var(--text);
}

/* ===== 通用面板/卡片 ===== */
.kpi-card,
.panel {
  position: relative;
  background: linear-gradient(160deg, var(--panel-1), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 36px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

/* 卡片顶部高光描边 */
.kpi-card::before,
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.kpi-card:hover,
.panel:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(46, 230, 255, 0.18),
    0 0 40px rgba(46, 230, 255, 0.12);
}

/* 点击提示角标 */
.kpi-card::after,
.panel .zoom-hint {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.kpi-card::after {
  content: '点击查看详情';
}

.kpi-card:hover::after,
.panel:hover .zoom-hint {
  opacity: 0.9;
}

/* ===== KPI 行 ===== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  height: 286px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
}

.kpi-chart {
  flex: 1;
  min-height: 0;
}

.kpi-foot {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 17px;
  color: var(--text-dim);
  border-top: 1px solid var(--line);
}

.kpi-foot b {
  color: var(--text);
  font-size: 19px;
}

.tag {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}

.tag-warn {
  color: var(--amber);
  background: rgba(255, 210, 74, 0.12);
  border: 1px solid rgba(255, 210, 74, 0.25);
}

/* ===== 主体行 ===== */
.main-row {
  flex: 1;
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: 20px;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-title {
  height: 52px;
  line-height: 52px;
  padding-left: 22px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--line);
}

.panel-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 19px;
  background: linear-gradient(var(--cyan), var(--blue));
  border-radius: 3px;
  margin-right: 12px;
  vertical-align: -3px;
  box-shadow: 0 0 12px var(--cyan);
}

.panel-body {
  flex: 1;
  min-height: 0;
}

.side-col {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  min-height: 0;
}

/* 看板切换入口 */
.nav-switch {
  position: absolute;
  top: 30px;
  left: 32px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 15px;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(120, 170, 255, 0.06);
  transition: all 0.2s ease;
}

.nav-switch:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(46, 230, 255, 0.12);
}

/* 班组排名表 */
.rank-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.rank-table th {
  color: var(--text-dim);
  font-weight: 600;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(14, 24, 56, 0.9);
}

.rank-table td {
  padding: 0 8px;
  text-align: center;
  border-bottom: 1px solid rgba(120, 170, 255, 0.08);
}

.rank-table tbody tr {
  cursor: pointer;
  transition: background 0.18s ease;
}

.rank-table tbody tr:hover {
  background: rgba(46, 230, 255, 0.08);
}

.rank-name {
  font-weight: 700;
  color: var(--cyan);
}

.bar-cell {
  position: relative;
  min-width: 120px;
}

.bar-fill {
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 10px rgba(46, 230, 255, 0.4);
}

/* ===== 入场动画(逐个上浮) ===== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  animation: revealUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 详情弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 5, 14, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-mask.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 1180px;
  max-width: 92vw;
  height: 720px;
  max-height: 88vh;
  background: linear-gradient(160deg, #0e1838, #0a1228);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 60px rgba(46, 230, 255, 0.1);
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.modal-mask.open .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-head h2::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 22px;
  background: linear-gradient(var(--cyan), var(--blue));
  border-radius: 3px;
  margin-right: 14px;
  vertical-align: -3px;
  box-shadow: 0 0 12px var(--cyan);
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #fff;
  border-color: var(--red);
  background: rgba(255, 107, 107, 0.12);
}

.modal-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  padding: 22px 28px;
}

.modal-chart {
  min-height: 0;
}

.modal-aside {
  min-height: 0;
  overflow: auto;
}

/* 详情数据表 */
.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.dtable th,
.dtable td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(120, 170, 255, 0.1);
}

.dtable th {
  color: var(--text-dim);
  font-weight: 600;
  background: rgba(120, 170, 255, 0.06);
  position: sticky;
  top: 0;
}

.dtable td {
  color: var(--text);
}

.dtable tr:hover td {
  background: rgba(46, 230, 255, 0.06);
}

.note-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(120, 170, 255, 0.05);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dim);
}

.note-box b {
  color: var(--text);
}

.ok {
  color: var(--green);
}

.bad {
  color: var(--red);
}

/* 可点击的"人工录入"标签(看板上链到后台) */
.tag-link {
  color: var(--cyan);
  background: rgba(46, 230, 255, 0.12);
  border: 1px solid rgba(46, 230, 255, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-link:hover {
  color: #fff;
  background: rgba(46, 230, 255, 0.22);
}

.tag-main {
  color: var(--green);
  background: rgba(52, 245, 176, 0.12);
  border: 1px solid rgba(52, 245, 176, 0.3);
}

/* ===== 后台考勤录入页 ===== */
body.admin-page {
  overflow: auto;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(46, 230, 255, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

.admin-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-head h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text);
}

.admin-links {
  display: flex;
  gap: 14px;
}

.admin-links a {
  padding: 8px 16px;
  font-size: 15px;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.2s ease;
}

.admin-links a:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(46, 230, 255, 0.12);
}

.admin-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-bar label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--text-dim);
}

.admin-bar input[type='date'] {
  padding: 9px 12px;
  font-size: 16px;
  color: var(--text);
  background: rgba(120, 170, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  color-scheme: dark;
}

.admin-hint {
  font-size: 14px;
  color: var(--text-faint);
}

.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--panel-1), var(--panel-2));
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.admin-table th {
  padding: 14px 16px;
  color: var(--text-dim);
  font-weight: 600;
  text-align: left;
  background: rgba(120, 170, 255, 0.06);
  border-bottom: 1px solid var(--line);
}

.admin-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(120, 170, 255, 0.08);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table .g-name {
  font-weight: 700;
  color: var(--cyan);
}

.admin-table .g-name .tag {
  margin-left: 8px;
}

.admin-table .g-rate {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
}

.admin-table input[type='number'] {
  width: 120px;
  padding: 8px 10px;
  font-size: 16px;
  color: var(--text);
  background: rgba(120, 170, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table input[type='number']:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(46, 230, 255, 0.08);
}

.admin-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

.admin-save {
  padding: 12px 40px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #04121a;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(46, 230, 255, 0.3);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.admin-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(46, 230, 255, 0.45);
}

.admin-status {
  font-size: 15px;
}

.admin-status.ok {
  color: var(--green);
}

.admin-status.bad {
  color: var(--red);
}

/* 无障碍:尊重"减少动画"系统设置 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
