:root {
  color-scheme: light;
  --ink: #162639;
  --muted: #526477;
  --paper: #f3f6f9;
  --surface: #fff;
  --line: #dce4ec;
  --line-strong: #b7c7d7;
  --blue: #174ab3;
  --blue-dark: #113886;
  --blue-light: #eef4ff;
  --navy: #142235;
  --warm: #ffad74;
  --danger: #a22630;
  --success: #156747;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
a { color: var(--blue); text-underline-offset: 4px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #3967e4; outline-offset: 3px; }
.skip { position: fixed; z-index: 1; inset: 8px auto auto 8px; transform: translateY(-180%); background: white; padding: 10px; }
.skip:focus { transform: none; }

.topbar { background: var(--navy); color: white; }
.header-inner, .shell { width: min(1160px, calc(100% - 56px)); margin-inline: auto; }
.header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: white; font-weight: 750; text-decoration: none; }
.brand-ball { position: relative; display: grid; width: 25px; height: 25px; border-radius: 50%; overflow: hidden; background: var(--warm); place-items: center; transform: rotate(-33deg); }
.brand-ball::before { content: ""; width: 11px; height: 33px; border-inline: 1.5px solid var(--navy); border-radius: 50%; }
.brand-ball::after { content: ""; position: absolute; width: 100%; border-top: 1.5px solid var(--navy); }
.account { display: flex; align-items: center; gap: 13px; font-size: .88rem; }
.account span { overflow: hidden; max-width: min(26vw, 210px); text-overflow: ellipsis; white-space: nowrap; color: #e1e9f4; }
.account .text-button { color: white; }

.shell { padding-block: 40px 24px; }
.page-heading, .section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-heading { align-items: flex-end; margin-bottom: 25px; }
.context { margin-bottom: 5px; color: var(--blue); font-size: .84rem; font-weight: 750; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -.035em; font-weight: 780; }
h2 { font-size: 1.25rem; line-height: 1.4; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 760; }
h4 { font-size: 1.1rem; font-weight: 770; }
.subtle { color: var(--muted); font-size: .93rem; }
.page-heading h1 + p, h2 + p { margin-top: 6px; }
.quiet-link { flex-shrink: 0; font-weight: 680; font-size: .9rem; }
.quiet-link span { margin-inline-start: 4px; }
.columns { display: grid; grid-template-columns: 1.14fr 1fr; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; min-width: 0; }
.result-card, .history-card { margin-top: 18px; scroll-margin-block: 18px; }
label:not(.file-box, .checkline) { display: block; margin: 16px 0 6px; font-size: .91rem; font-weight: 680; }
input:not([type="checkbox"], [type="file"]), select {
  display: block; width: 100%; height: 46px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 12px; color: var(--ink); background: white;
}
select { margin-bottom: 14px; }
.primary, .secondary, .text-button { min-height: 44px; border-radius: 8px; font-weight: 720; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; text-decoration: none; }
.primary { border: 1px solid var(--blue); background: var(--blue); color: white; }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { border: 1px solid var(--line-strong); background: white; color: var(--blue); }
.secondary:hover { border-color: var(--blue); background: var(--blue-light); }
.text-button { border: 0; padding: 0 8px; color: var(--blue); background: transparent; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }

.video-frame { display: grid; place-items: center; overflow: hidden; background: var(--navy); color: white; border-radius: 8px; }
.video-frame video { display: block; width: 100%; max-height: min(52vh, 470px); aspect-ratio: 16 / 9; object-fit: contain; }
.demo-frame { min-height: 128px; }
.demo-frame video { max-height: 230px; }
.guide { margin-top: 14px; padding: 14px 15px; background: var(--blue-light); border-radius: 8px; }
.guide h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.guide h3 span { color: var(--blue-dark); font-size: .8rem; font-weight: 700; }
.guide p { font-size: .89rem; margin-top: 5px; color: var(--ink); }
.notice { margin-top: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted); font-size: .88rem; }
.notice strong { display: block; color: var(--ink); margin-bottom: 3px; }

#upload-form { margin-top: 20px; }
.file-box { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 155px; border: 1px dashed #96acd0; border-radius: 10px; background: #f8faff; padding: 12px; cursor: pointer; text-align: center; }
.file-box:hover { border-color: var(--blue); background: var(--blue-light); }
#upload-form:has(#clip:focus-visible) .file-box { outline: 3px solid #3967e4; outline-offset: 3px; }
#clip { position: absolute; block-size: 1px; inline-size: 1px; opacity: 0; }
.file-arrow { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--blue); background: #e5edff; font-size: 1.25rem; }
.file-title { font-weight: 730; }
.filename { overflow-wrap: anywhere; margin: 8px 0 0; color: var(--blue-dark); font-size: .86rem; }
.checkline { display: flex; align-items: center; min-height: 44px; gap: 9px; margin: 9px 0; font-size: .92rem; cursor: pointer; }
.checkline input { flex: 0 0 17px; width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
#submit, .login-form .primary { width: 100%; }
progress { width: 100%; height: 12px; margin-bottom: 12px; accent-color: var(--blue); }
.error { color: var(--danger); margin: 8px 0 12px; font-size: .91rem; }

.result-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; }
.result-video h3 { margin-bottom: 9px; }
.result-footer { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 5px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.danger { color: var(--danger); }
.report { padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.report .section-header { align-items: center; gap: 8px; }
.report .text-button { font-size: .83rem; }
.report-context { color: var(--muted); font-size: .86rem; margin: 2px 0 12px; }
.report-coverage { font-size: .86rem; color: var(--blue-dark); font-weight: 650; }
.practice-focus { margin-top: 9px; padding: 13px 15px; border-left: 3px solid var(--blue); background: var(--blue-light); }
.practice-focus p:last-child { margin-top: 4px; }
.focus-label { margin-bottom: 2px; color: var(--blue-dark); font-size: .82rem; font-weight: 740; }
.report dt { margin-top: 12px; font-weight: 710; font-size: .9rem; }
.report dd { color: var(--muted); margin-top: 2px; font-size: .92rem; }
.report-note { margin-top: 15px; padding-top: 9px; border-top: 1px solid var(--line); font-size: .81rem; }
.status { flex: 0 0 auto; color: var(--muted); background: var(--paper); border-radius: 20px; padding: 4px 9px; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.status[data-status="done"] { background: #e2f4ea; color: var(--success); }
.status[data-status="running"], .status[data-status="queued"] { background: var(--blue-light); color: var(--blue-dark); }
.status[data-status="failed"] { background: #fcebed; color: var(--danger); }

.history { list-style: none; padding: 0; margin: 8px 0 0; }
.history button { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; min-height: 52px; border: 0; border-top: 1px solid var(--line); background: white; color: var(--ink); padding: 8px 10px; text-align: left; }
.history button:hover, .history button[aria-pressed="true"] { background: var(--blue-light); }
.history button strong { font-size: .95rem; }
.history .subtle { font-size: .82rem; white-space: nowrap; }
footer { margin-top: 18px; color: var(--muted); font-size: .83rem; }

.login-view { display: grid; grid-template-columns: 1.1fr 1fr; width: min(960px, 100%); margin: 32px auto; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: white; }
.login-intro, .login-form { min-width: 0; padding: clamp(28px, 5vw, 54px); }
.login-intro { display: grid; align-content: center; position: relative; isolation: isolate; overflow: hidden; background: var(--navy); color: white; min-height: 335px; }
.login-intro p { max-width: 26ch; margin-top: 16px; color: #dce7f5; }
.login-intro h1 { font-size: clamp(1.9rem, 4.1vw, 3rem); }
.court-lines { position: absolute; z-index: -1; inset: 14% -37% 14% 43%; border: 1px solid #92add952; border-radius: 50%; }
.court-lines::after { content: ""; position: absolute; inset: 25%; border: 1px solid #92add952; border-radius: 50%; }
.login-form .primary { margin-top: 17px; }

@media (max-width: 720px) {
  .header-inner, .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 56px; }
  .shell { padding-top: 24px; }
  .columns, .result-body, .login-view { grid-template-columns: 1fr; gap: 12px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 18px; }
  .card { padding: 16px; border-radius: 11px; }
  .login-view { gap: 0; margin: 7px auto; }
  .login-intro { min-height: 190px; }
  .login-intro, .login-form { padding: 22px; }
  .login-intro h1 br { display: none; }
}
@media (max-width: 400px) {
  .history button { grid-template-columns: minmax(0, 1fr) auto; row-gap: 1px; }
  .history button .subtle { grid-column: 1; grid-row: 2; }
  .history button .status { grid-column: 2; grid-row: 1 / span 2; }
}
@media print {
  body { background: white; }
  .shell { padding: 0; width: auto; }
  .topbar, .skip, .page-heading, .columns, .history-card, footer,
  .result-video, .result-footer, .result-card > .section-header, #result-message, #print { display: none !important; }
  .result-card, .report { border: 0; padding: 0; margin: 0; }
  .result-body { display: block; margin: 0; }
  .practice-focus { border-left: 2px solid #222; background: white; }
}
