/* ==========================================================================
   页面级样式：登录、启动屏、仪表盘、成绩、学生端、更新中心、错误页
   ========================================================================== */

/* --------------------------------------------------------------------------
   启动屏（首屏骨架，避免白屏）
   v4.10.0 引入、v4.10.1 改为「六边形矩阵」风格；样式统一放在
   public/assets/css/loading.css（与站内跳转幕布同处一个文件，便于一起改），
   这里不再重复定义 .boot-screen，只保留这一条说明。
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */
.auth-page {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 100vh;
  overflow: hidden;
}

.auth-page__aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-12) var(--space-12) var(--space-10);
  color: #fff;
  background: var(--brand-600);
  overflow: hidden;
}

.auth-page__aside::before,
.auth-page__aside::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.5;
}

.auth-page__aside::before {
  width: 460px;
  height: 460px;
  right: -140px;
  top: -120px;
  background: color-mix(in srgb, #ffffff 10%, transparent);
  animation: float-soft 9s var(--ease-in-out) infinite;
}

.auth-page__aside::after {
  width: 380px;
  height: 380px;
  left: -120px;
  bottom: -140px;
  background: color-mix(in srgb, #ffffff 6%, transparent);
  animation: float-soft 11s var(--ease-in-out) infinite reverse;
}

.auth-aside__content { position: relative; z-index: 1; max-width: 460px; }

.auth-aside__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
}

.auth-aside__brand .brand-mark {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.auth-aside__headline {
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 720;
  line-height: 1.24;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
}

.auth-aside__sub {
  font-size: var(--text-md);
  opacity: 0.86;
  line-height: 1.75;
}

.auth-aside__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  opacity: 0;
  animation: slide-in-left var(--dur-slower) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 110ms + 160ms);
}

.auth-feature__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.16);
}

.auth-feature__title { font-weight: 620; font-size: var(--text-base); }
.auth-feature__desc { font-size: var(--text-sm); opacity: 0.8; }

.auth-aside__footer { position: relative; z-index: 1; font-size: var(--text-sm); opacity: 0.72; }

.auth-page__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-6);
  background: var(--bg-app);
  background-image: var(--bg-app-gradient);
}

.auth-card {
  width: min(420px, 100%);
  animation: rise-in-lg var(--dur-slower) var(--ease-out) both;
}

.auth-card__head { margin-bottom: var(--space-8); }
.auth-card__title { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; }
.auth-card__sub { margin-top: var(--space-2); color: var(--text-secondary); }

.auth-card__form { display: flex; flex-direction: column; gap: var(--space-5); }

.auth-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-footer { margin-top: var(--space-8); text-align: center; font-size: var(--text-sm); color: var(--text-tertiary); }

.auth-theme-toggle { position: fixed; top: var(--space-5); right: var(--space-5); z-index: 10; }

/* 登录页左下角：大屏查分模式入口 */
.auth-kiosk-entry {
  position: fixed;
  left: max(var(--space-5), env(safe-area-inset-left, 0px));
  bottom: max(var(--space-5), env(safe-area-inset-bottom, 0px));
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms var(--ease-out);
  animation: rise-in 520ms var(--ease-out) 260ms both;
}

.auth-kiosk-entry:hover {
  transform: translateY(-2px);
  border-color: var(--brand-400);
  box-shadow: var(--shadow-lg);
}

.auth-kiosk-entry:active { transform: translateY(0) scale(0.985); }

.auth-kiosk-entry:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 3px; }

.auth-kiosk-entry__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--fill-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.auth-kiosk-entry__body { display: flex; flex-direction: column; line-height: 1.3; }

.auth-kiosk-entry__title { font-size: var(--text-sm); font-weight: 600; }

.auth-kiosk-entry__desc { font-size: var(--text-xs); color: var(--text-tertiary); }

.auth-kiosk-entry__arrow {
  color: var(--text-tertiary);
  transition: transform 220ms var(--ease-out);
}

.auth-kiosk-entry:hover .auth-kiosk-entry__arrow { transform: translateX(3px); }

@media (max-width: 960px) {
  .auth-kiosk-entry { min-height: 52px; padding: var(--space-2) var(--space-3); }
  .auth-kiosk-entry__desc { display: none; }
  .auth-kiosk-entry__icon { width: 32px; height: 32px; }
}

/* 登录页动画：错误抖动 */
.shake { animation: shake-x 420ms var(--ease-out) both; }

@keyframes shake-x {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

@media (max-width: 960px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-page__aside { display: none; }
}

/* --------------------------------------------------------------------------
   仪表盘
   -------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

.activity-list { display: flex; flex-direction: column; }

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  animation: rise-in var(--dur-normal) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}

.activity-item:last-child { border-bottom: none; }

.activity-item__body { flex: 1; min-width: 0; }
.activity-item__title { font-size: var(--text-base); font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-item__meta { font-size: var(--text-xs); color: var(--text-tertiary); }

/* 环形进度 */
.ring-progress { position: relative; display: grid; place-items: center; }
.ring-progress svg { transform: rotate(-90deg); }
.ring-progress__track { stroke: var(--bg-muted); }
.ring-progress__value {
  stroke: url(#ringGradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease-out);
}
.ring-progress__label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.ring-progress__number { font-size: var(--text-xl); font-weight: 700; }
.ring-progress__unit { font-size: var(--text-xs); color: var(--text-tertiary); }

/* --------------------------------------------------------------------------
   成绩模块
   -------------------------------------------------------------------------- */
.score-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
}

.score-hero__value {
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: none;
  color: var(--brand-500);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.score-hero__value.is-negative {
  background: none;
  color: var(--danger);
  -webkit-background-clip: text;
  background-clip: text;
}

.subject-score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: transform var(--dur-normal) var(--ease-out), box-shadow var(--dur-normal) var(--ease-out),
    border-color var(--dur-normal) var(--ease-out);
}

.subject-score-card:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand-400) 34%, var(--border-default));
}

.subject-score-card__value {
  font-size: var(--text-2xl);
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  font-size: var(--text-xs);
  font-weight: 620;
  color: var(--text-secondary);
}

/* 学生端科目卡片 */
.subject-tile {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur-normal) var(--ease-out), box-shadow var(--dur-normal) var(--ease-out);
}

.subject-tile::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--fill-brand);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--dur-slow) var(--ease-spring);
}

.subject-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.subject-tile:hover::after { transform: scaleY(1); }

/* --------------------------------------------------------------------------
   更新中心
   -------------------------------------------------------------------------- */
.update-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--tint-brand);
  border: 1px solid color-mix(in srgb, var(--brand-400) 26%, transparent);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 620;
}

.update-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.update-log {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-surface-sunken);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.8;
  max-height: 240px;
  overflow-y: auto;
}

.update-log__line { animation: fade-in var(--dur-fast) var(--ease-out) both; }
.update-log__line--ok { color: var(--success); }
.update-log__line--warn { color: var(--warning); }
.update-log__line--err { color: var(--danger); }

.file-list {
  max-height: 300px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.file-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.file-list__item:last-child { border-bottom: none; }
.file-list__item:nth-child(odd) { background: var(--bg-muted); }

.scope-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.scope-tag--frontend { background: var(--info-soft); color: var(--info); }
.scope-tag--backend { background: rgba(139, 92, 246, 0.16); color: var(--accent-violet); }
.scope-tag--database { background: var(--success-soft); color: var(--success); }

/* --------------------------------------------------------------------------
   结果页 / 错误页
   -------------------------------------------------------------------------- */
.result-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  max-width: 560px;
  margin: 8vh auto;
  padding: var(--space-10) var(--space-8);
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: rise-in-lg var(--dur-slower) var(--ease-out) both;
}

.result-page__icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: var(--radius-xl);
  background: var(--bg-muted);
  animation: pop-in var(--dur-slower) var(--ease-spring) both;
}

.result-page__icon--danger { background: var(--danger-soft); color: var(--danger); }
.result-page__icon--warning { background: var(--warning-soft); color: var(--warning); }
.result-page__icon--brand { background: var(--bg-active); color: var(--brand-500); }

.result-page__code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-muted);
}

.result-page__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; }

/* --------------------------------------------------------------------------
   分组 / 成员卡片
   -------------------------------------------------------------------------- */
.group-card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-normal) var(--ease-out), box-shadow var(--dur-normal) var(--ease-out),
    border-color var(--dur-normal) var(--ease-out);
  animation: rise-in var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.group-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--brand-400) 34%, var(--border-default));
}

.group-card__members { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* 成员选择器（小组组建） */
.member-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
}

.member-picker__search { position: relative; }

.member-picker__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: var(--space-2);
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
}

.member-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: var(--text-sm);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-spring);
}

.member-option:hover { border-color: var(--brand-400); transform: translateY(-1px); }

.member-option.is-checked {
  border-color: var(--brand-500);
  background: var(--bg-active);
  color: var(--brand-500);
  font-weight: 600;
}

.member-option input { display: none; }
.member-option__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.member-picker__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* 选中成员预览 */
.selected-members { display: flex; flex-wrap: wrap; gap: var(--space-2); min-height: 34px; align-items: center; }

/* --------------------------------------------------------------------------
   批量操作栏
   -------------------------------------------------------------------------- */
.bulk-bar {
  position: sticky;
  bottom: var(--space-4);
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  animation: bounce-in-up var(--dur-slow) var(--ease-spring) both;
}

.bulk-bar__count { font-weight: 620; }

/* --------------------------------------------------------------------------
   打印样式（总分表）
   -------------------------------------------------------------------------- */
@media print {
  .table-wrap { border: none; }
  .table thead th { background: #f1f5f9; color: #0f172a; }
}

/* --------------------------------------------------------------------------
   v5.1.0 公告管理页（列表 + 表单）
   -------------------------------------------------------------------------- */
.ann-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.ann-toolbar__tabs { display: flex; align-items: center; gap: var(--space-1); }
.ann-toolbar__tabs .tab {
  padding: 5px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
}
.ann-toolbar__tabs .tab.is-active { background: var(--brand-50); color: var(--brand-600); font-weight: 640; }
.ann-toolbar__hint { font-size: var(--text-sm); color: var(--text-tertiary); }

.ann-cell { min-width: 220px; }
.ann-cell__title { display: flex; align-items: center; gap: 6px; font-weight: 620; }
.ann-cell__title a { color: var(--text-primary); }
.ann-cell__title a:hover { color: var(--brand-500); }
.ann-cell__pin { display: inline-grid; place-items: center; color: var(--accent-amber); }
.ann-cell__desc {
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* 表单：左内容 + 右预览（窄屏自动堆叠） */
.ann-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.ann-editor__main,
.ann-editor__side { min-width: 0; }

.ann-editor__side { position: sticky; top: var(--space-4); }

.ann-format { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1); align-self: flex-start; }
.ann-format .tab { padding: 5px var(--space-4); border-radius: var(--radius-sm); cursor: pointer; background: transparent; color: var(--text-secondary); }
.ann-format .tab.is-active { background: var(--bg-surface); color: var(--brand-600); font-weight: 640; }

.ann-textarea { min-height: 340px; font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.7; resize: vertical; }

.ann-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

.ann-preview__frame { padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-app); box-shadow: var(--shadow-inset-sm); }
.ann-preview__body {
  margin-top: var(--space-3);
  padding: var(--space-4);
  max-height: 420px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.ann-preview__note { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-tertiary); }

.ann-center { display: flex; flex-direction: column; gap: var(--space-4); }
.ann-center__empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-8); color: var(--text-tertiary); }
.ann-center__item { padding: var(--space-4); border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: var(--bg-surface); }
.ann-center__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.ann-center__title { font-size: var(--text-lg); font-weight: 660; }
.ann-center__meta { display: flex; align-items: center; gap: var(--space-2); }
.ann-center__content { margin-top: var(--space-3); }

@media (max-width: 1080px) {
  .ann-editor { grid-template-columns: minmax(0, 1fr); }
  .ann-editor__side { position: static; }
}

/* 公告列表页的状态筛选标签页（v5.2.2-alpha.2：滑动指示器已移除，选中态由 .tab.is-active 自己画） */
.ann-toolbar__tabs {
  position: relative;
}
