/* ============================================================
   林知夏的个人站 —— 忠实复刻 sharyap 单窗口布局（浅色可爱风）
   ============================================================ */

:root {
  --bg: #ffffff;
  --ink: #3a3a3a;
  --ink-2: #8a8a8a;
  --accent: #f7941d;          /* 橙色点缀 */
  --hill-1: #cbe8f7;
  --hill-2: #bfe2f4;
  --bar: #3f3f3f;             /* 窗口标题栏深灰 */
  --bar-text: #f5f5f5;
  --win-bg: #ffffff;
  --win-border: #e6e6e6;
  --icon-ink: #4a4a4a;
  --shadow: 0 10px 30px -12px rgba(60, 90, 120, 0.18);
  --radius: 10px;
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

/* 深色主题配色对齐 sharyap 原站：近黑背景 + 深蓝山坡/窗口 + 浅青文字 */
html[data-theme="dark"] {
  --bg: #191c22;
  --ink: #dff2f9;
  --ink-2: #8fa5b3;
  --accent: #7fd0e8;          /* 深色下点缀变浅青 */
  --hill-1: #2c4a60;
  --hill-2: #253f52;
  --bar: #0e1318;
  --bar-text: #d8e9f2;
  --win-bg: #1f3446;
  --win-border: #31485c;
  --icon-ink: #d7e9f2;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 左上角系统按钮 ---------- */
.sys-controls {
  position: fixed;
  top: 18px; left: 20px;
  display: flex; gap: 10px;
  z-index: 30;
}
.sys-btn {
  width: 34px; height: 34px;
  border: none; background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.sys-btn:hover { background: rgba(0,0,0,0.06); transform: scale(1.08); }
html[data-theme="dark"] .sys-btn:hover { background: rgba(255,255,255,0.1); }
.sys-btn svg { width: 21px; height: 21px; }

#btn-theme .ico-moon { display: none; }
html[data-theme="dark"] #btn-theme .ico-sun { display: none; }
html[data-theme="dark"] #btn-theme .ico-moon { display: block; }

#btn-sound .ico-snd-off { display: none; }
body.muted #btn-sound .ico-snd-on { display: none; }
body.muted #btn-sound .ico-snd-off { display: block; }

/* 星星已换成图片素材（assets/icon_star.webp），深浅主题通用，无需变色 */

/* ---------- 主题切换幕布转场（原站交互：色布从上扫到下） ---------- */
.wipe {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  transform: translateY(-101%);
  background: linear-gradient(to bottom, #83878c 0%, #82868b 96.5%, #cdeef2 96.5%, #e6f8fa 100%);
  will-change: transform;
}
.wipe.run { animation: wipeDown 0.95s cubic-bezier(0.65, 0.05, 0.35, 0.95) forwards; }
@keyframes wipeDown {
  0%   { transform: translateY(-101%); }
  45%  { transform: translateY(0); }
  55%  { transform: translateY(0); }
  100% { transform: translateY(101%); }
}

/* ---------- 星星吉祥物（彩蛋交互）：固定在左上角 ---------- */
.mascot-star {
  position: fixed;
  top: 8px;
  left: clamp(110px, 13vw, 220px);
  width: 92px; height: 84px;
  z-index: 5;
  animation: bob 3.2s ease-in-out infinite;
  cursor: pointer;
  transition: filter 0.25s ease, transform 0.2s ease;
}
.mascot-star img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.mascot-star:hover, .mascot-star.lit {
  filter: drop-shadow(0 0 10px rgba(255, 180, 40, 0.85)) drop-shadow(0 0 22px rgba(255, 150, 20, 0.45));
}
.mascot-star.lit { animation: bob 3.2s ease-in-out infinite, wiggle 0.5s ease-in-out; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg) scale(1.08); }
  75% { transform: rotate(8deg) scale(1.08); }
}

/* 星星对话气泡 */
.bubble {
  position: absolute;
  left: 100%; top: 62%;
  margin-left: -14px;
  white-space: nowrap;
  background: var(--win-bg);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink);
  opacity: 0;
  transform: translateY(4px) scale(0.9);
  transform-origin: left center;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 10px -4px rgba(0,0,0,0.15);
}
.bubble::before {
  content: "";
  position: absolute;
  left: -7px; top: 50%;
  width: 10px; height: 10px;
  background: var(--win-bg);
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateY(-50%) rotate(45deg);
}
.mascot-star:hover .bubble, .mascot-star.lit .bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 星星点亮时，窗口彩色渐变描边光晕 */
.win.glow { position: relative; }
.win.glow::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--radius) + 3px);
  padding: 2px;
  background: linear-gradient(120deg, #ffb340, #ff7ac3, #7ac3ff, #7dffb8, #ffb340);
  background-size: 300% 300%;
  animation: glowSlide 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask-composite: exclude;
  pointer-events: none;
}
@keyframes glowSlide {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

/* ---------- 中央单窗口 ---------- */
.win {
  position: relative;
  z-index: 10;
  width: min(940px, calc(100vw - 60px));
  margin-top: 132px;   /* 星星移出文档流后，补回原有顶部留白 */
  background: var(--win-bg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.win__bar {
  height: 42px;
  background: var(--bar);
  color: var(--bar-text);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.35s ease;
}

/* [x] 关闭按钮（同原站：标题栏右侧文字按钮） */
.win__close {
  background: none; border: none;
  color: var(--bar-text);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.win__close:hover { opacity: 1; color: #ffb46e; background: rgba(255,255,255,0.08); }
.win__close.hide { display: none; }

.win__body {
  padding: 30px 40px 28px;
  min-height: clamp(340px, 58vh, 540px);
  max-height: min(72vh, 660px);
  overflow: hidden;                        /* 滚动交给内层视图，滚动条跟着滚动区域走 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* 常显细滚动条（同原站：只出现在真正滚动的区域） */
.view::-webkit-scrollbar, .about-scroll::-webkit-scrollbar { width: 12px; }
.view::-webkit-scrollbar-track, .about-scroll::-webkit-scrollbar-track { background: transparent; }
.view::-webkit-scrollbar-thumb, .about-scroll::-webkit-scrollbar-thumb {
  background: #c7cdd4;
  border-radius: 8px;
  border: 3px solid var(--win-bg);
}
.view::-webkit-scrollbar-thumb:hover, .about-scroll::-webkit-scrollbar-thumb:hover { background: #aab3bd; }
html[data-theme="dark"] .view::-webkit-scrollbar-thumb,
html[data-theme="dark"] .about-scroll::-webkit-scrollbar-thumb { background: #3d5a72; }
html[data-theme="dark"] .view::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .about-scroll::-webkit-scrollbar-thumb:hover { background: #4d6e88; }
.view, .about-scroll { scrollbar-width: thin; scrollbar-color: #c7cdd4 transparent; }
html[data-theme="dark"] .view, html[data-theme="dark"] .about-scroll { scrollbar-color: #3d5a72 transparent; }

/* 视图切换淡入（每个视图自己滚动） */
.view { width: 100%; text-align: center; animation: viewIn 0.32s ease backwards; overflow-y: auto; min-height: 0; }
/* 注意 fill-mode 用 backwards：结束后释放 transform，否则会破坏 .about-head 的 sticky */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 内页：左对齐排版（同原站「关于」窗口） */
.view--page { text-align: left; }
.view--page h2 { text-align: left; }

/* 首页大标题 */
.hero-title {
  font-size: clamp(36px, 7vw, 54px);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.hero-title .accent { color: var(--accent); }

.hero-sub {
  margin-top: 10px;
  font-size: 17px;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}

/* 图标导航行 */
.icon-nav {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: clamp(18px, 5vw, 44px);
  flex-wrap: wrap;
}
.icon-nav__item {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  color: var(--icon-ink);
  font-family: var(--sans);
  transition: transform 0.16s ease;
  padding: 4px 2px;
}
.icon-nav__item:hover { transform: translateY(-4px); }
.icon-nav__item:active { transform: translateY(-1px) scale(0.96); }
.icon-nav__item svg { width: 52px; height: 52px; }
.icon-nav__item span { font-size: 14px; color: var(--ink); }

/* 内页通用 */
.view h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: 0.03em;
}
.view h2 .accent { color: var(--accent); }
.view p { font-size: 15px; line-height: 1.9; color: var(--ink); }
.view .muted { color: var(--ink-2); font-size: 14px; }

/* ---------- 「关于」页（对照 sharyap：头像 + 橙色名字 + 身份 + 简介 + 要点） ---------- */
/* 头部固定不滚，滚动条只属于下方 .about-scroll（从头部底下才开始） */
/* 全部用常规流布局、零负边距、零溢出 —— 不会出现横向滚动条，也不会裁头像 */
.view--about {
  display: flex; flex-direction: column;
}
.about-head {
  display: flex; align-items: center; gap: 22px;
  flex-shrink: 0;
  background: var(--win-bg);
  padding: 0 0 16px;
  border-bottom: 1.5px solid var(--win-border);
  transition: background 0.35s ease, border-color 0.35s ease;
}
.about-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 12px 0 0;         /* 右侧留滚动条槽位 */
}
.avatar {
  width: 140px; height: 140px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  /* 对照 sharyap：照片贴满圆形，无描边无底色 */
}
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.about-name {
  display: flex; align-items: center; gap: 7px;
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
}
/* 名字前的小竖线装饰（同原站名字旁的符号） */
.name-ico { display: inline-flex; gap: 3px; align-items: flex-end; height: 22px; }
.name-ico i { width: 3.5px; border-radius: 2px; background: var(--accent); }
.name-ico i:first-child { height: 14px; }
.name-ico i:last-child { height: 22px; }

.about-role { font-size: 15px; color: var(--ink); line-height: 1.7; }
.about-role a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.about-role a:hover { opacity: 0.8; }

.about-hr {
  border: none;
  border-top: 1.5px solid var(--win-border);
  margin: 22px 0;
}

.about-intro { font-size: 15px; line-height: 1.9; margin-bottom: 18px; }

.about-list {
  margin: 0 0 14px 4px;
  padding-left: 22px;
  display: flex; flex-direction: column; gap: 9px;
}
.about-list li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}
.about-list li::marker { color: var(--ink); }

/* 作品卡 */
.work-list { display: flex; flex-direction: column; gap: 14px; width: 100%; margin-top: 6px; }
.work-card {
  text-align: left;
  border: 1.5px solid var(--win-border);
  border-radius: 10px;
  padding: 14px 18px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  font-family: var(--sans);
  color: var(--ink);
}
.work-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.work-card b { font-size: 15px; display: block; margin-bottom: 4px; }
.work-card span { font-size: 13px; color: var(--ink-2); line-height: 1.6; display: block; }

/* 摄影页：照片卡网格（照片就位前显示占位小山图案） */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 6px;
}
.photo-card {
  border: 1.5px solid var(--win-border);
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.photo-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.photo-card img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photo-ph {
  height: 110px;
  display: grid; place-items: center;
  color: var(--ink-2);
  background: var(--hill-1);
  opacity: 0.85;
}
.photo-ph svg { width: 34px; height: 34px; }
.photo-card figcaption { padding: 8px 12px 10px; text-align: left; }
.photo-card figcaption b { font-size: 13.5px; display: block; }
.photo-card figcaption span { font-size: 12px; color: var(--ink-2); }

/* 碎碎念页：时间线小卡 */
.murmur-list {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; margin-top: 6px;
}
.murmur-item {
  border: 1.5px solid var(--win-border);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: left;
  transition: border-color 0.15s ease;
}
.murmur-item:hover { border-color: var(--accent); }
.murmur-item small { font-size: 12px; color: var(--ink-2); letter-spacing: 0.05em; }
.murmur-item p { font-size: 14.5px; line-height: 1.8; margin-top: 3px; }

/* FAQ 折叠 */
.faq-list { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; text-align: left; }
.faq-item { border: 1.5px solid var(--win-border); border-radius: 10px; overflow: hidden; }
.faq-q {
  width: 100%; border: none; background: transparent;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  color: var(--ink);
  padding: 13px 16px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; text-align: left;
}
.faq-q::after { content: "+"; font-size: 17px; color: var(--accent); transition: transform 0.2s ease; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.28s ease; }
.faq-a p { padding: 0 16px 14px; font-size: 13.5px; color: var(--ink-2); }
.faq-item.open .faq-a { max-height: 220px; }

/* 链接 / 联系列表 */
.link-list { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 6px; }
.link-item {
  display: flex; align-items: center; gap: 13px;
  text-decoration: none; color: var(--ink);
  border: 1.5px solid var(--win-border);
  border-radius: 10px; padding: 12px 16px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  font-size: 14.5px;
}
.link-item:hover { border-color: var(--accent); transform: translateX(3px); }
.link-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.link-item small { margin-left: auto; color: var(--ink-2); font-size: 12px; }

/* ---------- 底部社交 + 版权 ---------- */
.footer {
  position: fixed;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.socials { display: flex; gap: 14px; }
.socials a {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bar);
  color: #fff;
  display: grid; place-items: center;
  transition: transform 0.16s ease, background 0.16s ease;
}
.socials a:hover { transform: translateY(-4px) scale(1.06); background: var(--accent); }
.socials svg { width: 18px; height: 18px; }
/* 深色下社交钮变白底（同原站） */
html[data-theme="dark"] .socials a { background: #eef4f7; color: #1c2733; }
.copyright { font-size: 11.5px; color: var(--ink-2); letter-spacing: 0.05em; }

/* ---------- 绿色小团子（唱歌） ---------- */
.mascot-blob {
  position: fixed;
  right: clamp(8px, 4vw, 60px);
  bottom: clamp(4px, 2vw, 18px);
  width: clamp(90px, 12vw, 140px);
  z-index: 6;
  animation: bob 4s ease-in-out infinite reverse;
}
.mascot-blob.singing { animation: bob 4s ease-in-out infinite reverse, sway 1.1s ease-in-out infinite; }
@keyframes sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg) translateY(-3px); }
}
.mascot-blob svg { width: 100%; height: auto; }

/* 唱歌冒出的音符 */
.notes { position: absolute; inset: 0; pointer-events: none; }
.note {
  position: absolute;
  font-size: 15px;
  color: var(--accent);
  opacity: 0;
  animation: noteFloat 2.2s ease-out forwards;
}
.note:nth-child(even) { color: #ff7ac3; }
@keyframes noteFloat {
  0%   { opacity: 0; transform: translate(0, 0) rotate(-8deg) scale(0.6); }
  15%  { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--dx, 14px), -52px) rotate(14deg) scale(1.15); }
}

/* ---------- 山坡 ---------- */
.hill {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: clamp(130px, 22vh, 200px);
  z-index: 1;
  pointer-events: none;
}
.hill svg { width: 100%; height: 100%; display: block; }
.hill .hill1 { fill: var(--hill-1); }
.hill .hill2 { fill: var(--hill-2); }
.hill path { transition: fill 0.35s ease; }

/* ---------- 手机适配 ---------- */
@media (max-width: 640px) {
  .mascot-star { width: 72px; height: 66px; top: 6px; left: 12px; }
  .win { margin-top: 96px; }
  .win__body { padding: 30px 20px 26px; min-height: 260px; }
  .about-head { padding-bottom: 14px; gap: 16px; }
  .about-scroll { padding: 16px 8px 0 0; }
  .icon-nav { gap: 16px; }
  .icon-nav__item svg { width: 38px; height: 38px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .mascot-blob { opacity: 0.9; }
}

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