/* =========================================================
   林间 · 个人小站
   配色：晨雾 / 苔绿 / 嫩芽 / 天青 / 日光
   ========================================================= */
:root {
  --mist: #EEF5F1;      /* 晨雾：页面底色 */
  --mist-2: #E2EEE7;    /* 稍深的雾，用于分区 */
  --moss: #2F5D50;      /* 苔绿：主色、按钮 */
  --moss-deep: #1F3D35; /* 深苔：标题文字 */
  --leaf: #9BC9A3;      /* 嫩芽：点缀 */
  --sky: #BFDCE5;       /* 天青 */
  --sun: #F4D35E;       /* 日光：唯一暖色 */
  --ink: #2A3B36;       /* 正文 */
  --ink-soft: #5E716B;  /* 次要文字 */
  --line: #CFE0D7;      /* 分隔线 */
  --paper: #FAFCFB;     /* 卡片底 */

  --font-hand: "LXGW WenKai Screen", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", serif;
  --font-body: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --wrap: 1120px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.4em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500; font-size: 15px;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sun { background: var(--sun); color: var(--moss-deep); }
.btn-sun:hover { background: #F7DE80; }
.btn-ghost { border-color: rgba(255,255,255,.7); color: #fff; background: rgba(255,255,255,.12); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.25); }
.btn-moss { background: var(--moss); color: #fff; }
.btn-moss:hover { background: var(--moss-deep); }
.btn-ghost-dark { border-color: var(--moss); color: var(--moss); background: transparent; }
.btn-ghost-dark:hover { background: var(--moss); color: #fff; }
.btn-text { background: none; color: var(--ink-soft); padding-inline: .8em; }
.btn-text:hover { color: var(--ink); }

/* =========================================================
   首屏：随时间变化的山林
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  overflow: hidden;
  color: #fff;
  /* 默认：白天 */
  --sky-top: #8EC5DE; --sky-bottom: #E6F3EE;
  --sun-c: #FFF3B0; --glow: rgba(255, 240, 170, .55);
  --hill-far: #A9CFC0; --hill-mid: #6FA58F; --hill-near: #3E7462; --pine: #2C5A4B;
  --mist-c: rgba(238, 245, 241, 1);
  --text-shadow: 0 1px 18px rgba(31, 61, 53, .25);
}
.hero[data-phase="dawn"] {
  --sky-top: #A8C8DE; --sky-bottom: #F8E1CC;
  --sun-c: #FFE3A8; --glow: rgba(255, 210, 160, .55);
  --hill-far: #B5CDC6; --hill-mid: #7FA699; --hill-near: #4B7768; --pine: #35604F;
}
.hero[data-phase="dusk"] {
  --sky-top: #6F7FB5; --sky-bottom: #F2BC96;
  --sun-c: #FFC98A; --glow: rgba(255, 170, 120, .5);
  --hill-far: #9C9FBE; --hill-mid: #6C7F92; --hill-near: #3F5A5E; --pine: #2E4549;
  --text-shadow: 0 1px 18px rgba(40, 40, 80, .35);
}
.hero[data-phase="night"] {
  --sky-top: #0F1D33; --sky-bottom: #33506B;
  --sun-c: #F3F1E3; --glow: rgba(220, 230, 255, .22);
  --hill-far: #2F4A5C; --hill-mid: #22394A; --hill-near: #172A36; --pine: #10202A;
  --text-shadow: 0 1px 18px rgba(0, 0, 0, .4);
}

.scene { position: absolute; inset: 0; }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky-top { stop-color: var(--sky-top); transition: stop-color 1.2s; }
.sky-bottom { stop-color: var(--sky-bottom); transition: stop-color 1.2s; }
.glow-in { stop-color: var(--glow); }
.glow-out { stop-color: var(--glow); stop-opacity: 0; }
.sun { fill: var(--sun-c); }
.stars circle { fill: #fff; opacity: 0; transition: opacity 1.2s; }
.hero[data-phase="night"] .stars circle { opacity: .85; animation: twinkle 4s ease-in-out infinite; }
.hero[data-phase="night"] .stars circle:nth-child(3n) { animation-delay: 1.3s; }
.hero[data-phase="night"] .stars circle:nth-child(3n+1) { animation-delay: 2.6s; }
@keyframes twinkle { 50% { opacity: .3; } }

.scene .layer { top: 7vh; left: -40px; width: calc(100% + 80px); }
.layer { will-change: transform; transition: transform .6s cubic-bezier(.2,.7,.3,1); }
.far path { fill: var(--hill-far); }
.mid path { fill: var(--hill-mid); }
.near > path { fill: var(--hill-near); }
.pines path { fill: var(--pine); }
.layer path { transition: fill 1.2s; }

/* 首屏入场：太阳升起，山峦落定 —— 全站唯一的编排动画 */
.sun-wrap { transform-box: view-box; animation: sunrise 2.4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes sunrise { from { transform: translateY(260px); opacity: 0; } to { transform: none; opacity: 1; } }
.scene .far  { animation: settle 1.6s .1s cubic-bezier(.2,.7,.2,1) both; }
.scene .mid  { animation: settle 1.6s .25s cubic-bezier(.2,.7,.2,1) both; }
.scene .near { animation: settle 1.6s .4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes settle { from { translate: 0 80px; } to { translate: 0 0; } }

.clouds { position: absolute; inset: 0; pointer-events: none; }
.cloud {
  position: absolute; display: block;
  height: 46px; border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  filter: blur(1px);
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 50%;
}
.cloud::before { width: 60px; height: 60px; left: 22%; top: -28px; }
.cloud::after  { width: 44px; height: 44px; left: 52%; top: -18px; }
.c1 { width: 170px; top: 18%; left: -200px; animation-duration: 95s; }
.c2 { width: 120px; top: 30%; left: -200px; animation-duration: 130s; animation-delay: -60s; opacity: .7; }
.c3 { width: 210px; top: 10%; left: -240px; animation-duration: 160s; animation-delay: -110s; opacity: .55; }
.hero[data-phase="night"] .cloud { background: rgba(200, 215, 235, .18); }
@keyframes drift { to { transform: translateX(calc(100vw + 480px)); } }

.mist {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22%;
  background: linear-gradient(to bottom, transparent, var(--mist-c));
}

/* 导航 */
.nav {
  position: relative; z-index: 3;
  max-width: var(--wrap); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 28px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-hand); font-size: 22px; text-decoration: none;
  text-shadow: var(--text-shadow);
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 50% 50% 50% 0;
  background: var(--sun); transform: rotate(-45deg);
  box-shadow: inset -4px -4px 0 rgba(47, 93, 80, .25);
}
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  text-decoration: none; padding: 6px 14px; border-radius: 999px; font-size: 15px;
  text-shadow: var(--text-shadow); transition: background-color .2s;
}
.nav-links a:hover { background: rgba(255, 255, 255, .2); }

/* 首屏文字 */
.hero-text {
  position: relative; z-index: 2;
  max-width: var(--wrap); margin: 0 auto;
  padding: 9vh 28px 0;
}
.greeting {
  margin: 0 0 14px;
  font-family: var(--font-hand); font-size: 20px;
  text-shadow: var(--text-shadow);
}
.hero h1 {
  margin: 0;
  font-family: var(--font-hand); font-weight: 400;
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 1.22; letter-spacing: .02em;
  max-width: 13em;
  text-shadow: var(--text-shadow);
}
.hero-sub {
  margin: 24px 0 0; max-width: 30em;
  font-size: 17px; line-height: 1.8;
  text-shadow: var(--text-shadow);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* =========================================================
   通用区块
   ========================================================= */
.section { max-width: var(--wrap); margin: 0 auto; padding: 96px 28px; }
.section-tint {
  max-width: none;
  background: var(--mist-2);
  border-radius: 48px 48px 0 0;
}
.section-tint > * { max-width: calc(var(--wrap) - 56px); margin-left: auto; margin-right: auto; }
.section-head { position: relative; margin-bottom: 40px; }
.section-head h2 {
  margin: 0;
  font-family: var(--font-hand); font-weight: 400;
  font-size: clamp(32px, 4vw, 44px); line-height: 1.3;
  color: var(--moss-deep);
}
.section-head p { margin: 8px 0 0; color: var(--ink-soft); max-width: 36em; }
.head-btn { position: absolute; right: 0; bottom: 4px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 14px; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(155, 201, 163, .35);
}
.field-row { display: grid; grid-template-columns: 1fr 110px; gap: 12px; }

/* =========================================================
   交流
   ========================================================= */
.talk-grid { display: grid; grid-template-columns: 360px 1fr; gap: 48px; align-items: start; }

.compose {
  position: sticky; top: 24px;
  padding: 28px;
  background: var(--paper);
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
}
.compose h3 { margin: 0 0 18px; font-family: var(--font-hand); font-weight: 400; font-size: 24px; color: var(--moss-deep); }
.moods { border: 0; padding: 0; margin: 0 0 20px; }
.moods legend { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; padding: 0; }
.moods { display: flex; flex-wrap: wrap; gap: 8px; }
.moods label { cursor: pointer; }
.moods input { position: absolute; opacity: 0; pointer-events: none; }
.moods span {
  display: inline-block; padding: 5px 12px; font-size: 14px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  transition: background-color .2s, border-color .2s;
}
.moods input:checked + span { background: #E3F1E6; border-color: var(--leaf); color: var(--moss-deep); }
.moods input:focus-visible + span { outline: 2px solid var(--moss); outline-offset: 2px; }
.compose-foot { display: flex; align-items: center; justify-content: space-between; }
.count { font-size: 13px; color: var(--ink-soft); }

.stream-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
  color: var(--ink-soft); font-size: 14px;
}
.seg { display: inline-flex; background: var(--mist-2); border-radius: 999px; padding: 3px; }
.seg button {
  border: 0; background: none; cursor: pointer;
  padding: 4px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-soft);
}
.seg button.is-on { background: #fff; color: var(--moss-deep); }

.messages { list-style: none; margin: 0; padding: 0; }
.msg {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.msg.is-new { animation: arrive .5s ease-out; }
@keyframes arrive { from { background: rgba(244, 211, 94, .25); } to { background: transparent; } }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-hand); font-size: 20px; color: #fff;
}
.msg-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.msg-name { font-weight: 600; color: var(--moss-deep); }
.msg-time { font-size: 13px; color: var(--ink-soft); }
.msg-body { margin: 6px 0 10px; white-space: pre-wrap; word-break: break-word; max-width: 38em; }
.msg-actions { display: flex; gap: 4px; }
.msg-actions button {
  border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; margin-left: -10px; margin-right: 6px;
  border-radius: 999px; font-size: 14px; color: var(--ink-soft);
  transition: background-color .2s, color .2s;
}
.msg-actions button:hover { background: var(--mist-2); color: var(--moss); }
.msg-actions button.liked { color: #C9622F; }
.replies { list-style: none; margin: 12px 0 0; padding: 0 0 0 16px; border-left: 2px solid var(--leaf); }
.replies li { padding: 6px 0; font-size: 15px; }
.replies b { color: var(--moss-deep); font-weight: 600; margin-right: 6px; }
.reply-form { display: flex; gap: 8px; margin-top: 12px; }
.reply-form input {
  flex: 1; min-width: 0; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.reply-form input:focus { outline: none; border-color: var(--moss); }
.reply-form .btn { padding: .5em 1.1em; font-size: 14px; }

/* =========================================================
   资料分享
   ========================================================= */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.toolbar-right { display: flex; gap: 10px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid transparent; background: rgba(255,255,255,.6); cursor: pointer;
  padding: 6px 16px; border-radius: 999px; font-size: 14px; color: var(--ink-soft);
  transition: background-color .2s, color .2s;
}
.chip:hover { color: var(--moss-deep); }
.chip.is-on { background: var(--moss); color: #fff; }
.search input {
  width: 220px; padding: 9px 16px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.search input:focus { outline: none; border-color: var(--moss); }

.shelf { list-style: none; margin: 0 auto; padding: 0; background: var(--paper); border-radius: var(--radius-m); overflow: hidden; }
.file {
  display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.file:last-child { border-bottom: 0; }
.file:hover { background: #F3F8F5; }
.ftype {
  width: 56px; height: 64px; border-radius: 6px 16px 6px 6px;
  display: grid; place-items: end center; padding-bottom: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--moss-deep); background: #DCEBE1;
}
.ftype[data-t="PDF"]  { background: #F3DCD2; color: #8A3E22; }
.ftype[data-t="XLSX"] { background: #D7EBD9; color: #2B6A39; }
.ftype[data-t="DOCX"] { background: #D6E3F1; color: #2D4F7C; }
.ftype[data-t="ZIP"]  { background: #F4E8C4; color: #7A5B12; }
.file-title { margin: 0; font-weight: 600; color: var(--moss-deep); }
.file-desc { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); max-width: 40em; }
.file-meta { font-size: 13px; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.file-meta span { display: block; }
.file .btn { padding: .5em 1.2em; font-size: 14px; }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 0; }

/* =========================================================
   链接分享
   ========================================================= */
.garden { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px 48px; }
.grove h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-family: var(--font-hand); font-weight: 400; font-size: 22px; color: var(--moss-deep);
}
.grove h3 small { font-family: var(--font-body); font-size: 13px; color: var(--ink-soft); }
.grove ul { list-style: none; margin: 0; padding: 0; }
.link {
  display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center;
  padding: 12px 10px; margin: 0 -10px;
  border-radius: var(--radius-s);
  text-decoration: none;
  transition: background-color .2s;
}
.link:hover { background: var(--mist-2); }
.link-badge {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 15px;
}
.link-name { font-weight: 600; color: var(--moss-deep); display: block; line-height: 1.4; }
.link-note { font-size: 14px; color: var(--ink-soft); display: block; line-height: 1.5; }
.link-domain { font-size: 12px; color: #8EA39C; }

/* =========================================================
   页脚 / 弹窗 / 提示
   ========================================================= */
.footer {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 36px 28px 48px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-soft);
}
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--moss); }

.dialog {
  width: min(460px, calc(100vw - 32px));
  border: 0; border-radius: var(--radius-l); padding: 0;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px rgba(31, 61, 53, .25);
}
.dialog::backdrop { background: rgba(31, 61, 53, .35); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dialog-form { padding: 28px; }
.dialog-form h3 { margin: 0 0 18px; font-family: var(--font-hand); font-weight: 400; font-size: 24px; color: var(--moss-deep); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0;
  padding: 10px 20px; border-radius: 999px;
  background: var(--moss-deep); color: #fff; font-size: 14px;
  pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 900px) {
  .talk-grid { grid-template-columns: 1fr; gap: 36px; }
  .compose { position: static; }
  .file { grid-template-columns: 48px 1fr auto; gap: 14px; padding: 16px 18px; }
  .ftype { width: 48px; height: 56px; }
  .file-meta { display: none; }
}
@media (max-width: 600px) {
  .nav { padding: 20px; }
  .nav-links a { padding: 6px 10px; font-size: 14px; }
  .hero-text { padding: 7vh 20px 0; }
  .hero h1 { font-size: 34px; }
  .hero-sub { font-size: 16px; }
  .section { padding: 72px 20px; }
  .section-tint { border-radius: 32px 32px 0 0; }
  .head-btn { position: static; margin-top: 16px; }
  .toolbar-right { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .file { grid-template-columns: 44px 1fr; }
  .file .btn { grid-column: 2; justify-self: start; }
  .garden { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .cloud { display: none; }
}
