/* =====================================================
   APEX - 自主招生报名查分系统
   设计方向：现代学术 · 沉稳可信 · 清晰层级
   ===================================================== */

/* ===== CSS Variables ===== */
:root {
  /* Colors */
  --color-bg: #f6f7fa;
  --color-surface: #ffffff;
  --color-primary: #1a1a2e;
  --color-primary-light: #2d2d52;
  --color-accent: #c8963e;
  --color-accent-light: #e2b04a;
  --color-accent-glow: rgba(200, 150, 62, 0.15);
  --color-text: #1a1a2e;
  --color-text-secondary: #5a5a7a;
  --color-text-muted: #8a8aa8;
  --color-border: #e8eaf0;
  --color-border-light: #f0f1f5;
  --color-success: #2d9d5a;
  --color-error: #d14343;
  --color-warning: #e28a30;
  --color-info: #3b82c4;

  /* Status Colors */
  --status-registered: #2d9d5a;
  --status-registered-bg: #e6f5ed;
  --status-scored: #3b82c4;
  --status-scored-bg: #e8f0fd;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

  /* Sizes */
  --nav-height: 64px;
  --max-width: 1200px;
  --content-max-width: 720px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.06);
  --shadow: 0 4px 16px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 26, 46, 0.12);
  --shadow-xl: 0 24px 60px rgba(26, 26, 46, 0.16);

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-in-out);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Typography ===== */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border-light);
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.nav-logo {
  width: 34px;
  height: 34px;
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--color-primary);
  background: rgba(26, 26, 46, 0.04);
}

.nav-link.active {
  color: var(--color-primary);
  background: rgba(26, 26, 46, 0.06);
}

.nav-link-admin {
  color: var(--color-accent);
}

.nav-link-admin:hover {
  color: var(--color-accent);
  background: var(--color-accent-glow);
}

/* 导航栏用户信息 */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 12px;
}

.nav-user-phone {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.nav-user-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-user-logout:hover {
  background: rgba(220, 53, 69, 0.2);
  color: var(--color-error);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Page System ===== */
main {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

.page {
  display: none;
  animation: fadeSlideIn 0.4s var(--ease-out);
}

.page.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.page-header {
  text-align: center;
  margin-bottom: 36px;
}

.page-header h1 {
  margin-bottom: 8px;
}

.page-header p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.required-mark {
  color: var(--color-error);
  font-weight: 700;
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--color-primary) 0%, #16213e 40%, #0f3460 100%);
  color: #ffffff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--color-accent);
  top: -100px;
  right: -100px;
  animation: orbFloat 8s var(--ease-in-out) infinite;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: #4f7dca;
  bottom: -80px;
  left: -80px;
  animation: orbFloat 10s var(--ease-in-out) infinite reverse;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: var(--color-accent-light);
  top: 50%;
  left: 40%;
  animation: orbFloat 12s var(--ease-in-out) infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 24px;
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--color-accent-light);
  border-radius: 50%;
  animation: pulse 2s var(--ease-in-out) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  line-height: 1.2;
  margin-bottom: 20px;
}

.title-line {
  display: block;
}

.title-line.accent {
  color: var(--color-accent-light);
}

.hero-desc {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-accent-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(200, 150, 62, 0.35);
}

.btn-primary:hover {
  background: var(--color-accent-light);
  box-shadow: 0 4px 20px rgba(200, 150, 62, 0.45);
  transform: translateY(-1px);
}

.btn-primary svg {
  width: 20px;
  height: 20px;
}

.btn-sm.btn-primary svg {
  width: 16px;
  height: 16px;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline svg {
  width: 20px;
  height: 20px;
}

/* Button states */
.btn-submit {
  position: relative;
}

.btn-submit.loading .btn-text {
  opacity: 0;
}

.btn-submit.loading .btn-loader {
  display: block;
}

.btn-loader {
  display: none;
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== Features / Steps ===== */
.features {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 44px;
}

.section-header h2 {
  margin-bottom: 8px;
}

.section-header p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--color-border-light);
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.step-number {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-border);
  line-height: 1;
  font-family: var(--font-mono);
  letter-spacing: -0.04em;
}

.step-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border-radius: var(--radius);
  color: var(--color-accent);
}

.step-icon svg {
  width: 28px;
  height: 28px;
}

.step-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.step-card p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===== Notice Section ===== */
.notice-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px;
}

.notices {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-item {
  display: flex;
  gap: 20px;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--color-accent);
  transition: var(--transition);
}

.notice-item:hover {
  box-shadow: var(--shadow);
}

.notice-date {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-glow);
  color: var(--color-accent);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
}

.notice-content h4 {
  margin-bottom: 4px;
}

.notice-content p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===== Forms ===== */
.form-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border-light);
}

.form-section {
  margin-bottom: 32px;
}

.form-section:last-of-type {
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 1.05rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border-light);
  color: var(--color-primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.remarks-full-width {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-group.required label::after {
  content: " *";
  color: var(--color-error);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
  background: var(--color-surface);
}

.form-group input.error,
.form-group select.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(209, 67, 67, 0.1);
}

.form-group .form-error {
  font-size: 0.8rem;
  color: var(--color-error);
  min-height: 0;
  opacity: 0;
  transition: var(--transition-fast);
}

.form-group .form-error.visible {
  opacity: 1;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235a5a7a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.auto-field {
  background-color: var(--color-border-light) !important;
  color: var(--color-text-secondary) !important;
  cursor: default;
}

/* ===== Photo Upload ===== */
.photo-upload {
  margin-top: 24px;
  grid-column: 1 / -1;
}

.photo-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  display: block;
  margin-bottom: 8px;
}

.photo-label.required::after {
  content: " *";
  color: var(--color-error);
}

.photo-hint {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.photo-area {
  position: relative;
  width: 100%;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  background: var(--color-bg);
}

.photo-area:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
}

.photo-area.drag-over {
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
  border-style: solid;
}

.photo-area.has-error {
  border-color: var(--color-error);
  background: rgba(209, 67, 67, 0.04);
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.photo-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

.photo-placeholder-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* 已确认的照片 */
.photo-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.photo-done img {
  width: 150px;
  height: 210px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

/* 准考证已确认预览横版 3:2 */
#examCardDone img {
  width: 270px;
  height: 180px;
}

.photo-done .btn-outline {
  width: 150px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.photo-progress {
  margin-top: 10px;
  width: 100%;
  height: 4px;
  background: var(--color-border-light);
  border-radius: 2px;
  overflow: hidden;
}

.photo-progress-bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s var(--ease-out);
}

.photo-progress-bar.uploading {
  animation: progressPulse 1.5s var(--ease-in-out) infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#photoError.visible {
  opacity: 1;
  margin-top: 6px;
}

.form-footer {
  padding-top: 20px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.checkbox-group input[type="checkbox"] {
  display: none;
}

.checkmark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  margin-top: 2px;
  transition: var(--transition-fast);
  position: relative;
}

.checkbox-group input:checked + .checkmark {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.checkbox-group input:checked + .checkmark::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ===== Success Card ===== */
.success-card {
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  box-shadow: var(--shadow);
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  color: var(--color-success);
}

.success-icon svg {
  width: 80px;
  height: 80px;
}

.success-card h2 {
  color: var(--color-success);
  margin-bottom: 12px;
}

.success-card > p {
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.success-note {
  font-size: 0.9rem;
  color: var(--color-text-muted) !important;
  margin-bottom: 24px !important;
}

.success-info {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 32px;
  display: inline-flex;
  gap: 8px;
  font-size: 0.95rem;
}

.success-info strong {
  color: var(--color-accent);
}

.btn-outline-on-light {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.success-card .btn {
  min-width: 160px;
  margin: 6px 0;
}

.success-card .btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.success-card .btn-outline:hover {
  background: var(--color-bg);
  border-color: var(--color-text-secondary);
}

/* ===== Confirm Card（报名确认页） ===== */
.confirm-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  max-width: 700px;
  margin: 0 auto;
}

.confirm-header {
  text-align: center;
  margin-bottom: 40px;
}

.confirm-header-icon {
  width: 56px;
  height: 56px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.confirm-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px 0;
}

.confirm-header p {
  color: var(--color-text-secondary);
  margin: 0;
  font-size: 0.95rem;
}

.confirm-section {
  margin-bottom: 32px;
}

.confirm-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
}

.confirm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
}

.confirm-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cf-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.cf-value {
  font-size: 1.05rem;
  color: var(--color-text);
  font-weight: 500;
  word-break: break-all;
}

.confirm-photos {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.confirm-photo-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.confirm-photo-item .cf-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.confirm-photo-item img {
  height: 168px;
  width: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
}

.confirm-photo-item:last-child img {
  aspect-ratio: 3 / 2;
  height: 168px;
}

.confirm-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--status-registered-bg);
  border-radius: var(--radius);
  margin-bottom: 32px;
}

.confirm-disclaimer svg {
  width: 20px;
  height: 20px;
  color: var(--color-warning);
  flex-shrink: 0;
  margin-top: 1px;
}

.confirm-disclaimer span {
  font-size: 0.9rem;
  color: var(--color-warning);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.confirm-actions .btn {
  min-width: 140px;
}

.confirm-actions .btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.confirm-actions .btn-outline:hover {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* ===== Ticket Number Highlight ===== */
.ticket-number {
  font-family: var(--font-mono);
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: var(--color-primary);
  letter-spacing: 2px;
}

/* ===== Query Card ===== */
.query-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.query-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  color: var(--color-accent);
}

.query-icon svg {
  width: 56px;
  height: 56px;
}

.query-card form {
  text-align: left;
}

.query-card .form-group {
  margin-bottom: 16px;
}

/* ===== Result Card ===== */
.result-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
}

.result-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-header h2 {
  color: #fff;
}

.result-badge {
  background: rgba(255,255,255,0.2);
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

.result-student {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 32px;
  border-bottom: 1px solid var(--color-border-light);
}

.student-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  flex-shrink: 0;
}

.student-info h3 {
  margin-bottom: 2px;
}

.student-info p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.result-total {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
  padding: 28px 32px;
  border-bottom: 1px solid var(--color-border-light);
}

.total-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.total-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-accent);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.score-table th,
.score-table td {
  padding: 14px 32px;
  text-align: center;
}

.score-table th {
  background: var(--color-bg);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.score-table td {
  font-size: 1.05rem;
  font-weight: 500;
  border-bottom: 1px solid var(--color-border-light);
}

.score-table td:first-child {
  font-weight: 600;
  color: var(--color-text);
}

.score-grade {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

.grade-a { background: #e6f5ed; color: var(--color-success); }
.grade-b { background: #e8f0fd; color: var(--color-info); }
.grade-c { background: #fdf0e0; color: var(--color-warning); }
.grade-d { background: #fde8e8; color: var(--color-error); }

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 24px 32px;
}

.result-actions .btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.result-actions .btn-outline:hover {
  background: var(--color-bg);
}

/* ===== Error Card ===== */
.error-card {
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  box-shadow: var(--shadow);
  max-width: 420px;
  margin: 0 auto;
}

.error-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--color-warning);
}

.error-icon svg {
  width: 56px;
  height: 56px;
}

.error-card h3 {
  margin-bottom: 8px;
}

.error-card p {
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.error-card .btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

/* ===== Admission Ticket (准考证) ===== */
.ticket-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 680px;
  margin: 0 auto;
  border: 2px solid var(--color-border);
}

.ticket-screen-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--color-border-light);
}

.print-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 8px 14px;
  white-space: nowrap;
}

.print-status.printed {
  color: var(--color-success);
  background: var(--status-registered-bg);
  border-radius: 20px;
}

.ticket-screen-actions .btn {
  min-width: 140px;
}

.ticket-screen-actions .btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.ticket-screen-actions .btn-outline:hover {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}



/* Mobile */
@media (max-width: 768px) {
  .ticket-screen-actions {
    flex-direction: column;
    align-items: center;
    padding: 20px;
  }
}

/* ===== Admin: Login Card ===== */
.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.login-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--color-accent);
}

.login-icon svg {
  width: 56px;
  height: 56px;
}

.login-card h3 {
  margin-bottom: 24px;
}

.login-card .login-form {
  text-align: left;
}

.login-card label {
  text-align: left;
  display: block;
}

.login-card .form-group {
  margin-bottom: 16px;
}

.login-hint {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* 登录提示文字 */
.login-desc {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.login-warn {
  background: rgba(200, 150, 62, 0.1);
  border: 1px solid rgba(200, 150, 62, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--color-accent-light);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* 输入框 + 按钮同行 */
.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
  min-width: 0;
}

.input-with-btn .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* 表单提示文字 */
.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* 只读输入框样式 */
input[readonly] {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-muted);
  cursor: default;
  border-color: var(--color-border-light);
}

input[readonly]:focus {
  border-color: var(--color-border-light);
  box-shadow: none;
}

/* ===== Admin: Panel ===== */
.admin-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 60vh;
}

.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tab {
  padding: 14px 24px;
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.admin-tab:hover {
  color: var(--color-text);
}

.admin-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.admin-tab-logout {
  margin-left: auto;
  color: var(--color-error) !important;
}

.tab-content {
  display: none;
  padding: 28px;
}

.tab-content.active {
  display: block;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon svg {
  width: 24px;
  height: 24px;
}

.icon-blue { background: #e8f0fd; color: var(--color-info); }
.icon-amber { background: #fdf0e0; color: var(--color-warning); }
.icon-green { background: #e6f5ed; color: var(--color-success); }
.icon-purple { background: #f0e8fd; color: #7c3aed; }
.icon-teal { background: #e6faf5; color: #0d9488; }

.stat-card-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.stat-card-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Table Toolbar */
.table-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.9rem;
  background: var(--color-bg);
  outline: none;
  transition: var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.filter-select {
  padding: 10px 36px 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.9rem;
  background: var(--color-bg);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235a5a7a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

/* 管理后台扩宽表格区域 */
#page-admin .page-container {
  max-width: 1200px;
}

#page-admin .tab-content {
  max-width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--color-bg);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--color-bg);
}

.status-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-registered { background: var(--status-registered-bg); color: var(--status-registered); }
.status-scored { background: var(--status-scored-bg); color: var(--status-scored); }

.action-btns {
  display: flex;
  gap: 6px;
  position: relative;
}

/* Admin: Photo thumbnail in table */
.reg-photo-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  cursor: default;
  font-size: 1rem;
  opacity: 0.4;
}

.reg-photo-thumb.no-photo {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.reg-photo-thumb[data-fileid] {
  cursor: pointer;
  opacity: 1;
}

.reg-photo-thumb[data-fileid]:hover {
  opacity: 0.8;
}

.reg-photo-thumb img {
  width: 36px;
  height: 44px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--color-border-light);
}

.reg-photo-thumb.loaded {
  opacity: 1;
}

.btn-table {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: var(--font-family);
  transition: var(--transition-fast);
}

.btn-table:hover {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
}

.btn-table.primary {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-glow);
}

.btn-table.danger {
  border-color: var(--color-error);
  color: var(--color-error);
}

.btn-table.danger:hover {
  background: #fde8e8;
}

/* 打印状态列 */
.print-col {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.print-col.print-done {
  color: var(--color-success);
  font-weight: 500;
}

/* Dropdown menu */
.dropdown-menu {
  position: absolute;
  z-index: 200;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  min-width: 100px;
  overflow: hidden;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  font-size: 0.8rem;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-family);
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--color-bg);
}

.dropdown-item.danger {
  color: var(--color-error);
}

.dropdown-item.danger:hover {
  background: #fde8e8;
}

/* ===== 准考证存根 ===== */
.stub-room-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 2.2;
}

.stub-print-area {
  background: #fff;
  padding: 0;
}

/* 每个考场一页 */
.stub-room {
  page-break-before: always;
  page-break-after: always;
  padding: 8mm 10mm 6mm;
  max-width: 210mm;
  margin: 0 auto 0;
}

.stub-room:first-child {
  page-break-before: auto;
}

.stub-room-header {
  text-align: center;
  font-size: 5mm;
  font-weight: 700;
  color: #1a3c1a;
  margin-bottom: 3mm;
  padding-bottom: 2mm;
  border-bottom: 1.5px solid #1a3c1a;
}

/* 5列6行网格 */
.stub-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2mm;
}

.stub-card {
  text-align: center;
  padding: 1.5mm 1mm;
  border: 1px solid #ddd;
  border-radius: 2px;
}

.stub-card-photo {
  width: 26mm;
  height: 34mm;
  object-fit: cover;
  border: 1px solid #ccc;
  background: #f0f0f0;
  display: block;
  margin: 0 auto;
}

.stub-card-photo.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3mm;
  color: #999;
}

.stub-card-label {
  font-size: 3.2mm;
  font-weight: 600;
  color: #111;
  margin-bottom: 1.5mm;
  line-height: 1.3;
  white-space: nowrap;
}

/* 屏幕预览时给点宽限 */
@media screen {
  .stub-print-area {
    overflow-x: auto;
  }
  .stub-room {
    box-shadow: 0 0 8px rgba(0,0,0,0.08);
    margin-bottom: 16px;
  }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.page-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.page-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s var(--ease-out);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--color-border-light);
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: var(--transition-fast);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.modal-body {
  padding: 24px 28px;
}

.modal-student-info {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.modal-student-info span {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.score-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.score-entry-grid .form-group input {
  background: var(--color-surface);
}

/* ===== Batch Score Panel ===== */
.batch-score-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.batch-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.batch-score-header h4 {
  font-size: 1.05rem;
  color: var(--color-text);
  margin: 0;
}

.batch-hint {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: 4px;
  line-height: 1.5;
}

.batch-format {
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: var(--color-accent-glow);
  border-radius: var(--radius-sm);
  display: inline-block;
}

#batchScoreInput {
  width: 100%;
  min-height: 160px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

#batchScoreInput:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.batch-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.batch-preview {
  margin-top: 20px;
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

.batch-preview-table {
  margin-top: 12px;
  max-height: 360px;
  overflow-y: auto;
}

.batch-summary {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.batch-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
  flex-wrap: wrap;
  gap: 12px;
}

.batch-error-count {
  color: var(--color-error);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Batch preview table row status */
.batch-row-matched {
  /* normal */
}

.batch-row-error {
  background: #fef2f2;
}

.batch-row-error td:first-child {
  color: var(--color-error);
  font-weight: 500;
}

.batch-status-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}

.batch-status-icon.ok {
  color: var(--color-success);
}

.batch-status-icon.err {
  color: var(--color-error);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 28px 24px;
}

.modal-footer .btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.modal-footer .btn-outline:hover {
  background: var(--color-bg);
}

/* ===== 自动裁剪预览 ===== */
.photo-crop-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
}

.photo-crop-preview canvas {
  width: 180px;
  height: 252px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.photo-crop-preview .photo-crop-actions {
  display: flex;
  gap: 10px;
}

.photo-crop-preview .btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.photo-crop-preview .btn-outline:hover {
  background: var(--color-bg);
}

/* 中考准考证裁剪预览（3:2 比例） */
.examcard-crop-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
}

.examcard-crop-preview canvas {
  width: 270px;
  height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.examcard-crop-preview .photo-crop-actions {
  display: flex;
  gap: 10px;
}

.examcard-crop-preview .btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.examcard-crop-preview .btn-outline:hover {
  background: var(--color-bg);
}

#examCardError.visible {
  opacity: 1;
  color: var(--color-error);
  font-size: 0.78rem;
  margin-top: 6px;
  display: block;
}

#examCardError:not(.visible) {
  opacity: 0;
  display: none;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  animation: toastSlideIn 0.3s var(--ease-out);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  border-left: 3px solid;
}

.toast-success { border-color: var(--color-success); }
.toast-error { border-color: var(--color-error); }
.toast-info { border-color: var(--color-info); }
.toast-warning { border-color: var(--color-warning); }

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-removing {
  animation: toastSlideOut 0.3s var(--ease-out) forwards;
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ===== Utility ===== */
.hidden {
  display: none !important;
}

/* ===== Print Styles ===== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    margin: 0;
    padding: 0;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide everything except stub printing */
  .navbar,
  .nav-links,
  .nav-user,
  .section-description,
  .hero,
  .footer {
    display: none !important;
  }

  /* Hide admin UI when printing */
  .admin-tabs,
  .admin-login,
  .table-toolbar,
  #page-admin .page-header,
  #page-admin .section-description,
  #page-admin .hero,
  .data-table,
  .pagination,
  #tab-dashboard,
  #tab-registrations,
  #tab-scores,
  .stub-room-label,
  #stubRoomSelect,
  #printStubBtn {
    display: none !important;
  }

  /* Show stub print area */
  #tab-stubs {
    display: block !important;
  }

  #stubPrintArea {
    display: block !important;
  }

  /* Stub layout in print */
  .stub-room {
    box-shadow: none !important;
    margin: 0 !important;
    page-break-before: always;
    page-break-after: always;
  }

  .stub-room:first-child {
    page-break-before: auto;
  }

  .stub-card {
    border-color: #ccc !important;
  }

  /* Remove container constraints */
  main {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  .section-content {
    max-width: none !important;
    padding: 0 !important;
  }

  .page-section {
    padding: 0 !important;
  }

}

/* ====== RESPONSIVE ====== */

/* Tablet */
@media (max-width: 1024px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  /* Navigation */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-surface);
    flex-direction: column;
    padding: 80px 24px 24px;
    box-shadow: var(--shadow-xl);
    transition: right 0.35s var(--ease-out);
    gap: 0;
    z-index: 999;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-link {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .nav-link-admin {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-user {
    position: absolute;
    top: 14px;
    right: 56px;
    margin: 0;
  }

  .nav-user-phone {
    font-size: 0.75rem;
    padding: 3px 10px;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: 40px 0;
  }

  .hero-content {
    padding: 40px 20px;
  }

  .hero-stats {
    gap: 32px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  /* Steps */
  .steps {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .features {
    padding: 40px 20px;
  }

  .notice-section {
    padding: 0 20px 40px;
  }

  /* Form */
  .form-card {
    padding: 24px 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .page-container {
    padding: 28px 16px 48px;
  }

  /* Query */
  .query-card {
    padding: 28px 20px;
  }

  /* Result */
  .result-header {
    padding: 20px;
  }

  .result-student {
    padding: 20px;
  }

  .result-total {
    padding: 20px;
  }

  .total-score {
    font-size: 2.2rem;
  }

  .score-table th,
  .score-table td {
    padding: 12px 16px;
  }

  .result-actions {
    flex-direction: column;
    padding: 20px;
  }

  /* Admin */
  .login-card {
    padding: 28px 20px;
  }

  .tab-content {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
    gap: 12px;
  }

  .stat-card-icon {
    width: 40px;
    height: 40px;
  }

  .stat-card-value {
    font-size: 1.2rem;
  }

  .table-toolbar {
    flex-direction: column;
  }

  .search-box {
    min-width: auto;
  }

  /* Modal */
  .modal {
    max-width: 100%;
    margin: 0 12px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .score-entry-grid {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-footer {
    padding: 16px 20px 20px;
  }

  /* Toast */
  .toast-container {
    right: 12px;
    left: 12px;
  }

  .toast {
    max-width: 100%;
  }

  /* Buttons */
  .btn-lg {
    padding: 14px 24px;
    font-size: 0.95rem;
  }

  .photo-done img,
  .photo-done .btn-outline {
    width: 130px;
  }

  .photo-done img {
    height: 182px;
  }

  #examCardDone img {
    width: 240px;
    height: 160px;
  }

  .photo-progress {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    padding: 0 20px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .success-card .btn {
    width: 100%;
  }

  .confirm-card {
    padding: 28px 20px;
  }

  .confirm-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .confirm-photos {
    flex-direction: column;
    gap: 20px;
  }

  .confirm-photo-item {
    width: 100%;
  }

  .confirm-photo-item img {
    height: 140px;
    width: auto;
  }

  .confirm-photo-item:last-child img {
    height: 140px;
  }

  .confirm-actions {
    flex-direction: column;
    gap: 12px;
  }

  .confirm-actions .btn {
    width: 100%;
  }
}

/* Small Mobile */
@media (max-width: 380px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-desc {
    font-size: 0.9rem;
  }

  .hero-stats {
    gap: 20px;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .score-table th,
  .score-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .total-score {
    font-size: 1.8rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Floating QR Code ===== */
.qr-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.qr-float-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary, #2563eb);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.qr-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
}

.qr-float-btn:active {
  transform: scale(0.95);
}

.qr-popup {
  position: absolute;
  bottom: 60px;
  right: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  padding: 20px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
  min-width: 240px;
}

.qr-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.qr-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
}

.qr-popup-close {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.qr-popup-close:hover {
  background: #f1f1f4;
  color: #333;
}

.qr-popup-img {
  display: block;
  max-width: 200px;
  margin: 0 auto;
  border-radius: 8px;
}

.qr-popup-url {
  margin-top: 10px;
  font-size: 13px;
  color: #888;
  font-family: monospace;
}

/* Desktop Large */
@media (min-width: 1400px) {
  .hero-content {
    max-width: 800px;
  }

  .steps {
    gap: 28px;
  }
}
