:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #152b48;
  background: #eff4fa;
  --blue: #254cd0;
  --navy: #132d51;
  --muted: #536984;
  --line: #dbe4f0;
  --surface: #fff;
  --tint: #f5f8fc;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--blue); }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #7c9ffc;
  outline-offset: 2px;
}
.competition-top { background: var(--navy); color: #fff; }
.competition-top-inner, .competition-shell { max-width: 1240px; margin: auto; padding-inline: 24px; }
.competition-top-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.competition-brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; font-weight: 750; }
.competition-brand img { width: 34px; height: 34px; }
.competition-brand small { display: block; font-size: 12px; color: #c9dbf6; font-weight: 500; }
.competition-shell { padding-block: 24px 44px; }
.competition-hero {
  border-radius: 17px; padding: 25px 28px;
  background: linear-gradient(112deg, #182f69, #2d4fc2 78%, #3457bf);
  color: white; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.competition-hero h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.25; }
.competition-hero p { margin-top: 7px; font-size: 14px; color: #e0eaff; }
.competition-tabs, .competition-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.competition-tabs { margin-block: 16px; }
.competition-tabs button, .competition-button {
  min-height: 42px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 9px; background: white; color: var(--navy); font-weight: 650;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; line-height: 1.3; text-align: center;
}
.competition-tabs [aria-current="page"], .competition-button.primary { background: var(--blue); color: white; border-color: var(--blue); }
.competition-hero .competition-button { background: #fff; color: #1b3f9b; }
.competition-button.danger { color: #a52c3d; background: #fff7f7; border-color: #f0d4d9; }
.competition-button.link { border-color: transparent; background: transparent; color: var(--blue); }
.competition-badge { background: #e8efff; color: #2649a5; border-radius: 999px; padding: 2px 7px; font-size: 12px; white-space: nowrap; }
.competition-badge.open, .competition-badge.accepted, .competition-badge.published { background: #e1f6eb; color: #086b4d; }
.competition-badge.interview, .competition-badge.returned, .competition-badge.upcoming { background: #fff2d7; color: #85530a; }
.competition-badge.cancelled, .competition-badge.rejected { background: #fce7eb; color: #a32c43; }
.competition-stars { color: #7c5008; background: #fff4d9; }
.competition-panel, .competition-card, .competition-empty {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 16px;
}
.competition-panel { margin-bottom: 14px; }
.competition-panel h2, .competition-card h2 { font-size: 18px; overflow-wrap: anywhere; }
.competition-card h3 { font-size: 16px; overflow-wrap: anywhere; }
.competition-panel > * + *, .competition-card > * + * { margin-top: 10px; }
.competition-empty { text-align: center; padding: 24px 14px; color: var(--muted); }
.competition-feedback { margin-block: 12px; border-radius: 9px; padding: 10px 12px; background: #e7f1ff; color: #1b427d; white-space: pre-wrap; }
.competition-feedback.error, .competition-form-error { color: #9b2338; background: #fff0f3; }
.competition-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr)); gap: 12px; }
.competition-list { display: grid; gap: 9px; }
.competition-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.competition-row > .competition-actions { justify-content: end; }
.competition-row > :first-child:not(input) { grid-column: 1 / span 2; }
.competition-event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 25%) minmax(292px, max-content);
  align-items: center;
  gap: 14px;
}
.competition-event-row > * + * { margin-top: 0; }
.competition-event-label { min-width: 0; overflow-wrap: anywhere; }
.competition-event-label h3 { margin-block: 4px 2px; }
.competition-event-label .competition-actions { gap: 5px; }
.competition-event-actions { justify-content: flex-end; gap: 6px; }
.competition-event-actions .competition-button { padding-inline: 10px; font-size: 13px; white-space: nowrap; }
.competition-registration-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}
.competition-registration-counts > div {
  padding: 7px 5px;
  border-radius: 9px;
  background: #eaf0ff;
  color: #24488f;
  text-align: center;
}
.competition-registration-counts dt { font-size: 12px; font-weight: 650; }
.competition-registration-counts dd { margin: 0; font-size: 23px; font-weight: 780; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.competition-registration-counts dd small { font-size: 12px; font-weight: 650; }
.competition-registration-counts > .competition-registration-pending { color: #8a4d09; background: #fff2db; }
.competition-registration-counts > .competition-registration-neutral { color: #536984; background: #eef2f6; }
.competition-event-more { display: none; position: relative; }
.competition-event-more > summary { list-style: none; cursor: pointer; }
.competition-event-more > summary::-webkit-details-marker { display: none; }
.competition-event-more > summary:focus-visible { outline: 3px solid #7c9ffc; outline-offset: 2px; }
.competition-event-more > div {
  position: absolute; z-index: 1; right: 0; top: calc(100% + 4px);
  display: grid; gap: 5px; min-width: 114px; padding: 5px;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px #132d5126; background: #fff;
}
.competition-muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.competition-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.competition-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.competition-kpis div { border: 1px solid var(--line); background: white; border-radius: 11px; padding: 11px 12px; }
.competition-kpis strong { display: block; font-size: 23px; color: var(--blue); font-variant-numeric: tabular-nums; }
.competition-kpis small { color: var(--muted); font-size: 12px; }
.competition-filter, .competition-fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); align-items: end; }
.competition-filter { margin-bottom: 14px; }
.competition-filter-layer, .competition-filter-options { display: contents; }
.competition-filter-trigger, .competition-filter-close { display: none; }
.competition-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.competition-wide { grid-column: 1 / -1; }
.competition-filter label, .competition-fields label, .competition-form > label { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
.competition-check { display: flex !important; align-items: center; gap: 8px !important; font-size: 14px; }
.competition-filter input, .competition-filter select, .competition-form input:not([type="checkbox"]),
.competition-form textarea, .competition-form select {
  border: 1px solid #cbd8ea; border-radius: 8px; background: white; color: #172f50; width: 100%; min-width: 0; padding: 9px 10px;
  min-height: 42px; font-size: 16px;
}
.competition-form input[type="checkbox"], .competition-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); }
.competition-form textarea { resize: vertical; }
.competition-filter summary { cursor: pointer; display: none; }
.competition-pagination { display: flex; align-items: center; justify-content: end; gap: 8px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; }
.competition-dialog {
  border: 0; padding: 0; border-radius: 15px; width: min(760px, calc(100% - 30px)); max-height: 90dvh; color: inherit;
  background: white; box-shadow: 0 20px 80px #0a213d55;
}
.competition-dialog::backdrop { background: #13254177; }
.competition-dialog header, .competition-dialog footer { background: white; padding: 13px 18px; display: flex; align-items: center; gap: 10px; justify-content: space-between; z-index: 1; }
.competition-dialog header { position: sticky; top: 0; border-bottom: 1px solid var(--line); }
.competition-dialog header h2 { font-size: 20px; overflow-wrap: anywhere; }
.competition-dialog footer { position: sticky; bottom: 0; border-top: 1px solid var(--line); justify-content: end; flex-wrap: wrap; }
.competition-dialog-body { padding: 16px 18px; display: grid; gap: 13px; }
.competition-dialog-body > * { min-width: 0; }
.competition-form fieldset { border: 1px solid var(--line); border-radius: 11px; padding: 12px; min-width: 0; }
.competition-form legend { padding: 0 5px; color: var(--navy); font-weight: 750; }
.competition-form-error { border-radius: 8px; padding: 9px; white-space: pre-wrap; }
.competition-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.competition-files li { background: var(--tint); padding: 7px 9px; border-radius: 7px; display: flex; align-items: center; justify-content: space-between; gap: 7px; overflow-wrap: anywhere; }
.competition-files li > span { min-width: 0; }
.competition-files .competition-button { min-height: 34px; padding: 4px 7px; }
.competition-timeline { border-inline-start: 2px solid #dbe6f9; padding-inline-start: 12px; }
.competition-timeline > * + * { margin-top: 10px; }
.competition-details { display: grid; gap: 8px; }
.competition-details dt { font-size: 12px; color: var(--muted); }
.competition-details dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.competition-track { padding: 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; }
@media (max-width: 900px) {
  .competition-event-row { grid-template-columns: minmax(0, 1fr) minmax(200px, 32%); gap: 10px; }
  .competition-event-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .competition-shell, .competition-top-inner { padding-inline: 12px; }
  .competition-top-inner { min-height: 59px; }
  .competition-brand { font-size: 14px; gap: 7px; }
  .competition-brand img { width: 28px; height: 28px; }
  .competition-top .competition-button { font-size: 12px; padding-inline: 8px; }
  .competition-shell { padding-top: 12px; }
  .competition-hero { padding: 17px 14px; border-radius: 12px; }
  .competition-hero p { font-size: 12px; }
  .competition-hero .competition-button { padding-inline: 8px; white-space: nowrap; }
  .competition-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-block: 10px; }
  html[data-app-role="student"] .competition-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .competition-tabs:has([data-value="events"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .competition-tabs:has([data-value="events"]) button { min-height: 44px; padding-inline: 2px; font-size: clamp(12px, 3.5vw, 14px); }
  .competition-tabs button { padding-inline: 5px; }
  .competition-panel, .competition-card { padding: 11px; }
  .competition-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competition-filter:has(.competition-filter-layer) { grid-template-columns: minmax(0, 1fr) auto; }
  .competition-filter-trigger { display: flex; gap: 5px; }
  .competition-filter-trigger .competition-button { padding-inline: 8px; }
  .competition-filter-layer[data-open="false"] { display: none; }
  .competition-filter-layer[data-open="true"] {
    position: fixed; z-index: 2; inset: auto 0 0; display: grid; gap: 12px;
    border-radius: 16px 16px 0 0; background: white; padding: 14px 14px max(14px, env(safe-area-inset-bottom));
    box-shadow: 0 0 0 100vmax #13254177; max-height: 85dvh; overflow: auto;
  }
  .competition-filter-close { display: inline-flex; justify-self: end; }
  .competition-filter-options { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competition-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competition-row { grid-template-columns: auto minmax(0, 1fr); }
  .competition-row > .competition-actions { grid-column: 1 / -1; justify-content: start; }
  .competition-event-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .competition-event-actions > .competition-button { flex: 1; }
  .competition-event-actions .competition-button { min-height: 44px; padding-inline: 7px; }
  .competition-event-wide-action { display: none; }
  .competition-event-more { display: block; }
  .competition-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 93dvh; }
  .competition-dialog footer { padding-bottom: max(13px, env(safe-area-inset-bottom)); }
  .competition-dialog header, .competition-dialog footer, .competition-dialog-body { padding-inline: 12px; }
}
