:root {
  --portal-ink: #10252b;
  --portal-ink-soft: #29434a;
  --portal-paper: #f4f0e7;
  --portal-paper-deep: #e6e0d3;
  --portal-white: #fffdf8;
  --portal-gold: #d3a45f;
  --portal-gold-soft: #e8c789;
  --portal-mint: #a6cec5;
  --portal-coral: #d97e64;
  --portal-line: rgba(16, 37, 43, .16);
  --portal-muted: rgba(16, 37, 43, .62);
  --portal-container: 1180px;
  --portal-shadow: 0 18px 50px rgba(16, 37, 43, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.portal-shell { min-width: 320px; margin: 0; overflow-x: hidden; color: var(--portal-ink); background: var(--portal-paper); font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--portal-gold); outline-offset: 3px; }
.portal-container { width: min(var(--portal-container), calc(100% - 64px)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 100; top: -64px; left: 16px; padding: 10px 14px; color: var(--portal-ink); background: var(--portal-gold-soft); transition: top .2s ease; }
.skip-link:focus { top: 16px; }

.portal-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid var(--portal-line); }
.portal-header-light { color: var(--portal-ink); background: rgba(244, 240, 231, .96); backdrop-filter: blur(14px); }
.portal-header-dark { color: var(--portal-paper); background: var(--portal-ink); border-bottom-color: rgba(244, 240, 231, .15); }
.portal-header-inner { display: flex; align-items: center; min-height: 78px; gap: 30px; }
.portal-brand { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 11px; }
.portal-brand-mark { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid currentColor; border-radius: 50%; }
.portal-brand-mark::before, .portal-brand-mark::after { position: absolute; width: 46px; height: 17px; content: ""; border: 1px solid var(--portal-gold); border-radius: 50%; transform: rotate(38deg); }
.portal-brand-mark::after { border-color: var(--portal-mint); transform: rotate(-38deg); }
.portal-brand-mark span { width: 8px; height: 8px; background: var(--portal-coral); transform: rotate(45deg); }
.portal-brand-copy { display: flex; flex-direction: column; line-height: 1; }
.portal-brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 500; letter-spacing: .12em; }
.portal-brand-copy small { max-width: 196px; margin-top: 5px; overflow: hidden; font-size: 10px; letter-spacing: .1em; text-overflow: ellipsis; white-space: nowrap; }
.portal-nav { display: flex; align-items: stretch; gap: 25px; height: 78px; margin-left: auto; }
.portal-nav a { position: relative; display: inline-flex; align-items: center; color: var(--portal-muted); font-size: 12px; white-space: nowrap; }
.portal-nav a::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; content: ""; background: var(--portal-coral); transform: scaleX(0); transition: transform .2s ease; }
.portal-nav a:hover, .portal-nav a.is-active { color: var(--portal-ink); }
.portal-nav a:hover::after, .portal-nav a.is-active::after { transform: scaleX(1); }
.portal-header-actions { display: flex; align-items: center; gap: 14px; margin-left: 10px; }
.portal-language, .portal-logout { padding: 5px 0; border: 0; color: var(--portal-muted); background: transparent; font-size: 11px; white-space: nowrap; }
.portal-header-dark .portal-language, .portal-header-dark .portal-logout { color: rgba(244, 240, 231, .78); }
.portal-language:hover, .portal-logout:hover { color: var(--portal-coral); }
.portal-user-chip { max-width: 145px; padding: 6px 10px; overflow: hidden; color: var(--portal-ink); background: var(--portal-paper-deep); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.portal-icon-button { display: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--portal-line); color: currentColor; background: transparent; font-size: 17px; }
.portal-mobile-nav { display: none; }

body.portal-shell.login-page { min-height: 100vh; color: var(--portal-paper); background: var(--portal-ink); }
body.portal-shell.login-page .login-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); align-items: center; gap: clamp(55px, 10vw, 160px); min-height: calc(100vh - 79px); padding-top: 70px; padding-bottom: 70px; color: var(--portal-paper); background: transparent; }
.login-intro { position: relative; min-height: 430px; padding-top: 34px; color: var(--portal-paper); background: transparent; }
.portal-kicker { margin: 0 0 15px; color: var(--portal-coral); font-size: 10px; font-weight: 800; letter-spacing: .2em; line-height: 1.5; }
.portal-header-dark .portal-kicker, .login-page .portal-kicker { color: var(--portal-gold-soft); }
.login-intro h1, .portal-page-heading h1 { max-width: 100%; margin: 0; font-family: Georgia, "Songti SC", "STSong", serif; font-size: clamp(42px, 5vw, 68px); font-weight: 400; letter-spacing: 0; line-height: 1.14; overflow-wrap: anywhere; }
.login-intro h1 { color: var(--portal-paper); background: transparent; -webkit-text-fill-color: var(--portal-paper); }
.login-subtitle { max-width: 430px; margin: 22px 0 0; color: rgba(244, 240, 231, .72); font-size: 15px; }
.login-subtitle, .login-english, .login-intro .portal-kicker { -webkit-text-fill-color: currentColor; }
.login-english { margin-top: 65px; color: rgba(244, 240, 231, .58); font-family: Georgia, serif; font-size: 17px; letter-spacing: 0; }
.login-orbit { position: absolute; right: 6%; bottom: 5px; display: grid; place-items: center; width: 210px; height: 210px; color: var(--portal-gold-soft); font-family: Georgia, serif; font-size: 25px; letter-spacing: .12em; border: 1px solid rgba(232, 199, 137, .46); border-radius: 50%; }
.login-orbit::before, .login-orbit::after { position: absolute; width: 270px; height: 90px; content: ""; border: 1px solid rgba(166, 206, 197, .48); border-radius: 50%; transform: rotate(30deg); }
.login-orbit::after { border-color: rgba(217, 126, 100, .5); transform: rotate(-30deg); }
.login-orbit i, .login-orbit b { position: absolute; display: block; width: 9px; height: 9px; background: var(--portal-coral); transform: rotate(45deg); }
.login-orbit i { top: 12px; right: 57px; background: var(--portal-mint); }
.login-orbit b { bottom: 38px; left: 13px; width: 6px; height: 6px; background: var(--portal-gold-soft); }
.login-panel { width: 100%; max-width: 430px; padding: 37px 38px 27px; color: var(--portal-ink); background: var(--portal-paper); box-shadow: 0 26px 75px rgba(0, 0, 0, .25); }
.portal-form { display: grid; gap: 17px; }
.portal-form label { display: grid; gap: 7px; color: var(--portal-muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.portal-form label.checkbox-field { display: flex; align-items: flex-start; gap: 10px; margin-top: 2px; color: var(--portal-muted); font-weight: 400; letter-spacing: 0; }
.portal-form .checkbox-field input { width: 17px; min-width: 17px; height: 17px; min-height: 17px; margin: 1px 0 0; padding: 0; accent-color: var(--portal-coral); }
.checkbox-field span { display: grid; gap: 4px; }
.checkbox-field strong { color: var(--portal-ink); font-size: 12px; font-weight: 700; }
.checkbox-field small { color: var(--portal-muted); font-size: 10px; font-weight: 400; line-height: 1.5; }
.portal-form input, .portal-form select, .portal-form textarea { width: 100%; min-height: 45px; padding: 9px 12px; border: 1px solid rgba(16, 37, 43, .25); border-radius: 0; color: var(--portal-ink); background: rgba(255, 253, 248, .8); font-size: 13px; }
.portal-form textarea { min-height: 90px; resize: vertical; }
.portal-form input::placeholder { color: rgba(16, 37, 43, .4); }
.portal-form input:focus, .portal-form select:focus, .portal-form textarea:focus { outline: 2px solid var(--portal-gold); outline-offset: 1px; border-color: var(--portal-gold); }
.portal-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 43px; padding: 0 17px; border: 1px solid transparent; border-radius: 2px; font-size: 11px; font-weight: 800; letter-spacing: .08em; transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
.portal-button:hover:not(:disabled) { transform: translateY(-2px); }
.portal-button-gold { color: var(--portal-ink); background: var(--portal-gold-soft); }
.portal-button-gold:hover:not(:disabled) { background: #f1d49a; }
.portal-button-outline { color: var(--portal-ink); background: transparent; border-color: var(--portal-line); }
.portal-button-outline:hover:not(:disabled) { background: var(--portal-paper-deep); border-color: rgba(16, 37, 43, .3); }
.portal-button-dark { color: var(--portal-paper); background: var(--portal-ink); }
.login-form .portal-button { width: 100%; min-height: 51px; margin-top: 5px; }
.form-alert, .portal-alert { min-height: 20px; color: #a44735; font-size: 12px; }
.form-alert:empty, .portal-alert:empty { display: none; }
.login-panel-footer { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 17px; border-top: 1px solid var(--portal-line); color: rgba(16, 37, 43, .45); font-size: 10px; }

.app-page { background: var(--portal-paper); }
.portal-main { padding-top: 72px; padding-bottom: 120px; }
.portal-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: 45px; border-bottom: 1px solid var(--portal-line); }
.portal-page-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.portal-page-actions .portal-button { white-space: nowrap; }
.portal-page-heading h1 { font-size: clamp(40px, 5vw, 62px); }
.portal-welcome { margin: 14px 0 0; color: var(--portal-muted); font-size: 14px; }
.portal-alert { margin: 20px 0 0; padding: 0; }
.portal-section { scroll-margin-top: 100px; padding-top: 72px; }
.section-heading-inline { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.section-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.section-heading-inline h2 { margin: 0; font-family: Georgia, "Songti SC", "STSong", serif; font-size: 39px; font-weight: 400; line-height: 1.2; }
.section-count { padding-bottom: 7px; color: var(--portal-coral); font-family: Georgia, serif; font-size: 23px; }
.mailbox-unread-count { min-width: 28px; padding: 4px 8px 5px; color: var(--portal-ink); background: var(--portal-gold-soft); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; text-align: center; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { min-height: 142px; padding: 24px 21px 18px; border: 1px solid var(--portal-line); background: rgba(255, 253, 248, .55); }
.metric-card-accent { color: var(--portal-paper); background: var(--portal-ink); border-color: var(--portal-ink); }
.metric-label { display: block; color: var(--portal-muted); font-size: 11px; }
.metric-card-accent .metric-label { color: rgba(244, 240, 231, .66); }
.metric-card strong { display: block; margin-top: 11px; font-family: Georgia, serif; font-size: 38px; font-weight: 400; line-height: 1.1; }
.metric-card small { display: block; margin-top: 12px; color: rgba(16, 37, 43, .48); font-size: 10px; }
.metric-card-accent small { color: rgba(244, 240, 231, .58); }
.metric-course { max-width: 100%; overflow: hidden; font-size: 23px !important; text-overflow: ellipsis; white-space: nowrap; }
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.panel-card { border: 1px solid var(--portal-line); background: rgba(255, 253, 248, .65); }
.overview-card { min-height: 245px; padding: 23px 24px; }
.panel-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--portal-line); }
.panel-card-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 400; }
.panel-link { color: var(--portal-coral); font-size: 11px; font-weight: 700; }
.panel-link:hover { text-decoration: underline; }
.mini-announcements, .mini-schedule { padding-top: 5px; }
.mini-announcement { display: grid; grid-template-columns: 58px 1fr; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--portal-line); }
.mini-announcement:last-child { border-bottom: 0; }
.mini-announcement time { color: var(--portal-coral); font-family: Georgia, serif; font-size: 15px; }
.mini-announcement strong { display: block; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mini-announcement span { display: block; margin-top: 2px; overflow: hidden; color: var(--portal-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mini-class { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--portal-line); }
.mini-class:last-child { border-bottom: 0; }
.mini-class strong { display: block; font-size: 12px; }
.mini-class span { display: block; color: var(--portal-muted); font-size: 10px; }
.mini-class time { flex: 0 0 auto; color: var(--portal-coral); font-family: Georgia, serif; font-size: 13px; }
.empty-state { margin: 0; padding: 31px 15px; color: rgba(16, 37, 43, .48); text-align: center; font-size: 12px; }

.filter-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.search-field { position: relative; flex: 1 1 auto; }
.search-field > span { position: absolute; top: 8px; left: 12px; color: var(--portal-coral); font-size: 22px; line-height: 1; }
.search-field input { width: 100%; min-height: 42px; padding: 0 12px 0 36px; border: 1px solid var(--portal-line); color: var(--portal-ink); background: rgba(255, 253, 248, .66); font-size: 12px; }
.filter-bar select { min-width: 130px; min-height: 42px; padding: 0 10px; border: 1px solid var(--portal-line); color: var(--portal-ink); background: rgba(255, 253, 248, .66); font-size: 11px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--portal-line); background: rgba(255, 253, 248, .58); }
.data-table { width: 100%; min-width: 680px; border-collapse: collapse; text-align: left; }
.data-table th { padding: 13px 16px; color: rgba(16, 37, 43, .56); background: rgba(230, 224, 211, .6); font-size: 10px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.data-table td { padding: 16px; border-top: 1px solid var(--portal-line); color: var(--portal-muted); font-size: 12px; vertical-align: middle; }
.data-table td:first-child { color: var(--portal-ink); font-family: Georgia, serif; }
.course-name { color: var(--portal-ink); font-weight: 700; }
.course-name small { display: block; margin-top: 3px; color: var(--portal-muted); font-family: inherit; font-size: 10px; font-weight: 400; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; color: #477870; background: rgba(166, 206, 197, .3); font-size: 10px; white-space: nowrap; }
.status-pill.is-full { color: #a44735; background: rgba(217, 126, 100, .16); }
.status-pill.is-progress { color: #96702f; background: rgba(232, 199, 137, .34); }
.table-action { padding: 5px 0; border: 0; border-bottom: 1px solid currentColor; color: var(--portal-coral); background: transparent; font-size: 11px; font-weight: 800; }
.table-action:hover { color: var(--portal-ink); }
.table-action.is-danger { color: #a44735; }
.table-action + .table-action { margin-left: 13px; }

.schedule-wrap { overflow-x: auto; border: 1px solid var(--portal-line); background: rgba(255, 253, 248, .58); }
.schedule-grid { display: grid; grid-template-columns: 78px repeat(7, minmax(122px, 1fr)); min-width: 950px; }
.schedule-cell { min-height: 72px; padding: 10px; border-right: 1px solid var(--portal-line); border-bottom: 1px solid var(--portal-line); }
.schedule-cell:nth-child(8n) { border-right: 0; }
.schedule-head { min-height: 47px; color: var(--portal-ink); background: var(--portal-paper-deep); font-size: 11px; font-weight: 800; }
.schedule-time { color: rgba(16, 37, 43, .52); background: rgba(230, 224, 211, .35); font-family: Georgia, serif; font-size: 12px; }
.schedule-entry { min-height: 55px; padding: 8px 9px; color: var(--portal-ink); background: rgba(232, 199, 137, .35); border-left: 3px solid var(--portal-coral); }
.schedule-entry strong { display: block; font-size: 11px; line-height: 1.4; }
.schedule-entry span { display: block; margin-top: 3px; color: var(--portal-muted); font-size: 9px; }

.announcement-list { border-top: 1px solid var(--portal-line); }
.announcement-item { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 24px; align-items: start; padding: 22px 3px; border-bottom: 1px solid var(--portal-line); }
.announcement-date { color: var(--portal-coral); font-family: Georgia, serif; font-size: 21px; line-height: 1.2; }
.announcement-date small { display: block; margin-top: 5px; color: var(--portal-muted); font-family: inherit; font-size: 10px; }
.announcement-item h3 { margin: 0 0 5px; font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 400; line-height: 1.35; }
.announcement-item p { display: -webkit-box; max-width: 690px; margin: 0; overflow: hidden; color: var(--portal-muted); font-size: 12px; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.announcement-type { color: #477870; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.announcement-open { align-self: center; padding: 4px 0; border: 0; border-bottom: 1px solid var(--portal-coral); color: var(--portal-coral); background: transparent; font-size: 11px; font-weight: 800; white-space: nowrap; }
.announcement-open:hover { color: var(--portal-ink); border-color: var(--portal-ink); }
.mailbox-address { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; margin-bottom: 17px; padding: 15px 17px; border: 1px solid var(--portal-line); color: var(--portal-muted); background: rgba(255, 253, 248, .58); font-size: 11px; }
.mailbox-address strong { color: var(--portal-ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; font-weight: 700; }
.mailbox-unread-label { margin-left: auto; color: var(--portal-coral); font-size: 10px; }
.mailbox-list { border-top: 1px solid var(--portal-line); }
.mailbox-item { padding: 21px 3px; border-bottom: 1px solid var(--portal-line); }
.mailbox-item.is-unread { padding-left: 12px; border-left: 3px solid var(--portal-coral); background: rgba(232, 199, 137, .12); }
.mailbox-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.mailbox-item-heading h3 { margin: 3px 0 0; color: var(--portal-ink); font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 400; line-height: 1.35; }
.mailbox-item-heading time { flex: 0 0 auto; color: var(--portal-muted); font-size: 10px; }
.mailbox-sender { margin: 8px 0 0; color: var(--portal-muted); font-size: 11px; }
.mailbox-body { margin: 13px 0 0; color: var(--portal-muted); font-size: 13px; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }
.mailbox-delivery-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; margin-top: 13px; color: var(--portal-muted); font-size: 10px; }
.mailbox-delivery-error { display: block; margin-top: 7px; color: #a44735; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.mailbox-item-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.admin-mailbox-list { max-height: 620px; overflow-y: auto; padding-right: 5px; }
.admin-mailbox-item { padding-left: 4px; padding-right: 4px; }
.profile-card { display: flex; align-items: flex-start; gap: 30px; padding: 30px; border: 1px solid var(--portal-line); background: rgba(255, 253, 248, .58); }
.profile-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 70px; height: 70px; color: var(--portal-paper); background: var(--portal-ink); font-family: Georgia, serif; font-size: 20px; }
.profile-fields { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 25px 40px; width: 100%; }
.profile-fields div { display: grid; gap: 4px; }
.profile-fields span { color: var(--portal-muted); font-size: 10px; }
.profile-fields strong { overflow: hidden; color: var(--portal-ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.profile-security { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); gap: 28px; margin-top: 18px; padding: 26px 30px; border: 1px solid var(--portal-line); background: rgba(230, 224, 211, .28); }
.profile-security h3 { margin: 4px 0 8px; color: var(--portal-ink); font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 400; }
.profile-security .admin-section-help { margin: 0; }
.password-form { display: grid; gap: 13px; }
.password-form .portal-button { justify-self: start; margin-top: 2px; }

.admin-quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.quick-link { display: grid; grid-template-columns: 40px 1fr 20px; align-items: center; gap: 15px; min-height: 77px; padding: 0 20px; border: 1px solid var(--portal-line); background: rgba(255, 253, 248, .58); transition: transform .2s ease, background .2s ease; }
.quick-link:hover { transform: translateY(-3px); background: var(--portal-gold-soft); }
.quick-link span { color: var(--portal-coral); font-family: Georgia, serif; font-size: 22px; }
.quick-link strong { font-size: 12px; }
.quick-link b { color: var(--portal-coral); font-size: 19px; font-weight: 400; }
.admin-editor { margin: -5px 0 22px; padding: 27px; border: 1px solid var(--portal-line); background: rgba(230, 224, 211, .35); }
.admin-section-help { max-width: 760px; margin: -10px 0 22px; color: var(--portal-muted); font-size: 12px; line-height: 1.7; }
.smtp-editor { margin-top: 0; }
.smtp-form .form-grid { align-items: start; }
.smtp-form .checkbox-field { min-height: 52px; }
.smtp-status { flex: 0 0 auto; }
.smtp-password-note { margin: 18px 0 0; color: var(--portal-muted); font-size: 11px; }
.smtp-password-note[data-configured="true"] { color: #477870; }
.smtp-actions { margin-top: 18px; }
.smtp-test-panel { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); gap: 26px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--portal-line); }
.smtp-test-panel h3 { margin: 4px 0 8px; color: var(--portal-ink); font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 400; }
.smtp-test-panel .admin-section-help { margin: 0; }
.smtp-test-controls { display: flex; align-items: end; gap: 13px; }
.smtp-test-controls label { flex: 1 1 auto; }
.smtp-test-controls .portal-button { flex: 0 0 auto; min-height: 43px; }
.smtp-test-result { min-height: 20px; margin: 15px 0 0; color: var(--portal-muted); font-size: 11px; }
.smtp-test-result[data-kind="success"] { color: #477870; }
.smtp-test-result[data-kind="error"] { color: #a44735; }
.content-language-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.content-table { min-width: 900px; table-layout: fixed; }
.content-table th:first-child, .content-table td:first-child { width: 220px; }
.content-table th:last-child, .content-table td:last-child { width: 90px; }
.content-preview { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-table code { color: var(--portal-coral); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.content-language-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 3px; }
.admin-form > label { margin-top: 16px; }
.admin-table { min-width: 850px; }
.student-table { min-width: 980px; }
.admin-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-record-panel { min-width: 0; padding: 22px; border: 1px solid var(--portal-line); background: rgba(255, 253, 248, .48); }
.admin-record-panel .section-heading-inline { align-items: center; margin-bottom: 20px; }
.admin-record-panel .section-heading-inline h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 400; }
.admin-record-panel .portal-button { min-height: 36px; padding: 0 12px; font-size: 10px; }
.admin-record-panel .admin-editor { margin: 0 0 18px; padding: 18px; }
.admin-record-panel .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-record-panel .admin-table { min-width: 690px; }
.admin-announcement-list { border-top: 1px solid var(--portal-line); }
.admin-notification-list { border-top: 1px solid var(--portal-line); }
.admin-notification-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 190px; align-items: center; gap: 20px; padding: 18px 3px; border-bottom: 1px solid var(--portal-line); }
.admin-notification-row > * { min-width: 0; }
.admin-notification-row.is-unread { padding-left: 12px; border-left: 3px solid var(--portal-coral); background: rgba(232, 199, 137, .12); }
.admin-notification-row h3 { margin: 3px 0; font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.admin-notification-row p { margin: 0; overflow: hidden; color: var(--portal-muted); font-size: 11px; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.admin-notification-row time { color: var(--portal-muted); font-size: 10px; }
.nav-count { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; place-items: center; color: var(--portal-ink); background: var(--portal-gold-soft); border-radius: 50%; font-size: 10px; line-height: 1; }
.admin-announcement-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 170px; align-items: center; gap: 20px; padding: 18px 3px; border-bottom: 1px solid var(--portal-line); }
.admin-admission-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px minmax(220px, 260px); align-items: center; gap: 20px; padding: 18px 3px; border-bottom: 1px solid var(--portal-line); }
.admin-admission-row.is-approved { background: rgba(150, 184, 158, .08); }
.admin-announcement-row > * { min-width: 0; }
.admin-admission-row > * { min-width: 0; }
.admin-announcement-row h3, .admin-admission-row h3 { margin: 0 0 3px; font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.admin-announcement-row p { margin: 0; overflow: hidden; color: var(--portal-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-admission-row p { margin: 0; overflow: hidden; color: var(--portal-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admission-provisioned { display: block; margin-top: 7px; color: var(--portal-muted); font-size: 11px; }
.admission-profile-editor { display: grid; gap: 9px; max-width: 620px; margin-top: 12px; }
.admission-profile-editor > summary { width: fit-content; color: var(--portal-coral); cursor: pointer; font-size: 11px; font-weight: 800; list-style-position: outside; }
.admission-profile-editor > summary::marker { color: var(--portal-coral); }
.admission-profile-editor[open] > summary { margin-bottom: 2px; color: var(--portal-ink); }
.admission-profile-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.admission-profile-editor label { display: grid; gap: 5px; color: var(--portal-muted); font-size: 10px; font-weight: 700; }
.admission-profile-editor input, .admission-profile-editor textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--portal-line); border-radius: 0; color: var(--portal-ink); background: rgba(255, 253, 248, .7); font: inherit; font-size: 11px; }
.admission-profile-editor textarea { min-height: 52px; resize: vertical; }
.admission-profile-editor input:focus, .admission-profile-editor textarea:focus { outline: 2px solid var(--portal-gold); outline-offset: 1px; border-color: var(--portal-gold); }
.admission-profile-editor input[readonly] { color: var(--portal-muted); background: rgba(230, 224, 211, .38); cursor: not-allowed; }
.admission-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.admission-editor-lock { color: var(--portal-muted); font-size: 10px; line-height: 1.5; }
.admin-announcement-meta { color: var(--portal-muted); font-size: 10px; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.admin-admission-row.is-closed { opacity: .78; }
.admin-table tr.is-disabled { opacity: .68; }
.admin-table tr.is-disabled td { background: rgba(230, 224, 211, .2); }

.portal-dialog { width: min(570px, calc(100% - 32px)); padding: 0; border: 0; color: var(--portal-ink); background: var(--portal-paper); box-shadow: 0 25px 80px rgba(0, 0, 0, .3); }
.portal-dialog::backdrop { background: rgba(16, 37, 43, .72); backdrop-filter: blur(4px); }
.dialog-content { position: relative; padding: 39px 38px 35px; }
.dialog-close { position: absolute; top: 13px; right: 16px; width: 30px; height: 30px; padding: 0; border: 0; color: var(--portal-ink); background: transparent; font-size: 27px; font-weight: 300; }
.dialog-content h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 32px; font-weight: 400; line-height: 1.3; }
.dialog-date { margin: 9px 0 20px; color: var(--portal-muted); font-size: 11px; }
.dialog-body { color: var(--portal-muted); font-size: 13px; line-height: 1.9; white-space: pre-wrap; }
.portal-toast { position: fixed; z-index: 60; right: 22px; bottom: 22px; max-width: min(360px, calc(100% - 44px)); padding: 13px 17px; color: var(--portal-paper); background: var(--portal-ink); box-shadow: 0 12px 30px rgba(0, 0, 0, .2); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.portal-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .portal-container { width: min(var(--portal-container), calc(100% - 44px)); }
  .portal-nav { gap: 16px; }
  .portal-header-actions { gap: 10px; }
  .portal-user-chip { max-width: 100px; }
  .login-layout { gap: 55px; }
  .login-orbit { right: 0; width: 175px; height: 175px; }
  .login-orbit::before, .login-orbit::after { width: 225px; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-fields { gap: 22px 25px; }
}

@media (max-width: 760px) {
  .portal-container { width: min(var(--portal-container), calc(100% - 36px)); }
  .portal-header-inner { min-height: 68px; gap: 15px; }
  .portal-nav { display: none; }
  .portal-header-actions { margin-left: auto; }
  .portal-user-chip { display: none; }
  .portal-icon-button { display: block; }
  .portal-mobile-nav { display: grid; max-height: 0; overflow: hidden; padding: 0 18px; background: var(--portal-paper); transition: max-height .25s ease, padding .25s ease; }
  .portal-mobile-nav.is-open { max-height: min(80vh, 560px); overflow-y: auto; padding-top: 8px; padding-bottom: 12px; border-top: 1px solid var(--portal-line); overscroll-behavior: contain; }
  .portal-mobile-nav a { padding: 10px 4px; border-bottom: 1px solid var(--portal-line); color: var(--portal-muted); font-size: 13px; }
  .portal-mobile-nav a:last-child { border-bottom: 0; }
  body.portal-shell.login-page .login-layout { display: block; grid-template-columns: none; min-height: auto; padding-top: 49px; padding-bottom: 50px; }
  .login-intro { min-height: 320px; padding-top: 10px; overflow: hidden; }
  .login-intro h1 { font-size: 43px; }
  .login-subtitle { font-size: 14px; }
  .login-orbit { right: 10px; bottom: 0; width: 138px; height: 138px; font-size: 19px; }
  .login-orbit::before, .login-orbit::after { width: 180px; height: 63px; }
  .login-english { margin-top: 50px; font-size: 15px; }
  .login-panel { width: 100%; max-width: none; padding: 30px 23px 24px; }
  .portal-main { padding-top: 43px; padding-bottom: 75px; }
  .portal-page-heading { align-items: flex-start; flex-direction: column; gap: 22px; padding-bottom: 31px; }
  .portal-page-heading h1 { font-size: 43px; }
  .portal-page-actions { width: 100%; justify-content: flex-start; }
  .portal-page-heading .portal-button { align-self: flex-start; }
  .portal-section { padding-top: 54px; }
  .section-heading-inline h2 { font-size: 34px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { min-height: 124px; padding: 17px 15px 15px; }
  .metric-card strong { margin-top: 9px; font-size: 31px; }
  .metric-course { font-size: 19px !important; }
  .overview-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .filter-bar select { flex: 1 1 0; min-width: 0; }
  .announcement-item { grid-template-columns: 65px minmax(0, 1fr); gap: 14px; }
  .announcement-open { grid-column: 2; justify-self: start; margin-top: 4px; }
  .mailbox-item-heading { flex-direction: column; gap: 6px; }
  .mailbox-item-heading time { align-self: flex-start; }
  .mailbox-unread-label { margin-left: 0; flex-basis: 100%; }
  .profile-card { align-items: stretch; flex-direction: column; padding: 22px; }
  .profile-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
  .profile-security { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
  .admin-quick-links { grid-template-columns: 1fr; }
  .admin-editor { padding: 20px 16px; }
  .content-language-grid { grid-template-columns: 1fr; gap: 15px; }
  .admin-announcement-row { grid-template-columns: 1fr; gap: 8px; }
  .admin-notification-row { grid-template-columns: 1fr; gap: 8px; }
  .admin-admission-row { grid-template-columns: 1fr; gap: 8px; }
  .admission-profile-fields { grid-template-columns: 1fr; }
  .admin-record-grid { grid-template-columns: 1fr; }
  .admin-record-panel { padding: 16px; }
  .admin-record-panel .section-heading-inline { align-items: flex-start; flex-direction: row; }
  .admin-actions { justify-content: flex-start; }
  .smtp-test-panel { grid-template-columns: 1fr; gap: 15px; }
}

@media (max-width: 440px) {
  .portal-brand-copy small { max-width: 105px; font-size: 9px; letter-spacing: .03em; }
  .portal-language { font-size: 10px; }
  .portal-logout { font-size: 10px; }
  .login-intro { min-height: 290px; }
  .login-orbit { right: -2px; bottom: -8px; width: 118px; height: 118px; }
  .login-orbit::before, .login-orbit::after { width: 154px; height: 53px; }
  .form-grid { grid-template-columns: 1fr; gap: 15px; }
  .content-language-grid { grid-template-columns: 1fr; gap: 15px; }
  .admin-record-panel .form-grid { grid-template-columns: 1fr; }
  .smtp-test-controls { align-items: stretch; flex-direction: column; }
  .smtp-test-controls .portal-button { align-self: flex-start; }
  .section-heading-inline { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-count { padding-bottom: 0; }
  .profile-fields { grid-template-columns: 1fr; }
  .dialog-content { padding: 34px 22px 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
