/* ---------- 主题变量 ---------- */
:root {
  --bg: #fbfaf8;
  --bg-soft: #f2f0ec;
  --fg: #1c1b19;
  --fg-muted: #6b6862;
  --line: #e3dfd8;
  --accent: #b4532a;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(28, 27, 25, .04), 0 8px 24px -12px rgba(28, 27, 25, .12);
  --glow: 0 0 0 1px rgba(180, 83, 42, .10),
          0 0 28px -8px rgba(180, 83, 42, .55),
          0 0 64px -24px rgba(180, 83, 42, .45),
          0 0 140px -60px rgba(180, 83, 42, .35);
  --glow-soft: 0 0 24px -8px rgba(180, 83, 42, .42);
  --glow-off: 0 0 0 1px rgba(180, 83, 42, 0),
              0 0 28px -8px rgba(180, 83, 42, 0),
              0 0 64px -24px rgba(180, 83, 42, 0),
              0 0 140px -60px rgba(180, 83, 42, 0);

  --light-a:rgba(214,132,52,.17);
  --light-b:rgba(120,150,255,.10);
  --light-c:rgba(214,120,160,.08);
  --sheen:rgba(255,255,255,.55);
  --sheen-opacity:.55;
  --orb-a: rgba(214, 132, 52, .16);
  --orb-b: rgba(120, 150, 255, .09);
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #14130f;
  --bg-soft: #1c1a16;
  --fg: #ece8e1;
  --fg-muted: #9a958c;
  --line: #2e2a24;
  --accent: #e08a5f;
  --card: #1a1815;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px -14px rgba(0, 0, 0, .7);
  --glow: 0 0 0 1px rgba(224, 138, 95, .10), 0 0 32px -8px rgba(224, 138, 95, .85), 0 0 80px -26px rgba(224, 138, 95, .70);
  --glow-off: 0 0 0 1px rgba(224, 138, 95, 0), 0 0 32px -8px rgba(224, 138, 95, 0), 0 0 80px -26px rgba(224, 138, 95, 0);
  --glow-soft: 0 0 20px -8px rgba(224, 138, 95, .45);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .01em;
  transition: background .25s ease, color .25s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--accent); color: var(--bg); }

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
  box-shadow: var(--shadow), 0 0 30px -6px rgba(224,138,95,0);
  transition: transform .3s ease, border-color .4s ease,
              box-shadow 1s cubic-bezier(.45,0,.25,1);
}
.theme-toggle:hover { transform: rotate(-15deg) scale(1.05); border-color: rgba(224,138,95,.24); box-shadow: var(--shadow), var(--glow-soft); }

.theme-icon::before { content: "◐"; font-size: 18px; line-height: 1; }
html[data-theme="dark"] .theme-icon::before { content: "◑"; }

/* ---------- Hero ---------- */
.hero {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 84px 24px 56px;
  display: flex;
  gap: 28px;
  align-items: center;
}

.avatar {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.02em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 650;
}

.tagline {
  margin: 8px 0 16px;
  color: var(--fg-muted);
  font-size: 17px;
}

.links { display: flex; flex-wrap: wrap; gap: 18px; }
.links a {
  color: var(--fg-muted);
  font-size: 15px;
  position: relative;
}
.links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width .2s ease;
}
.links a:hover { color: var(--accent); text-decoration: none; }
.links a:hover::after { width: 100%; }

/* ---------- 区块 ---------- */
main { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.section { padding: 56px 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: none; }

h2 {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.lead { margin: 0; font-size: 17.5px; max-width: 60ch; }

/* ---------- 事实列表 ---------- */
.facts {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  background: var(--card);
  font-size: 15px;
}
.facts span { color: var(--fg-muted); }

#status { color: #2f9e44; }
html[data-theme="dark"] #status { color: #51cf66; }

/* ---------- 作品卡片 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow-off);
    transition: transform .3s ease, border-color .4s ease, box-shadow 1.1s cubic-bezier(.45,0,.25,1);
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(224, 138, 95, .18);
  box-shadow: var(--shadow), var(--glow);
}

.card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.card p { margin: 0 0 14px; color: var(--fg-muted); font-size: 14.5px; line-height: 1.6; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 12px;
  letter-spacing: .04em;
}

/* ---------- 笔记列表 ---------- */
.list { list-style: none; margin: 0; padding: 0; }

.list li {
  display: flex;
  gap: 20px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: none; }

.date {
  flex: 0 0 68px;
  color: var(--fg-muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.list a { color: var(--fg); }
.list a:hover { color: var(--accent); }

/* ---------- 技能标签 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chips span {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  color: var(--fg);
    box-shadow: var(--glow-off);
    transition: border-color .4s ease, color .4s ease, transform .3s ease, box-shadow 1.1s cubic-bezier(.45,0,.25,1);
}
.chips span:hover {
  border-color: transparent;
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

/* ---------- 经历时间线 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  display: flex;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: none; }
.timeline li:first-child { padding-top: 4px; }

.when {
  flex: 0 0 118px;
  color: var(--fg-muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.timeline h3 { margin: 0 0 4px; font-size: 16.5px; font-weight: 600; }
.timeline p { margin: 0; color: var(--fg-muted); font-size: 14.5px; line-height: 1.65; }

/* ---------- 区块内的更多链接 ---------- */
.more-link { margin: 22px 0 0; }
.more-link a {
  font-size: 14.5px;
  color: var(--accent);
  letter-spacing: .01em;
}
.more-link a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 按钮 ---------- */
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  font-size: 15px;
  box-shadow: var(--shadow), var(--glow-off);
    transition: border-color .4s ease, color .4s ease, transform .3s ease, box-shadow 1.1s cubic-bezier(.45,0,.25,1);
}
.btn:hover {
  border-color: transparent;
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--glow);
}

/* ---------- 页脚 ---------- */
footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  color: var(--fg-muted);
  font-size: 13.5px;
}
footer p { margin: 0; }

/* ---------- 移动端 ---------- */
@media (max-width: 560px) {
  .hero-inner { flex-direction: column; align-items: flex-start; padding-top: 64px; }
  .section { padding: 40px 0; }
  .list li { flex-direction: column; gap: 2px; }
  .date { flex: none; }
}

/* ---------- 移动端排版（全站共用） ---------- */
@media (max-width: 700px) {
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  img, video { max-width: 100%; height: auto; }

  /* 触控目标不小于 44px */
  .btn, .cat, .tool, .card .more, footer a { min-height: 44px; }
  .btn, .cat { padding: 11px 18px; }

  /* 筛选条横向滚动，不换行挤压 */
  .cats, .chips {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 4px;
  }
  .cats::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
  .cats > *, .chips > * { flex: 0 0 auto; }

  /* 网格降列 */
  .res-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .tools-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .grid { grid-template-columns: 1fr !important; }

  /* 卡片收紧 */
  .res { padding: 14px; }
  .res h3 { font-size: 15.5px; }
  .card { padding: 16px; border-radius: 12px; }

  /* 长文件名不能把卡片撑出屏幕 */
  .res, .card, .tool, .res-top > div { min-width: 0; }
  .res h3, .res .meta, .tool .t, .tool .m,
  .res .path-hint, .res .cat-tag {
    overflow-wrap: anywhere; word-break: break-word; white-space: normal;
  }

  /* 标题与正文比例 */
  h1 { font-size: 26px !important; line-height: 1.3; }
  h2 { font-size: 18px !important; }
  .muted, .sub, .meta { font-size: 12.5px; }

  /* 内容区留白，避免贴边 */
  .wrap, .res-wrap, .tools-wrap { padding-left: 16px !important; padding-right: 16px !important; }
}

@media (max-width: 400px) {
  .tools-grid { grid-template-columns: 1fr !important; }
}

/* ---------- 页面切换（Chrome/Edge 126+ 跨文档 View Transitions） ---------- */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: vt-out .16s ease both;
  }
  ::view-transition-new(root) {
    animation: vt-in .3s cubic-bezier(.2, .7, .2, 1) both;
  }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* 兜底：不支持 View Transitions 的浏览器，页面自身淡入 */
@media (prefers-reduced-motion: no-preference) {
  body { animation: page-in .34s cubic-bezier(.2, .7, .2, 1) both; }
}
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* 尊重"减少动态效果"偏好 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 环境光层（沉浸光感） ---------- */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden; contain: strict;
}
.ambient i {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(88px); will-change: transform;
  animation: orbDrift 52s ease-in-out infinite alternate;
}
.ambient i:nth-child(1) {
  width: 52vw; height: 52vw; left: -14vw; top: -16vw;
  background: radial-gradient(circle at 50% 50%, var(--orb-a), transparent 68%);
}
.ambient i:nth-child(2) {
  width: 44vw; height: 44vw; right: -12vw; top: 16vh;
  background: radial-gradient(circle at 50% 50%, var(--orb-b), transparent 70%);
  animation-duration: 68s; animation-delay: -12s;
}
@keyframes orbDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, -4vh, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .ambient i { animation: none; } }

/* 内容压在光层之上 */
body > header, body > main, body > section, body > footer { position: relative; z-index: 1; }
