@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

:root {
  --pink:   #e8459a;
  --purple: #9b59d8;
  --deep:   #7c3aed;
  --grad:   linear-gradient(135deg, #e8459a 0%, #9b59d8 50%, #6d28d9 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f7f4fc;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 背景光晕 ── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.bg-orb-1 {
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232,69,154,0.07) 0%, transparent 70%);
  animation: floatOrb 8s ease-in-out infinite;
}
.bg-orb-2 {
  bottom: -150px; right: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(109,40,217,0.08) 0%, transparent 70%);
  animation: floatOrb 10s ease-in-out infinite reverse;
}
.bg-orb-3 {
  top: 45%; left: 50%;
  width: 340px; height: 340px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(155,89,216,0.05) 0%, transparent 70%);
  animation: floatOrb 13s ease-in-out infinite 2s;
}
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(25px, 18px) scale(1.06); }
}

/* ── Header ── */
header {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(200,170,240,0.25);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(140,80,210,0.07);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  font-size: clamp(14px, 3vw, 19px);
  font-weight: 800;
  flex-shrink: 0;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
}
.nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── 按钮 ── */
.btn-ghost {
  border: 1.5px solid rgba(155,89,216,0.3);
  border-radius: 22px;
  padding: 6px 14px;
  font-size: clamp(11px, 2vw, 13.5px);
  font-weight: 500;
  color: #7c5cb8;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.btn-ghost:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(232,69,154,0.06);
  transform: translateY(-1px);
}

.btn-primary {
  border-radius: 22px;
  padding: 7px 14px;
  font-size: clamp(11px, 2vw, 13.5px);
  font-weight: 600;
  color: white;
  background: var(--grad);
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(155,89,216,0.4);
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.25s;
  border-radius: 22px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(155,89,216,0.5);
}
.btn-primary:hover::after {
  background: rgba(255,255,255,0.1);
}

/* ── Banner ── */
.banner-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 36px rgba(140,60,200,0.18);
  transition: transform 0.4s cubic-bezier(.4,0,.2,1), box-shadow 0.4s;
  margin-bottom: 22px;
}
.banner-wrap:hover {
  transform: translateY(-3px) scale(1.005);
  box-shadow: 0 16px 48px rgba(140,60,200,0.26);
}
.banner-wrap img {
  width: 100%;
  display: block;
  border-radius: 18px;
}

/* ── Section ── */
.section-wrap {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 22px 20px 26px;
  margin-bottom: 18px;
  border: 1px solid rgba(200,170,240,0.22);
  box-shadow: 0 4px 24px rgba(140,80,200,0.07);
  position: relative;
  z-index: 1;
  animation: fadeSlideUp 0.55s cubic-bezier(.4,0,.2,1) both;
}
.section-wrap:nth-child(2) { animation-delay: 0.08s; }
.section-wrap:nth-child(3) { animation-delay: 0.16s; }
.section-wrap:nth-child(4) { animation-delay: 0.24s; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(232,69,154,0.12), rgba(155,89,216,0.12));
  border: 1px solid rgba(155,89,216,0.18);
  border-radius: 30px;
  padding: 5px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #7c3aed;
  margin-bottom: 6px;
}
.section-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: 1; box-shadow: 0 0 0 0   rgba(232,69,154,0.5); }
  50%       { transform: scale(1.35); opacity: 0.8; box-shadow: 0 0 0 5px rgba(232,69,154,0); }
}

.section-divider {
  height: 1.5px;
  background: linear-gradient(to right, rgba(232,69,154,0.35), rgba(155,89,216,0.3), transparent);
  margin: 14px 0 20px;
  border-radius: 2px;
}

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 700px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .cards-grid { grid-template-columns: 1fr; } }

a.card-link {
  display: block;
  text-decoration: none;
  border-radius: 16px;
}

/* ── Card ── */
.card {
  background: white;
  border-radius: 16px;
  padding: 20px 16px 22px;
  border: 1.5px solid rgba(200,170,240,0.2);
  box-shadow: 0 2px 14px rgba(140,80,200,0.06);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.32s cubic-bezier(.4,0,.2,1);
  height: 100%;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.38s cubic-bezier(.4,0,.2,1);
  border-radius: 16px 16px 0 0;
}
.card::after {
  content: '';
  position: absolute;
  bottom: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155,89,216,0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s, transform 0.35s;
  transform: scale(0.5);
  pointer-events: none;
}
a.card-link:hover .card {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 14px 36px rgba(140,80,200,0.16);
  border-color: rgba(155,89,216,0.35);
}
a.card-link:hover .card::before { transform: scaleX(1); }
a.card-link:hover .card::after  { opacity: 1; transform: scale(1.5); }

.card-arrow {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(232,69,154,0.1), rgba(109,40,217,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  color: #9b59d8;
  font-size: 13px;
  font-weight: 700;
}
a.card-link:hover .card-arrow {
  background: var(--grad);
  color: white;
  transform: rotate(45deg) scale(1.15);
  box-shadow: 0 4px 12px rgba(155,89,216,0.4);
}

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.tag {
  display: inline-block;
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-init   { background: #fce9f3; color: #c44b9a; }
.tag-python { background: #eef0ff; color: #4f5de8; }
.tag-cpp    { background: #e6faf3; color: #1a9e6e; }

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e1233;
  margin-bottom: 8px;
  line-height: 1.4;
  padding-right: 28px;
}
.card-desc {
  font-size: 12px;
  color: #9e93b8;
  line-height: 1.78;
}

/* ── 知识文档区域 ── */
.docs-row {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(200,170,240,0.22);
}
.docs-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #9e93b8;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}
.docs-label::before {
  content: '';
  display: inline-block;
  width: 16px; height: 1.5px;
  background: linear-gradient(to right, rgba(232,69,154,0.4), rgba(155,89,216,0.4));
  border-radius: 2px;
}
.docs-label::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(to right, rgba(155,89,216,0.15), transparent);
  border-radius: 2px;
}
.docs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(232,69,154,0.06), rgba(155,89,216,0.08));
  border: 1px solid rgba(155,89,216,0.18);
  font-size: 12.5px;
  font-weight: 600;
  color: #7c3aed;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.doc-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: 30px;
}
.doc-chip:hover::before { opacity: 1; }
.doc-chip:hover {
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(155,89,216,0.35);
  transform: translateY(-2px);
}
.doc-chip:hover .doc-icon { color: white; }
.doc-icon {
  font-size: 13px;
  position: relative;
  z-index: 1;
  color: #c084fc;
  transition: color 0.25s;
}
.doc-chip span { position: relative; z-index: 1; }

/* ── Coming Soon ── */
.coming-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.coming-title {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.coming-desc {
  font-size: 13px;
  color: #9e93b8;
  line-height: 1.8;
  max-width: 480px;
}
.btn-coming {
  background: var(--grad);
  color: white;
  border-radius: 30px;
  padding: 11px 24px;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: default;
  box-shadow: 0 6px 22px rgba(155,89,216,0.35);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 6px 22px rgba(155,89,216,0.35); }
  50%       { box-shadow: 0 8px 30px rgba(232,69,154,0.5); }
}
.btn-coming::before {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  animation: sweep 2.8s infinite;
}
@keyframes sweep {
  0%   { left: -60%; }
  100% { left: 140%; }
}

/* ── Modal 通用 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,10,50,0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── 赛事介绍 Modal ── */
.modal-box {
  background: white;
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(100,30,180,0.25);
  transform: translateY(30px) scale(0.96);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  background: var(--grad);
  padding: 22px 24px 18px;
  position: relative;
  flex-shrink: 0;
}
.modal-header-tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.modal-header h2 {
  font-size: clamp(17px, 4vw, 22px);
  font-weight: 800;
  color: white;
  line-height: 1.4;
}
.modal-header p {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-top: 5px;
  line-height: 1.6;
}
.modal-close {
  position: absolute;
  top: 16px; right: 18px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.35); }

.modal-body {
  overflow-y: auto;
  padding: 22px 22px 28px;
  flex: 1;
}
.modal-body::-webkit-scrollbar       { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: #f3eeff; border-radius: 10px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(155,89,216,0.3); border-radius: 10px; }

/* Modal 内容 */
.m-section       { margin-bottom: 24px; }
.m-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 800; color: #1e1233; margin-bottom: 14px;
}
.m-section-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad); color: white;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.m-text {
  font-size: 13px; color: #555; line-height: 1.85; margin-bottom: 10px;
}
.m-info-card {
  background: linear-gradient(135deg, #fdf2f8, #f5f0ff);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid rgba(200,170,240,0.25);
}
.m-info-card-title {
  font-size: 13px; font-weight: 700; color: #7c3aed;
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.m-info-card-title::before {
  content: '';
  display: inline-block; width: 4px; height: 14px;
  background: var(--grad); border-radius: 2px; flex-shrink: 0;
}
.m-info-card p,
.m-info-card li { font-size: 12.5px; color: #555; line-height: 1.85; }
.m-info-card ol { padding-left: 18px; }

.m-stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 14px;
}
@media (max-width: 400px) { .m-stats-row { grid-template-columns: 1fr 1fr; } }

.m-stat-box {
  background: white; border-radius: 12px;
  border: 1px solid rgba(200,170,240,0.25);
  padding: 11px 10px; text-align: center;
  box-shadow: 0 2px 10px rgba(140,80,200,0.06);
}
.m-stat-box .val {
  font-size: 13px; font-weight: 700; margin-bottom: 3px; line-height: 1.4;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.m-stat-box .lbl { font-size: 11px; color: #aaa; }

.m-step { display: flex; gap: 10px; margin-bottom: 9px; align-items: flex-start; }
.m-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(232,69,154,0.13), rgba(109,40,217,0.13));
  color: #7c3aed; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.m-step-text { font-size: 12.5px; color: #555; line-height: 1.85; }

.m-divider {
  height: 1px;
  background: linear-gradient(to right, rgba(232,69,154,0.2), rgba(155,89,216,0.2), transparent);
  margin: 18px 0;
}

.m-score-table {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px; margin-top: 10px;
}
.m-score-table th {
  background: linear-gradient(135deg, rgba(232,69,154,0.09), rgba(109,40,217,0.09));
  color: #7c3aed; font-weight: 700;
  padding: 9px 10px; text-align: center;
  border-bottom: 1.5px solid rgba(155,89,216,0.15);
}
.m-score-table td {
  padding: 9px 10px; text-align: center; color: #555;
  border-bottom: 1px solid rgba(200,170,240,0.15);
}
.m-score-table tr:last-child td { border-bottom: none; }
.m-score-table tr:nth-child(even) td { background: rgba(245,240,255,0.5); }

/* ── 微信二维码 Modal ── */
.qr-box {
  background: white; border-radius: 24px;
  width: 100%; max-width: 300px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(100,30,180,0.25);
  transform: translateY(30px) scale(0.92);
  transition: transform 0.38s cubic-bezier(.34,1.56,.64,1);
  text-align: center;
}
.modal-overlay.active .qr-box { transform: translateY(0) scale(1); }

.qr-header {
  background: var(--grad);
  padding: 20px 24px 16px;
  position: relative;
}
.qr-header h3 { font-size: 18px; font-weight: 800; color: white; }
.qr-header p  { font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 4px; }

.qr-body { padding: 22px 20px 24px; }
.qr-img-wrap {
  width: 190px; height: 190px;
  margin: 0 auto 14px;
  border-radius: 16px; overflow: hidden;
  border: 3px solid transparent;
  background: linear-gradient(white, white) padding-box, var(--grad) border-box;
  box-shadow: 0 6px 24px rgba(155,89,216,0.18);
  display: flex; align-items: center; justify-content: center;
}
.qr-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 13px; display: block;
}
.qr-name {
  font-size: 15px; font-weight: 700; margin-bottom: 4px;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.qr-tip { font-size: 12px; color: #9e93b8; line-height: 1.7; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 24px 0 32px;
  font-size: 12px; color: #b8aad0;
  position: relative; z-index: 1;
}
footer span {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  font-weight: 600;
}

/* ── Main ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
  position: relative; z-index: 1;
}

@media (min-width: 640px) {
  main            { padding: 32px 24px; }
  .header-inner   { padding: 0 28px; }
  .section-wrap   { padding: 26px 28px 30px; margin-bottom: 22px; }
}