:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #65717f;
  --border: #dbe1e8;
  --primary: #1f6feb;
  --primary-dark: #1556bd;
  --success: #16794c;
  --success-bg: #e8f7ef;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --warning-bg: #fff5da;
  --shadow: 0 12px 28px rgba(26, 39, 57, 0.08);
  --shadow-hover: 0 16px 34px rgba(26, 39, 57, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  min-height: 64px;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}

.topbar-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 2px;
}

.nav a:hover {
  color: var(--primary);
}

.nav form {
  margin: 0;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  min-height: auto;
  font-weight: 600;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto 56px;
}

.panel,
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 22px;
  animation: panel-in 260ms ease both;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.panel:hover,
.auth-panel:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.auth-panel {
  width: min(460px, 100%);
  margin: 80px auto;
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 22px;
}

p {
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

/* 左侧标题+说明：占满剩余宽度，长文案可自然换行 */
.section-heading > div:first-child {
  min-width: 0;
  flex: 1 1 280px;
}

.section-heading h2 {
  margin: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 1 auto;
  max-width: 100%;
  padding-top: 2px;
}

.section-heading > .toolbar {
  margin-left: auto;
}

.form {
  display: grid;
  gap: 18px;
}

.grid-form {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  color: #2b3440;
  font-weight: 700;
}

.check-line {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.check-line input {
  min-height: 18px;
  width: 18px;
  margin: 3px 0 0;
}

input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

/* Prevent iOS zoom on focus: keep form controls >= 16px */
input,
textarea,
select,
button {
  font-size: 16px;
}

input:focus {
  outline: 3px solid rgba(31, 111, 235, 0.14);
  border-color: var(--primary);
}

.compact-select {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 34px 0 12px;
  font: inherit;
}

.compact-select:focus {
  outline: 3px solid rgba(31, 111, 235, 0.14);
  border-color: var(--primary);
}

.primary-action,
button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 120ms ease;
}

button:hover:not(:disabled),
.primary-action:hover:not(:disabled) {
  box-shadow: 0 8px 18px rgba(26, 39, 57, 0.10);
  transform: translateY(-1px);
}

button:active:not(:disabled),
.primary-action:active:not(:disabled) {
  box-shadow: none;
  transform: translateY(0);
}

.primary-action {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

.primary-action:hover {
  background: var(--primary-dark);
}

a.primary-action {
  text-decoration: none;
}

.primary-action-block {
  width: 100%;
}

.danger-action {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  font-weight: 700;
}

.danger-action:hover:not(:disabled) {
  background: #9f1f17;
  border-color: #9f1f17;
}

button:disabled,
.primary-action:disabled,
.danger-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button.copied {
  border-color: #bfe8d0;
  background: var(--success-bg);
  color: var(--success);
}

.hint {
  margin: 0;
  font-size: 14px;
}

.credential-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1.1fr);
  align-items: start;
  gap: 28px;
}

.auth-reference {
  margin: 0;
}

.auth-reference img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.auth-reference figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.loading-notice {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #b8d2ff;
  border-radius: 8px;
  background: #edf5ff;
  color: #1b4f9c;
  padding: 12px 14px;
  font-weight: 700;
  animation: panel-in 180ms ease both;
}

.loading-notice[hidden] {
  display: none;
}

.spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 3px solid rgba(31, 111, 235, 0.22);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 820ms linear infinite;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  margin-right: 8px;
}

.form.is-submitting input {
  background: #f8fafc;
}

.alert {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f8c9c5;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success);
  border-color: #bfe8d0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  transition: color 180ms ease, transform 180ms ease;
}

.stat strong.stat-updated {
  color: var(--primary);
  transform: translateY(-1px);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.record-table {
  min-width: 920px;
  table-layout: fixed;
  width: 100%;
}

.record-table th,
.record-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-table .select-col {
  width: 44px;
  text-align: center;
}

.record-table .col-time {
  width: 124px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.record-table .col-account {
  width: 18%;
}

.record-table .col-password {
  width: 17%;
}

.record-table .col-status {
  width: 76px;
  text-align: center;
}

.record-table .col-message {
  width: 24%;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  line-height: 1.45;
}

.record-table .col-download {
  width: 64px;
  text-align: center;
}

.record-table .col-actions {
  width: 88px;
  text-align: center;
}

.record-table .col-password code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

tbody tr {
  animation: row-in 220ms ease both;
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    opacity 170ms ease,
    transform 170ms ease;
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr:has(.cdk-select:checked) {
  background: #edf5ff;
}

tbody tr.row-created {
  animation: row-added 360ms ease both;
}

tbody tr.row-removing {
  opacity: 0;
  transform: translateX(16px);
}

tbody tr.is-filtered-out {
  display: none;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #fafbfc;
}

.select-col {
  width: 42px;
  text-align: center;
}

.select-checkbox {
  min-height: 18px;
  width: 18px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

code {
  background: #eef2f7;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  padding: 3px 6px;
  color: #223044;
}

.copy-code {
  min-height: 30px;
  border-radius: 6px;
  border: 1px solid #d7dee8;
  background: #eef2f7;
  color: #4b5b70;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 14px;
  padding: 3px 8px;
}

.copy-code:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: #edf5ff;
}

.copy-code.copied {
  border-color: #bfe8d0;
  background: var(--success-bg);
  color: var(--success);
}

.status,
.pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  background: #edf2f7;
  color: var(--muted);
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

tbody tr:hover .status,
tbody tr:hover .pill {
  transform: translateY(-1px);
}

.status.ok {
  background: var(--success-bg);
  color: var(--success);
}

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

.status.muted {
  background: var(--warning-bg);
  color: #8a5a00;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions form {
  margin: 0;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes row-added {
  from {
    background: #edf5ff;
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    background: transparent;
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* ---------- Mobile-first enterprise layout ---------- */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

.result-panel {
  text-align: left;
}

.result-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success-bg);
  color: var(--success);
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 12px;
  border: 1px solid #b7e4c7;
}

.result-desc,
.hero-desc {
  margin: 10px 0 0;
}

.mobile-auth-tip {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 820px) {
  .topbar {
    min-height: 56px;
    padding-top: env(safe-area-inset-top);
  }

  .topbar-inner {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    gap: 12px;
  }

  .brand {
    font-size: 0.98rem;
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav {
    gap: 10px 12px;
    flex-wrap: nowrap;
  }

  .nav a,
  .nav .link-button {
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .page {
    width: 100%;
    margin: 16px 0 40px;
    padding: 0 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .panel,
  .auth-panel {
    padding: 18px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    box-shadow: 0 6px 18px rgba(26, 39, 57, 0.06);
  }

  .panel:hover,
  .auth-panel:hover {
    transform: none;
    box-shadow: 0 6px 18px rgba(26, 39, 57, 0.06);
  }

  .intro,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }

  .section-heading > div:first-child {
    flex: 1 1 auto;
    width: 100%;
  }

  .section-heading > .toolbar {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    max-width: 100%;
  }

  .section-desc {
    max-width: 100%;
  }

  .student-hero h1 {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  .hero-desc {
    font-size: 0.92rem;
    line-height: 1.55;
  }

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

  .stat {
    padding: 14px;
  }

  .stat strong {
    font-size: 22px;
  }

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

  .credential-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Enterprise mobile: form first, hide bulky reference screenshot */
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block;
  }

  .auth-reference {
    order: 0;
  }

  .form {
    gap: 14px;
  }

  label {
    font-size: 0.92rem;
    gap: 6px;
  }

  input,
  textarea,
  select {
    min-height: 48px;
    border-radius: 10px;
    font-size: 16px;
  }

  textarea {
    min-height: 120px;
  }

  .check-line {
    font-size: 0.88rem;
    line-height: 1.45;
    gap: 12px;
  }

  .check-line input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin-top: 1px;
  }

  .primary-action,
  .secondary-action,
  .danger-action,
  button {
    min-height: 48px;
    border-radius: 10px;
    width: 100%;
  }

  .toolbar {
    width: 100%;
    gap: 8px;
  }

  .toolbar .primary-action,
  .toolbar .secondary-action,
  .toolbar .danger-action,
  .toolbar button,
  .toolbar .compact-select {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .section-heading .pill {
    align-self: flex-start;
  }

  .alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .loading-notice {
    font-size: 0.9rem;
    padding: 12px;
  }

  .auth-panel {
    width: 100%;
    margin: 24px auto;
  }

  .result-panel {
    text-align: center;
  }

  .result-panel .result-desc {
    margin-bottom: 16px;
  }

  .table-wrap {
    margin: 0 -4px;
    border-radius: 10px;
  }

  table {
    min-width: 720px;
  }

  .record-table {
    min-width: 920px;
  }

  th,
  td {
    padding: 11px 10px;
    font-size: 0.9rem;
  }

  .modal-overlay {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    align-items: flex-end;
  }

  .modal-card {
    width: 100%;
    max-height: min(88vh, 720px);
    border-radius: 16px 16px 12px 12px;
  }
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-inner {
    padding: 0 12px;
  }

  .page {
    padding: 0 12px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .panel,
  .auth-panel {
    padding: 16px 14px;
  }

  .brand {
    max-width: 46vw;
  }

  .nav {
    gap: 8px;
  }

  .intro p.hero-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

.proxy-panel .proxy-import-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef2f6;
}

.proxy-import-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.proxy-import-actions .primary-action {
  width: auto;
  min-width: 120px;
}

.proxy-list-card {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfe;
  overflow: hidden;
}

.proxy-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #eef2f6;
}

.proxy-list-left,
.proxy-list-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proxy-list-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.proxy-tool-btn {
  width: auto !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 0.88rem;
}

.proxy-table-wrap {
  margin: 0;
  background: #fff;
}

.proxy-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.proxy-table th,
.proxy-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.proxy-table .col-check {
  width: 48px;
  text-align: center;
}

.proxy-table .col-endpoint {
  width: 24%;
}

.proxy-table .col-account {
  width: 14%;
}

.proxy-table .col-status {
  width: 18%;
}

.proxy-table .col-probe {
  width: 22%;
}

.proxy-table .col-score {
  width: 10%;
  white-space: nowrap;
}

.proxy-table .col-actions {
  width: 168px;
}

.proxy-table .col-endpoint code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.proxy-table .proxy-msg {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  color: var(--muted);
}

.proxy-table .status-gap {
  margin-left: 6px;
}

.proxy-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.proxy-row-actions form {
  margin: 0;
  display: inline-flex;
}

.proxy-mini-btn {
  width: auto !important;
  min-height: 32px !important;
  min-width: 0 !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  font-size: 0.82rem !important;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.proxy-mini-btn:hover:not(:disabled) {
  border-color: #93b4e8;
  background: #f5f9ff;
  color: var(--primary);
}

.proxy-mini-danger {
  color: var(--danger) !important;
  border-color: #f0c7c3 !important;
}

.proxy-mini-danger:hover:not(:disabled) {
  background: var(--danger-bg) !important;
  border-color: #e8a9a3 !important;
  color: var(--danger) !important;
}

/* collapsed: only first 5 data rows */
.proxy-table-wrap.is-collapsed tr.proxy-row-extra {
  display: none;
}

@media (max-width: 900px) {
  .proxy-table {
    min-width: 760px;
    table-layout: auto;
  }

  .proxy-list-toolbar {
    align-items: stretch;
  }

  .proxy-list-left,
  .proxy-list-right {
    width: 100%;
  }

  .proxy-tool-btn {
    flex: 1 1 auto;
  }
}

.security-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.security-table th,
.security-table td {
  padding: 11px 12px;
}

.security-table .col-time {
  width: 110px;
}

.security-table .col-status {
  width: 72px;
}

.security-table .ua-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.security-table code {
  font-size: 0.88rem;
}

.announcement-panel {
  overflow: hidden;
}

.announcement-heading {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.announcement-heading-text {
  min-width: 0;
  flex: 1 1 auto;
}

.announcement-heading-text h2 {
  margin-bottom: 6px;
}

.section-desc {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: min(72ch, 100%);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.announcement-toolbar {
  flex-shrink: 0;
  padding-top: 2px;
}

/* 管理后台全宽：说明与工具栏同排时更从容 */
body:has(.admin-shell) .section-heading {
  gap: 12px 28px;
  margin-bottom: 18px;
}

body:has(.admin-shell) .section-heading > div:first-child {
  flex: 1 1 min(420px, 100%);
}

body:has(.admin-shell) .section-desc {
  max-width: min(64ch, 100%);
}

body:has(.admin-shell) .section-heading > .toolbar {
  flex: 0 1 auto;
  align-self: flex-start;
}

/* 工具栏按钮较多（如 CDK 列表）时靠右换行，不挤扁标题 */
body:has(.admin-shell) .section-heading > .toolbar {
  max-width: min(100%, 560px);
}

@media (max-width: 1100px) {
  body:has(.admin-shell) .section-heading > .toolbar {
    max-width: 100%;
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

.announcement-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Do not inherit the 5-column CDK grid-form layout */
.announcement-form.grid-form,
form#announcement-form.grid-form {
  grid-template-columns: none;
  align-items: stretch;
}

.announcement-enable-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #dbe7fb;
  background: linear-gradient(135deg, #f5f9ff 0%, #eef5ff 55%, #f8fafc 100%);
}

.announcement-enable-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.announcement-enable-main .hint-inline {
  margin: 0;
  padding-left: 54px;
  line-height: 1.5;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  width: fit-content;
  max-width: 100%;
}

.switch-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.switch-slider {
  width: 46px;
  height: 26px;
  background-color: #cbd5e1;
  border-radius: 999px;
  position: relative;
  transition: background-color 0.22s ease;
  flex-shrink: 0;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.22s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
}

.switch-label input[type="checkbox"]:checked + .switch-slider {
  background-color: var(--primary);
}

.switch-label input[type="checkbox"]:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-label input[type="checkbox"]:focus-visible + .switch-slider {
  outline: 3px solid rgba(31, 111, 235, 0.28);
  outline-offset: 2px;
}

.switch-text {
  font-size: 0.98rem;
  line-height: 1.3;
}

.hint-inline {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 400;
}

.announcement-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px 18px;
  align-items: start;
}

.announcement-fields .field {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-weight: 400;
  color: inherit;
}

.announcement-fields .field-content {
  grid-column: 1 / -1;
}

.announcement-fields .field-image {
  grid-row: 1 / span 1;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #2b3440;
  font-weight: 700;
  font-size: 0.94rem;
}

.field-optional {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 1px 8px;
}

.announcement-fields input,
.announcement-fields textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.announcement-fields input {
  min-height: 44px;
  padding: 0 12px;
}

.announcement-fields textarea {
  min-height: 150px;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.55;
}

.announcement-fields input:focus,
.announcement-fields textarea:focus {
  outline: 3px solid rgba(31, 111, 235, 0.14);
  border-color: var(--primary);
}

.image-upload-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.image-preview-wrap {
  position: relative;
  min-height: 180px;
  border: 1.5px dashed #c9d4e2;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #fbfcfe 0%, #f5f7fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.image-preview-wrap:hover {
  border-color: #93b4e8;
  background: #f7faff;
}

.image-preview-wrap.is-dragover {
  border-color: var(--primary);
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.15);
}

.image-preview-wrap.has-image {
  border-style: solid;
  border-color: #dbe1e8;
  background: #fff;
  min-height: 200px;
  padding: 10px;
}

.image-preview {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* Prevent browser broken-image glyph when src is empty/missing */
.image-preview[hidden],
.image-preview:not([src]),
.image-preview[src=""] {
  display: none !important;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
}

.image-placeholder-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f0fe;
  color: var(--primary);
  margin-bottom: 4px;
  flex-shrink: 0;
}

.image-placeholder-icon svg {
  display: block;
}

.image-placeholder-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
}

.image-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-pick-btn {
  cursor: pointer;
  margin: 0;
}

.danger-ghost {
  color: var(--danger);
  border-color: #f0c7c3;
  background: #fff;
}

.danger-ghost:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: #e8a9a3;
  color: var(--danger);
}

.image-upload-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.45;
}

.announcement-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid #eef2f6;
  margin-top: 2px;
}

.secondary-action {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}

.secondary-action:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 6px 14px rgba(26, 39, 57, 0.08);
  transform: translateY(-1px);
}

.announcement-actions .primary-action {
  border-radius: 8px;
  min-width: 140px;
}

.announcement-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.2;
}

.announcement-status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.announcement-status-chip.is-on {
  background: var(--success-bg);
  border-color: #b7e4c7;
  color: var(--success);
}

.announcement-status-chip.is-on::before {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 121, 76, 0.12);
}

.announcement-status-chip.is-off {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.announcement-status-chip.is-off::before {
  background: #94a3b8;
}

/* legacy helpers kept for safety */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

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

.form-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.inline-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 1000000;
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.inline-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.inline-toast.is-error {
  background: #7f1d1d;
}

@media (max-width: 820px) {
  .announcement-fields {
    grid-template-columns: 1fr;
  }

  .announcement-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .announcement-toolbar {
    align-self: flex-start;
  }

  .announcement-enable-main .hint-inline {
    padding-left: 0;
  }

  .announcement-actions {
    justify-content: stretch;
  }

  .announcement-actions .secondary-action,
  .announcement-actions .primary-action {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .announcement-enable-card {
    padding: 14px;
  }

  .announcement-actions {
    flex-direction: column-reverse;
  }

  .announcement-actions .secondary-action,
  .announcement-actions .primary-action {
    width: 100%;
  }
}

/* Announcement Modal */
body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  animation: fadeInOverlay 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Critical: display:flex must not override the HTML hidden attribute */
.modal-overlay[hidden],
.modal-overlay.is-hidden {
  display: none !important;
  pointer-events: none !important;
}

.modal-overlay.is-closing {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.modal-overlay.is-closing .modal-card {
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #ffffff;
  width: min(100%, 440px);
  max-height: min(86vh, 720px);
  border-radius: 18px;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.22),
    0 8px 20px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.95);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalScaleUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  color: #b45309;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.45rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

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

.modal-body {
  padding: 18px 20px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-content-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
  word-break: break-word;
  white-space: pre-wrap;
}

.modal-content-text:empty::before {
  content: "暂无公告内容";
  color: #94a3b8;
}

.modal-content-text a {
  color: #1f6feb;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.modal-content-text a:hover {
  color: #1556bd;
}

.modal-content-text b,
.modal-content-text strong {
  color: #0f172a;
  font-weight: 700;
}

.modal-content-text p {
  margin: 0 0 0.65em;
}

.modal-content-text p:last-child {
  margin-bottom: 0;
}

.modal-image-wrapper {
  margin-top: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-image-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  max-width: 100%;
  border: 1px solid #eef2f7;
}

.modal-img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.modal-footer {
  padding: 14px 20px 18px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.modal-footer-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 0.82rem;
  color: #64748b;
}

.text-link-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  color: #64748b;
  cursor: pointer;
  font-size: 0.82rem;
  transition: color 0.15s ease;
}

.text-link-btn:hover {
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-footer-options .sep {
  color: #cbd5e1;
  user-select: none;
}

.modal-primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 9px 22px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(31, 111, 235, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  margin-left: auto;
}

.modal-primary-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(31, 111, 235, 0.36);
}

.modal-primary-btn:active {
  transform: translateY(0);
}

.modal-primary-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .modal-card {
    width: 100%;
    border-radius: 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-primary-btn {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .modal-footer-options {
    justify-content: center;
  }
}

/* ---------- Visual refresh: calm teal workbench ---------- */
:root {
  color-scheme: light;
  --bg: #edf2f2;
  --surface: #ffffff;
  --text: #102c2c;
  --muted: #617375;
  --border: #d8e3e2;
  --primary: #117a74;
  --primary-dark: #0c5c58;
  --success: #0c7a52;
  --success-bg: #e8f6ef;
  --danger: #b33a35;
  --danger-bg: #fceceb;
  --warning-bg: #fff4d8;
  --shadow: 0 10px 30px rgba(16, 44, 44, 0.07);
  --shadow-hover: 0 16px 38px rgba(16, 44, 44, 0.11);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

.topbar {
  min-height: 74px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(216, 227, 226, 0.9);
  box-shadow: 0 3px 18px rgba(16, 44, 44, 0.04);
}

.topbar-inner {
  width: min(1180px, calc(100% - 48px));
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
}

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

.brand-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(17, 122, 116, 0.22);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.nav {
  gap: 7px;
}

.nav a,
.nav .link-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: #526667;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav a:hover,
.nav .link-button:hover {
  background: #e8f4f2;
  color: var(--primary);
}

.nav a:last-child {
  background: #f0f5f4;
  color: var(--primary);
}

.nav a:last-child:hover {
  background: #e1efed;
}

.page {
  width: min(1180px, calc(100% - 48px));
  margin: 34px auto 72px;
}

.panel,
.auth-panel {
  padding: 30px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel:hover,
.auth-panel:hover {
  border-color: #bfd4d2;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.intro {
  align-items: center;
  min-height: 188px;
}

.student-hero {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 38px 42px;
  background: #173f3d;
  border-color: #173f3d;
  box-shadow: 0 16px 36px rgba(23, 63, 61, 0.18);
}

.student-hero:hover {
  border-color: #173f3d;
  box-shadow: 0 20px 42px rgba(23, 63, 61, 0.22);
}

.student-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.student-hero .eyebrow {
  margin-bottom: 11px;
  color: #f2c35c;
  letter-spacing: 0.1em;
}

.student-hero h1 {
  color: #fff;
  font-size: clamp(28px, 3vw, 39px);
  letter-spacing: -0.02em;
}

.student-hero .hero-desc {
  max-width: 620px;
  margin-top: 13px;
  color: rgba(236, 248, 247, 0.78);
  font-size: 14px;
  line-height: 1.75;
}

.student-hero-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(245, 250, 249, 0.68);
  transform: rotate(-8deg);
}

.student-hero-mark-line {
  width: 54px;
  height: 1px;
  background: #f2c35c;
}

.student-hero-mark-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.5;
}

.eyebrow {
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  color: var(--text);
  letter-spacing: -0.015em;
}

h2 {
  font-size: 23px;
}

p {
  color: var(--muted);
}

.section-heading {
  margin-bottom: 20px;
}

.section-desc {
  color: var(--muted);
}

.form {
  gap: 16px;
}

label {
  gap: 7px;
  color: #294242;
  font-size: 14px;
}

input,
textarea,
select,
.compact-select {
  border-color: #cfdddb;
  border-radius: 6px;
  background: #fbfdfd;
  color: var(--text);
}

input:hover,
textarea:hover,
select:hover,
.compact-select:hover {
  border-color: #a9c6c3;
}

input:focus,
textarea:focus,
select:focus,
.compact-select:focus {
  outline: 3px solid rgba(17, 122, 116, 0.14);
  border-color: var(--primary);
  background: #fff;
}

input::placeholder,
textarea::placeholder {
  color: #9aabaa;
}

input[type="checkbox"] {
  accent-color: var(--primary);
}

button,
.primary-action,
.secondary-action,
.danger-action {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 700;
}

button:hover:not(:disabled),
.primary-action:hover:not(:disabled),
.secondary-action:hover:not(:disabled),
.danger-action:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-action {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(17, 122, 116, 0.18);
}

.primary-action:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.secondary-action {
  background: #fff;
  border-color: #bad0cd;
  color: #2e5e5b;
}

.secondary-action:hover:not(:disabled) {
  background: #eef7f5;
  border-color: #7eb2ad;
  color: var(--primary-dark);
}

.danger-action {
  background: #fff;
  border-color: #ebc4c0;
  color: var(--danger);
}

.danger-action:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: #d99690;
}

.alert {
  border-radius: 6px;
  padding: 13px 16px;
  border-width: 1px;
}

.stats-grid {
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 21px 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--primary);
}

.stat:nth-child(2)::before { background: #4387d6; }
.stat:nth-child(3)::before { background: #d69b2c; }
.stat:nth-child(4)::before { background: #cb6059; }

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  margin-top: 7px;
  color: var(--text);
  font-size: 31px;
  letter-spacing: -0.03em;
}

.stat strong.stat-updated {
  color: var(--primary);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 13px 14px;
  border-bottom-color: #e4eceb;
}

th {
  background: #f5f9f8;
  color: #58706f;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: #f1f8f7;
}

tbody tr:has(.cdk-select:checked) {
  background: #e7f4f2;
}

code,
.copy-code {
  border-color: #d1dfdd;
  background: #f0f6f5;
  color: #285451;
}

.copy-code:hover:not(:disabled) {
  border-color: var(--primary);
  background: #e8f5f3;
  color: var(--primary-dark);
}

.status,
.pill {
  min-height: 27px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
}

.status.ok {
  background: var(--success-bg);
  color: var(--success);
}

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

.status.muted {
  background: var(--warning-bg);
  color: #926411;
}

.pill {
  background: #edf4f3;
  color: #376563;
}

.result-panel {
  border-top: 3px solid var(--success);
}

.result-badge {
  border-radius: 8px;
  background: var(--success-bg);
  border-color: #b6dfca;
}

section.panel:has(input[name="cdk_code"]) {
  border-left: 4px solid #d69b2c;
}

section.panel:has(#query-form) {
  border-top: 3px solid var(--primary);
}

.loading-notice {
  border-color: #b8d9d5;
  border-radius: 6px;
  background: #edf8f6;
  color: #27615d;
}

.auth-panel {
  max-width: 470px;
}

body:has(.auth-login-card) {
  background: #e8efee;
}

.auth-login-card {
  margin-top: 76px;
  border-top: 3px solid var(--primary);
}

.auth-login-mark {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #e8f4f2;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

body:has(.stats-grid) .intro {
  min-height: 166px;
  background: #173f3d;
  border-color: #173f3d;
}

body:has(.stats-grid) .intro:hover {
  border-color: #173f3d;
}

body:has(.stats-grid) .intro .eyebrow,
body:has(.stats-grid) .intro h1 {
  color: #fff;
}

body:has(.stats-grid) .intro p:not(.eyebrow) {
  max-width: 720px;
  color: rgba(236, 248, 247, 0.78);
}

.announcement-enable-card {
  border-color: #cfe1df;
  border-radius: 8px;
  background: #f3f8f7;
}

.switch-label input[type="checkbox"]:checked + .switch-slider {
  background-color: var(--primary);
}

.proxy-list-card {
  border-color: #d7e3e1;
  border-radius: 8px;
  background: #f8fbfb;
}

.proxy-list-toolbar {
  background: #f5f9f8;
  border-bottom-color: #dfeae8;
}

.proxy-table-wrap {
  background: #fff;
}

.proxy-mini-btn {
  border-color: #c6d8d6;
  color: #315a58;
}

.proxy-mini-btn:hover:not(:disabled) {
  border-color: #7eb2ad;
  background: #eef7f5;
  color: var(--primary-dark);
}

.inline-toast {
  background: #173f3d;
  border: 1px solid #2d625f;
  box-shadow: 0 12px 30px rgba(16, 44, 44, 0.2);
}

.modal-overlay {
  background: rgba(16, 44, 44, 0.66);
  backdrop-filter: blur(8px);
}

.modal-card {
  border: 1px solid #d3e1df;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(16, 44, 44, 0.24);
}

.modal-icon-badge {
  background: #fff4d8;
  border-color: #f3d990;
  color: #9a6b12;
}

.modal-primary-btn {
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(17, 122, 116, 0.22);
}

.modal-primary-btn:hover {
  background: var(--primary-dark);
  filter: none;
}

@media (max-width: 820px) {
  .topbar-inner,
  .page {
    width: 100%;
  }

  .topbar-inner {
    min-height: 64px;
    padding: 0 16px;
  }

  .topbar {
    min-height: 64px;
  }

  .brand-caption {
    display: none;
  }

  .page {
    margin: 20px 0 44px;
    padding: 0 16px;
  }

  .panel,
  .auth-panel {
    padding: 22px 18px;
    border-radius: 8px;
  }

  .student-hero {
    min-height: 190px;
    padding: 28px 24px;
  }

  .student-hero-mark {
    display: none;
  }

  .intro {
    min-height: 0;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat {
    padding: 17px 16px;
  }

  .stat strong {
    font-size: 25px;
  }

  .section-heading {
    gap: 12px;
  }
}

@media (max-width: 520px) {
  .topbar-inner {
    padding: 0 12px;
  }

  .brand-name {
    max-width: 45vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav a,
  .nav .link-button {
    padding: 0 8px;
    font-size: 12px;
  }

  .page {
    padding: 0 12px;
  }

  .panel,
  .auth-panel {
    padding: 18px 15px;
  }

  .student-hero {
    padding: 25px 20px;
  }

  .student-hero h1 {
    font-size: 27px;
  }

  .student-hero .hero-desc {
    font-size: 13px;
  }

  .auth-login-card {
    margin-top: 28px;
  }
}

/* ---------- 管理后台：模块化标签页 ---------- */
body:has(.admin-tabs) .intro {
  display: block;
  min-height: 0;
  padding-bottom: 24px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.admin-tab {
  position: relative;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(236, 248, 247, 0.88);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.admin-tab:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.admin-tab.is-active {
  background: #fff;
  border-color: #fff;
  color: #173f3d;
  box-shadow: 0 6px 16px rgba(9, 34, 33, 0.28);
}

.admin-tab:focus-visible {
  outline: 2px solid #f2c35c;
  outline-offset: 2px;
}

.admin-tab-panel[hidden] {
  display: none !important;
}

.admin-tab-panel {
  animation: admin-tab-in 240ms ease both;
}

@keyframes admin-tab-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.admin-tab-panel > .panel:last-child {
  margin-bottom: 0;
}

body:has(.admin-tabs) .page {
  margin-bottom: 60px;
}

@media (max-width: 820px) {
  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
  }

  .admin-tab {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .admin-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- 管理后台：全屏工作台布局 ---------- */
body:has(.admin-shell) {
  background: #e6edec;
}

body:has(.admin-shell) .topbar {
  display: none;
}

body:has(.admin-shell) .page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 26px clamp(18px, 2.6vw, 40px) 48px;
}

body:has(.admin-shell) .intro {
  padding: 30px clamp(22px, 2.4vw, 40px) 24px;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(16, 44, 44, 0.16);
}

body:has(.admin-shell) .intro h1 {
  font-size: clamp(23px, 2vw, 30px);
}

body:has(.admin-shell) .intro p:not(.eyebrow) {
  max-width: 860px;
}

.intro-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.admin-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

body:has(.admin-shell) .intro .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 0;
}

body:has(.admin-shell) .intro .stat {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
  backdrop-filter: blur(4px);
}

body:has(.admin-shell) .intro .stat::before {
  background: #f2c35c;
}

body:has(.admin-shell) .intro .stat:nth-child(2)::before { background: #7cc4bf; }
body:has(.admin-shell) .intro .stat:nth-child(3)::before { background: #8fd18b; }
body:has(.admin-shell) .intro .stat:nth-child(4)::before { background: #e88a84; }

body:has(.admin-shell) .intro .stat span {
  color: rgba(236, 248, 247, 0.72);
}

body:has(.admin-shell) .intro .stat strong {
  color: #fff;
}

body:has(.admin-shell) .intro .stat strong.stat-updated {
  color: #f2c35c;
}

.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.admin-sidebar {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 44px);
  max-height: calc(100vh - 44px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid #e6eeed;
}

.admin-sidebar-badge {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(17, 122, 116, 0.24);
}

.admin-sidebar-title {
  display: grid;
  gap: 1px;
}

.admin-sidebar-title strong {
  font-size: 14px;
  color: var(--text);
}

.admin-sidebar-title span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.admin-sidebar .admin-tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 14px 12px;
  overflow-y: auto;
}

.admin-nav-label {
  padding: 2px 10px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #9ab3b1;
}

.admin-sidebar .admin-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #3f5a58;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  box-shadow: none;
}

.admin-sidebar .admin-tab:hover {
  background: #eef5f4;
  color: var(--primary-dark);
  transform: none;
}

.admin-sidebar .admin-tab.is-active {
  background: #e2f1ef;
  border-color: #bcdad6;
  color: var(--primary-dark);
  box-shadow: none;
}

.admin-tab-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: #8aa5a3;
  transition: color 160ms ease;
}

.admin-sidebar .admin-tab:hover .admin-tab-icon,
.admin-sidebar .admin-tab.is-active .admin-tab-icon {
  color: var(--primary);
}

.admin-tab-text {
  flex: 1;
}

.admin-sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid #e6eeed;
}

.admin-sidebar-foot a,
.admin-sidebar-foot button {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* 覆盖全局 button 的居中，与“学生查询页”链接保持左对齐 */
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5c7472;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.admin-sidebar-foot a:hover,
.admin-sidebar-foot button:hover {
  background: #f1f6f5;
  color: var(--primary-dark);
}

.admin-sidebar-foot form {
  margin: 0;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.admin-topbar-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.admin-topbar-note {
  font-size: 12px;
  color: var(--muted);
}

.admin-topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.admin-return-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #b8ddd8;
  border-radius: 9px;
  background: #eef8f6;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.admin-return-link:hover {
  border-color: #8fcac2;
  background: #dff2ef;
  box-shadow: 0 6px 14px rgba(58, 167, 157, 0.16);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.admin-return-link svg {
  flex-shrink: 0;
}

.admin-sidebar-backdrop {
  display: none;
}

/* The HTML hidden attribute must win over the mobile drawer backdrop rule. */
.admin-sidebar-backdrop[hidden] {
  display: none !important;
}

/* 概览模块卡片 */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.overview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-content: start;
  align-items: start;
  justify-content: stretch;
  justify-items: start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 116px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fbfb;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.overview-card:hover {
  border-color: #9cc6c1;
  background: #eef7f5;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(16, 44, 44, 0.1);
}

.overview-card-title,
.overview-card-desc {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.overview-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-dark);
}

.overview-card-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 1366px) {
  .admin-shell {
    grid-template-columns: 224px minmax(0, 1fr);
    gap: 20px;
  }
}

@media (max-width: 1024px) {
  body:has(.admin-shell) .page {
    padding: 18px 16px 40px;
  }

  .admin-shell {
    display: block;
    margin-top: 18px;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: 280px;
    max-width: 82vw;
    min-height: 0;
    max-height: none;
    height: 100%;
    border-radius: 0 14px 14px 0;
    transform: translateX(-105%);
    transition: transform 240ms ease;
    box-shadow: 0 18px 50px rgba(16, 44, 44, 0.28);
  }

  body.admin-sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    background: rgba(16, 44, 44, 0.45);
    backdrop-filter: blur(2px);
  }

  .admin-menu-toggle {
    display: inline-flex;
  }

  body:has(.admin-shell) .intro .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body:has(.admin-shell) .page {
    padding: 12px 12px 32px;
  }

  body:has(.admin-shell) .intro {
    padding: 22px 18px 18px;
  }

  body:has(.admin-shell) .intro .stats-grid {
    gap: 10px;
  }

  .admin-topbar-note {
    display: none;
  }
}

/* ---------- Fresh palette: mint, sky and coral ---------- */
:root {
  --bg: #f1f9f8;
  --surface: #ffffff;
  --text: #16384d;
  --muted: #60798a;
  --border: #d4e8e5;
  --primary: #3aa79d;
  --primary-dark: #287f79;
  --success: #2e9c70;
  --success-bg: #e8f8f0;
  --danger: #d86f76;
  --danger-bg: #fff0f1;
  --warning-bg: #fff7df;
  --shadow: 0 10px 30px rgba(42, 104, 112, 0.08);
  --shadow-hover: 0 16px 38px rgba(42, 104, 112, 0.13);
}

body {
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--primary-dark);
}

.topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: #dcecea;
  box-shadow: 0 3px 18px rgba(42, 104, 112, 0.05);
}

.brand-mark,
.admin-sidebar-badge {
  background: var(--primary);
  box-shadow: 0 5px 12px rgba(58, 167, 157, 0.24);
}

.brand-caption,
.admin-sidebar-title span {
  color: #6e8995;
}

.nav a:hover,
.nav .link-button:hover {
  background: #e6f6f3;
  color: var(--primary-dark);
}

.nav a:last-child {
  background: #edf8f6;
  color: var(--primary-dark);
}

.nav a:last-child:hover {
  background: #dff2ef;
}

.panel,
.auth-panel,
.stat,
.admin-topbar,
.admin-sidebar {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.panel:hover,
.auth-panel:hover {
  border-color: #b8ddd8;
  box-shadow: var(--shadow-hover);
}

.student-hero,
body:has(.admin-shell) .intro {
  background: #dff4f0;
  border-color: #c2e6e0;
  box-shadow: 0 14px 34px rgba(53, 132, 133, 0.13);
}

.student-hero:hover,
body:has(.admin-shell) .intro:hover {
  border-color: #acd9d2;
  box-shadow: 0 18px 40px rgba(53, 132, 133, 0.17);
}

.student-hero .eyebrow,
body:has(.admin-shell) .intro .eyebrow {
  color: #258c84;
}

.student-hero h1,
body:has(.admin-shell) .intro h1 {
  color: var(--text);
}

.student-hero .hero-desc,
body:has(.admin-shell) .intro p:not(.eyebrow) {
  color: #587381;
}

.student-hero-mark {
  color: #4c8f96;
}

.student-hero-mark-line {
  background: #efbf63;
}

body:has(.admin-shell) {
  background: #edf7f6;
}

body:has(.admin-shell) .intro .stat {
  background: rgba(255, 255, 255, 0.76);
  border-color: #b9ded9;
  box-shadow: none;
  backdrop-filter: none;
}

body:has(.admin-shell) .intro .stat::before {
  background: #efbf63;
}

body:has(.admin-shell) .intro .stat:nth-child(2)::before {
  background: #76c8d1;
}

body:has(.admin-shell) .intro .stat:nth-child(3)::before {
  background: #86c98a;
}

body:has(.admin-shell) .intro .stat:nth-child(4)::before {
  background: #e98b8c;
}

body:has(.admin-shell) .intro .stat span {
  color: #5b7583;
}

body:has(.admin-shell) .intro .stat strong {
  color: var(--text);
}

body:has(.admin-shell) .intro .stat strong.stat-updated {
  color: var(--primary-dark);
}

.admin-topbar {
  background: rgba(255, 255, 255, 0.9);
}

.admin-sidebar-head,
.admin-sidebar-foot {
  border-color: #e0efed;
}

.admin-sidebar .admin-tab {
  color: #4a6875;
}

.admin-sidebar .admin-tab:hover {
  background: #edf8f6;
  color: var(--primary-dark);
}

.admin-sidebar .admin-tab.is-active {
  background: #ddf2ee;
  border-color: #b6ded8;
  color: var(--primary-dark);
}

.admin-sidebar .admin-tab:hover .admin-tab-icon,
.admin-sidebar .admin-tab.is-active .admin-tab-icon {
  color: var(--primary);
}

.admin-sidebar-foot a:hover,
.admin-sidebar-foot button:hover {
  background: #edf8f6;
  color: var(--primary-dark);
}

.overview-card {
  border-color: #d2e7e4;
  background: #f8fcfb;
}

.overview-card:hover {
  border-color: #a9d8d1;
  background: #eaf8f5;
  box-shadow: 0 10px 22px rgba(42, 104, 112, 0.11);
}

.overview-card-title {
  color: var(--primary-dark);
}

input,
textarea,
select,
.compact-select {
  border-color: #cce2df;
  background: #fbfefd;
}

input:focus,
textarea:focus,
select:focus,
.compact-select:focus {
  outline-color: rgba(58, 167, 157, 0.18);
  border-color: var(--primary);
}

input::placeholder,
textarea::placeholder {
  color: #9aafb8;
}

button,
.primary-action,
.secondary-action,
.danger-action {
  border-color: #c9e0dd;
}

.primary-action {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(58, 167, 157, 0.2);
}

.primary-action:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.secondary-action {
  color: var(--primary-dark);
}

.secondary-action:hover:not(:disabled) {
  background: #eaf8f5;
  border-color: #8fcac2;
}

.danger-action {
  border-color: #efc6c8;
  color: #c45d65;
}

.danger-action:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: #e2a1a6;
}

.status.ok {
  background: var(--success-bg);
  color: var(--success);
}

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

.status.muted {
  background: var(--warning-bg);
  color: #9a741f;
}

.pill {
  background: #e8f6f3;
  color: var(--primary-dark);
}

.announcement-enable-card {
  border-color: #c8e4df;
  background: #f1faf8;
}

.switch-slider {
  background-color: #b9d9d5;
}

.switch-label input[type="checkbox"]:checked + .switch-slider {
  background-color: var(--primary);
}

.proxy-list-card,
.proxy-list-toolbar {
  border-color: #d2e7e4;
  background: #f8fcfb;
}

.proxy-mini-btn:hover:not(:disabled) {
  border-color: #8fcac2;
  background: #eaf8f5;
  color: var(--primary-dark);
}

.inline-toast {
  background: #2f8f89;
  border-color: #76c8c0;
}

.modal-overlay {
  background: rgba(22, 56, 77, 0.48);
}

.modal-primary-btn {
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(58, 167, 157, 0.24);
}

.modal-primary-btn:hover {
  background: var(--primary-dark);
}

/* ---------- CDK access toggle ---------- */
.cdk-settings-panel {
  border-top: 3px solid var(--primary);
}

.cdk-settings-heading {
  margin-bottom: 18px;
}

.cdk-settings-form {
  gap: 14px;
}

.cdk-settings-card {
  margin: 0;
}

.cdk-settings-actions {
  justify-content: flex-start;
  margin-top: 2px;
}

.cdk-disabled-note {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid #c8e4df;
  border-radius: 10px;
  background: #f1faf8;
}

.cdk-disabled-note label {
  gap: 7px;
  color: #376563;
  font-size: 0.92rem;
}

.cdk-disabled-note input:disabled {
  cursor: not-allowed;
  opacity: 1;
  border-color: #c9dedb;
  background: #e7f2f0;
  color: #6e8584;
}

.cdk-disabled-note .hint {
  color: #557976;
}

/* ---------- Student query experience refresh ---------- */
.student-page {
  max-width: 1080px;
}

.student-page .student-hero {
  margin-bottom: 16px;
  border-color: #c2e6e0;
  background: linear-gradient(135deg, #dff4f0 0%, #f2f9ff 100%);
  box-shadow: 0 14px 32px rgba(53, 132, 133, 0.12);
}

.student-page .student-hero::after {
  position: absolute;
  right: -74px;
  bottom: -104px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(58, 167, 157, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(58, 167, 157, 0.05), 0 0 0 44px rgba(58, 167, 157, 0.035);
  content: "";
  pointer-events: none;
}

.student-page .student-hero h1 {
  color: #16384d;
}

.student-page .student-hero .hero-desc {
  color: #587381;
}

.query-progress-card {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
  margin-bottom: 20px;
  border: 1px solid #d4e8e5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 22px rgba(42, 104, 112, 0.06);
}

.query-progress-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.query-progress-heading .eyebrow {
  margin-bottom: 5px;
  font-size: 11px;
}

.query-progress-heading h2 {
  margin: 0;
  font-size: 19px;
}

.query-progress-caption {
  padding: 7px 10px;
  border: 1px solid #d4e8e5;
  border-radius: 999px;
  background: #f2faf8;
  color: #4d7774;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.query-progress-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.query-progress-item {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid #e0ecea;
  border-radius: 11px;
  background: #fbfefe;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.query-progress-item.is-current {
  border-color: #8fcac2;
  background: #edf8f6;
  box-shadow: 0 5px 14px rgba(58, 167, 157, 0.1);
}

.query-progress-item.is-next {
  opacity: 0.72;
}

.query-progress-item.is-complete .query-progress-index {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.query-progress-index {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8dedb;
  border-radius: 50%;
  background: #f1f8f7;
  color: #5c7d7b;
  font-size: 12px;
  font-weight: 800;
}

.query-progress-item strong,
.query-progress-item small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.query-progress-item strong {
  color: #285451;
  font-size: 13px;
}

.query-progress-item small {
  margin-top: 3px;
  color: #6e8584;
  font-size: 11px;
  line-height: 1.45;
}

.student-page .query-card {
  padding: 26px 28px;
  border-radius: 15px;
  border-color: #d4e8e5;
  box-shadow: 0 10px 28px rgba(42, 104, 112, 0.07);
}

.student-page .credential-card {
  border-top: 3px solid var(--primary);
}

.student-page .cdk-step-card {
  border-top: 3px solid #d6a443;
}

.query-card-heading {
  align-items: flex-start;
  margin-bottom: 16px;
}

.query-card-heading h2 {
  margin-top: 3px;
}

.query-card-subtitle {
  margin: 8px 0 0;
  color: #6b828f;
  font-size: 13px;
  line-height: 1.55;
}

.query-security-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  margin: -2px 0 20px;
  border: 1px solid #d2e9e4;
  border-radius: 10px;
  background: #f1faf8;
  color: #4b7472;
  font-size: 12px;
  line-height: 1.5;
}

.query-security-icon {
  display: inline-flex;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #dff2ef;
  color: var(--primary-dark);
}

.query-form {
  gap: 16px;
}

.query-field {
  display: grid;
  gap: 8px;
}

.query-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #285451;
  font-size: 13px;
  font-weight: 800;
}

.query-field-label small {
  color: #7b929e;
  font-size: 11px;
  font-weight: 600;
}

.query-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.query-input-wrap > svg {
  position: absolute;
  left: 14px;
  z-index: 1;
  color: #73a7a2;
  pointer-events: none;
}

.query-input-wrap input {
  width: 100%;
  min-height: 51px;
  padding-left: 44px;
  border-color: #cfe3e0;
  border-radius: 12px;
  background: #fbfefe;
  box-shadow: inset 0 1px 2px rgba(42, 104, 112, 0.03);
}

.query-input-wrap input:hover {
  border-color: #9fcac5;
}

.query-input-wrap input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(58, 167, 157, 0.12);
}

/* 密码可见性切换（小眼睛） */
.query-password-input {
  padding-right: 46px;
}

.query-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 1;
  transform: translateY(-50%);
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7b9e9a;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.query-password-toggle:hover:not(:disabled),
.query-password-toggle:focus-visible {
  color: var(--primary-dark);
  background: #eaf8f5;
}

/* 覆盖全局 button 的悬停/按下位移与阴影，保持绝对定位居中 */
.query-password-toggle:hover:not(:disabled),
.query-password-toggle:active:not(:disabled) {
  transform: translateY(-50%);
  box-shadow: none;
}

.query-password-toggle:focus-visible {
  outline: 2px solid rgba(58, 167, 157, 0.45);
  outline-offset: 1px;
}

.query-password-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.query-password-toggle .icon-eye {
  display: block;
}

.query-password-toggle .icon-eye-off {
  display: none;
}

.query-password-toggle.is-visible .icon-eye {
  display: none;
}

.query-password-toggle.is-visible .icon-eye-off {
  display: block;
}

.query-consent {
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid #e0ecea;
  border-radius: 10px;
  background: #fbfefe;
  color: #5d747f;
  line-height: 1.55;
}

.query-consent input {
  margin-top: 2px;
}

.query-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.query-submit svg {
  transition: transform 150ms ease;
}

.query-submit:hover svg {
  transform: translateX(3px);
}

.query-result-card {
  padding: 26px 28px;
  background: linear-gradient(145deg, #ffffff 0%, #f4fbf8 100%);
}

.query-result-topline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.query-result-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f8f0;
  color: #2e9c70;
  font-size: 12px;
  font-weight: 800;
}

.query-result-card h2 {
  margin-top: 14px;
}

.query-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0;
  color: #64807f;
  font-size: 12px;
}

.query-result-meta strong {
  color: #2f7169;
}

.cdk-form {
  width: 100%;
}

.cdk-security-strip {
  border-color: #eadbb4;
  background: #fffaf0;
  color: #7d6a42;
}

.cdk-security-strip .query-security-icon {
  background: #fff0c9;
  color: #9a7528;
}

@media (max-width: 760px) {
  .query-progress-card {
    padding: 18px 16px;
  }

  .query-progress-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .query-progress-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .student-page .query-card,
  .query-result-card {
    padding: 20px 16px;
  }

  .query-card-heading {
    flex-direction: column;
    gap: 12px;
  }

  .query-card-heading .pill {
    align-self: flex-start;
  }

  .query-security-strip {
    align-items: flex-start;
  }

  .query-result-meta {
    flex-direction: column;
    gap: 7px;
  }
}

/* ---------- Recent query table readability ---------- */
.record-table th,
.record-table td {
  padding: 11px 10px;
}
