/*
 * GKDOLL Character Stories front-end styles.
 * Scope: only templates rendered by this plugin under #gkcs-main.
 */
#gkcs-main.gkcs-main {
  --gkcs-gold: #c79a42;
  --gkcs-text: #151515;
  --gkcs-muted: #6e6e6e;
  --gkcs-border: #e4e0d8;
  color: var(--gkcs-text);
  background: #fff;
}

#gkcs-main .gkcs-container {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

/* Parent Character Stories page intro — matches the previously approved layout. */
#gkcs-main .gkcs-root-intro {
  padding: 34px 0 10px;
  text-align: center;
  background: #fff;
}

#gkcs-main .gkcs-root-title {
  margin: 0 0 8px;
  color: #111;
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 700;
  line-height: 1.25;
}

#gkcs-main .gkcs-root-subtitle {
  margin: 0 auto;
  max-width: 820px;
  color: #777;
  font-size: 14px;
  line-height: 1.7;
}

/* 人物故事目录：电脑6列、平板4列、手机2列 */
#gkcs-main .lori-directory {
  width: 100%;
  padding: 8px 0 36px;
}

#gkcs-main .lori-directory-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 24px;
  color: #a36b18;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

#gkcs-main .lori-directory-meta::before,
#gkcs-main .lori-directory-meta::after {
  width: 52px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c99543);
  content: "";
}

#gkcs-main .lori-directory-meta::after {
  background: linear-gradient(90deg, #c99543, transparent);
}

#gkcs-main .lori-character-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 26px 18px;
  width: 100%;
}

#gkcs-main .lori-character-card {
  position: relative;
  display: block;
  flex: 0 0 calc((100% - 90px) / 6);
  max-width: calc((100% - 90px) / 6);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(139, 99, 42, .24);
  border-radius: 13px;
  background: #21170f;
  box-shadow: 0 7px 18px rgba(48, 31, 13, .13);
  text-decoration: none;
  transform: translateY(0);
  transition:
    transform .28s ease,
    box-shadow .28s ease,
    border-color .28s ease;
  cursor: pointer;
}

#gkcs-main .lori-character-card:focus-visible {
  outline: 2px solid #c99543;
  outline-offset: 3px;
}

#gkcs-main .lori-character-image {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #19130e;
}

#gkcs-main .lori-character-image::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(15, 10, 6, .78) 0%,
    rgba(15, 10, 6, .16) 31%,
    transparent 55%
  );
  content: "";
}

#gkcs-main .lori-character-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition:
    transform .48s cubic-bezier(.2, .65, .3, 1),
    filter .3s ease;
}

#gkcs-main .lori-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #241a11, #4a3621);
}

#gkcs-main .lori-character-name {
  position: absolute;
  right: 9px;
  bottom: 9px;
  left: 9px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 30px 8px 8px;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(218, 168, 77, .50);
  border-radius: 8px;
  background: rgba(20, 14, 10, .86);
  box-shadow: 0 5px 13px rgba(0, 0, 0, .23);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .75);
  backdrop-filter: blur(7px);
  transition:
    color .25s ease,
    background .25s ease,
    border-color .25s ease;
}

#gkcs-main .lori-character-name::after {
  position: absolute;
  right: 10px;
  color: #d8a84d;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  content: "›";
  transition:
    color .25s ease,
    transform .25s ease;
}

@media (hover: hover) and (pointer: fine) {
  #gkcs-main .lori-character-card:hover {
    color: #fff;
    border-color: rgba(191, 133, 43, .62);
    box-shadow: 0 15px 28px rgba(69, 43, 13, .21);
    text-decoration: none;
    transform: translateY(-5px);
  }

  #gkcs-main .lori-character-card:hover .lori-character-image img {
    filter: brightness(1.035) saturate(1.05);
    transform: scale(1.05);
  }

  #gkcs-main .lori-character-card:hover .lori-character-name {
    color: #2b1b08;
    border-color: #e2ad46;
    background: linear-gradient(135deg, #f2cf7d 0%, #d99b32 100%);
    text-shadow: none;
  }

  #gkcs-main .lori-character-card:hover .lori-character-name::after {
    color: #2b1b08;
    transform: translateX(2px);
  }
}

/* Character child-category page. */
#gkcs-main .gkcs-character-hero {
  padding: 34px 0 22px;
  background: #fff;
}

#gkcs-main .gkcs-breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 26px;
  font-size: 13px;
  color: #8b8b8b;
}

#gkcs-main .gkcs-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

#gkcs-main .gkcs-character-layout {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

#gkcs-main .gkcs-character-image {
  overflow: hidden;
  border-radius: 14px;
  background: #f4f1ea;
}

#gkcs-main .gkcs-character-image img {
  width: 100%;
  height: auto;
  display: block;
}

#gkcs-main .gkcs-character-copy h1 {
  margin: 6px 0 8px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.1;
  color: #111;
}

#gkcs-main .gkcs-primary-keyword {
  display: inline-block;
  margin: 0 0 20px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f5efe1;
  color: #775414;
  font-size: 13px;
  font-weight: 700;
}

#gkcs-main .gkcs-character-description {
  font-size: 16px;
  line-height: 1.85;
  color: #4f4f4f;
}

#gkcs-main .gkcs-character-description > *:first-child { margin-top: 0; }
#gkcs-main .gkcs-character-description > *:last-child { margin-bottom: 0; }

#gkcs-main .gkcs-section {
  padding: 34px 0 70px;
}

#gkcs-main .gkcs-articles-section {
  border-top: 1px solid var(--gkcs-border);
  margin-top: 24px;
}

#gkcs-main .gkcs-section-title {
  margin: 0 0 28px;
  text-align: center;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
  color: #111;
}

#gkcs-main .gkcs-article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

#gkcs-main .gkcs-article-card {
  overflow: hidden;
  border: 1px solid var(--gkcs-border);
  border-radius: 12px;
  background: #fff;
}

#gkcs-main .gkcs-article-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

#gkcs-main .gkcs-article-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f5f5f5;
}

#gkcs-main .gkcs-article-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#gkcs-main .gkcs-article-body { padding: 18px; }
#gkcs-main .gkcs-article-body h3 {
  margin: 0 0 9px;
  font-size: 20px;
  line-height: 1.35;
  color: #111;
}
#gkcs-main .gkcs-article-body p {
  margin: 0;
  color: var(--gkcs-muted);
  font-size: 14px;
  line-height: 1.65;
}

#gkcs-main .gkcs-pagination {
  margin-top: 32px;
  text-align: center;
}

#gkcs-main .gkcs-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  border: 1px dashed #d8d3c8;
  border-radius: 10px;
  color: #6f6a60;
  text-align: center;
  background: #faf9f6;
}

/* 平板：每行4个 */
@media (max-width: 1024px) {
  #gkcs-main .gkcs-container {
    width: min(100% - 32px, 1240px);
  }

  #gkcs-main .lori-character-grid {
    gap: 22px 16px;
  }

  #gkcs-main .lori-character-card {
    flex-basis: calc((100% - 48px) / 4);
    max-width: calc((100% - 48px) / 4);
  }

  #gkcs-main .gkcs-character-layout {
    grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
    gap: 30px;
  }

  #gkcs-main .gkcs-article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 手机：每行2个 */
@media (max-width: 767px) {
  #gkcs-main .gkcs-container {
    width: min(100% - 24px, 1240px);
  }

  #gkcs-main .gkcs-root-intro {
    padding: 26px 0 8px;
  }

  #gkcs-main .gkcs-root-title {
    font-size: 24px;
  }

  #gkcs-main .gkcs-root-subtitle {
    font-size: 13px;
  }

  #gkcs-main .lori-directory {
    padding: 4px 0 24px;
  }

  #gkcs-main .lori-directory-meta {
    gap: 9px;
    margin-bottom: 16px;
    font-size: 9px;
  }

  #gkcs-main .lori-directory-meta::before,
  #gkcs-main .lori-directory-meta::after {
    width: 28px;
  }

  #gkcs-main .lori-character-grid {
    gap: 14px 10px;
  }

  #gkcs-main .lori-character-card {
    flex-basis: calc((100% - 10px) / 2);
    max-width: calc((100% - 10px) / 2);
    border-radius: 11px;
  }

  #gkcs-main .lori-character-name {
    right: 7px;
    bottom: 7px;
    left: 7px;
    min-height: 36px;
    padding: 7px 25px 7px 6px;
    font-size: 12px;
  }

  #gkcs-main .lori-character-name::after {
    right: 8px;
    font-size: 15px;
  }

  #gkcs-main .gkcs-character-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  #gkcs-main .gkcs-character-image {
    max-width: 420px;
    margin: 0 auto;
  }

  #gkcs-main .gkcs-article-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #gkcs-main .lori-character-card,
  #gkcs-main .lori-character-image img,
  #gkcs-main .lori-character-name,
  #gkcs-main .lori-character-name::after {
    transition: none;
  }
}
