/* ============================================================
   毕之昂作品集 · 纸墨设计系统
   设计语言：中文古籍 —— 宣纸底、墨字、朱砂批注
   ============================================================ */

:root {
  /* —— 色彩 token —— */
  --paper: #faf7f0;        /* 宣纸暖白：主背景 */
  --paper-deep: #f3eee3;   /* 深一度纸色：卡片底 */
  --ink: #211d19;          /* 墨色：正文（不是纯黑，纯黑刺眼） */
  --ink-soft: #57504a;     /* 淡墨：次级文字 */
  --ink-faint: #9b928a;    /* 灰墨：辅助信息 */
  --cinnabar: #b03a2e;     /* 朱砂红：唯一强调色（古籍批注笔） */
  --cinnabar-dark: #8f2d23;/* 深朱砂：hover态 */
  --line: #e2dccd;         /* 淡纸线：分隔 */

  /* —— 字体 —— */
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;   /* 标题·宋体 */
  --sans: "PingFang SC", "Hiragino Sans GB", -apple-system, sans-serif; /* 正文 */

  /* —— emil 规范的自定义缓动曲线（关键！丝滑感的来源）—— */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);     /* 入场：起步快、收尾稳 */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);  /* 屏内移动 */

  /* —— 间距/圆角 —— */
  --radius: 2px;           /* 近乎直角：古籍排版不用大圆角 */
  --section-pad: 96px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  font-size: 16px;
  /* 纸张质感：极淡的纹理颗粒，几乎察觉不到但去掉就"太干净" */
  background-image: radial-gradient(rgba(33,29,25,0.018) 1px, transparent 0);
  background-size: 24px 24px;
}
a { color: var(--cinnabar); text-decoration: none; transition: color 0.2s var(--ease-out); }
a:hover { color: var(--cinnabar-dark); }

.container { max-width: 880px; margin: 0 auto; padding: 0 28px; }

/* ============ Hero：纸色开场，朱线点题 ============ */
.hero {
  background: var(--paper);
  padding: 120px 0 100px;
  position: relative;
  /* 朱砂批注线：一条从标题延伸出去的红线，页面唯一的装饰 */
}
.hero::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 3px; height: 180px;
  background: var(--cinnabar);
}
.hero-kicker {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 2px;
  margin-bottom: 28px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 72px;           /* 超大宋体：视觉锚点 */
  letter-spacing: 6px;        /* 宋体大字需要字距呼吸 */
  line-height: 1.1;
  margin-bottom: 24px;
}
.hero-sub {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink-soft);
  margin-bottom: 36px;
  font-weight: 400;
}
.hero-desc {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 620px;
}
.hero-desc strong { color: var(--ink); font-weight: 600; }
.hero-actions { margin-top: 44px; display: flex; gap: 16px; flex-wrap: wrap; }

/* 按钮：朱砂为主，压下有反馈（emil: 按钮必须有按压感）*/
.btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: transform 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
/* :active 按压缩小 —— "界面听到了你"的物理反馈 */
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--cinnabar); color: #fff; }
.btn-primary:hover { background: var(--cinnabar-dark); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); }

/* ============ 导航 ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,247,240,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 58px; }
.nav-brand { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: 2px; }
.nav-links a {
  margin-left: 30px; font-size: 14px; color: var(--ink-soft);
  position: relative;
}
/* 下划线从左往右"画出"（ui-animation 模式：下划线生长）*/
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1.5px;
  background: var(--cinnabar);
  transition: width 0.25s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a:hover::after { width: 100%; }

/* ============ 板块结构 ============ */
section { padding: var(--section-pad) 0; }
.section-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 3px;
  margin-bottom: 14px;
}
/* 板块标题左侧的朱砂方块 —— 代替"01/02"编号：不是序列，不该用数字 */
.section-title::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  background: var(--cinnabar);
  margin-right: 14px;
  vertical-align: 4px;
}
.section-sub { color: var(--ink-soft); font-size: 15px; margin-bottom: 44px; max-width: 680px; }

/* ============ 作品：左右双栏但有主次，不等宽卡片 ============ */
.work-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.work-card {
  padding: 40px 36px 44px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.25s var(--ease-out);
}
.work-card + .work-card { border-left: 1px solid var(--line); }
/* 首卡（内测中的主推产品）横跨两栏，作为整块作品区的开篇 */
.work-card-lead { grid-column: 1 / -1; padding-bottom: 40px; }
.work-card-lead + .work-card { border-left: none; }
.work-card-lead p { max-width: 660px; }
.work-card-lead .work-how { max-width: 700px; }
.work-card:hover { background: var(--paper-deep); }
/* 悬停时左侧朱线划入 —— 卡片可点的暗示 */
.work-card::before {
  content: "";
  position: absolute; left: 0; top: 0;
  width: 3px; height: 0;
  background: var(--cinnabar);
  transition: height 0.3s var(--ease-out);
}
.work-card:hover::before { height: 100%; }
.work-badge {
  font-size: 12px;
  color: var(--cinnabar);
  border: 1px solid var(--cinnabar);
  padding: 2px 10px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  display: inline-block;
  letter-spacing: 2px;
}
.work-card h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 14px; letter-spacing: 1px; }
.work-card p { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 16px; }
/* 每件作品的“怎么做的”：解释过程，不重复功能描述 */
.work-how {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-soft);
  border-left: 2px solid var(--line);
  padding-left: 12px;
  margin-bottom: 20px;
}
.work-how strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--cinnabar);
  font-weight: 600;
  margin-bottom: 2px;
}

.work-meta { list-style: none; margin-bottom: 22px; }
.work-meta li {
  font-size: 13px; color: var(--ink-faint);
  padding: 3px 0 3px 16px; position: relative;
}
.work-meta li::before { content: "·"; position: absolute; left: 2px; color: var(--cinnabar); font-weight: bold; }
.work-links a { font-size: 14px; font-weight: 500; }
.work-links span { font-size: 13.5px; color: var(--ink-faint); }

/* ============ 概念卡：非SaaS式，竖排索引感 ============ */
.concept { background: var(--paper-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.concept-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.chip {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 6px 18px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.chip:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.chip:active { transform: scale(0.96); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.concept-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); max-width: 760px; }
.concept-card {
  background: var(--paper);
  padding: 26px 24px;
  cursor: pointer;
  position: relative;
}
/* 筛选隐藏/显示用透明度+缩放而不是 display，避免跳变 */
.concept-card.filtered { display: none; }
.concept-card h4 { font-family: var(--serif); font-size: 19px; margin-bottom: 2px; letter-spacing: 1px; }
.concept-card .en { font-size: 12.5px; color: var(--ink-faint); font-style: italic; margin-bottom: 10px; font-family: Georgia, serif; }
.concept-card .cat { font-size: 12px; color: var(--cinnabar); margin-bottom: 12px; letter-spacing: 1px; }
.concept-card .hint { font-size: 12px; color: var(--ink-faint); }
/* 展开定义区：从压缩+半透明状态舒展开（emil: 东西不从虚无中出现）*/
.concept-card .def {
  max-height: 0;           /* 闭合时高度为0 */
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  border-top: 0 solid var(--line);
  transition: max-height 0.4s var(--ease-out), opacity 0.3s var(--ease-out),
              margin-top 0.35s var(--ease-out), padding-top 0.35s var(--ease-out);
}
.concept-card.open .def {
  max-height: 220px;        /* 展开目标高度 */
  opacity: 1;
  margin-top: 14px;
  padding-top: 14px;
  border-top-width: 1px;
}
.concept-card:hover { background: #fff; }

/* ============ v2 概念卡：索引优先 + 精选 + 搜索辅助 ============ */
.concept-index { margin-bottom: 20px; }
.index-label {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-row .chip { padding: 5px 14px; font-size: 12.5px; }
.chip-sub { margin-bottom: 18px; }
.chip-sub .chip { border-style: dashed; }
.index-toggle {
  font-size: 12px; color: var(--cinnabar); background: none; border: none;
  cursor: pointer; margin-left: 10px; letter-spacing: 1px; padding: 0;
}
.index-toggle:hover { text-decoration: underline; }
/* 搜索：辅助条，收窄靠右 */
.concept-aux {
  display: flex; align-items: center; gap: 14px;
  padding-top: 14px; margin-bottom: 30px;
  border-top: 1px dashed var(--line);
}
.term-search {
  flex: 0 1 260px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
  transition: border-color 0.2s var(--ease-out);
}
.term-search:focus { outline: none; border-color: var(--cinnabar); }
.term-search::placeholder { color: var(--ink-faint); }
.term-count { font-size: 12.5px; color: var(--ink-faint); letter-spacing: 1px; }
.featured-label {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex; align-items: baseline; gap: 12px;
}
.featured-label .index-toggle { margin-left: 0; }
.empty-hint {
  padding: 40px 0; text-align: center;
  color: var(--ink-faint); font-size: 14px;
}

/* 卡片正面：一句话定义 */
.concept-card .one {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.6;
}
/* v2 展开区：内容更长，闭合动画统一（展开后完整显示，不截断） */
.concept-card.v2 .def { max-height: 0; font-size: 13px; overflow-y: hidden; }
.concept-card.v2.open .def { max-height: none; }
/* 详情：纸墨版"词条"排版 */
.term-detail { margin-top: 4px; }
.term-detail dt {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--cinnabar);
  margin-top: 14px;
  margin-bottom: 3px;
}
.term-detail dt:first-child { margin-top: 0; }
.term-detail dd { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }
.term-detail dd em { color: var(--ink); }
.term-philosophers {
  margin-top: 14px; padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-faint); letter-spacing: 0.5px;
}

.term-sources { margin-top: 10px; font-size: 12px; color: var(--ink-faint); }
.term-sources a { margin-left: 4px; }
.entry-type { letter-spacing: 1px; }

/* ============ 关于我 ============ */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.about-grid > div { padding: 36px 32px 40px 0; border-bottom: 1px solid var(--line); }
.about-grid > div:nth-child(even) { padding-left: 32px; border-left: 1px solid var(--line); padding-right: 0; }
.about-grid h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 12px; letter-spacing: 1px; }
.about-grid p { font-size: 14.5px; color: var(--ink-soft); }

/* ============ 联系 & 页脚 ============ */
.contact { text-align: center; padding: 110px 0; }
.contact-note { color: var(--ink-soft); font-size: 15px; font-family: var(--serif); letter-spacing: 1px; }
footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: 13px; color: var(--ink-faint); text-align: center; }

/* ============ 入场序列：一次编排好的加载动画 ============ */
/* 页面加载时 hero 各元素依次浮现 —— 仅有这一次，之后全部安静 */
.hero > .container > * {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.7s var(--ease-out) forwards;
}
.hero-kicker   { animation-delay: 0.05s; }
.hero h1       { animation-delay: 0.15s; }
.hero-sub      { animation-delay: 0.25s; }
.hero-desc     { animation-delay: 0.35s; }
.hero-actions  { animation-delay: 0.45s; }
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
/* 尊重系统"减少动态"设置（无障碍质量底线） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero > .container > * { opacity: 1; transform: none; }
}

/* 键盘焦点可见（无障碍质量底线） */
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }

/* ============ 响应式 ============ */
@media (max-width: 760px) {
  .hero { padding: 72px 0 64px; }
  .hero h1 { font-size: 42px; letter-spacing: 3px; }
  .hero-sub { font-size: 17px; }
  .work-grid, .about-grid { grid-template-columns: 1fr; }
  .work-card-lead { grid-column: auto; }
  .work-card + .work-card { border-left: none; border-top: 1px solid var(--line); }
  .about-grid > div, .about-grid > div:nth-child(even) { padding-left: 0; border-left: none; padding-right: 0; }
  .concept-aux { flex-wrap: wrap; }
  .term-search { flex: 1 1 100%; }
  .nav-links a { margin-left: 16px; font-size: 13px; }
  section { padding: 56px 0; }
}
