/* ============================================================
   星垂芷野 · 个人展示页样式
   风格：沉浸式风景首屏 + 淡粉主题 + 樱花元素
   ============================================================ */

:root {
  --bg: #17121d;
  --bg-soft: #221a29;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 220, 230, 0.14);
  --text: #f3ecf1;
  --text-dim: #c3b3c4;
  --accent: #f2b8c9;          /* 淡粉主色 */
  --accent-strong: #e891ab;
  --accent-soft: rgba(242, 184, 201, 0.16);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --maxw: 1000px;
  --header-h: 62px;
}

[data-theme="light"] {
  --bg: #faf4f6;
  --bg-soft: #ffffff;
  --surface: rgba(90, 40, 60, 0.04);
  --surface-strong: rgba(90, 40, 60, 0.08);
  --border: rgba(120, 50, 75, 0.16);
  --text: #33222d;
  --text-dim: #7d6673;
  --accent: #e07a99;
  --accent-strong: #cf5f84;
  --accent-soft: rgba(224, 122, 153, 0.14);
  --shadow: 0 20px 50px rgba(120, 50, 80, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---------- 樱花画布 ---------- */
#sakura {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

/* ---------- 顶部栏 ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(16px, 4vw, 40px);
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--border);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: 1px; }
.brand-mark { color: var(--accent); display: inline-flex; }

.nav { margin-left: auto; display: flex; gap: clamp(12px, 2.4vw, 26px); font-size: 0.95rem; }
.nav a { color: var(--text-dim); padding: 4px 0; transition: color 0.2s ease; }
.nav a:hover, .nav a.active { color: var(--accent); }

.theme-toggle {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { background: var(--surface-strong); border-color: var(--accent); }
.theme-icon {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, var(--accent), var(--accent-strong));
  box-shadow: 0 0 8px var(--accent-soft);
}
[data-theme="light"] .theme-icon {
  background: radial-gradient(circle at 68% 32%, #ffe3ee, #f2a0bd);
}

/* ---------- 沉浸式首屏 ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + 24px) 20px 90px;
  background: url("../assets/bg.jpg") center 30% / cover no-repeat, #241a2c;
}
.hero-mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18, 12, 22, 0.42) 0%, rgba(18, 12, 22, 0.18) 40%, rgba(23, 18, 29, 0.88) 100%);
  pointer-events: none;
}
[data-theme="light"] .hero-mask {
  background: linear-gradient(180deg, rgba(18, 12, 22, 0.30) 0%, rgba(18, 12, 22, 0.10) 40%, var(--bg) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 720px; }

.avatar {
  width: 150px; height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 6px rgba(242, 184, 201, 0.14), 0 14px 44px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}
.avatar:hover { transform: scale(1.04); }

.hero-name {
  margin: 22px 0 6px;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 6px;
  text-indent: 6px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.hero-sub {
  margin: 0;
  color: var(--accent);
  letter-spacing: 3px;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
}
.hero-quote {
  margin: 18px auto 0;
  max-width: 30em;
  color: rgba(255, 244, 248, 0.82);
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

.hero-nav {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-nav a {
  padding: 9px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 234, 0.4);
  background: rgba(20, 14, 24, 0.35);
  color: #ffeef4;
  font-size: 0.95rem;
  letter-spacing: 2px;
  backdrop-filter: blur(6px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.hero-nav a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #3a1524;
  transform: translateY(-2px);
}

.hero-social {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 14px;
}
.social-btn {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 224, 234, 0.4);
  background: rgba(20, 14, 24, 0.35);
  color: #ffeef4;
  backdrop-filter: blur(6px);
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}
.social-btn:hover { background: var(--accent); color: #3a1524; transform: translateY(-2px); }

.scroll-hint {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 240, 246, 0.75);
  font-size: 1.2rem;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 7px); }
}

/* ---------- 通用区块 ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(52px, 9vw, 96px) clamp(18px, 4vw, 40px);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: 3px;
}
.section-head h2::before {
  content: "❀";
  color: var(--accent);
  margin-right: 12px;
  font-size: 0.85em;
}
.section-index { margin-left: auto; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.prose p { color: var(--text-dim); font-size: 1.04rem; max-width: 68ch; }

/* ---------- 兴趣卡片 ---------- */
.card-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--surface-strong); }
.card h3 { margin: 0 0 8px; font-size: 1.12rem; letter-spacing: 1px; }
.card h3::before { content: "❀ "; color: var(--accent); font-size: 0.8em; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }

/* ---------- 技能条 ---------- */
.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; max-width: 640px; }
.skill-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 0.98rem;
}
.skill-name small { color: var(--text-dim); font-size: 0.82rem; }
.skill-val { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.skill-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  overflow: hidden;
}
.skill-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent) 55%, var(--accent-strong));
  transition: width 1.2s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.skill.is-visible .skill-fill { width: var(--val); }

/* ---------- 联系 ---------- */
.links { display: flex; flex-wrap: wrap; gap: 14px; }
.link-chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.link-chip:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--surface-strong); }
.link-name { font-weight: 700; }
.link-handle { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- 页脚 ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px clamp(18px, 4vw, 40px) 64px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.site-footer a { color: var(--accent); }
.to-top { color: var(--text-dim); }
.to-top:hover { color: var(--accent); }

/* ---------- 回到顶部按钮 ---------- */
.back-top {
  position: fixed;
  right: 22px; bottom: 26px;
  z-index: 85;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 86%, transparent);
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}
.back-top.show { opacity: 1; transform: none; }
.back-top:hover { background: var(--accent); color: #3a1524; }

/* ---------- 滚动淡入（渐进增强：仅 JS 可用时启用隐藏） ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }
html:not(.js) .skill-fill { width: var(--val); }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint { animation: none; }
  .skill-fill { transition: none; width: var(--val); }
  html { scroll-behavior: auto; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .nav { display: none; }
  .avatar { width: 118px; height: 118px; }
  .hero-name { letter-spacing: 4px; }
  .hero-nav a { padding: 8px 18px; font-size: 0.9rem; letter-spacing: 1px; }
  .back-top { right: 14px; bottom: 18px; }
  .section { padding-left: 18px; padding-right: 18px; }
}
