/* --- 全局重置 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

:root {
  color-scheme: dark;
  /* iOS 风格强调色：更纯净的蓝紫色 */
  --accent: #9e8cfc; 
  --accent-soft: rgba(158, 140, 252, 0.15);
  
  /* 颜色定义 */
  --bg-page: #000000;
  --text-main: #ffffff;
  --text-soft: rgba(235, 235, 245, 0.6); /* iOS 风格次级文本颜色 */
  
  /* iOS 核心玻璃材质变量 */
  --ios-glass: rgba(30, 30, 35, 0.5);
  --ios-glass-border: rgba(255, 255, 255, 0.12);
  --ios-blur: blur(50px) saturate(180%);
  --ios-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Noto Sans SC", "Helvetica Neue", sans-serif; /* 优先使用苹果系统字体 */
  color: var(--text-main);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -44px;
  z-index: 10000;
  padding: 8px 12px;
  border-radius: 10px;
  background: #ffffff;
  color: #000000;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.noscript-tip {
  margin: 12px auto 0;
  width: min(900px, calc(100% - 24px));
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 10px;
  background: rgba(255, 204, 0, 0.18);
  border: 1px solid rgba(255, 204, 0, 0.35);
  color: rgba(255, 255, 255, 0.95);
}

/* --- 动态背景 --- */
.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-page);
}

.background video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.8; /* 稍微压暗背景视频，让前景更突出 */
}

@media (max-width: 768px) {
  .background video { display: none; }
  .background {
    background-image: url('mobile-bg.jpg');
    background-size: cover;
    background-position: center;
  }
}

/* --- 布局容器 --- */
.page {
  position: relative;
  min-height: 100vh;
  padding: 40px 24px 60px; /* 增加顶部留白 */
  display: flex;
  flex-direction: column;
}

/* --- 顶部导航 (灵感岛风格) --- */
.top-bar {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  /* iOS 玻璃质感 */
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: var(--ios-blur);
  -webkit-backdrop-filter: var(--ios-blur);
  border: 1px solid var(--ios-glass-border);
  
  border-radius: 99px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  animation: slideDown 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.top-left { display: flex; align-items: center; gap: 12px; }

.status-dot {
  width: 8px; height: 8px;
  background: #32d74b; /* iOS Green */
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(50, 215, 75, 0.5);
  animation: pulse 3s infinite;
}

.page-info { display: flex; flex-direction: column; line-height: 1.2; }
.page-title { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.page-subtitle { font-size: 10px; color: var(--text-soft); font-weight: 500; }

.top-right {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; color: var(--text-soft);
  font-weight: 500;
}
.time-display { font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }

/* --- 内容区域 --- */
.content { width: 100%; max-width: 900px; margin: 60px auto 0; flex: 1; }

/* --- 头像区域 (移除旋转，改为纯净玻璃圆环) --- */
.avatar-wrapper {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; margin-bottom: 50px;
  animation: fadeIn 1s ease-out;
}

.avatar-circle {
  position: relative; width: 128px; height: 128px;
  border-radius: 50%; 
  padding: 6px; /* 玻璃环厚度 */
  
  /* 静态玻璃环效果 */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* 移除旋转动画伪元素 */
.avatar-circle::before { display: none; }

.avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
  background: #000;
}

.avatar-inner img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.avatar-circle:hover .avatar-inner img { transform: scale(1.1); }

.avatar-info { text-align: center; }
.avatar-name {
  font-size: 28px; font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.avatar-tags { display: flex; gap: 8px; justify-content: center; }

/* iOS 胶囊标签风格 */
.avatar-tag {
  font-size: 11px; font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.3s;
}
.avatar-tag:hover { background: rgba(255, 255, 255, 0.15); }

/* --- 卡片网格 --- */
.cards-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}

/* --- 卡片样式重构 (核心 Glassmorphism) --- */
.card {
  position: relative;
  border-radius: 24px; /* 更圆润的角 */
  overflow: hidden;
  animation: slideUp 0.6s ease-out backwards;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1;

  /* 移除原本的 ::after 和 ::before 复杂层叠 */
  background: var(--ios-glass);
  backdrop-filter: var(--ios-blur);
  -webkit-backdrop-filter: var(--ios-blur);
  border: 1px solid var(--ios-glass-border);
  box-shadow: var(--ios-shadow);
}

/* 移除旧的旋转背景 */
.card::before, .card::after { content: none; }

.card:hover {
  transform: translateY(-6px) scale(1.01);
  background: rgba(40, 40, 45, 0.6); /* Hover 变亮一点点 */
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.card-content-wrapper { padding: 26px; height: 100%; display: flex; flex-direction: column;}

/* 动画延迟 */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.25s; }
.card:nth-child(5) { animation-delay: 0.3s; }

.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

/* 极简图标容器 */
.card-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff; 
  font-size: 18px;
}

.card-title { font-size: 17px; font-weight: 600; color: #fff; letter-spacing: -0.3px; }

.card-body {
  font-size: 14px; line-height: 1.6;
  color: var(--text-soft);
  font-weight: 400;
}
.card-body strong { color: #fff; font-weight: 600; }
.card-body p + p { margin-top: 8px; }
.card-highlight { margin-bottom: 8px; }

/* --- 技能条 (iOS 风格) --- */
.skill-item { margin-bottom: 14px; }
.skill-meta { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.7); }

.skill-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  /* 纯色渐变，更干净 */
  background: linear-gradient(90deg, #8e2de2, #4a00e0);
  border-radius: 10px;
  width: var(--percent);
}

/* --- 社交链接 --- */
.social-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; padding-top: 15px; }

.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.05);
  appearance: none;
}

.social-btn:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.social-btn:hover i { color: #000; }
.social-btn i { font-size: 16px; color: rgba(255,255,255,0.8); transition: color 0.2s; }

.project-link {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.project-link:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border-color: rgba(255,255,255,0.18);
}

.project-link-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-link-label strong {
  font-size: 14px;
  color: #fff;
}

.project-link-label span {
  font-size: 12px;
  color: rgba(255,255,255,0.68);
}

.project-link i {
  font-size: 18px;
  color: rgba(255,255,255,0.82);
}

/* --- 底部版权 --- */
.footer-credit {
  margin-top: 50px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: fadeIn 1s ease-out 0.8s backwards;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.icp-info {
  font-size: 12px;
  opacity: 0.6;
}

.icp-info a {
  color: inherit;
  text-decoration: none;
}
.credit-capsule {
  padding: 6px 16px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 99px;
  font-size: 11px; color: var(--text-soft);
  display: flex; align-items: center; gap: 6px;
  transition: transform 0.2s;
}
.credit-capsule:hover { transform: translateY(-2px); background: rgba(0,0,0,0.6); }
.credit-link { color: #fff; text-decoration: none; font-weight: 500; opacity: 0.8; }
.credit-link:hover { opacity: 1; }

.icp-link {
  font-size: 10px;
  color: var(--text-soft);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.icp-link:hover { opacity: 0.9; text-decoration: underline; }

/* --- 模态框 (iOS Alert 风格) --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.4); /* 背景暗度降低 */
  backdrop-filter: blur(15px); /* 背景极大模糊 */
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-box {
  position: relative; width: 85%; max-width: 300px;
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 24px;
  text-align: center;
  transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}
.modal-overlay.active .modal-box { transform: scale(1); }

.modal-icon-wrapper {
  width: 48px; height: 48px; margin: 0 auto 16px;
  background: rgba(255,255,255,0.1); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: #fff; }
.modal-desc { font-size: 13px; color: var(--text-soft); margin-bottom: 20px; }

.modal-data-box {
  background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 10px; margin-bottom: 20px;
  font-family: monospace; font-size: 15px; color: #fff;
  user-select: all;
}

.modal-checkbox-wrapper {
  margin-bottom: 20px;
  color: var(--text-soft);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.modal-checkbox-wrapper input {
  accent-color: var(--accent);
  width: 16px; height: 16px;
  cursor: pointer;
}
.modal-checkbox-wrapper label { cursor: pointer; }

.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1; padding: 12px; border-radius: 12px;
  font-size: 13px; font-weight: 600; border: none; cursor: pointer;
}
.btn-cancel { background: rgba(255,255,255,0.08); color: #fff; }
.btn-copy { background: #fff; color: #000; }

button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

/* --- 响应式微调 --- */
@media (max-width: 900px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .page { padding: 15px 16px; }
  .cards-grid { grid-template-columns: 1fr; }
  .top-right { display: none; }
  .avatar-circle { width: 110px; height: 110px; }
}

/* 简单的动画定义 */
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* 浅色模式适配 (保留功能，优化配色) */
html.light {
  --bg-page: #f2f2f7; /* iOS System Gray 6 */
  --text-main: #000000;
  --text-soft: rgba(60, 60, 67, 0.6);
  
  --ios-glass: rgba(255, 255, 255, 0.65);
  --ios-glass-border: rgba(255, 255, 255, 0.4);
  --ios-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

html.light .top-bar { background: rgba(255, 255, 255, 0.7); border-color: rgba(0,0,0,0.05); }
html.light .card-title, html.light .avatar-name { color: #000; text-shadow: none; }
html.light .card-icon { background: rgba(0,0,0,0.05); color: #000; }
html.light .social-btn { background: rgba(0,0,0,0.05); color: #000; }
html.light .social-btn:hover { background: #000; color: #fff; }

/* --- Toast 提示 --- */
.toast {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(50, 215, 75, 0.9); /* iOS Green style */
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
