/* ============================================================
   Claude 官网风格设计系统
   奶油画布 + 珊瑚色 CTA + 衬线展示标题 + 深色特色板块
   参考 awesome-design-md-main/design-md/claude/DESIGN.md
   ============================================================ */
:root {
  /* 品牌色 */
  --primary: #cc785c;
  --primary-active: #a9583e;
  --primary-disabled: #e6dfd8;
  --primary-soft: rgba(204, 120, 92, 0.1);

  /* 文字 */
  --ink: #141413;
  --body-strong: #252523;
  --body-text: #3d3d3a;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;

  /* 表面 */
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --surface-cream-strong: #e8e0d2;
  --surface-dark: #181715;
  --surface-dark-elevated: #252320;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;

  /* 反色文字 */
  --on-primary: #ffffff;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;

  /* 辅助色 */
  --accent-teal: #5db8a6;
  --accent-amber: #e8a55a;
  --success: #5db872;
  --error: #c64545;

  /* 字体 */
  --font-serif: "Tiempos Headline", "Copernicus", Georgia, "Noto Serif SC",
    "Songti SC", "STZhongsong", "SimSun", serif;
  --font-sans: "StyreneB", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  background: var(--canvas);
  color: var(--body-text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

::selection { background: rgba(204, 120, 92, 0.22); }

.hidden { display: none !important; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- 顶部导航 ---------- */
.topnav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.spike {
  width: 17px;
  height: 17px;
  flex: none;
  color: currentColor;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  color: var(--body-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-link:active { color: var(--primary-active); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:active { background: var(--primary-active); }

.btn-primary:disabled {
  background: var(--primary-disabled);
  color: var(--muted);
  cursor: default;
}

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn-secondary:active { background: var(--surface-soft); }

.btn-block { width: 100%; }

.btn-ghost-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}

.btn-ghost-sm:active { background: var(--surface-soft); }

.btn-danger-ghost {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  background: transparent;
  color: var(--error);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.btn-danger-ghost:active {
  background: rgba(198, 69, 69, 0.08);
  border-color: rgba(198, 69, 69, 0.3);
}

/* ---------- 布局容器 ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 32px 80px;
}

/* ---------- 登录页 ---------- */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 56px 32px;
}

.login-wrap-center { justify-content: center; }

.hero-grid {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
}

.login-hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: var(--ink);
  margin: 20px 0 16px;
}

.hero-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 30em;
}

.hero-points {
  list-style: none;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-points li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--body-text);
  font-size: 15px;
}

.hero-points li::before {
  content: "\2733";
  color: var(--primary);
  font-size: 12px;
  flex: none;
}

.login-card {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
}

.login-card h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  margin: 6px 0 24px;
}

.privacy-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline-soft);
  font-size: 13px;
  color: var(--muted-soft);
  line-height: 1.6;
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--body-strong);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder { color: var(--muted-soft); }

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.15);
}

.form-error {
  display: none;
  background: rgba(198, 69, 69, 0.07);
  border: 1px solid rgba(198, 69, 69, 0.25);
  color: var(--error);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.form-error.show { display: block; }

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 16px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.remember-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

/* ---------- 页头 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.page-head h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--ink);
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.tier-badge {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ---------- 批次切换 ---------- */
.batch-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.picker-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--muted-soft);
  margin-right: 8px;
}

.pill-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pill-tab.active {
  background: var(--surface-card);
  color: var(--ink);
}

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--muted);
}

.stat-value {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--ink);
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.stat-value .of {
  font-size: 18px;
  letter-spacing: 0;
  color: var(--muted-soft);
}

.stat-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* 深色特色卡片：主要指标（对应 pricing-tier-card-featured） */
.stat-card.featured { background: var(--surface-dark); }
.stat-card.featured .stat-label { color: var(--on-dark-soft); }
.stat-card.featured .stat-value { color: var(--on-dark); }
.stat-card.featured .stat-value .of { color: var(--on-dark-soft); }
.stat-card.featured .stat-sub { color: var(--accent-amber); }

/* 排名较上次的升降标记 */
.delta-chip {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--on-dark-soft);
  white-space: nowrap;
}

.delta-chip.delta-up { color: #8fd8a8; }
.delta-chip.delta-down { color: #e5928c; }

td .delta-up { color: #3e7d4e; font-weight: 600; }
td .delta-down { color: var(--error); font-weight: 600; }
td .delta-flat { color: var(--muted-soft); }

/* ---------- 图表卡片 ---------- */
.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card {
  min-width: 0;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-card.full { grid-column: 1 / -1; }

.chart-card h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.chart-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.chart-box {
  height: 300px;
  margin-top: 12px;
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card + .card { margin-top: 16px; }

.card h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 16px;
}

/* ---------- 详细信息 ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.detail-item {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 16px;
}

.d-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--muted-soft);
}

.d-value {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 6px;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--muted-soft);
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--body-text);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }

.tag {
  display: inline-flex;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

/* ---------- 空状态 ---------- */
.empty-state {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
}

.empty-mark {
  font-size: 32px;
  line-height: 1;
  color: var(--primary);
}

.empty-state h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin: 16px 0 8px;
}

.empty-state p { color: var(--muted); }

/* ---------- 页脚（深色板块） ---------- */
.footer {
  background: var(--surface-dark);
  color: var(--on-dark-soft);
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--on-dark);
  font-size: 15px;
  font-weight: 600;
}

.footer p { font-size: 13.5px; }

/* ---------- 辅导员端：上传 ---------- */
.upload-zone {
  border: 1.5px dashed var(--hairline);
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-zone .zone-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.upload-zone .zone-hint {
  font-size: 13px;
  color: var(--muted-soft);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* 上传前解析预览 */
.preview-panel {
  margin-top: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preview-head {
  padding: 10px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 13.5px;
  color: var(--body-text);
}

.preview-panel table { font-size: 13.5px; }

.preview-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--hairline-soft);
  font-size: 12.5px;
  color: var(--muted-soft);
}

.file-chosen {
  margin-top: 14px;
  display: inline-flex;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-cream-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 20px;
}

.form-row .field {
  flex: 1;
  margin-bottom: 0;
}

.form-row .btn { height: 44px; }

.notice {
  display: none;
  margin-top: 14px;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.notice.show { display: block; }

.notice.ok {
  background: rgba(93, 184, 114, 0.1);
  border: 1px solid rgba(93, 184, 114, 0.3);
  color: #3e7d4e;
}

.notice.err {
  background: rgba(198, 69, 69, 0.07);
  border: 1px solid rgba(198, 69, 69, 0.25);
  color: var(--error);
}

.hint {
  font-size: 13px;
  color: var(--muted-soft);
  margin-top: 12px;
}

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 860px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline-soft);
}

.modal-head h2 { white-space: nowrap; }

.record-search {
  flex: 1;
  min-width: 0;
  max-width: 320px;
  height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.record-search::placeholder { color: var(--muted-soft); }

.record-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.15);
}

.modal-head h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.modal-close:active { background: var(--surface-soft); }

.modal-body {
  padding: 8px 24px 24px;
  overflow: auto;
}

.modal-body thead th {
  position: sticky;
  top: 0;
  background: var(--canvas);
}

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.55s ease forwards;
}

.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.12s; }
.d3 { animation-delay: 0.18s; }
.d4 { animation-delay: 0.24s; }
.d5 { animation-delay: 0.3s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .login-hero h1 { font-size: 44px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topnav { padding: 0 20px; }
  .container { padding: 28px 20px 56px; }
  .login-wrap { padding: 36px 20px; }
  .login-hero h1 {
    font-size: 36px;
    letter-spacing: -1px;
  }
  .login-card { padding: 28px 22px; }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-head h1 { font-size: 30px; }
  .stat-value { font-size: 34px; }
  .charts-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-box { height: 260px; }
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }
  .footer-inner { padding: 32px 20px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* 当前成绩表的班级信息 */
.class-section { margin-bottom: 16px; }
.class-ranks { margin-top: 16px; }
#class-unavailable { margin-bottom: 16px; }
