/* ========================================
   超级云 - mcqsj.top
   Light × Editorial × Warm × Rich Motion
   ======================================== */

:root {
  --bg: #f8f6f1;
  --bg-card: #ffffff;
  --bg-hover: #faf8f4;
  --text: #2a2825;
  --text-sub: #6b6862;
  --text-dim: #a8a39b;
  --accent: #3b6fc9;
  --accent-soft: rgba(59, 111, 201, 0.08);
  --accent-deep: #2a5aa8;
  --warm: #b48c5a;
  --warm-soft: rgba(180, 140, 90, 0.08);
  --green: #5aa082;
  --green-soft: rgba(90, 160, 130, 0.08);
  --border: rgba(42, 40, 37, 0.10);
  --border-card: rgba(42, 40, 37, 0.06);
  --hairline: rgba(42, 40, 37, 0.05);

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur: 0.3s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 纸感噪点（保留，叠加在 canvas 之上） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.025 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: -3;
  pointer-events: none;
  opacity: 0.7;
}

/* ===== 1. 粒子流场背景 ===== */
#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  display: block;
}

/* ===== 导航 ===== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(248, 246, 241, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
}

.nav {
  max-width: 880px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.nav-brand img {
  height: 30px;
  image-rendering: pixelated;
}

/* ===== 5. 流光文字 ===== */
.brand-shine {
  background: linear-gradient(90deg, #3b6fc9, #b48c5a, #5aa082, #3b6fc9);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shine 7s linear infinite;
}

@keyframes shine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--dur) var(--ease);
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width var(--dur) var(--ease);
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

/* ===== Hero ===== */
.hero {
  max-width: 880px;
  margin: 0 auto;
  padding: 180px 32px 100px;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-content { flex: 1; }

/* ===== Hero 轨道动画系统 ===== */
.hero-orbit {
  flex-shrink: 0;
  width: 340px;
  height: 340px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: orbit-fade-in 1.2s var(--ease-out) 0.4s both;
}

.orbit-svg {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.orbit-glow {
  position: absolute;
  inset: 25%;
  background: radial-gradient(circle, rgba(59,111,201,0.18), transparent 65%);
  border-radius: 50%;
  filter: blur(24px);
  animation: orbit-pulse 4s ease-in-out infinite;
}

/* 三层环不同速度旋转 */
.ring-outer {
  transform-origin: 200px 200px;
  animation: orbit-rotate 60s linear infinite;
}

.ring-mid {
  transform-origin: 200px 200px;
  animation: orbit-rotate-reverse 40s linear infinite;
}

.ring-inner {
  transform-origin: 200px 200px;
  animation: orbit-rotate 25s linear infinite;
}

/* 节点发光 */
.node {
  filter: drop-shadow(0 0 4px currentColor);
}

.node-1 { animation: node-blink 3s ease-in-out infinite; }
.node-4 { animation: node-blink 4s ease-in-out infinite 1s; }
.node-6 { animation: node-blink 2.5s ease-in-out infinite 0.5s; }

/* 中心核脉冲 */
.core-halo {
  animation: core-pulse 3s ease-in-out infinite;
  transform-origin: 200px 200px;
}

.core {
  animation: core-glow 2s ease-in-out infinite;
}

@keyframes orbit-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbit-rotate-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes orbit-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes node-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes core-pulse {
  0%, 100% { opacity: 0.3; r: 8; }
  50% { opacity: 0.6; r: 14; }
}

@keyframes core-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes orbit-fade-in {
  from { opacity: 0; transform: scale(0.85) rotate(-12deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(59, 111, 201, 0.15);
  padding: 6px 14px;
  border-radius: 9999px;
  margin-bottom: 24px;
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 0.05s forwards;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(59, 111, 201, 0.4);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== 2. 标题逐字浮现 ===== */
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 28px;
}

.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  animation: word-up 0.7s var(--ease-out) var(--d, 0s) forwards;
}

.hero-title .word i {
  font-style: italic;
  color: var(--accent);
}

@keyframes word-up {
  0% { opacity: 0; transform: translateY(0.35em); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-sub);
  max-width: 380px;
  line-height: 1.6;
  opacity: 0;
  animation: fade-up 0.9s var(--ease-out) 0.45s forwards;
}

.hero-scroll {
  margin-top: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  opacity: 0;
  animation: fade-up 0.9s var(--ease-out) 0.6s forwards, bounce-hint 2.5s ease-in-out 1.8s infinite;
}

.hero-scroll svg {
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce-hint {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== Section 标题 ===== */
.section-title {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 32px;
  margin-bottom: 48px;
}

.section-title h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h2::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.section-title p {
  font-size: 14px;
  color: var(--text-dim);
  padding-left: 36px;
}

/* ===== Projects ===== */
.projects {
  padding: 80px 0;
}

.card-grid {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  perspective: 1200px;
}

/* ===== 4. 卡片 3D 视差 ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.25s var(--ease-out), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
  overflow: hidden;
}

.card-glow {
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 111, 201, 0.06), transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.card-glow-off {
  background: radial-gradient(circle, rgba(168, 163, 155, 0.06), transparent 70%);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(59, 111, 201, 0.3));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

/* 桌面 hover 升起（无 JS 3D 时的回退） */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    box-shadow: 0 16px 40px rgba(42, 40, 37, 0.10);
    border-color: var(--border);
  }
  .card:hover::before { transform: scaleX(1); }
  .card:hover .card-glow { opacity: 1; }
  .card:hover .card-icon {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: rgba(59, 111, 201, 0.15);
  }
  .card:hover .card-link {
    color: var(--accent);
    gap: 8px;
  }
  /* 移动端/触屏由 JS 关闭 3D，这里在 reduce-motion 时也保持 translateY hover 回退 */
  .card:not(.no-tilt):hover {
    transform: translateY(-6px);
  }
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-sub);
  border: 1px solid var(--border-card);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.card-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 9999px;
}

.card-tag-wip {
  color: var(--accent);
  border-color: rgba(59, 111, 201, 0.15);
  background: var(--accent-soft);
}

.card-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-sub);
  line-height: 1.55;
  flex: 1;
}

.card-footer { padding-top: 4px; }

.card-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color var(--dur) var(--ease), gap var(--dur) var(--ease);
}

.card-link svg {
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-link-off { color: var(--text-dim); }
.card-disabled { cursor: default; }

/* ===== Footer（备案可见度提升） ===== */
footer {
  border-top: 1px solid var(--hairline);
  padding: 36px 32px;
}

.footer-content {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-beian {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-beian a {
  color: var(--text-sub);          /* 原 --text-dim → --text-sub */
  text-decoration: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color var(--dur) var(--ease);
}

.footer-beian a:hover { color: var(--accent); }

.footer-sep {
  color: var(--text-sub);
  opacity: 0.6;                    /* 原 0.4 → 0.6 */
}

.police-icon {
  width: 14px;
  height: 14px;
}

.copyright {
  font-size: 12px;
  color: var(--text-sub);          /* 原 --text-dim → --text-sub */
}

/* ===== 3. 滚动渐入 + clip-path 揭幕 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  clip-path: inset(0 0 30% 0);
  transition: opacity 0.7s var(--ease-out),
              transform 0.7s var(--ease-out),
              clip-path 0.8s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
}

/* 卡片 staggered */
.card.fade-in:nth-child(2) {
  transition-delay: 0.12s;
}

/* ===== 响应式 ===== */
@media (max-width: 734px) {
  .nav { padding: 0 24px; }

  .hero {
    flex-direction: column;
    padding: 140px 24px 60px;
    gap: 20px;
    text-align: center;
  }

  .hero-badge { margin: 0 auto 20px; }
  .hero-sub { margin: 0 auto; }
  .hero-scroll { margin: 40px auto 0; justify-content: center; }

  .hero-orbit {
    width: 200px;
    height: 200px;
    order: -1;
  }

  .section-title, .card-grid {
    padding-left: 24px;
    padding-right: 24px;
  }

  .section-title p { padding-left: 36px; }

  .card-grid {
    grid-template-columns: 1fr;
    perspective: none;
  }

  .card { padding: 24px; }

  .nav-links { gap: 20px; }

  .footer-beian {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== prefers-reduced-motion 降级 ===== */
@media (prefers-reduced-motion: reduce) {
  #particles { display: none; }

  .brand-shine {
    -webkit-text-fill-color: var(--accent);
    color: var(--accent);
    background: none;
    animation: none;
  }

  .hero-orbit { animation: none; opacity: 1; transform: none; }
  .ring-outer, .ring-mid, .ring-inner { animation: none; }
  .orbit-glow { animation: none; opacity: 0.5; }
  .node, .core, .core-halo { animation: none; }

  .hero-badge,
  .hero-title .word,
  .hero-sub,
  .hero-scroll {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }

  .card { transform-style: flat; will-change: auto; }

  html { scroll-behavior: auto; }
}