/* ============================================================
   iOS 风格个人主页
   设计要点：
   - SF 字体栈 + 大圆角 + 毛玻璃（backdrop-filter）
   - 系统级色彩（iOS 蓝 / 绿 / 紫 / 橙…）
   - 浅色 / 深色 / 跟随系统 三态主题
   ============================================================ */

/* ---------- 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--label);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(0, 122, 255, 0.28);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

/* ---------- 主题变量 ---------- */
:root {
  --accent: #007aff;
  --green: #34c759;
  --indigo: #5856d6;
  --purple: #af52de;
  --pink: #ff2d55;
  --orange: #ff9500;
  --teal: #5ac8fa;
  --radius: 18px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* 浅色模式 */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f7;
  --bg-glow-a: rgba(0, 122, 255, 0.22);
  --bg-glow-b: rgba(175, 82, 222, 0.2);
  --bg-glow-c: rgba(255, 45, 85, 0.14);
  --card: rgba(255, 255, 255, 0.66);
  --card-strong: rgba(255, 255, 255, 0.85);
  --card-border: rgba(60, 60, 67, 0.12);
  --label: #1c1c1e;
  --secondary: #6e6e73;
  --tertiary: #98989f;
  --fill: rgba(120, 120, 128, 0.14);
  --fill-strong: rgba(120, 120, 128, 0.22);
  --separator: rgba(60, 60, 67, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.16);
  --dock-bg: rgba(255, 255, 255, 0.62);
}

/* 深色模式 */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-glow-a: rgba(0, 122, 255, 0.24);
  --bg-glow-b: rgba(175, 82, 222, 0.2);
  --bg-glow-c: rgba(255, 45, 85, 0.16);
  --card: rgba(30, 30, 32, 0.62);
  --card-strong: rgba(44, 44, 46, 0.8);
  --card-border: rgba(255, 255, 255, 0.09);
  --label: #ffffff;
  --secondary: #98989f;
  --tertiary: #6e6e73;
  --fill: rgba(120, 120, 128, 0.24);
  --fill-strong: rgba(120, 120, 128, 0.38);
  --separator: rgba(84, 84, 88, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --dock-bg: rgba(22, 22, 24, 0.58);
}

/* ---------- 毛玻璃通用 ---------- */
.glass {
  background: var(--card);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
}

/* ---------- 背景光斑 ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
  animation: drift 26s ease-in-out infinite alternate;
}

.glow-a {
  top: -22vmax;
  left: -14vmax;
  background: var(--bg-glow-a);
}

.glow-b {
  top: 12vmax;
  right: -20vmax;
  background: var(--bg-glow-b);
  animation-delay: -8s;
}

.glow-c {
  bottom: -26vmax;
  left: 24vmax;
  background: var(--bg-glow-c);
  animation-delay: -16s;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(6vmax, -5vmax) scale(1.12);
  }
}

/* ---------- 顶部导航栏 ---------- */
.topbar {
  position: sticky;
  top: 10px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(1080px, calc(100% - 24px));
  margin: 10px auto 0;
  padding: 10px 18px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0a84ff, #bf5af2);
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.35);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--fill);
  color: var(--label);
}

/* 主题分段控件 */
.theme-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--fill);
  flex-shrink: 0;
}

.ts-btn {
  width: 32px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.ts-btn.active {
  background: var(--card-strong);
  color: var(--label);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 110px 20px 150px;
}

.hero-inner {
  max-width: 720px;
  width: 100%;
}

.avatar-wrap {
  position: relative;
  width: 132px;
  margin: 0 auto 8px;
}

.avatar-ring {
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #0a84ff, #bf5af2, #ff375f, #0a84ff);
  box-shadow: 0 10px 36px rgba(10, 132, 255, 0.28);
  animation: ring-spin 12s linear infinite;
}

.avatar {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #bf5af2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 700;
  color: #fff;
  user-select: none;
}

@keyframes ring-spin {
  to {
    transform: rotate(360deg);
  }
}

.online-dot {
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.3);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.3);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(52, 199, 89, 0.08);
  }
}

.hero-greet {
  margin-top: 22px;
  font-size: 15px;
  color: var(--secondary);
}

.hero-name {
  margin-top: 2px;
  font-size: clamp(42px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-role {
  min-height: 1.5em;
  margin-top: 6px;
  font-size: clamp(18px, 2.6vw, 24px);
  font-weight: 600;
  color: var(--accent);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -0.08em;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-desc {
  max-width: 560px;
  margin: 14px auto 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease,
    background 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 122, 255, 0.35);
}

.btn-secondary {
  background: var(--fill-strong);
  color: var(--label);
}

.hero-stats {
  display: flex;
  width: min(460px, 100%);
  margin: 34px auto 0;
  padding: 18px 10px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat + .stat {
  border-left: 1px solid var(--separator);
}

.stat strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stat span {
  font-size: 12px;
  color: var(--secondary);
}

/* 漂浮图标 */
.float-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.f-icon {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: var(--card-strong);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}

.fi-1 { top: 22%; left: 7%; }
.fi-2 { top: 32%; right: 8%; animation-delay: -1.2s; }
.fi-3 { top: 55%; left: 12%; animation-delay: -2.4s; }
.fi-4 { top: 63%; right: 12%; animation-delay: -3.6s; }
.fi-5 { top: 76%; left: 6%; animation-delay: -4.8s; }
.fi-6 { top: 45%; right: 4%; animation-delay: -6s; }

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(3deg);
  }
}

@media (max-width: 900px) {
  .float-icons {
    display: none;
  }
}

/* ---------- 通用区块 ---------- */
.section {
  padding: 86px 20px;
  scroll-margin-top: 78px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.container-narrow {
  max-width: 720px;
}

.section-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-sub {
  margin-top: 4px;
  margin-bottom: 36px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--tertiary);
}

.card {
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.card p {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--secondary);
}

.card p + p {
  margin-top: 10px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
}

@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.check-list {
  list-style: none;
  margin-top: 4px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--secondary);
}

.check-list li::before {
  content: "✓";
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.18);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-list strong {
  color: var(--label);
  font-weight: 600;
}

/* ---------- 技能（App 图标网格） ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 16px;
}

.skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 20px 10px;
  border-radius: var(--radius);
  background: var(--card);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}

.skill:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.skill-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  color: #fff;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.16),
    0 6px 16px rgba(0, 0, 0, 0.2);
}

.skill-name {
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

.skill-dots {
  display: flex;
  gap: 3px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--fill-strong);
}

.dot.on {
  background: var(--green);
}

/* ---------- 项目卡片 ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--card);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease;
}

.project:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.project-thumb {
  position: relative;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 58px;
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.18), transparent 60%);
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 20px 22px 22px;
}

.project-title {
  font-size: 17px;
  font-weight: 700;
}

.project-desc {
  font-size: 14px;
  line-height: 1.75;
  color: var(--secondary);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--secondary);
  font-size: 11.5px;
  font-weight: 600;
}

.project-link {
  margin-top: auto;
  padding-top: 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.25s var(--ease);
}

.project-link:hover {
  gap: 9px;
}

/* ---------- 设置列表风格（经历 / 联系） ---------- */
.group-label {
  margin: 30px 0 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

.settings-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--card);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow);
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  text-decoration: none;
  color: inherit;
  transition: background 0.25s ease;
}

.setting-row + .setting-row {
  border-top: 0.5px solid var(--separator);
}

a.setting-row:hover {
  background: var(--fill);
}

.setting-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.14);
}

.setting-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.setting-title {
  font-size: 15.5px;
  font-weight: 500;
}

.setting-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--secondary);
}

.setting-time {
  margin-top: 2px;
  font-size: 12px;
  color: var(--tertiary);
}

.setting-chevron {
  flex: none;
  font-size: 20px;
  color: var(--tertiary);
  font-weight: 400;
}

/* ---------- 应用图标渐变色板 ---------- */
.g-blue    { background: linear-gradient(135deg, #0a84ff, #64d2ff); }
.g-indigo  { background: linear-gradient(135deg, #5e5ce6, #9a9aff); }
.g-purple  { background: linear-gradient(135deg, #bf5af2, #d0a1ff); }
.g-pink    { background: linear-gradient(135deg, #ff375f, #ff6482); }
.g-orange  { background: linear-gradient(135deg, #ff9f0a, #ffd60a); }
.g-green   { background: linear-gradient(135deg, #30d158, #66d4cf); }
.g-teal    { background: linear-gradient(135deg, #64d2ff, #40cbe0); }
.g-red     { background: linear-gradient(135deg, #ff453a, #ff6961); }
.g-gray    { background: linear-gradient(135deg, #8e8e93, #c7c7cc); }

/* ---------- 底部 Dock ---------- */
.dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--dock-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 54px;
  padding: 7px 9px;
  border-radius: 15px;
  text-decoration: none;
  color: var(--secondary);
  transition: background 0.25s ease, color 0.25s ease;
}

.dock-item:hover,
.dock-item.active {
  background: var(--fill);
  color: var(--label);
}

.dock-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  color: #fff;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.16),
    0 5px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s var(--ease);
}

.dock-item.active .dock-icon {
  transform: scale(1.08);
}

.dock-label {
  font-size: 10px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .dock-label {
    display: none;
  }

  .dock-item {
    min-width: 46px;
    padding: 6px 7px;
  }
}

/* ---------- 页脚 ---------- */
.footer {
  padding: 34px 20px 120px;
  text-align: center;
  font-size: 13px;
  color: var(--tertiary);
}

.back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.25s var(--ease);
}

.back-top:hover {
  gap: 11px;
}

/* ---------- 滚动进场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.4s; }

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--fill-strong);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
