/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --header-offset: 80px;
  --app-vh: 1vh;
  --app-vh-100: 100vh;
}

html, body {
  height: 100%;
  overflow: hidden; /* 禁止原生滚动，使用容器滚动 */
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  background-color: #4A3E96;
  width: 100%;
  overflow-x: hidden;
}

/* 全屏滚动容器 */
.scroll-container {
  height: var(--app-vh-100, 100vh);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

/* 各自适应屏幕区域 */
.section {
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  scroll-margin-top: var(--header-offset, 80px);
}

/* 头部样式 */
.header {
  height: 80px;
  background: rgba(74, 62, 150, 0.85);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* Logo 样式 */
.logo {
  display: flex;
  align-items: center;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.logo-top,
.logo-bottom {
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}

.logo-prefix {
  display: inline-block;
  width: 1em;
  margin-right: 8px;
  letter-spacing: 0;
}

.logo-main {
  font-size: 16px;
  letter-spacing: 6px;
}

.logo-bottom {
  font-size: 14px;
}

.logo-domain {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
}

/* 导航菜单 */
.nav {
  height: 100%;
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.nav-indicator {
  position: absolute;
  bottom: 20px;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  z-index: 1;
  opacity: 0;
  left: 0;
}

.nav-list {
  display: flex;
  list-style: none;
  height: 100%;
  position: relative;
  z-index: 2;
  flex-wrap: nowrap;
}

.nav-item {
  height: 100%;
  flex: 0 0 auto;
}

.nav-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 25px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  position: relative;
  transition: all 0.3s;
}

.nav-item a:hover {
  color: #fff;
}

.nav-item.active a {
  color: #fff;
  font-weight: bold;
}

/* 头部右侧操作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.divider {
  width: 1px;
  height: 16px;
  background-color: rgba(255, 255, 255, 0.3);
}

.action-link {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  white-space: nowrap;
  transition: opacity 0.3s;
}
.action-link:hover {
  opacity: 0.8;
}
.action-link i {
  font-size: 18px;
}

.taobao-icon {
  font-size: 18px;
}

.action-btn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  gap: 6px;
  transition: all 0.3s;
}
.action-btn:hover {
  background: #fff;
  color: #4A3E96;
}
.action-btn i {
  font-size: 16px;
}

.action-btn span {
  white-space: nowrap;
}

/* 下拉展示二维码 */
.action-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.action-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}
.dropdown-content {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: all 0.3s ease;
  z-index: 200;
  pointer-events: none;
}
.action-dropdown:hover .dropdown-content {
  display: flex;
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* 仅“联系我们”二维码：改为与按钮右对齐 */
.action-dropdown-contact .dropdown-content {
  left: auto;
  right: 0;
  transform: translate(0, 10px);
}

.action-dropdown-contact:hover .dropdown-content {
  transform: translate(0, 0);
}

.dropdown-content img {
  width: 120px;
  height: 120px;
  margin-bottom: 10px;
}
.dropdown-content p {
  color: #333;
  font-size: 12px;
  text-align: center;
  margin: 0;
}

/* 第一屏布局 */
.section-home {
  display: flex;
  flex-direction: column;
  padding-top: var(--header-offset, 80px); /* 为固定头部留出空间 */
}

/* 英雄区域 */
.hero {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: 64px;
  font-weight: bold;
  letter-spacing: 4px;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 56px;
  font-weight: bold;
  letter-spacing: 4px;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-desc {
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 40px;
  opacity: 0.9;
}

.hero-btn {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  padding: 12px 40px;
  border-radius: 30px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-btn:hover {
  background-color: #fff;
  color: #333;
}

/* 数据统计区域 */
.stats {
  flex: 0 0 168px;
  background-color: #4A3E96;
  display: flex;
  align-items: center;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
}

.stat-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.stat-icon {
  width: 4px;
  height: 24px;
  background-color: #fff;
  margin-top: 8px;
}

.stat-number {
  font-size: 36px;
  font-weight: bold;
  line-height: 1;
}

.stat-text {
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.6;
  margin-top: 6px;
}

/* 内容区域公共样式 */
.section-content {
  background-color: #F8F9FA;
  color: #333;
  padding-top: var(--header-offset, 80px); /* Header高度 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-content:nth-child(even) {
  background-color: #fff;
}

.section-inner {
  max-width: 1200px;
  width: 100%;
  padding: 40px;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.view-more-btn {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #4A3E96;
  text-decoration: none;
  font-size: 15px;
  font-weight: bold;
  transition: all 0.3s;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(74, 62, 150, 0.05);
}

.view-more-btn:hover {
  background: #4A3E96;
  color: #fff;
  gap: 8px;
}

.section-title {
  font-size: 40px;
  color: #2c2560;
  margin-bottom: 15px;
  font-weight: bold;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: #4A3E96;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 18px;
  color: #666;
  margin-top: 10px;
}

/* 栅格布局 (服务和科目) */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
}

.subjects-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.grid-card {
  background: #fff;
  border-radius: 16px;
  padding: 35px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(74, 62, 150, 0.05);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid rgba(74, 62, 150, 0.05);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.grid-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, #4A3E96, #6b5cd6);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.grid-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(74, 62, 150, 0.15);
  border-color: transparent;
}

.grid-card:hover::before {
  opacity: 1;
}

.grid-card i {
  font-size: 48px;
  color: #4A3E96;
  margin-bottom: 20px;
  display: inline-block;
  transition: all 0.4s ease;
}

.grid-card:hover i {
  color: #fff;
  transform: scale(1.1);
}

.grid-card span {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  transition: color 0.4s ease;
  display: block;
}

.grid-card:hover span {
  color: #fff;
}

/* 大赛信息区域 */
.section-contests {
  background-color: #fff;
}

.contests-container {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

/* 左侧大图卡片 */
.contest-main {
  flex: 2;
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
  text-decoration: none;
  color: inherit;
}

.contest-main:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.contest-main .contest-cover {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.contest-main-content {
  display: flex;
  flex: 1;
}

.contest-date-block {
  width: 120px;
  background-color: #4A3E96;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.contest-date-block .day {
  font-size: 48px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 5px;
}

.contest-date-block .month {
  font-size: 14px;
  opacity: 0.9;
}

.contest-main-text {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contest-main-text h3 {
  font-size: 20px;
  color: #333;
  margin-bottom: 15px;
  font-weight: bold;
}

.contest-main-text p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

/* 右侧小列表 */
.contest-list {
  flex: 1;
  display: flex;
  gap: 20px;
}

.contest-item {
  flex: 1;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  text-decoration: none;
}

.contest-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.contest-item.highlight {
  background-color: #5952B8;
  color: #fff;
}

.contest-item .day {
  font-size: 42px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 5px;
  color: #4A3E96;
}

.contest-item.highlight .day {
  color: #fff;
}

.contest-item .month {
  font-size: 14px;
  color: #999;
  margin-bottom: 25px;
}

.contest-item.highlight .month {
  color: rgba(255,255,255,0.8);
}

.contest-item h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 15px;
  text-align: left;
  font-weight: bold;
  line-height: 1.4;
}

.contest-item.highlight h3 {
  color: #fff;
}

.contest-item p {
  font-size: 13px;
  color: #666;
  text-align: left;
  line-height: 1.6;
}

.contest-item.highlight p {
  color: rgba(255,255,255,0.8);
}

/* 联系我们区域 */
.section-contact {
  background-color: #F8F9FA;
}

.contact-container {
  display: flex;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  overflow: hidden;
}

.contact-info {
  flex: 1;
  padding: 50px;
  background-color: #4A3E96;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 30px;
  justify-content: center;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

.info-item i {
  font-size: 32px;
  color: rgba(255,255,255,0.8);
}

.info-content h4 {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 5px;
  font-weight: normal;
}

.info-content p {
  font-size: 18px;
  font-weight: bold;
}

.contact-qrs {
  flex: 1;
  padding: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.qr-card {
  text-align: center;
}

.qr-card img {
  width: 160px;
  height: 160px;
  margin-bottom: 15px;
  border: 1px solid #eee;
  padding: 5px;
  border-radius: 8px;
}

.qr-card p {
  font-size: 14px;
  color: #666;
}

@media (max-width: 1366px) {
  .header {
    height: auto;
    min-height: 80px;
    padding: 10px 0;
  }

  .header-container {
    height: auto;
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 0 16px;
  }

  .logo {
    width: 100%;
  }

  .nav {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-indicator {
    bottom: 4px;
  }

  .nav-list {
    height: auto;
    min-width: max-content;
    padding-bottom: 4px;
  }

  .nav-item {
    height: auto;
  }

  .nav-item a {
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
  }

  .action-btn {
    padding: 6px 12px;
  }

  .section-home {
    padding-top: var(--header-offset, 80px);
  }

  .section-content {
    padding-top: var(--header-offset, 80px);
  }

  .hero-title {
    font-size: 52px;
  }

  .hero-subtitle {
    font-size: 44px;
  }

  .stats-container {
    padding: 0 20px;
  }
}

@media (max-width: 1200px) {
  .header-container {
    padding: 0 16px;
  }

  .nav-item a {
    padding: 0 14px;
    font-size: 14px;
  }

  .header-actions {
    gap: 12px;
  }

  .action-btn {
    padding: 6px 12px;
  }

  .hero-title {
    font-size: 52px;
  }

  .hero-subtitle {
    font-size: 44px;
  }

  .stats-container {
    padding: 0 20px;
  }
}

@media (max-width: 992px) {
  .hero-title {
    font-size: 44px;
  }

  .hero-subtitle {
    font-size: 36px;
  }

  .hero-desc {
    margin-bottom: 28px;
  }

  .section-inner {
    padding: 32px 24px;
  }
}

@media (max-width: 768px) {
  .header {
    height: auto;
    min-height: 80px;
    padding: 8px 0 10px;
  }

  .header-container {
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding: 0 12px;
  }

  .logo {
    width: 100%;
  }

  .logo-main {
    letter-spacing: 1px;
    font-size: 15px;
  }

  .logo-domain {
    font-size: 16px;
  }

  .nav {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-indicator {
    display: none;
  }

  .nav-list {
    height: auto;
    min-width: max-content;
    gap: 4px;
    padding-bottom: 2px;
  }

  .nav-item {
    height: auto;
  }

  .nav-item a {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 16px;
  }

  .nav-item.active a {
    background: rgba(255, 255, 255, 0.16);
  }

  .header-actions .divider {
    display: none;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .action-link,
  .action-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 6px 8px;
    font-size: 12px;
  }

  .action-link {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
  }

  .action-link span,
  .action-btn span {
    display: inline-block;
    font-size: 12px;
    white-space: nowrap;
  }

  .action-link i,
  .action-btn i {
    font-size: 14px;
  }

  .action-dropdown {
    width: 100%;
  }

  .action-dropdown .action-btn {
    width: 100%;
  }

  .section {
    min-height: auto;
  }

  .section-home,
  .section-content {
    padding-top: var(--header-offset, 80px);
  }

  .hero {
    min-height: 62vh;
    padding: 36px 16px;
  }

  .hero-title {
    font-size: 36px;
    letter-spacing: 1px;
  }

  .hero-subtitle {
    font-size: 28px;
    letter-spacing: 1px;
  }

  .hero-desc {
    font-size: 14px;
    letter-spacing: 0;
  }

  .hero-btn {
    padding: 10px 24px;
    font-size: 14px;
  }

  .stats {
    flex: 0 0 auto;
    padding: 14px 0;
  }

  .stats-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0 16px;
  }

  .stat-item {
    gap: 10px;
  }

  .stat-number {
    font-size: 28px;
  }

  .stat-text {
    font-size: 13px;
  }

  .section-inner {
    padding: 24px 16px;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .section-title {
    font-size: 32px;
  }

  .section-subtitle {
    font-size: 15px;
    margin-top: 6px;
  }

  .view-more-btn {
    position: static;
    margin-top: 16px;
  }

  .grid-container,
  .subjects-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .grid-card {
    padding: 12px 4px;
    border-radius: 10px;
  }

  .grid-card:hover {
    transform: none;
  }

  .grid-card i {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .grid-card span {
    font-size: 12px;
    line-height: 1.2;
  }

  .contests-container {
    flex-direction: column;
  }

  .contest-main .contest-cover {
    height: 220px;
  }

  .contest-main-content {
    flex-direction: column;
  }

  .contest-date-block {
    width: 100%;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    padding: 14px;
  }

  .contest-main-text {
    padding: 20px;
  }

  .contest-list {
    flex-direction: column;
    gap: 14px;
  }

  .contest-item {
    padding: 20px 16px;
  }

  .contact-container {
    flex-direction: column;
  }

  .contact-info,
  .contact-qrs {
    padding: 24px 18px;
  }

  .contact-qrs {
    gap: 20px;
    flex-wrap: wrap;
  }

  .qr-card img {
    width: 140px;
    height: 140px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 10px;
  }

  .nav-item a {
    padding: 0 10px;
    font-size: 12px;
  }

  .header-actions {
    gap: 6px;
  }

  .action-link,
  .action-btn {
    padding: 6px 6px;
  }

  .action-link span,
  .action-btn span {
    font-size: 11px;
  }

  .hero-title {
    font-size: 30px;
  }

  .hero-subtitle {
    font-size: 24px;
  }

  .section-title {
    font-size: 28px;
  }

  .grid-container,
  .subjects-grid {
    gap: 8px;
  }

  .grid-card span {
    font-size: 11px;
  }

  .qr-card img {
    width: 124px;
    height: 124px;
  }
}

/* Mobile-Only profile (UA + viewport) */
body.is-mobile-device .header {
  height: auto;
  min-height: 80px;
  padding: 8px 0;
}

body.is-mobile-device .header-container {
  height: auto;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 8px;
  padding: 0 12px;
}

body.is-mobile-device .logo {
  width: 100%;
}

body.is-mobile-device .logo-main {
  letter-spacing: 1px;
  font-size: 14px;
}

body.is-mobile-device .logo-domain {
  font-size: 16px;
}

body.is-mobile-device .nav {
  width: 100%;
  height: auto;
  justify-content: flex-start;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body.is-mobile-device .nav::-webkit-scrollbar {
  display: none;
}

body.is-mobile-device .nav-indicator {
  display: none !important;
}

body.is-mobile-device .nav-list {
  height: auto;
  min-width: max-content;
  gap: 4px;
  padding-bottom: 2px;
}

body.is-mobile-device .nav-item {
  height: auto;
}

body.is-mobile-device .nav-item a {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 16px;
}

body.is-mobile-device .nav-item.active a {
  background: rgba(255, 255, 255, 0.16);
}

body.is-mobile-device .header-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.is-mobile-device .header-actions .divider {
  display: none;
}

body.is-mobile-device .action-link,
body.is-mobile-device .action-btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 6px 8px;
  font-size: 12px;
}

body.is-mobile-device .action-link {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
}

body.is-mobile-device .action-link span {
  display: inline;
  font-size: 12px;
  white-space: nowrap;
}

body.is-mobile-device .action-dropdown {
  width: 100%;
}

body.is-mobile-device .action-dropdown .action-btn {
  width: 100%;
}

body.is-mobile-device .section-home,
body.is-mobile-device .section-content {
  padding-top: var(--header-offset, 80px);
}

body.is-mobile-device .section-inner {
  padding: 20px 12px;
}

body.is-mobile-device .section-title {
  font-size: 28px;
}

body.is-mobile-device .section-subtitle {
  font-size: 14px;
  margin-top: 6px;
}

body.is-mobile-device .grid-container,
body.is-mobile-device .subjects-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.is-mobile-device .grid-card {
  border-radius: 10px;
  padding: 12px 4px;
}

body.is-mobile-device .grid-card:hover {
  transform: none;
}

body.is-mobile-device .grid-card i {
  font-size: 22px;
  margin-bottom: 6px;
}

body.is-mobile-device .grid-card span {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}

/* Mobile Header + Navigation Refinement */
.section-home,
.section-content {
  padding-top: var(--header-offset, 80px);
}

.subjects-grid .subject-more-card {
  display: none;
  border: 1px solid rgba(74, 62, 150, 0.08);
  outline: none;
  cursor: default;
  font-family: inherit;
  pointer-events: none;
  user-select: none;
}

.subjects-grid .subject-more-card i {
  font-size: 28px;
}

.subjects-grid .subject-more-card span {
  font-size: 18px;
}

@media (max-width: 768px) {
  .header {
    padding: 8px 0 10px;
  }

  .header-container {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo actions"
      "nav nav";
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
    padding: 0 10px;
  }

  .logo {
    grid-area: logo;
    min-width: 0;
  }

  .logo-main {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .logo-domain {
    font-size: 15px;
  }

  .nav {
    grid-area: nav;
    overflow: visible;
    justify-content: center;
  }

  .nav-indicator {
    display: block;
    bottom: 0;
  }

  .nav-list {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding-bottom: 6px;
  }

  .nav-item {
    flex: none;
    width: 100%;
  }

  .nav-item a {
    width: 100%;
    height: 34px;
    padding: 0 2px;
    border-radius: 0;
    font-size: 13px;
    line-height: 1;
  }

  .nav-item.active a {
    background: transparent;
  }

  .header-actions {
    grid-area: actions;
    width: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-end;
    align-items: center;
  }

  .action-link,
  .action-btn {
    width: auto;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 14px;
    font-size: 11px;
    gap: 4px;
  }

  .action-link span,
  .action-btn span {
    font-size: 11px;
  }

  .action-link i,
  .action-btn i {
    font-size: 12px;
  }

  .action-dropdown {
    width: auto;
  }

  .action-dropdown .action-btn {
    width: auto;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 8px;
    column-gap: 6px;
  }

  .logo-main {
    font-size: 12px;
    letter-spacing: 0.5px;
  }

  .logo-domain {
    font-size: 12px;
  }

  .nav-list {
    padding-bottom: 5px;
  }

  .nav-item a {
    font-size: 12px;
  }

  .header-actions {
    gap: 3px;
  }

  .action-link,
  .action-btn {
    padding: 4px 6px;
    font-size: 10px;
    gap: 3px;
  }

  .action-link span,
  .action-btn span {
    font-size: 10px;
  }
}

body.is-mobile-device .header-container {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "logo actions"
    "nav nav";
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  padding: 0 10px;
}

body.is-mobile-device .logo {
  grid-area: logo;
  min-width: 0;
}

body.is-mobile-device .nav {
  grid-area: nav;
  overflow: visible;
  justify-content: center;
}

body.is-mobile-device .nav-indicator {
  display: block !important;
  bottom: 0;
}

body.is-mobile-device .nav-list {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding-bottom: 6px;
}

body.is-mobile-device .nav-item {
  flex: none;
  width: 100%;
}

body.is-mobile-device .nav-item a {
  width: 100%;
  height: 34px;
  padding: 0 2px;
  border-radius: 0;
  font-size: 13px;
  line-height: 1;
}

body.is-mobile-device .nav-item.active a {
  background: transparent;
}

body.is-mobile-device .header-actions {
  grid-area: actions;
  width: auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
}

body.is-mobile-device .action-link,
body.is-mobile-device .action-btn {
  width: auto;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 14px;
  gap: 4px;
}

body.is-mobile-device .action-link span,
body.is-mobile-device .action-btn span {
  font-size: 11px;
}

body.is-mobile-device .action-link i,
body.is-mobile-device .action-btn i {
  font-size: 12px;
}

body.is-mobile-device .action-dropdown {
  width: auto;
}

body.is-mobile-device .action-dropdown .action-btn {
  width: auto;
}

body.is-mobile-device .subjects-grid .subject-more-card {
  display: block;
}

body.is-mobile-device .subjects-grid .subject-more-card i {
  font-size: 22px;
  margin-bottom: 6px;
  display: inline-block;
}

body.is-mobile-device .subjects-grid .subject-more-card span {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  display: block;
}

body.is-mobile-device .contests-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.is-mobile-device .contest-main .contest-cover {
  height: 150px;
}

body.is-mobile-device .contest-main-content {
  flex-direction: column;
}

body.is-mobile-device .contest-date-block {
  width: 100%;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
}

body.is-mobile-device .contest-date-block .day {
  font-size: 26px;
  margin-bottom: 0;
}

body.is-mobile-device .contest-date-block .month {
  font-size: 12px;
  margin-bottom: 0;
}

body.is-mobile-device .contest-main-text {
  padding: 12px 12px 14px;
}

body.is-mobile-device .contest-main-text h3 {
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.35;
  text-decoration: none;
}

body.is-mobile-device .contest-main-text p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  text-decoration: none;
}

body.is-mobile-device .contest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.is-mobile-device .contest-item {
  padding: 12px 10px;
}

body.is-mobile-device .contest-item .day {
  font-size: 28px;
  margin-bottom: 4px;
}

body.is-mobile-device .contest-item .month {
  margin-bottom: 10px;
  font-size: 12px;
}

body.is-mobile-device .contest-item h3 {
  font-size: 13px;
  margin-bottom: 8px;
}

body.is-mobile-device .contest-item p {
  font-size: 11px;
  line-height: 1.45;
}

/* Mobile viewport lock: every section fills one phone screen */
body.is-mobile-device .scroll-container {
  height: var(--app-vh-100, 100vh);
}

body.is-mobile-device .section {
  height: auto;
  min-height: var(--app-vh-100, 100vh);
  overflow: visible;
}

body.is-mobile-device .section-home {
  height: var(--app-vh-100, 100vh);
  min-height: var(--app-vh-100, 100vh);
  padding-top: var(--header-offset, 80px);
}

body.is-mobile-device .hero {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 16px;
}

body.is-mobile-device .stats {
  flex: 0 0 clamp(172px, calc(var(--app-vh, 1vh) * 25), 240px);
  padding: 14px 0;
}

body.is-mobile-device .section-content {
  height: auto;
  min-height: var(--app-vh-100, 100vh);
  padding-top: var(--header-offset, 80px);
  align-items: flex-start;
}

body.is-mobile-device .section-content .section-inner {
  height: auto;
  min-height: calc(var(--app-vh-100, 100vh) - var(--header-offset, 80px));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 14px;
}

body.is-mobile-device .section-contact .section-inner {
  padding-bottom: 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

body.is-mobile-device .section-contests .section-header {
  margin-bottom: 14px;
}

body.is-mobile-device .section-contests .section-subtitle {
  margin-top: 8px;
}

body.is-mobile-device .section-contests .view-more-btn {
  margin-top: 10px;
}

/* Mobile-only: contests "view more" aligned to the right of subtitle row */
body.is-mobile-device .section-contests .section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title title"
    "subtitle action";
  column-gap: 10px;
  row-gap: 10px;
  align-items: center;
}

body.is-mobile-device .section-contests .section-title {
  grid-area: title;
  justify-self: center;
}

body.is-mobile-device .section-contests .section-subtitle {
  grid-area: subtitle;
  margin: 0;
  text-align: left;
  justify-self: start;
}

body.is-mobile-device .section-contests .view-more-btn {
  grid-area: action;
  position: static;
  margin: 0;
  justify-self: end;
  align-self: center;
  white-space: nowrap;
}

/* Mid-size desktop/tablet window: keep nav row visible and stable */
@media (min-width: 769px) and (max-width: 1366px) {
  body:not(.is-mobile-device) .header {
    height: auto;
    min-height: 80px;
    padding: 10px 0;
  }

  body:not(.is-mobile-device) .header-container {
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo actions"
      "nav nav";
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    padding: 0 16px;
  }

  body:not(.is-mobile-device) .logo {
    grid-area: logo;
    width: auto;
    min-width: 0;
  }

  body:not(.is-mobile-device) .nav {
    grid-area: nav;
    width: 100%;
    height: auto;
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  body:not(.is-mobile-device) .nav::-webkit-scrollbar {
    display: none;
  }

  body:not(.is-mobile-device) .nav-list {
    height: auto;
    min-width: max-content;
    padding-bottom: 4px;
  }

  body:not(.is-mobile-device) .nav-item {
    height: auto;
  }

  body:not(.is-mobile-device) .nav-item a {
    height: 36px;
    padding: 0 12px;
  }

  body:not(.is-mobile-device) .header-actions {
    grid-area: actions;
    width: auto;
    justify-content: flex-end;
    gap: 10px;
  }
}
