/* ============================================================
   我的主页 · 样式表
   ------------------------------------------------------------
   整站只有这一个 CSS 文件，没有任何框架。
   想改配色 → 只改下面 :root 和 [data-theme="dark"] 里的变量，
   全站会自动跟着变。这是 CSS 变量最强的地方。
   ============================================================ */

:root {
  /* 亮色（白天）配色 */
  --bg: #fbfbfd;
  --bg-soft: #f3f5f9;
  --card: #ffffff;
  --ink: #0f1218;        /* 主文字 */
  --ink-2: #4a5364;      /* 次要文字 */
  --ink-3: #8b94a6;      /* 弱文字（日期、编号） */
  --line: #e6e9f0;       /* 分割线 / 边框 */
  --accent: #1a7cf5;     /* 主题蓝 */
  --accent-2: #6aa9ff;
  --accent-soft: #eaf2ff;
  --nav-bg: rgba(251, 251, 253, .82);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 16px 40px -20px rgba(16, 24, 40, .18);
  --radius: 16px;
  --max: 1060px;
}

/* 深色（夜晚）配色 —— 只换变量，其他规则一行都不用改 */
[data-theme="dark"] {
  --bg: #0b0d10;
  --bg-soft: #101318;
  --card: #14181e;
  --ink: #eef1f6;
  --ink-2: #a7b0c0;
  --ink-3: #6c7686;
  --line: #232830;
  --accent: #4c9bff;
  --accent-2: #2b6fd0;
  --accent-soft: #101d31;
  --nav-bg: rgba(11, 13, 16, .82);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 48px -24px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

/* 页面顶部一层极淡的蓝光，让纯色背景不死板 */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  background: radial-gradient(60% 60% at 70% 0%, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

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

::selection { background: var(--accent); color: #fff; }

/* 键盘用户聚焦时的描边，别删，这是无障碍 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}

.brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.02em;
  margin-right: auto;
}

.brand span { color: var(--accent); }

.nav nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--ink-2);
}

.nav nav a { transition: color .18s; }
.nav nav a:hover { color: var(--ink); }

.theme {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 15px;
  transition: .18s;
}
.theme:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---------------- 首屏 ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  align-items: center;
  gap: 48px;
  padding-block: 84px 76px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: .02em;
}

.eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}

h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.05;
  letter-spacing: -.04em;
  font-weight: 800;
}

.lead {
  margin: 20px 0 0;
  max-width: 34em;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  transition: .2s;
}
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--accent);
}
.btn.primary:hover { filter: brightness(1.06); }

/* 头像 */
.hero-img {
  justify-self: center;
  position: relative;
}
.hero-img img {
  width: clamp(180px, 22vw, 250px);
  height: clamp(180px, 22vw, 250px);
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .4s;
}
.hero-img:hover img { transform: scale(1.03) rotate(-1.5deg); }

/* 头像外面那圈虚线 */
.hero-img::after {
  content: "";
  position: absolute;
  inset: -14px;
  border: 1px dashed var(--line);
  border-radius: 50%;
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 三个数据 */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.stats b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.stats span {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

/* ---------------- 通用小节 ---------------- */
.sec {
  padding-block: 68px;
  border-top: 1px solid var(--line);
}

.sec-label {
  margin: 0 0 14px;
  font: 500 12px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .18em;
  color: var(--accent);
  text-transform: uppercase;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -.035em;
  font-weight: 800;
  line-height: 1.2;
}

.sec-intro {
  margin: 0 0 34px;
  max-width: 36em;
  color: var(--ink-2);
}

/* ---------------- 关于 ---------------- */
.about {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 42px;
  align-items: start;
}

.about p {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 15.5px;
}
.about p strong { color: var(--ink); font-weight: 700; }

/* 右侧「现在在做什么」卡片 */
.now {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.now h3 {
  margin: 0 0 16px;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
}
.now dl { margin: 0; display: grid; gap: 14px; }
.now dt { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.now dd { margin: 0; font-size: 14.5px; }

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

.work {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: .25s ease;
  position: relative;
  overflow: hidden;
}
.work:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent-2);
}

.work .idx {
  font: 500 12px/1 ui-monospace, Consolas, monospace;
  color: var(--ink-3);
  letter-spacing: .08em;
}

.work h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
  line-height: 1.35;
}

.work p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  flex: 1;
}

.work-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}
.tag.live { background: rgba(34, 197, 94, .12); color: #15803d; }
[data-theme="dark"] .tag.live { color: #4ade80; }
.tag.wip { background: rgba(245, 158, 11, .14); color: #b45309; }
[data-theme="dark"] .tag.wip { color: #fbbf24; }

.arrow { color: var(--accent); font-weight: 600; }

/* ---------------- 路线图 ---------------- */
/* ---------------- 联系 ---------------- */
.contact { text-align: left; }
.mailto {
  display: inline-block;
  margin: 6px 0 26px;
  font-size: clamp(22px, 4.4vw, 40px);
  font-weight: 800;
  letter-spacing: -.035em;
  border-bottom: 2px solid var(--accent);
  line-height: 1.35;
  word-break: break-all;
}
.mailto:hover { color: var(--accent); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.links a {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-2);
  transition: .18s;
}
.links a:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }

/* ---------------- 页脚 ---------------- */
footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 46px;
  font-size: 13px;
  color: var(--ink-3);
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
}

/* ---------------- 手机 ---------------- */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-block: 52px 56px;
    text-align: left;
  }
  .hero-img { order: -1; justify-self: start; }
  .hero-img::after { display: none; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .nav nav { display: none; }
  .stats { gap: 26px; }
}

/* 系统里开了「减少动态效果」的人，不该被动画打扰 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
