/* =========================================================
   蒙青创 OJ · 门户内嵌界面
   ========================================================= */

.oj-page {
  background: var(--paper);
}

[hidden] {
  display: none !important;
}

.oj-header .brand__en {
  letter-spacing: 0.14em;
}

/* 门户在 980px 以下会隐藏 .nav，OJ 需要保留自己的横向导航 */
.oj-nav {
  display: flex;
}

.oj-user {
  max-width: 120px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oj-main {
  min-height: calc(100vh - 220px);
  padding: 34px 0 76px;
}

.oj-demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 11px 15px;
  border: 1px solid rgba(232, 169, 60, 0.38);
  border-radius: 12px;
  background: var(--amber-soft);
  color: #6f4a09;
  font-size: 11px;
  line-height: 1.6;
}

.oj-demo-banner strong {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.oj-demo-banner code,
.oj-code-inline {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.oj-loading {
  padding: 60px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- Hero ---------- */

.oj-hero {
  position: relative;
  overflow: hidden;
  padding: 38px;
  border-radius: 30px;
  background: linear-gradient(145deg, #073f38 0%, #082d28 58%, #071f1b 100%);
  color: #f2faf7;
}

.oj-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(120deg, #000, transparent 78%);
  -webkit-mask-image: linear-gradient(120deg, #000, transparent 78%);
}

.oj-hero::after {
  content: "";
  position: absolute;
  top: -150px;
  right: -100px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 215, 191, 0.25), transparent 68%);
}

.oj-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 36px;
  align-items: center;
}

.oj-hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(32px, 4.6vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  font-weight: 900;
}

.oj-hero p {
  max-width: 540px;
  margin: 0;
  font-size: 13px;
  line-height: 1.85;
  color: rgba(242, 250, 247, 0.65);
}

.oj-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 23px;
}

.oj-hero__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.oj-hero__stat {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.oj-hero__stat b {
  display: block;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.oj-hero__stat span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: rgba(242, 250, 247, 0.52);
}

/* ---------- Layout / cards ---------- */

.oj-section {
  margin-top: 34px;
}

.oj-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.oj-section-head h2 {
  margin: 7px 0 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.oj-section-head p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.oj-section-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.oj-problem-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.oj-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.oj-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.oj-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.oj-card__head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.oj-card__body {
  padding: 18px;
}

.oj-muted {
  color: var(--muted);
}

.oj-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
}

.oj-empty {
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Tables ---------- */

.oj-table-wrap {
  overflow-x: auto;
}

.oj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.oj-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(236, 241, 233, 0.6);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.oj-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.oj-table tr:last-child td {
  border-bottom: 0;
}

.oj-table tbody tr:hover {
  background: rgba(221, 244, 236, 0.22);
}

.oj-problem-title {
  display: inline-block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
}

.oj-problem-title:hover {
  color: var(--teal);
}

.oj-sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted);
}

.oj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.oj-tags span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 9px;
}

.oj-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.oj-status::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.oj-status--accepted {
  background: var(--mint-soft);
  color: var(--teal);
}

.oj-status--wrong_answer {
  background: var(--red-soft);
  color: var(--red);
}

.oj-status--time_limit_exceeded,
.oj-status--memory_limit_exceeded {
  background: var(--amber-soft);
  color: #875706;
}

.oj-status--compile_error,
.oj-status--runtime_error,
.oj-status--system_error {
  background: var(--red-soft);
  color: #8c3a2a;
}

.oj-status--queued,
.oj-status--running {
  background: var(--paper-2);
  color: var(--teal);
}

.oj-difficulty {
  font-size: 10px;
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
}

.oj-difficulty-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.oj-difficulty--red { background: #e74c3c; }
.oj-difficulty--orange { background: #e67e22; }
.oj-difficulty--yellow { background: #f1c40f; color: #3a3000; }
.oj-difficulty--green { background: #27ae60; }
.oj-difficulty--cyan { background: #16a085; }
.oj-difficulty--blue { background: #2980b9; }
.oj-difficulty--purple { background: #8e44ad; }
.oj-difficulty--black { background: #2c3e50; }

.oj-ac-rate {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

/* ---------- Toolbar ---------- */

.oj-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.oj-toolbar input,
.oj-toolbar select {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
}

.oj-toolbar input {
  flex: 1 1 220px;
}

.oj-toolbar input:focus,
.oj-toolbar select:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 107, 93, 0.12);
}

.oj-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.oj-chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.oj-chip.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

/* ---------- Pagination ---------- */

.oj-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  font-size: 10px;
  color: var(--muted);
}

.oj-pagination__buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.oj-pagination__jump {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.oj-pagination__jump input {
  width: 52px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  text-align: center;
}

.oj-pagination__jump input::-webkit-inner-spin-button,
.oj-pagination__jump input::-webkit-outer-spin-button {
  margin: 0;
}

.oj-pagination button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 10px;
}

.oj-pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Problem detail ---------- */

.oj-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}

.oj-breadcrumb a:hover {
  color: var(--teal);
}

.oj-problem-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.oj-problem-head h1 {
  margin: 6px 0 8px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.oj-problem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}

.oj-problem-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.oj-statement {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-2);
}

.oj-statement > :first-child {
  margin-top: 0;
}

.oj-statement h2 {
  margin: 30px 0 10px;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.oj-statement h3 {
  margin: 22px 0 8px;
  font-size: 17px;
  color: var(--ink);
}

.oj-statement p {
  margin: 0 0 14px;
}

.oj-statement ul,
.oj-statement ol {
  margin: 0 0 14px;
  padding-left: 21px;
}

.oj-statement li {
  margin-bottom: 5px;
}

.oj-statement li::marker {
  color: var(--teal);
}

.oj-statement blockquote {
  margin: 18px 0;
  padding: 14px 17px;
  border-left: 3px solid var(--mint);
  border-radius: 0 9px 9px 0;
  background: var(--paper);
  color: var(--ink);
}

.oj-statement pre {
  overflow-x: auto;
  margin: 12px 0 18px;
  padding: 15px;
  border-radius: 11px;
  background: #0b1f1b;
  color: #dcebe6;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
}

.oj-statement code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.oj-statement pre code {
  padding: 0;
  background: transparent;
}

.oj-statement table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid var(--line);
}

.oj-statement th,
.oj-statement td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.oj-statement th {
  background: var(--paper-2);
}

.oj-sample {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.oj-sample__head {
  display: flex;
  justify-content: space-between;
  padding: 8px 11px;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.oj-sample pre {
  margin: 0;
  border-radius: 0;
}

/* ---------- Submit panel ---------- */

.oj-submit-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 12px;
}

.oj-submit-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.oj-submit-card h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.oj-submit-card > p {
  margin: 0 0 12px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}

.oj-submit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}

.oj-submit-row select {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
}

.oj-code-editor {
  display: block;
  width: 100%;
  min-height: 300px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  outline: none;
  background: #0b1f1b;
  color: #dcebe6;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  resize: vertical;
  tab-size: 4;
}

.oj-code-editor:focus {
  box-shadow: 0 0 0 3px rgba(90, 215, 191, 0.18);
}

.oj-submit-tip {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  color: var(--muted);
}

.oj-submit-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--paper);
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-2);
}

.oj-login-cta {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- Result ---------- */

.oj-result {
  display: grid;
  gap: 14px;
}

.oj-result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 16px;
  background: var(--paper-2);
}

.oj-result-banner h2 {
  margin: 7px 0 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.oj-result-score {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.oj-result-score small {
  font-size: 0.35em;
  color: var(--muted);
}

.oj-code-block {
  overflow-x: auto;
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: #0b1f1b;
  color: #dcebe6;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}

.oj-compile {
  white-space: pre-wrap;
  color: #8c3a2a;
  background: var(--red-soft);
  padding: 12px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
}

/* ---------- Contests / training ---------- */

.oj-contest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.oj-contest-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.oj-contest-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.oj-contest-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.oj-contest-card h3 {
  margin: 13px 0 7px;
  font-size: 18px;
  line-height: 1.4;
}

.oj-contest-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.oj-contest-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 13px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}

.oj-contest-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
}

.oj-contest-state--running {
  background: var(--mint-soft);
  color: var(--teal);
}

.oj-contest-state--upcoming {
  background: var(--amber-soft);
  color: #875706;
}

.oj-contest-state--ended {
  background: var(--paper-2);
  color: var(--muted);
}

.oj-training-list {
  display: grid;
  gap: 12px;
}

.oj-training-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.oj-training-card h3 {
  margin: 5px 0 6px;
  font-size: 18px;
}

.oj-training-card p {
  max-width: 600px;
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.oj-progress {
  width: 150px;
  flex: 0 0 auto;
}

.oj-progress__bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-2);
}

.oj-progress__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--mint));
}

.oj-progress span {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted);
  text-align: right;
}

.oj-training-items {
  display: grid;
  gap: 8px;
}

.oj-training-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.oj-training-item__num {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}

.oj-training-item a {
  font-weight: 700;
  font-size: 12px;
}

.oj-training-item a:hover {
  color: var(--teal);
}

.oj-training-item__solved {
  margin-left: auto;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
}

/* ---------- Login ---------- */

.oj-auth-wrap {
  display: grid;
  place-items: center;
  min-height: 460px;
}

.oj-auth-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.oj-auth-card h1 {
  margin: 10px 0 7px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.oj-auth-card > p {
  margin: 0 0 22px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.oj-field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.oj-field label {
  font-size: 11px;
  font-weight: 700;
}

.oj-field input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}

.oj-field input:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 107, 93, 0.12);
}

.oj-auth-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  line-height: 1.6;
}

.oj-auth-note {
  margin: 14px 0 0;
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
}

.oj-auth-note code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--paper-2);
  font-family: var(--font-mono);
}

/* ---------- Footer ---------- */

.oj-footer {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.oj-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.oj-footer a:hover {
  color: var(--teal);
}

/* ---------- Responsive ---------- */

@media (max-width: 1050px) {
  .oj-hero__grid {
    grid-template-columns: 1fr;
  }

  .oj-hero__stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .oj-problem-layout {
    grid-template-columns: 1fr;
  }

  .oj-submit-panel {
    position: static;
  }

  .oj-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .oj-header .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 10px;
  }

  .oj-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 3px;
  }

  .oj-nav .nav__link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .oj-back {
    display: none;
  }
}

@media (max-width: 680px) {
  .oj-main {
    padding-top: 22px;
  }

  .oj-hero {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .oj-hero__stats {
    grid-template-columns: 1fr 1fr;
  }

  .oj-contest-grid {
    grid-template-columns: 1fr;
  }

  .oj-training-card {
    display: block;
  }

  .oj-progress {
    width: 100%;
    margin-top: 14px;
  }

  .oj-progress span {
    text-align: left;
  }

  .oj-problem-head {
    display: block;
  }

  .oj-problem-head h1 {
    font-size: 30px;
  }

  .oj-statement {
    padding: 18px;
    font-size: 13px;
  }

  .oj-table th,
  .oj-table td {
    padding: 10px;
  }

  .oj-table th:nth-child(3),
  .oj-table td:nth-child(3) {
    display: none;
  }

  .oj-footer__inner {
    display: block;
    line-height: 1.9;
  }

  .oj-auth-wrap {
    min-height: 400px;
  }
}

/* ---------- Contest tabs / scoreboard ---------- */

.oj-contest-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.oj-contest-registered {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #e8f7f1;
  font-size: 12px;
}

.oj-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.oj-tab {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.oj-tab.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.oj-contest-context {
  display: inline-block;
  margin: 14px 0 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #875706;
  font-family: var(--font-mono);
  font-size: 10px;
}

.oj-scoreboard {
  min-width: 620px;
}

.oj-scoreboard .oj-score-head {
  text-align: center;
}

.oj-score-head__link {
  color: inherit;
  text-decoration: none;
}

.oj-score-head__link:hover {
  text-decoration: underline;
}

.oj-score-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.oj-score-link:hover b {
  text-decoration: underline;
}

.oj-score-link--disabled {
  cursor: default;
}

.oj-score-total {
  text-align: center;
}

.oj-score-cell {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.oj-score-cell b {
  display: block;
  font-size: 12px;
}

.oj-score-cell span {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  opacity: 0.65;
}

.oj-score-cell--accepted {
  color: var(--teal);
  background: var(--mint-soft);
}

.oj-score-cell--failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.oj-score-cell--partial {
  color: #875706;
  background: var(--amber-soft);
}

.oj-rank {
  width: 48px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ---------- Contest clarifications ---------- */

.oj-clarification {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.oj-clarification:last-of-type {
  border-bottom: 0;
}

.oj-clarification__q,
.oj-clarification__a {
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.7;
}

.oj-clarification__q b,
.oj-clarification__a b {
  flex: 0 0 20px;
  color: var(--teal);
  font-family: var(--font-mono);
}

.oj-clarification__q p,
.oj-clarification__a p {
  margin: 0;
}

.oj-clarification__q span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.oj-clarification__a {
  margin-top: 6px;
  color: var(--ink-2);
}

.oj-clarification-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ---------- Homework ---------- */

.oj-homework-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.oj-homework-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.oj-homework-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.oj-homework-card h3 {
  margin: 10px 0 6px;
  font-size: 18px;
}

.oj-homework-card p {
  min-height: 38px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .oj-homework-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Homework badge / todo ---------- */

.nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent, #d97757);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
}

.nav__badge[hidden] {
  display: none !important;
}

.oj-todo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.oj-todo-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.oj-todo-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.oj-todo-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.oj-todo-card h3 {
  margin: 8px 0 6px;
  font-size: 16px;
}

.oj-todo-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
}

.oj-todo-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 760px) {
  .oj-todo-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Notifications / account ---------- */

.oj-notify {
  gap: 5px;
}

.oj-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.oj-filter-tabs a {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.oj-filter-tabs a.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.oj-notification-list {
  display: grid;
  gap: 10px;
}

.oj-notification {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.oj-notification.is-unread {
  border-left: 3px solid var(--teal);
}

.oj-notification__top,
.oj-notification__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.oj-notification h3 {
  margin: 9px 0 5px;
  font-size: 16px;
}

.oj-notification p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.oj-notification__actions button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.oj-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.oj-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.oj-account-row:last-child {
  border-bottom: 0;
}

.oj-account-row span {
  color: var(--muted);
}

.oj-handles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 760px) {
  .oj-handles-grid {
    grid-template-columns: 1fr;
  }
}

.oj-password-form {
  display: grid;
  gap: 12px;
}

@media (max-width: 760px) {
  .oj-account-grid {
    grid-template-columns: 1fr;
  }
  .oj-notify {
    display: none;
  }
}

.oj-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.oj-stats-row > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.oj-stats-row b { display: block; font-size: 24px; color: var(--teal); }
.oj-stats-row span { color: var(--muted); font-size: 11px; }
.oj-attachments { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.oj-solution { font-size: 14px; line-height: 1.85; }
.oj-solution h2, .oj-solution h3 { margin: 18px 0 8px; }
.oj-solution pre { overflow: auto; padding: 12px; border-radius: 8px; background: #0d2b27; color: #e9f6f1; }
@media (max-width: 640px) { .oj-stats-row { grid-template-columns: 1fr; } }

.oj-objective-question { padding: 16px 0; border-bottom: 1px solid var(--line); }
.oj-objective-stem { font-size: 14px; line-height: 1.8; margin-bottom: 10px; }
.oj-objective-options { display: grid; gap: 7px; }
.oj-objective-options label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.oj-objective-options input { margin-top: 3px; }

.oj-community-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.oj-community-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.oj-community-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 11px; }
.oj-community-meta span { color: var(--muted); }
.oj-community-body { font-size: 12px; line-height: 1.75; color: var(--ink-2); overflow-wrap: anywhere; }
.oj-community-body pre { overflow: auto; padding: 10px; border-radius: 6px; background: #f4f7f4; }
@media (max-width: 860px) { .oj-community-grid { grid-template-columns: 1fr; } }

.oj-community-actions { display: flex; gap: 12px; margin-top: 6px; font-size: 10px; }
.oj-link--danger { color: #b24632; }
.oj-community-replies { margin: 4px 0 0 22px; padding-left: 10px; border-left: 2px solid #e4ece7; }

.oj-account-sections { margin-top: 20px; display: grid; gap: 18px; }
.oj-user-file-list, .oj-user-blog-list { margin-top: 10px; }
.oj-blog-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.oj-blog-card { display: block; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; color: var(--ink); }
.oj-blog-card:hover { border-color: var(--teal); }
.oj-blog-card__meta { color: var(--muted); font-size: 10px; }
.oj-blog-card h3 { margin: 8px 0; }
.oj-blog-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.oj-blog-content { font-size: 14px; line-height: 1.9; }
.oj-blog-content pre { overflow: auto; padding: 12px; border-radius: 8px; background: #f4f7f4; }
@media (max-width: 700px) { .oj-blog-list { grid-template-columns: 1fr; } }

/* Account center alignment */
.oj-account-sections { max-width: 980px; }
.oj-account-sections .oj-card { width: 100%; }
.oj-contact-form { display: grid; gap: 10px; margin-top: 12px; }
.oj-contact-form > .input { width: 100%; }
.oj-contact-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oj-contact-actions .input { flex: 1 1 150px; min-width: 0; width: auto; }
.oj-contact-actions .btn { flex: 0 0 auto; }
.oj-file-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.oj-file-name { min-width: 0; flex: 1 1 180px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oj-blog-form { display: grid; gap: 0; }
.oj-blog-form > .input { width: 100%; }
.oj-blog-form textarea { width: 100%; background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.oj-blog-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.oj-blog-actions .checkbox { min-height: 0; }
.oj-account-sections .oj-account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.oj-account-sections .oj-account-row > * { min-width: 0; }
@media (max-width: 560px) {
  .oj-contact-actions .btn { flex: 1 1 100%; }
  .oj-contact-actions .input { flex: 1 1 100%; }
  .oj-blog-actions { align-items: stretch; flex-direction: column; }
}

/* Account cards use equal columns so related forms line up */
.oj-account-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.oj-account-sections {
  max-width: none;
  width: 100%;
}
.oj-account-sections > .oj-account-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 980px) {
  .oj-account-grid,
  .oj-account-sections > .oj-account-grid {
    grid-template-columns: 1fr;
  }
}

.oj-community-item--answer { margin: 6px -8px; padding: 12px 8px; border-radius: 8px; background: #f1f8f3; }
.oj-answer-badge { display: inline-block; margin-bottom: 6px; padding: 2px 7px; border-radius: 999px; background: #d9efe1; color: #17643a; font-size: 9px; font-weight: 700; }

.oj-problem-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.oj-problem-title-row h1 { margin: 0; }

.oj-level { display: inline-flex; min-width: 22px; justify-content: center; padding: 2px 6px; border-radius: 999px; background: #eef5ef; color: var(--teal); font-size: 10px; font-weight: 800; }

.oj-profile-head { display: flex; align-items: center; gap: 16px; margin: 18px 0; }
.oj-profile-avatar { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; font-size: 26px; font-weight: 800; }
.oj-profile-head h1 { margin: 0 0 4px; }
.oj-profile-rating { margin-left: auto; text-align: right; }
.oj-profile-rating b { display: block; font-size: 32px; color: var(--teal); }
.oj-profile-rating span { color: var(--muted); font-size: 11px; }

/* Problem code workspace */
body.oj-editor-open { overflow: hidden; }
.oj-submit-card--launcher { border-color: rgba(11, 107, 93, 0.22); }
.oj-editor-launch { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 13px; border-radius: 11px; background: var(--paper-2); }
.oj-editor-launch__mark { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px; background: var(--teal); color: #fff; font-family: var(--font-mono); font-size: 12px; font-weight: 800; }
.oj-editor-launch b { display: block; font-size: 12px; }
.oj-editor-launch p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.oj-code-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; }
.oj-code-modal[hidden] { display: none !important; }
.oj-code-modal__backdrop { position: absolute; inset: 0; background: rgba(5, 19, 16, 0.68); backdrop-filter: blur(5px); }
.oj-code-modal__dialog { position: relative; display: flex; flex-direction: column; width: min(1180px, 96vw); height: min(860px, 92vh); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; background: #0b1f1b; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4); }
.oj-code-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.09); }
.oj-code-modal__head h2 { margin: 3px 0 0; color: #f2fbf7; font-size: 18px; }
.oj-code-modal__head .eyebrow { color: #7ed9c3; }
.oj-code-modal__tools { display: flex; align-items: center; gap: 8px; }
.oj-code-modal__tools select { min-height: 34px; padding: 0 28px 0 10px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px; background: #12352e; color: #e8f5f0; font-size: 11px; }
.oj-modal-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: #e8f5f0; font-size: 22px; cursor: pointer; }
.oj-modal-icon:hover { background: rgba(255, 255, 255, 0.16); }
.oj-code-modal__body { flex: 1; min-height: 0; padding: 14px 20px 0; }
.oj-code-editor-wrap { display: flex; height: 100%; min-height: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 11px; background: #081814; }
.oj-line-numbers { flex: 0 0 46px; height: 100%; margin: 0; padding: 13px 9px 13px 0; overflow: hidden; border-right: 1px solid rgba(255, 255, 255, 0.06); color: #5f8d80; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; text-align: right; user-select: none; }
.oj-code-editor--xl { flex: 1; width: auto; height: 100%; min-height: 0; padding: 13px 16px; border: 0; border-radius: 0; resize: none; font-size: 13px; line-height: 1.7; background: transparent; }
.oj-code-editor--xl:focus { box-shadow: none; }
.oj-code-modal__status { margin: 10px 20px 0; padding: 0; color: #cfe8df; font-size: 11px; }
.oj-code-modal__status:not([hidden]) { padding: 9px 11px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.oj-code-modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; color: #7fa99d; font-size: 10px; }
.oj-code-modal__actions { display: flex; gap: 8px; flex: 0 0 auto; }
@media (max-width: 720px) {
  .oj-code-modal { padding: 0; }
  .oj-code-modal__dialog { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .oj-code-modal__head { padding: 12px 14px; }
  .oj-code-modal__head h2 { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .oj-code-modal__body { padding: 10px 12px 0; }
  .oj-code-modal__foot { flex-direction: column; align-items: stretch; padding: 10px 12px; }
  .oj-code-modal__foot > span { display: none; }
  .oj-code-modal__actions .btn { flex: 1; }
  .oj-line-numbers { flex-basis: 38px; }
  .oj-code-editor--xl { font-size: 12px; }
}

.oj-code-modal__foot .btn--ghost { color: #dcebe6; border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.04); }
.oj-code-modal__foot .btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }

.oj-code-editor--xl { font-size: 14px; }
.oj-line-numbers { font-size: 13px; }
@media (max-width: 720px) { .oj-code-editor--xl { font-size: 13px; } }

.oj-code-editor-mount { display: flex; flex: 1; min-width: 0; height: 100%; }
.oj-code-editor-mount[hidden] { display: none !important; }
.oj-code-editor-mount .monaco-editor { height: 100% !important; }
.oj-code-editor-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #7fa99d; font-family: var(--font-mono); font-size: 11px; background: #081814; z-index: 2; }
.oj-code-editor-wrap { position: relative; }

.oj-user.is-active { color: var(--teal); border-bottom: 2px solid var(--teal); padding-bottom: 2px; }

/* OJ daily check-in / countdown */
.oj-daily-section { margin-top: 18px; }
.oj-daily-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 18px; align-items: stretch; }
.oj-daily-card { display: flex; min-width: 0; height: 100%; flex-direction: column; }
.oj-checkin-card { overflow: hidden; padding: 0; border: 1px solid var(--line); background: #fff; }
.oj-checkin-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 22px 18px;
  color: #eaf7f2;
  text-align: center;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(90, 215, 191, 0.24), transparent 68%),
    linear-gradient(145deg, #0e3a32, #071f1b);
}
.oj-checkin-top .eyebrow { color: rgba(169, 239, 223, 0.7); }
.oj-checkin-top h3 { margin: 2px 0 0; color: #f2faf7; font-size: 24px; letter-spacing: -0.03em; }
.oj-checkin-streak { display: grid; justify-items: center; gap: 2px; }
.oj-checkin-streak b { color: var(--mint, #a9efdf); font-family: var(--font-mono); font-size: 34px; line-height: 1; }
.oj-checkin-streak span { color: rgba(234, 247, 242, 0.55); font-size: 9px; letter-spacing: 0.08em; }
.oj-checkin-main { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 18px 22px 14px; text-align: center; }
.oj-fortune-box { width: 100%; min-width: 0; min-height: 88px; padding: 14px; border: 1px dashed #d5e2dc; border-radius: 10px; background: #f7faf8; text-align: center; }
.oj-fortune-box.is-revealed { border-style: solid; border-color: rgba(61, 157, 132, 0.35); background: #f2fbf7; }
.oj-checkin-label { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.oj-fortune-box strong { display: block; margin: 6px 0 3px; color: var(--teal); font-size: 30px; line-height: 1.1; letter-spacing: -0.04em; }
.oj-fortune-box p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.oj-checkin-button { width: 100%; }
.oj-checkin-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 4px 22px 16px; }
.oj-checkin-day { display: grid; justify-items: center; gap: 4px; padding: 7px 2px; border-radius: 8px; background: #f5f8f6; color: var(--muted); text-align: center; }
.oj-checkin-day span { font-size: 9px; }
.oj-checkin-day b { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #698078; font-size: 10px; }
.oj-checkin-day.is-done { color: var(--teal); background: #e9f8f1; }
.oj-checkin-day.is-done b { color: #fff; background: var(--teal); }
.oj-checkin-foot { display: flex; justify-content: center; gap: 22px; padding: 10px 22px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.oj-checkin-foot b { color: var(--ink); }

/* Countdown card */
.oj-countdown-card { overflow: hidden; color: #eaf7f2; border-color: #0d2d27; background: linear-gradient(145deg, #0e3a32, #071f1b); }
.oj-countdown-card .oj-card__body { flex: 1; }
.oj-countdown-card .oj-card__head { padding: 18px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.oj-countdown-card .oj-card__head h3 { color: #f2faf7; }
.oj-countdown-card .oj-card__head .oj-muted { color: rgba(234, 247, 242, 0.5); }
.oj-countdown-card .oj-card__body { padding: 14px 16px 16px; }
.oj-countdown-list { display: grid; gap: 10px; }
.oj-countdown { padding: 13px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; background: rgba(255, 255, 255, 0.035); }
.oj-countdown:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.oj-countdown__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.oj-countdown__title { color: #f2faf7; font-weight: 700; font-size: 13px; }
.oj-countdown__date { color: rgba(234, 247, 242, 0.48); font-family: var(--font-mono); font-size: 9px; }
.oj-countdown__clock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 11px; }
.oj-countdown__unit { display: grid; place-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); }
.oj-countdown__unit b { color: var(--mint, #a9efdf); font-family: var(--font-mono); font-size: 23px; line-height: 1; }
.oj-countdown__unit small { color: rgba(234, 247, 242, 0.48); font-size: 8px; }
@media (max-width: 760px) {
  .oj-daily-grid { grid-template-columns: 1fr; }
  .oj-checkin-main { align-items: stretch; }
  .oj-checkin-button { width: 100%; }
  .oj-countdown__unit b { font-size: 20px; }
}

/* OJ personal charts */
.oj-data-section { margin-top: 22px; }
.oj-chart-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 18px; }
.oj-chart-card { min-width: 0; }
.oj-chart-card .oj-card__body { padding: 18px 20px 20px; }
.oj-activity-chart { display: flex; align-items: stretch; gap: 9px; height: 168px; }
.oj-activity-day { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.oj-activity-bar { position: relative; width: 100%; height: 128px; overflow: hidden; border-radius: 7px; background: #eff4f1; }
.oj-activity-bar i, .oj-activity-bar em { position: absolute; right: 0; bottom: 0; left: 0; display: block; border-radius: 7px 7px 0 0; }
.oj-activity-bar i { background: #bce8dc; }
.oj-activity-bar em { background: var(--teal); }
.oj-activity-day b { color: var(--muted); font-family: var(--font-mono); font-size: 9px; font-weight: 400; }
.oj-activity-day small { color: var(--muted); font-size: 8px; }
.oj-difficulty-chart { display: grid; gap: 13px; padding-top: 4px; }
.oj-difficulty-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 42px; align-items: center; gap: 10px; }
.oj-difficulty-row > span { color: var(--muted); font-size: 10px; }
.oj-difficulty-track { height: 8px; overflow: hidden; border-radius: 999px; background: #eef4f1; }
.oj-difficulty-track i { display: block; height: 100%; overflow: hidden; border-radius: inherit; background: #bce8dc; }
.oj-difficulty-track em { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.oj-difficulty-row > b { color: var(--ink); font-family: var(--font-mono); font-size: 11px; text-align: right; }
.oj-difficulty-row > b small { color: var(--muted); font-size: 9px; font-weight: 400; }
@media (max-width: 760px) {
  .oj-chart-grid { grid-template-columns: 1fr; }
  .oj-activity-chart { height: 150px; }
  .oj-activity-bar { height: 110px; }
}

/* Problem statement samples: input left, output right */
.oj-problem-samples { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.oj-problem-samples__title { margin-bottom: 10px; color: var(--ink); font-size: 16px; font-weight: 700; }
.oj-problem-sample { overflow: hidden; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.oj-problem-sample__head { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.oj-problem-sample__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.oj-problem-sample__col { min-width: 0; padding: 10px 12px 12px; }
.oj-problem-sample__col + .oj-problem-sample__col { border-left: 1px solid var(--line); }
.oj-problem-sample__col > span, .oj-sample-item > div > span { display: flex; align-items: center; gap: 4px; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.oj-copy-sample { display: inline-grid; width: 20px; height: 20px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.oj-copy-sample:hover { border-color: var(--teal); color: var(--teal); background: #f1faf6; }
.oj-copy-sample svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.oj-problem-sample__col pre { margin: 0; padding: 10px 12px; overflow: auto; border-radius: 7px; background: #0d2d27; color: #dff7ef; font-family: var(--font-mono); font-size: 11px; line-height: 1.65; white-space: pre-wrap; }
@media (max-width: 760px) {
  .oj-problem-sample__grid { grid-template-columns: 1fr; }
  .oj-problem-sample__col + .oj-problem-sample__col { border-top: 1px solid var(--line); border-left: 0; }
}

/* Online sample self-test */
.oj-sample-test { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7faf8; }
.oj-sample-test__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.oj-sample-test__head b { display: block; color: var(--ink); font-size: 13px; }
.oj-sample-test__head span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.oj-sample-item { margin-top: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.oj-sample-item__head { margin-bottom: 6px; color: var(--teal); font-family: var(--font-mono); font-size: 10px; font-weight: 700; }
.oj-sample-item__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.oj-sample-item__grid > div > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.oj-sample-item pre { max-height: 130px; margin: 0; overflow: auto; color: var(--ink); font-family: var(--font-mono); font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.oj-sample-empty { padding: 10px 12px; border: 1px dashed #d5e2dc; border-radius: 8px; color: var(--muted); font-size: 11px; }
@media (max-width: 760px) {
  .oj-sample-test__head { align-items: flex-start; flex-direction: column; }
  .oj-sample-item__grid { grid-template-columns: 1fr; }
}

.oj-user-link {
  color: var(--ink-2);
  font-weight: 700;
}

.oj-user-link:hover {
  color: var(--teal);
}

/* =========================================================
   OJ motion layer: directional page fades, tactile cards,
   a quieter table and a springy code workspace.
   ========================================================= */

:root {
  --oj-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --oj-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

#oj-app > * {
  animation: oj-page-in 0.48s var(--oj-ease) both;
}

#oj-app > *:nth-child(2) { animation-delay: 0.035s; }
#oj-app > *:nth-child(3) { animation-delay: 0.07s; }
#oj-app > *:nth-child(4) { animation-delay: 0.105s; }

.oj-card,
.oj-homework-card,
.oj-contest-card,
.oj-training-card,
.oj-training-item,
.oj-submit-card {
  transition:
    transform 0.35s var(--oj-ease),
    box-shadow 0.35s ease,
    border-color 0.25s ease,
    background-color 0.25s ease;
}

@media (hover: hover) {
  .oj-homework-card:hover,
  .oj-contest-card:hover,
  .oj-training-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -30px rgba(7, 63, 56, 0.46);
  }

  .oj-card:hover,
  .oj-submit-card:hover {
    box-shadow: 0 18px 36px -30px rgba(7, 63, 56, 0.38);
  }
}

.oj-table tbody tr,
.oj-scoreboard tbody tr {
  transition: background-color 0.2s ease;
}

.oj-table tbody tr:hover,
.oj-scoreboard tbody tr:hover {
  background: rgba(221, 244, 236, 0.42);
}

.oj-pagination button {
  transition:
    transform 0.25s var(--oj-spring),
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.oj-pagination button:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: var(--teal);
  background: var(--mint-soft);
}

.oj-code-modal:not([hidden]) .oj-code-modal__backdrop {
  animation: oj-backdrop-in 0.25s ease both;
}

.oj-code-modal:not([hidden]) .oj-code-modal__dialog {
  animation: oj-dialog-in 0.35s var(--oj-spring) both;
}

.oj-loading {
  position: relative;
  overflow: hidden;
}

.oj-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.6) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: oj-shimmer 1.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes oj-page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes oj-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes oj-dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes oj-shimmer {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  #oj-app > *,
  .oj-code-modal:not([hidden]) .oj-code-modal__backdrop,
  .oj-code-modal:not([hidden]) .oj-code-modal__dialog,
  .oj-loading::after {
    animation: none !important;
  }
  .oj-card,
  .oj-homework-card,
  .oj-contest-card,
  .oj-training-card,
  .oj-training-item,
  .oj-submit-card,
  .oj-pagination button,
  .oj-table tbody tr,
  .oj-scoreboard tbody tr {
    transition: none !important;
  }
}

