:root {
  --char-theme: #447bda;
  --char-theme-light: #447bda;
}

/* ========== 背景几何装饰 ========== */
.bg-geo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.geo {
  position: absolute;
  opacity: 0.04;
  border-color: var(--char-theme);
}

.geo-1 {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  top: 15%;
  right: 10%;
}

.geo-2 {
  width: 120px;
  height: 120px;
  top: 60%;
  left: 5%;
  transform: rotate(45deg);
}

.geo-3 {
  width: 0;
  height: 0;
  border-left: 80px solid transparent;
  border-right: 80px solid transparent;
  border-bottom-color: rgba(139, 111, 192, 0.04);
  border-radius: 0;
  top: 30%;
  right: 30%;
}

.geo-4 {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  bottom: 20%;
  right: 15%;
  border-style: dashed;
}

/* ========== 角色详情主体 ========== */
.detail-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  min-height: 100vh;
  margin-top: 0;
  overflow: hidden;
}


/* ========== 左侧倒直角三角形 ========== */
.triangle-left {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: linear-gradient(145deg, var(--char-theme-light), var(--char-theme));
   clip-path: polygon(0 0, 600px 0, 0 100%);
   z-index: 0;
}

/* ========== 斜边滚动文字（独立漂浮层） ========== */


.scroll-line-slanted {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 60px;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  white-space: nowrap;
  transform: rotate(-57.8deg);
  transform-origin: bottom left;
}


.scroll-line-slanted span {
  display: inline-block;
  font-size: 2rem;
  color: var(--char-theme);
  opacity: 1;
  letter-spacing: 2px;
  white-space: nowrap;
  font-weight: bold;
  flex-shrink: 0;
  animation: scrollHorizontal 8s linear infinite;
  padding-right: 40px;
}

@keyframes scrollHorizontal {
  0% {
    transform: translateX(-20%);
  }
  100% {
    transform: translateX(0);
  }
}


/* ========== 角色立绘 ========== */
/* ========== 立绘容器 ========== */
.character-stand {
  position: relative;
  z-index: 2;
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 30%;
}

/* 差分标签 */
.diff-label {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 2px;
  z-index: 3;
  pointer-events: none;
}

/* 左右箭头按钮 */
.diff-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.3s ease, transform 0.3s ease;
  padding: 0;
}

.diff-arrow:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.diff-prev {
  left: calc(30% + 10px);
}

.diff-next {
  right: 10px;
}

/* 立绘切换动画 */
.stand-image {
  width: 600px;
  height: auto;
  display: block;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.stand-image.switch-out {
  opacity: 0;
  transform: scale(0.95);
}

.stand-image.switch-in {
  opacity: 1;
  transform: scale(1);
}


/* ========== 角色信息区 ========== */
.character-info {
  position: relative;
  z-index: 2;
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  padding: 60px 40px 40px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  margin-left: 20%;
}

.char-name {
  font-size: 3.5rem;
  font-weight: 700;
  color: #2d2a3a;
  margin: 0 0 4px 0;
  letter-spacing: 8px;
  position: relative;
  left: 0;
  white-space: nowrap;
}

.char-pinyin {
  font-size: 0.75rem;
  color: #2d2a3a;
  letter-spacing: 4px;
  margin: 0 0 28px 0;
  font-weight: 300;
}
.char-pinyin img{
  margin: 0 28px 0 0;
}

/* 资料卡 */
.info-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
  max-width: 280px;
}

.info-row {
  display: flex;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f0edf5;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
   background: var(--char-theme);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 2px 16px;
  border-radius: 0;
  display: inline-block;
  text-align: center;
  min-width: 56px;
}

.info-value {
  color: #4a4a5e;
  font-size: 0.8rem;
  padding-left: 10px;
}

/* 角色说明 */
.char-desc {
  max-width: 420px;
}

.char-desc p {
  font-size: 0.9rem;
  color: #5a5a6e;
  line-height: 1.8;
  margin: 0;
}
.triangle-number {
  position: absolute;
  bottom: 24%;
  left: 0%;
  font-size: 56rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

/* ========== 描述截断 ========== */
.char-desc {
  cursor: pointer;
  position: relative;
}

.char-desc p {
  /* 删除或注释掉以下行数限制 */
   /* display: -webkit-box; */
   /* -webkit-line-clamp: 3; */
   /* -webkit-box-orient: vertical; */
   /* overflow: hidden; */
  position: relative;
}

.char-desc.truncated::after {
  content: "...";
  position: absolute;
  bottom: 0;
  right: 0;
  background: #ffffff;
  padding-left: 4px;
  color: #8b6fc0;
  font-weight: bold;
}

/* ========== 描述弹窗 ========== */
.desc-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.desc-modal.active {
  display: flex !important;
}

.desc-modal-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}


.desc-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5rem;
  color: #8b6fc0;
  cursor: pointer;
  transition: color 0.2s;
}

.desc-modal-close:hover {
  color: #6b4fa0;
}

.desc-modal-content p {
  font-size: 1rem;
  color: #4a4a5e;
  line-height: 1.8;
  margin: 0;
}
.char-desc.truncated::after {
  content: "MORE";
  position: absolute;
  bottom: 0;
  right: 0;
  background: #ffffff;
  padding-left: 8px;
  color: var(--char-theme);
  font-weight: bold;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

/* ========== 描述下方图片 ========== */
.char-images {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.char-image-item {
  width: 50%;
}

.char-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid var(--char-theme);
}

.char-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.char-image-label {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--char-theme);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 10px;
  border-radius: 4px 0 0 0;
  letter-spacing: 1px;
}


/* ========== 名字右侧小图片 ========== */
.char-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.char-name-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  vertical-align: middle; 
}
/* ========== 图片弹窗 ========== */
.image-modal-content {
  padding: 20px;
  background: transparent;
  box-shadow: none;
  max-width: 90vw;
  max-height: 90vh;
}

#nameIconModal .desc-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  padding: 20px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
}

#nameIconModal .desc-modal-content img {
  max-width: none;
  width: auto;
  height: auto;
  min-height: 200px;
  display: block;
}



.image-modal-content img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

/* ========== 文字弹窗标题 ========== */
.desc-modal-content h3 {
  font-size: 1.3rem;
  color: var(--char-theme);
  margin: 0 0 16px 0;
  font-weight: bold;
}

/* ========== 可点击元素 ========== */
.char-name-icon {
  cursor: pointer;
  transition: transform 0.2s;
}

.char-name-icon:hover {
  transform: scale(1.1);
}

.char-image-wrapper {
  cursor: pointer;
  transition: transform 0.2s;
}

.char-image-wrapper:hover {
  transform: scale(1.02);
}


/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .detail-main {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    min-height: 100vh;
    overflow: hidden;
  }
 .character-info {
    z-index: 2;
  }
  
  .scroll-line-slanted {
	bottom: 0px;
	left: 54px;
	width: 220%;
	height: 220%;
    transform: rotate(-65deg);
    transform-origin: bottom left;
  }
	
  .triangle-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    background: linear-gradient(145deg, var(--char-theme-light), var(--char-theme));
	 z-index: 0;
  }

#nameIconModal .desc-modal-content {
    max-width: 95vw;
    max-height: 80vh;
    padding: 10px;
    overflow-x: auto;
    overflow-y: auto;
    white-space: nowrap;
    display: block;
  }
  
  #nameIconModal .desc-modal-content img {
    height: auto;
    width: auto;
    min-width: 800px;
    max-width: none;
    max-height: none;
    display: inline-block;
    vertical-align: top;
  }
  
    .character-stand {
      grid-column: 1 / 2;
      grid-row: 1 / 3;
      padding-left: 0;
      padding-top: 0;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      position: relative;
      height: 100vh;
      overflow: visible;
	  z-index: 5;  /* 关键：提升到三角形和信息区之上 */
    }
  
    .stand-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      pointer-events: none;
      position: absolute;
      top: 0;
      left: 0;
    }
  
    .diff-arrow {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 20;
      pointer-events: auto;
    }
  
    .diff-prev {
      left: 10px;
    }
  
    .diff-next {
      right: 10px;
    }
  
    .diff-label {
      position: absolute;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 20;
      pointer-events: auto;
    }
	
  .character-info {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    padding: 60px 20px 40px 50%;
    margin-left: 0;
    align-items: flex-start;
    justify-content: center;
  }

  .char-name {
    font-size: 3.5rem;
    white-space: nowrap;
  }

  .char-pinyin {
    text-align: left;
  }

  .info-card {
    max-width: 280px;
  }

  .char-desc {
    max-width: 280px;
  }
   .char-image-item {
      width: 80%;
    }
    
    .char-name-icon {
      width: 36px;
      height: 36px;
      display: inline-block;
    }
}
