:root {
  --wine: #7d1f2c;
  --ink: #241913;
  --muted: rgba(36, 25, 19, 0.68);
  --line: rgba(72, 38, 26, 0.12);
  --green: #3f8156;
  --red: #b53a3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(18, 42, 24, 0.06), rgba(18, 42, 24, 0.18)),
    url("/static/second_degree/images/campus-bg.png") center/cover no-repeat fixed;
}

.page-stage {
  min-height: 100vh;
  padding: 20px;
  display: grid;
  place-items: start center;
}

.login-body .page-stage {
  place-items: center center;
}

.panel-shell {
  width: min(1160px, 100%);
  background: linear-gradient(180deg, rgba(247, 240, 232, 0.8), rgba(247, 240, 232, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.login-shell {
  width: min(460px, calc(100vw - 320px));
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.login-card {
  border-radius: 26px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(247, 240, 232, 0.36), rgba(247, 240, 232, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(28px) saturate(1.1);
  text-align: center;
}

.login-inline-footer {
  padding: 8px 8px 0;
  color: rgba(36, 25, 19, 0.82);
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.42);
  border-top: 1px solid rgba(72, 38, 26, 0.08);
  margin-top: 8px;
}

.login-inline-footer .footer-line {
  gap: 3px 8px;
}

.login-inline-footer .footer-line + .footer-line {
  margin-top: 2px;
}

.page-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(72, 38, 26, 0.08);
}

.page-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header-main {
  min-width: 0;
  flex: 1 1 auto;
}

.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.header-logout-btn {
  min-width: 112px;
  height: 38px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.brand-line, .brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup {
  justify-content: center;
  margin-bottom: 8px;
}

.brand-logo {
  width: 64px;
  height: auto;
  display: block;
}

.brand-cn {
  display: block;
  font-family: "STSong", "SimSun", serif;
  font-size: 20px;
  font-weight: 600;
}

.brand-en {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: 0.16em;
  color: rgba(60, 35, 24, 0.72);
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 600;
  color: #452519;
}

.login-card .page-title { margin-bottom: 12px; }

.page-pad { margin: 0 24px 18px; }

.message-box {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
}

.hidden { display: none !important; }
.message-box.info { background: rgba(234, 244, 251, 0.88); border: 1px solid rgba(45, 134, 200, 0.16); color: #365063; }
.message-box.error { background: rgba(250, 234, 234, 0.9); border: 1px solid rgba(181, 58, 58, 0.16); color: #8a2f2f; }
.message-box.success { background: rgba(232, 247, 237, 0.9); border: 1px solid rgba(63, 129, 86, 0.16); color: #356748; }

.notice-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(45, 134, 200, 0.16);
  background: linear-gradient(180deg, rgba(234, 244, 251, 0.88), rgba(234, 244, 251, 0.74));
  color: #365063;
  line-height: 1.8;
  font-size: 13px;
}

.section-title {
  margin: 0;
  padding: 12px 24px;
  background: linear-gradient(90deg, #2584cb, #49a7df);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.section-heading {
  position: relative;
  padding: 0 24px 12px;
}

.section-heading .section-title {
  width: 100%;
  border-radius: 16px;
  padding-right: 152px;
}

.section-heading-btn {
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(calc(-50% - 6px));
  width: 55px;
  min-width: 55px;
  max-width: 55px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  z-index: 1;
}

.steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 24px 18px;
}

.step {
  min-width: 150px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(72, 38, 26, 0.08);
  color: rgba(36, 25, 19, 0.68);
  font-weight: 700;
}

.step.active { background: linear-gradient(135deg, #2d86c8, #55a8e2); color: #fff; }
.step.done { background: rgba(77, 151, 102, 0.16); color: #32533d; }

.form-panel { max-width: 320px; margin: 0 auto; text-align: left; }
.compact-form { display: grid; gap: 10px; }
.compact-form .button-stack { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 22px; align-items: start; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }

.field label, .photo-title, .option-title, .card-title {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: rgba(36, 25, 19, 0.78);
  font-weight: 700;
}

.req { color: #d64d4d; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, .value-box {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
}

.field-invalid {
  border-color: rgba(181, 58, 58, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(181, 58, 58, 0.12);
}

.field-error {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #a23838;
}

.field-label-error {
  color: #a23838 !important;
}

.value-box { display: flex; align-items: center; }

.field-tip, .hint-block, .debug-card {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: #6f7d85;
}

.debug-card {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px dashed rgba(72, 38, 26, 0.18);
}

.photo-card, .option-card, .summary-card, .fee-card, .info-box, .result-hero {
  border-radius: 18px;
  border: 1px solid rgba(72, 38, 26, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.photo-card, .summary-card, .fee-card, .result-hero, .info-box { padding: 14px; }

.photo-box {
  width: 132px;
  aspect-ratio: 35 / 49;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px dashed rgba(37, 26, 21, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 242, 238, 0.72));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box img:not([src]), .photo-box img[src=""] { opacity: 0; }
.file-input { display: block; width: 100%; margin-top: 12px; font-size: 12px; }

.download-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--wine);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.option-card { margin: 0 24px 18px; padding: 14px 16px; }
.radio-group, .pill-row { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.radio-group label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.major-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(72, 38, 26, 0.1);
  background: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  color: rgba(36, 25, 19, 0.7);
}

.major-pill.selected {
  border-color: rgba(125, 31, 44, 0.22);
  background: linear-gradient(135deg, rgba(125, 31, 44, 0.12), rgba(167, 64, 74, 0.18));
  color: #6d1f2b;
  font-weight: 700;
}

.payment-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr); gap: 18px; }
.summary-grid, .result-cards { display: grid; gap: 12px; }
.summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 24px 18px; }
.info-box.full { grid-column: 1 / -1; }
.info-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.info-value { font-size: 15px; font-weight: 700; color: rgba(36, 25, 19, 0.92); }

.fee-label { font-size: 14px; color: rgba(36, 25, 19, 0.72); }
.fee-amount { margin-top: 8px; font-size: clamp(34px, 5vw, 46px); line-height: 1; font-weight: 800; color: var(--wine); }
.fee-amount span { font-size: 18px; margin-left: 4px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.status-pill.pending { background: rgba(237, 179, 59, 0.18); color: #8b5a13; }
.status-pill.success { background: rgba(77, 151, 102, 0.16); color: #32533d; }

.tips-list { display: grid; gap: 8px; margin-top: 10px; font-size: 13px; line-height: 1.75; color: rgba(36, 25, 19, 0.72); }
.button-stack, .action-bar { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.button-stack { margin-top: 12px; }
.compact-stack { margin-top: 10px; }
.action-bar { padding: 0 24px 10px; }
.action-bar.dual { padding-bottom: 16px; }

.btn {
  min-width: 148px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.primary-btn { color: #fff; background: linear-gradient(135deg, var(--wine), #a7404a); box-shadow: 0 14px 24px rgba(125, 31, 44, 0.18); }
.ghost-btn { background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(72, 38, 26, 0.12); color: rgba(36, 25, 19, 0.82); }
.wide-btn { width: 100%; }

/* Override the generic .btn min-width only for the section logout action. */
.section-heading .section-heading-btn {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
}

.result-hero { text-align: center; }
.success-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(63, 129, 86, 0.14);
  color: var(--green);
  font-size: 34px;
  font-weight: 800;
}

.result-hero h2 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 34px); color: #3b5e47; }
.result-hero p { margin: 0 auto; max-width: 620px; line-height: 1.9; color: rgba(36, 25, 19, 0.72); font-size: 14px; }

.page-footer {
  padding: 16px 24px 24px;
  text-align: center;
  color: rgba(36, 25, 19, 0.66);
  font-size: 11px;
  line-height: 1.7;
}

.footer-line {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.footer-line + .footer-line { margin-top: 4px; }
.footer-sep { color: rgba(36, 25, 19, 0.34); }

@media (max-width: 900px) {
  .form-grid, .payment-grid { grid-template-columns: 1fr; }
  .photo-card { order: -1; }
  .form-fields, .summary-grid, .result-cards { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .login-shell {
    width: min(100%, 460px);
    min-height: auto;
  }
}

@media (max-width: 560px) {
  body { background-attachment: scroll; }
  .page-stage { padding: 10px; }
  .login-shell { min-height: auto; }
  .page-header, .steps, .section-title, .action-bar, .page-footer { padding-left: 14px; padding-right: 14px; }
  .page-pad, .option-card, .result-cards { margin-left: 14px; margin-right: 14px; }
  .steps .step { min-width: auto; flex: 1 1 120px; }
  .button-stack, .action-bar { flex-direction: column; }
  .btn { width: 100%; }
  .page-header-bar { flex-direction: column; }
  .page-header-actions { width: 100%; }
  .header-logout-btn { width: 100%; }
  .section-heading { padding-left: 14px; padding-right: 14px; }
  .section-heading .section-title { padding-right: 126px; }
  .section-heading .section-heading-btn { right: 14px; width: 70px; min-width: 70px; max-width: 70px; }
  .footer-sep { display: none; }
}
