/* ============================================================
   心の小站 — 主样式（二次元可爱风主题）
   ============================================================ */

/* ---------- 字体 ---------- */
@font-face {
  font-family: 'Baloo2';
  src: url('../fonts/Baloo2-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Baloo2';
  src: url('../fonts/Baloo2-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- 主题变量 ---------- */
:root {
  --pink:        #ff8fc0;
  --pink-deep:   #f76fa8;
  --pink-light:  #ffd9e8;
  --purple:      #b8a5f5;
  --purple-deep: #9d86ee;
  --blue:        #8fc7f5;
  --blue-deep:   #6aa8e8;
  --cream:       #fff8fb;
  --milk:        #ffffff;
  --ink:         #5b4a58;
  --ink-soft:    #9a8a99;
  --peach:       #ffeef5;
  --lavender:    #f3eeff;
  --sky:         #eaf4ff;
  --radius-lg:   26px;
  --radius-md:   18px;
  --radius-sm:   12px;
  --shadow-soft: 0 8px 30px rgba(247, 130, 175, .16), 0 2px 8px rgba(157, 134, 238, .10);
  --shadow-pop:  0 14px 40px rgba(247, 130, 175, .28);
  --font-cute:   'Baloo2', '幼圆', 'YouYuan', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-body:   'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, var(--cream) 0%, var(--peach) 45%, var(--lavender) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.guest { height: 100vh; overflow: hidden; }  /* 未登录不可下滑 */
a { color: var(--pink-deep); text-decoration: none; }
a:hover { color: var(--purple-deep); }
img { max-width: 100%; }
::selection { background: var(--pink-light); color: var(--pink-deep); }

/* ---------- 背景（各页面共用，具体图片由行内 style 指定） ---------- */
.bg-deco {
  position: fixed; inset: -30px; z-index: -2;
  background-size: cover; background-position: center 30%;
  filter: blur(14px) saturate(1.05) brightness(1.06);
  transform: scale(1.06);
}
.bg-deco-overlay {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(170deg, rgba(255, 248, 251, .82) 0%, rgba(255, 238, 245, .72) 45%, rgba(243, 238, 255, .80) 100%);
}
.blog-bg { background-image: url('../img/bg-tianyi.jpg'); background-position: center 22%; }

/* ---------- 鼠标跟随粉色小圆圈 ---------- */
.cursor-dot {
  position: fixed; left: 0; top: 0; z-index: 9999;
  width: 26px; height: 26px;
  border: 2px solid rgba(255, 143, 192, .85);
  background: rgba(255, 175, 210, .22);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-100px, -100px);
  transition: width .18s ease, height .18s ease, background .18s ease, opacity .3s;
  box-shadow: 0 0 14px rgba(255, 143, 192, .55);
}
.cursor-dot.grow { width: 42px; height: 42px; background: rgba(255, 143, 192, .18); }
@media (hover: none) { .cursor-dot { display: none; } }

/* ---------- 通用布局 ---------- */
.page-container { max-width: 1080px; margin: 0 auto; padding: 26px 20px 70px; }
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .cute-title { margin: 0 auto; }
.head-space { flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-soft);
  padding: 22px 26px;
}
.card-title { font-family: var(--font-cute); font-size: 20px; margin-bottom: 16px; color: var(--ink); }
.sub-title { font-family: var(--font-cute); font-size: 16px; margin: 18px 0 10px; color: var(--ink-soft); }
.card-icon { font-size: 40px; text-align: center; filter: drop-shadow(0 4px 8px rgba(247, 111, 168, .3)); }
.notice-card { margin-bottom: 18px; border-left: 6px solid var(--pink); }

/* ---------- 按钮 ---------- */
.btn {
  font-family: var(--font-cute);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; user-select: none;
  padding: 10px 22px; font-size: 15px; border-radius: 999px;
  color: #fff; background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  box-shadow: 0 6px 18px rgba(247, 111, 168, .35);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(247, 111, 168, .45); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, #ff9dc6 0%, #f76fa8 55%, #c39bf5 100%); }
.btn-secondary { background: linear-gradient(135deg, #9ec8f7 0%, #b8a5f5 100%); }
.btn-ghost {
  background: rgba(255, 255, 255, .8); color: var(--pink-deep);
  border: 2px solid var(--pink-light); box-shadow: 0 4px 12px rgba(247, 111, 168, .12);
}
.btn-ghost:hover { background: #fff; color: var(--purple-deep); border-color: var(--lavender); }
.btn-danger { background: linear-gradient(135deg, #ff9d9d 0%, #f76f8f 100%); }
.btn-sm { padding: 7px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-family: var(--font-cute); font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 16px;
  border: 2px solid #ffd9e8; border-radius: var(--radius-sm);
  background: #fffdf; font-size: 15px; color: var(--ink); outline: none;
  transition: border .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 175, 210, .25); }
.static-value { padding: 10px 14px; background: var(--peach); border-radius: var(--radius-sm); color: var(--ink-soft); }
.textarea {
  width: 100%; padding: 12px 16px; resize: vertical;
  border: 2px solid #ffd9e8; border-radius: var(--radius-md);
  background: #fffdf; font-size: 15px; line-height: 1.8; color: var(--ink); outline: none;
  font-family: var(--font-body);
}
.textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 175, 210, .25); }
.form-error {
  background: #fff0f3; color: #e64970; border: 2px solid #ffc9d6;
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 14px;
}

/* ---------- 头像 ---------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(247, 111, 168, .25);
  background: var(--peach);
}
.avatar-blank { background: var(--peach); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(91, 74, 88, .35); backdrop-filter: blur(4px); padding: 20px; }
.modal[hidden] { display: none; }
.modal-box {
  background: rgba(255, 255, 255, .97); border-radius: var(--radius-lg);
  border: 2px solid #fff; box-shadow: var(--shadow-pop);
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  padding: 26px 28px; animation: pop .25s ease;
}
.modal-box.modal-lg { width: min(720px, 100%); }
.modal-title { font-family: var(--font-cute); font-size: 20px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@keyframes pop { from { transform: scale(.92) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(255, 255, 255, .96); color: var(--ink);
  border: 2px solid var(--pink-light); border-left: 6px solid var(--pink);
  padding: 11px 20px; border-radius: 999px; box-shadow: var(--shadow-soft);
  font-size: 14.5px; animation: toastIn .3s ease; max-width: 90vw;
}
.toast.toast-err { border-left-color: #f76f8f; color: #d6336c; }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Markdown 渲染 ---------- */
.markdown-body { line-height: 1.9; font-size: 15.5px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { font-family: var(--font-cute); margin: 0.9em 0 0.4em; color: var(--ink); }
.markdown-body h2::before { content: '♡ '; color: var(--pink); }
.markdown-body h3::before { content: '✿ '; color: var(--purple); }
.markdown-body p { margin: 0.5em 0; }
.markdown-body ul, .markdown-body ol { padding-left: 1.6em; margin: 0.5em 0; }
.markdown-body li { margin: 0.25em 0; }
.markdown-body a { color: var(--blue-deep); border-bottom: 1.5px dashed var(--pink); }
.markdown-body code { background: var(--peach); border-radius: 6px; padding: 2px 7px; font-size: 0.9em; color: var(--pink-deep); }
.markdown-body pre { background: #fdf3f7; border: 2px solid var(--pink-light); border-radius: var(--radius-sm); padding: 13px 16px; overflow: auto; margin: 0.7em 0; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 4px solid var(--pink); background: var(--peach); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 8px 16px; margin: 0.7em 0; color: var(--ink-soft); }
.markdown-body img { border-radius: var(--radius-md); max-width: 100%; box-shadow: var(--shadow-soft); margin: 6px 0; }
.markdown-body hr { border: none; border-top: 2px dashed var(--pink-light); margin: 1.2em 0; }
.markdown-body table { border-collapse: collapse; margin: .7em 0; }
.markdown-body th, .markdown-body td { border: 1.5px solid var(--pink-light); padding: 6px 12px; }

/* 数学公式 */
.math-block { margin: 1em 0; overflow-x: auto; overflow-y: hidden; text-align: center; }
.math-block .katex-display { margin: 0; }
.markdown-body .katex { font-size: 1.12em; }
.math-error { color: #e64970; background: #fff0f3; border-radius: 6px; padding: 2px 8px; }

/* ============================================================
   主页
   ============================================================ */
.page-home .hero-bg {
  position: fixed; inset: -40px; z-index: -2;
  background-image: url('../img/bg-aqua.jpg');
  background-size: cover;
  background-position: center 32%;
  filter: blur(10px) saturate(1.08) brightness(1.04);
  transform: scale(1.08);
}
/* 不同屏幕比例采用不同截取 */
@media (max-aspect-ratio: 3/4) { .page-home .hero-bg { background-position: 62% 20%; } }
@media (min-aspect-ratio: 21/9)  { .page-home .hero-bg { background-position: center 45%; } }
@media (max-width: 600px)        { .page-home .hero-bg { background-position: 60% 25%; } }

.page-home .hero-bg-overlay {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 500px at 70% 20%, rgba(255, 214, 235, .35), transparent 60%),
    linear-gradient(180deg, rgba(255, 250, 253, .78) 0%, rgba(255, 240, 247, .70) 40%, rgba(243, 240, 255, .82) 100%);
}

.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 0 20px; position: relative;
}
.hero-title {
  font-family: var(--font-cute);
  font-size: clamp(44px, 8.5vw, 104px);
  font-weight: 700; letter-spacing: 2px; line-height: 1.15;
  background: linear-gradient(120deg, #f76fa8 15%, #b8a5f5 55%, #6aa8e8 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 18px rgba(247, 111, 168, .30));
  animation: floatY 4.5s ease-in-out infinite;
}
.hero-sub {
  margin-top: 14px; font-size: clamp(16px, 2.4vw, 22px);
  color: var(--ink-soft); letter-spacing: 6px;
}
.hero-divider { margin-top: 26px; color: var(--pink); font-size: 20px; }
.hero-divider span { animation: beat 1.6s ease-in-out infinite; display: inline-block; }
.hero-hint { margin-top: 40px; color: var(--ink-soft); font-size: 14px; background: rgba(255,255,255,.6); padding: 9px 22px; border-radius: 999px; border: 2px dashed var(--pink-light); }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes beat { 0%,100% { transform: scale(1); } 30% { transform: scale(1.25); } }

.scroll-hint { margin-top: 46px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-soft); }
.scroll-hint .mouse { width: 24px; height: 38px; border: 2.5px solid var(--pink); border-radius: 14px; display: flex; justify-content: center; padding-top: 6px; }
.scroll-hint .wheel { width: 4px; height: 8px; border-radius: 4px; background: var(--pink); animation: wheel 1.6s ease-in-out infinite; }
.scroll-hint .scroll-text { font-size: 13px; letter-spacing: 2px; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* 飘浮装饰 */
.floating-deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.floating-deco span {
  position: absolute; color: rgba(247, 111, 168, .5); font-size: 20px;
  animation: drift 7s ease-in-out infinite; animation-delay: var(--d, 0s);
}
@keyframes drift { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-22px) rotate(12deg); } }

/* 主页分节 */
.home-section { max-width: 1080px; margin: 0 auto; padding: 30px 20px 80px; position: relative; }
.section-title { font-family: var(--font-cute); text-align: center; font-size: clamp(26px, 4vw, 36px); color: var(--ink); }
.section-title .title-dot { color: var(--pink); animation: beat 1.8s infinite; display: inline-block; }
.section-sub { text-align: center; color: var(--ink-soft); margin: 8px 0 30px; }

/* 功能入口：一行四个圆角方框 */
.func-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.func-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 210px; padding: 26px 18px; text-align: center;
  background: linear-gradient(160deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
  border: 2.5px solid var(--hue, var(--pink-light));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform .22s ease, box-shadow .22s ease;
  overflow: hidden;
}
.func-card::after {
  content: '✦'; position: absolute; right: -8px; top: -12px; font-size: 44px;
  color: var(--hue, var(--pink-light)); opacity: .8; transition: transform .3s;
}
.func-card:hover { transform: translateY(-8px) rotate(-0.6deg); box-shadow: var(--shadow-pop); }
.func-card:hover::after { transform: rotate(20deg) scale(1.2); }
.func-icon { font-size: 52px; margin-bottom: 14px; filter: drop-shadow(0 6px 10px rgba(247,111,168,.3)); transition: transform .25s; }
.func-card:hover .func-icon { transform: scale(1.15) rotate(-6deg); }
.func-title { font-family: var(--font-cute); font-size: 18px; color: var(--ink); }
.func-desc { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.func-arrow { margin-top: 14px; color: var(--pink-deep); font-weight: bold; opacity: 0; transition: opacity .2s; }
.func-card:hover .func-arrow { opacity: 1; }
@media (max-width: 900px) { .func-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .func-grid { grid-template-columns: 1fr; } }

/* 网站介绍 */
.intro-card { position: relative; }
.intro-card .btn-sm { position: absolute; top: 16px; right: 16px; }

.site-footer { text-align: center; color: var(--ink-soft); font-size: 13px; margin-top: 40px; letter-spacing: 1px; }
.guest-footer { position: fixed; bottom: 16px; left: 0; right: 0; margin: 0; }

/* ---------- 左侧隐藏目录栏 ---------- */
.side-rail { position: fixed; left: 0; top: 0; width: 0; height: 100vh; z-index: 200; }
.side-rail-body {
  position: absolute; left: 0; top: 50%;
  transform: translate(-100%, -50%);   /* 收起时完全滑出，手柄贴住屏幕左缘 */
  transition: transform .28s ease;
  background: rgba(255, 255, 255, .93); backdrop-filter: blur(8px);
  border: 2px solid var(--pink-light); border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-soft); padding: 14px 18px 14px 26px; min-width: 150px;
}
.side-rail:hover .side-rail-body, .side-rail.open .side-rail-body { transform: translate(0, -50%); }
.side-rail-handle {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  width: 30px; height: 58px; background: rgba(255,255,255,.93);
  border: 2px solid var(--pink-light); border-left: none;
  border-radius: 0 14px 14px 0; display: flex; align-items: center; justify-content: center;
  color: var(--pink-deep); cursor: pointer; box-shadow: 4px 4px 12px rgba(247,111,168,.18);
}
.rail-title { font-family: var(--font-cute); color: var(--pink-deep); font-size: 15px; margin-bottom: 8px; letter-spacing: 2px; }
.rail-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--ink); font-size: 14.5px; transition: background .15s, transform .15s; }
.rail-item:hover { background: var(--peach); transform: translateX(4px); color: var(--pink-deep); }

/* ---------- 右上角用户区 ---------- */
.user-corner { position: fixed; top: 18px; right: 20px; z-index: 200; }
.user-bubble {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px);
  border: 2px solid #fff; border-radius: 999px; padding: 5px 16px 5px 6px;
  box-shadow: var(--shadow-soft); transition: transform .18s;
}
.user-bubble:hover { transform: translateY(-2px) scale(1.03); }
.user-bubble .avatar { width: 38px; height: 38px; }
.user-name { font-family: var(--font-cute); color: var(--ink); font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   登录 / 安装页
   ============================================================ */
.login-card, .install-card { width: min(400px, 100%); text-align: center; }
.login-card .field, .install-card .field { text-align: left; }
.login-card .cute-title, .install-card .cute-title { margin-bottom: 6px; }
.login-card .muted, .install-card .muted { margin-bottom: 18px; }
.link-plain { display: inline-block; margin-top: 10px; }
.shake { animation: shake .4s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); margin-bottom: 12px; cursor: pointer; }
.check-row input { width: 17px; height: 17px; accent-color: var(--pink-deep); }

/* ---------- 工具类 ---------- */
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

/* 滚动条也可爱一点 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--pink), var(--purple)); border-radius: 8px; border: 2px solid var(--cream); }
