/* =========================================================
   临床研究笔记 — 站点样式
   视觉参考:fll.yuanyuanstar.click
   近黑底 + 玻璃拟态面板 + 绯红强调 + 大圆角
   ---------------------------------------------------------
   【背景图怎么换】
   把图片放进 site/assets/img/,命名 bg.jpg,
   然后把下面 :root 里的 --bg-image 改成:
       --bg-image: url("../img/bg.jpg");
   就这一行。不要图的时候保持 none。
   ========================================================= */

:root {
  color-scheme: dark;

  /* 底色与面板 */
  --page-bg: #0b0d15;
  --page-bg-deep: #06070c;
  --glass: rgba(15, 18, 30, 0.55);
  --glass-strong: rgba(15, 18, 30, 0.78);
  --glass-soft: rgba(255, 248, 240, 0.06);
  --glass-border: rgba(255, 244, 232, 0.14);

  /* 文字 */
  --ink: #f6f1e8;
  --ink-2: rgba(246, 241, 232, 0.74);
  --muted: rgba(246, 241, 232, 0.52);

  /* 强调 */
  --accent: #ff2400;
  --accent-2: #dc143c;
  --accent-soft: #ffe0d8;
  --accent-strong: #ff6a4c;
  --violet: #8b00ff;

  /* 圆角与阴影 */
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.26);
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.32);

  /* 字体 */
  --font-sans: "Avenir Next", "Montserrat", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Consolas, monospace;

  /* 背景图:换成自己的图时只改这一行 */
  --bg-image: url("../img/bg.jpg");

  --measure: 48rem;
}

/* ---------- 字体 ---------- */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--page-bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 背景层:压暗的图 + 红色与紫色的雾光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(
      180deg,
      rgba(11, 13, 21, 0.52) 0%,
      rgba(11, 13, 21, 0.78) 55%,
      rgba(6, 7, 12, 0.93) 100%
    ),
    radial-gradient(1100px 640px at 50% -8%, rgba(255, 36, 0, 0.1), transparent 66%),
    radial-gradient(900px 620px at 84% 10%, rgba(139, 0, 255, 0.2), transparent 70%),
    var(--bg-image);
  background-size: cover, auto, auto, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
  background-color: var(--page-bg);
}

img { max-width: 100%; height: auto; }

a {
  color: var(--accent-strong);
  text-decoration: none;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }

::selection { background: rgba(255, 36, 0, 0.32); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 244, 232, 0.22) transparent;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 20px;
}

/* 玻璃面板 */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 13, 21, 0.55);
  border-bottom: 1px solid rgba(255, 244, 232, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.site-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.site-title:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.18s;
}
.site-nav a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.lang-toggle {
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.lang-toggle:hover {
  color: var(--ink);
  border-color: rgba(255, 106, 76, 0.6);
  background: rgba(255, 36, 0, 0.14);
}

/* ---------- 首屏 ---------- */
.hero {
  margin: 40px 0 18px;
  padding: 46px 44px 42px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: 2.9rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.lede {
  margin: 0 0 26px;
  max-width: 32em;
  font-size: 1.03rem;
  color: var(--ink-2);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.86rem;
  font-weight: 500;
}
.hero-links a {
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.hero-links a:hover {
  text-decoration: none;
  color: #fff;
  border-color: rgba(255, 106, 76, 0.65);
  background: rgba(255, 36, 0, 0.16);
}

/* 细分隔 */
.sigil {
  height: 1px;
  margin: 34px 0;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 244, 232, 0.18) 22%,
    rgba(255, 106, 76, 0.4) 50%,
    rgba(255, 244, 232, 0.18) 78%,
    transparent
  );
}

/* ---------- 列表 ---------- */
.section-title {
  margin: 0 0 16px 4px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-item {
  padding: 26px 28px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.post-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 106, 76, 0.42);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 36, 0, 0.1);
}

.post-item time {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.post-title {
  margin: 0 0 8px;
  font-size: 1.22rem;
  line-height: 1.42;
  font-weight: 700;
  letter-spacing: -0.012em;
}
.post-title a { color: var(--ink); }
.post-title a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.excerpt {
  margin: 0;
  max-width: 38em;
  font-size: 0.94rem;
  color: var(--ink-2);
}

.badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 9px;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
  color: var(--accent-soft);
  background: rgba(255, 36, 0, 0.16);
  border: 1px solid rgba(255, 106, 76, 0.42);
  border-radius: 999px;
}

/* ---------- 文章页 ---------- */
.post {
  margin: 34px 0 0;
}

.back {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.84rem;
  color: var(--muted);
}
.back:hover { color: var(--accent-strong); text-decoration: none; }

.post-header {
  padding-bottom: 26px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 244, 232, 0.1);
}
.post-header h1 {
  margin: 6px 0 16px;
  font-size: 2rem;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* 文章正文放在玻璃面板里 */
.post,
.prose {
  border-radius: var(--radius-lg);
}
article.post {
  padding: 34px 34px 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.prose { font-size: 1.01rem; }
.prose > *:first-child { margin-top: 0; }

.prose h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.prose h3 {
  margin: 1.9em 0 0.5em;
  font-size: 1.06rem;
  font-weight: 700;
}
.prose p { margin: 0 0 1.15em; }
.prose ul,
.prose ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.prose li { margin: 0.4em 0; }

.prose blockquote {
  margin: 1.7em 0;
  padding: 0.6em 1em;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 36, 0, 0.06);
  color: var(--ink-2);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.16em 0.42em;
  border-radius: 6px;
  background: rgba(255, 248, 240, 0.09);
  border: 1px solid rgba(255, 244, 232, 0.1);
}
.prose pre {
  margin: 0 0 1.3em;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.65;
  border-radius: var(--radius-sm);
  background: rgba(6, 7, 12, 0.62);
  border: 1px solid rgba(255, 244, 232, 0.1);
}
.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 1em;
}

.prose hr {
  border: 0;
  border-top: 1px solid rgba(255, 244, 232, 0.1);
  margin: 2.4em 0;
}
.prose a { text-decoration: underline; }
.prose strong { font-weight: 700; color: var(--ink); }

.prose table {
  width: 100%;
  margin: 0 0 1.4em;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.prose th,
.prose td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 244, 232, 0.1);
}
.prose th {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.lang-note {
  margin: 0 0 24px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--ink-2);
  background: var(--glass-soft);
  border: 1px dashed rgba(255, 244, 232, 0.22);
  border-radius: var(--radius-sm);
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 60px;
  padding: 26px 0 44px;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 244, 232, 0.08);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent-strong); }

/* ---------- 语言切换 ---------- */
html[data-lang="zh"] [data-lang="en"] { display: none !important; }
html[data-lang="en"] [data-lang="zh"] { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .hero {
    margin: 24px 0 14px;
    padding: 30px 24px 28px;
    border-radius: var(--radius-lg);
  }
  .hero h1 { font-size: 2.05rem; }
  .post-header h1 { font-size: 1.5rem; }
  .post-item { padding: 20px 20px; }
  article.post { padding: 24px 22px 6px; border-radius: var(--radius-lg); }
  .site-nav { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* 不支持 backdrop-filter 时的兜底:面板更实一点 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero,
  .post-item,
  article.post,
  .site-header {
    background: var(--glass-strong);
  }
}
