/* Layout */
.site-header {
  height: 56px;
  background-color: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-md);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  max-width: var(--w-container);
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-text);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: none;
}
.site-logo:hover {
  background: none;
  opacity: 0.8;
}
.site-header__nav {
  display: flex;
  gap: var(--sp-md);
  font-size: 0.9em;
}
.site-header__nav a {
  text-decoration: none;
}

.layout-main {
  max-width: var(--w-container);
  margin: 0 auto;
  padding: var(--sp-2xl) var(--sp-md);
  display: flex;
  gap: var(--sp-2xl);
}
.layout-content {
  flex: 1;
  max-width: var(--w-content);
  min-width: 0;
}
.layout-sidebar {
  display: none;
  width: 240px;
  flex-shrink: 0;
}
@media (min-width: 1024px) {
  .layout-sidebar {
    display: block;
  }
}

.site-footer {
  margin-top: var(--sp-3xl);
  padding: var(--sp-2xl) var(--sp-md);
  background-color: var(--c-surface);
}
.site-footer__inner {
  max-width: var(--w-container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.site-footer__main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  color: var(--c-text-light);
}
.site-footer__legal {
  font-size: 11px;
  color: var(--c-text-light);
}
.site-footer svg {
  width: 16px;
  height: 16px;
  color: var(--c-accent);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85em;
  color: var(--c-text-light);
  margin-bottom: var(--sp-lg);
}
.breadcrumb a {
  color: var(--c-text-light);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
  background: none;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-lg);
  margin-bottom: var(--sp-2xl);
}
.card {
  display: block;
  background: var(--c-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-decoration: none;
  color: var(--c-text);
  transition: box-shadow 0.15s;
}
.card:hover {
  
  box-shadow: 0 4px 12px rgba(46,44,51,.08), 0 10px 30px rgba(46,44,51,.1);
  background-color: var(--c-bg);
  text-decoration: none;
}
.card--dummy {
  opacity: 0.6;
}
.card__img-wrap {
  position: relative;
  aspect-ratio: 16/10;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-accent), var(--c-surface));
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__img-wrap img {
  border-radius: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}



.card__body {
  padding: var(--sp-md);
}
.card__title {
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: var(--sp-xs);
  font-size: 1.1rem;
}
.card__meta {
  font-size: 0.85em;
  color: var(--c-text-light);
}

/* List Card (ff14 index) */
.list-card {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md);
  background: var(--c-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--c-text);
  margin-bottom: var(--sp-md);
  transition: box-shadow 0.15s;
}
.list-card:hover {
  
  box-shadow: 0 4px 12px rgba(46,44,51,.08), 0 10px 30px rgba(46,44,51,.1);
  background-color: var(--c-bg);
  text-decoration: none;
}
.list-card__body {
  flex: 1;
}
.list-card__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

/* Article Header */
.article-header {
  margin-bottom: var(--sp-2xl);
}
.article-icon {
  font-size: 64px;
  text-align: center;
  margin-bottom: var(--sp-md);
}
.article-title {
  font-size: 2rem;
  margin-bottom: var(--sp-sm);
  line-height: 1.3;
}
.article-desc {
  font-size: 1.1rem;
  color: var(--c-text-light);
  margin-bottom: var(--sp-lg);
}
.article-meta {
  display: flex;
  gap: var(--sp-md);
  align-items: center;
  font-size: 0.9em;
  color: var(--c-text-light);
  margin-bottom: var(--sp-lg);
}
.article-notice {
  background-color: var(--c-surface-warm);
  padding: var(--sp-md);
  border-radius: 10px;
  font-size: 0.9em;
  display: flex;
  gap: 12px;
  position: relative;
}


/* Labels */
.label {
  display: inline-block;
  padding: 0.2em 0.6em;
  font-size: 11px;
  border-radius: 4px;
  font-weight: 700;
  margin-right: 0.5em;
  vertical-align: middle;
  background-color: #fff;
  border: 1px solid var(--c-border);
  color: var(--c-text-light);
}



.label--magic { background-color: var(--c-bm-light-magic); color: var(--c-bm-magic); }
.label--fly { background-color: var(--c-bm-light-fly); color: var(--c-bm-fly); }
.label--fierce { background-color: var(--c-bm-light-fierce); color: var(--c-bm-fierce); }
.label--solid-attr { background-color: var(--c-bm-light-solid); color: var(--c-bm-solid); }

/* Pet DB attribute card img wrapper */
.card__img-wrap--magic { background: var(--c-bm-light-magic); }
.card__img-wrap--fly { background: var(--c-bm-light-fly); }
.card__img-wrap--fierce { background: var(--c-bm-light-fierce); }
.card__img-wrap--solid-attr { background: var(--c-bm-light-solid); }

/* Table of Contents */
.toc {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}
.toc__title {
  font-weight: 700;
  margin-bottom: var(--sp-sm);
}
.toc ul {
  padding-left: 0;
}
.toc li {
  margin-bottom: var(--sp-xs);
}
.toc a {
  color: var(--c-text-light);
  display: block;
  text-decoration: none;
  padding-left: 10px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}
.toc a:hover, .toc a.is-active {
  color: var(--c-accent);
  border-left-color: var(--c-accent);
  background: none;
}
/* Mobile TOC */
.mobile-toc {
  background: var(--c-surface);
  border-radius: 10px;
  padding: var(--sp-md);
  margin-bottom: var(--sp-2xl);
}
@media (min-width: 1024px) {
  .mobile-toc { display: none; }
}

/* Details / Toggle (Segment Button) */
.details-toggle-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--sp-md);
}
details {
  background: var(--c-surface);
  border-radius: 10px;
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
}
summary {
  font-weight: 700;
  cursor: pointer;
}
details > p {
  margin-top: var(--sp-sm);
  margin-bottom: 0;
  font-size: 0.95em;
}

/* FAQ Cards */
.faq-card {
  background: var(--c-surface-warm);
  border-radius: 10px;
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
  display: flex;
  gap: var(--sp-md);
}
.faq-q-mark {
  width: 24px;
  height: 24px;
  background-color: var(--c-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.faq-content {
  flex: 1;
}
.faq-q {
  font-weight: 700;
  margin-bottom: var(--sp-sm);
  font-family: var(--font-heading);
}
.faq-a {
  margin-bottom: 0;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--space-paragraph);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th, td {
  padding: var(--sp-sm);
  border-bottom: 1px solid var(--c-border);
}
th {
  font-weight: 700;
  background: var(--c-surface);
}

/* Filter buttons (Pets DB) */
.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-btn {
  background: var(--c-surface);
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--c-text-light);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.is-active {
  background: var(--c-accent);
  color: #fff;
}

/* Diagrams (CSS) */
.diagram {
  background: var(--c-surface);
  border-radius: 10px;
  padding: 20px;
  margin: var(--sp-lg) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
}
.diagram-title {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--c-text-light);
  font-weight: 700;
  text-align: center;
}
.tp-bars {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.tp-bar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.85em;
}
.tp-bar-label {
  width: 60px;
}
.tp-bar-outer {
  flex: 1;
  height: 12px;
  background: var(--c-border);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.tp-bar-inner {
  height: 100%;
  background: var(--c-accent);
}
.tp-bar-val {
  width: 50px;
  text-align: right;
  font-family: var(--font-mono);
}
.tp-bar-line {
  position: absolute;
  left: 40%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--c-bg);
  z-index: 2;
}

/* Circle Diagram */
.circle-diagram {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
}
.circle-node {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: 700;
  gap: 4px;
}
.node-top { top: 0; left: 50%; transform: translateX(-50%); }
.node-right { top: 50%; right: 0; transform: translateY(-50%); }
.node-bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.node-left { top: 50%; left: 0; transform: translateY(-50%); }
.circle-arrow {
  position: absolute;
  font-size: 1.2rem;
  color: var(--c-accent);
}
.arrow-tr { top: 40px; right: 40px; transform: rotate(45deg); }
.arrow-br { bottom: 40px; right: 40px; transform: rotate(135deg); }
.arrow-bl { bottom: 40px; left: 40px; transform: rotate(225deg); }
.arrow-tl { top: 40px; left: 40px; transform: rotate(315deg); }

/* Flow Diagram */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
}
.flow-node {
  background: var(--c-bg);
  border: 1px solid var(--c-accent);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: 10px;
  font-size: 0.9em;
  text-align: center;
}
.flow-arrow {
  color: var(--c-accent);
}

.ext-icon {
  width: 12px;
  height: 12px;
  margin-right: 4px;
  vertical-align: middle;
}

.details-toggle-btn {
  background: none;
  border: none;
  color: var(--c-accent);
  cursor: pointer;
  font-size: 0.9em;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.details-toggle-btn:hover {
  background: var(--c-accent-soft);
}
.info-label-right {
  text-align: right;
  font-size: 11px;
  color: var(--c-text-light);
  margin-top: -0.5em;
  margin-bottom: var(--space-paragraph);
}
.flow-arrow {
  color: var(--c-text-light);
  stroke-width: 1.5px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.site-header__nav ul,
.toc ul,
.mobile-toc ul,
.card-grid {
  list-style: none !important;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
}

.mobile-toc li + li,
.toc li + li {
  margin-top: 0 !important;
}

/* Figure / Figcaption (Article content) */
.layout-content figure {
  margin: var(--sp-lg) 0;
}

.layout-content figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--c-border);
}

.layout-content figcaption {
  margin-top: var(--sp-sm);
  font-size: 0.85em;
  color: var(--c-text-light);
  line-height: 1.6;
}

details figure {
  margin: 12px 0;
}



/* Pets List */
.page-pets .layout-content {
  max-width: 880px;
}

.pet-head {
  display: grid;
  grid-template-columns: 2.5em 40px 1fr 6em 3.5em 1fr 1fr 1.5em;
  align-items: center;
  min-height: 44px;
  position: sticky;
  top: 56px;
  z-index: 10;
  background-color: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-light);
}

.pet {
  border-bottom: 1px solid var(--c-border);
}

.pet__row {
  display: grid;
  grid-template-columns: 2.5em 40px 1fr 6em 3.5em 1fr 1fr 1.5em;
  align-items: center;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pet__row::-webkit-details-marker {
  display: none;
}

.pet[open] > .pet__row,
.pet__row:hover {
  background-color: var(--c-surface);
}

.pet--empty .pet__row {
  cursor: default;
}
.pet--empty .pet__row:hover {
  background-color: transparent;
}

.pet[open] > .pet__row .pet__name {
  color: var(--c-accent);
}

.pet__class, .pet__name, .pet__release, .pet__big {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.pet__no {
  color: var(--c-text-light);
  font-size: 0.9em;
}

.pet__portrait {
  border-radius: 4px;
}

.pet__name {
  font-weight: 700;
}

.pet__class {
  color: var(--c-text-light);
  font-size: 0.9em;
}

.pet__release, .pet__big {
  font-weight: 400;
  font-size: 0.95em;
}

.pet__chevron {
  color: var(--c-text-light);
  text-align: right;
  transition: transform 0.2s;
}

.pet[open] > .pet__row .pet__chevron {
  transform: rotate(90deg);
}

.pet__detail {
  padding: 16px;
}

/* Mobile View */
@media (max-width: 640px) {
  .pet-head {
    display: none;
  }
  
  .pet__row {
    grid-template-columns: 40px auto 1fr 1.5em;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
      "portrait name attr chevron"
      "portrait release big chevron";
    height: 72px;
    gap: 0 8px;
    padding: 8px 0;
  }
  
  .pet__no, .pet__class {
    display: none;
  }
  
  .pet__portrait {
    grid-area: portrait;
    align-self: center;
  }
  
  .pet__name {
    grid-area: name;
    align-self: end;
    font-size: 1.05em;
  }
  
  .pet__attr {
    grid-area: attr;
    align-self: end;
    padding-bottom: 2px;
  }
  
  .pet__release {
    grid-area: release;
    align-self: start;
    font-size: 0.85em;
    color: var(--c-text-light);
  }
  
  .pet__big {
    grid-area: big;
    align-self: start;
    font-size: 0.85em;
    color: var(--c-text-light);
  }
  
  .pet__chevron {
    grid-area: chevron;
    align-self: center;
  }
}

/* Keep .pet-details-inner, etc */
.pet-details-header {
  display: flex;
  gap: var(--sp-md);
  margin-bottom: 16px;
}

.pet-details-header-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  font-size: 0.9em;
}

.pet-details-header-info p {
  margin: 0;
}

.pet-details-lore {
  margin-bottom: 24px;
}

.pet-skill-header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.pet-skill-header img {
  border-radius: 4px;
}

.pet-skill-header p {
  margin: 0;
  font-size: 0.9em;
}

.pet-skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.pet-skill-col p {
  margin-bottom: 8px;
  font-size: 0.9em;
}

.pet-skill-col dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 0.85em;
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  margin: 0;
}

.pet-skill-col dt {
  color: var(--c-text-light);
  font-weight: normal;
}

.pet-skill-col dd {
  margin: 0;
  font-weight: bold;
}

@media (max-width: 640px) {
  .pet-details-header {
    flex-direction: column;
  }
  
  .pet-skills-grid {
    grid-template-columns: 1fr;
  }
}
