/* ============================================================
   Ret2Shell-style theme — faithful re-implementation of the
   original Ret 2 Shell (github.com/ret2shell) design system:
   - cyber-dark / cyber-light layers, oklch accent palette
   - flat translucent-ink surfaces, no shadows, no gradients
   - double-layer cards, icon-boxed inputs, 2px progress bars
   - hexagon circuit background with draw-line animation
   - terminal-style inverted selection, hidden scrollbars
   ============================================================ */

@font-face {
  font-family: "Reverier Mono";
  font-display: swap;
  font-weight: 400;
  font-style: normal;
  src: url("/static/fonts/reverier-mono.woff2") format("woff2");
}

@font-face {
  font-family: "Reverier Mono";
  font-display: swap;
  font-weight: 700;
  font-style: normal;
  src: url("/static/fonts/reverier-mono-bold.woff2") format("woff2");
}

@font-face {
  font-family: "Reverier Mono";
  font-display: swap;
  font-weight: 400;
  font-style: italic;
  src: url("/static/fonts/reverier-mono-italic.woff2") format("woff2");
}

/* ------------------------------------------------------------
   1. Design tokens (values match the original base.css)
   ------------------------------------------------------------ */
:root {
  --r2s-primary: oklch(0.64 0.17 248);
  --r2s-primary-content: #000;
  --r2s-error: oklch(0.64 0.17 24);
  --r2s-error-content: #000;
  --r2s-warning: oklch(0.64 0.17 48);
  --r2s-warning-content: #000;
  --r2s-success: oklch(0.64 0.17 150);
  --r2s-success-content: #000;
  --r2s-info: oklch(0.64 0.17 248);
  --r2s-info-content: #000;

  /* dark layer is the flagship look (original default) */
  --r2s-layer: oklch(0.18 0 248);
  --r2s-ink: #fff;

  /* translucent ink scale — the core of the original look */
  --ink-04: color-mix(in srgb, var(--r2s-ink) 4%, transparent);
  --ink-05: color-mix(in srgb, var(--r2s-ink) 5%, transparent);
  --ink-08: color-mix(in srgb, var(--r2s-ink) 8%, transparent);
  --ink-10: color-mix(in srgb, var(--r2s-ink) 10%, transparent);
  --ink-15: color-mix(in srgb, var(--r2s-ink) 15%, transparent);
  --ink-20: color-mix(in srgb, var(--r2s-ink) 20%, transparent);
  --ink-30: color-mix(in srgb, var(--r2s-ink) 30%, transparent);
  --ink-40: color-mix(in srgb, var(--r2s-ink) 40%, transparent);
  --ink-60: color-mix(in srgb, var(--r2s-ink) 60%, transparent);
  --ink-80: color-mix(in srgb, var(--r2s-ink) 80%, transparent);

  --layer-60: color-mix(in srgb, var(--r2s-layer) 60%, transparent);
  --layer-80: color-mix(in srgb, var(--r2s-layer) 80%, transparent);
  --layer-90: color-mix(in srgb, var(--r2s-layer) 90%, transparent);

  /* compat aliases used across older rules */
  --r2s-muted: var(--ink-60);
  --r2s-faint: var(--ink-08);
  --r2s-soft: var(--ink-05);
  --r2s-line: var(--ink-15);
  --r2s-line-strong: var(--ink-30);
  --r2s-panel: var(--layer-60);
  --r2s-panel-solid: var(--r2s-layer);

  --r2s-radius-xs: 2px;
  --r2s-radius-sm: 6px;
  --r2s-radius: 8px;   /* rounded-lg — buttons, inputs */
  --r2s-radius-xl: 12px; /* rounded-xl — cards */
  --r2s-left: 296px;
  --r2s-right: 300px;

  --r2s-ease: ease-in-out;
  --r2s-dur: 0.3s;

  --r2s-font: "Reverier Mono", "Menlo", -apple-system, "Noto Sans",
    "Helvetica Neue", "Helvetica", "Nimbus Sans L", "Arial", "Liberation Sans",
    "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC",
    "Source Han Sans CN", "Microsoft YaHei", "Consolas", "Courier", monospace;
}

html[data-theme="cyber-light"] {
  --r2s-layer: oklch(0.96 0.015 248);
  --r2s-ink: #000;
}

/* ------------------------------------------------------------
   2. Base / reset
   ------------------------------------------------------------ */
* {
  box-sizing: border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

html {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  min-width: 320px;
  color: var(--r2s-ink);
  font-family: var(--r2s-font);
  font-size: 15px;
  line-height: 1.6;
  background: var(--r2s-layer);
  transition: background-color 0.7s, color 0.7s;
  overflow-x: hidden;
}

/* terminal-like inverted selection (original signature) */
::selection {
  background: var(--r2s-ink);
  color: var(--r2s-layer);
}

a {
  color: inherit;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* original autofill counter-hack */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-transition: color 1919810s ease-out, background-color 1919810s ease-out;
  -webkit-box-shadow: none;
  -webkit-text-fill-color: var(--r2s-ink);
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

button {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

form.is-submitting {
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

/* ------------------------------------------------------------
   3. Keyframes (ported from the original widget styles)
   ------------------------------------------------------------ */
@keyframes draw-line {
  0% { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

@keyframes r2s-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes r2s-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes r2s-dive-left {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes r2s-dive-right {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes r2s-dive-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes r2s-dive-scale {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* tailwind's animate-ping — used for the `_` cursor on splash */
@keyframes r2s-ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

/* steady terminal caret blink */
@keyframes r2s-caret-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

@keyframes r2s-toast-out {
  to { opacity: 0; transform: translateX(24px); }
}

@keyframes rainbow {
  0% { background-position: 0 0; }
  100% { background-position: -100% 0; }
}

@keyframes skeleton {
  from { background-position: 150%; }
  to { background-position: -50%; }
}

@keyframes rx-dash {
  to { stroke-dashoffset: 600; }
}

/* staggered logo stroke-draw + fill (original logo-animate pattern) */
@keyframes logo-stroke {
  0% { stroke-dashoffset: 620; stroke-dasharray: 620; }
  100% { stroke-dashoffset: 0; stroke-dasharray: 620; }
}

@keyframes logo-fill-primary {
  0% { fill: transparent; }
  100% { fill: var(--r2s-primary); }
}

@keyframes logo-fill-error {
  0% { fill: transparent; }
  100% { fill: var(--r2s-error); }
}

@keyframes logo-fill-gray {
  0% { fill: transparent; }
  100% { fill: rgb(128, 128, 128); }
}

@keyframes logo-fill-soft {
  0% { fill: transparent; }
  100% { fill: var(--ink-10); }
}

/* ------------------------------------------------------------
   4. Background — hexagon circuit lines (original artwork)
   ------------------------------------------------------------ */
.r2s-bg-lines {
  position: fixed;
  inset: -1px;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
}

.r2s-bg-lines::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--layer-90);
  transition: background-color 0.7s;
}

.r2s-bg-lines svg {
  position: fixed;
  height: 100vh;
  opacity: 0.1;
}

.r2s-bg-lines svg:first-of-type {
  left: 0;
  bottom: 0;
}

.r2s-bg-lines svg:last-of-type {
  right: 0;
  top: 0;
}

.r2s-bg-lines path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-line 3s cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

.r2s-bg-lines.is-settled path {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
}

/* ------------------------------------------------------------
   5. Text utilities
   ------------------------------------------------------------ */
.r2s-kicker,
.student-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-60);
  text-transform: lowercase;
}

.r2s-heading {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.r2s-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
}

.r2s-subtitle {
  color: var(--ink-60);
  margin-top: 6px;
}

.r2s-muted {
  color: var(--ink-60);
}

.small,
.r2s-muted.small {
  font-size: 12.5px;
}

.r2s-empty {
  padding: 22px 16px;
  color: var(--ink-60);
  text-align: center;
  border: 1px dashed var(--ink-15);
  border-radius: var(--r2s-radius-xl);
}

.rainbow {
  background-image: -webkit-linear-gradient(left, #0078d6, #f4e006 20%, #ff0000 40%, #00ff08 60%, #c800ff 80%, #0078d6);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 100%;
  animation: rainbow 4s infinite linear;
}

.skeleton {
  background-color: var(--ink-30);
  will-change: background-position;
  animation: skeleton 1.8s ease-in-out infinite;
  background-image: linear-gradient(105deg, transparent 0%, transparent 40%, var(--ink-40) 50%, transparent 60%, transparent 100%);
  background-size: 200% auto;
  background-repeat: no-repeat;
  background-position-x: -50%;
}

/* typed-title caret (splash / brand) */
.r2s-caret {
  display: inline-block;
  color: var(--r2s-primary);
  animation: r2s-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.r2s-type-cursor::after {
  content: "_";
  color: var(--r2s-primary);
  animation: r2s-caret-blink 1.06s step-end infinite;
}

/* layout helpers */
.r2s-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.r2s-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.r2s-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.r2s-list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.r2s-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.r2s-icon[data-icon]::before {
  content: attr(data-icon);
}

/* bootstrap-ish utility shims (bootstrap CDN removed) */
.d-flex { display: flex; }
.d-none { display: none !important; }
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.align-items-end { align-items: flex-end; }
.justify-content-end { justify-content: flex-end; }
.text-end { text-align: right; }

code {
  font-family: inherit;
  background: var(--ink-10);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ------------------------------------------------------------
   6. Buttons — original .btn recipe (translucent ink, flat)
   ------------------------------------------------------------ */
.r2s-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
  background: var(--ink-10);
  color: var(--r2s-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}

.r2s-button:hover {
  background: var(--ink-20);
}

.r2s-button:active {
  background: var(--ink-15);
}

.r2s-button:focus-visible {
  outline: 2px solid var(--ink-60);
  outline-offset: 2px;
}

.r2s-button:disabled,
.r2s-button[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.r2s-button.primary {
  background: var(--r2s-primary);
  color: var(--r2s-primary-content);
}

.r2s-button.primary:hover {
  background: color-mix(in srgb, var(--r2s-primary) 80%, transparent);
}

.r2s-button.primary:active {
  background: color-mix(in srgb, var(--r2s-primary) 70%, transparent);
}

.r2s-button.primary:focus-visible {
  outline-color: var(--r2s-primary);
}

.r2s-button.danger {
  background: var(--r2s-error);
  color: var(--r2s-error-content);
}

.r2s-button.danger:hover {
  background: color-mix(in srgb, var(--r2s-error) 80%, transparent);
}

.r2s-button.danger:active {
  background: color-mix(in srgb, var(--r2s-error) 70%, transparent);
}

.r2s-button.danger:focus-visible {
  outline-color: var(--r2s-error);
}

.r2s-button.warning {
  background: var(--r2s-warning);
  color: var(--r2s-warning-content);
}

.r2s-button.warning:hover {
  background: color-mix(in srgb, var(--r2s-warning) 80%, transparent);
}

.r2s-button.warning:active {
  background: color-mix(in srgb, var(--r2s-warning) 70%, transparent);
}

.r2s-button.warning:focus-visible {
  outline-color: var(--r2s-warning);
}

.r2s-button.success {
  background: var(--r2s-success);
  color: var(--r2s-success-content);
}

.r2s-button.success:hover {
  background: color-mix(in srgb, var(--r2s-success) 80%, transparent);
}

.r2s-button.success:active {
  background: color-mix(in srgb, var(--r2s-success) 70%, transparent);
}

.r2s-button.success:focus-visible {
  outline-color: var(--r2s-success);
}

.r2s-button.ghost {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.r2s-button.ghost:hover {
  background: var(--ink-20);
}

.r2s-button.ghost:active {
  background: var(--ink-15);
}

.r2s-button.chip-xs {
  min-height: 26px;
  padding: 0 8px;
  border-radius: var(--r2s-radius-sm);
  font-size: 12.5px;
}

.r2s-button.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.r2s-button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: r2s-spin 0.8s linear infinite;
}

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

/* square icon button (theme toggle etc.) */
.r2s-button.square {
  width: 40px;
  padding: 0;
}

.r2s-button.square svg {
  width: 20px;
  height: 20px;
}

/* theme toggle sun/moon swap */
html[data-theme="cyber-dark"] .icon-scheme-sun { display: none; }
html[data-theme="cyber-light"] .icon-scheme-moon { display: none; }

/* ------------------------------------------------------------
   7. Pills — original .tag recipe (rounded-full + dot)
   ------------------------------------------------------------ */
.r2s-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--ink-10);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.r2s-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-60);
  flex-shrink: 0;
}

.r2s-pill.ok::before { background: var(--r2s-success); }
.r2s-pill.warn::before { background: var(--r2s-warning); }
.r2s-pill.err::before { background: var(--r2s-error); }

.r2s-pill.ok { color: var(--r2s-success); }
.r2s-pill.warn { color: var(--r2s-warning); }
.r2s-pill.err { color: var(--r2s-error); }

/* ------------------------------------------------------------
   8. Frame + topbar (original title-bar recipe)
   ------------------------------------------------------------ */
.r2s-frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.r2s-topbar {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 40;
  background: var(--layer-60);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background-color 0.7s;
}

.r2s-topbar-inner {
  width: 100%;
  min-height: 64px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ink-05);
  border-bottom: 1px solid var(--ink-15);
}

.r2s-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: var(--r2s-radius);
  color: var(--r2s-ink);
  text-decoration: none;
  transition: background-color 0.2s ease-out;
}

.r2s-brand:hover {
  background: var(--ink-10);
}

.r2s-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--r2s-primary);
}

.r2s-brand:hover .r2s-brand-mark {
  background-image: -webkit-linear-gradient(left, #0078d6, #f4e006 20%, #ff0000 40%, #00ff08 60%, #c800ff 80%, #0078d6);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 100%;
  animation: rainbow 4s infinite linear;
}

.r2s-brand > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.r2s-brand-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r2s-brand-title.is-typing::after {
  content: "_";
  color: var(--r2s-primary);
  animation: r2s-caret-blink 1.06s step-end infinite;
}

.r2s-brand-sub {
  font-size: 11.5px;
  color: var(--ink-60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.r2s-actions .r2s-button:not(.primary):not(.danger):not(.warning):not(.success) {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.r2s-actions .r2s-button:not(.primary):not(.danger):not(.warning):not(.success):hover {
  background: var(--ink-20);
}

/* ------------------------------------------------------------
   9. Panels — original double-layer .card recipe
   ------------------------------------------------------------ */
.r2s-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink-15);
  border-radius: var(--r2s-radius-xl);
  background: var(--layer-60);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: background-color 0.7s, border-color 0.7s;
}

.r2s-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  background: var(--ink-05);
  border-bottom: 1px solid var(--ink-10);
}

.r2s-panel-body {
  flex: 1;
  padding: 20px;
  background: var(--ink-05);
}

.r2s-panel-head + .r2s-panel-body {
  border-top: none;
}

/* ------------------------------------------------------------
   10. Forms — original .input / .label recipes
   ------------------------------------------------------------ */
.form-label,
.r2s-login-field-label {
  display: flex;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-60);
}

.form-text {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink-60);
}

.form-text.ok { color: var(--r2s-success); }
.form-text.err { color: var(--r2s-error); }

.form-control {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
  background: var(--ink-05);
  color: var(--r2s-ink);
  font-family: inherit;
  font-size: 14px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background-color 0.2s ease-out;
}

.form-control:hover {
  background: var(--ink-08);
}

.form-control:focus {
  outline: 2px solid var(--ink-60);
  outline-offset: 2px;
  background: var(--ink-05);
}

.form-control:disabled {
  background: var(--ink-05);
  color: var(--ink-40);
  cursor: not-allowed;
}

.form-control::placeholder {
  color: var(--ink-40);
}

textarea.form-control {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.form-check-input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--r2s-primary);
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

@media (max-width: 860px) {
  .span-2, .span-3, .span-4, .span-5, .span-6, .span-8 {
    grid-column: span 12;
  }
}

/* multi select dropdown */
.multi-select {
  position: relative;
}

.multi-select-toggle {
  display: flex;
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
  background: var(--ink-05);
  color: var(--r2s-ink);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.multi-select-toggle:hover {
  background: var(--ink-08);
}

.multi-select-toggle:focus-visible {
  outline: 2px solid var(--ink-60);
  outline-offset: 2px;
}

.multi-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--ink-15);
  border-radius: var(--r2s-radius-xl);
  background: var(--r2s-panel-solid);
  display: none;
}

.multi-select-menu.show {
  display: block;
  animation: r2s-fade-in 0.2s ease-out, r2s-dive-up 0.2s ease-out;
}

.multi-select-menu .form-check {
  padding: 6px 8px;
  border-radius: var(--r2s-radius-sm);
}

.multi-select-menu .form-check:hover {
  background: var(--ink-08);
}

/* filter pills — flat ghost buttons, active = ink block */
.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius-sm);
  background: transparent;
  color: var(--ink-60);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.filter-pill:hover {
  background: var(--ink-10);
  color: var(--r2s-ink);
}

.filter-pill.active {
  background: var(--ink-15);
  color: var(--r2s-ink);
}

/* ------------------------------------------------------------
   11. Progress — original 2px hairline
   ------------------------------------------------------------ */
.progress {
  position: relative;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--ink-30);
  overflow: visible;
}

.progress-bar {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: var(--r2s-primary);
  transition: width 0.3s ease-in-out;
}

/* ------------------------------------------------------------
   12. Login page — original account/login card layout
   ------------------------------------------------------------ */
.r2s-login-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 12px 48px;
}

.r2s-login-stage {
  width: min(880px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* the login card = original double-layer card */
.r2s-login-main {
  border: 1px solid var(--ink-15);
  border-radius: var(--r2s-radius-xl);
  background: var(--layer-60);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
  animation: r2s-dive-up 0.3s var(--r2s-ease) both;
}

.r2s-login-columns {
  display: flex;
  flex-direction: row;
  gap: 24px;
  padding: 24px;
  background: var(--ink-05);
}

.r2s-login-panel {
  flex: 1;
  min-width: 0;
}

.r2s-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.r2s-login-form-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.r2s-login-divider {
  width: 1px;
  align-self: stretch;
  background: var(--ink-10);
}

.r2s-login-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: r2s-dive-right 0.3s var(--r2s-ease) both;
}

.r2s-login-logo {
  width: 144px;
  height: 144px;
}

.r2s-login-logo svg {
  width: 100%;
  height: 100%;
}

/* logo line-art: staggered stroke draw + delayed fill (original pattern) */
.r2s-login-logo path {
  fill: transparent;
  stroke-width: 6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.r2s-login-logo .logo-doc-face {
  stroke: var(--ink-60);
  animation: logo-stroke 1s cubic-bezier(0.47, 0, 0.745, 0.715) 0s both,
    logo-fill-soft 0.7s cubic-bezier(0.47, 0, 0.745, 0.715) 0.8s both;
}

.r2s-login-logo .logo-doc-fold {
  stroke: var(--ink-60);
  animation: logo-stroke 1s cubic-bezier(0.47, 0, 0.745, 0.715) 0.12s both,
    logo-fill-gray 0.7s cubic-bezier(0.47, 0, 0.745, 0.715) 0.9s both;
}

.r2s-login-logo .logo-doc-lines {
  stroke: var(--ink-60);
  fill: none;
  animation: logo-stroke 1s cubic-bezier(0.47, 0, 0.745, 0.715) 0.24s both;
}

.r2s-login-logo .logo-pen-body {
  stroke: var(--r2s-primary);
  animation: logo-stroke 1s cubic-bezier(0.47, 0, 0.745, 0.715) 0.36s both,
    logo-fill-primary 0.7s cubic-bezier(0.47, 0, 0.745, 0.715) 1s both;
}

.r2s-login-logo .logo-pen-tip {
  stroke: var(--r2s-error);
  animation: logo-stroke 1s cubic-bezier(0.47, 0, 0.745, 0.715) 0.48s both,
    logo-fill-error 0.7s cubic-bezier(0.47, 0, 0.745, 0.715) 1.1s both;
}

.r2s-login-brand-copy {
  text-align: center;
}

.r2s-login-brand-copy h1 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
}

.r2s-login-brand-copy p {
  margin: 2px 0 0;
  color: var(--ink-60);
  font-size: 13px;
}

/* icon-boxed input (original Input widget) */
.r2s-login-field {
  display: flex;
  flex-direction: column;
}

.r2s-login-input-wrap {
  display: flex;
  flex-direction: row;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
}

.r2s-login-input-wrap:focus-within {
  outline: 2px solid var(--ink-60);
  outline-offset: 2px;
}

.r2s-login-input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  border-radius: var(--r2s-radius) 0 0 var(--r2s-radius);
  background: var(--ink-10);
  color: var(--r2s-ink);
}

.r2s-login-input-icon svg {
  width: 20px;
  height: 20px;
}

.r2s-login-input {
  flex: 1;
  width: 0;
  min-height: 44px;
  padding: 8px 14px;
  border: none;
  border-radius: 0 var(--r2s-radius) var(--r2s-radius) 0;
  background: var(--ink-05);
  color: var(--r2s-ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: background-color 0.2s ease-out;
}

.r2s-login-input:hover,
.r2s-login-input:focus {
  background: var(--ink-08);
}

.r2s-login-input::placeholder {
  color: var(--ink-40);
}

.r2s-login-input.has-eye {
  border-radius: 0;
}

.r2s-login-eye {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 0 var(--r2s-radius) var(--r2s-radius) 0;
  background: var(--ink-10);
  color: var(--r2s-ink);
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.r2s-login-eye:hover {
  background: var(--ink-20);
}

.r2s-login-eye svg {
  width: 20px;
  height: 20px;
}

.r2s-login-eye .eye-off { display: none; }
.r2s-login-eye.is-visible .eye-on { display: none; }
.r2s-login-eye.is-visible .eye-off { display: block; }

.r2s-login-submit {
  margin-top: 12px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
  background: var(--r2s-primary);
  color: var(--r2s-primary-content);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.r2s-login-submit:hover {
  background: color-mix(in srgb, var(--r2s-primary) 80%, transparent);
}

.r2s-login-submit:active {
  background: color-mix(in srgb, var(--r2s-primary) 70%, transparent);
}

.r2s-login-submit:disabled {
  background: color-mix(in srgb, var(--r2s-primary) 85%, transparent);
  color: color-mix(in srgb, var(--r2s-primary-content) 60%, transparent);
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .r2s-login-columns {
    flex-direction: column-reverse;
    gap: 16px;
    padding: 18px 16px;
  }
  .r2s-login-divider {
    width: auto;
    height: 1px;
  }
  .r2s-login-side {
    animation-name: r2s-dive-up;
    gap: 6px;
  }
  .r2s-login-logo {
    width: 64px;
    height: 64px;
  }
  .r2s-login-brand-copy h1 {
    font-size: 19px;
  }
  /* 16px 以下的输入框在 iOS 上聚焦会触发页面自动缩放 */
  .r2s-login-input {
    font-size: 16px;
  }
}

/* bulletin board below the login card */
.r2s-login-bulletin {
  border: 1px solid var(--ink-15);
  border-radius: var(--r2s-radius-xl);
  background: var(--layer-60);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
  animation: r2s-dive-up 0.3s var(--r2s-ease) 0.08s both;
}

.notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ink-05);
  border-bottom: 1px solid var(--ink-10);
}

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

.notice-tip {
  font-size: 12.5px;
  color: var(--ink-60);
}

.notice-pager {
  display: flex;
  gap: 4px;
}

.notice-page-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--r2s-radius-sm);
  background: transparent;
  color: var(--r2s-ink);
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.notice-page-button:hover {
  background: var(--ink-15);
}

.notice-page-button svg {
  width: 16px;
  height: 16px;
}

.notice-viewport {
  position: relative;
  min-height: 118px;
  background: var(--ink-05);
}

#noticeTrack {
  position: relative;
  min-height: 118px;
  transition: height 0.32s var(--r2s-ease);
}

.notice-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 118px;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
}

/* 进场卡片盖在离场卡片上方，避免过渡瞬间文字叠影 */
.notice-card.is-active {
  display: flex;
  z-index: 1;
  animation: r2s-dive-right 0.32s var(--r2s-ease) both;
}

.notice-card.is-active.enter-left {
  animation-name: r2s-dive-left;
}

.notice-card.is-leaving {
  display: flex;
  z-index: 0;
  animation: notice-leave-left 0.32s var(--r2s-ease) both;
  pointer-events: none;
}

.notice-card.is-leaving.leave-right {
  animation-name: notice-leave-right;
}

@keyframes notice-leave-left {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-24px); }
}

@keyframes notice-leave-right {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

.notice-title {
  font-weight: 700;
}

.notice-time {
  font-size: 12px;
  color: var(--ink-60);
}

.notice-content {
  flex: 1;
  font-size: 13.5px;
  color: var(--ink-80);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.notice-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notice-dots {
  display: flex;
  gap: 5px;
}

.notice-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-20);
  transition: background-color 0.3s;
}

.notice-dot.active {
  background: var(--r2s-primary);
}

/* ------------------------------------------------------------
   13. Splash / transition overlay (original boot splash)
   ------------------------------------------------------------ */
.r2s-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--r2s-layer);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-out, visibility 0.3s;
}

.r2s-transition-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.r2s-transition-overlay.is-finished {
  opacity: 0;
}

/* hexagon lines inside the overlay must sit above its own bg */
.r2s-transition-overlay .r2s-bg-lines {
  position: absolute;
  z-index: 0;
}

.r2s-transition-overlay .r2s-bg-lines::before {
  display: none;
}

.r2s-transition-overlay .r2s-bg-lines svg {
  position: absolute;
}

.r2s-transition-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.r2s-transition-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  opacity: 0.9;
}

.r2s-transition-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  opacity: 0.9;
}

.r2s-transition-user {
  font-size: 15px;
  color: var(--ink-60);
  min-height: 1.5em;
}

.r2s-transition-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-60);
  opacity: 0;
}

.r2s-transition-overlay.is-active .r2s-transition-status {
  animation: r2s-fade-in 0.3s ease-out 0.9s both;
}

.r2s-transition-progress {
  width: min(320px, 70vw);
  margin-top: 8px;
}

body.r2s-login-transitioning {
  overflow: hidden;
}

/* ------------------------------------------------------------
   Team-cover curtain (original TeamCover: 报名成功过渡)
   - curtain drops from the top: height 0 -> 100%, 0.5s ease-in-out
   - cover image slowly zooms (scale 1.25) and blurs over 2s
   - scrim darkens layer/20 -> layer/80 over 1s
   - bottom-left: flag + scope + coming / divider / huge user name
   - top-right: logo | platform name + brief
   ------------------------------------------------------------ */
.r2s-cover-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  overflow: hidden;
  z-index: 100;
  transition: height 0.5s ease-in-out;
}

.r2s-cover-transition.is-active {
  height: 100%;
}

.r2s-cover-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--r2s-layer);
}

.r2s-cover-img {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
  transition: transform 2s ease-out, filter 2s ease-out;
}

.r2s-cover-transition.is-active .r2s-cover-img {
  transform: scale(1.25);
  filter: blur(8px);
}

.r2s-cover-scrim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  background: color-mix(in srgb, var(--r2s-layer) 20%, transparent);
  transition: background-color 1s;
}

.r2s-cover-transition.is-active .r2s-cover-scrim {
  background: color-mix(in srgb, var(--r2s-layer) 80%, transparent);
}

.r2s-cover-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 24px;
  padding: clamp(28px, 6vw, 96px);
}

.r2s-cover-team {
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: clamp(30px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  opacity: 0;
  transform: translateX(160px);
  transition: opacity 2s ease-out, transform 2s ease-out;
}

.r2s-cover-transition.is-active .r2s-cover-team {
  opacity: 1;
  transform: translateX(0);
}

.r2s-cover-team .flag {
  flex-shrink: 0;
  color: var(--r2s-error);
  font-size: 0.95em;
}

.r2s-cover-team .scope {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.r2s-cover-team .coming {
  flex-shrink: 0;
  color: var(--r2s-warning);
}

.r2s-cover-divider {
  width: 100%;
  height: 1px;
  background: var(--ink-10);
}

.r2s-cover-name {
  margin: 0;
  text-align: right;
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  opacity: 0;
  transform: translateX(-160px);
  transition: opacity 2s ease-out, transform 2s ease-out;
}

.r2s-cover-transition.is-active .r2s-cover-name {
  opacity: 1;
  transform: translateX(0);
}

.r2s-cover-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 16px;
  padding: clamp(28px, 6vw, 96px);
}

.r2s-cover-game {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  width: 100%;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.r2s-cover-transition.is-active .r2s-cover-game {
  opacity: 1;
  transform: translateX(0);
}

.r2s-cover-game h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 700;
}

.r2s-cover-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  font-size: 46px;
  font-weight: 700;
  color: var(--r2s-primary);
}

.r2s-cover-vline {
  width: 2px;
  height: 48px;
  flex-shrink: 0;
  background: var(--ink-10);
}

.r2s-cover-brief {
  margin: 0;
  text-align: center;
  align-self: flex-end;
  max-width: 420px;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.r2s-cover-transition.is-active .r2s-cover-brief {
  opacity: 0.6;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .r2s-cover-scrim {
    flex-direction: column-reverse;
  }

  .r2s-cover-right {
    justify-content: flex-start;
    align-items: center;
  }

  .r2s-cover-game {
    justify-content: center;
  }

  .r2s-cover-brief {
    align-self: center;
  }

  .r2s-cover-logo {
    width: 44px;
    height: 44px;
    font-size: 32px;
  }
}

/* ------------------------------------------------------------
   14. Student workspace
   ------------------------------------------------------------ */
.student-shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--r2s-left) minmax(0, 1fr);
  align-items: start;
}

.student-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 12px;
  border-right: 1px solid var(--ink-10);
  overflow-y: auto;
  animation: r2s-dive-left 0.3s var(--r2s-ease) both;
}

.student-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
}

.student-side-head h2 {
  font-size: 18px;
  font-weight: 700;
}

.student-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-filter-row {
  display: flex;
  gap: 4px;
}

.student-tree {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.student-tree-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-tree-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-60);
  text-transform: lowercase;
}

.student-task-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
  background: transparent;
  color: var(--r2s-ink);
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.student-task-link:hover {
  background: var(--ink-10);
}

.student-task-link.is-active {
  background: var(--ink-10);
  border-color: var(--ink-15);
}

.student-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ink-40);
}

.student-status-dot.todo { background: var(--r2s-warning); }
.student-status-dot.done { background: var(--r2s-success); }
.student-status-dot.dead { background: var(--r2s-error); }

.student-task-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.student-task-copy strong {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-task-copy span {
  font-size: 11.5px;
  color: var(--ink-60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-task-index {
  font-size: 11.5px;
  color: var(--ink-40);
  flex-shrink: 0;
}

.student-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* open-task tab strip — original h-16 tab bar */
.student-task-tabs {
  position: sticky;
  top: 64px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ink-10);
  background: var(--layer-60);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  overflow-x: auto;
  white-space: nowrap;
}

.student-task-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
  background: transparent;
  color: var(--ink-60);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.student-task-tab:hover {
  background: var(--ink-10);
  color: var(--r2s-ink);
}

.student-task-tab.is-active {
  background: var(--ink-10);
  border-color: var(--ink-15);
  color: var(--r2s-ink);
}

.student-task-tab .r2s-icon {
  color: var(--r2s-primary);
}

.student-stage {
  flex: 1;
  padding: 20px 16px 48px;
}

.student-workbench {
  display: none;
  flex-direction: column;
  gap: 18px;
  width: min(1080px, 100%);
  margin: 0 auto;
}

.student-workbench.is-active {
  display: flex;
  animation: r2s-dive-left 0.3s var(--r2s-ease) both;
}

.student-workbench.dim {
  opacity: 0.75;
}

.student-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.student-task-title {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

.student-task-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-60);
}

.student-task-info a {
  color: var(--r2s-primary);
  text-decoration: none;
}

.student-task-info a:hover {
  text-decoration: underline;
}

.student-task-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.student-countdown-readout {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.student-countdown-readout span {
  font-size: 11.5px;
  color: var(--ink-60);
}

.student-countdown-readout strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

/* sub tabs (提交 / 锤子反馈) */
.student-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--ink-10);
  padding-bottom: 8px;
}

.student-subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
  background: transparent;
  color: var(--ink-60);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.student-subtab:hover {
  background: var(--ink-10);
  color: var(--r2s-ink);
}

.student-subtab.is-active {
  background: var(--ink-10);
  border-color: var(--ink-15);
  color: var(--r2s-ink);
}

.student-subtab strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--r2s-primary);
  color: var(--r2s-primary-content);
  font-size: 11.5px;
}

.student-pane {
  display: none;
}

.student-pane.is-active {
  display: block;
  animation: r2s-dive-up 0.3s var(--r2s-ease) both;
}

.student-section {
  border: 1px solid var(--ink-15);
  border-radius: var(--r2s-radius-xl);
  background: var(--layer-60);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.student-section > * {
  background: var(--ink-05);
}

.student-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-10);
}

.student-section-title h2 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 700;
}

.student-section form,
.student-section .student-hammer-panel {
  padding: 18px;
}

.student-submit-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

/* upload dropzone */
.r2s-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.r2s-upload-item {
  padding: 14px;
  border: 1px solid var(--ink-10);
  border-radius: var(--r2s-radius-xl);
  background: var(--ink-04);
}

.drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px;
  border: 1px dashed var(--ink-20);
  border-radius: var(--r2s-radius-xl);
  background: var(--ink-04);
  cursor: pointer;
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
}

.drop:hover,
.drop.hover {
  border-color: var(--r2s-primary);
  background: color-mix(in srgb, var(--r2s-primary) 8%, transparent);
}

.drop .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.drop .icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--r2s-primary);
}

.drop .controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-name {
  font-weight: 700;
  word-break: break-all;
}

/* hammer feedback chat */
.student-hammer-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.student-hammer-feed,
.hammer-chat-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}

.hammer-message {
  display: flex;
  gap: 10px;
  max-width: 86%;
}

.hammer-message.from-student {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.hammer-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--r2s-radius);
  background: var(--r2s-primary);
  color: var(--r2s-primary-content);
  font-weight: 700;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hammer-avatar:hover {
  transform: scale(1.1);
}

.hammer-message.from-admin .hammer-avatar {
  background: var(--ink-15);
  color: var(--r2s-ink);
}

.hammer-bubble {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--ink-10);
  border-radius: var(--r2s-radius-xl);
  background: var(--ink-05);
}

.hammer-message.from-student .hammer-bubble {
  background: color-mix(in srgb, var(--r2s-primary) 14%, transparent);
  border-color: color-mix(in srgb, var(--r2s-primary) 24%, transparent);
}

.hammer-bubble header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.hammer-bubble header strong {
  font-size: 13px;
}

.hammer-bubble header time {
  font-size: 11.5px;
  color: var(--ink-60);
}

.hammer-bubble p {
  margin: 0;
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.hammer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 16px;
  color: var(--ink-60);
  text-align: center;
  border: 1px dashed var(--ink-15);
  border-radius: var(--r2s-radius-xl);
}

.hammer-empty-icon {
  font-size: 28px;
}

.student-hammer-editor,
.hammer-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hammer-editor.compact {
  margin-top: 12px;
}

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

/* ------------------------------------------------------------
   15. Admin workspace
   ------------------------------------------------------------ */
.r2s-shell {
  flex: 1;
  min-height: 0;
}

.admin-focus-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  align-items: start;
}

.admin-ret-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  border-right: 1px solid var(--ink-10);
  overflow-y: auto;
}

.admin-ret-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 12px;
  animation: r2s-dive-left 0.3s var(--r2s-ease) both;
}

.admin-ret-scope {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--ink-15);
  border-radius: var(--r2s-radius-xl);
  background: var(--ink-05);
}

.admin-ret-scope strong {
  font-size: 15px;
}

.admin-ret-scope > span:last-child {
  font-size: 12px;
  color: var(--ink-60);
}

.admin-ret-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-ret-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--r2s-radius);
  color: var(--ink-60);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.admin-ret-nav a:hover {
  background: var(--ink-10);
  color: var(--r2s-ink);
}

.admin-ret-nav a.active {
  background: var(--ink-10);
  border-color: var(--ink-15);
  color: var(--r2s-ink);
}

.admin-ret-nav a .r2s-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--r2s-primary);
}

.admin-ret-nav a span:nth-child(2) {
  flex: 1;
}

.admin-ret-nav a strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink-10);
  font-size: 11.5px;
}

.admin-ret-nav a.active strong {
  background: var(--r2s-primary);
  color: var(--r2s-primary-content);
}

.admin-view {
  display: none;
  padding: 20px 16px 48px;
}

.admin-view.is-active {
  display: block;
  animation: r2s-dive-left 0.3s var(--r2s-ease) both;
}

.admin-focus-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-toolbar .form-control {
  width: 220px;
}

/* collapsible rows (details) */
.admin-row {
  border: 1px solid var(--ink-10);
  border-radius: var(--r2s-radius-xl);
  background: var(--ink-04);
  overflow: hidden;
  transition: border-color 0.2s ease-out;
}

.admin-row:hover {
  border-color: var(--ink-20);
}

.admin-row summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.admin-row summary::-webkit-details-marker {
  display: none;
}

.admin-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-row-main h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.admin-row-status {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-countline {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.admin-countline strong {
  font-size: 22px;
  color: var(--r2s-primary);
}

.admin-countline span {
  font-size: 12.5px;
  color: var(--ink-60);
}

/* expandable detail: grid-rows trick for smooth open/close */
.admin-row.has-detail-motion .r2s-detail-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--r2s-dur) var(--r2s-ease);
}

.admin-row.has-detail-motion.is-detail-open .r2s-detail-body {
  grid-template-rows: 1fr;
}

.r2s-detail-inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 16px;
}

.admin-row.is-detail-open .r2s-detail-inner {
  padding: 4px 16px 16px;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .admin-detail-grid {
    grid-template-columns: 1fr;
  }
}

.admin-detail-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-detail-title h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.admin-detail-title span {
  font-size: 12.5px;
  color: var(--ink-60);
}

.submission-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.submission-compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--ink-10);
  border-radius: var(--r2s-radius);
  background: var(--ink-04);
}

.submission-compact-item.is-new {
  border-color: color-mix(in srgb, var(--r2s-success) 40%, transparent);
  background: color-mix(in srgb, var(--r2s-success) 10%, transparent);
}

.submission-compact-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.submission-compact-meta strong {
  font-size: 13.5px;
}

.submission-compact-meta span {
  font-size: 11.5px;
  color: var(--ink-60);
}

.submission-compact-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sub-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.sub-list li {
  padding: 7px 12px;
  border: 1px solid var(--ink-08);
  border-radius: var(--r2s-radius);
  background: var(--ink-04);
}

.sub-student {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.sub-student strong {
  font-size: 13.5px;
}

.sub-student span {
  font-size: 11.5px;
  color: var(--ink-60);
}

/* assignment form area */
.admin-form-grid {
  align-items: start;
}

.admin-section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.admin-submission-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.submission-item-row {
  padding: 12px;
  border: 1px solid var(--ink-10);
  border-radius: var(--r2s-radius-xl);
  background: var(--ink-04);
}

/* import widget */
.admin-import-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-file-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--r2s-radius);
  background: var(--ink-10);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

.admin-file-picker:hover {
  background: var(--ink-20);
}

.admin-file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.admin-file-name {
  max-width: 200px;
  font-size: 12.5px;
  color: var(--ink-60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* class member list */
.admin-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.admin-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--ink-08);
  border-radius: var(--r2s-radius-xl);
  background: var(--ink-04);
}

.admin-member-row.is-manager {
  border-color: color-mix(in srgb, var(--r2s-primary) 30%, transparent);
  background: color-mix(in srgb, var(--r2s-primary) 8%, transparent);
}

.admin-member-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-member-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--r2s-radius);
  background: var(--r2s-primary);
  color: var(--r2s-primary-content);
  font-weight: 700;
}

.admin-member-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-member-text > span:last-child {
  font-size: 11.5px;
  color: var(--ink-60);
}

.admin-member-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--r2s-primary);
  color: var(--r2s-primary-content);
  font-size: 11px;
  font-weight: 700;
}

.admin-member-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-member-actions .r2s-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: var(--r2s-radius-sm);
}

.admin-member-empty {
  padding: 18px;
  color: var(--ink-60);
  text-align: center;
}

/* feedback threads */
.feedback-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.feedback-thread-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-thread-last {
  min-width: 0;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12.5px;
  color: var(--ink-60);
}

.feedback-thread-last span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-thread-last time {
  font-size: 11.5px;
  color: var(--ink-40);
}

/* live update flashes */
.r2s-live-updated {
  animation: r2s-live-flash 1.2s ease-out;
}

@keyframes r2s-live-flash {
  0% { background-color: color-mix(in srgb, var(--r2s-primary) 18%, transparent); }
  100% { background-color: transparent; }
}

/* tables */
.table-shell {
  border: 1px solid var(--ink-10);
  border-radius: var(--r2s-radius-xl);
  overflow-x: auto;
  background: var(--ink-04);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-60);
  border-bottom: 1px solid var(--ink-15);
  white-space: nowrap;
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-08);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background-color 0.2s ease-out;
}

.table tbody tr:hover {
  background: var(--ink-05);
}

/* ------------------------------------------------------------
   16. Account (change password) page
   ------------------------------------------------------------ */
.account-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 12px 48px;
}

.account-stage {
  display: flex;
  width: min(880px, 100%);
  border: 1px solid var(--ink-15);
  border-radius: var(--r2s-radius-xl);
  background: var(--layer-60);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
  animation: r2s-dive-up 0.3s var(--r2s-ease) both;
}

.account-overview {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 24px;
  background: var(--ink-05);
  border-right: 1px solid var(--ink-10);
  text-align: center;
}

.account-logo {
  width: 108px;
  height: 108px;
}

.account-overview h1 {
  font-size: 22px;
  font-weight: 700;
}

.account-overview p {
  font-size: 12.5px;
  color: var(--ink-60);
  max-width: 320px;
}

.account-id-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 300px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ink-10);
  border-radius: var(--r2s-radius-xl);
  background: var(--ink-04);
  text-align: left;
}

.account-id-card > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.account-id-card span {
  font-size: 12px;
  color: var(--ink-60);
}

.account-id-card strong {
  font-size: 13.5px;
}

.account-form-panel {
  flex: 1.15;
  min-width: 0;
  padding: 28px 24px;
  background: var(--ink-05);
}

.account-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.account-form-head h2 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 700;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

@media (max-width: 760px) {
  .account-stage {
    flex-direction: column;
  }
  .account-overview {
    border-right: none;
    border-bottom: 1px solid var(--ink-10);
  }
}

/* ------------------------------------------------------------
   17. Toasts — original toast slide + card tint
   ------------------------------------------------------------ */
.toast-stack {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast-neo {
  position: relative;
  border: 1px solid var(--ink-15);
  border-radius: var(--r2s-radius-xl);
  background: var(--r2s-panel-solid);
  overflow: hidden;
  animation: r2s-dive-right 0.3s var(--r2s-ease) both;
}

.toast-body-neo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--ink-05);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-neo.success .toast-icon { color: var(--r2s-success); }
.toast-neo.danger .toast-icon { color: var(--r2s-error); }
.toast-neo.warning .toast-icon { color: var(--r2s-warning); }
.toast-neo.info .toast-icon { color: var(--r2s-info); }

.toast-neo.success .toast-body-neo { background: color-mix(in srgb, var(--r2s-success) 14%, transparent); }
.toast-neo.danger .toast-body-neo { background: color-mix(in srgb, var(--r2s-error) 14%, transparent); }
.toast-neo.warning .toast-body-neo { background: color-mix(in srgb, var(--r2s-warning) 14%, transparent); }
.toast-neo.info .toast-body-neo { background: color-mix(in srgb, var(--r2s-info) 14%, transparent); }

.toast-text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  word-break: break-word;
}

.toast-close {
  min-height: 24px;
  width: 24px;
  padding: 0;
  border-radius: var(--r2s-radius-sm);
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-size: 15px;
  line-height: 1;
}

.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--ink-40);
  transform-origin: left;
}

.toast-neo.success .toast-progress { background: var(--r2s-success); }
.toast-neo.danger .toast-progress { background: var(--r2s-error); }
.toast-neo.warning .toast-progress { background: var(--r2s-warning); }
.toast-neo.info .toast-progress { background: var(--r2s-info); }

/* ------------------------------------------------------------
   18. Darkmode switch (original darkmode-button.css, no tailwind)
   ------------------------------------------------------------ */
:root {
  --darkmode-ease: cubic-bezier(0.4, -0.3, 0.6, 1.3);
  --darkmode-clr-background-day: #3c9dff;
  --darkmode-clr-background-night: #0d1231;
  --darkmode-clr-sun: #fce570;
  --darkmode-clr-sun-lgt: #ffffe3;
  --darkmode-clr-moon: hsl(212, 13%, 75%);
  --darkmode-button-width: 2.5em;
}

.darkmode-wrapper {
  position: relative;
  height: 48px;
  width: 100%;
  max-width: 220px;
  border: none;
  border-radius: var(--r2s-radius);
  overflow: hidden;
  isolation: isolate;
  background-color: var(--darkmode-clr-background-day);
  font-size: 1em;
  cursor: pointer;
  transition: all 0.75s var(--darkmode-ease);
}

.darkmode-wrapper:focus-visible {
  outline: 2px solid var(--ink-60);
  outline-offset: 2px;
}

/* 迷你版：放在页头角落的小开关，内部元素均为 em 单位，靠 font-size 整体缩放 */
.darkmode-wrapper.darkmode-mini {
  font-size: 9px;
  height: 26px;
  width: 52px;
  max-width: none;
  flex-shrink: 0;
  border-radius: 999px;
}

.darkmode-wrapper .darkmode-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: 100%;
  transform: translateX(33%) translateY(-100%);
  transition: transform 0.7s;
}

.darkmode-wrapper .darkmode-button {
  position: absolute;
  top: 50%;
  left: 0.25em;
  transform: translateY(-50%);
  width: var(--darkmode-button-width);
  height: var(--darkmode-button-width);
  border-radius: 50%;
  background: radial-gradient(var(--darkmode-clr-sun-lgt), transparent);
  background-color: var(--darkmode-clr-sun);
  box-shadow:
    0px 0px 0em 1em rgb(255 255 255 / 0.2),
    0px 0px 0em 2em rgb(255 255 255 / 0.2),
    0px 0px 0.5em 3em rgb(255 255 255 / 0.2),
    0 0 0.5em 0 #fff;
  transition: all 0.75s var(--darkmode-ease);
}

.darkmode-wrapper .darkmode-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 60%;
  width: 25%;
  height: 25%;
  background-color: #c5c5c500;
  border-radius: 50%;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow:
    -0.95em -0.75em 0 0.1em #d5d5d500,
    0.1em -1em 0 -0.1em #d5d5d500;
}

.darkmode-wrapper::before {
  content: "";
  position: absolute;
  width: 2.5em;
  aspect-ratio: 1 / 1;
  background-color: #fff;
  border-radius: 50%;
  right: -0.25em;
  bottom: 0.4em;
  box-shadow:
    -1em 1em 0 -0.25em #fff,
    -2em 1.25em 0 -0.5em #fff,
    -3em 1.5em 0 -0.25em #fff,
    -4em 1.5em 0 -0.6em #fff,
    -5em 1.75em 0 -0.5em #fff;
  opacity: 0.5;
  transition: all 0.75s ease;
}

.darkmode-wrapper::after {
  content: "";
  position: absolute;
  width: var(--darkmode-button-width);
  height: var(--darkmode-button-width);
  background-color: #fff;
  border-radius: 50%;
  right: -1em;
  bottom: 0em;
  box-shadow:
    -1em 1em 0 -0.25em #fff,
    -2em 1.25em 0 -0.5em #fff,
    -3em 1.5em 0 -0.25em #fff,
    -4em 1.5em 0 -0.6em #fff,
    -5em 1.75em 0 -0.5em #fff;
  transition: all 0.75s ease;
}

.darkmode-wrapper[data-color-scheme="dark"] {
  background-color: var(--darkmode-clr-background-night);
}

.darkmode-wrapper[data-color-scheme="dark"] .darkmode-stars {
  transform: translateX(0) translateY(0);
}

.darkmode-wrapper[data-color-scheme="dark"] .darkmode-button {
  background: radial-gradient(#eee, transparent);
  background-color: var(--darkmode-clr-moon);
  left: calc(100% - 0.25em - var(--darkmode-button-width));
  box-shadow:
    0px 0px 0em 1em rgb(255 255 255 / 0.1),
    0px 0px 0em 2em rgb(255 255 255 / 0.1),
    0px 0px 0.5em 3em rgb(255 255 255 / 0.1),
    0 0 0.5em 0 #fff;
}

.darkmode-wrapper[data-color-scheme="dark"] .darkmode-button::after {
  transition-delay: 0.5s;
  background-color: #c5c5c5ff;
  box-shadow:
    -0.95em -0.75em 0 0.1em #d5d5d5ff,
    0.1em -1em 0 -0.1em #d5d5d5ff;
}

.darkmode-wrapper[data-color-scheme="dark"]::before {
  right: -5em;
  bottom: -1em;
  scale: 2;
}

.darkmode-wrapper[data-color-scheme="dark"]::after {
  right: -5em;
  bottom: -2em;
  scale: 3;
}

/* ------------------------------------------------------------
   19. Mobile drawer + misc
   ------------------------------------------------------------ */
.r2s-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 18px;
  z-index: 90;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--ink-15);
  background: var(--r2s-panel-solid);
}

.r2s-mobile-toggle.left {
  left: 14px;
}

.r2s-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, #000 45%, transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.r2s-backdrop.is-open {
  display: block;
  opacity: 1;
}

@media (max-width: 980px) {
  .student-shell,
  .admin-focus-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 85;
    height: 100vh;
    width: min(320px, 86vw);
    background: var(--r2s-panel-solid);
    border-right: 1px solid var(--ink-15);
    transform: translateX(-100%);
    transition: transform 0.3s var(--r2s-ease);
    /* 桌面端入场动画的 fill 状态会覆盖 transform，导致抽屉常开且拦截点击 */
    animation: none;
  }

  .student-sidebar.is-open {
    transform: translateX(0);
  }

  .admin-ret-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--ink-10);
  }

  .admin-ret-sidebar-inner {
    padding-bottom: 8px;
  }

  .admin-ret-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .r2s-mobile-toggle {
    display: inline-flex;
  }

  .feedback-thread-last {
    align-items: flex-start;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .r2s-brand-title {
    max-width: 46vw;
  }

  /* 小屏隐藏英文副标题，给主标题让出宽度 */
  .r2s-brand-sub {
    display: none;
  }

  /* 小屏隐藏装饰性徽标（仅登录页头部使用），避免挤压站点标题 */
  .r2s-actions > .r2s-pill {
    display: none;
  }

  .r2s-actions .r2s-button {
    padding: 0 10px;
    font-size: 13px;
  }

  .student-stage,
  .admin-view {
    padding: 14px 10px 40px;
  }

  /* 触屏下加大公告翻页按钮的点击区域 */
  .notice-page-button {
    width: 34px;
    height: 34px;
  }

  /* 表单控件不小于 16px，避免 iOS 聚焦时自动放大页面 */
  input, select, textarea {
    font-size: 16px;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
