/* 基础主题色 */
:root {
  --accent: #ffd000; /* 用户偏好主题色（金黄） */
  --bg: #0e1320;
  --bg-alt: #10162b;
  --text: #e5e7eb;
  --muted: #a1a7b3;
  --card: #141a2f;
  --border: #1f2540;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, #17305a 0%, var(--bg) 55%, var(--bg) 100%);
  line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
.container { width: min(1100px, 92vw); margin: 0 auto; }

/* 顶部导航 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
  background: rgba(16, 22, 43, 0.6);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { font-weight: 800; letter-spacing: 0.5px; color: var(--white); }
.site-header nav a { margin-left: 18px; color: var(--muted); }
.site-header nav a:hover { color: var(--white); }

/* 首屏 */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero-text h1 { font-size: clamp(28px, 4.6vw, 44px); margin: 0 0 12px; }
.hero-text .accent { color: var(--accent); text-shadow: 0 0 12px rgba(255, 208, 0, 0.35); }
.subtitle { color: var(--muted); max-width: 58ch; }
.cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 10px; border: 1px solid var(--border); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #ffea80); color: #3b2e00; border: none; box-shadow: 0 6px 18px rgba(255, 208, 0, 0.25); }
.btn.ghost { color: var(--text); }
.btn:hover { transform: translateY(-1px); transition: transform 160ms ease; }

/* 首屏图形动画 */
.hero-art { position: relative; height: 300px; }
.shape { position: absolute; }
.planet {
  right: 6%; top: 12%; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1e3a8a 0, #0b1c49 45%, #071433 100%);
  box-shadow: 0 30px 50px rgba(0,0,0,0.35), inset -10px -20px 35px rgba(0,0,0,0.45);
  animation: float 6s ease-in-out infinite;
}
.orbit {
  right: 4%; top: 6%; width: 240px; height: 240px; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.18); filter: drop-shadow(0 0 6px rgba(255,255,255,0.08));
  animation: spin 18s linear infinite;
}
.spark { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(255,208,0,0.7); }
.spark.s1 { right: 18%; top: 30%; animation: drift 8s ease-in-out infinite; }
.spark.s2 { right: 8%; top: 70%; animation: drift 7s ease-in-out infinite reverse; }
.spark.s3 { right: 24%; top: 12%; animation: drift 9s ease-in-out infinite; }
.card {
  left: 4%; bottom: 2%; width: 220px; height: 150px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--border); box-shadow: 0 14px 40px rgba(0,0,0,0.35);
  transform: rotate(-3deg); animation: float 7s ease-in-out infinite reverse;
}
.code-lines { padding: 16px; display: grid; gap: 10px; }
.code-lines span { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, #243763 0%, #1b2a52 40%, var(--accent) 90%); opacity: 0.9; }
.code-lines span:nth-child(2) { width: 90%; }
.code-lines span:nth-child(3) { width: 75%; }
.code-lines span:nth-child(4) { width: 85%; }
.code-lines span:nth-child(5) { width: 60%; }

@keyframes float { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-6px, 8px); } }

/* 通用区块 */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { 
  font-size: 22px; 
  margin: 0 0 12px;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.section-title.visible::after { width: 100%; }
.section-text { color: var(--muted); max-width: 70ch; }
.tip { margin-top: 10px; color: var(--muted); font-size: 14px; }

.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; padding: 0; list-style: none; }
.info-list li { 
  color: var(--text); 
  padding: 12px 16px; 
  border-radius: 10px; 
  background: linear-gradient(135deg, rgba(255,208,0,0.05) 0%, rgba(255,208,0,0.01) 100%);
  border: 1px solid rgba(255,208,0,0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.info-list li::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,208,0,0.15), transparent);
  transition: left 0.6s ease;
}
.info-list li:hover::before { left: 100%; }
.info-list li:hover { 
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(255,208,0,0.2);
}

.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.skill { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 14px; 
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.skill::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,208,0,0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.skill:hover::before { opacity: 1; }
.skill:hover { 
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(255,208,0,0.25), 0 0 0 1px rgba(255,208,0,0.2);
}
.skill .icon { 
  font-size: 24px; 
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.skill:hover .icon { transform: scale(1.3) rotate(8deg); }
.skill h3 { 
  margin: 6px 0 8px; 
  font-size: 18px;
  position: relative;
  z-index: 1;
}
.skill p { 
  margin: 0; 
  color: var(--muted);
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}
.skill:hover p { color: var(--text); }

.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.work-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.work-card h3 { margin: 0 0 8px; font-size: 18px; }
.work-card p { margin: 0 0 10px; color: var(--muted); }
.tags { display: flex; gap: 8px; }
.tags span { font-size: 12px; color: #0d0f16; background: var(--accent); border-radius: 999px; padding: 4px 10px; }

.contact-box { 
  display: flex; 
  align-items: center; 
  gap: 14px; 
  margin-top: 6px;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,208,0,0.08) 0%, rgba(255,208,0,0.02) 100%);
  border: 1px solid rgba(255,208,0,0.2);
  position: relative;
  overflow: hidden;
}
.contact-box::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(45deg, var(--accent), #ffea80, var(--accent));
  border-radius: 16px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
  animation: borderRotate 3s linear infinite;
}
.contact-box:hover::before { opacity: 0.3; }
.contact-box::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,208,0,0.15) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-box:hover::after { transform: translate(-50%, -50%) scale(1); }
.contact-box .btn { position: relative; z-index: 1; }
.contact-box .muted { position: relative; z-index: 1; }
.muted { color: var(--muted); }

@keyframes borderRotate {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* 底部 */
.site-footer { padding: 24px 0 32px; border-top: 1px solid var(--border); background: rgba(16, 22, 43, 0.6); backdrop-filter: saturate(140%) blur(6px); }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.copy .sep { color: #3a4062; }
.copy .record { color: var(--muted); }
.copy .record:hover { color: var(--accent); }
.notice { color: var(--muted); font-size: 14px; }

/* 入场动画 */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* 响应式 */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { height: 220px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .works-grid { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; }
}
