/* ============================================================
   组件样式 · Header / 按钮 / 卡片 / 表单 / 跑马灯 / 返回顶部
   ============================================================ */

/* ============ 固定头部 ============ */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition:
    background 0.4s,
    border-color 0.4s,
    backdrop-filter 0.4s;
}
.site-header.scrolled {
  background: rgba(4, 9, 20, 0.74);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-1);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 12px rgba(61, 123, 255, 0.45));
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-cn {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.brand-en {
  font-family: var(--font-disp);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--text-3);
}

.main-nav ul {
  display: flex;
  gap: 4px;
}
.main-nav a {
  position: relative;
  display: block;
  padding: 10px 14px;
  font-size: 14.5px;
  letter-spacing: 0.05em;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-main);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--text-1);
}
.main-nav a.active::after {
  transform: scaleX(1);
}

/* 汉堡按钮（移动端） */
.burger {
  display: none;
  width: 42px;
  height: 42px;
  position: relative;
  background: rgba(120, 160, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.burger span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: transform 0.35s var(--ease-out), opacity 0.25s, top 0.35s var(--ease-out);
}
.burger span:nth-child(1) {
  top: 15px;
}
.burger span:nth-child(2) {
  top: 25px;
}
.burger.open span:nth-child(1) {
  top: 20px;
  transform: rotate(45deg);
}
.burger.open span:nth-child(2) {
  top: 20px;
  transform: rotate(-45deg);
}

/* 移动端全屏菜单 */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  background: rgba(3, 6, 13, 0.97);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-out), visibility 0.45s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu ul {
  display: grid;
  gap: 8px;
  text-align: center;
  padding: 0 24px;
}
.mobile-menu a {
  display: block;
  padding: 12px 20px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-2);
  text-decoration: none;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), color 0.3s;
  transition-delay: 0s;
}
.mobile-menu.open a {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.08s + var(--i, 0) * 0.05s);
}
.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--cyan);
}
.mobile-menu .mm-foot {
  margin-top: 28px;
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.5s 0.45s;
}
.mobile-menu.open .mm-foot {
  opacity: 1;
}

/* ============ 按钮 ============ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-1);
  text-decoration: none;
  border: none;
  cursor: pointer;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s, background 0.35s;
}
.btn .arr {
  transition: transform 0.35s var(--ease-out);
}
.btn:hover .arr {
  transform: translateX(4px);
}

.btn-primary {
  background: var(--grad-main);
  color: #051226;
  box-shadow: 0 8px 30px rgba(61, 123, 255, 0.35);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.7s var(--ease-out);
}
.btn-primary:hover::before {
  transform: translateX(130%);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 42px rgba(61, 123, 255, 0.5);
}

.btn-ghost {
  background: rgba(140, 180, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(62, 230, 255, 0.1);
  box-shadow:
    inset 0 0 0 1px rgba(62, 230, 255, 0.55),
    0 0 26px rgba(62, 230, 255, 0.15);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 13.5px;
}

/* ============ 徽标 / 标签 ============ */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-2);
  background: rgba(120, 160, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

/* ============ 卡片 ============ */
.card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    transform 0.45s var(--ease-out),
    border-color 0.45s,
    box-shadow 0.45s;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(62, 230, 255, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.45s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow:
    0 18px 50px rgba(3, 10, 30, 0.6),
    0 0 40px rgba(61, 123, 255, 0.12);
}
.card:hover::before {
  opacity: 1;
}

/* HUD 角标（悬停显现） */
.hud::before,
.hud::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-style: solid;
  border-color: rgba(62, 230, 255, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s, transform 0.4s var(--ease-out);
}
.hud::before {
  top: 10px;
  left: 10px;
  border-width: 1px 0 0 1px;
  transform: translate(5px, 5px);
}
.hud::after {
  bottom: 10px;
  right: 10px;
  border-width: 0 1px 1px 0;
  transform: translate(-5px, -5px);
}
.hud:hover::before,
.hud:hover::after {
  opacity: 1;
  transform: none;
}

/* 图标底座 */
.icon-tile {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: linear-gradient(145deg, rgba(61, 123, 255, 0.18), rgba(62, 230, 255, 0.05));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: inset 0 0 18px rgba(61, 123, 255, 0.12);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s, color 0.45s;
}
.icon-tile svg {
  width: 25px;
  height: 25px;
}

/* ============ 跑马灯 ============ */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 18px 0;
  border-block: 1px solid var(--line);
  background: rgba(8, 14, 30, 0.5);
}
.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 1;
  pointer-events: none;
}
.marquee::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-0), transparent);
}
.marquee::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg-0), transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  padding-right: 18px;
  font-size: 14.5px;
  letter-spacing: 0.24em;
  color: var(--text-2);
  white-space: nowrap;
}
.marquee-item::after {
  content: "✦";
  margin-left: 18px;
  font-size: 10px;
  color: var(--cyan);
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ============ 表单 ============ */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field > label {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.field .req {
  color: var(--cyan);
  margin-left: 2px;
}
.field .err-msg {
  font-size: 12px;
  color: #ff7a93;
}
.field.invalid .control {
  border-color: rgba(255, 122, 147, 0.6);
}

.control {
  width: 100%;
  padding: 13px 16px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-1);
  background: rgba(8, 15, 32, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.control:focus {
  border-color: rgba(62, 230, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 230, 255, 0.12);
}
.control::placeholder {
  color: var(--text-3);
}
textarea.control {
  min-height: 118px;
  resize: vertical;
}
select.control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2368789f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  cursor: pointer;
}
select.control option {
  background: #0a1226;
  color: var(--text-1);
}

/* ============ 返回顶部 ============ */
.back-top {
  position: fixed;
  right: 26px;
  bottom: 30px;
  z-index: 90;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: rgba(10, 18, 38, 0.82);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.4s, visibility 0.4s, transform 0.4s var(--ease-out), box-shadow 0.3s;
}
.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.back-top:hover {
  border-color: rgba(62, 230, 255, 0.6);
  box-shadow: 0 0 24px rgba(62, 230, 255, 0.25);
}
.back-top svg {
  width: 18px;
  height: 18px;
}
