/* ========================================
   サブページ共通スタイル
   ======================================== */

/* パンくずリスト */
.breadcrumb {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  padding: 8px 0;
}

.breadcrumb a {
  color: var(--color-reiwa);
}

/* セクション共通 */
.detail-section {
  margin-bottom: 32px;
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}

.section-intro {
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

/* ========================================
   年ページ - ヒーローカード
   ======================================== */
.year-hero {
  text-align: center;
  padding: 32px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.year-hero__year {
  font-family: var(--font-number);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-reiwa);
}

.year-hero__unit {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-text-primary);
  margin-left: 4px;
}

.year-hero__era {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.year-hero__age {
  font-size: var(--text-lg);
  margin-top: 12px;
}

.year-hero__age strong {
  font-size: var(--text-2xl);
  color: var(--color-current-year-accent);
}

/* ========================================
   干支ヒーローカード
   ======================================== */
.eto-hero-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.eto-hero-card__main {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--color-bg-secondary);
}

.eto-hero-card__emoji {
  font-size: 3rem;
  line-height: 1;
}

.eto-hero-card__animal {
  font-size: var(--text-xl);
  font-weight: 700;
}

.eto-hero-card__eto60 {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.eto-hero-card__elements {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 24px 0;
}

.element-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.element-connector {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-secondary);
}

.eto-hero-card__relation {
  padding: 12px 24px;
}

.relation-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
}

.relation-badge--sojo,
.relation-badge--sojo-reverse {
  background: #2E7D32;
}

.relation-badge--sokoku,
.relation-badge--sokoku-reverse {
  background: #C62828;
}

.relation-badge--hiwa {
  background: #B8860B;
}

.relation-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.eto-hero-card__trait {
  padding: 12px 24px;
  font-size: var(--text-sm);
  line-height: 1.8;
  background: var(--color-bg-secondary);
  margin: 0 16px;
  border-radius: 8px;
}

.eto-hero-card__notable {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  margin-top: 12px;
}

.notable-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-reiwa);
}

.notable-nature {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-top: 8px;
}

.notable-history {
  margin-top: 12px;
  font-size: var(--text-sm);
}

.notable-history ul {
  padding-left: 20px;
  margin-top: 4px;
}

.notable-history li {
  margin-bottom: 4px;
  line-height: 1.7;
}

.eto-hero-card__link {
  padding: 12px 24px 20px;
  text-align: center;
}

/* ========================================
   厄年アラート
   ======================================== */
.yakudoshi-alert {
  background: #FEF2F2;
  border: 2px solid #EF4444;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.yakudoshi-alert__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: #DC2626;
  margin-bottom: 8px;
}

.yakudoshi-alert__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yakudoshi-alert .yaku-badge {
  font-size: var(--text-sm);
  padding: 4px 12px;
}

@media (prefers-color-scheme: dark) {
  .yakudoshi-alert {
    background: #451A1A;
    border-color: #B91C1C;
  }
  .yakudoshi-alert__title {
    color: #FCA5A5;
  }
}

.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 24px;
}

.next-yaku {
  margin-top: 8px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ========================================
   人生の節目 タイムライン
   ======================================== */
.milestones {
  display: grid;
  gap: 2px;
}

.milestone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: background-color var(--transition-fast);
}

.milestone--linked {
  cursor: pointer;
}

.milestone--linked:hover {
  background: var(--color-hover);
  opacity: 1;
}

.milestone--past {
  opacity: 0.65;
}

.milestone--current {
  background: var(--color-current-year) !important;
  border-color: var(--color-current-year-accent);
  opacity: 1;
  font-weight: 600;
}

.milestone--celebration {
  border-left: 4px solid #E91E63;
}

.milestone__year {
  min-width: 200px;
  font-family: var(--font-number);
}

.milestone__emoji {
  margin-right: 6px;
}

.milestone__era {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-left: 4px;
}

.milestone__label {
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.milestone__ads {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
}

.milestone__ads:hover {
  opacity: 1;
}

.milestone__ad {
  font-size: var(--text-xs);
  text-decoration: none;
  color: #FF9900;
  font-weight: 600;
  margin-left: 2px;
}

.milestone__ad--rakuten {
  color: #BF0000;
  margin-left: 4px;
}

.milestone__ad:hover {
  text-decoration: underline;
}

/* ========================================
   アフィリエイトセクション
   ======================================== */
.affiliate-section {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--color-bg-secondary);
  border-radius: 12px;
}

.affiliate-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 12px;
}

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

.affiliate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text-primary);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.affiliate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.affiliate-card__emoji {
  font-size: 2rem;
}

.affiliate-card__label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
}

/* ショップリンク（Amazon + 楽天） */
.shop-links {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.shop-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.shop-link:hover {
  opacity: 0.8;
}

.shop-link--amazon {
  background: #FF9900;
  color: #111;
}

.shop-link--rakuten {
  background: #BF0000;
  color: #fff;
}

/* ========================================
   年ナビゲーション
   ======================================== */
.year-nav-section {
  margin-top: 32px;
}

.year-nav-section h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 12px;
}

.year-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.year-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-primary);
  font-family: var(--font-number);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background-color var(--transition-fast);
}

.year-nav-btn:hover {
  background: var(--color-hover);
  opacity: 1;
}

.year-nav-btn--current {
  background: var(--color-current-year);
  border-color: var(--color-current-year-accent);
  font-weight: 700;
}

.year-nav-btn__year {
  font-weight: 600;
}

.year-nav-btn__era {
  font-size: 10px;
  color: var(--color-text-secondary);
}

.decade-group {
  margin-bottom: 20px;
}

.decade-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-secondary);
}

/* ========================================
   干支ページ - ハイライトカード
   ======================================== */
.eto-highlight-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.eto-highlight-card__top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px;
}

.eto-highlight-card__emoji {
  font-size: 5rem;
  line-height: 1;
}

.eto-highlight-card__kanji {
  font-size: 3rem;
  font-weight: 700;
}

.eto-highlight-card__reading {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
}

.eto-highlight-card__body {
  padding: 24px;
}

.eto-highlight-card__elements {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.eto-highlight-card__relation {
  margin-bottom: 16px;
  font-size: var(--text-sm);
  line-height: 1.8;
}

.eto-notable-box {
  padding: 16px;
  background: var(--color-bg-secondary);
  border-radius: 10px;
  margin-bottom: 16px;
  line-height: 1.8;
}

.eto-notable-box p {
  margin-bottom: 8px;
}

.eto-trait {
  font-size: var(--text-sm);
  line-height: 1.8;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
}

.current-event {
  color: var(--color-current-year-accent);
  font-weight: 700;
}

/* ========================================
   十二支グリッド
   ======================================== */
.junishi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.junishi-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.junishi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.junishi-card--current {
  border: 2px solid var(--color-current-year-accent);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.junishi-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.junishi-card__emoji {
  font-size: 2rem;
  line-height: 1;
}

.junishi-card__name {
  font-size: var(--text-xl);
  font-weight: 700;
}

.junishi-card__reading {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.junishi-card__body {
  padding: 12px 16px 16px;
}

.junishi-card__element {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 8px;
}

.junishi-card__trait {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.junishi-card__keyword {
  font-size: var(--text-xs);
  color: var(--color-reiwa);
  font-weight: 600;
}

.junishi-card__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--color-current-year-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ========================================
   十干グリッド
   ======================================== */
.jikkan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.jikkan-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  transition: transform var(--transition-fast);
}

.jikkan-card:hover {
  transform: translateY(-1px);
}

.jikkan-card--current {
  border: 2px solid var(--color-current-year-accent);
}

.jikkan-card__name {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.jikkan-card__reading {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.jikkan-card__element {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: 8px;
}

.jikkan-card__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--color-current-year-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ========================================
   五行セクション
   ======================================== */
.gogyo-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gogyo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.gogyo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.gogyo-card__header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gogyo-card__emoji {
  font-size: 1.5rem;
}

.gogyo-card__name {
  font-size: var(--text-xl);
  font-weight: 700;
}

.gogyo-card__reading {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.gogyo-card__info {
  padding: 12px 16px;
  font-size: var(--text-sm);
  line-height: 1.8;
}

.gogyo-card__relation {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gogyo-rel {
  font-size: var(--text-xs);
  font-weight: 600;
}

.gogyo-rel--sojo {
  color: #2E7D32;
}

.gogyo-rel--sokoku {
  color: #C62828;
}

.gogyo-diagram {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 24px;
}

.gogyo-diagram h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 12px;
}

.gogyo-diagram h3:first-child {
  margin-top: 0;
}

.gogyo-flow {
  font-size: var(--text-lg);
  text-align: center;
  padding: 12px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  letter-spacing: 0.05em;
}

/* ========================================
   六十干支テーブル
   ======================================== */
.eto60-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.eto60-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.eto60-table thead th {
  background: var(--color-bg-secondary);
  padding: 10px 12px;
  font-weight: 700;
  text-align: center;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.eto60-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.eto60-name {
  text-align: center;
  font-size: var(--text-base);
}

.eto60-current {
  background: var(--color-current-year) !important;
}

.eto60-notable {
  background: rgba(139, 76, 112, 0.04);
}

.eto60-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.eto60-badge--current {
  background: var(--color-current-year-accent);
  color: #fff;
}

.eto60-badge--notable {
  background: var(--color-reiwa);
  color: #fff;
}

/* ========================================
   有名な干支カード
   ======================================== */
.notable-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.notable-card--current {
  border: 2px solid var(--color-current-year-accent);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.15);
}

.notable-card__header {
  padding: 16px 20px;
  background: var(--color-bg-secondary);
}

.notable-card__header h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 4px;
}

.notable-card__elements {
  font-size: var(--text-sm);
}

.notable-card__body {
  padding: 16px 20px;
  line-height: 1.8;
}

.notable-card__body p {
  margin-bottom: 8px;
}

/* タイムライン */
.notable-timeline {
  margin-top: 12px;
  border-left: 3px solid var(--color-border);
  padding-left: 16px;
}

.timeline-item {
  position: relative;
  padding-bottom: 12px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}

.timeline-item--current::before {
  background: var(--color-current-year-accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.timeline-item__year {
  font-family: var(--font-number);
  font-weight: 700;
  font-size: var(--text-sm);
}

.timeline-item--current .timeline-item__year {
  color: var(--color-current-year-accent);
}

.timeline-item__event {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* 同じ干支の年リンク */
.eto-same-years {
  padding: 12px 0 4px;
  font-size: var(--text-sm);
  line-height: 1.8;
}

.eto-same-years a {
  color: var(--color-reiwa);
  margin: 0 2px;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 768px) {
  .year-hero__year {
    font-size: 2.5rem;
  }

  .eto-highlight-card__top {
    padding: 24px 16px;
  }

  .eto-highlight-card__emoji {
    font-size: 3.5rem;
  }

  .eto-highlight-card__kanji {
    font-size: 2.5rem;
  }

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

  .milestone__year {
    min-width: 150px;
  }
}

@media (max-width: 600px) {
  .section-title {
    font-size: var(--text-lg);
  }

  .year-hero {
    padding: 24px 16px;
  }

  .year-hero__year {
    font-size: 2rem;
  }

  .year-hero__age strong {
    font-size: var(--text-xl);
  }

  .eto-hero-card__main {
    padding: 16px;
  }

  .eto-hero-card__emoji {
    font-size: 2rem;
  }

  .eto-hero-card__elements {
    padding: 12px 16px 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .element-connector {
    align-self: center;
  }

  .eto-hero-card__relation,
  .eto-hero-card__notable,
  .eto-hero-card__link {
    padding-left: 16px;
    padding-right: 16px;
  }

  .eto-highlight-card__top {
    flex-direction: column;
    padding: 20px 16px;
  }

  .eto-highlight-card__body {
    padding: 16px;
  }

  .eto-highlight-card__elements {
    flex-direction: column;
    align-items: flex-start;
  }

  .junishi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

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

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

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

  .year-nav-grid {
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  }

  .milestone {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .milestone__year {
    min-width: auto;
  }

  .eto60-table {
    font-size: var(--text-xs);
  }

  .eto60-table td,
  .eto60-table th {
    padding: 6px 8px;
  }
}

/* ========================================
   印刷
   ======================================== */
@media print {
  .ad-slot,
  .affiliate-section,
  .affiliate-grid,
  .milestone__ads,
  .shop-links,
  .year-nav-section,
  .back-to-top,
  .site-footer nav,
  .breadcrumb {
    display: none !important;
  }
}

/* ========================================
   ダークモード追加
   ======================================== */
@media (prefers-color-scheme: dark) {
  .yakudoshi-alert {
    background: #451A1A;
    border-color: #B91C1C;
  }

  .eto-notable-box {
    background: var(--color-bg-secondary);
  }

  .gogyo-diagram {
    background: var(--color-bg-secondary);
  }
}


/* ==========================================================================
   家族の年齢早見ページ
   ========================================================================== */

/* --- 登録フォーム --- */
.family-form {
  margin-bottom: 24px;
}

.family-form__fields {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.family-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.family-form__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary, #666);
}

.family-form__input {
  padding: 10px 14px;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface, #fff);
  color: var(--color-text, #2D2D2D);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.family-form__input:focus {
  outline: none;
  border-color: var(--color-primary, #7B4B94);
  box-shadow: 0 0 0 3px rgba(123, 75, 148, 0.12);
}

.family-form__input--year {
  max-width: 130px;
}

.family-form__button {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: var(--color-primary, #7B4B94);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.family-form__button:hover {
  background: var(--color-primary-dark, #5e3572);
  transform: translateY(-1px);
}

.family-form__button:active {
  transform: translateY(0);
}

/* --- 家族カウント --- */
.family-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-secondary, #666);
  margin-left: 8px;
}

/* --- 空状態 --- */
.family-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-secondary, #888);
}

.family-empty__icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.family-empty p {
  margin: 4px 0;
  line-height: 1.6;
}

/* --- カードグリッド --- */
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* --- メンバーカード --- */
.family-card {
  position: relative;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.family-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.family-card__delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-secondary, #999);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
}

.family-card__delete:hover {
  background: #fee;
  color: #c00;
}

.family-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--color-border-light, #f0f0f0);
}

.family-card__name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text, #2D2D2D);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 60px);
}

.family-card__age {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary, #7B4B94);
  white-space: nowrap;
}

.family-card__body {
  padding: 12px 16px;
}

.family-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.family-card__label {
  color: var(--color-text-secondary, #888);
  white-space: nowrap;
  margin-right: 8px;
}

.family-card__value {
  font-weight: 500;
  text-align: right;
}

.family-card__yakudoshi {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.family-card__footer {
  padding: 8px 16px 12px;
  text-align: right;
}

.family-card__link {
  font-size: 0.85rem;
  color: var(--color-primary, #7B4B94);
  text-decoration: none;
  font-weight: 500;
}

.family-card__link:hover {
  text-decoration: underline;
}

/* --- 全削除ボタン --- */
.family-clear {
  text-align: center;
  padding: 24px 0 8px;
}

.family-clear__button {
  padding: 8px 20px;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary, #888);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.family-clear__button:hover {
  border-color: #c00;
  color: #c00;
}

/* --- レスポンシブ --- */
@media (max-width: 600px) {
  .family-form__fields {
    flex-direction: column;
  }

  .family-form__input--year {
    max-width: 100%;
  }

  .family-form__button {
    width: 100%;
  }

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

/* --- ダークモード --- */
@media (prefers-color-scheme: dark) {
  .family-form__input {
    background: var(--color-bg-secondary, #2a2a2a);
    border-color: var(--color-border, #444);
    color: var(--color-text, #e0e0e0);
  }

  .family-card {
    background: var(--color-bg-secondary, #2a2a2a);
    border-color: var(--color-border, #444);
  }

  .family-card__delete:hover {
    background: rgba(200, 0, 0, 0.15);
  }

  .family-empty {
    color: var(--color-text-secondary, #888);
  }
}
