:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #1f2b3d;
  --muted: #5f6d82;
  --line: #dce4f0;
  --primary: #0f766e;
  --danger: #b42318;
  --warn-bg: #fff7e8;
  --ok-bg: #ecfdf3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #eef3fb 0%, #f9fbff 100%);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.page {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 14px 12px 28px;
}

.quick-bar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px 7px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.95);
  color: #fff;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.25);
  font-size: 14px;
  font-weight: 800;
}

.quick-bar[hidden] {
  display: none;
}

.quick-bar button {
  border: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}

.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(28, 48, 77, 0.08);
  padding: 14px;
  margin-bottom: 12px;
}

.card.submit-card-flash {
  animation: submitCardPulse 1.4s ease-in-out 3;
}

h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

h2 {
  margin: 0;
  font-size: 18px;
}

.tip {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.tip.small {
  font-size: 13px;
}

.submit-hint {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff1d6;
  border: 1px solid #ffd28a;
  color: #8a4b00;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.success-guide {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef7ff;
  border: 1px solid #cfe3ff;
  color: #1f4f85;
  font-size: 14px;
  line-height: 1.6;
}

.submit-selected-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #dce4f0;
  border-radius: 12px;
  background: #f8fbff;
}

.submit-selected-box strong {
  display: block;
  color: #172033;
  font-size: 16px;
  margin-bottom: 6px;
}

.submit-selected-box p {
  margin: 0;
  color: #5f6d82;
  font-size: 14px;
  line-height: 1.6;
}

.submit-selected-box.has-selection {
  border-color: #a8d8cd;
  background: #f0fbf7;
}

.submit-selected-item {
  display: block;
  margin-top: 6px;
}

.submit-selected-item strong {
  display: block;
  margin: 0;
  color: #0f5d50;
  font-weight: 800;
  font-size: 14px;
}

.submit-selected-item em {
  display: block;
  margin-top: 1px;
  color: #536579;
  font-style: normal;
  font-size: 13px;
  line-height: 1.45;
}

.notice-img {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  border: 1px solid #dbe4ef;
  margin-top: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

label span {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  color: #334763;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  background: #fcfdff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #5b87ff;
  box-shadow: 0 0 0 3px rgba(91, 135, 255, 0.15);
}

input.field-error,
textarea.field-error {
  border-color: #d92d20;
  background: #fff7f6;
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.18);
}

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

.class-list {
  display: grid;
  gap: 18px;
}

.class-item {
  position: relative;
  border: 2px solid #d9e3ef;
  border-left: 6px solid #b8c9dc;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 43, 61, 0.08);
}

.class-item.selected {
  border-color: #0f766e;
  border-left-color: #0f766e;
  background: #ecfdf7;
  box-shadow: 0 10px 26px rgba(15, 118, 110, 0.18);
}

.class-item.selected::after {
  content: "已选择";
  position: absolute;
  right: 14px;
  bottom: 58px;
  border-radius: 999px;
  padding: 3px 10px;
  background: #0f766e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.class-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.course-name {
  font-size: 16px;
  font-weight: 600;
}

.badge {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.ok {
  background: var(--ok-bg);
  color: #0f7a31;
}

.badge.full {
  background: #ffebe9;
  color: var(--danger);
}

.meta {
  margin-top: 6px;
  color: #50627d;
  font-size: 13px;
  line-height: 1.45;
}

.remark {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff8eb;
  color: #6d4b16;
  font-size: 13px;
  line-height: 1.55;
}

.adjust {
  margin-top: 6px;
  color: #174ea6;
  font-size: 13px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.btn.primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, #0f766e 0%, #0b9c8e 100%);
}

.btn.primary.submit-flash {
  animation: submitPulse 1.4s ease-in-out 3;
}

.btn.ghost {
  color: #194072;
  background: #e8f0fb;
}

.btn.mini {
  margin-top: 12px;
  width: 100%;
  font-size: 16px;
  font-weight: 800;
  background: #e8f1ff;
  color: #123f7a;
}

@keyframes submitPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.55);
    transform: scale(1);
  }
  45% {
    box-shadow: 0 0 0 12px rgba(15, 118, 110, 0);
    transform: scale(1.035);
    filter: brightness(1.12);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
    transform: scale(1);
  }
}

@keyframes submitCardPulse {
  0% {
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(28, 48, 77, 0.08);
  }
  45% {
    background: #fff8df;
    box-shadow: 0 0 0 4px rgba(255, 189, 46, 0.38), 0 16px 34px rgba(15, 118, 110, 0.18);
  }
  100% {
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(28, 48, 77, 0.08);
  }
}

.class-item.selected .btn.mini {
  background: #0f766e;
  color: #ffffff;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.result-item {
  border-top: 1px dashed #dde5f0;
  padding-top: 10px;
  margin-top: 10px;
}

.result-title {
  font-size: 15px;
  font-weight: 600;
}

.result-message {
  margin-top: 4px;
  font-size: 13px;
  color: #334e72;
}

.qr-wrap {
  margin-top: 8px;
}

.qr-wrap span {
  display: block;
  font-size: 12px;
  color: #5d6f89;
  margin-bottom: 4px;
}

.qr-wrap img {
  width: 140px;
  height: 140px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(29, 43, 66, 0.9);
  color: #fff;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 999px;
  max-width: calc(100vw - 30px);
  text-align: center;
  z-index: 30;
}

.dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.dialog-mask[hidden] {
  display: none;
}

.dialog-box {
  width: min(420px, 100%);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  padding: 22px 18px 18px;
  text-align: center;
}

.dialog-title {
  font-size: 22px;
  font-weight: 800;
  color: #172033;
}

.dialog-message {
  margin-top: 12px;
  color: #26364d;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.65;
}

.dialog-danger {
  color: #b42318;
  font-size: 22px;
  font-weight: 900;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.dialog-btn {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 13px 10px;
  background: #edf2fa;
  color: #21324a;
  font-size: 17px;
  font-weight: 700;
}

.dialog-btn.primary {
  background: #0f766e;
  color: #fff;
}

@media (min-width: 640px) {
  .page {
    padding-top: 20px;
  }

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

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

  .btn.mini {
    width: auto;
    min-width: 100px;
  }
}
