:root {
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #252d38;
  background: #f5f6f8;
  font-synthesis: none;
  --blue: #365c86;
  --blue-deep: #29496e;
  --line: #e5e8ed;
  --muted: #697584;
  --nav: #171c24;
  --gold: #d6b475;
  --card-shadow: 0 2px 6px rgba(29, 39, 52, .025);
}
* { box-sizing: border-box }
body { margin: 0; font-size: 14px; line-height: 1.6 }
::selection { background: #cfe2f8 }
button, input, select, textarea { font: inherit }

button {
  border: 0;
  background: var(--blue);
  color: white;
  padding: 10px 17px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: none;
  transition: background .15s, box-shadow .15s, transform .1s;
}
button:hover { background: var(--blue-deep) }
button:active { transform: translateY(1px); box-shadow: none }
button:disabled { opacity: .5; cursor: wait; transform: none }
button:focus-visible, a:focus-visible { outline: 2px solid #59a5ef; outline-offset: 2px }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 95, 196, .13) }
button.secondary {
  background: white;
  color: var(--blue);
  border: 1px solid var(--line);
  box-shadow: none;
}
button.secondary:hover { border-color: #a9c4e8; background: #f6faff; box-shadow: 0 1px 4px rgba(23, 43, 66, .07) }
button.quiet { color: var(--muted); background: transparent; padding: 5px 8px; box-shadow: none }
button.quiet:hover { background: rgba(100, 118, 138, .1); box-shadow: none }
button.danger { background: #b63d41 }
button.danger:hover { background: #9d3136; box-shadow: 0 2px 8px rgba(182, 61, 65, .3) }
button.small { padding: 5px 10px; font-size: 12px }

input, select, textarea {
  width: 100%;
  border: 1px solid #d4dae2;
  border-radius: 7px;
  padding: 10px 12px;
  background: white;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 }
label input, label select, label textarea { display: block; margin-top: 6px; font-weight: 400 }
textarea { resize: vertical }
h1, h2, h3, p { margin-top: 0 }
h1 { font-size: 28px; letter-spacing: -.7px; margin-bottom: 0 }
h2 { font-size: 21px }
h3 { font-size: 16px; margin-bottom: 8px }
.muted { color: var(--muted); font-weight: 400; font-size: 13px }
[hidden] { display: none !important }

.ui-icon, .icon-button svg, .brand-mark svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round }
.brand-mark { display: grid; place-items: center; background: #d6b475; color: #201d16; width: 39px; height: 39px; border-radius: 11px; flex-shrink: 0 }
.brand-mark svg { width: 25px; height: 25px }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; box-shadow: none; font-size: 24px; flex-shrink: 0 }
.icon-button:hover { background: #edf0f4; color: #252d38; box-shadow: none }
.workspace { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100svh }
.sidebar {
  background: var(--nav);
  color: #f1f2f4;
  display: flex;
  flex-direction: column;
  padding: 27px 14px 16px;
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 12px }
.brand { display: flex; gap: 12px; align-items: center; white-space: nowrap; text-decoration: none; color: inherit }
.brand strong { display: block; font-size: 20px; letter-spacing: .06em; line-height: 1.5 }
.brand small { display: block; color: #8e99a8; font-size: 11px; letter-spacing: .02em }
.environment-tag { align-self: flex-start; margin: 23px 12px 20px; padding: 3px 9px; border: 1px solid #373838; border-radius: 5px; color: #c1b493; font-size: 10px }
.sidebar nav { display: grid; gap: 4px; min-height: 0; overflow-y: auto; padding: 0 4px 18px; scrollbar-width: thin; scrollbar-color: #3e4652 transparent }
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #b1bac8;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  box-shadow: none;
  transition: background .15s, color .15s;
}
.sidebar nav button:hover { background: #242b35; color: #f1f2f4; box-shadow: none }
.sidebar nav .ui-icon { width: 17px; height: 17px; opacity: .8 }
.sidebar nav button.selected {
  background: #33322e;
  color: #f0d7a8;
  box-shadow: inset 2px 0 0 var(--gold);
  font-weight: 600;
}
.sidebar-footer {
  flex-shrink: 0;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 18px 6px 0;
  color: #b1bac8;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.identity-avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #303947; color: #dbe3ee; font-size: 14px; flex-shrink: 0 }
.identity-copy { flex: 1; min-width: 0 }
.identity-copy strong { display: block; color: #e2e7ed; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.identity-copy span { display: block; color: #939fae; font-size: 10px }
.sidebar .icon-button { color: #9aa5b4; border-color: transparent }
.sidebar .icon-button:hover { color: white; background: #29313c }
.sidebar-portal { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding: 12px 10px 0; color: #aeb9c8; font-size: 11px; text-decoration: none; flex-shrink: 0 }
.sidebar-portal:hover { color: #f0d7a8 }
#nav-toggle, #nav-close { display: none }
.nav-backdrop { display: none }

main { padding: 32px 38px; min-width: 0 }
header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 32px }
header p { color: var(--muted); font-size: 12px; margin-bottom: 5px; letter-spacing: .05em }
.header-actions { display: flex; align-items: center; gap: 10px }
.header-actions > a { font-size: 13px }
.workspace-main { display: flex; flex-direction: column; padding: 0 36px }
.workspace-header { min-height: 100px; margin: 0; border-bottom: 1px solid var(--line); gap: 16px; align-items: center }
.workspace-header h1 { font-size: 23px; font-weight: 650; letter-spacing: 0; line-height: 1.4; outline: none }
.workspace-header p { font-size: 11px; letter-spacing: 0; margin-bottom: 6px }
.page-heading { display: flex; align-items: center; gap: 11px; min-width: 0 }
.student-entry { color: #637084; text-decoration: none; padding: 8px }
.student-entry:hover { color: var(--blue) }
.student-entry span { margin-left: 4px }
.header-actions #new-order { min-height: 38px; padding: 8px 15px; font-size: 12px; border-radius: 9px }
.header-actions #new-order span { font-size: 15px; margin-right: 4px }
#page-content { padding-top: 28px; flex: 1; min-width: 0 }
.workspace-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 17px 0; margin-top: 5px; color: #76808c; font-size: 11px }
#connection { font-size: 12px; color: #257349; margin-right: 8px; display: inline-flex; align-items: center; gap: 7px }
#connection::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2f9e63; box-shadow: 0 0 0 3px rgba(47, 158, 99, .16) }

.notice {
  background: #e9f1fb;
  border-left: 3px solid #2f72bd;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #315a85;
  border-radius: 0 9px 9px 0;
}
.notice button { margin-left: 16px }
.overview-intro { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 19px }
.overview-intro h2 { margin: 0 0 5px; font-size: 22px; font-weight: 600; overflow-wrap: anywhere }
.overview-intro p { margin: 0; font-size: 12px; color: var(--muted) }
.overview-intro time { font-size: 12px; color: var(--muted); white-space: nowrap }
.demo-note { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #e8dfce; border-radius: 7px; background: #faf8f2; color: #84704a; font-size: 11px; margin-bottom: 20px }
.demo-note > span { width: 5px; height: 5px; border-radius: 50%; background: #b59b67; flex-shrink: 0 }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 23px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--card-shadow); overflow: hidden }
.stat {
  padding: 24px 23px 20px;
  min-width: 0;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0 }
.stat span { font-size: 12px; color: var(--muted) }
.stat strong {
  display: block;
  font-size: clamp(22px, 2.1vw, 31px);
  font-weight: 600;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  margin-top: 7px;
  color: #252d38;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.stat strong small { font-size: 17px; font-weight: 400; color: #7b8490 }
.stat p { margin: 7px 0 0; font-size: 10px; color: #77828f }
.balance-stat { background: #fafbfD }
.balance-stat strong { color: #365c86 }
.quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 23px }
.quick-link { display: flex; align-items: center; gap: 10px; padding: 14px 13px; text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 8px; color: #384452; font-weight: 400; box-shadow: none; min-width: 0 }
.quick-link:hover { border-color: #bdcbdc; background: #eef2f6; box-shadow: none }
.quick-link strong { display: block; font-size: 12px; font-weight: 600 }
.quick-link small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px }
.shortcut-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #e9edf3; color: #5b728e; flex-shrink: 0 }
.shortcut-icon .ui-icon { width: 18px; height: 18px }
.shortcut-chevron { margin-left: auto; color: #87919e; font-size: 20px }

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 23px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  background: white;
}
.panel-head h2, .panel-head h3 { margin: 0 }
.panel-head h3 { font-size: 14px; font-weight: 600 }
.panel-body { padding: 24px }

.table-scroll { overflow: auto }
table { width: 100%; border-collapse: collapse; white-space: nowrap; text-align: left }
th {
  background: #f8f9fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
td { padding: 16px; border-top: 1px solid #eef1f6; font-size: 12px; vertical-align: middle; font-variant-numeric: tabular-nums }
tbody tr { transition: background .12s }
tbody tr:hover { background: #f6f9fd }
td small { display: block; color: var(--muted) }
/* 末列钉右：宽表格横向滚动时操作列始终可见（实底防透叠，hover 同步行背景） */
th:last-child, td:last-child { position: sticky; right: 0; background: #fff; border-left: 1px solid #eef1f6 }
th:last-child { background: #f7f9fc }
tbody tr:hover td:last-child { background: #f6f9fd }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #edf1f7;
  color: #4d647e;
  font-size: 12px;
  font-weight: 500;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75 }
.badge.succeeded, .badge.active, .badge.all { background: #e2f3ea; color: #1f6b46 }
.badge.failed, .badge.refunded, .badge.rejected { background: #fbeaec; color: #a03a40 }
.badge.running, .badge.queued, .badge.whitelist { background: #e6effc; color: #2461a8 }
.badge.unknown, .badge.pending { background: #fdf3dd; color: #96691a }
.badge.cancelled, .badge.inactive, .badge.off { background: #eef0f3; color: #66788c }
.badge.ordered, .badge.charged { background: #e8f3f1; color: #14705f }

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 42px 24px; text-align: center; color: var(--muted); font-size: 12px }
.empty .ui-icon { width: 28px; height: 28px; color: #a3aebc; margin-bottom: 5px }
.empty strong { color: #576576; font-size: 12px; font-weight: 500 }
.empty span { font-size: 11px }
.two-columns { display: grid; grid-template-columns: 1.2fr 1fr; gap: 23px }

.plugin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 17px 22px;
  border-bottom: 1px solid #eef1f6;
  transition: background .12s;
}
.plugin-row:hover { background: #f8fbfe }
.plugin-row:last-child { border: 0 }
.plugin-row p { margin: 3px 0 0; color: var(--muted); font-size: 12px }
.plugin-row strong { font-size: 12px; font-weight: 600 }
.plugin-copy { flex: 1; min-width: 0; overflow-wrap: anywhere }
.plugin-copy p { font-size: 10px }
.plugin-version { margin-left: 12px; color: #84909e }
.service-icon { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #e8ecf1; border-radius: 9px; background: #f9fafc; color: #6b809a; flex-shrink: 0 }
.service-icon .ui-icon { width: 18px; height: 18px }
.notification-list { list-style: none; padding: 8px 22px; margin: 0 }
.notification-list li { display: flex; gap: 12px; padding: 15px 0; border-bottom: 1px solid #eef1f6 }
.notification-list li:last-child { border-bottom: 0 }
.notification-dot { width: 7px; height: 7px; border-radius: 50%; background: #a8b9cd; margin-top: 6px; flex-shrink: 0 }
.notification-list strong { display: block; font-size: 12px; font-weight: 500; overflow-wrap: anywhere }
.notification-list time { display: block; margin-top: 4px; color: var(--muted); font-size: 10px }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: step }
.flow div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafcfe;
  transition: border-color .15s, background .15s;
}
.flow div:hover { border-color: #b9d0ec; background: #f4f8fd }
.flow div::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font: 600 11px/1 ui-monospace, Consolas, monospace;
  color: var(--blue);
  opacity: .55;
  letter-spacing: .14em;
  margin-bottom: 9px;
}
.flow strong { display: block }
.flow span { font-size: 12px; color: var(--muted) }

.login-view {
  position: relative;
  isolation: isolate;
  min-height: max(760px, 100svh);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr);
  /* CSS 兜底星云：canvas 未加载或禁用 JS 时背景仍有质感，不退化为死黑 */
  background:
    radial-gradient(ellipse 62% 48% at 36% 42%, #241d0f 0%, transparent 64%),
    radial-gradient(ellipse 40% 32% at 74% 18%, #121623 0%, transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 110%, #141008 0%, transparent 60%),
    #050507;
  color: #f1ebdf;
  color-scheme: dark;
  overflow: hidden;
}
.login-view::selection { background: #5d4b2b; color: #fff }
.login-galaxy { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none }
.login-stage { display: flex; flex-direction: column; min-width: 0 }
.login-topbar { margin: 0; padding: 40px 54px; align-items: center }
.login-brand { display: inline-flex; align-items: center; gap: 14px; color: #eee6d5; text-decoration: none }
.login-brand strong { font-size: 22px; font-weight: 700; letter-spacing: .12em }
.login-brand span { color: #a09a8e; font-size: 12px; padding-left: 16px; border-left: 1px solid #373227 }
.brand-glyph { width: 29px; height: 29px; color: #d6b475 }
.login-hero { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 270px 54px 44px }
.login-copy { position: relative; margin-bottom: 44px }
.login-tagline { font: italic 24px/1.5 Georgia, "Times New Roman", serif; color: #d6b475; margin: 0 0 20px }
.login-title { font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif; font-size: clamp(38px, 4.2vw, 66px); font-weight: 750; line-height: 1.36; letter-spacing: .01em; margin: 0; color: #f1ebdf }
.login-sub { color: #aaa497; font-size: 15px; line-height: 1.9; margin: 26px 0 0 }
.login-meta { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #27251f; padding-top: 22px; font-size: 12px; color: #90897b; max-width: 600px }
.login-view a:not(.login-brand) { color: #cec5b3; text-underline-offset: 5px; text-decoration-color: #64583f }
.login-view a:not(.login-brand):hover { color: #e6c892; text-decoration-color: currentColor }
.login-panel-wrap { display: flex; flex-direction: column; justify-content: center; padding: 124px clamp(32px, 4.6vw, 82px) 48px; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .55) 35%, rgba(0, 0, 0, .72)) }
.login-panel { width: min(390px, 100%); margin: auto; position: relative }
.panel-rule { display: flex; align-items: center; margin-bottom: 28px }
.panel-rule::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #d6b475 }
.panel-rule i { height: 1px; flex: 1; background: #27251f }
.login-panel h2 { font-size: 32px; font-weight: 650; color: #f1ebdf; margin: 0 0 10px; letter-spacing: .02em }
.panel-register { color: #a39c8f; font-size: 13px; margin: 0 0 28px }
.panel-register a { margin-left: 6px }
.panel-hint { color: #a39c8f; font-size: 12px; line-height: 1.8; margin: 0 0 26px; min-height: 22px }
.login-panel .field { margin-bottom: 22px }
.login-panel .field label { font-size: 12px; color: #b1aa9b; margin: 0 0 9px; font-weight: 400 }
.login-panel .field input { background: rgba(13, 12, 10, .68); border: 1px solid #39352c; border-radius: 10px; padding: 14px 16px; color: #f1ebdf; font-size: 14px; box-shadow: none; min-height: 50px }
.login-panel .field input::placeholder { color: #8e887d }
.login-panel .field input:focus { outline: none; border-color: #b7965b; box-shadow: 0 0 0 3px rgba(214, 180, 117, .09) }
.login-panel .field input:autofill { box-shadow: inset 0 0 0 100px #14120d; -webkit-text-fill-color: #f1ebdf }
.login-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 28px 0 22px; padding: 7px 7px 7px 22px; min-height: 54px; border-radius: 999px; background: #eee7d8; color: #1c1912; font-size: 14px; font-weight: 650; border: 0; box-shadow: none; transition: background .15s }
.login-submit:hover { background: #e1cfa9; box-shadow: none }
.login-submit .arrow { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #17150f; color: #eee7d8; font-style: normal; font-size: 19px }
.login-agreement { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; border: 1px solid #302c24; border-radius: 10px; padding: 14px 12px; color: #aaa294; font-size: 11px; line-height: 1.7 }
.login-agreement input { width: 16px; height: 16px; margin: 0 5px 0 0; padding: 0; accent-color: #d6b475; flex-shrink: 0; cursor: pointer }
.login-agreement label { font-size: inherit; font-weight: 400; margin: 0; cursor: pointer }
.login-error { color: #ecc1ae; background: #291b14; border-radius: 8px; padding: 10px 12px; font-size: 12px; margin: 0 }
.panel-foot { color: #a39c8f; font-size: 11px; line-height: 1.9; margin: 20px 0 0 }
.login-copyright { width: min(390px, 100%); margin: 44px auto 0; color: #90897b; font-size: 11px; line-height: 1.8 }
#login-view button:focus-visible, #login-view a:focus-visible, #login-view input:focus-visible { outline: 2px solid #d6b475; outline-offset: 4px }
#login-view .field input:focus-visible { outline: none }
@media (max-width: 900px) and (min-width: 701px) {
  .login-view { grid-template-columns: minmax(0, 1.2fr) minmax(330px, 1fr) }
  .login-topbar { padding: 32px }
  .login-hero { padding: 270px 32px 36px }
  .login-tagline { font-size: 19px }
  .login-title { font-size: 38px }
  .login-brand span { display: none }
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  width: min(750px, 95vw);
  max-height: 90vh;
  box-shadow: 0 24px 80px rgba(15, 33, 53, .28);
}
dialog::backdrop { background: rgba(15, 33, 53, .42); backdrop-filter: blur(2px) }
.dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line) }
.dialog-header h2 { margin: 0; font-size: 19px }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px }
.quote-summary { background: #f0f6fd; border: 1px solid #d7e5f5; border-radius: 9px; padding: 15px 18px; margin-top: 15px }

.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  max-width: min(440px, 90vw);
  background: #16395c;
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 33, 53, .3);
  z-index: 10;
  font-size: 13px;
}
.toast.error { background: #9c343b }

.loading { padding: 40px; color: var(--muted) }
.pagination { padding: 16px 22px; border-top: 1px solid var(--line); text-align: right }
pre { white-space: pre-wrap; word-break: break-word; background: #f5f8fc; padding: 15px; font-size: 12px; max-height: 320px; overflow: auto; border-radius: 8px }
.actions { display: flex; gap: 8px; flex-wrap: wrap }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0 }
.panel > .hint { padding: 13px 22px; margin: 0; background: #fafbfd; border-bottom: 1px solid var(--line) }

.table-scroll::-webkit-scrollbar, pre::-webkit-scrollbar { width: 8px; height: 8px }
.table-scroll::-webkit-scrollbar-thumb, pre::-webkit-scrollbar-thumb { background: #c3d1e2; border-radius: 8px }
.table-scroll::-webkit-scrollbar-track, pre::-webkit-scrollbar-track { background: transparent }

.menu-group { margin-top: 10px }
.menu-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 10px; color: #8b96a6; padding: 7px 12px; cursor: pointer; list-style: none }
.menu-group > summary::-webkit-details-marker { display: none }
.menu-group > summary > span { color: #647082; transform: rotate(-90deg) }
.menu-group[open] > summary > span { transform: none }
.menu-group > div { display: grid; gap: 3px }
.menu-group > summary:focus-visible, .table-scroll:focus-visible { outline: 2px solid #809bbf; outline-offset: -2px }

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: dialog-in .2s ease }
  .toast { animation: toast-in .25s cubic-bezier(.22, 1, .36, 1) }
  .loading::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 9px;
    vertical-align: -2px;
    border: 2px solid #c7d6ea;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
  }
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes spin { to { transform: rotate(360deg) } }

@media (max-width: 1050px) {
  main { padding: 25px }
  .workspace { grid-template-columns: 212px minmax(0, 1fr) }
  .workspace-main { padding: 0 24px }
  .sidebar { padding: 24px 10px 16px }
  .two-columns { grid-template-columns: 1fr }
  .flow { grid-template-columns: 1fr 1fr }
  .header-actions #connection { display: none }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .stat:nth-child(2) { border-right: 0 }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line) }
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .student-entry { display: none }
  .stat { padding: 18px 20px }
  .stat strong { font-size: 26px }
}
@media (max-width: 700px) {
  .workspace { display: block }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(286px, 86vw); height: 100svh; z-index: 21; padding: 24px 14px 18px; transform: translateX(-100%); visibility: hidden }
  .nav-open .sidebar { transform: none; visibility: visible }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 20; border-radius: 0; background: rgba(15, 20, 28, .48); padding: 0; cursor: default }
  .nav-backdrop:hover { background: rgba(15, 20, 28, .48); box-shadow: none }
  body.navigation-open { overflow: hidden }
  #nav-toggle, #nav-close { display: inline-grid }
  #nav-toggle { border: 0; width: 30px }
  .sidebar-footer { display: flex }
  main { padding: 20px 14px }
  .workspace-main { padding: 0 17px }
  .workspace-header { min-height: 85px; gap: 8px }
  .workspace-header h1 { font-size: 19px }
  .workspace-header p { font-size: 10px; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
  .page-heading { gap: 5px }
  #page-content { padding-top: 21px }
  .workspace-footer { font-size: 10px }
  .workspace-footer > span:first-child { max-width: 180px }
  .overview-intro { align-items: flex-start; flex-direction: column; gap: 7px; margin-bottom: 15px }
  .overview-intro h2 { font-size: 20px }
  .overview-intro time { font-size: 11px }
  .demo-note { padding: 9px 11px; font-size: 10px; margin-bottom: 15px }
  header { align-items: flex-start; gap: 8px; margin-bottom: 20px }
  h1 { font-size: 23px }
  .header-actions { gap: 6px }
  .header-actions #new-order { padding: 8px 10px; font-size: 11px; min-height: 34px }
  .header-actions #refresh { width: 32px; height: 34px }
  .header-actions #new-order span { display: none }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px }
  .stat { padding: 16px 14px }
  .stat strong { font-size: 22px; margin-top: 5px }
  .stat strong small { font-size: 13px }
  .stat span { font-size: 11px }
  .stat p { font-size: 9px }
  .quick-links { gap: 8px; margin-bottom: 18px }
  .quick-link { padding: 11px 10px; gap: 8px }
  .quick-link strong { font-size: 11px }
  .quick-link small { display: none }
  .shortcut-icon { width: 28px; height: 28px; border-radius: 6px }
  .shortcut-chevron { font-size: 18px }
  .panel-head, .panel-body { padding: 18px }
  .panel { margin-bottom: 18px }
  .plugin-row { padding: 15px 17px; gap: 10px }
  .plugin-row .badge { font-size: 10px; padding: 3px 7px }
  .two-columns { gap: 0 }
  .flow { gap: 8px }
  .login-view { grid-template-columns: minmax(0, 1fr); min-height: 100svh }
  .login-stage { min-height: 520px }
  .login-topbar { padding: 24px }
  .login-brand strong { font-size: 20px }
  .login-brand span { font-size: 11px }
  .login-hero { padding: 210px 24px 26px }
  .login-copy { margin-bottom: 26px }
  .login-tagline { font-size: 19px; margin-bottom: 12px }
  .login-title { font-size: clamp(30px, 8vw, 42px) }
  .login-sub { margin-top: 18px; font-size: 13px }
  .login-meta { gap: 12px; font-size: 11px; padding-top: 18px }
  .login-panel-wrap { padding: 24px 24px 32px; background: rgba(0, 0, 0, .48) }
  .login-panel h2 { font-size: 28px }
  .login-copyright { margin-top: 30px }
  .form-grid { grid-template-columns: 1fr }
  dialog { padding: 20px; max-height: 90svh }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important }
}
