/* ============================================================
   kutree — 个人主页样式
   配色参考 Canva 蓝黄作品集模板：天蓝主色 + 明黄点缀
   产品入口为 Launchpad 式 App 图标网格
   ============================================================ */

:root {
  --blue: #4f9fe8;
  --blue-deep: #2e7cd6;
  --blue-soft: #e3f0fc;
  --yellow-deep: #f5a623;
  --ink: #1f2d3d;
  --ink-soft: #5b6b7c;
  --ink-faint: #93a3b3;
  --line: #e2ebf3;
  --font: ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

/* 两页统一预留滚动条宽度，避免页面高度不同时导航栏位置跳动 */
html {
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ---------- Header ---------- */
.site-header {
  padding: 0 24px;
}

.nav {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.nav ul {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav a:not(.logo) {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:not(.logo):hover {
  color: var(--blue-deep);
  background: var(--blue-soft);
}

.nav a.active {
  color: #fff;
  background: var(--blue);
}

/* ---------- Layout ---------- */
.container {
  flex: 1;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

/* ---------- Hero（极简居中） ---------- */
.hero {
  text-align: center;
  padding: 48px 0 8px;
  animation: rise 0.5s ease both;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero .aka {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-faint);
}

.hero .tagline {
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 600;
  margin-top: 6px;
}

/* ---------- 区块标题 ---------- */
section {
  margin-top: 56px;
}

section h2 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

/* 首页区块内容居中 */
body.home section h2 {
  text-align: center;
}

/* ---------- 产品：App 图标网格 ---------- */
.app-grid {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px 48px;
}

.app-tile {
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding: 8px 4px;
  border-radius: 16px;
}

.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(31, 45, 61, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
}

.app-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

a.app-tile:hover .app-icon {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 14px 28px rgba(46, 124, 214, 0.28);
}

.app-icon--placeholder {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: #fff;
  font-size: 40px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-name {
  font-weight: 700;
  font-size: 15px;
}

.app-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow-deep);
  background: rgba(255, 197, 61, 0.18);
  border-radius: 999px;
  padding: 2px 10px;
}

.is-placeholder {
  cursor: default;
}

/* ---------- Resume 页（白色背景 + 低调配色） ---------- */
.resume-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.resume-head h1 {
  font-size: 26px;
  font-weight: 800;
}

.lang-toggle {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-toggle:hover {
  border-color: var(--blue);
  color: var(--blue-deep);
}

html[data-lang="en"] .lang-zh { display: none; }
html[data-lang="zh"] .lang-en { display: none; }

body.resume-page section h2 {
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

body.resume-page .container {
  animation: rise 0.4s ease both;
}

.timeline {
  list-style: none;
  display: grid;
  gap: 14px;
}

.timeline li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: baseline;
}

.timeline .period {
  font-size: 14px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.pubs {
  list-style: none;
  display: grid;
  gap: 16px;
}

.pubs strong {
  color: var(--ink);
}

.pubs li {
  color: var(--ink-soft);
}

.resume section p + p {
  margin-top: 8px;
}

.resume section > div,
.resume section > ul {
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 24px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink-soft);
}

/* ---------- 动效 ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rise {
  animation: rise 0.5s ease both;
  animation-delay: var(--d, 0s);
}

/* 尊重用户的减弱动效设置 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 30px;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
