:root {
  --navy: #14283f;
  --navy-2: #1e3a5c;
  --gold: #d9a441;
  --bg: #faf9f6;
  --card: #ffffff;
  --text: #232a33;
  --muted: #5b6673;
  --border: #e6e2da;
  --heading: #14283f;
  --nav-bg: rgba(250, 249, 246, 0.92);
}

/* 深色模式 */
[data-theme="dark"] {
  --navy: #0d1a2b;
  --navy-2: #16304a;
  --gold: #e3b45e;
  --bg: #0f1621;
  --card: #17212f;
  --text: #e6e4df;
  --muted: #97a3b0;
  --border: #27354a;
  --heading: #e6e4df;
  --nav-bg: rgba(15, 22, 33, 0.92);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans",
    "Microsoft YaHei", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12); }
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--heading);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.nav-right a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.nav-right a:hover { color: var(--heading); }

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.lang-switch button.active {
  background: var(--gold);
  color: #14283f;
  font-weight: 600;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.theme-toggle:hover { transform: scale(1.08); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  text-align: center;
  padding: 5.5rem 1.2rem 5rem;
}
#particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 2.4rem;
  letter-spacing: 0.02em;
  min-height: 1.4em;
}
.hero h1.typing::after {
  content: "|";
  color: var(--gold);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-divider {
  width: 64px;
  height: 3px;
  background: var(--gold);
  margin: 1.4rem auto;
  border-radius: 2px;
}
.hero .tagline {
  font-size: 1.15rem;
  opacity: 0.95;
}
.hero .sub {
  margin-top: 0.6rem;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
}
.btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.7rem 2.2rem;
  background: var(--gold);
  color: #14283f;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(217, 164, 65, 0.35);
}

/* ---------- 通用区块 ---------- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.2rem;
}
section { padding: 3.2rem 0 0.5rem; }
section h2 {
  color: var(--heading);
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  position: relative;
}
section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 56px;
  height: 2px;
  background: var(--gold);
}
section p { color: var(--text); margin-bottom: 0.8rem; }
.sub-title { color: var(--heading); margin: 1.6rem 0 0.4rem; font-size: 1.05rem; }
.interests { color: var(--muted); }

/* ---------- 滚动显现动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--d, 0s);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- 实习经历 ---------- */
.exp-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.exp-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.exp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.exp-head h3 {
  font-size: 1.05rem;
  color: var(--heading);
}
.exp-role {
  font-size: 0.85rem;
  color: var(--gold);
  background: rgba(217, 164, 65, 0.12);
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}
.exp-item p {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- 校园经历 ---------- */
.plain-list {
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
}
.plain-list li {
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}
.plain-list li:last-child { border-bottom: none; }
.plain-list li::before {
  content: "◆";
  color: var(--gold);
  font-size: 0.7rem;
  margin-right: 0.6rem;
  vertical-align: 1px;
}

/* ---------- 技能 ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.skill-card h3 {
  color: var(--heading);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.skill-card p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

/* ---------- 联系 ---------- */
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  max-width: 420px;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0;
}
.contact-label {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 3.5em;
}
.contact-row a {
  color: var(--heading);
  text-decoration: none;
  font-weight: 600;
}
.contact-row a:hover { text-decoration: underline; }

/* ---------- 页脚 ---------- */
footer {
  margin-top: 3.5rem;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 1.6rem 1.2rem;
  font-size: 0.85rem;
}

/* ---------- 回到顶部 ---------- */
#back-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  color: #14283f;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
#back-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
#back-top:hover { transform: translateY(-2px); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .nav-right { gap: 0.6rem; }
  .skill-grid { grid-template-columns: 1fr; }
}

/* 尊重系统的减少动态效果设置 */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
