/* =========================================================
 * jayychou.com 个人开发者主页样式表
 * 风格：青石暖白编辑风，支持系统深浅色自适应，零外部依赖
 * ========================================================= */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-alt: #f5f5f4;
  --text: #1c1917;
  --text-muted: #57534e;
  --border: #e7e5e4;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #f0fdfa;
  --accent-border: #99f6e4;
  --max-width: 820px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1214;
    --surface: #131c1f;
    --surface-alt: #182428;
    --text: #f5f5f4;
    --text-muted: #a8a29e;
    --border: #243338;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.1);
    --accent-border: rgba(45, 212, 191, 0.28);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* 顶部导航 */
.topbar {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
}

.site-logo:hover {
  color: var(--text);
  text-decoration: none;
}

.avatar-monogram {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

@media (prefers-color-scheme: dark) {
  .avatar-monogram {
    color: #0c1214;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  font-size: 0.94rem;
}

.nav a {
  color: var(--text-muted);
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

/* 主内容容器 */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.25rem 4.25rem;
}

/* 个人简介首屏 */
.intro {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.intro h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.95rem, 4.2vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.intro p {
  margin: 0 0 1.25rem;
  max-width: 650px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.05rem;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .btn-primary,
  .btn-primary:hover {
    color: #0c1214;
  }
}

/* 通用分区 */
.block {
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--border);
}

.block:last-of-type {
  border-bottom: none;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
}

.block-head h2 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.015em;
}

.block-head a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* 项目列表 */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.project-card h3 {
  margin: 0;
  font-size: 1.03rem;
}

.project-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  flex: 1;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 0.16rem 0.6rem;
}

/* 主题清单 */
.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.topic-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.75rem 1.2rem;
  align-items: baseline;
}

.topic-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-desc {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.topic-desc strong {
  color: var(--text);
}

/* 建站说明框 */
.colophon {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  font-size: 0.93rem;
  color: var(--text-muted);
}

.colophon strong {
  color: var(--text);
}

/* 长文页面样式 */
.article h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3.6vw, 2.2rem);
  letter-spacing: -0.025em;
}

.article .meta {
  margin: 0 0 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article h2 {
  margin: 2rem 0 0.65rem;
  font-size: 1.18rem;
}

.article p,
.article li {
  color: var(--text-muted);
  font-size: 0.97rem;
}

.article ul {
  padding-left: 1.25rem;
}

/* 页脚 */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

.footer-nav a {
  color: var(--text-muted);
}

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

@media (max-width: 620px) {
  .topbar-inner {
    flex-wrap: wrap;
  }
  .topic-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .main {
    padding-top: 2.2rem;
  }
}
