/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  color: #333; background: #f7f8fa; line-height: 1.75;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ===== Layout ===== */
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== Header ===== */
.site-header {
  background: #1A1A2E;
  color: #fff;
  padding: 2rem 1.5rem 1.5rem;
}
.site-header__inner {
  max-width: 960px; margin: 0 auto;
}
.site-header__title {
  font-size: 1.35rem; font-weight: 700; letter-spacing: .02em; margin-bottom: .15rem;
}
.site-header__subtitle {
  font-size: .82rem; opacity: .75; margin-bottom: 1.2rem;
}
.search-box {
  position: relative; max-width: 560px;
}
.search-box__input {
  width: 100%; padding: .75rem 1rem .75rem 2.6rem;
  border: none; border-radius: 8px;
  font-size: .95rem; background: rgba(255,255,255,.12);
  color: #fff; outline: none; transition: background .2s;
}
.search-box__input::placeholder { color: rgba(255,255,255,.5); }
.search-box__input:focus { background: rgba(255,255,255,.2); }
.search-box__icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; opacity: .5;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  max-width: 960px; margin: 1rem auto .5rem; padding: 0 1.5rem;
  font-size: .8rem; color: #888;
}
.breadcrumb a { color: #2563EB; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== Section ===== */
.section {
  max-width: 960px; margin: 0 auto; padding: 0 1.5rem;
}
.section__heading {
  font-size: 1.15rem; font-weight: 700; color: #1A1A2E;
  margin: 2rem 0 1rem; padding-bottom: .5rem;
  border-bottom: 2px solid #1A1A2E;
  display: flex; align-items: center; gap: .5rem;
}
.section__heading-icon { font-size: 1.1rem; }

/* ===== Standard Use-Cases (Top page expanded) ===== */
.standard-list { display: flex; flex-direction: column; gap: .75rem; }

.uc-card {
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 1.1rem 1.3rem;
  transition: box-shadow .2s, transform .15s;
  cursor: pointer; display: block;
}
.uc-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }
.uc-card__header { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .45rem; }
.uc-card__star-badge {
  flex-shrink: 0; background: #FFF8E1; color: #92400E;
  font-size: .7rem; font-weight: 700; padding: .2rem .55rem;
  border-radius: 4px; white-space: nowrap;
}
.uc-card__title {
  font-size: 1rem; font-weight: 600; color: #1A1A2E; line-height: 1.5;
}
.uc-card__summary {
  font-size: .85rem; color: #555; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.uc-card__tools { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.tool-badge {
  font-size: .72rem; padding: .18rem .55rem; border-radius: 20px;
  background: #EFF6FF; color: #2563EB; font-weight: 500;
}

/* ===== Lesson Cards (Top page) ===== */
.lesson-list { display: flex; flex-direction: column; gap: .75rem; }

.lesson-card {
  background: #E1F5EE; border-radius: 10px;
  padding: 1.1rem 1.3rem;
  transition: box-shadow .2s, transform .15s;
  cursor: pointer; display: block;
}
.lesson-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-1px); }
.lesson-card__number {
  font-size: .72rem; font-weight: 700; color: #085041;
  margin-bottom: .25rem;
}
.lesson-card__title {
  font-size: 1rem; font-weight: 600; color: #085041; margin-bottom: .35rem;
}
.lesson-card__summary {
  font-size: .85rem; color: #333; line-height: 1.65;
}

/* ===== Tool / Job Category Sections ===== */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}
.category-card {
  background: #fff; border-radius: 10px; padding: 1rem 1.2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  cursor: pointer; transition: box-shadow .2s, transform .15s;
}
.category-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }
.category-card__title {
  font-size: .95rem; font-weight: 600; color: #1A1A2E; margin-bottom: .3rem;
}
.category-card__count {
  font-size: .78rem; color: #888;
}

/* ===== Use Case Detail Page ===== */
.uc-detail { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.uc-detail__title {
  font-size: 1.4rem; font-weight: 700; color: #1A1A2E; margin-bottom: .3rem;
}
.uc-detail__summary {
  font-size: .95rem; color: #555; line-height: 1.7; margin-bottom: 1.5rem;
}
.uc-detail__how-label {
  font-size: .9rem; font-weight: 700; color: #1A1A2E; margin-bottom: .4rem;
}
.uc-detail__how {
  font-size: .92rem; color: #444; line-height: 1.75; margin-bottom: 1.5rem;
}
.uc-detail__tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 2rem; }
.uc-detail__tools .tool-badge { font-size: .8rem; padding: .25rem .7rem; }

/* ===== Case Cards ===== */
.case-cards { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.case-card {
  background: #fff; border-radius: 10px; padding: 1.2rem 1.4rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  cursor: pointer; display: block;
}
.case-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.case-card__job {
  display: inline-block; font-size: .72rem; padding: .2rem .6rem;
  border: 1px solid #ccc; border-radius: 4px; color: #555; margin-bottom: .5rem;
}
.case-card__desc {
  font-size: .88rem; color: #444; line-height: 1.65; margin-bottom: .7rem;
}
.case-card__ba {
  display: grid; grid-template-columns: 1fr 1fr; gap: .8rem;
}
.case-card__before, .case-card__after {
  font-size: .8rem; line-height: 1.6; padding: .6rem .8rem; border-radius: 6px;
}
.case-card__before { background: #FFF5F5; color: #991B1B; }
.case-card__after { background: #F0FDF4; color: #166534; }
.case-card__before-label, .case-card__after-label {
  font-weight: 700; font-size: .7rem; display: block; margin-bottom: .2rem;
}

/* ===== Related Use Cases ===== */
.related-section { margin-bottom: 2rem; }
.related-section__title {
  font-size: .9rem; font-weight: 700; color: #1A1A2E; margin-bottom: .5rem;
}
.related-link {
  display: block; padding: .45rem 0;
  font-size: .88rem; color: #333;
  border-bottom: 1px solid #eee;
  transition: color .15s;
}
.related-link:hover { color: #2563EB; }
.related-link::before { content: "→ "; color: #999; }

/* ===== Case Detail Page ===== */
.case-detail { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.case-detail__ba-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem;
}
.case-detail__before, .case-detail__after {
  padding: .8rem 1rem; border-radius: 8px; font-size: .88rem; line-height: 1.65;
}
.case-detail__before { background: #FFF5F5; color: #991B1B; }
.case-detail__after { background: #F0FDF4; color: #166534; }
.case-detail__ba-label {
  font-weight: 700; font-size: .75rem; display: block; margin-bottom: .25rem;
}
.case-detail__section-title {
  font-size: 1rem; font-weight: 700; color: #1A1A2E;
  margin: 1.5rem 0 .5rem; padding-bottom: .3rem; border-bottom: 1px solid #eee;
}
.case-detail__text {
  font-size: .95rem; color: #444; line-height: 1.75;
}
.case-detail__job-badge {
  display: inline-block; font-size: .78rem; padding: .25rem .7rem;
  border: 1px solid #ccc; border-radius: 4px; color: #555; margin-bottom: .4rem;
}
.case-detail__title {
  font-size: 1.3rem; font-weight: 700; color: #1A1A2E; margin-bottom: .5rem;
}
.case-detail__tools { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }

/* ===== Lesson Detail Page ===== */
.lesson-detail { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.lesson-detail__header {
  background: #1A1A2E; color: #fff; padding: 1.5rem;
  border-radius: 10px 10px 0 0; margin: -1.5rem -1.5rem 0;
}
.lesson-detail__number { font-size: .78rem; opacity: .7; margin-bottom: .3rem; }
.lesson-detail__title { font-size: 1.35rem; font-weight: 700; }
.lesson-detail__summary-bar {
  background: #E1F5EE; padding: 1rem 1.5rem;
  font-size: .9rem; color: #085041; line-height: 1.7;
  margin: 0 -1.5rem 1.5rem;
}
.lesson-detail__body-section {
  background: #E1F5EE; border-radius: 10px; padding: 1.3rem 1.5rem; margin-bottom: 1.5rem;
}
.lesson-detail__body-title {
  font-size: .9rem; font-weight: 700; color: #085041; margin-bottom: .5rem;
}
.lesson-detail__body-text {
  font-size: .92rem; color: #333; line-height: 1.8;
  white-space: pre-wrap;
}

/* ===== Search Results ===== */
.search-results { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.search-results__title { font-size: 1.1rem; font-weight: 700; color: #1A1A2E; margin-bottom: 1rem; }
.search-results__count { font-size: .85rem; color: #888; margin-bottom: 1rem; }
.search-results__empty {
  text-align: center; padding: 3rem 1rem; color: #999; font-size: .95rem;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto; background: #1A1A2E; color: rgba(255,255,255,.6);
  text-align: center; padding: 1.5rem; font-size: .78rem;
}
.site-footer a { color: rgba(255,255,255,.8); }
.site-footer a:hover { text-decoration: underline; }

/* ===== Back Link ===== */
.back-link {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .85rem; color: #2563EB; margin-bottom: 1rem;
}
.back-link:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .site-header { padding: 1.5rem 1rem 1.2rem; }
  .site-header__title { font-size: 1.15rem; }
  .section { padding: 0 1rem; }
  .case-card__ba, .case-detail__ba-row { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .uc-detail, .case-detail, .lesson-detail { padding: 1rem; }
  .lesson-detail__header { margin: -1rem -1rem 0; padding: 1.2rem 1rem; }
  .lesson-detail__summary-bar { margin: 0 -1rem 1rem; padding: .8rem 1rem; }
}

/* ===== Utility ===== */
.hidden { display: none !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
