/* 全局基础样式 */
html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: transparent !important;
    color: #fff;
    font-family: "Kaisei Mincho", serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* 全屏星空背景 */
.bg-layer{
    position: fixed;
    inset: 0;
    background: url('./images/chushibeijtu.png') center/cover no-repeat;
    z-index: -999;
    pointer-events: none;
}
/* 页面切换：淡入淡出（完全保留你原有的布局和动画） */
/* 页面切换：淡入淡出（完全保留你原有的布局和动画） */
/* 页面切换：淡入淡出（完全保留你原有的布局和动画） */
.page{
  position:absolute;
  width:100vw;
  height:100vh;
  top: 0;
  left: 0;
  opacity:0;
  pointer-events:none;
  transition:opacity 900ms ease;
  display:flex;
  align-items:center;
  justify-content:center;
  /* 删除了致命的 inset:0; */
}
.page.active{
  opacity:1;
  pointer-events:auto;
  z-index:10;
}

/* ============== 第二页 【观照】原版竖向！！ ============== */
/* Page2 观照 原版竖排，完全不变 */
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 3.5rem;
    letter-spacing: 1.5rem;
    line-height: 4;
    /* 👇 就是这里！改这个数字，控制上下位置 */
    position: relative;
    top: -8vh;  /* 负数 = 往上移，正数 = 往下移 */
}

/* ============== 第六页 单独专属样式，互不影响 ============== */
/* 第6页专属：单竖列、居中、字号缩小、不拆列 */
#page6 .p6-vertical-text {
    /* 竖排核心：强制单列，不换行 */
    writing-mode: vertical-rl;
    text-orientation: upright;
    white-space: nowrap; /* 强制不换行，彻底解决两列问题 */
    overflow: visible;

    /* 字号缩小，字间距收紧 */
    font-family: "Kaisei Mincho", serif;
    font-size: 1.4rem;
    letter-spacing: 0.4rem;
    line-height: 2.2;

    /* 页面绝对居中，不受容器影响 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    color: #ffffff;
    text-shadow: 0 0 6px rgba(255,255,255,0.25);

    /* 淡入动画，不影响布局 */
    opacity: 0;
    transition: opacity 1.5s ease;
}
#page6.active .p6-vertical-text {
    opacity: 1;
}

/* 普通横向居中文字 page3 page4 */
.text-center {
    text-align: center;
    line-height: 0.8;
    font-size: 1.8rem;
    letter-spacing: 0.5rem;
}

/* 输入页 */
.input-container {
    width: 80%;
    max-width: 600px;
    text-align: center;
}
.input-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
textarea, input[type="text"], input[type="date"] {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: "Kaisei Mincho", serif;
    font-size: 1.2rem;
    resize: none;
    margin-bottom: 1rem;
}
textarea::placeholder {
    color:rgba(255,255,255,0.6);
}

/* 按钮基础样式 */
button {
  padding: 0.8rem 2.5rem;
  font-size: 1.3rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
}

/* 主按钮 - 保存按钮（偏灰高级感） */
.btn-primary {
  background: rgba(160, 160, 160, 0.85); /* 中灰背景，不白不刺眼 */
  color: #000; /* 深字对比，清晰不糊 */
}

/* 次按钮 - 取消/返回（灰调边框+文字） */
.btn-secondary {
  background: transparent;
  color: rgba(180, 180, 180, 0.9); /* 浅灰文字，柔和不突兀 */
  border: 1px solid rgba(180, 180, 180, 0.5);
}

/* hover 效果（轻轻加深，交互丝滑） */
.btn-primary:hover {
  background: rgba(160, 160, 160, 1); /*  hover 加深一点，反馈明显 */
}

.btn-secondary:hover {
  background: rgba(180, 180, 180, 0.1);
  border-color: rgba(180, 180, 180, 0.8);
}

/* page7 按钮 - 渐入动画（和保存按钮同色偏灰版） */
#page7 .page7-btn {
  /* 原有淡入动画逻辑，完全保留 */
  opacity: 0;
  transition: opacity 900ms ease;

  /* 👇 核心：和保存按钮完全一致的偏灰样式 */
  padding: 0.8rem 2.5rem;
  font-size: 1.3rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  background: rgba(160, 160, 160, 0.85); /* 中灰背景，和保存按钮一致 */
  color: #000; /* 深字对比，清晰不糊 */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* 质感阴影 */
  transition: opacity 900ms ease, background 0.3s ease; /* 合并过渡，hover更丝滑 */
}

/* 显示状态：完全不透明，样式继承，无需额外改色 */
#page7 .page7-btn.show {
  opacity: 1;
}

/* 👇 新增hover效果，和保存按钮完全统一 */
#page7 .page7-btn:hover {
  background: rgba(160, 160, 160, 1); /* hover加深，反馈一致 */
}


/* 日记列表 */
.diary-header {
    font-size: 2.2rem;
    letter-spacing:1rem;
    margin-bottom:2rem;
}
.diary-list {
    width:80%;
    max-height:50vh;
    overflow-y:auto;
    border:1px solid rgba(255,255,255,0.2);
    padding:1rem;
    border-radius:4px;
    background:rgba(0,0,0,0.3);
}
.diary-item {
    padding:1rem;
    border-bottom:1px solid rgba(255,255,255,0.1);
}
.diary-time {
    font-size:0.9rem;
    color:rgba(255,255,255,0.6);
}

/* 返回首页按钮 */
.back-home-btn{
    position:absolute;
    top:2.4rem;
    right:2.4rem;
    width:44px;
    height:44px;
    background:transparent;
    border:none;
}
/* 第8页 日记列表 居中+列表内日期+内容样式 */
#page8 #diaryListContainer {
    width: 80%;
    max-width: 600px;
    max-height: 60vh;
    overflow-y: auto;

    /* 页面绝对居中 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    padding: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: "Kaisei Mincho", serif;
}

#page8 .diary-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: background 0.3s ease;
}
#page8 .diary-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
#page8 .diary-item:last-child {
    border-bottom: none;
}

/* 列表内日期样式（小字号、浅灰色） */
#page8 .diary-item-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

/* 列表内内容样式（正常字号、白色） */
#page8 .diary-item-content {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #fff;
    /* 内容过长自动省略，保持列表整洁 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ========== 仅 Page9 专属修改 ========== */
#page9 .detail-container{
    width: 80%;
    max-width: 600px;
    /* 整体往上，微调这个值：负数=往上 */
    position: relative;
    top: -10vh;
    text-align: center;
}

#page9 .detail-container h3{
    font-size:1.6rem;
    letter-spacing:0.6rem;
    margin-bottom: 1.6rem;
    opacity:0.9;
}
/* 单独文本框包裹日记内容 */
#page9 #diaryDetail{
    padding: 1.8rem 1.4rem;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;

    line-height: 2;
    font-size: 1.15rem;
    letter-spacing: 0.2rem;
    white-space: pre-wrap;
}
/* ========= 全局手机适配 新增，不改动你原有任何样式 ======== */
html{
    /* 禁止手机缩放、兼容刘海屏 */
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

body{
    overflow: hidden;
}

/* 刘海屏、底部小黑条适配安全区 */
.bg-layer,
.page{
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* 手机：全局字体、容器自适应 */
@media (max-width: 768px){
    /* 第二页竖排文字自适应位置 */
    .vertical-text{
        font-size: 2.2rem;
        letter-spacing: 1rem;
        top: -4vh;
    }

    /* 第6页竖排适配 */
    #page6 .p6-vertical-text{
        font-size: 1.1rem;
        letter-spacing: 0.25rem;
    }

    /* 输入框手机适配：居中、完全显示、不溢出 */
    .input-container{
     width: 88%; /* 保留你原来的88%宽度 */
     margin: 0 auto; /* 核心：强制水平居中 */
     box-sizing: border-box; /* 防止内边距撑宽 */
}
    textarea{
    width: 100%; /* 占满容器宽度，完全显示 */
    box-sizing: border-box; /* 必须加，解决padding撑大输入框 */
    font-size: 1rem; /* 保留你原来的字体大小 */
  /* 额外优化：适配手机触摸，增加内边距 */
    padding: 1rem;
    min-height: 80px;
}

    /* 第8页日记列表手机适配 */
    #page8 #diaryListContainer{
        width: 88%;
    }

    /* 第9页详情框手机适配，位置保持偏上不变 */
    #page9 .detail-container{
        width: 88%;
    }
    #page9 #diaryDetail{
        font-size: 1rem;
        line-height: 1.8;
    }

    /* 按钮移动端缩放 */
    button{
        padding: 0.7rem 1.8rem;
        font-size: 1.1rem;
    }
}
/* 全局隐藏滚动条 - 电脑+手机全平台生效，不影响滚动 */
/* 针对Chrome、Edge、Safari等现代浏览器 */
::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent;
}

/* 针对Firefox */
* {
  scrollbar-width: none !important;
}

/* 针对IE/旧Edge（兜底） */
* {
  -ms-overflow-style: none !important;
}

/* 额外兜底：强制页面滚动条隐藏 */
html, body {
  overflow: -moz-scrollbars-none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
/* 星河流转 增强版 - 速度适中，肉眼清晰可见 */
.overlay-effect {
  position: fixed;
  inset: 0;
  z-index: -9;
  pointer-events: none;
  display:none
  /* 👇 这里务必替换成你自己的图片路径！ */
  background: url("images/chushibeijtu.png") center/cover no-repeat;
  animation: starFlowSmooth 19s ease-in-out infinite alternate;
}

@keyframes starFlowSmooth {
  0% {
    transform: translate(0, 0) scale(1.05);
  }
  100% {
    transform: translate(-4%, -7%) scale(1.05);
  }
}
/* -------- 新增AI弹窗样式 粘贴在文件最后 -------- */
.ai-philosophy-card{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.03);
  display: grid;
  place-items: center;
  z-index: 9999;
}
.card-wrap{
  background: #252525;
  border: 1px solid rgba(194,167,132,0.35);
  color: #d9c9b4;
  padding: 32px 26px;
  border-radius: 12px;
  max-width: 340px;
  line-height: 1.9;
  text-align: center;
}
.ai-text{
  margin:16px 0;
  font-size:15px;
}
.card-close{
  background: transparent;
  border: 1px solid #b9a388;
  color:#d9c9b4;
  padding:5px 20px;
  border-radius:4px;
}
/* 点击水波纹效果 - 全局生效【中等尺寸】 */
.ripple {
  position: fixed;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 1;
}

@keyframes ripple-animation {
  to {
    transform: scale(4); /* 中等大小，不浮夸刚刚好 */
    opacity: 0;
  }
}
/* 纯CSS GIF背景，零HTML改动，完美适配你的观照H5 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  /* 路径和你项目里的文件名完全对应 */
  background: url("./bg-cloud.gif") center/cover no-repeat !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

/* 只关闭星空动画层，保留页面底层容器 */
.overlay-effect {
  display: none !important;
}

/* 确保bg-layer正常显示，页面结构不被破坏 */
.bg-layer {
  display: block !important;
}
/* 观照日记H5 手机端输入框100%适配，零HTML改动 */
@media screen and (max-width: 768px) {
  /* 输入框主体：手机端全屏适配 */
  textarea,
  input[type="text"],
  #diaryInput {
    /* 层级拉满，不被背景遮挡 */
    position: relative !important;
    z-index: 999 !important;
    pointer-events: auto !important;

    /* 手机端尺寸：左右留边，高度适配 */
    width: 88% !important;
    min-height: 140px !important;
    max-height: 200px !important;
    margin: 24px auto !important;
    display: block !important;

    /* 视觉适配深色背景 */
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 12px !important;
    backdrop-filter: blur(8px) !important;

    /* 文字样式：手机端清晰可读 */
    color: #ffffff !important;
    font-size: 16px !important; /* 防手机端字体过小 */
    line-height: 1.6 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    resize: none !important; /* 禁止手动拉伸，保持样式统一 */
  }

  /* 占位符：手机端可见 */
  textarea::placeholder,
  input::placeholder,
  #diaryInput::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1 !important;
    font-size: 16px !important;
  }

  /* 聚焦状态：手机端高亮 */
  textarea:focus,
  input:focus,
  #diaryInput:focus {
    outline: none !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2) !important;
  }

  /* 保存按钮：手机端适配 */
  .save-btn,
  button[type="submit"],
  #saveBtn {
    width: 88% !important;
    max-width: 200px !important;
    height: 50px !important;
    margin: 0 auto 30px auto !important;
    display: block !important;
    font-size: 18px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    z-index: 999 !important;
    pointer-events: auto !important;
  }

  /* 标题：手机端适配位置 */
  .page-title {
    font-size: 28px !important;
    margin-top: 40px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
    color: #ffffff !important;
  }
}

/* 全局兜底：确保输入框在所有设备都可点击 */
textarea,
input[type="text"],
#diaryInput {
  pointer-events: auto !important;
  z-index: 999 !important;
}