/* ==========================================================================
   Siberianfores — 个人主页样式
   纯静态、零外部依赖（不引用任何 CDN / 网络字体），国内访问无阻塞
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --bg:            #FBF9F4;
  --bg-elevated:   #FFFFFF;
  --text:          #1B2A24;
  --text-muted:    #5C6F66;
  --line:          #E4DFD4;
  --accent:        #2F5D50;
  --accent-soft:   #E9EFEA;
  --gold:          #A8813C;

  --maxw: 880px;
  --radius: 14px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               "Noto Sans CJK SC", sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC",
                Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg:            #0E1512;
  --bg-elevated:   #16201C;
  --text:          #E8EDE9;
  --text-muted:    #96ADA2;
  --line:          #253229;
  --accent:        #8FC0AC;
  --accent-soft:   #172420;
  --gold:          #D3AE6A;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

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

/* ---------- 双语显隐 ----------
   两种语言的内容都写在 HTML 里，靠 <html lang> 切换。
   好处：JS 失效时仍会显示中文，不会出现空白页。 */
html[lang^="zh"] [data-lang="en"],
html[lang^="en"] [data-lang="zh"] {
  display: none;
}

/* ---------- 内容上架 / 下架 ----------
   给任何作品卡或文章条目加 data-visible="false"，即可从页面移除（内容仍保留）。 */
[data-visible="false"] {
  display: none;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: var(--bg); /* 旧浏览器兜底 */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .25s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: .01em;
  font-size: 15.5px;
  margin-right: auto;
}

.brand-mark {
  width: 22px;
  height: 22px;
  fill: var(--accent);
  flex: none;
}

.nav {
  display: flex;
  gap: 26px;
  font-size: 14.5px;
  color: var(--text-muted);
}

.nav a {
  position: relative;
  white-space: nowrap;
  transition: color .2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--accent);
  transition: right .25s ease;
}

.nav a:hover { color: var(--text); }
.nav a:hover::after { right: 0; }

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle:active { transform: scale(.94); }

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; fill: currentColor; stroke: none; }

/* ---------- 语言切换 ---------- */
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}

.lang-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 128px 0 96px;
}

/* 注：首屏曾用一个模糊光晕做氛围，但在浅色背景上低透明度渐变的色阶
   会产生可见的圆形硬边（不同显示器上更明显），故移除，改用留白与树线。 */

/* 底部淡淡的松林剪影 */
.hero-forest {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  opacity: .075;
  pointer-events: none;
  background-image: url("treeline.svg");
  background-repeat: repeat-x;
  background-position: bottom left;
  background-size: auto 100%;
}

[data-theme="dark"] .hero-forest { opacity: .16; }

.hero .wrap { position: relative; }

.eyebrow {
  margin: 0 0 18px;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-title {
  margin: 0 0 22px;
  font-family: var(--font-serif);
  font-size: clamp(42px, 8vw, 68px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero-lead {
  margin: 0 0 38px;
  max-width: 30em;
  font-size: 17.5px;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform .18s ease, background-color .2s ease,
              border-color .2s ease, color .2s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, #000);
}

[data-theme="dark"] .btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, #fff);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- 区块 ---------- */
.section {
  padding: 78px 0;
  border-top: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 34px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
}

.section-title .num {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--gold);
}

.prose { max-width: 62ch; }

.prose p {
  margin: 0 0 1.1em;
  color: var(--text-muted);
}

.prose p:last-child { margin-bottom: 0; }

/* ---------- 技能标签 ---------- */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.skills li {
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

/* ---------- 作品卡片 ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: border-color .22s ease, transform .22s ease,
              box-shadow .22s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -18px color-mix(in srgb, var(--accent) 55%, transparent);
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.card-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card p {
  margin: 0 0 18px;
  font-size: 14.5px;
  color: var(--text-muted);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: auto;
  padding-top: 2px;
}

.card-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  transition: opacity .2s ease;
}

.card-link:hover { opacity: .7; }

/* ---------- 文章列表 ---------- */
.article-source {
  margin: 0 0 26px;
  font-size: 14.5px;
  color: var(--text-muted);
}

.article-source strong {
  color: var(--text);
  font-weight: 600;
}

.post-src {
  flex: none;
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--text-muted);
}

.contact-plain { font-size: 15.5px; }

/* ---------- 笔记列表 ---------- */
.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.post-list li { border-bottom: 1px solid var(--line); }

.post-list a {
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding: 17px 4px;
  transition: padding-left .22s ease, color .2s ease;
}

.post-list a:hover {
  padding-left: 12px;
  color: var(--accent);
}

.post-list time {
  flex: none;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.post-title { font-size: 15.5px; }

/* ---------- 联系 ---------- */
.section-contact { padding-bottom: 92px; }

.contact-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.contact-list span {
  flex: none;
  width: 68px;
  font-size: 13px;
  color: var(--text-muted);
}

.contact-list a {
  font-size: 15.5px;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
  word-break: break-all;
}

.contact-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- 赞助商广告位 ---------- */
.sponsor-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 14.5px;
}

.ad-label {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--gold);
}

.sponsor-strip a {
  color: var(--text);
  transition: color .2s ease;
}

.sponsor-strip a:hover { color: var(--accent); }

/* ---------- 打赏卡片 ---------- */
.pay-grid {
  display: grid;
  /* 320px 起跳：在 880px 容器里正好两列，四张卡排成 2×2，窄屏自动单列 */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.pay-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 20px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: border-color .22s ease, transform .22s ease,
              box-shadow .22s ease;
}

.pay-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -18px color-mix(in srgb, var(--accent) 55%, transparent);
}

.pay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pay-head h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
}

.pay-sep { color: var(--text-muted); font-weight: 400; }

.chain-badge {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 二维码始终放在白色底板上，保证深浅两种主题下都能被扫到 */
.qr-box {
  display: grid;
  place-items: center;
  padding: 11px;
  border-radius: 12px;
  background: #FFFFFF;
}

.qr-box img {
  display: block;
  width: 100%;
  max-width: 150px;
  height: auto;
}

.pay-label {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.pay-addr {
  display: block;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: .01em;
  word-break: break-all;
  color: var(--text);
  user-select: all;
}

.pay-actions {
  display: flex;
  gap: 8px;
}

.copy-btn,
.pay-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.copy-btn:hover,
.pay-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn[data-state="copied"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* 复制后的提示文案跟随语言切换 */
.copy-btn[data-state="copied"] .copy-text { display: none; }
.copy-btn[data-state="copied"]::after { content: "已复制"; }
html[lang^="en"] .copy-btn[data-state="copied"]::after { content: "Copied"; }

.pay-contract {
  margin: 0;
  padding-top: 3px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--text-muted);
}

.pay-contract a {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.pay-contract a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- 转账网络提示 ---------- */
.pay-note {
  margin: 24px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--bg-elevated);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

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

/* ---------- 页脚 ---------- */
.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.site-footer p { margin: 0 0 6px; }

.site-footer a {
  transition: color .2s ease;
}

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

.copyright { margin-bottom: 12px !important; }

/* ---------- 滚动进入动效（渐进增强） ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }

  .header-inner { height: 60px; gap: 14px; }

  .brand { font-size: 14.5px; gap: 8px; }

  .nav {
    gap: 14px;
    font-size: 13px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* 右侧淡出，暗示还能横向滚动 */
    mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
  }

  .nav::-webkit-scrollbar { display: none; }

  .theme-toggle { width: 34px; height: 34px; flex: none; }

  .lang-toggle { height: 34px; padding: 0 10px; font-size: 12px; }

  .header-tools { gap: 6px; }

  .hero { padding: 92px 0 76px; }

  .hero-lead { font-size: 16px; }

  .section { padding: 58px 0; }

  .section-title { font-size: 23px; margin-bottom: 26px; }

  .post-list a { flex-direction: column; gap: 4px; }

  .post-src { margin-left: 0; align-self: flex-start; }

  .contact-list li { gap: 12px; }
}

/* 超窄屏：只保留树形图标，把导航让出来 */
@media (max-width: 440px) {
  .brand span { display: none; }
  .nav { gap: 12px; }
}

/* 尊重"减少动态效果"的系统偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
