/* ===== 变量 ===== */
:root {
  --primary: #254665;
  --dark: #1B3E5E;
  --blue: #38BDF8;
  --bg: #F4F7FA;
  --text: #172033;
  --muted: #667085;
  --card: #fff;
  --line: #E5EAF0;
  --glass-bg: rgba(255, 255, 255, .55);
  --glass-border: rgba(255, 255, 255, .65);
  --glass-shadow: 0 8px 32px rgba(37, 70, 101, .12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(56, 189, 248, .12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(37, 70, 101, .08), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(56, 189, 248, .06), transparent);
  background-attachment: fixed;
}

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 导航栏 ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 4px 24px rgba(37, 70, 101, .06);
}

nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--primary);
  font-size: 22px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 26px rgba(37, 70, 101, .25);
  transition: transform .3s ease;
}

.logo:hover .logo-icon {
  transform: scale(1.06) rotate(-3deg);
}

.nav-links {
  display: flex;
  gap: 8px;
  color: #475467;
  font-size: 14px;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 10px;
  transition: color .25s, background .25s;
}

.nav-links a:hover {
  color: var(--primary);
  background: rgba(37, 70, 101, .06);
}

/* ===== Hero 首屏 ===== */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, .22), transparent 28%),
    radial-gradient(circle at 85% 75%, rgba(56, 189, 248, .1), transparent 24%),
    linear-gradient(135deg, #254665 0%, #102A43 54%, #081827 100%);
  color: #fff;
  padding: 90px 0 80px;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(56, 189, 248, .15), transparent 70%);
}

.hero::before {
  width: 480px;
  height: 480px;
  top: -120px;
  right: -80px;
  animation: float 8s ease-in-out infinite;
}

.hero::after {
  width: 320px;
  height: 320px;
  bottom: -60px;
  left: -40px;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 50px;
  align-items: center;
}

.badge {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(8px);
  color: #DDF5FF;
  font-size: 14px;
  margin-bottom: 24px;
}

h1 {
  font-size: 58px;
  line-height: 1.08;
  letter-spacing: -1.8px;
  margin-bottom: 18px;
}

.hero h2 {
  color: #A8DDF5;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero p {
  color: #D7E4EE;
  font-size: 17px;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 14px;
  font-weight: 700;
  transition: transform .25s, box-shadow .25s, background .25s;
}

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

.btn-primary {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .45);
}

.profile-card {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 28px;
  padding: 34px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .15);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  transition: transform .35s ease, box-shadow .35s ease;
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 36px 90px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.avatar {
  width: 108px;
  height: 108px;
  border-radius: 30px;
  background: linear-gradient(135deg, #fff, #BEEBFF);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 900;
  margin-bottom: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
}

/* ===== 联系方式列表 ===== */
.contact-list,
.contact-box {
  display: grid;
  gap: 4px;
  font-size: 15px;
}

.contact-list {
  color: #E8F5FF;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #A8DDF5;
}

.contact-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-icon--brand svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.contact-icon--brand svg path {
  fill: currentColor;
  stroke: none;
}

.contact-text {
  flex: 1;
  line-height: 1.5;
}

/* ===== 通用区块 ===== */
section {
  padding: 74px 0;
}

.section-title {
  margin-bottom: 34px;
}

.section-title span {
  display: block;
  color: #2563EB;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 8px;
}

.section-title h2 {
  font-size: 34px;
  color: #111827;
  letter-spacing: -.8px;
}

/* ===== 卡片 ===== */
.about-grid,
.education {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.about-grid .card:last-child:nth-child(5) {
  grid-column: 1 / -1;
}

.card,
.skill,
.edu-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.card:hover,
.edu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(37, 70, 101, .12);
  border-color: rgba(56, 189, 248, .35);
}

.card h3,
.edu-card h3 {
  color: var(--primary);
  font-size: 21px;
  margin-bottom: 12px;
}

.card p,
.card li,
.edu-card p {
  color: #475467;
  font-size: 15px;
}

/* ===== 数据统计 ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.stat {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(37, 70, 101, .1);
}

.stat strong {
  display: block;
  font-size: 30px;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat span {
  color: var(--muted);
  font-size: 14px;
}

/* ===== 时间线 ===== */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 3px solid rgba(37, 70, 101, .15);
}

.timeline-item {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform .3s ease, box-shadow .3s ease;
}

.timeline-item:hover {
  transform: translateX(6px);
  box-shadow: 0 16px 40px rgba(37, 70, 101, .1);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 30px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  box-shadow: 0 0 0 6px rgba(37, 70, 101, .13);
}

.time {
  display: inline-block;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--dark));
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  margin-bottom: 12px;
}

.timeline-item h3 {
  font-size: 22px;
  color: #111827;
  margin-bottom: 8px;
}

.timeline-item p {
  color: #475467;
  font-size: 15px;
}

.timeline-item ul {
  margin-top: 14px;
  padding-left: 20px;
  color: #475467;
  font-size: 14px;
  line-height: 1.7;
}

.timeline-item li {
  margin-bottom: 8px;
}

.timeline-item li:last-child {
  margin-bottom: 0;
}

/* ===== 技能网格 ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.skill {
  min-height: 150px;
}

.skill:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(37, 70, 101, .12);
  border-color: rgba(56, 189, 248, .4);
}

.skill-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(37, 70, 101, .08);
}

.skill h3 {
  color: #111827;
  font-size: 18px;
  margin-bottom: 8px;
}

.skill p {
  color: #5B6677;
  font-size: 14px;
}

.skills-category {
  grid-column: 1 / -1;
  margin-top: 16px;
  margin-bottom: 34px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.skills-category span {
  display: block;
  color: #2563EB;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 8px;
}

.skills-category h2 {
  font-size: 34px;
  color: #111827;
  letter-spacing: -.8px;
}

/* ===== 联系区块 ===== */
.contact-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 60%, #0a1f33 100%);
  color: #fff;
  border-radius: 34px;
  padding: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  box-shadow: 0 24px 64px rgba(37, 70, 101, .25);
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, .15), transparent 70%);
  pointer-events: none;
}

.contact-section h2 {
  font-size: 32px;
  margin-bottom: 10px;
  position: relative;
}

.contact-section p {
  color: #D7E4EE;
  position: relative;
}

.contact-box {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 20px 24px;
  border-radius: 24px;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  position: relative;
  color: #E8F5FF;
}

.contact-box a {
  color: #A8DDF5;
  transition: color .2s;
}

.contact-box a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ===== 页脚 ===== */
footer {
  text-align: center;
  padding: 34px 0;
  color: #667085;
  font-size: 14px;
  border-top: 1px solid rgba(37, 70, 101, .06);
  margin-top: 20px;
}

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow:
    0 8px 32px rgba(37, 70, 101, .15),
    inset 0 1px 0 rgba(255, 255, 255, .6);
  color: var(--primary);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(.9);
  transition: opacity .35s ease, visibility .35s ease, transform .35s ease, background .25s, box-shadow .25s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  background: rgba(255, 255, 255, .65);
  box-shadow:
    0 12px 40px rgba(37, 70, 101, .2),
    inset 0 1px 0 rgba(255, 255, 255, .8);
  transform: translateY(-3px) scale(1.04);
}

.back-to-top:active {
  transform: translateY(0) scale(.96);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 访问口令弹窗 ===== */
html:not(.auth-ok) #pageContent {
  display: none !important;
}

html.auth-ok #accessGate {
  display: none !important;
}

html:not(.auth-ok) {
  overflow: hidden;
}

#accessGate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, .18), transparent 28%),
    linear-gradient(135deg, #254665 0%, #102A43 54%, #081827 100%);
}

.gate-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  border-radius: 28px;
  text-align: center;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .15);
  animation: gateIn .45s ease;
}

@keyframes gateIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.gate-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), var(--dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .25);
}

.gate-card h2 {
  color: #fff;
  font-size: 24px;
  margin-bottom: 8px;
  letter-spacing: -.5px;
}

.gate-card p {
  color: #A8DDF5;
  font-size: 14px;
  margin-bottom: 28px;
}

.gate-form {
  display: grid;
  gap: 14px;
}

.gate-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 16px;
  backdrop-filter: blur(8px);
  outline: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
}

.gate-input::placeholder {
  color: rgba(255, 255, 255, .4);
}

.gate-input:focus {
  border-color: rgba(56, 189, 248, .6);
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .15);
}

.gate-submit {
  padding: 14px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: #fff;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  transition: transform .25s, box-shadow .25s;
}

.gate-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.gate-submit:active {
  transform: translateY(0);
}

.gate-error {
  color: #FCA5A5;
  font-size: 13px;
  min-height: 20px;
  opacity: 0;
  transition: opacity .25s;
}

.gate-error.show {
  opacity: 1;
}

.gate-shake {
  animation: shake .45s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .education,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 42px;
  }

  .nav-links {
    display: none;
  }

  .back-to-top {
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 560px) {
  .skills-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 36px;
  }

  section {
    padding: 52px 0;
  }

  .hero {
    padding: 70px 0;
  }

  .contact-section {
    padding: 28px;
  }
}
