/* CHGE.cn - 长歌的数字花园 V2.6 */
/* Completely self-contained, no external dependencies */

:root {
  --bg: #070814;
  --bg-grad: linear-gradient(135deg, #070814 0%, #0a0b1a 50%, #0d0c20 100%);
  --card: #12152a;
  --card-hover: #181b35;
  --card-active: #1e2240;
  --accent: #e94560;
  --accent-light: #ff6b81;
  --accent-glow: rgba(233, 69, 96, 0.4);
  --gold: #f5a623;
  --gold-light: #ffc107;
  --gold-glow: rgba(245, 166, 35, 0.3);
  --purple: #8b7cf6;
  --purple-light: #a99ff9;
  --purple-glow: rgba(139, 124, 246, 0.3);
  --success: #00d9a5;
  --success-glow: rgba(0, 217, 165, 0.25);
  --text: #eaebf3;
  --text-dim: #8a8ca8;
  --text-muted: #5a5c75;
  --border: rgba(255,255,255,0.05);
  --border-light: rgba(255,255,255,0.09);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg-grad);
  color: var(--text);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Rich layered background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 140% 80% at 50% -20%, rgba(233, 69, 96, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 100% 70% at 90% 110%, rgba(139, 124, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 10% 95%, rgba(245, 166, 35, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 70% 60%, rgba(233, 69, 96, 0.03) 0%, transparent 50%),
    linear-gradient(180deg, rgba(15, 12, 35, 0.3) 0%, transparent 30%);
  pointer-events: none;
  z-index: -1;
}

/* Subtle grid pattern */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -1;
}

/* Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(7, 8, 20, 0.88);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 18px 48px;
  height: auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.top-nav:hover::after {
  opacity: 1;
}

.top-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 2px;
  transition: all 0.3s ease;
}

.top-nav .brand:hover {
  color: #fff;
  text-shadow: 
    0 0 10px var(--accent),
    0 0 20px var(--accent),
    0 0 40px var(--accent-glow);
}

.top-nav .brand-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-nav .brand-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  animation: starPulse 3s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.85; }
}

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

.top-nav .links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 4px;
  position: relative;
  transition: color 0.25s;
  letter-spacing: 0.5px;
}

.top-nav .links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 1px;
  transition: all 0.25s ease;
}

.top-nav .links a:hover {
  color: var(--text);
}

.top-nav .links a:hover::after,
.top-nav .links a.active::after {
  left: 0;
  right: 0;
}

.top-nav .links a.active {
  color: var(--accent-light);
}

.top-nav .stat {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Main content area */
.main {
  max-width: 900px;
  margin: 100px auto 0;
  padding: 48px 40px 100px;
}

/* Page title */
.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 44px;
  display: flex;
  align-items: center;
  gap: 20px;
  letter-spacing: -0.3px;
}

.page-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-light), transparent);
}

/* Back link */
.back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 36px;
  transition: all 0.25s;
  padding: 8px 0;
}

.back:hover {
  color: var(--accent-light);
  gap: 14px;
}

/* Typography */
p {
  color: var(--text-dim);
  line-height: 1.95;
}

p strong {
  color: var(--accent-light);
  font-weight: 600;
}

em {
  color: var(--gold);
  font-style: normal;
  font-weight: 500;
}

.gold {
  color: var(--gold);
  font-weight: 600;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}

.card:hover {
  border-color: var(--border-light);
  background: var(--card-hover);
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(233, 69, 96, 0.05);
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 10px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-active {
  background: rgba(233, 69, 96, 0.1);
  color: var(--accent-light);
  border: 1px solid rgba(233, 69, 96, 0.2);
}

.badge-done {
  background: rgba(0, 217, 165, 0.08);
  color: var(--success);
  border: 1px solid rgba(0, 217, 165, 0.15);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 48px;
  padding-top: 12px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--gold), var(--purple), var(--success), var(--text-muted));
  border-radius: 1px;
  opacity: 0.35;
}

.tl-item {
  position: relative;
  padding-bottom: 44px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -38px;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent), 0 0 24px var(--accent-glow);
  transition: all 0.35s ease;
}

.tl-item:hover::before {
  transform: scale(1.3);
  box-shadow: 0 0 0 2px var(--accent), 0 0 40px var(--accent-glow);
}

.tl-item:nth-child(2)::before {
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 0 24px var(--gold-glow);
}
.tl-item:nth-child(2):hover::before {
  box-shadow: 0 0 0 2px var(--gold), 0 0 40px var(--gold-glow);
}

.tl-item:nth-child(3)::before {
  background: var(--purple);
  box-shadow: 0 0 0 2px var(--purple), 0 0 24px var(--purple-glow);
}
.tl-item:nth-child(3):hover::before {
  box-shadow: 0 0 0 2px var(--purple), 0 0 40px var(--purple-glow);
}

.tl-item:nth-child(4)::before { background: var(--success); box-shadow: 0 0 0 2px var(--success), 0 0 24px var(--success-glow); }
.tl-item:nth-child(5)::before { background: var(--accent-light); box-shadow: 0 0 0 2px var(--accent-light); }
.tl-item:nth-child(6)::before { background: var(--text-muted); box-shadow: 0 0 0 2px var(--text-muted); }

.tl-date {
  font-size: 0.82rem;
  color: var(--accent-light);
  font-weight: 600;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.tl-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.tl-desc {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.8;
}

/* Letter style */
.letter {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px;
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
}

.letter:hover {
  border-color: var(--border-light);
  background: var(--card-hover);
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.letter::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 32px;
  font-size: 7rem;
  color: var(--accent);
  opacity: 0.05;
  font-family: Georgia, serif;
  line-height: 1;
}

.letter::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 69, 96, 0.3), transparent);
}

.letter-date {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.letter-content {
  font-size: 1rem;
  line-height: 2.1;
  color: var(--text-dim);
}

.letter-content p {
  margin-top: 22px;
}

.letter-content p:first-child {
  margin-top: 0;
}

.letter-content strong {
  color: var(--accent-light);
  font-weight: 600;
}

.letter .sign {
  text-align: right;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--accent-light);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

/* Skill bars */
.skill-item {
  margin-top: 22px;
}

.skill-item:first-child {
  margin-top: 0;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.skill-label span:first-child {
  color: var(--text);
  font-weight: 500;
}

.skill-label span:last-child {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.skill-bar {
  height: 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero section - Homepage */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 140px 40px 120px;
  position: relative;
}

.hero-logo {
  height: 100px;
  margin-bottom: 40px;
  filter: drop-shadow(0 0 40px rgba(233, 69, 96, 0.4));
  animation: logoShimmer 4s ease-in-out infinite;
  cursor: default;
}

@keyframes logoShimmer {
  0%, 100% { 
    filter: drop-shadow(0 0 30px rgba(233, 69, 96, 0.3)) 
            drop-shadow(0 0 60px rgba(139, 124, 246, 0.15));
  }
  50% { 
    filter: drop-shadow(0 0 50px rgba(233, 69, 96, 0.6)) 
            drop-shadow(0 0 100px rgba(139, 124, 246, 0.3));
  }
}

.hero-logo:hover {
  animation: logoShimmerIntense 1.5s ease-in-out infinite;
}

@keyframes logoShimmerIntense {
  0%, 100% { 
    filter: drop-shadow(0 0 60px rgba(233, 69, 96, 0.8)) 
            drop-shadow(0 0 120px rgba(139, 124, 246, 0.5));
  }
  50% { 
    filter: drop-shadow(0 0 80px rgba(233, 69, 96, 1)) 
            drop-shadow(0 0 140px rgba(139, 124, 246, 0.7));
  }
}

.hero-tagline {
  color: var(--text-dim);
  font-size: 1.15rem;
  margin-bottom: 56px;
  line-height: 2;
  max-width: 520px;
}

.hero-tagline strong {
  color: var(--accent-light);
  font-weight: 600;
}

/* Entrance cards */
.entrance {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 900px;
  width: 100%;
}

.entrance-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.entrance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(180deg, rgba(233, 69, 96, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.entrance-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.entrance-card:hover {
  border-color: rgba(233, 69, 96, 0.3);
  background: var(--card-hover);
  transform: translateY(-8px);
  box-shadow: 0 30px 80px rgba(233, 69, 96, 0.12), 0 0 0 1px rgba(233, 69, 96, 0.1);
}

.entrance-card:hover::before {
  opacity: 1;
}

.entrance-card:hover::after {
  transform: scaleX(1);
}

.entrance-card .icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  display: block;
  position: relative;
  transition: transform 0.4s ease;
}

.entrance-card:hover .icon {
  transform: scale(1.1);
}

.entrance-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  letter-spacing: 0.3px;
}

.entrance-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
  position: relative;
}

/* Friends section */
.friends-section {
  max-width: 900px;
  width: 100%;
  margin-top: 72px;
}

.friends-label {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 28px;
  letter-spacing: 8px;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 400px;
  margin: 0 auto;
}

.friends-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: all 0.35s ease;
}

.friends-card:hover {
  border-color: rgba(139, 124, 246, 0.3);
  background: var(--card-hover);
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(139, 124, 246, 0.1);
}

.friends-card .icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.friends-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.friends-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Footer */
.footer {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.footer .heart {
  color: var(--accent);
  display: inline-block;
  animation: heartbeat 2.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.2); }
  60% { transform: scale(1); }
}

/* Letter full page */
.letter-full {
  max-width: 900px;
  margin: 100px auto 0;
  padding: 0 40px 100px;
}

.letter-full .letter {
  margin-bottom: 32px;
}

/* Projects page */
.projects-intro {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 36px;
  margin-top: -28px;
}

/* Principles list */
.principles {
  list-style: none;
  margin-top: 4px;
}

.principles li {
  padding: 10px 0;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.principles li:last-child {
  border-bottom: none;
}

.principles li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 1024px) {
  .entrance { grid-template-columns: repeat(2, 1fr); }
  .main, .letter-full { padding: 40px 28px 80px; }
  .hero { padding: 80px 28px 100px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  
  .top-nav { padding: 14px 20px; }
  .top-nav .links { gap: 16px; }
  .top-nav .links a { font-size: 0.85rem; }
  .top-nav .brand { font-size: 0.9rem; }
  
  .main, .letter-full { 
    padding: 36px 20px 70px; 
    margin-top: 80px;
    max-width: 100%;
  }
  
  .entrance { grid-template-columns: 1fr; }
  .friends-grid { grid-template-columns: 1fr; }
  
  .hero-logo { height: 72px; }
  .hero-logo:hover { transform: scale(1.05); }
  .hero { padding: 100px 20px 70px; }
  .main { margin-top: 90px; }
  
  .letter { padding: 28px; }
  .card { padding: 28px; }
  
  .timeline { padding-left: 36px; }
  .timeline::before { left: 10px; }
  .tl-item::before { left: -34px; width: 16px; height: 16px; }
}