:root {
  --bg: #eaf6ff;
  --grid: rgba(65, 132, 180, 0.14);
  --ink: #162b3b;
  --muted: #65798c;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --line: rgba(77, 129, 166, 0.22);
  --blue: #2d7fbd;
  --blue-deep: #1f5f92;
  --blue-soft: #dcefff;
  --shadow: 0 20px 55px rgba(38, 91, 132, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.95), transparent 28%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

button,
input,
textarea {
  font: inherit;
}

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

.is-hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  width: min(1220px, calc(100% - 36px));
  min-height: calc(100vh - 36px);
  margin: 18px auto;
}

.sidebar,
.workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.sidebar {
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 24px;
  font-size: 17px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-deep);
  background: #fff;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.session-box {
  display: grid;
  gap: 7px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding: 18px 6px 0;
}

.session-box strong {
  font-size: 15px;
}

.session-box span {
  color: var(--muted);
  font-size: 13px;
}

.session-box button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-deep);
  background: #f8fcff;
  cursor: pointer;
}

.admin-entry {
  display: inline-flex;
  margin: 0;
  color: #6d8294;
  font-size: 13px;
}

.admin-entry:hover {
  color: var(--blue-deep);
}

.login-entry-area {
  display: grid;
  gap: 8px;
  margin: 22px 6px 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.login-entry-area p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  color: #39576f;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: var(--blue-deep);
  background: var(--blue-soft);
}

.workspace {
  min-width: 0;
  padding: 32px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.page-head {
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.12;
  font-weight: 800;
}

.page-head p {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.request-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
}

.request-form,
.promise-card,
.simple-panel,
.tool-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.request-form {
  display: grid;
  gap: 16px;
  padding: 26px;
}

.request-form label {
  display: grid;
  gap: 8px;
}

.request-form span {
  color: #314b61;
  font-size: 14px;
  font-weight: 700;
}

.request-form input,
.request-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #f8fcff;
  outline: none;
  resize: vertical;
}

.request-form input:focus,
.request-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(45, 127, 189, 0.16);
}

.request-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
}

.request-form button:hover {
  background: var(--blue-deep);
}

.form-tip {
  min-height: 22px;
  color: var(--blue-deep);
  font-size: 14px;
  line-height: 1.6;
}

.promise-card {
  padding: 24px;
}

.promise-card h2,
.empty-state h2,
.simple-panel h2 {
  font-size: 23px;
  line-height: 1.35;
}

.promise-card p,
.empty-state p,
.simple-panel p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.promise-steps {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.promise-steps span {
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 10px 12px;
  color: #34566f;
  background: #f4faff;
}

.tool-board {
  display: grid;
  gap: 16px;
  min-height: 440px;
  padding: 22px;
  background:
    linear-gradient(rgba(45, 127, 189, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 127, 189, 0.06) 1px, transparent 1px),
    rgba(255, 255, 255, 0.5);
  background-size: 22px 22px;
}

.trial-notice {
  max-width: 780px;
  border: 1px solid rgba(226, 169, 25, 0.35);
  border-radius: 8px;
  padding: 16px 18px;
  background: #fff8df;
}

.trial-notice strong {
  display: block;
  color: #87620d;
  font-size: 16px;
}

.trial-notice p {
  margin-top: 8px;
  color: #6f5a22;
  line-height: 1.75;
}

.empty-state {
  display: grid;
  min-height: 440px;
  place-items: center;
  align-content: center;
  padding: 36px;
  text-align: center;
}

.empty-line {
  width: 68px;
  height: 4px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: var(--blue);
}

.simple-panel {
  min-height: 260px;
  padding: 32px;
}

.tool-card {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  max-width: 780px;
  border: 1px solid rgba(45, 127, 189, 0.22);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(38, 91, 132, 0.1);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tool-card.disabled {
  opacity: 0.92;
  cursor: default;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 127, 189, 0.48);
  box-shadow: 0 18px 42px rgba(38, 91, 132, 0.16);
}

.tool-icon {
  display: grid;
  width: 168px;
  height: 168px;
  place-items: center;
  border: 1px solid rgba(45, 127, 189, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fdff, #dcefff);
}

.tool-icon svg {
  width: 112px;
  height: 112px;
}

.tool-icon rect {
  fill: rgba(255, 255, 255, 0.72);
  stroke: #2d7fbd;
  stroke-width: 5;
}

.tool-icon path {
  fill: none;
  stroke: #1f5f92;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-icon.soft rect {
  stroke: #7ba7c9;
}

.tool-icon.soft path {
  stroke: #5f86a5;
}

.tool-copy {
  min-width: 0;
}

.tool-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.tool-status i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.status-green {
  color: #19734a;
  background: #def7eb;
}

.status-green i {
  background: #1fa365;
}

.status-yellow {
  color: #87620d;
  background: #fff3cc;
}

.status-yellow i {
  background: #e2a919;
}

.status-red {
  color: #a33c3c;
  background: #ffe4e4;
}

.status-red i {
  background: #d84b4b;
}

.tool-copy h2 {
  font-size: 30px;
  line-height: 1.25;
}

.tool-copy p {
  max-width: 520px;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.tool-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  margin-top: 20px;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--blue);
}

.tool-link.muted {
  color: #5d7488;
  background: #e8f1f8;
}

.account-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.compact-head h1 {
  font-size: 38px;
}

.teacher-home-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.profile-card,
.auth-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.profile-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 22px;
}

.avatar {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  background: var(--blue);
}

.profile-card h2 {
  font-size: 22px;
}

.profile-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.account-profile {
  align-items: flex-start;
}

.auth-card,
.admin-card {
  padding: 22px;
}

.auth-card {
  grid-column: 2;
  grid-row: 1;
}

.password-card {
  grid-column: 1 / -1;
  grid-row: auto;
  margin-top: 18px;
}

.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.password-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.password-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
}

.password-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(80, 143, 214, 0.16);
  outline: none;
}

.password-toggle {
  display: flex !important;
  grid-column: 1;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.password-toggle input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.password-form button {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
}

.password-form .form-tip {
  grid-column: 1 / -1;
}

.admin-card {
  grid-column: 1 / -1;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 22px;
}

.section-title span {
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 700;
}

.auth-list {
  display: grid;
  gap: 10px;
}

.auth-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  padding: 13px 14px;
  background: #f8fcff;
}

.auth-item strong {
  display: block;
  font-size: 16px;
}

.auth-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.duration-pill {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 700;
  background: var(--blue-soft);
}

.empty-auth {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.grant-row > label span {
  color: #314b61;
  font-size: 14px;
  font-weight: 700;
}

.grant-row select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #f8fcff;
}

.grant-row input[type="date"],
.reminder-input input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #f8fcff;
}

.reminder-input {
  display: grid;
  grid-template-columns: auto minmax(54px, 72px) auto;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.check-line input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.grant-table {
  display: grid;
  gap: 10px;
}

.whitelist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
}

.whitelist-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.whitelist-tools input {
  min-height: 42px;
  min-width: min(420px, 100%);
  flex: 1 1 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #f8fcff;
  outline: none;
}

.whitelist-tools input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(45, 127, 189, 0.16);
}

.whitelist-tools span {
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 700;
}

.teacher-list {
  display: grid;
  gap: 10px;
}

.teacher-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 112px 96px;
  gap: 14px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  padding: 13px 14px;
  color: inherit;
  text-align: left;
  background: #f8fcff;
  cursor: pointer;
}

.whitelist-row {
  min-height: 74px;
}

.teacher-row:hover,
.teacher-row.active {
  border-color: rgba(45, 127, 189, 0.46);
  background: #eef8ff;
}

.teacher-row strong {
  display: block;
  font-size: 16px;
}

.teacher-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.service-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.service-chip {
  border-radius: 999px;
  padding: 5px 9px;
  color: #31566f;
  font-size: 13px;
  background: var(--blue-soft);
}

.service-chip.closed {
  color: #7a8792;
  background: #edf2f6;
}

.teacher-count {
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 700;
}

.teacher-expiry {
  color: #31566f;
  font-size: 13px;
  font-weight: 700;
}

.teacher-ok,
.teacher-alert {
  border-radius: 999px;
  padding: 6px 9px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.teacher-ok {
  color: #19734a;
  background: #def7eb;
}

.teacher-alert {
  color: #87620d;
  background: #fff3cc;
}

.teacher-editor {
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  padding: 16px;
  background: #f8fcff;
}

.editor-head {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.editor-head h3 {
  margin: 0;
  font-size: 20px;
}

.editor-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.grant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 142px 118px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fcff;
}

.inline-auth {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-tip {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.whitelist-card {
  background: rgba(255, 255, 255, 0.82);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 130px 130px 170px auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.admin-toolbar input,
.admin-toolbar select,
.add-teacher-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.admin-toolbar button,
.add-teacher-form button,
.teacher-table-row button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--blue-deep);
  background: #f8fcff;
  cursor: pointer;
}

.admin-toolbar button:hover,
.add-teacher-form button:hover,
.teacher-table-row button:hover {
  border-color: rgba(45, 127, 189, 0.46);
  background: var(--blue-soft);
}

.admin-toolbar span {
  color: var(--muted);
  font-size: 14px;
}

.add-teacher-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: #f8fcff;
}

.teacher-table {
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.teacher-table-head,
.teacher-table-row {
  display: grid;
  grid-template-columns: 190px minmax(160px, 1fr) 104px 112px 150px 86px 70px;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
}

.teacher-table-head {
  color: #39576f;
  font-size: 13px;
  font-weight: 800;
  background: #eef8ff;
}

.teacher-table-row {
  border-top: 1px solid rgba(77, 129, 166, 0.14);
  color: #263f54;
  font-size: 14px;
  cursor: pointer;
}

.teacher-table-row.active {
  background: #f4fbff;
}

.teacher-table-row:hover {
  background: #eef8ff;
}

.teacher-table-row strong,
.teacher-table-row small {
  display: block;
}

.teacher-table-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.state-pill {
  display: inline-flex;
  min-width: 68px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.state-normal {
  color: #19734a;
  background: #def7eb;
}

.state-warning {
  color: #87620d;
  background: #fff3cc;
}

.state-expired {
  color: #a33c3c;
  background: #ffe4e4;
}

.state-closed {
  color: #6d7b86;
  background: #edf2f6;
}

.plain-editor {
  margin-top: 16px;
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: #f8fcff;
}

.plain-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.editor-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--blue-deep);
  background: #fff;
  cursor: pointer;
}

.editor-actions button:hover {
  background: var(--blue-soft);
}

.editor-actions .danger-button {
  color: #a33c3c;
  background: #fff7f7;
}

.editor-actions .danger-button:hover {
  background: #ffe4e4;
}

.plain-editor-head h2 {
  font-size: 20px;
}

.plain-editor-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.plain-grant-table {
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.plain-grant-head,
.plain-grant-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 64px 92px 150px 150px 104px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.plain-grant-head {
  color: #39576f;
  font-size: 13px;
  font-weight: 800;
  background: #eef8ff;
}

.plain-grant-row {
  border-top: 1px solid rgba(77, 129, 166, 0.14);
}

.plain-grant-row select,
.plain-grant-row input[type="date"],
.plain-grant-row input[type="number"] {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
}

.plain-grant-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.plain-grant-row input[type="number"] {
  width: 58px;
}

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

.quick-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: #31566f;
  background: #fff;
  cursor: pointer;
}

.quick-actions button:first-child,
.quick-actions button:nth-child(2),
.quick-actions button:nth-child(3) {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.quick-actions button:first-child:hover,
.quick-actions button:nth-child(2):hover,
.quick-actions button:nth-child(3):hover {
  background: var(--blue-deep);
}

.quick-actions button:hover {
  background: var(--blue-soft);
}

.module-card {
  background: rgba(255, 255, 255, 0.82);
}

.module-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 140px auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.module-toolbar input,
.module-toolbar select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.module-toolbar span {
  color: var(--muted);
  font-size: 14px;
}

.module-table {
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
}

.module-table-head,
.module-table-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(98px, 0.72fr) minmax(120px, 0.95fr) 74px 104px 68px 92px;
  gap: 10px;
  align-items: center;
  min-width: 860px;
  padding: 11px 12px;
}

.module-table-head {
  color: #39576f;
  font-size: 13px;
  font-weight: 800;
  background: #eef8ff;
}

.module-table-row {
  border-top: 1px solid rgba(77, 129, 166, 0.14);
  color: #263f54;
  font-size: 14px;
}

.module-table-row strong,
.module-table-row small {
  display: block;
}

.module-table-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.module-table-row code {
  display: inline-block;
  max-width: 100%;
  border-radius: 6px;
  padding: 3px 6px;
  color: #31566f;
  overflow-wrap: anywhere;
  background: #eef8ff;
}

.login-page {
  display: grid;
  place-items: center;
}

.login-shell {
  display: grid;
  grid-template-columns: 420px minmax(260px, 360px);
  gap: 18px;
  align-items: stretch;
  width: min(820px, calc(100% - 32px));
}

.login-hub {
  grid-template-columns: minmax(280px, 1.05fr) minmax(280px, 1fr) minmax(280px, 0.95fr);
  width: min(1180px, calc(100% - 32px));
}

.login-card,
.login-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.login-note {
  align-content: center;
  display: grid;
}

.login-note h2 {
  font-size: 26px;
  line-height: 1.3;
}

.login-note p {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.8;
}

.login-note a {
  display: inline-flex;
  width: fit-content;
  min-height: 40px;
  align-items: center;
  margin-top: 20px;
  border-radius: 8px;
  padding: 0 16px;
  color: var(--blue-deep);
  background: var(--blue-soft);
}

.login-brand {
  padding: 0 0 24px;
}

.login-card h1 {
  font-size: 42px;
  margin-bottom: 24px;
}

.login-card h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.login-lead,
.login-card-note,
.trial-warning {
  color: var(--muted);
  line-height: 1.75;
}

.login-lead {
  margin-bottom: 22px;
  font-size: 16px;
}

.login-card-note {
  margin-bottom: 18px;
  font-size: 14px;
}

.trial-warning {
  margin-top: 16px;
  border: 1px solid rgba(226, 169, 25, 0.35);
  border-radius: 8px;
  padding: 12px 14px;
  color: #75580f;
  background: #fff8df;
  font-size: 13px;
}

.primary-login-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
}

.primary-login-action:hover {
  background: var(--blue-deep);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form span {
  color: #314b61;
  font-size: 14px;
  font-weight: 700;
}

.login-form input,
.login-form textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #f8fcff;
  outline: none;
}

.login-form textarea {
  min-height: 86px;
  padding: 11px 13px;
  resize: vertical;
}

.login-form input:focus,
.login-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(45, 127, 189, 0.16);
}

.login-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
}

.login-demo {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.compact-form {
  gap: 11px;
}

.quiet-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 16px;
  color: var(--blue-deep);
  font-size: 14px;
}

.admin-record-table {
  border: 1px solid rgba(77, 129, 166, 0.18);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
}

.admin-record-head,
.admin-record-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
}

.registration-head,
.registration-row {
  grid-template-columns: 140px 150px 150px 150px minmax(170px, 1fr) 86px 156px;
  min-width: 1060px;
}

.feedback-head,
.feedback-row {
  grid-template-columns: 84px 130px minmax(220px, 1fr) 130px 76px 86px 156px;
  min-width: 1030px;
}

.admin-record-head {
  color: #39576f;
  font-size: 13px;
  font-weight: 800;
  background: #eef8ff;
}

.admin-record-row {
  border-top: 1px solid rgba(77, 129, 166, 0.14);
  color: #263f54;
  font-size: 14px;
}

.admin-record-row strong,
.admin-record-row small {
  display: block;
}

.admin-record-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.record-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  color: var(--blue-deep);
  background: #f8fcff;
  cursor: pointer;
  font-size: 12px;
}

.record-actions button:hover {
  background: var(--blue-soft);
}

.feedback-toolbar {
  grid-template-columns: minmax(260px, 1fr) 120px 120px auto;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: calc(100% - 18px);
    min-height: auto;
    gap: 10px;
    margin: 9px auto;
  }

  .sidebar {
    padding: 12px;
  }

  .brand {
    padding: 0 2px 10px;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-item {
    min-height: 42px;
    padding: 10px 11px;
    text-align: center;
    font-size: 14px;
  }

  .login-entry-area,
  .session-box {
    margin-top: 10px;
    padding-top: 10px;
  }

  .login-entry-area p {
    font-size: 12px;
    line-height: 1.5;
  }

  .request-layout {
    grid-template-columns: 1fr;
  }

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

  .teacher-home-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .auth-card {
    grid-column: auto;
    grid-row: auto;
  }

  .tool-card {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .tool-icon {
    width: 132px;
    height: 132px;
  }

  .whitelist-layout {
    grid-template-columns: 1fr;
  }

  .tool-icon svg {
    width: 92px;
    height: 92px;
  }

  .workspace {
    padding: 18px;
  }

  .page-head {
    margin-bottom: 14px;
  }

  .page-head p {
    font-size: 14px;
    line-height: 1.6;
  }

  h1,
  .compact-head h1 {
    font-size: 28px;
  }

  .tool-board {
    min-height: auto;
    padding: 12px;
    gap: 12px;
  }

  .trial-notice {
    padding: 12px;
  }

  .tool-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    max-width: none;
    padding: 14px;
  }

  .tool-icon {
    width: 96px;
    height: 96px;
  }

  .tool-icon svg {
    width: 70px;
    height: 70px;
  }

  .tool-copy h2 {
    font-size: 21px;
  }

  .tool-copy p {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
  }

  .tool-link {
    min-height: 34px;
    margin-top: 12px;
    padding: 0 12px;
    font-size: 13px;
  }

  .request-form,
  .promise-card,
  .simple-panel,
  .admin-card,
  .auth-card {
    padding: 14px;
  }

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

  .password-toggle,
  .password-form .form-tip {
    grid-column: auto;
  }

  .password-form button {
    width: 100%;
  }

  .module-toolbar,
  .admin-toolbar,
  .feedback-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    gap: 8px;
  }

  .admin-toolbar input,
  .admin-toolbar select,
  .admin-toolbar button,
  .module-toolbar input,
  .module-toolbar select {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: calc(100% - 12px);
    margin: 6px auto;
  }

  .sidebar {
    padding: 14px 10px;
  }

  .brand {
    display: grid;
    justify-items: start;
    gap: 8px;
    font-size: 14px;
  }

  .tool-card {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 12px;
  }

  .tool-icon {
    width: 78px;
    height: 78px;
  }

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

  .tool-copy h2 {
    font-size: 19px;
  }

  .tool-status {
    margin-bottom: 7px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .grant-row,
  .auth-item,
  .teacher-row,
  .teacher-table-head,
  .teacher-table-row,
  .plain-grant-head,
  .plain-grant-row,
  .add-teacher-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }
}
