/*
 * 个人主页 - SHome 个人主页系统
 * 作者：Jichun29 | 主页：https://www.jichun29.cn
 */

@charset "utf-8";

/* ========== 自定义字体 ========== */
@font-face {
  font-family: "Pacifico-Regular";
  font-display: swap;
  src: url("../fonts/Pacifico-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "UnidreamLED";
  font-display: swap;
  src: url("../fonts/UnidreamLED.ttf") format("truetype");
}

/* ========== 全局样式 ========== */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #333;
  overflow: hidden;
  font-family: "HarmonyOS_Regular", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, a, p {
  margin: 0;
  padding: 0;
  user-select: none;
  text-decoration: none;
  color: #fff;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
a, .menu, .description {
  touch-action: manipulation;
}
*:hover {
  transition: 0.3s;
}

a:hover {
  color: rgb(57, 159, 255);
  text-decoration: underline;
}

/* ========== 基础容器 ========== */
#app {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ========== 毛玻璃卡片 ========== */
.cards {
  border-radius: 6px;
  background-color: #00000040;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: scale(1);
  transition: backdrop-filter 0.3s, transform 0.3s;
}
.cards:hover {
  transform: scale(1.01);
}
.cards:active {
  transform: scale(0.98);
}

/* ========== 文字省略 ========== */
.text-hidden {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ========== Transition 动画 ========== */
.fade-enter-active, .fade-leave-active {
  transition: opacity 0.3s ease-in-out;
}
.fade-enter-from, .fade-leave-to {
  opacity: 0;
}

/* ========== Keyframes ========== */
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-blur-in {
  from {
    filter: blur(20px) brightness(0.3);
    transform: scale(1.6);
  }
  to {
    filter: blur(0) brightness(1);
    transform: scale(1);
  }
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-10px); }
}
@keyframes fade-blur-main-in {
  from { transform: scale(1.2); }
  to { transform: scale(1); }
}

@keyframes elMsgIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes elMsgOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes spin-reverse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

/* ========== 自定义鼠标光标 ========== */
#cursor {
  position: fixed;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 25px;
  opacity: 0.25;
  z-index: 10086;
  pointer-events: none;
  transition: 0.2s ease-in-out;
  transition-property: background, opacity, transform;
}
#cursor.hidden { opacity: 0; }
#cursor.active { opacity: 0.5; transform: scale(0.5); }

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
::-webkit-scrollbar-thumb { border-radius: 10px; background-color: #eeeeee; }

/* ========== 响应式隐藏 ========== */
@media (min-width: 910px) and (max-width: 1200px) {
  .sm-hidden { display: none; }
}

/* ========== 加载动画 ========== */
#loader-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 999;
  overflow: hidden;
}
#loader-wrapper .loader {
  width: 100%; height: 100%;
  position: absolute;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#loader-wrapper .loader-circle {
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #fff;
  animation: spin 1.8s linear infinite;
  z-index: 2;
}
#loader-wrapper .loader-circle:before {
  content: "";
  position: absolute;
  top: 5px; left: 5px; right: 5px; bottom: 5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #a4a4a4;
  animation: spin-reverse 0.6s linear infinite;
}
#loader-wrapper .loader-circle:after {
  content: "";
  position: absolute;
  top: 15px; left: 15px; right: 15px; bottom: 15px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #d3d3d3;
  animation: spin 1s linear infinite;
}
#loader-wrapper .loader-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  z-index: 2;
  margin-top: 40px;
  font-size: 24px;
}
#loader-wrapper .loader-text .tip {
  margin-top: 6px;
  font-size: 18px;
  opacity: 0.6;
}
#loader-wrapper .loader-section {
  position: fixed;
  top: 0;
  width: 51%;
  height: 100%;
  background: #333;
  z-index: 1;
}
#loader-wrapper .loader-section.section-left { left: 0; }
#loader-wrapper .loader-section.section-right { right: 0; }

/* 加载完成 */
#loader-wrapper.loaded {
  visibility: hidden;
  transform: translateY(-100%);
  transition: transform 0.3s 1s ease-out, visibility 0.3s 1s ease-out;
}
#loader-wrapper.loaded .loader-circle,
#loader-wrapper.loaded .loader-text {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
#loader-wrapper.loaded .loader-section.section-left {
  transform: translateX(-100%);
  transition: transform 0.5s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
#loader-wrapper.loaded .loader-section.section-right {
  transform: translateX(100%);
  transition: transform 0.5s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* ========== 背景层 ========== */
.cover {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transition: 0.25s;
  z-index: -1;
}
.cover .bg {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  filter: blur(20px) brightness(0.3);
  transition: filter 0.3s, transform 0.3s;
  animation: fade-blur-in 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: 0.45s;
}
.cover .gray {
  opacity: 1;
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-image: radial-gradient(rgba(0,0,0,0) 0, rgba(0,0,0,0.5) 100%), radial-gradient(rgba(0,0,0,0) 33%, rgba(0,0,0,0.3) 166%);
  transition: 1.5s;
  pointer-events: none;
}

/* ========== 主界面 ========== */
#main {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform: scale(1.2);
  transition: transform 0.3s, opacity 0.5s;
  z-index: 2;
  opacity: 0;
}
#main.ready {
  opacity: 1;
  animation: fade-blur-main-in 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: 0.5s;
}

.container {
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 0 0.5vw;
}
.container .all {
  width: 100%;
  height: 100%;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

/* 左侧区域 */
.left {
  width: 50%;
  margin-right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transform: translateY(20px);
}

/* 右侧区域 */
.right {
  width: 50%;
  margin-left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ========== Logo + 简介（左侧） ========== */
.logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  animation: fade 0.5s;
  max-width: 520px;
}
.logo-img {
  border-radius: 50%;
  width: 130px;
  height: 130px;
  object-fit: cover;
  flex-shrink: 0;
}
.logo-avatar {
  border-radius: 50%;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  flex-shrink: 0;
}
.name {
  width: 100%;
  padding-left: 24px;
  transform: translateY(-8px);
  font-family: "Pacifico-Regular", cursive;
}
.name .bg {
  font-size: 5.2rem;
}
.name .sm {
  margin-left: 6px;
  font-size: 2.2rem;
}

.description {
  width: 100%;
  max-width: 520px;
  padding: 1.2rem 1.5rem;
  margin-top: 3.5rem;
  animation: fade 0.5s;
  cursor: pointer;
}
.description .content {
  display: flex;
  justify-content: space-between;
}
.description .content .text {
  margin: 0.75rem 1.2rem;
  line-height: 2rem;
  margin-right: auto;
  font-size: 1.05rem;
}
.description .content .text p:first-child {
  font-family: "Pacifico-Regular", cursive;
}
.description .content .quote-icon {
  flex-shrink: 0;
  opacity: 0.6;
}
.description .content .quote-icon:last-child {
  align-self: flex-end;
}

/* ========== 网站链接（右侧） ========== */
.links {
  width: 100%;
}
.links .line {
  margin: 2.2rem 0.25rem 1.2rem;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  animation: fade 0.5s;
}
.links .line .title {
  margin-left: 8px;
  font-size: 1.2rem;
  text-shadow: 0 0 5px #00000050;
}
.links .link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  height: 220px;
}
.links .link-item {
  height: 100px;
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: center;
  padding: 0 10px;
  animation: fade 0.5s;
  cursor: pointer;
}
.links .link-item:hover {
  transform: scale(1.02);
  background: rgb(0 0 0 / 40%);
}
.links .link-item:active {
  transform: scale(1);
}
.links .link-item .link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.links .link-item .link-name {
  font-size: 1.15rem;
  margin-left: 10px;
}

/* Swiper 分页器 */
.link-swiper .swiper-pagination {
  position: relative;
  margin-top: 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}
.link-swiper .swiper-pagination-bullet {
  background-color: #fff;
  width: 20px; height: 4px;
  margin: 0 4px;
  border-radius: 4px;
  opacity: 0.2;
  transition: opacity 0.3s;
}
.link-swiper .swiper-pagination-bullet-active,
.link-swiper .swiper-pagination-bullet:hover {
  opacity: 1;
}

/* ========== 社交链接（左侧） ========== */
.social {
  width: 100%;
  max-width: 520px;
  height: 46px;
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: transparent;
  border-radius: 6px;
  backdrop-filter: blur(0);
  animation: fade 0.5s;
  transition: background-color 0.3s, backdrop-filter 0.3s;
}
.social .social-links {
  display: flex;
  align-items: center;
  justify-content: center;
}
.social .social-links a,
.social .social-links .social-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 12px;
  transition: transform 0.3s;
  cursor: pointer;
}
.social .social-links a:hover,
.social .social-links .social-copy:hover {
  transform: scale(1.1);
}
.social .social-links a:active,
.social .social-links .social-copy:active {
  transform: scale(1);
}
.social .tip {
  display: none;
  margin-right: 12px;
  animation: fade 0.5s;
  font-size: 13px;
  white-space: nowrap;
}
.social:hover {
  background-color: #00000040;
  backdrop-filter: blur(5px);
}
@media (min-width: 768px) {
  .social:hover .tip {
    display: block;
  }
}

/* ========== 功能区（右侧） ========== */
.func {
  height: 165px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}

/* 一言 */
.hitokoto {
  flex: 1;
  height: 100%;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.hitokoto .hito-text {
  font-size: 1.05rem;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hitokoto .hito-from {
  margin-top: 0.6rem;
  text-align: right;
  font-weight: bold;
  font-size: 0.95rem;
}

/* 时间天气卡片 */
.time-weather {
  flex: 1;
  height: 100%;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  animation: fade 0.5s;
}
.time-weather .time {
  font-size: 1.15rem;
  text-align: center;
}
.time-weather .time .date {
  text-overflow: ellipsis;
  overflow-x: hidden;
  white-space: nowrap;
}
.time-weather .time .text {
  margin-top: 12px;
  font-size: 3.5rem;
  letter-spacing: 2px;
  font-family: "UnidreamLED", monospace;
}
.time-weather .weather {
  text-align: center;
  width: 100%;
  text-overflow: ellipsis;
  overflow-x: hidden;
  white-space: nowrap;
  font-size: 0.95rem;
}

/* ========== 时光胶囊（右侧） ========== */
.time-capsule {
  width: 100%;
}
.time-capsule .capsule-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0.2rem 0 1.5rem;
  font-size: 1.1rem;
}
.time-capsule .capsule-title svg {
  margin-right: 6px;
}
.time-capsule .capsule-item {
  margin-bottom: 1rem;
}
.time-capsule .capsule-item .item-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0 0.5rem 0;
  font-size: 0.95rem;
}
.time-capsule .capsule-item .remaining {
  opacity: 0.6;
  font-size: 0.85rem;
  font-style: oblique;
}
.time-capsule .progress-bar-wrap {
  width: 100%;
  height: 20px;
  border-radius: 6px;
  background-color: #00000020;
  overflow: hidden;
}
.time-capsule .progress-bar {
  height: 100%;
  border-radius: 6px;
  background-color: #efefef;
  text-align: center;
  font-family: "UnidreamLED", monospace;
  font-size: 0.9rem;
  color: #564d59;
  line-height: 20px;
  transition: width 0.3s;
}
.time-capsule .capsule-item.start .item-title {
  justify-content: center;
  opacity: 0.8;
  font-size: 0.85rem;
}
.site-alive {
  text-align: center;
  opacity: 0.6;
  font-size: 0.8rem;
  margin-top: 4px;
  font-style: oblique;
}

/* ========== 音乐播放器（右侧） ========== */
.music-section {
  width: 100%;
}
.music-section .aplayer-container {
  border-radius: 6px;
  overflow: hidden;
}

/* ========== Box 抽屉视图 ========== */
.box {
  flex: 1 0 0%;
  margin-left: 0.75rem;
  height: 80%;
  max-width: 50%;
  position: relative;
  animation: fade 0.5s;
}
.box:hover {
  transform: scale(1);
}
.box-close, .box-setting {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: transform 0.3s, opacity 0.3s;
}
.box-close:hover, .box-setting:hover {
  transform: scale(1.2);
}
.box-close:active, .box-setting:active {
  transform: scale(1);
}
.box-setting {
  right: 56px;
}
.box-content {
  display: flex;
  flex-direction: column;
  padding: 30px;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
.box-content .more-content {
  margin-top: auto;
  padding-top: 20px;
}
.box-content .aplayer-container {
  border-radius: 6px;
  overflow: hidden;
}

/* 社交图标图片 */
.social .social-links .icon-img {
  transition: transform 0.3s;
}
.social .social-links .icon-img:hover {
  transform: scale(1.1);
}
.links .link-icon img {
  display: block;
}

/* ========== 壁纸全屏下载按钮 ========== */
.wp-download {
  display: none;
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 10px 24px;
  z-index: 100;
  cursor: pointer;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #ffffffcc;
  transition: all 0.3s;
  animation: fade 0.5s;
}
.wp-download.show { display: flex; }
.wp-download:hover { background: rgba(0, 0, 0, 0.5); }

/* ========== 页脚 ========== */
#footer {
  width: 100%;
  position: absolute;
  bottom: 0; left: 0;
  padding: 10px 0;
  line-height: 1.8;
  text-align: center;
  z-index: 0;
  font-size: 14px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
#footer.blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.2);
}
.footer-lrc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: fade 0.5s;
}

/* ========== 响应式 ========== */
@media (min-width: 1201px) and (max-width: 1380px) {
  .container { max-width: 1100px; }
}
@media (max-width: 1280px) {
  .container { max-width: 1100px; }
  .time-weather .time .text { font-size: 3rem; }
  .time-weather .time { font-size: 1rem; }
}
@media (max-width: 992px) {
  .container { max-width: 900px; }
}

/* 平板竖屏：上下排列 */
@media (max-width: 910px) {
  .all { flex-direction: column; gap: 12px; }
  .left { width: 100%; max-width: 100%; transform: none; align-items: center; margin-right: 0; margin-bottom: 0; }
  .right { width: 100%; max-width: 100%; margin-left: 0; }
  .left .links { display: none; }
  .func .hitokoto { display: none; }
  .func .time-weather { flex: 1; }
  .name .bg { font-size: 4rem; }
  .social { max-width: 100%; justify-content: center; }
}

/* 手机端 */
@media (max-width: 840px) {
  .social { max-width: 100%; justify-content: center; }
  .social .social-links { justify-content: space-evenly; width: 90%; }
  .social .tip { display: none !important; }
}

@media (max-width: 768px) {
  .logo-img, .logo-avatar { width: 100px; height: 100px; }
  .name .bg { font-size: 4rem; }
  .name { height: 100px; }
  .description { margin-top: 2rem; }
}

/* 隐藏自定义光标 */
@media (max-width: 720px) {
  #cursor { display: none !important; }
}

/* ========== 移动端菜单按钮 ========== */
.menu {
  display: none;
  position: absolute;
  top: 84%;
  left: calc(50% - 28px);
  width: 56px;
  height: 34px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 6px;
  justify-content: center;
  align-items: center;
  z-index: 10;
  transition: transform 0.3s, background 0.3s;
  animation: fade 0.5s;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.menu:active { transform: scale(0.92); background: rgba(0, 0, 0, 0.4); }

/* 手机端核心布局修复 */
@media (max-width: 720px) {
  /* 左侧面板 — 默认显示（个人信息+社交） */
  .left {
    width: 100%;
    max-width: 100%;
    align-items: center;
    margin-right: 0;
  }
  /* 右侧面板 — 默认隐藏，菜单切换时显示 */
  .right {
    display: none;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }
  /* 菜单打开时：隐藏Left，显示Right */
  .left.hidden { display: none; }
  .right.show { display: flex; }

  /* 显示菜单按钮 */
  .menu { display: flex; }

  /* 禁用Box视图 */
  .box { display: none !important; }
  .logo { max-width: 100%; }
  .description {
    max-width: 100%;
    pointer-events: none;
    cursor: default;
  }
  .description .content .quote-icon { display: none; }

  /* 链接网格适配 */
  .links .link-grid {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
    min-height: 240px;
    gap: 12px;
  }
  .links .link-item { height: 80px; flex-direction: column; }
  .links .link-item .link-name {
    font-size: 1rem;
    margin-left: 0;
    margin-top: 6px;
  }

  /* 时间天气适配 */
  .time-weather .time .text { font-size: 2.8rem; }

  #footer { font-size: 0.85rem; }
  .name .bg { font-size: 3.5rem; }
  .name .sm { font-size: 1.4rem; }
  .scroll-hint { display: none; }

  /* 移动端触摸优化 */
  .social .social-links a,
  .social .social-links .social-copy { margin: 0 16px; } /* 增大触摸目标间距 */
}

@media (max-width: 560px) {
  .c-hidden { display: none; }
  .name .bg { font-size: 2.8rem; }
  .name .sm { font-size: 1.2rem; }
  .logo-img, .logo-avatar { width: 90px; height: 90px; }
  .name { height: 90px; padding-left: 14px; }
  .description { padding: 0.8rem 1rem; margin-top: 1.5rem; }
  .description .content .text { margin: 0.5rem 0.5rem; font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .links .link-item { flex-direction: column; }
  .links .link-item .link-name { font-size: 0.9rem; display: block; }
}

@media (max-width: 460px) {
  .links .link-grid { grid-template-columns: repeat(2, 1fr); }
  .name .bg { font-size: 2.5rem; }
  .name .sm { font-size: 1.1rem; }
}

@media (max-width: 390px) {
  .container { overflow-x: auto; }
  .all { min-width: 360px; padding: 0 0.5rem; }
}

@media (max-height: 720px) {
  .container { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
  .container::-webkit-scrollbar { display: none; }
}
