/* =========================================================
   小茗 · Excel × AI 作品集
   设计语言：暖白底 + Excel 绿(#217346) → AI 蓝(#2563EB) 渐变
   移动端优先；断点：768px（平板/横屏）、1024px（桌面）
   ========================================================= */

/* ---------- 变量与基础 ---------- */
:root {
  --bg: #FAFAF8;
  --bg-soft: #F2F3EF;
  --card: #FFFFFF;
  --border: #E7E8E2;
  --text: #1A2332;
  --text-2: #4A5568;
  --text-3: #8A94A6;
  --green: #217346;
  --blue: #2563EB;
  --grad: linear-gradient(120deg, #217346 0%, #2C8FA0 50%, #2563EB 100%);
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(26, 35, 50, 0.06), 0 4px 14px rgba(26, 35, 50, 0.05);
  --shadow-md: 0 2px 6px rgba(26, 35, 50, 0.07), 0 10px 30px rgba(26, 35, 50, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "微软雅黑", "Segoe UI", "Noto Sans SC", sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

ul, ol { list-style: none; }

/* 键盘焦点可见性（无障碍） */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

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

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-logo-dot { color: var(--blue); }

.nav-menu {
  display: none;
  gap: 28px;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--text-2);
  padding: 6px 2px;
  transition: color 0.2s ease;
}

.nav-link:hover { color: var(--text); }

/* 汉堡按钮（移动端） */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端下拉菜单 */
.nav-menu.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 10px 20px 18px;
  gap: 4px;
}

.nav-menu.is-open .nav-link {
  display: block;
  padding: 12px 4px;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--bg-soft);
}

.nav-menu.is-open li:last-child .nav-link { border-bottom: none; }

/* ---------- 通用 Section ---------- */
.section { padding: 72px 0; }

.section-head { margin-bottom: 40px; }

.section-eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.section-sub {
  color: var(--text-2);
  font-size: 1rem;
  max-width: 560px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 56px;
  background:
    radial-gradient(700px 320px at 85% -10%, rgba(37, 99, 235, 0.08), transparent 70%),
    radial-gradient(600px 300px at 5% 10%, rgba(33, 115, 70, 0.08), transparent 70%);
}

.hero-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 36px;
  align-items: center;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(1.8rem, 6vw, 2.9rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.hero-title-line { display: block; }

.hero-title-grad {
  display: block;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 18px auto 0;
  max-width: 520px;
  color: var(--text-2);
  font-size: 1.02rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.hero-tags li {
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.36);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--text-3); }

/* 头像（首字母，不放照片） */
.hero-avatar-wrap { flex-shrink: 0; }

.hero-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 56px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  user-select: none;
}

/* AI 搭建横幅 */
.hero-ai-note {
  margin-top: 44px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(33, 115, 70, 0.07), rgba(37, 99, 235, 0.07));
  border: 1px dashed rgba(37, 99, 235, 0.35);
  color: var(--text-2);
  font-size: 0.92rem;
  text-align: center;
}

/* ---------- 作品区 ---------- */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.work-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* 案例插图区 */
.work-visual {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 真实运行截图 */
.work-shot {
  position: relative;
  width: 100%;
  margin: 0;
}

.work-shot img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: block;
}

.shot-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  color: #FFFFFF;
  background: linear-gradient(135deg, #217346, #2563EB);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.work-shot figcaption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-3);
  text-align: center;
}

.work-shot + .work-shot { margin-top: 18px; }

/* 案例截图轮播 */
.work-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
}

.carousel-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.45s ease;
}

.carousel-track .work-shot {
  flex: 0 0 100%;
  min-width: 0;
}

/* 轮播容器已带圆角裁切，内部图片去掉双重边框 */
.work-carousel .work-shot img {
  border-radius: 0;
  border: none;
}

/* 轮播截图不受 600px 限制，撑满卡片宽度保证文字可读 */
.work-card.card-stacked .work-carousel .work-shot img { max-width: 100%; }

.carousel-track .work-shot + .work-shot { margin-top: 0; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(26, 35, 50, 0.55);
  color: #FFFFFF;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 3px;
  transition: background 0.2s ease;
}

.carousel-btn:hover { background: rgba(26, 35, 50, 0.8); }

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
  position: static;
  width: fit-content;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(26, 35, 50, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 3px 8px;
}

.carousel-dot {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.25s ease, transform 0.25s ease;
}

.carousel-dot.is-active::before {
  background: #FFFFFF;
  transform: scale(1.3);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.work-visual svg {
  width: 200px;
  height: 140px;
}

.work-visual-rag { background: linear-gradient(135deg, #EFF5F0, #F2F3EF); }
.work-visual-ocr { background: linear-gradient(135deg, #EDF1F7, #F2F3EF); }
.work-visual-pipeline { background: linear-gradient(135deg, #EDF1F7, #EFF5F0); }

.work-body { padding: 24px 22px 26px; }

.work-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.work-num {
  font-size: 0.9rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.work-chip {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.work-status {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.work-status-done {
  color: var(--green);
  background: rgba(33, 115, 70, 0.1);
}

.work-status-wip {
  color: #B45309;
  background: rgba(217, 119, 6, 0.12);
}

.work-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}

.work-card p { font-size: 0.95rem; color: var(--text-2); margin-bottom: 8px; }
.work-card p:last-child { margin-bottom: 0; }

.work-card p strong { color: var(--text); }

/* 待补数据标注 */
.todo-mark {
  color: #B45309;
  background: rgba(217, 119, 6, 0.08);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.88em;
}

/* 案例卡内的演示入口按钮 */
.btn-demo {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-demo:hover {
  background: rgba(37, 99, 235, 0.06);
}

.btn-demo:active { transform: scale(0.97); }

.works-note {
  margin-top: 26px;
  font-size: 0.88rem;
  color: var(--text-3);
  text-align: center;
}

/* ---------- 关于我 ---------- */
.about { background: var(--bg-soft); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.about-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-left: 12px;
  border-left: 4px solid var(--green);
}

/* 时间线 */
.timeline { position: relative; padding-left: 22px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; padding-bottom: 26px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-dot-green { background: var(--green); }
.timeline-dot-blue { background: var(--blue); }
.timeline-dot-grad { background: var(--grad); }

.timeline-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-item p { font-size: 0.93rem; color: var(--text-2); }

/* 技能矩阵 */
.skill-group { margin-bottom: 18px; }

.skill-group-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags li {
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.skill-tags-ai li {
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--blue);
  background: rgba(37, 99, 235, 0.05);
}

.about-extra {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-2);
}

/* ---------- 联系我 ---------- */
.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
}

.contact-sub { color: var(--text-2); margin-top: 6px; }

.contact-mail {
  margin-top: 14px;
  font-size: 1rem;
}

.contact-mail a {
  color: var(--blue);
  font-weight: 500;
}

.contact-mail a:hover { text-decoration: underline; }

.contact-mail-note {
  color: var(--text-3);
  font-size: 0.85rem;
}

.contact-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-3);
}

.contact-qr { flex-shrink: 0; }

.qr-box {
  width: 230px;
  padding: 14px 14px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.qr-box img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.qr-label {
  display: block;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-3);
  text-align: center;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  background: var(--card);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-2);
}

.footer-ai { color: var(--text-3); font-size: 0.8rem; }

/* ---------- 滚动淡入动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* 尊重系统减弱动画设置（无障碍） */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   断点：≥768px（平板 / 横屏）
   ========================================================= */
@media (min-width: 768px) {
  .section { padding: 96px 0; }
  .hero { padding: 96px 0 72px; }

  .hero-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    gap: 48px;
  }

  .hero-sub { margin-left: 0; }
  .hero-tags { justify-content: flex-start; }
  .hero-cta { justify-content: flex-start; }
  .hero-avatar { width: 160px; height: 160px; font-size: 68px; }

  .hero-ai-note { text-align: left; }

  /* 案例卡：图左文右 */
  .work-card {
    flex-direction: row;
    align-items: stretch;
  }

  .work-visual {
    flex: 0 0 260px;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }

  .work-body { flex: 1; padding: 28px 30px; }

  /* 关于我：双栏 */
  .about-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
  }

  /* 联系：左文右码 */
  .contact-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    gap: 48px;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* =========================================================
   断点：≥1024px（桌面）
   ========================================================= */
@media (min-width: 1024px) {
  .container { padding: 0 32px; }

  .nav { height: 68px; }

  /* 桌面显示水平菜单，隐藏汉堡 */
  .nav-toggle { display: none; }

  .nav-menu {
    display: flex;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 32px;
  }

  .nav-menu.is-open { position: static; }

  .nav-menu.is-open .nav-link,
  .nav-menu .nav-link {
    display: inline;
    padding: 6px 2px;
    font-size: 0.95rem;
    border-bottom: none;
  }

  .hero-title { font-size: 3.1rem; }
  .hero-avatar { width: 180px; height: 180px; font-size: 76px; }

  .work-visual { flex-basis: 300px; }
  .work-title { font-size: 1.3rem; }

  /* 带真实截图的案例卡：上下堆叠，截图全宽更易读 */
  .work-card.card-stacked { flex-direction: column; }
  .work-card.card-stacked .work-visual {
    flex: none;
    border-bottom: 1px solid var(--border);
    border-right: none;
    padding: 28px 32px 20px;
  }
  .work-card.card-stacked .work-shot img { max-width: 600px; margin: 0 auto; }
  .work-card.card-stacked .work-body { padding: 26px 32px 30px; }
}
