.sd-register {
  --sd-ink: #142d49;
  --sd-muted: #50657d;
  --sd-line: #dce6f2;
  --sd-blue: #155caa;
  --sd-surface: #f4f7fc;
  max-width: 1168px;
  padding: 30px 24px 48px;
  color: var(--sd-ink);
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", sans-serif;
}

.sd-register [hidden] { display: none !important; }
.sd-register :focus-visible { outline: 3px solid #4693eb; outline-offset: 3px; }
.sd-register .sd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sd-register-header {
  overflow: hidden;
  padding: 21px 30px 24px;
  border-radius: 20px;
  background: linear-gradient(115deg, #122d4b, #16558a);
  color: white;
  box-shadow: 0 10px 25px #123b631c;
}

.sd-register-nav, .sd-register-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sd-register-nav a {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #ffffff42;
  border-radius: 9px;
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.sd-register-nav a:hover { background: #ffffff1c; }
.sd-register-nav a:focus-visible { outline-color: white; }
.sd-register .sd-role {
  padding: 3px 10px;
  border: 1px solid #ffffff35;
  border-radius: 20px;
  background: #ffffff16;
  color: #eff7ff;
  font-size: 12px;
  white-space: nowrap;
}

.sd-register-title { margin-top: 16px; }
.sd-register-title h1 {
  margin: 0;
  color: white;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.25;
}

.sd-register-title p { margin: 7px 0 0; color: #d4e8fd; }
.sd-register-title svg {
  flex: 0 0 auto;
  width: clamp(50px, 9vw, 82px);
  height: auto;
  color: #a8d4ff;
}

.sd-register-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(0, 1.65fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
  padding: 17px;
  border: 1px solid var(--sd-line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 3px 12px #173b6210;
}

.sd-register .sd-search { position: relative; display: block; min-width: 0; }
.sd-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  color: var(--sd-blue);
  pointer-events: none;
}

.sd-register .sd-search input, .sd-register .sd-filter-fields select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid #b9cbe0;
  border-radius: 9px;
  background: white;
  color: var(--sd-ink);
}

.sd-register .sd-search input { padding-left: 39px; }
.sd-register .sd-search input::placeholder { color: var(--sd-muted); }
.sd-filter-details { min-width: 0; }
.sd-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sd-filter-fields label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.sd-filter-fields select { font-weight: 400; }
.sd-filter-actions, .sd-record-actions, .sd-pagination > div { display: flex; gap: 8px; }
.sd-register .sd-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid #bdcde0;
  border-radius: 9px;
  background: white;
  color: var(--sd-ink);
  font-weight: 600;
  white-space: nowrap;
}

.sd-register .sd-button:hover:enabled { background: #edf5ff; border-color: #7da9d8; }
.sd-register .sd-button-primary { background: var(--sd-blue); border-color: var(--sd-blue); color: white; }
.sd-register .sd-button-primary:hover:enabled { background: #104b8d; border-color: #104b8d; }
.sd-register .sd-button-danger { color: #a1293b; }
.sd-register .sd-button-danger:hover:enabled { background: #fff1f3; border-color: #e1aab4; }

.sd-results { margin-top: 26px; }
.sd-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.sd-results-header h2 { margin: 0; font-size: 19px; }
.sd-result-count { color: var(--sd-muted); font-size: 13px; }
.sd-register .sd-list-message {
  margin: 0 0 10px;
  padding: 20px;
  border: 1px dashed #bdcde0;
  border-radius: 13px;
  background: white;
  color: var(--sd-muted);
  text-align: center;
  overflow-wrap: anywhere;
}

.sd-register .sd-list-message:empty { margin: 0; padding: 0; border: 0; }
.sd-register .sd-list-error { border-style: solid; border-color: #e4b9c0; background: #fff4f5; color: #9a2a3c; }
.sd-register .sd-records { gap: 12px; }
.sd-register-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  align-items: start;
  column-gap: 20px;
  row-gap: 12px;
  padding: 16px 18px 12px;
  border: 1px solid var(--sd-line);
  border-radius: 15px;
  background: white;
  box-shadow: 0 3px 12px #173b6210;
}

.sd-record-header, .sd-identity, .sd-record-tags, .sd-student-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sd-record-header { align-self: center; gap: 10px 16px; }
.sd-identity { flex-wrap: nowrap; gap: 10px; }
.sd-identity > div { min-width: 0; overflow-wrap: anywhere; }
.sd-register .sd-avatar {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  height: 42px;
  border-radius: 11px;
  background: #e5effc;
  color: #194e86;
  font-size: 17px;
  font-weight: 700;
}

.sd-identity h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.sd-student-meta { gap: 0 8px; color: var(--sd-muted); font-size: 13px; }
.sd-student-meta span + span { padding-left: 8px; border-left: 1px solid #bccada; }
.sd-record-tags { gap: 6px; }
.sd-type, .sd-status {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 7px;
  background: #eaf2fe;
  color: #164f89;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.sd-status { background: #eef1f5; color: #455a73; }
.sd-status[data-status="active"] { background: #e6f5ee; color: #196044; }
.sd-status[data-status="review"], .sd-status[data-status="pending"] { background: #fff2d9; color: #754d07; }
.sd-status[data-status="revoked"] { background: #fbecef; color: #9b3347; }

.sd-record-dates, .sd-record-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.sd-record-dates {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr));
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--sd-surface);
}
.sd-record-dates dt, .sd-record-facts dt { color: var(--sd-muted); font-size: 12px; }
.sd-record-dates dd, .sd-record-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.sd-record-dates dd { font-weight: 650; font-variant-numeric: tabular-nums; }
.sd-record-reason { grid-column: 1 / -1; }
.sd-record-reason dd { white-space: pre-wrap; }
.sd-record-details {
  grid-column: 1 / -1;
  min-width: 0;
  border-top: 1px solid var(--sd-line);
}

.sd-record-details summary, .sd-filter-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  width: fit-content;
  max-width: 100%;
  color: var(--sd-blue);
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.sd-record-details summary::-webkit-details-marker, .sd-filter-details summary::-webkit-details-marker { display: none; }
.sd-record-details summary::after, .sd-filter-details summary::after {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.sd-record-details[open] summary::after, .sd-filter-details[open] summary::after { transform: translateY(2px) rotate(225deg); }
.sd-record-body { padding: 12px; border-radius: 10px; background: var(--sd-surface); }
.sd-record-actions { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-end; }
.sd-register .sd-export { color: var(--sd-blue); background: #edf5ff; }
.sd-export-message { grid-column: 1 / -1; color: #9a2a3c; overflow-wrap: anywhere; }
.sd-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }
.sd-pagination > span { color: var(--sd-muted); }

@media (min-width: 641px) {
  .sd-filter-details[open] summary { display: none; }
  .sd-register-record:has(.sd-record-actions) .sd-record-details:not([open]) { grid-column: 1; border-top: 0; }
  .sd-record-details:not([open]) + .sd-record-actions { grid-column: 2; }
}

@media (max-width: 760px) {
  .sd-register-filter { grid-template-columns: minmax(140px, 1fr) minmax(0, 1.8fr) auto; gap: 10px; }
  .sd-register .sd-button { padding-inline: 11px; }
}

@media (max-width: 640px) {
  .sd-register { padding: 12px 12px 32px; }
  .sd-register-header { padding: 14px 15px 17px; border-radius: 15px; }
  .sd-register-title { margin-top: 12px; }
  .sd-register-filter { grid-template-columns: minmax(0, 1fr); margin-top: 12px; padding: 12px; gap: 8px; }
  .sd-filter-details { border-top: 1px solid var(--sd-line); }
  .sd-filter-details summary { width: 100%; }
  .sd-filter-details summary span { flex: 1; color: var(--sd-muted); font-size: 12px; text-align: right; }
  .sd-filter-fields { padding-bottom: 5px; }
  .sd-filter-actions { justify-content: flex-end; }
  .sd-filter-actions .sd-button-primary { min-width: 84px; }
  .sd-register .sd-search input, .sd-register .sd-filter-fields select { font-size: 16px; }
  .sd-results { margin-top: 20px; }
  .sd-register-record { grid-template-columns: minmax(0, 1fr); padding: 13px 12px 8px; gap: 9px; }
  .sd-record-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .sd-student-meta span + span { padding-left: 0; border-left: 0; }
  .sd-record-dates, .sd-record-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-record-actions { justify-content: flex-start; padding-bottom: 5px; }
}
