:root {
  color-scheme: light;
  --ink: #292434;
  --muted: #645e70;
  --line: #dedbe5;
  --surface: #fff;
  --soft: #f3f0f7;
  --accent: #55407d;
  --accent-deep: #3e2b60;
  --paper: #f6f5f8;
  --danger: #923d35;
  font-family: "DM Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .43; cursor: default; }
:focus-visible { outline: 3px solid #9673ce; outline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }

.masthead { background: #fffeff; border-bottom: 1px solid var(--line); }
.bar, .wrap { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }
.bar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .navigation { display: flex; align-items: center; }
.brand { gap: 10px; font-size: 15px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #493963; }
.brand-mark i { width: 13px; height: 16px; border: 1.5px solid #efe7f9; border-left-width: 4px; border-radius: 2px; transform: rotate(-13deg); }
.navigation { gap: 17px; color: var(--muted); font-size: 13px; }
.navigation a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.wrap { padding-block: 30px 68px; }
#initial { padding: 24px; color: var(--muted); text-align: center; }

.section-head, .signin-rule { position: relative; isolation: isolate; overflow: hidden; color: white; background: linear-gradient(112deg,#302737,#483751 58%,#605070); }
.section-head { min-height: 138px; display: flex; align-items: flex-end; gap: 18px; padding: 23px 32px; border-radius: 15px; }
.section-head::before, .signin-rule::before {
  content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; right: 7%; top: 9%; border-radius: 50%;
  background: radial-gradient(circle, #51415d 0 7%, #cfc3d9 7.5% 8.3%, transparent 8.7% 16%, #d2cadd88 16.6% 17.3%, transparent 18%),
    repeating-radial-gradient(circle, transparent 0 7px, #fff2 8px, transparent 9px 16px),
    conic-gradient(from -25deg, #9385a8, #c6b3cf 15%, #9587aa 25%, #b6b7ca 34%, #8a7d9e 50%, #cfbece 66%, #9585a3 81%, #9385a8);
  opacity: .68; box-shadow: inset 0 0 0 1px #ecdef366;
}
.section-head::after, .signin-rule::after {
  content: ""; position: absolute; z-index: -1; right: 15%; top: 24%; width: 115px; height: 142px; transform: rotate(-16deg); border-radius: 4px;
  background: linear-gradient(90deg,#3c3046 0 8%,#c2b4cf 8.5% 10%,transparent 10%),
    linear-gradient(148deg,transparent 0 48%,#a597b3 48.5% 61%,#82758e 61.5% 67%,#bfb3c7 67.5% 77%,#81718d 77.5%),
    linear-gradient(145deg,#a291ad,#c6b6c6);
  box-shadow: 0 5px 16px #211c3044; opacity: .94;
}
h1, h2, p { margin-block-start: 0; }
h1 { margin: 0; font-size: clamp(34px, 3.5vw, 46px); font-weight: 700; letter-spacing: -.035em; line-height: 1.2; }
.collection-label { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; color: #e2d7e7; font-size: 13px; font-weight: 600; }
.collection-label span { width: 18px; height: 2px; background: #c0a3d3; }
.count { margin: 0 0 3px; font-size: 13px; color: #e0d5e6; font-variant-numeric: tabular-nums; }

.signin-view { width: min(100%,440px); margin: clamp(5px,7vh,84px) auto 0; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 0 34px 34px; box-shadow: 0 12px 36px #3025380c; }
.signin-rule { height: 85px; margin: 0 -34px 28px; }
.signin-rule::before { width: 146px; height: 146px; right: 6%; top: -15%; }
.signin-rule::after { width: 78px; height: 100px; right: 24%; top: 18%; }
.signin-view h1 { font-size: 32px; }
.intro { margin: 9px 0 25px; color: var(--muted); font-size: 14px; line-height: 1.7; }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 650; }
input { color: var(--ink); width: 100%; min-height: 42px; background: white; border: 1px solid #bdb6c6; border-radius: 7px; padding: 9px 12px; }
input::placeholder { color: #797180; }
input:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.primary { min-height: 42px; border: 1px solid var(--accent); border-radius: 7px; padding: 8px 19px; background: var(--accent); color: white; font-size: 14px; font-weight: 650; }
.primary:hover:not(:disabled) { background: var(--accent-deep); }
.signin-view .primary { margin-top: 17px; width: 100%; display: flex; align-items: center; justify-content: space-between; }

.record-toolbar { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; column-gap: 30px; row-gap: 13px; padding-block: 22px 17px; }
.search-form { flex: 1 1 350px; max-width: 560px; margin: 0; }
.search-row { display: flex; gap: 8px; }
.search-field { flex: 1; position: relative; min-width: 0; }
.search-field input { padding-left: 37px; }
.glass { position: absolute; left: 13px; top: 13px; width: 13px; height: 13px; border: 1.6px solid #756b80; border-radius: 50%; pointer-events: none; }
.glass::after { position: absolute; content: ""; width: 6px; height: 1.6px; background: #756b80; top: 9px; left: 8px; transform: rotate(45deg); transform-origin: left; }
.view-switch { display: inline-flex; align-items: stretch; gap: 3px; padding: 3px; border: 1px solid var(--line); background: #ebe8ef; border-radius: 8px; }
.view-switch button { white-space: nowrap; min-height: 32px; padding: 3px 11px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.view-switch button[aria-pressed=true] { background: white; color: var(--accent-deep); border-color: #d7d1df; box-shadow: 0 1px 2px #31253f13; }
.view-switch button:hover { color: var(--accent-deep); }
.view-switch button::before { content: ""; width: 12px; height: 11px; border: 1px solid currentColor; border-radius: 2px; }
#view-table::before { background: linear-gradient(90deg, transparent 33%, currentColor 34% 42%, transparent 43%), linear-gradient(transparent 28%,currentColor 29% 37%,transparent 38% 64%,currentColor 65% 73%,transparent 74%); }
#view-cards::before { background: linear-gradient(90deg, transparent 43%, currentColor 44% 54%, transparent 55%), linear-gradient(transparent 42%,currentColor 43% 54%,transparent 55%); }
.message, .segment-status, .status-feedback, .status-time { color: var(--muted); font-size: 13px; line-height: 1.55; }
.message { margin: 0 0 12px; }
.signin-view .message { margin: 8px 0 0; }
.message:empty, .status-feedback:empty, .segment-status:empty { display: none; }
.message.error, .segment-status.error, .status-feedback.error { color: var(--danger); }

.table-scroll { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-width: 100%; scrollbar-color: #b8aebe transparent; }
.attendance-table { width: 100%; min-width: 770px; border-spacing: 0; border-collapse: separate; color: var(--ink); font-size: 14px; line-height: 1.5; }
.attendance-table th, .attendance-table td { padding: 15px 16px; text-align: left; vertical-align: middle; }
.attendance-table thead th { padding-block: 11px; background: #efecf3; border-bottom: 1px solid var(--line); color: #554d62; font-size: 12px; font-weight: 650; white-space: nowrap; }
.attendance-table tbody tr + tr > * { border-top: 1px solid #ebe8ee; }
.attendance-table tbody tr:hover > * { background: #f8f6fa; }
.student-name { min-width: 85px; max-width: 9em; font-weight: 700; overflow-wrap: anywhere; }
.attendance-table td:nth-child(2) { font: 13px/1.5 Consolas,"SFMono-Regular",monospace; color: #50485c; white-space: nowrap; }
.attendance-table td:nth-child(3) { min-width: 175px; width: 34%; overflow-wrap: anywhere; }
.attendance-table td:nth-child(5) { white-space: nowrap; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.attendance-table td:last-child { white-space: nowrap; }
.view-record, .navigation button, .pager button, .segment-nav button, .retry, .status-action, #close-record { border: 1px solid #d2cbd9; border-radius: 6px; padding: 6px 11px; background: white; font-size: 13px; line-height: 1.5; min-height: 33px; }
.view-record { color: var(--accent-deep); background: #f6f3fa; }
:is(.view-record,.navigation button,.pager button,.segment-nav button,.retry,.status-action,#close-record):hover:not(:disabled) { background: #efebf5; border-color: #aca0b9; }
.submission-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 20px; padding: 3px 9px; color: #2d6151; background: #e6f2e9; font-size: 12px; font-weight: 600; line-height: 1.5; }
.submission-status::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #53806c; }
.submission-status.returned { color: #863c31; background: #fae8df; }
.submission-status.returned::before { background: #b76b50; }

.cards-view { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.record { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: white; }
.record[open] { border-color: #b6a5c5; }
.record summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 18px 20px; }
.record summary::-webkit-details-marker { display: none; }
.record summary:hover { background: #fbf9fc; }
.record summary:focus-visible { outline-offset: -3px; }
.title { margin: 0 0 8px; display: block; font-size: 17px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.meta, .dialog-meta { display: flex; gap: 6px 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; line-height: 1.45; }
.meta > span:first-child { font-size: 15px; color: var(--ink); font-weight: 650; }
.id { font: 13px/1.45 Consolas,"SFMono-Regular",monospace; overflow-wrap: anywhere; }
.meta time, .status-time, .segment-index, .pager { font-variant-numeric: tabular-nums; }
.community-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.community-heading .title { margin: 0; }
.community-cover { flex: none; width: 36px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--soft); }
.community-source { display: inline-block; color: var(--muted); font-size: 12px; }
.game-cell .community-source { margin-inline-start: 7px; padding-inline: 5px; background: var(--soft); border-radius: 4px; white-space: nowrap; }
.excerpt { grid-column: 1 / -1; padding: 8px 10px; border-left: 2px solid #d4c6df; background: #f7f5f9; color: #5c5466; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.record[open] .excerpt, .excerpt:empty { display: none; }
.toggle { align-self: start; padding-top: 2px; color: var(--accent); font-size: 12px; white-space: nowrap; }
.toggle::before { content: "展开评价"; }
.toggle::after { content: "⌄"; padding-left: 4px; }
.record[open] .toggle::before { content: "收起评价"; }
.record[open] .toggle::after { content: "⌃"; }
.full { padding: 16px 20px; border-top: 1px solid var(--line); }
.full h2 { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.full p { margin: 0; line-height: 1.8; font-size: 15px; overflow-wrap: anywhere; white-space: pre-wrap; }
.segment-text { max-height: 50vh; overflow-y: auto; padding-right: 6px; }
.record-actions, .segment-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; }
.record-actions { border-top: 1px solid var(--line); padding: 12px 20px; background: #faf9fb; }
.segment-nav { margin-top: 14px; }
.segment-index { font-size: 13px; color: var(--muted); }
.return-action { color: var(--danger); border-color: #d9b6ad; }
.status-action.return-action:hover:not(:disabled) { color: #843b32; background: #faeee9; border-color: #cb9a89; }

.record-dialog { width: min(580px,calc(100% - 32px)); max-height: calc(100dvh - 44px); padding: 0; overflow-y: auto; border: 1px solid #cfc6da; border-radius: 13px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 80px #291f3638; }
.record-dialog::backdrop { background: #261e32a6; }
.dialog-heading { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: white; }
.dialog-heading h2 { margin: 0; font-size: 20px; }
.dialog-body > .dialog-meta { padding: 18px 20px; }
.dialog-meta > :is(.title,.community-heading) { width: 100%; margin: 0; }
.empty { border: 1px dashed #c6bdcf; background: #fbf9fc; border-radius: 10px; padding: 34px 14px; color: var(--muted); text-align: center; font-size: 14px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 20px; font-size: 13px; color: var(--muted); }

@media (max-width: 820px) {
  .bar, .wrap { width: calc(100% - 40px); }
  .cards-view { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .bar, .wrap { width: calc(100% - 28px); }
  .bar { min-height: 56px; gap: 8px; }
  .brand { gap: 7px; font-size: 13px; }
  .brand-mark { width: 27px; height: 27px; border-radius: 7px; }
  .navigation { gap: 10px; font-size: 12px; }
  .navigation button { padding: 5px 7px; font-size: 12px; }
  .wrap { padding-block: 18px 40px; }
  .section-head { min-height: 116px; padding: 18px; gap: 10px; }
  .section-head::before { width: 115px; height: 115px; right: -21px; top: 19%; }
  .section-head::after { width: 65px; height: 85px; right: 26px; top: 39%; }
  .count { margin-bottom: 2px; font-size: 12px; }
  .record-toolbar { padding-block: 16px 13px; gap: 11px; }
  .search-form { flex-basis: 100%; }
  input { font-size: 16px; }
  .view-switch button, .view-record, .pager button, #close-record, .status-action { min-height: 38px; }
  .attendance-table th, .attendance-table td { padding-inline: 13px; }
  .attendance-table :is(th,td):first-child { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line); }
  .attendance-table .student-name { background: white; }
  .record summary, .full, .record-actions { padding-inline: 15px; }
  .pager { justify-content: center; gap: 10px; }
  .signin-view { padding: 0 22px 24px; margin-top: 4vh; }
  .signin-rule { margin-inline: -22px; }
}
@media (max-width: 370px) {
  .bar { flex-wrap: wrap; padding-block: 7px; row-gap: 3px; }
  .section-head::before, .section-head::after { opacity: .45; }
}
