/* Plain desk: paper page, ink type, one black stage. */

html {
  color-scheme: light;
}

body {
  background: #f4f4f2 !important;
  color: #1c1c1c !important;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif !important;
}

body::before {
  display: none !important;
}

.site-nav {
  height: 56px !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  padding: 0 28px !important;
  border: 0 !important;
  border-bottom: 1px solid #dedede !important;
  border-radius: 0 !important;
  background: #f4f4f2 !important;
  box-shadow: none !important;
  align-items: center !important;
}

.site-logo,
.site-logo span {
  max-width: none !important;
  width: auto !important;
  flex: 0 0 auto !important;
  color: #161616 !important;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.site-links {
  gap: 4px !important;
}

.site-link {
  color: #5e5e5e !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 6px 10px !important;
  font-size: 14px !important;
}

.site-link:hover,
.site-link.active {
  color: #161616 !important;
  background: transparent !important;
  box-shadow: inset 0 -2px 0 #161616;
}

.site-nav-actions {
  gap: 14px !important;
}

.site-user-chip,
.site-logout-button,
.site-auth-link {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #3a3a3a !important;
  font-family: inherit !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

.site-logout-button,
.site-auth-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-kicker {
  display: none !important;
}

.page-shell {
  padding-top: 36px !important;
}

.page-shell:has(.desk-list) {
  width: min(880px, calc(100vw - 48px)) !important;
}

.auth-page-shell {
  width: min(440px, calc(100vw - 32px)) !important;
}

.desk-intro {
  max-width: 720px;
  margin-bottom: 8px;
}

.desk-intro h1,
.page-title,
.panel-title {
  margin: 0 0 8px !important;
  color: #161616 !important;
  font-family: "SimSun", "Songti SC", "Noto Serif SC", serif !important;
  font-size: 34px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}

.desk-intro p,
.page-copy,
.panel-copy,
.status-text,
.deck-category-copy,
.deck-category-meta {
  color: #5f5f5f !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

.desk-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
  border: 0;
}

.desk-intro,
.v3 {
  animation: deskIn 0.42s cubic-bezier(0.16, 0.84, 0.28, 1);
}

.desk-row {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid #1c1c1c !important;
  border-radius: 0 !important;
  background: #fff;
  color: #1c1c1c;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  animation: deskIn 0.46s cubic-bezier(0.16, 0.84, 0.28, 1) both;
  transition: background 0.28s ease, color 0.28s ease, transform 0.28s cubic-bezier(0.16, 0.84, 0.28, 1);
}

.desk-row:nth-child(2) { animation-delay: 0.04s; }
.desk-row:nth-child(3) { animation-delay: 0.08s; }
.desk-row:nth-child(4) { animation-delay: 0.12s; }
.desk-row:nth-child(5) { animation-delay: 0.16s; }
.desk-row:nth-child(6) { animation-delay: 0.2s; }
.desk-row:nth-child(7) { animation-delay: 0.24s; }

.desk-row:hover {
  background: #1c1c1c;
  color: #fff;
  transform: translateY(-4px);
}

.desk-row.is-shuffle {
  background: #1c1c1c;
  color: #fff;
}

.desk-row.is-shuffle:hover {
  background: #fff;
  color: #1c1c1c;
  transform: translateY(-4px);
}

.desk-exam {
  font-family: "SimSun", "Songti SC", serif;
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1;
}

.desk-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.desk-main strong {
  font-weight: 500;
  font-size: 14px;
}

.desk-main em {
  color: #6a6a6a;
  font-style: normal;
  font-size: 13px;
}

.desk-row:hover .desk-main em,
.desk-row.is-shuffle .desk-main em {
  color: rgba(255, 255, 255, 0.7);
}

.desk-row.is-shuffle:hover .desk-main em {
  color: #6a6a6a;
}

.desk-go {
  display: none;
}

.panel,
.auth-panel,
.admin-config-panel,
.admin-section-panel,
.unlock-card,
.input,
textarea,
select {
  background: #fff !important;
  color: #1c1c1c !important;
  border: 1px solid #d5d5d5 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}

.panel,
.auth-panel,
.admin-config-panel,
.admin-section-panel,
.unlock-card {
  padding: 22px !important;
}

.button,
.button-primary,
.button-secondary {
  min-height: 38px;
  border-radius: 2px !important;
  transform: none !important;
  box-shadow: none !important;
}

.button-primary {
  background: #1c1c1c !important;
  border-color: #1c1c1c !important;
  color: #f4f4f2 !important;
}

.button-secondary {
  background: #fff !important;
  border-color: #1c1c1c !important;
  color: #1c1c1c !important;
}

.button:hover,
.deck-card:hover,
.deck-category-card:hover,
.hero-stage:hover {
  transform: none !important;
  box-shadow: none !important;
}

.unlock-overlay {
  background: rgba(22, 22, 22, 0.46) !important;
  backdrop-filter: none !important;
}

.v3-hdr {
  margin-bottom: 12px !important;
}

.v3-lbl {
  color: #1c1c1c !important;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.v3-cnt {
  color: #666 !important;
  background: transparent !important;
  border: 0 !important;
  letter-spacing: 0 !important;
  font-family: inherit !important;
}

.v3-filter-btn {
  color: #1c1c1c !important;
  background: #fff !important;
  border: 1px solid #1c1c1c !important;
  border-radius: 2px !important;
  letter-spacing: 0 !important;
}

.v3-stage {
  background: #111 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.v3-stage .v3-word,
#v3w {
  color: #fff !important;
}

.v3-stage .v3-pos,
.v3-stage .v3-ph,
.v3-stage .v3-hint,
.v3-stage .v3-hint-txt,
.v3-stage .v3-hico,
.v3-stage .v3-df,
.v3-stage .v3-ex,
.v3-stage .v3-crowd,
.v3-stage .quiz-hud-text,
.v3-stage .v3-phase {
  color: rgba(255, 255, 255, 0.82) !important;
}

.v3-dot.on {
  background: #1c1c1c !important;
}

.v3-live,
.v3-live.on {
  color: rgba(255, 255, 255, 0.8) !important;
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: none !important;
}

.v3-live span,
.v3-live.on span {
  background: #3ddc55 !important;
  box-shadow: none !important;
}

.v3-stage .v3-pfill,
.v3-stage .quiz-hud-fill {
  background: #3ddc55 !important;
}

.v3-dot {
  background: #cfcfcf !important;
}

.v3-dot.done {
  background: #8d8d8d !important;
}

#v3sl,
input[type="range"] {
  accent-color: #1c1c1c !important;
}

.v3-plw.on .v3-pli {
  background: #1c1c1c !important;
  color: #fff !important;
  border-color: #1c1c1c !important;
}
.v3b,
.v3-mb,
.v3-pli,
.v3-blbl,
.v3-bv,
.v3-filter-btn,
.site-link {
  color: #1c1c1c !important;
  border-color: #cfcfcf !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background 0.24s ease, color 0.24s ease, border-color 0.24s ease, transform 0.24s cubic-bezier(0.16, 0.84, 0.28, 1) !important;
}

.site-link {
  border-color: transparent !important;
  color: #5e5e5e !important;
}

.site-link:hover,
.site-link.active {
  color: #161616 !important;
}

.v3b:hover,
.v3-mb:hover,
.v3-filter-btn:hover {
  transform: translateY(-2px);
}

.v3-plw:hover .v3-pli {
  transform: scale(1.06);
}

.v3-plw.on .v3-pli {
  background: #1c1c1c !important;
  color: #fff !important;
  border-color: #1c1c1c !important;
}

.v3-mb.on,
.v3b.on {
  background: #1c1c1c !important;
  color: #fff !important;
  border-color: #1c1c1c !important;
}

.v3-accent-btn {
  color: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: transparent !important;
  border-radius: 2px !important;
}

.v3-accent-btn.on {
  color: #111 !important;
  background: #fff !important;
  border-color: #fff !important;
}

.listen-filter {
  background: rgba(20, 20, 20, 0.45) !important;
}

.listen-filter-card {
  background: #fff !important;
  color: #1c1c1c !important;
  border: 1px solid #1c1c1c !important;
  border-radius: 0 !important;
}

.listen-query,
.listen-range input {
  background: #fff !important;
  color: #1c1c1c !important;
  border: 1px solid #ccc !important;
  border-radius: 0 !important;
}

.listen-range label,
.listen-meta,
.listen-row small,
.listen-pager {
  color: #555 !important;
}

.listen-quick button,
.listen-text {
  color: #1c1c1c !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
  border-radius: 2px !important;
}

.listen-row {
  background: #f6f6f4 !important;
  color: #1c1c1c !important;
  border-radius: 0 !important;
}

.listen-go {
  color: #fff !important;
  background: #1c1c1c !important;
  border-radius: 2px !important;
}

@media (max-width: 768px) {
  .desk-intro h1,
  .page-title,
  .panel-title {
    font-size: 28px !important;
  }
}

.listen-filter:not([hidden]) {
  animation: deskFade 0.24s ease;
}

.listen-filter:not([hidden]) .listen-filter-card {
  animation: deskIn 0.34s cubic-bezier(0.16, 0.84, 0.28, 1);
}

@keyframes deskIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes deskFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .desk-intro,
  .desk-row,
  .v3,
  .reel-view,
  .listen-filter,
  .listen-filter-card {
    animation: none !important;
    transition: none !important;
  }
}

.v3-ctrl,
.v3-dots {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.auth-page-shell {
  width: min(460px, calc(100vw - 32px)) !important;
  min-height: calc(100vh - 56px);
  padding-top: 0 !important;
  padding-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-panel {
  padding: 32px 32px 28px !important;
  border-color: #1c1c1c !important;
  border-top: 4px solid #1c1c1c !important;
}

.auth-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.auth-title-row .page-title {
  margin: 0 !important;
}

.auth-switch {
  color: #1c1c1c;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.auth-panel .page-copy {
  margin: 12px 0 0;
}

.auth-form {
  margin-top: 22px;
  gap: 16px;
}

.auth-label {
  display: grid;
  gap: 8px;
  color: #1c1c1c;
  font-size: 14px;
  font-weight: 700;
}

.auth-panel .input {
  min-height: 52px;
  padding: 0 14px;
  border-color: #c8c8c8 !important;
  font-size: 16px;
  font-weight: 400;
}

.auth-panel .input:focus {
  outline: none;
  border-color: #1c1c1c !important;
}

.auth-panel .password-toggle {
  color: #1c1c1c;
  background: transparent;
}

.auth-panel .password-toggle:hover,
.auth-panel .password-toggle.is-visible {
  color: #1c1c1c;
  background: #f2f2f2;
}

.auth-panel .remember-row {
  color: #1c1c1c !important;
}

.auth-panel .remember-row input {
  accent-color: #1c1c1c;
  width: 16px;
  height: 16px;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-size: 16px;
}

@media (max-width: 1024px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  body {
    padding-top: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }

  .site-nav {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    min-height: 0 !important;
    padding: env(safe-area-inset-top, 0px) 16px 0 !important;
    border-radius: 0 !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .site-logo {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 38vw !important;
    font-size: 15px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .site-links {
    display: flex !important;
    order: 0 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin-left: auto !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
  }

  .site-link {
    padding: 8px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }

  .site-nav-actions {
    flex: 0 0 auto !important;
    width: auto !important;
    justify-content: flex-end !important;
  }

  .site-logout-button,
  .site-auth-link,
  .site-user-chip {
    width: auto !important;
    max-width: 28vw !important;
    min-height: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .page-shell,
  .admin-page,
  .study-page {
    width: min(880px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    padding-top: 16px !important;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }

  .page-shell:has(.desk-list) {
    width: min(880px, calc(100vw - 28px)) !important;
  }

  .desk-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .desk-exam {
    font-size: clamp(26px, 4vw, 40px);
  }

  .auth-page-shell {
    width: min(460px, calc(100vw - 32px)) !important;
    min-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px)) !important;
    margin-top: 0 !important;
    padding-top: 12px !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
  }

  .auth-panel,
  .unlock-card {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .study-page {
    min-height: 0 !important;
  }

  .study-wrap,
  .v3 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible !important;
  }

  .v3-hdr,
  .v3-hdr-side {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    gap: 8px !important;
  }

  .v3-hdr {
    justify-content: space-between !important;
  }

  .v3-lbl {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 15px !important;
  }

  #v3stage,
  .v3-stage {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: min(62dvh, 620px) !important;
    max-height: calc(100dvh - 210px) !important;
    margin-bottom: 12px !important;
    border-radius: 0 !important;
  }

  .v3-ctrl {
    gap: 12px !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
  }

  .v3b {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    flex: 0 0 44px !important;
  }

  .v3-plw {
    width: 68px !important;
    height: 68px !important;
    min-width: 68px !important;
    flex: 0 0 68px !important;
  }

  .listen-filter {
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  .listen-filter-card {
    width: min(560px, 100%) !important;
    max-height: calc(100dvh - 96px) !important;
    box-sizing: border-box !important;
  }

  .listen-range {
    flex-wrap: wrap !important;
  }

  .unlock-overlay {
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  .unlock-card {
    width: min(460px, 100%) !important;
    border-radius: 2px !important;
  }

  .admin-page .field-row,
  .admin-page .button-row,
  .unlock-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .admin-table-wrap {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 700px) {
  .site-user-chip {
    display: none !important;
  }

  .site-logout-button {
    max-width: none !important;
    flex: 0 0 auto !important;
    font-size: 13px !important;
  }

  .desk-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .desk-row {
    padding: 12px;
  }

  .desk-exam {
    font-size: 30px;
  }

  .auth-panel {
    padding: 22px 16px 18px !important;
  }

  .auth-title-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .auth-switch {
    font-size: 13px;
    white-space: normal;
  }

  #v3stage,
  .v3-stage {
    height: calc(100dvh - 252px) !important;
    min-height: 300px !important;
    max-height: none !important;
  }

  #v3w,
  .v3-word,
  #v3stage #v3w.v3-word {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    font-size: clamp(32px, 12vw, 56px) !important;
    line-height: 1 !important;
  }

  .v3-ci {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    height: auto !important;
    grid-template-rows: none !important;
  }

  #v3stage .reel-col {
    width: 20% !important;
    left: 2% !important;
  }

  #v3stage .reel-col-right {
    left: auto !important;
    right: 2% !important;
  }

  #v3stage .reel-focus {
    width: 54% !important;
    max-width: 54% !important;
  }

  #v3stage .reel-focus b,
  #v3stage .reel-hot-word {
    font-size: clamp(28px, 8vw, 46px) !important;
  }

  .admin-page .button,
  .admin-page .field-row > *,
  .unlock-actions .button {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 500 700;
  font-display: swap;
  src: url("../assets/fonts/bodoni-moda-italic.woff2") format("woff2");
}
