/* =============================================================
 * home.css — 首页 dashboard 样式
 * Source-RFC: 02-homepage-rfc/1.1-page-home.md · spec/03-impl/01-visual-design.md
 *
 * 只消费 theme.css 暴露的语义令牌，绝不硬编码颜色：
 *   --accent / --accent-soft / --accent-line / --accent-tint / --accent-glow
 *   --bg / --fg / --fg-muted / --surface / --surface-2
 *   --border / --border-strong / --code-bg
 * 字阶 / 宽度 / 节律令牌同样来自 theme.css：
 *   --fs-sm..--fs-3xl · --lh-body/-tight/-snug · --w-wide · --space-section
 * 深浅色均由令牌自动适配（theme.css 负责 data-theme 切换）。所有标题 / 正文
 * 都走 --fg / --fg-muted，深色态对比度 ≥ AA（修 user #5）。
 *
 * 霓虹是点缀不是涂料（visual-design §0/§4）：用于链接、细下划线、竖条、
 * 焦点光晕、小 tint；主 CTA = 强调色描边 / 低饱和 tint 背景 + 强调色文字，
 * hover 才加轻微填充 / 光晕。绝不大面积实心填充。
 * ============================================================= */

/* 全宽容器：home.html 已直接继承 base（跳过窄 col-xl-8 与大标题 hero）。
   这里把 dashboard 居中到 --w-wide，呼吸感足（修 user #1）。 */
.home-main {
  flex: 1;
}
.home-dashboard {
  width: var(--w-wide);
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) 0 var(--space-section);
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
}

/* ---- 通用区块标题 ---- */
.home-section__title {
  font-family: var(--header-font);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
  line-height: var(--lh-tight);
}

.home-empty {
  color: var(--fg-muted);
  font-style: italic;
}

/* =========================== 身份 hero =========================== */
.home-identity {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.home-identity__avatar {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  /* neon as a thin ring of glow, not a fill */
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.home-identity__avatar--round {
  border-radius: 50%;
}

.home-identity__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-identity__name {
  font-family: var(--header-font);
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 0.4rem;
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
}

.home-identity__name-zh {
  color: var(--fg);
  font-weight: 700;
  margin-left: 0.4rem;
  /* subtle accent underline = neon as accent, not a fill */
  border-bottom: 2px solid var(--accent-line);
  padding-bottom: 1px;
}

.home-identity__tagline {
  color: var(--fg-muted);
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  margin: 0 0 1.25rem;
  max-width: 60ch;
}

.home-identity__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---- Buttons (visual-design §4): neon as accent, not a slab of fill ---- */
.home-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  font-family: var(--header-font);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
}

/* primary = low-sat accent tint bg + accent text + accent outline;
   hover adds a subtle fill + glow. No solid magenta slab. */
.home-cta--primary {
  background-color: var(--accent-tint);
  color: var(--accent);
  border-color: var(--accent-line);
}
.home-cta--primary:hover,
.home-cta--primary:focus {
  background-color: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 12px var(--accent-glow);
  text-decoration: none;
}

/* secondary = neutral outline */
.home-cta--ghost {
  background-color: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.home-cta--ghost:hover,
.home-cta--ghost:focus {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ====================== 研究 & 发表区 ====================== */
.home-research {
  position: relative;
  padding-left: 1.75rem;
}

/* 左侧霓虹竖条强调 — neon as a thin identity bar */
.home-research::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 3px;
  border-radius: 3px;
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.home-research__subtitle {
  font-family: var(--header-font);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 0.6rem;
  line-height: var(--lh-tight);
}

.home-research__interests {
  margin-bottom: 1.75rem;
}

.home-research__interests p {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  max-width: var(--w-prose);
}

.pub-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-item {
  padding: 1.1rem 1.25rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}
.pub-item:hover {
  border-color: var(--border-strong);
}

.pub-item__title {
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.35rem;
  font-size: var(--fs-base);
  line-height: var(--lh-snug);
}

.pub-item__meta {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-item__venue {
  color: var(--accent);
  font-weight: 600;
}

.pub-item__links {
  margin: 0.6rem 0 0;
  display: flex;
  gap: 0.6rem;
}

.pub-link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.pub-link:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  text-decoration: none;
}

/* =========================== Now · 近况 =========================== */
.home-now__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.home-now__header .home-section__title {
  margin-bottom: 0;
}
.home-now__more {
  flex: 0 0 auto;
  font-family: var(--header-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.home-now__more:hover {
  text-decoration: underline;
}
.home-now__meta {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  margin: 0 0 1rem;
}
.home-now__list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem 1.75rem;
}
.home-now__item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent-line);
}
.home-now__label {
  font-family: var(--header-font);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}
.home-now__text {
  color: var(--fg-muted);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}

/* ===================== 内容版块 dashboard ===================== */
/* 不是固定 3 列：auto-fit minmax(320px,1fr)，窄屏自然降到 1 列（修 user #1）。 */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.home-block {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease,
    box-shadow 0.15s ease;
}

.home-block:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -12px var(--accent-glow);
}

.home-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.home-block__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--header-font);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--fg);
  margin: 0;
  line-height: var(--lh-tight);
}

.home-block__icon {
  font-size: 1.2rem;
  line-height: 1;
}

.home-block__more {
  flex: 0 0 auto;
  font-family: var(--header-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.home-block__more:hover {
  text-decoration: underline;
  color: var(--accent);
}

.home-block__blurb {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  margin: 0 0 1rem;
  line-height: var(--lh-snug);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.home-block__list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.home-block__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.home-block__date {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.home-block__link {
  color: var(--fg);
  text-decoration: none;
  font-size: var(--fs-base);
  line-height: var(--lh-snug);
  border-left: 2px solid transparent;
  padding-left: 0;
  transition: color 0.15s ease, border-color 0.15s ease,
    padding-left 0.15s ease;
}

.home-block__link:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  padding-left: 0.5rem;
  text-decoration: none;
}

.home-block__empty {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  font-style: italic;
  margin: 0.5rem 0 0;
}

/* =========================== 响应式 =========================== */
@media (max-width: 576px) {
  .home-identity {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .home-identity__tagline {
    margin-left: auto;
    margin-right: auto;
  }
  .home-identity__cta {
    justify-content: center;
  }
  .home-now__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}
