:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eef3f7;
  --text: #17212f;
  --muted: #5a687a;
  --line: #dbe3ec;
  --accent: #0f8ea8;
  --accent-strong: #0b637b;
  --amber: #d2871d;
  --charcoal: #1b2532;
  --shadow: 0 18px 50px rgba(23, 33, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    "Inter",
    "PingFang SC",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 40px;
  border-bottom: 1px solid rgba(219, 227, 236, 0.86);
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--charcoal);
  font-size: 14px;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 6px;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-strong);
}

.hero {
  position: relative;
  min-height: 680px;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: #ffffff;
  background: #111923;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(12, 18, 27, 0.92) 0%, rgba(12, 18, 27, 0.72) 42%, rgba(12, 18, 27, 0.26) 100%),
    linear-gradient(180deg, rgba(12, 18, 27, 0.08) 0%, rgba(12, 18, 27, 0.72) 100%);
}

.hero-content {
  position: relative;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 72px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #72d6e6;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 54px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  font-weight: 800;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.button:hover {
  transform: translateY(-1px);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 860px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(13, 23, 35, 0.62);
  backdrop-filter: blur(14px);
}

.hero-facts div {
  padding: 18px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-facts div:last-child {
  border-right: 0;
}

.hero-facts dt {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.hero-facts dd {
  margin: 0;
  font-weight: 800;
}

.section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 86px 0;
}

.section.muted {
  width: 100%;
  padding-right: max(24px, calc((100% - 1120px) / 2));
  padding-left: max(24px, calc((100% - 1120px) / 2));
  background: var(--surface-strong);
}

.section-heading {
  margin-bottom: 32px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 46px;
  align-items: start;
}

.two-column p {
  color: var(--muted);
  font-size: 17px;
}

.metric-grid,
.panel-grid,
.timeline {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric,
.panel,
.timeline article,
.code-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  padding: 24px;
}

.metric span {
  display: block;
  margin-bottom: 24px;
  color: var(--amber);
  font-weight: 900;
}

.metric strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.metric p,
.panel p,
.timeline p,
.steps p,
.code-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.timeline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.timeline article {
  min-height: 230px;
  padding: 26px;
}

.timeline span {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  min-height: 210px;
  padding: 26px;
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  counter-increment: step;
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 26px;
  color: var(--amber);
  font-weight: 900;
}

.panel-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 28px;
}

.code-section {
  padding-top: 48px;
}

.code-card {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(440px, 1.14fr);
  gap: 30px;
  align-items: center;
  padding: 32px;
}

pre {
  margin: 0;
  overflow-x: auto;
  border-radius: 8px;
  background: #101923;
  color: #d7f8ff;
}

code {
  display: block;
  padding: 22px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
}

.contact {
  padding-top: 44px;
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.contact-list a,
.contact-list span {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 40px;
  color: #d4dde7;
  background: var(--charcoal);
}

.footer a {
  color: #ffffff;
  font-weight: 800;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 24px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    min-height: 720px;
  }

  h1 {
    font-size: 46px;
  }

  .two-column,
  .code-card {
    grid-template-columns: 1fr;
  }

  .timeline,
  .steps,
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: auto;
  }

  .brand {
    max-width: 100%;
  }

  .hero-content,
  .section {
    width: min(100% - 32px, 1120px);
  }

  .hero {
    min-height: 780px;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(12, 18, 27, 0.95) 0%, rgba(12, 18, 27, 0.82) 100%),
      linear-gradient(180deg, rgba(12, 18, 27, 0.04) 0%, rgba(12, 18, 27, 0.78) 100%);
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 28px;
  }

  .hero-copy {
    font-size: 17px;
  }

  .hero-facts,
  .metric-grid,
  .timeline,
  .steps,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .hero-facts div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .hero-facts div:last-child {
    border-bottom: 0;
  }

  .section {
    padding: 64px 0;
  }

  .section.muted {
    padding-right: 16px;
    padding-left: 16px;
  }

  .code-card {
    padding: 22px;
  }

  .footer {
    flex-direction: column;
    padding: 24px 16px;
  }
}

/* ================================================================
   账号体系：登录 / 注册 / 队伍信息页
   ================================================================ */

.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 72px - 88px);
  padding: 48px 20px 72px;
}

.auth-card {
  width: min(560px, 100%);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card--wide {
  width: min(760px, 100%);
}

.auth-card h1 {
  margin-bottom: 10px;
  font-size: 32px;
}

.auth-sub {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 15px;
}

.auth-sub strong {
  color: var(--text);
}

.member-tip {
  margin: -14px 0 18px;
  font-size: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
}

.field .req {
  color: #d64545;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
}

.field input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(15, 142, 168, 0.25);
}

.field input::placeholder {
  color: #9aa7b8;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 64px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent-strong);
}

.field-error {
  margin: 6px 0 0;
  color: #d64545;
  font-size: 13px;
}

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 16px;
}

.forgot-row a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.forgot-row a:hover {
  color: var(--accent);
}

.btn-code {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.btn-code:hover {
  background: rgba(15, 142, 168, 0.08);
}

.btn-code:disabled {
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  background: var(--surface-strong);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 6px;
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
}

.btn-add {
  min-height: 40px;
  padding: 0 16px;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn-add:hover {
  background: rgba(15, 142, 168, 0.08);
}

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.member-actions {
  display: flex;
  align-items: center;
}

.btn-remove {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(214, 69, 69, 0.4);
  border-radius: 6px;
  background: transparent;
  color: #d64545;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-remove:hover {
  background: rgba(214, 69, 69, 0.08);
}

.btn-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 22px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.btn-submit:hover {
  background: var(--accent-strong);
}

.btn-submit:disabled {
  background: #7fb8c6;
  cursor: not-allowed;
}

.auth-switch {
  margin: 22px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 800;
}

.form-error,
.form-success {
  display: none;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
}

.form-error {
  border: 1px solid rgba(214, 69, 69, 0.4);
  background: #fdf0f0;
  color: #b33030;
}

.form-success {
  border: 1px solid rgba(39, 151, 83, 0.4);
  background: #eefaf2;
  color: #1d7a41;
}

.form-error.show,
.form-success.show {
  display: block;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .code-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .code-row .btn-code {
    width: 100%;
  }

  .member-row {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 14px;
  }

  .member-actions {
    justify-content: flex-end;
  }

  .auth-card {
    padding: 26px 20px;
  }
}

/* ================================================================
   管理员后台
   ================================================================ */

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.back-home:hover {
  color: var(--accent);
}

/* 排行榜：前三名奖牌与高亮 */
.ranking-table .rank-cell {
  width: 80px;
}

.medal {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.medal-gold {
  background: linear-gradient(135deg, #f7d774, #d9a520);
}

.medal-silver {
  background: linear-gradient(135deg, #e3e8ee, #9aa7b8);
}

.medal-bronze {
  background: linear-gradient(135deg, #e8b08a, #b5784a);
}

.ranking-table tr.rank-1 td {
  background: #fffbe8;
}

.ranking-table tr.rank-2 td {
  background: #f6f8fb;
}

.ranking-table tr.rank-3 td {
  background: #fdf4ee;
}

.ranking-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 32px 20px;
}

.admin-login-card {
  width: min(420px, 100%);
}

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--charcoal);
  color: #fff;
}

.admin-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.admin-brand {
  font-weight: 800;
}

.admin-nav {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.admin-nav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.admin-wrap {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.admin-heading h1 {
  margin: 0;
  font-size: 28px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-tab {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table thead th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: var(--surface-strong);
  white-space: nowrap;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: #fafcfe;
}

.empty-cell {
  padding: 40px !important;
  text-align: center !important;
  color: var(--muted);
}

.actions-cell {
  white-space: nowrap;
}

.action-btn {
  min-height: 32px;
  padding: 0 12px;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.action-ok:hover {
  border-color: #1d7a41;
  color: #1d7a41;
}

.action-no:hover,
.action-danger:hover {
  border-color: #b33030;
  color: #b33030;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-pending {
  background: #eef1f5;
  color: #5a687a;
}

.badge-approved {
  background: #e4f5ea;
  color: #1d7a41;
}

.badge-rejected {
  background: #fdecec;
  color: #b33030;
}

/* 队伍页审核状态横幅 */
.status-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  font-size: 14px;
  font-weight: 700;
}

.status-banner.status-approved {
  border-color: rgba(29, 122, 65, 0.4);
  background: #eefaf2;
  color: #1d7a41;
}

.status-banner.status-rejected {
  border-color: rgba(179, 48, 48, 0.4);
  background: #fdf0f0;
  color: #b33030;
}

.banner-reason {
  font-weight: 400;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 27, 0.5);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.modal-panel--wide {
  width: min(720px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 22px;
}

.modal-body h4 {
  margin: 20px 0 10px;
}

.modal-actions {
  margin-top: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 16px;
  margin: 0;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 13px;
}

.detail-grid dd {
  margin: 0;
}

@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .admin-bar-inner,
  .admin-wrap {
    width: calc(100% - 32px);
  }

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

