/* 水水的博客 — 地质 / 时间主题
   设计原则：暖白岩层、墨色正文、单一矿物青强调；衬线标题 + 高可读正文。 */
:root {
  --paper: #f4efe5;
  --paper-2: #ebe3d5;
  --ink: #1e2523;
  --muted: #65706b;
  --line: rgba(30, 37, 35, .14);
  --teal: #0d6668;
  --teal-soft: #d9e7e3;
  --amber: #a7602b;
  --card: rgba(255, 252, 246, .72);
  --shadow: 0 18px 50px rgba(39, 43, 38, .10);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", Georgia, serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151a18;
    --paper-2: #1b211e;
    --ink: #e8e4d9;
    --muted: #a5afa8;
    --line: rgba(232, 228, 217, .14);
    --teal: #7fc7bd;
    --teal-soft: #1f3330;
    --amber: #d49a62;
    --card: rgba(24, 30, 27, .74);
    --shadow: 0 18px 50px rgba(0, 0, 0, .32);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(13, 102, 104, .10), transparent 65%),
    radial-gradient(900px 480px at 0% 108%, rgba(167, 96, 43, .08), transparent 60%),
    var(--paper);
  font: 16px/1.8 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amber); }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--teal); color: #fff; padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }

/* 岩层纹理：低对比、纯 CSS，不依赖图片 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .30;
  background-image:
    repeating-linear-gradient(168deg, transparent 0 46px, rgba(30, 37, 35, .035) 47px, transparent 48px 96px),
    repeating-linear-gradient(12deg, transparent 0 74px, rgba(13, 102, 104, .025) 75px, transparent 76px 150px);
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; letter-spacing: .03em; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--teal); color: var(--teal); border-radius: 8px 2px 8px 2px; font-size: .9rem; }
.nav-links { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--teal); }
.github-link { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); border-radius: 999px; padding: .32rem .8rem; color: var(--ink) !important; }
.github-link:hover { border-color: var(--teal); background: var(--teal-soft); }
.github-link svg { width: 15px; height: 15px; fill: currentColor; }

.hero { padding: clamp(3.4rem, 8vw, 7rem) 0 4rem; position: relative; }
.eyebrow { display: inline-flex; gap: .55rem; align-items: center; color: var(--teal); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--teal); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.22; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.5rem, 6vw, 5.4rem); margin: 1.1rem 0 1.2rem; max-width: 900px; }
h1 em { font-style: normal; color: var(--teal); }
.lede { max-width: 650px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.18rem); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.15rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); background: var(--card); }
.btn:hover { border-color: var(--teal); color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--amber); border-color: var(--amber); color: #fff; }

/* 首页：旧版视频 hero 的电影感，叠加在新站的岩层排版之上 */
body.home .top {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(to bottom, rgba(8, 12, 11, .66), transparent);
  border-bottom: 0;
  backdrop-filter: none;
}
body.home .brand, body.home .nav-links a { color: #f4efe5; }
body.home .brand-mark { border-color: #9ee0d3; color: #9ee0d3; }
body.home .nav-links a:hover, body.home .nav-links a[aria-current="page"] { color: #9ee0d3; }
body.home .github-link { color: #f4efe5 !important; border-color: rgba(244, 239, 229, .32); }
body.home .github-link:hover { background: rgba(244, 239, 229, .12); border-color: #9ee0d3; }
.hero-cinema {
  position: relative;
  min-height: min(82vh, 780px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0b100e url("hero-poster.jpg") center / cover no-repeat;
  color: #f4efe5;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
  filter: saturate(.82) contrast(1.05);
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 11, 10, .78) 0%, rgba(7, 11, 10, .36) 52%, rgba(7, 11, 10, .18) 100%),
    linear-gradient(to top, var(--paper) 0%, transparent 24%);
}
.hero-inner { position: relative; z-index: 1; padding: 9rem 0 6rem; }
.hero-cinema h1 { color: #f7f2e8; max-width: 780px; }
.hero-cinema h1 em { color: #9ee0d3; }
.hero-cinema .lede { color: rgba(247, 242, 232, .78); }
.hero-cinema .eyebrow { color: #9ee0d3; }
.hero-cinema .btn { color: #f4efe5; border-color: rgba(244, 239, 229, .30); background: rgba(244, 239, 229, .07); }
.hero-cinema .btn:hover { color: #0b100e; background: #9ee0d3; border-color: #9ee0d3; }
.hero-cinema .btn.primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.hero-cinema .btn.primary:hover { background: var(--amber); border-color: var(--amber); color: #fff; }
.hero-scroll { display: inline-flex; gap: .5rem; align-items: center; margin-top: 3.2rem; color: rgba(247, 242, 232, .62); font-size: .78rem; letter-spacing: .12em; text-decoration: none; }
.hero-scroll:hover { color: #9ee0d3; }

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.project-card {
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.25rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}
.project-card:hover { background: var(--teal-soft); color: var(--ink); }
.project-index { color: var(--amber); font: .72rem/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.project-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.project-desc { color: var(--muted); font-size: .88rem; line-height: 1.7; }
.project-arrow { position: absolute; right: 1.2rem; top: 1.2rem; color: var(--teal); }

.section { padding: 3.5rem 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2.3rem); }
.section-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem; box-shadow: var(--shadow); }
.card h3 { margin: .1rem 0 .55rem; font-size: 1.22rem; }
.card p { margin: 0; color: var(--muted); }
.card .meta { margin-top: 1rem; color: var(--muted); font-size: .78rem; }
.post-card { grid-column: span 6; display: block; color: inherit; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.post-card:hover { transform: translateY(-3px); border-color: var(--teal); color: inherit; }
.post-card .tag { color: var(--amber); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.about-card { grid-column: span 5; }
.about-card .avatar { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-family: var(--serif); font-size: 1.4rem; border: 1px solid var(--line); margin-bottom: 1rem; }
.github-card { grid-column: span 7; }
.github-card .repo { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.github-card .repo:hover { color: var(--teal); }
.github-card .repo small { color: var(--muted); }

.article { max-width: 760px; margin: 0 auto; padding: 4rem 0 5rem; }
.article header { margin-bottom: 2.5rem; }
.article h1 { font-size: clamp(2rem, 4.5vw, 3.6rem); margin-bottom: .8rem; }
.article .meta { color: var(--muted); font-size: .88rem; }
.article h2 { font-size: 1.55rem; margin: 2.4rem 0 .7rem; }
.article h3 { font-size: 1.18rem; margin: 1.8rem 0 .5rem; }
.article p { margin: 0 0 1.1rem; }
.article ul, .article ol { padding-left: 1.4rem; }
.article blockquote { margin: 1.4rem 0; padding: .7rem 1.2rem; border-left: 3px solid var(--teal); background: var(--teal-soft); color: var(--muted); }
.article code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; background: var(--paper-2); padding: .12rem .35rem; border-radius: 4px; }
.article pre { overflow-x: auto; padding: 1rem; background: #17201d; color: #e9e5da; border-radius: 8px; }
.article pre code { background: transparent; padding: 0; color: inherit; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.article .back { font-size: .88rem; }
.article > img { margin: 1.2rem 0; border: 1px solid var(--line); border-radius: 8px; }
.command-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin: 1.2rem 0 2rem; }
.command-card { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.command-card code { display: inline-block; margin-bottom: .3rem; color: var(--teal); font-weight: 700; }
.command-card span { display: block; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.command-card span code { display: inline; margin: 0; color: var(--ink); font-weight: 400; }

.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: flex; justify-content: space-between; gap: 2rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.archive-list time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.archive-list a { color: var(--ink); text-decoration: none; }
.archive-list a:hover { color: var(--teal); }

.footer { border-top: 1px solid var(--line); padding: 2.4rem 0 3rem; color: var(--muted); font-size: .85rem; }
.footer-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--muted); }

@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .wrap { width: calc(100% - 28px); }
  .nav { flex-wrap: wrap; align-items: center; row-gap: .55rem; }
  .nav-links {
    order: 2;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: .9rem;
    padding-top: .55rem;
    border-top: 1px solid var(--line);
  }
  .nav-links a { font-size: .82rem; }
  .github-link { padding: .24rem .62rem; }
  .post-card, .about-card, .github-card { grid-column: 1 / -1; }
  .hero { padding-top: 3rem; }
  .hero-cinema { min-height: 76vh; align-items: flex-end; }
  .hero-inner { padding: 7rem 0 3.4rem; }
  .hero-video { opacity: .56; }
  .hero-scroll { margin-top: 1.8rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 140px; }
  .command-grid { grid-template-columns: 1fr; }
  .hero h1, .lede { overflow-wrap: anywhere; }
  .hero-actions .btn { flex: 1 0 100%; width: 100%; justify-content: center; }
  .archive-list li { display: block; }
  .archive-list time { display: block; margin-top: .2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
