:root {
  color-scheme: light;
  --canvas: #f5f3ed;
  --paper: #fffdf8;
  --ink: #182a3e;
  --navy: #162a42;
  --blue: #3459bf;
  --muted: #566678;
  --line: #dfdfd7;
  --focus: #5578ed;
  font-family: "Instrument Sans", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
  line-height: 1.55;
  font-synthesis: none;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.4vw, 3.7rem); line-height: 1.15; letter-spacing: -.06em; font-weight: 750; overflow-wrap: anywhere; }
h2 { font-size: 1.06rem; line-height: 1.4; }
small, .file-meta span { color: var(--muted); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.brand { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; width: fit-content; }
.mark { position: relative; width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid #8ba6ff; background: #93aaff; border-radius: 6px; }
.mark::before, .mark::after { content: ""; position: absolute; left: 8px; width: 12px; height: 9px; border: 1.5px solid var(--navy); border-radius: 2px; transform: skewY(-15deg); }
.mark::before { top: 7px; }
.mark::after { top: 12px; border-top-color: transparent; }

.app-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100svh; }
.sidebar { background: var(--navy); color: #eef3ff; display: flex; flex-direction: column; min-width: 0; padding: 30px 18px 20px; }
.sidebar .brand { margin: 0 10px 44px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link { display: flex; gap: 11px; align-items: center; padding: 12px; color: #cbd8e8; border-radius: 6px; font-size: .94rem; }
.nav-link:hover, .nav-link[aria-current] { background: #253e5b; color: #fff; }
.nav-link[aria-current] { box-shadow: inset 3px 0 #9eb1ff; }
.nav-icon { display: inline-block; position: relative; width: 15px; height: 13px; flex: 0 0 15px; }
.folder-icon { border: 1.4px solid currentColor; border-radius: 2px; }
.folder-icon::before { content: ""; position: absolute; width: 7px; height: 3px; border: 1.4px solid currentColor; border-bottom: 0; left: 0; top: -4px; border-radius: 2px 2px 0 0; }
.tray-icon { border: 1.4px solid currentColor; border-radius: 2px; }
.tray-icon::before { content: ""; position: absolute; width: 7px; border-bottom: 1.4px solid currentColor; top: 4px; left: 3px; }
.user-icon::before, .user-icon::after { content: ""; position: absolute; border: 1.4px solid currentColor; }
.user-icon::before { width: 6px; height: 6px; border-radius: 50%; left: 4px; top: -1px; }
.user-icon::after { width: 13px; height: 6px; border-radius: 5px 5px 1px 1px; left: 1px; bottom: 0; }
.sidebar-account { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 14px 6px 0; border-top: 1px solid #40536b; min-width: 0; }
.sidebar-account > div { min-width: 0; overflow: hidden; }
.sidebar-account strong, .sidebar-account a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: .82rem; }
.sidebar-account a, .logout { color: #cbd8e8; font-size: .74rem; }
.sidebar-account a:hover, .logout:hover { text-decoration: underline; }
.sidebar-account form { margin-left: auto; }
.logout { border: 0; background: transparent; padding: 5px; }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; display: inline-grid; place-items: center; background: #2e4a6c; color: #e7edff; border-radius: 50%; font-size: .8rem; font-weight: 650; }

.main { width: 100%; max-width: 1440px; min-width: 0; padding: clamp(24px, 5vw, 74px); }
.page-heading { margin-bottom: 33px; max-width: 100%; }
.page-heading p, .login-panel p { margin-top: 12px; color: var(--muted); max-width: 65ch; overflow-wrap: anywhere; }
.page-heading.with-action { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.preserve-lines { white-space: pre-wrap; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--blue); font-size: .84rem; font-weight: 650; }
.back-link::before { content: ""; width: 7px; height: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.workspace { display: grid; grid-template-columns: minmax(255px, .82fr) minmax(330px, 1.2fr); gap: 22px; align-items: start; }
.workspace.reverse { grid-template-columns: minmax(330px, 1.2fr) minmax(255px, .82fr); }
.wide-section { max-width: 940px; }
.narrow-section { max-width: 430px; }
.upload-section, .file-section, .form-panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; }
.upload-section, .form-panel { padding: 21px; }
.upload-section { border-top: 3px solid var(--blue); }
.upload-form, .stack { display: grid; gap: 14px; }
.upload-form, .form-panel > h2 + .stack { margin-top: 16px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 190px; padding: 20px 12px; border: 1px dashed #90a1c7; border-radius: 7px; background: #f0f2fd; text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.dragging { background: #e6ebfe; border-color: var(--blue); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone strong { font-size: .95rem; overflow-wrap: anywhere; max-width: 100%; }
.dropzone span, .upload-status { font-size: .82rem; color: var(--muted); }
.drop-symbol { width: 52px; height: 48px; position: relative; margin-bottom: 5px; }
.drop-symbol::before, .drop-symbol::after { content: ""; position: absolute; width: 29px; height: 36px; border-radius: 4px; }
.drop-symbol::before { background: #a6b7f5; transform: rotate(-14deg); left: 8px; top: 7px; }
.drop-symbol::after { background: #fff; border: 1px solid #96a8df; transform: rotate(8deg); left: 17px; top: 2px; }
.drop-symbol i { position: absolute; z-index: 1; top: 12px; left: 29px; width: 2px; height: 15px; background: var(--blue); border-radius: 1px; }
.drop-symbol i::after { content: ""; position: absolute; top: 0; left: -3px; width: 8px; height: 8px; transform: rotate(45deg); border-top: 2px solid var(--blue); border-left: 2px solid var(--blue); }
progress { width: 100%; accent-color: var(--blue); }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; min-height: 41px; border-radius: 6px; font-weight: 650; font-size: .88rem; white-space: nowrap; text-align: center; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: #2949a5; }
.button:disabled { opacity: .6; cursor: wait; }
.quiet { border-color: #d8deec; background: #fafbff; color: #274a9f; min-height: 32px; padding: 5px 10px; }
.quiet:hover { background: #e9edfb; }

.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 19px 20px; border-bottom: 1px solid var(--line); }
.section-heading span { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.file-list { list-style: none; padding: 0; margin: 0; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 13px 19px; border-bottom: 1px solid var(--line); min-width: 0; }
.file-row:last-child { border-bottom: 0; }
.file-icon { position: relative; width: 28px; height: 35px; flex: 0 0 28px; border: 1px solid #b2bfe7; border-radius: 4px; background: #ecf0ff; }
.file-icon::after { content: ""; position: absolute; left: 6px; right: 6px; top: 12px; height: 6px; border-block: 1px solid #7891d2; }
.assignment-icon { background: #e6ede9; border-color: #9db9ac; }
.assignment-icon::after { border-color: #5b8673; }
.file-meta { flex: 1; min-width: 0; display: grid; gap: 3px; }
.file-meta strong, .file-meta span { overflow-wrap: anywhere; }
.file-meta strong { font-size: .92rem; }
.file-meta span { font-size: .78rem; }
.empty { display: grid; justify-items: center; align-content: center; gap: 5px; padding: 34px 16px; min-height: 205px; text-align: center; }
.empty span { color: var(--muted); font-size: .85rem; }
.empty-lines { display: block; width: 30px; height: 18px; margin-bottom: 7px; border: 1px solid #aab5c7; border-top: 0; border-radius: 0 0 4px 4px; transform: skewX(-8deg); }
.student-avatar { background: #e9eeff; color: #3a4d9e; }

.stack label { display: grid; gap: 6px; font-weight: 650; font-size: .86rem; }
.stack input:not([type=hidden]), .stack textarea { width: 100%; border: 1px solid #c9cdd4; border-radius: 6px; color: var(--ink); background: #fff; padding: 9px 10px; font-weight: 400; min-height: 43px; }
.stack textarea { resize: vertical; }
.notice { padding: 11px 14px; background: #e4f0e7; border-radius: 6px; color: #20553f; font-size: .87rem; margin-bottom: 18px; overflow-wrap: anywhere; }
.notice.error, .upload-status.error { color: #942b2b; }
.notice.error { background: #fae9e7; margin-bottom: 0; }
.credential { display: block; margin-top: 8px; user-select: all; }
.error-page { padding: 30px; }
.error-page h1 { font-size: clamp(1.45rem, 4vw, 2.1rem); margin-bottom: 20px; }

.guest { min-height: 100svh; display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(890px, 100%); display: grid; grid-template-columns: 1fr 1fr; min-height: 500px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 18px 65px #182a3e14; }
.login-art { min-width: 0; display: grid; grid-template-rows: auto 1fr; padding: 26px; background: var(--navy); color: #f3f6ff; overflow: hidden; position: relative; }
.login-art::before { content: ""; position: absolute; inset: 1px; pointer-events: none; background-image: linear-gradient(#b0c4ff12 1px, transparent 1px), linear-gradient(90deg, #b0c4ff12 1px, transparent 1px); background-size: 26px 26px; }
.login-art .brand { z-index: 1; }
.paper-scene { position: relative; align-self: center; justify-self: center; width: 235px; height: 242px; }
.paper { position: absolute; width: 122px; height: 151px; border-radius: 8px; box-shadow: 0 9px 20px #101b354d; }
.paper-back { top: 19px; left: 92px; background: #7b96ef; transform: rotate(21deg); }
.paper-middle { top: 17px; left: 37px; background: #bdc9fa; transform: rotate(-18deg); }
.paper-front { top: 30px; left: 58px; width: 131px; height: 164px; background: #fffdf5; transform: rotate(-6deg); padding: 36px 22px; }
.paper-front i { display: block; width: 100%; height: 2px; margin-bottom: 12px; background: #b5c2de; }
.paper-front i:first-child { height: 6px; width: 60%; margin-bottom: 17px; background: #5272c2; }
.paper-front i:last-child { width: 71%; }
.paper-slot { position: absolute; top: 161px; left: 12px; width: 211px; height: 54px; background: #b6c6fa; border-radius: 6px; border-top: 13px solid #5773c2; box-shadow: 0 11px 20px #101b357f; }
.paper-slot::after { content: ""; position: absolute; width: 30px; margin-left: -15px; left: 50%; border-bottom: 2px solid #5b75bc; top: 19px; }
.login-panel { display: grid; align-content: center; padding: clamp(25px, 6vw, 62px); }
.login-panel h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.login-panel .stack { gap: 16px; }
.login-panel .stack > div { margin-bottom: 7px; }
.login-panel .primary { margin-top: 4px; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .main { padding-inline: 32px; }
}
@media (max-width: 890px) {
  .workspace, .workspace.reverse { grid-template-columns: minmax(0, 1fr); }
  .workspace.reverse .form-panel { grid-row: 1; }
}
@media (max-width: 660px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100svh; }
  .sidebar { padding: 14px 14px 9px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .sidebar .brand { margin: 0; }
  .sidebar nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; }
  .nav-link { padding: 8px 9px; font-size: .82rem; }
  .sidebar-account { margin: 0; border: 0; padding: 0; }
  .sidebar-account > .avatar { display: none; }
  .sidebar-account strong { max-width: 80px; }
  .main { align-self: start; padding: 27px 15px; }
  .page-heading { margin-bottom: 23px; }
  .page-heading.with-action { align-items: flex-start; flex-direction: column; }
  .guest { padding: 14px; }
  .login-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .login-art { padding: 17px; }
  .paper-scene { display: none; }
  .login-panel { padding: 26px 21px 31px; }
  .file-row { padding-inline: 13px; }
}
