/* ============================================================
 * 设计规范 · 温暖生活感 / 平静、内敛但强大
 * 改样式请先读《设计规范.md》，token 都集中在 :root
 * ============================================================ */

:root {
  /* —— 色板 —— */
  --paper:      #FBF5EB;   /* 页面底色 · 暖米 */
  --card:       #FFFDF8;   /* 卡片底色 · 暖白 */
  --ink:        #3E332A;   /* 主文字 · 暖棕黑 */
  --ink-soft:   #8C7C6D;   /* 次要文字 */
  --ink-faint:  #BCAE9F;   /* 极次要 / 英文小标 */
  --accent:     #D96C47;   /* 主点缀 · 陶土橙 */
  --accent-soft:#F7E3D8;   /* 主点缀浅底 */
  --sage:       #7C9A6D;   /* 辅助 · 鼠尾草绿 */
  --sage-soft:  #E9F0E4;
  --amber:      #E9A23B;   /* 辅助 · 暖黄 */
  --amber-soft: #FBF0DA;
  --rose:       #C9718A;   /* 辅助 · 干玫瑰 */
  --rose-soft:  #F7E6EC;
  --blue:       #6C93B8;   /* 辅助 · 灰蓝 */
  --blue-soft:  #E6EEF5;
  --line:       #EDE3D4;   /* 分隔线 / 描边 */

  /* —— 圆角 —— */
  --r-card: 20px;
  --r-chip: 999px;
  --r-tag:  8px;

  /* —— 阴影（暖调、轻）—— */
  --shadow:       0 6px 24px rgba(93, 64, 43, .08);
  --shadow-hover: 0 14px 36px rgba(93, 64, 43, .14);

  /* —— 字体 —— */
  --font: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
          "Noto Sans CJK SC", "Microsoft YaHei", -apple-system, sans-serif;

  /* —— 节奏 —— */
  --page-max: 1040px;
  --section-gap: clamp(72px, 12vw, 128px);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .6s ease, color .6s ease;
}

::selection { background: var(--accent-soft); }

/* ————— 顶栏 ————— */
.topbar {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand-seal {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: 12px;
  font-weight: 700; font-size: 17px;
  transform: rotate(-4deg);
  box-shadow: var(--shadow);
}
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: .02em; }

.topbar-links { display: flex; gap: 8px; }
.icon-link {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-chip);
  color: var(--ink-soft);
  transition: all .25s ease;
}
.icon-link:hover {
  background: var(--card);
  color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.icon-link svg { width: 19px; height: 19px; }

/* ————— 首屏 ————— */
main { max-width: var(--page-max); margin: 0 auto; padding: 0 24px; }

.hero {
  min-height: 78vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 40px;
  padding: 40px 0 24px;
}
.hero-hi {
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .06em;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 54px);
  line-height: 1.25;
  letter-spacing: .01em;
  margin-bottom: 18px;
}
.hero-tagline {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.hero-now {
  display: inline-block;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--r-chip);
  padding: 6px 16px;
  margin-bottom: 30px;
}
.hero-now:empty { display: none; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-chip);
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  border: none; cursor: pointer;
  font-family: var(--font);
  transition: all .25s ease;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px rgba(217, 108, 71, .32);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(217, 108, 71, .4); }
.btn-ghost {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.hero-art { display: flex; justify-content: center; }
.hero-art img {
  width: 100%; max-width: 480px;
  filter: drop-shadow(0 20px 40px rgba(93, 64, 43, .12));
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ————— 章节通用 ————— */
section { margin-bottom: var(--section-gap); }

.section-title {
  font-size: clamp(24px, 3.4vw, 32px);
  margin-bottom: 28px;
  display: flex; align-items: baseline; gap: 14px;
}
.section-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--ink-faint);
}

/* ————— 关于 ————— */
.about-body {
  background: var(--card);
  border-radius: var(--r-card);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow);
  max-width: 720px;
}
.about-body p { margin-bottom: 14px; font-size: 16.5px; }
.about-body p:last-child { margin-bottom: 0; }

/* ————— 项目卡片 ————— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}
.project-card {
  display: block;
  background: var(--card);
  border-radius: var(--r-card);
  padding: 26px;
  text-decoration: none; color: var(--ink);
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  transition: all .28s ease;
  position: relative;
}
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.project-card.no-link { cursor: default; }
.project-card.no-link:hover { transform: none; box-shadow: var(--shadow); }

.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }

.project-icon {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: 16px;
  font-size: 26px; font-weight: 700;
}
.tint-orange { background: var(--accent-soft); color: var(--accent); }
.tint-green  { background: var(--sage-soft);   color: var(--sage); }
.tint-amber  { background: var(--amber-soft);  color: var(--amber); }
.tint-rose   { background: var(--rose-soft);   color: var(--rose); }
.tint-blue   { background: var(--blue-soft);   color: var(--blue); }

.project-name { font-size: 18px; font-weight: 700; }
.status {
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--ink-soft);
}
.status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
}
.status-live::before     { background: var(--sage); }
.status-wip::before      { background: var(--amber); }
.status-archived::before { background: var(--ink-faint); }

.project-desc { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 16px; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: var(--r-tag);
  padding: 3px 10px;
}

.card-arrow {
  position: absolute; right: 22px; bottom: 22px;
  color: var(--ink-faint);
  transition: all .28s ease;
}
.project-card:hover .card-arrow { color: var(--accent); transform: translateX(4px); }
.project-card.no-link .card-arrow { display: none; }

/* ————— 全部项目（折叠区）————— */
.all-projects { margin-top: 28px; text-align: center; }
.toggle-arrow { display: inline-block; transition: transform .3s ease; }
#toggleAll[aria-expanded="true"] .toggle-arrow { transform: rotate(180deg); }

.all-list[hidden] { display: none; }

.all-list {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  text-align: left;
  animation: unfold .35s ease;
}
@keyframes unfold {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.all-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px 20px;
  text-decoration: none; color: var(--ink);
  transition: all .25s ease;
}
.all-row:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.all-row.no-link { cursor: default; }
.all-row.no-link:hover { box-shadow: none; transform: none; }
.all-row .project-icon { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }
.all-row-name { font-weight: 600; font-size: 15.5px; }
.all-row-desc { font-size: 13px; color: var(--ink-soft); }
.all-row-meta { flex: 1; min-width: 0; }

/* ————— 页脚 ————— */
.footer {
  border-top: 1px solid var(--line);
  padding: 36px 24px 44px;
  text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.footer-note { font-size: 13.5px; color: var(--ink-faint); }

/* ————— 入场动效 ————— */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ————— 星尘轨迹 ————— */
.stardust {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: 9999;
  opacity: .85;
  animation: stardust .9s ease-out forwards;
}
@keyframes stardust {
  0%   { transform: translateY(0) scale(1); opacity: .85; }
  100% { transform: translateY(-18px) scale(.2); opacity: 0; }
}

/* ————— 彩蛋一：猫 ————— */
.hero-art { position: relative; }
.cat-zone {
  position: absolute;
  left: 63%; top: 42%;
  width: 27%; height: 52%;
  background: transparent;
  border: none; cursor: pointer;
  border-radius: 50%;
  padding: 0;
}
.cat-meow {
  position: absolute;
  left: 66%; top: 30%;
  background: var(--card);
  color: var(--ink);
  font-size: 15px; font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-chip);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  pointer-events: none;
  animation: meow 1.4s ease forwards;
}
@keyframes meow {
  0%   { opacity: 0; transform: translateY(8px) scale(.8); }
  15%  { opacity: 1; transform: translateY(0) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}
.cat-heart {
  position: absolute;
  top: 38%;
  font-size: 20px;
  pointer-events: none;
  animation: heart-float 1.2s ease-out forwards;
}
@keyframes heart-float {
  0%   { opacity: 0; transform: translateY(0) scale(.5); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-70px) scale(1.1); }
}

/* ————— 彩蛋二：夜灯模式 ————— */
.lamp-toast {
  position: fixed;
  left: 50%; bottom: 40px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: var(--paper);
  font-size: 14.5px;
  padding: 10px 22px;
  border-radius: var(--r-chip);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transition: all .4s ease;
  z-index: 10000;
  pointer-events: none;
}
.lamp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer-note { cursor: default; user-select: none; }

html.night {
  --paper:      #241D18;   /* 深夜暖棕 */
  --card:       #322820;
  --ink:        #F0E4D4;
  --ink-soft:   #B7A48D;
  --ink-faint:  #7E6E5C;
  --accent:     #E8835F;   /* 夜里更亮一点的陶土橙 */
  --accent-soft:#4A3025;
  --sage-soft:  #33402B;
  --amber-soft: #4A3A22;
  --rose-soft:  #432A33;
  --blue-soft:  #2B3540;
  --line:       #463A2F;
  --shadow:       0 6px 24px rgba(0, 0, 0, .3);
  --shadow-hover: 0 14px 36px rgba(0, 0, 0, .45);
}
html.night body { transition: background .6s ease, color .6s ease; }
html.night .lamp-toast { background: var(--accent); color: #fff; }

/* ————— 图标例外通道：单色 SVG ————— */
.icon-svg svg { width: 26px; height: 26px; display: block; }

/* ————— 响应式 ————— */
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 28px;
    text-align: center;
  }
  .hero-actions { justify-content: center; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 340px; }
  .section-title { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art img, .reveal { animation: none; transition: none; opacity: 1; transform: none; }
}
