@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600&family=Noto+Serif+SC:wght@500&display=swap');

/* ===== 基础样式 ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: #0a0a0f;
  color: #e8e6e3;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 全局背景纹理 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      ellipse at 20% 50%,
      rgba(100, 80, 40, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(60, 40, 100, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 80%,
      rgba(40, 60, 100, 0.04) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ===== 动画 ===== */
.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

.animate-slideUp {
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-slideLeft {
  animation: slideLeft 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-slideRight {
  animation: slideRight 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(var(--glow-rgb, 201, 168, 76), 0.15);
  }
  50% {
    box-shadow: 0 0 35px rgba(var(--glow-rgb, 201, 168, 76), 0.3);
  }
}

/* ===== 搜索框 ===== */
.search-wrapper {
  max-width: 480px;
  margin: 0 auto 40px;
  position: relative;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: #666;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e8e6e3;
  font-size: 15px;
  font-family: inherit;
  letter-spacing: 1px;
  outline: none;
  transition: all 0.3s;
}

.search-input::placeholder {
  color: #555;
  letter-spacing: 2px;
}

.search-input:focus {
  border-color: #c9a84c;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.1);
}

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1a1a22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.search-dropdown::-webkit-scrollbar {
  width: 4px;
}

.search-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(201, 168, 76, 0.08);
}

.search-result-avatar {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.search-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-result-avatar-text {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 15px;
  font-weight: 600;
  color: #e8e6e3;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

.search-result-path {
  font-size: 12px;
  color: #888;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 首页 ===== */
.home-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.home-header {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.home-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 12px;
  margin: 0 0 16px;
  background: linear-gradient(
    135deg,
    #c9a84c 0%,
    #f0d878 40%,
    #c9a84c 60%,
    #a08030 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

.home-subtitle {
  font-size: 16px;
  color: #888;
  letter-spacing: 4px;
  margin: 0;
}

/* 装饰线 */
.home-header::after {
  content: "";
  display: block;
  width: 200px;
  height: 2px;
  margin: 24px auto 0;
  background: linear-gradient(90deg, transparent, #c9a84c, transparent);
}

/* ===== 分类卡片网格 ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.category-card {
  position: relative;
  padding: 40px 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: fadeIn 0.6s ease-out backwards;
  animation-delay: var(--delay);
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--cat-color);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(var(--glow-rgb, 201, 168, 76), 0.1);
}

.card-border-top,
.card-border-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  width: 0;
  background: var(--cat-color);
  transition: width 0.4s ease;
}

.card-border-top {
  top: 0;
}
.card-border-bottom {
  bottom: 0;
}

.category-card:hover .card-border-top,
.category-card:hover .card-border-bottom {
  width: 100%;
}

.card-icon {
  font-size: 40px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.card-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 4px;
  color: #fff;
  position: relative;
  z-index: 1;
}

.card-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 20px;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

.card-info {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 1;
}

.card-dot {
  margin: 0 8px;
}

.card-arrow {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  z-index: 1;
}

.category-card:hover .card-arrow {
  color: var(--cat-color);
  transform: translateY(-50%) translateX(4px);
}

/* ===== 分类详情页 ===== */
.category-view {
  min-height: 100vh;
}

.category-header {
  position: relative;
  padding: 40px 24px 32px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.category-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cat-color),
    transparent
  );
}

.back-btn {
  position: absolute;
  left: 24px;
  top: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.category-header-content {
  max-width: 600px;
  margin: 0 auto;
}

.category-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.category-name {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 8px;
  margin: 0 0 8px;
  color: #fff;
}

.category-subtitle-text {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 3px;
  margin: 0;
}

/* ===== 子分类 Tab ===== */
.sub-tabs-wrapper {
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sub-tabs-wrapper::-webkit-scrollbar {
  height: 2px;
}

.sub-tabs-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.sub-tabs {
  display: flex;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  justify-content: center;
}

.sub-tab {
  padding: 16px 28px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 15px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  position: relative;
}

.sub-tab:hover {
  color: #ccc;
}

.sub-tab.active {
  color: var(--cat-color);
  border-bottom-color: var(--cat-color);
}

/* ===== 角色区域 ===== */
.characters-area {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.sub-desc {
  text-align: center;
  color: #888;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.character-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeIn 0.4s ease-out backwards;
  animation-delay: var(--delay);
}

.character-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--cat-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.char-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.02)
  );
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  overflow: hidden;
}

.character-card:hover .char-avatar {
  border-color: var(--cat-color);
  box-shadow: 0 0 20px rgba(var(--glow-rgb, 201, 168, 76), 0.2);
}

.char-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-avatar-inner {
  font-size: 28px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.character-card:hover .char-avatar-inner {
  color: var(--cat-color);
}

.char-name {
  font-size: 16px;
  font-weight: 600;
  color: #e8e6e3;
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.char-role {
  font-size: 12px;
  color: #666;
  letter-spacing: 1px;
}

/* ===== 角色弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  background: #14141a;
  border-radius: 12px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-container::-webkit-scrollbar {
  width: 4px;
}

.modal-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #999;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 36px 32px;
}

.modal-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(135deg, #c9a84c22, #c9a84c08);
  border: 2px solid #c9a84c44;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  transition: all 0.3s;
}

.modal-avatar:hover {
  border-color: #c9a84c;
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.modal-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-avatar-inner {
  font-size: 32px;
  font-weight: 700;
  color: #c9a84c;
}

.modal-title-area {
  flex: 1;
}

.modal-char-title {
  font-size: 12px;
  color: #888;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.modal-char-name {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: 4px;
}

.modal-char-role {
  /*display: inline-block;
  font-size: 12px;
  color: #c9a84c;
  background: rgba(201, 168, 76, 0.1);
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
  border: 1px solid rgba(201, 168, 76, 0.2);*/
}

.modal-desc {
  font-size: 15px;
  line-height: 1.8;
  color: #bbb;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-attributes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.attr-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 16px;
}

.attr-label {
  display: block;
  font-size: 11px;
  color: #666;
  letter-spacing: 2px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.attr-value {
  display: block;
  font-size: 15px;
  color: #e8e6e3;
  font-weight: 500;
}

/* ===== 相关角色 ===== */
.modal-relations {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.relations-title {
  font-size: 14px;
  color: #888;
  letter-spacing: 3px;
  margin: 0 0 20px;
  font-weight: 400;
}

.relations-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.relations-grid::-webkit-scrollbar {
  height: 2px;
}

.relations-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.relation-item {
  flex-shrink: 0;
  text-align: center;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.2s;
  min-width: 80px;
}

.relation-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.relation-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  transition: all 0.2s;
}

.relation-item:hover .relation-avatar {
  border-color: #c9a84c;
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.2);
}

.relation-avatar-inner {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.relation-item:hover .relation-avatar-inner {
  color: #c9a84c;
}

.relation-name {
  font-size: 13px;
  color: #ccc;
  margin-bottom: 2px;
  letter-spacing: 1px;
}

.relation-type {
  font-size: 11px;
  color: #666;
}

.empty-text {
  text-align: center;
  color: #666;
  padding: 60px 0;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .search-wrapper {
    margin-bottom: 28px;
  }

  .search-input {
    font-size: 14px;
    padding: 12px 16px 12px 42px;
  }

  .home-title {
    font-size: 32px;
    letter-spacing: 6px;
  }

  .home-view {
    padding: 40px 16px 60px;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    padding: 28px 24px;
  }

  .card-title {
    font-size: 22px;
  }

  .category-header {
    padding: 32px 16px 24px;
  }

  .category-name {
    font-size: 28px;
    letter-spacing: 4px;
  }

  .back-btn {
    position: relative;
    left: 0;
    top: 0;
    margin-bottom: 20px;
    display: inline-flex;
  }

  .category-header-content {
    text-align: center;
  }

  .sub-tabs {
    justify-content: flex-start;
  }

  .characters-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .character-card {
    padding: 20px 12px;
  }

  .modal-container {
    max-height: 90vh;
  }

  .modal-body {
    padding: 28px 20px;
  }

  .modal-top {
    flex-direction: column;
    text-align: center;
  }

  .modal-char-name {
    font-size: 24px;
  }

  .modal-attributes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .home-title {
    font-size: 26px;
    letter-spacing: 4px;
  }

  .characters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .char-avatar {
    width: 56px;
    height: 56px;
    border-radius: 6px;
  }

  .char-avatar-inner {
    font-size: 22px;
  }
}

.gender-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.gender-badge.female {
  color: #ff4fa3; /* 粉红 */
  border-color: rgba(255, 79, 163, 0.35);
  background: rgba(255, 79, 163, 0.12);
}

.gender-badge.male {
  color: #3aa0ff; /* 蓝色 */
  border-color: rgba(58, 160, 255, 0.35);
  background: rgba(58, 160, 255, 0.12);
}

.gender-badge.unknown {
  color: #b7b7b7;
  border-color: rgba(183, 183, 183, 0.25);
  background: rgba(183, 183, 183, 0.08);
}

.group-section {
  margin-top: 18px;
}

.group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.group-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.92);
}

.group-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* ===== 同人图预览（弹窗内） ===== */
.modal-fanart {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.fanart-title {
  font-size: 14px;
  color: #888;
  letter-spacing: 3px;
  margin: 0 0 16px;
  font-weight: 400;
}

.fanart-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.fanart-preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s;
}

.fanart-preview-item:hover {
  border-color: #c9a84c;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.fanart-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fanart-more-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c9a84c;
  font-size: 13px;
  letter-spacing: 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.fanart-more-btn:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.3);
}

/* ===== 同人图集页面 ===== */
.gallery-view {
  min-height: 100vh;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.gallery-header {
  margin-bottom: 40px;
  position: relative;
}

.gallery-back-btn {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.gallery-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.gallery-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.24);
}

.gallery-hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.gallery-hero-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-hero-text {
  min-width: 0;
}

.gallery-hero-kicker {
  font-size: 11px;
  letter-spacing: 3px;
  color: #9c8d5f;
  margin-bottom: 8px;
}

.gallery-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  margin: 0 0 8px;
}

.gallery-subtitle {
  font-size: 14px;
  color: #9f9f9f;
  letter-spacing: 1px;
  margin: 0 0 14px;
}

.gallery-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #e8e6e3;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.5px;
  font-family: inherit;
}

.gallery-hero-btn:hover {
  background: rgba(201, 168, 76, 0.22);
  border-color: rgba(201, 168, 76, 0.5);
  color: #f0d878;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.15);
}

.gallery-hero-btn svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.gallery-grid.gallery-masonry {
  --masonry-row-height: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: var(--masonry-row-height);
  gap: 20px;
  align-items: start;
}

.gallery-item {
  width: 100%;
  margin: 0;
  break-inside: avoid;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.3s;
  animation: fadeIn 0.4s ease-out backwards;
  animation-delay: var(--delay);
}

.gallery-item:hover {
  border-color: rgba(201, 168, 76, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.gallery-item-img-wrap {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: rgba(255,255,255,0.03);
  /* 从 220px 降低到 160px，这是大部分横图的合理高度 */
  min-height: 160px; 
}

.asset-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.asset-shell img.is-broken {
  opacity: 0;
  pointer-events: none;
}

.asset-fallback {
  position: absolute;
  inset: 0;
  display: none;
}

.asset-shell.is-missing .asset-fallback {
  display: flex;
}

.avatar-asset-shell,
.gallery-asset-shell {
  width: 100%;
  height: 100%;
}

.avatar-fallback {
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.12), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
}

.gallery-fallback {
  min-height: 280px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018) 62%, rgba(8,8,12,0.72) 100%);
}

.gallery-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 22%, transparent 68%, rgba(0,0,0,0.22));
  pointer-events: none;
}

.gallery-fallback-mark {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}

.gallery-fallback-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.18);
}

.gallery-fallback-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 72px;
  height: 34px;
  border-radius: 999px 999px 18px 18px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.18);
}

.gallery-fallback-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.gallery-fallback-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.5);
}

.gallery-fallback-tags {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
}

.gallery-item-img-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.42) 100%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.gallery-item:hover .gallery-item-img-wrap::after {
  opacity: 1;
}

.gallery-item-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s;
}

.gallery-item:hover .gallery-item-img {
  transform: scale(1.02);
}

.gallery-item-info {
  padding: 14px 16px 16px;
}

.gallery-item-desc {
  font-size: 14px;
  color: #d1d1d1;
  margin: 0 0 10px;
  line-height: 1.55;
}

.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.fanart-hashtag {
  display: inline;
  font-size: 12.5px;
  color: rgba(201, 168, 76, 0.6);
  cursor: pointer;
  transition: color 0.2s;
  letter-spacing: 0.3px;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}

.fanart-hashtag:hover {
  color: #f0d878;
  text-decoration: underline;
}

/* ===== Lightbox 大图 ===== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 24px;
}

.lightbox-overlay.show {
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ccc;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-info {
  text-align: center;
  margin-top: 20px;
  max-width: 600px;
}

.lightbox-desc {
  font-size: 15px;
  color: #bbb;
  margin: 0 0 12px;
  letter-spacing: 1px;
}

.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.lightbox-nav.prev {
  left: 20px;
}
.lightbox-nav.next {
  right: 20px;
}

.gallery-empty {
  text-align: center;
  color: #666;
  padding: 80px 0;
  font-size: 15px;
  letter-spacing: 2px;
}

/* ===== 响应式补充 ===== */
@media (max-width: 1024px) {
  .gallery-grid.gallery-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .fanart-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .gallery-title {
    font-size: 22px;
    letter-spacing: 3px;
  }

  .gallery-back-btn {
    position: relative;
    margin-bottom: 16px;
    display: inline-flex;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
  }

  .lightbox-nav.prev {
    left: 8px;
  }
  .lightbox-nav.next {
    right: 8px;
  }
}

@media (max-width: 640px) {
  .gallery-grid.gallery-masonry {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery-item-img-wrap {
    min-height: 140px;
  }

  .gallery-fallback {
    min-height: 220px;
  }
}


/* ===== 角色卡片重制：游戏图鉴风 ===== */
.characters-grid {
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 16px;
}

.character-card {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  text-align: left;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.1), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 10px 28px rgba(0,0,0,0.28);
  transform: translateY(0);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    background 0.35s ease;
}

.character-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 24%, transparent 70%, rgba(0,0,0,0.18));
  pointer-events: none;
  z-index: 1;
}

.character-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(var(--glow-rgb, 201, 168, 76), 0.65), rgba(255,255,255,0.05), rgba(var(--glow-rgb, 201, 168, 76), 0.22));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 4;
}

.character-card:hover {
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.14), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025));
  border-color: rgba(var(--glow-rgb, 201, 168, 76), 0.55);
  transform: translateY(-8px);
  box-shadow:
    0 18px 40px rgba(0,0,0,0.4),
    0 0 0 1px rgba(var(--glow-rgb, 201, 168, 76), 0.12),
    0 0 28px rgba(var(--glow-rgb, 201, 168, 76), 0.22);
}

.character-card:hover::after {
  opacity: 1;
}

.char-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(var(--glow-rgb, 201, 168, 76), 0.1), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  overflow: hidden;
  box-shadow: none;
}

.character-card:hover .char-avatar {
  border-color: transparent;
  box-shadow: none;
}

.char-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,15,0.02) 0%, rgba(10,10,15,0.05) 58%, rgba(10,10,15,0.68) 100%),
    radial-gradient(circle at 50% 110%, rgba(var(--glow-rgb, 201, 168, 76), 0.22), transparent 42%);
  pointer-events: none;
  z-index: 1;
}

.char-avatar-img,
.char-avatar-inner {
  width: 100%;
  height: 100%;
}

.char-avatar-img {
  display: block;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.02);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

.character-card:hover .char-avatar-img {
  transform: scale(1.1);
  filter: saturate(1.06) brightness(1.05);
}

.char-avatar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.76);
  background:
    radial-gradient(circle at 50% 25%, rgba(255,255,255,0.08), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s ease;
}

.character-card:hover .char-avatar-inner {
  transform: scale(1.06);
  color: rgba(255,255,255,0.92);
}

.char-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 16px;
  z-index: 3;
  background: linear-gradient(180deg, rgba(8,8,12,0.02) 0%, rgba(8,8,12,0.32) 12%, rgba(8,8,12,0.82) 100%);
  backdrop-filter: blur(6px);
}

.char-name {
  margin: 0;
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 1px;
  color: #f5f1e6;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0,0,0,0.55);
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s ease;
}

.character-card:hover .char-name {
  transform: translateY(-1px);
  color: #fffaf0;
}

.char-role {
  display: none;
}

@media (max-width: 768px) {
  .characters-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .character-card {
    border-radius: 16px;
  }

  .char-name {
    font-size: 16px;
    letter-spacing: 1px;
  }

  .char-info {
    height: 20%;
    padding: 14px 10px 12px;
  }

  .char-avatar-inner {
    font-size: 54px;
  }
}

@media (max-width: 480px) {
  .characters-area {
    padding: 24px 16px 64px;
  }

  .characters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .char-name {
    font-size: 18px;
  }
}


@media (max-width: 640px) {
  .gallery-grid.gallery-masonry {
    grid-template-columns: 1fr;
  }

  .gallery-view {
    padding: 24px 16px 60px;
  }

  .gallery-back-btn {
    left: 16px;
    top: 16px;
  }

  .gallery-hero-avatar {
    width: 78px;
    height: 78px;
    border-radius: 18px;
  }
}

/* ===== 终极视觉优化：页面切换动画 ===== */
.animate-fadeIn {
  animation: pageReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pageReveal {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ===== 同人图瀑布流精致化渲染 ===== */
.gallery-item {
  position: relative;
  background: #16161e;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover {
  border-color: #c9a84c;
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(201, 168, 76, 0.15);
  z-index: 10;
}

.gallery-item-img {
  border-radius: 20px 20px 0 0;
  filter: grayscale(20%);
  transition: filter 0.4s ease;
}

.gallery-item:hover .gallery-item-img {
  filter: grayscale(0%);
}

/* ===== 同人图页面的返回按钮美化 ===== */
.gallery-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-radius: 50px;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.gallery-back-btn:hover {
  background: #c9a84c;
  color: #000;
  border-color: #f0d878;
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.4);
}

/* ===== 滚动条美化（全站） ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #c9a84c, #16213e);
  border-radius: 10px;
}