/* ==========================================================================
   AiXcel 会計用語辞典 (/dictionary) 専用スタイル
   ========================================================================== */

:root {
  --d-teal: #21c4a6;
  --d-teal-dark: #024560;
  --d-teal-light: #e0f7f3;
  --d-lime: #a3e635;
  --d-amber-bg: #fef3c7;
  --d-amber-text: #92400e;
  --d-ink: #1f2937;
  --d-ink-2: #374151;
  --d-muted: #6b7280;
  --d-border: #e5e7eb;
  --d-surface: #f9fafb;
  --d-white: #ffffff;
  --d-shadow: 0 1px 3px rgba(0,0,0,.04);
  --d-shadow-md: 0 4px 12px rgba(2,69,96,.08);
}

/* ========== コンテナ ========== */
.dict-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.dict-term-container {
  max-width: 820px;
  padding-top: 40px;
}

/* ========== Hero (invoice-final-cta__cardと統一・暗色テーマ) ========== */
.dict-hero {
  position: relative;
  background: rgb(11 27 43);
  border-radius: 24px;
  overflow: hidden;
  padding: 56px 32px;
  text-align: center;
  margin-bottom: 32px;
}
.dict-hero__glow {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(33,196,166,.2);
  filter: blur(60px);
  pointer-events: none;
}
.dict-hero__eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #21c4a6;
  margin: 0 0 12px;
}
.dict-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 14px;
  letter-spacing: -.02em;
}
.dict-hero__lead {
  font-size: .95rem;
  color: rgba(255,255,255,.7);
  line-height: 1.8;
  margin: 0 0 28px;
}
.dict-search-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}
.dict-search {
  width: 100%;
  padding: 14px 44px 14px 46px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  font-size: .95rem;
  background: rgba(255,255,255,.08);
  color: #fff;
  outline: none;
  transition: all .2s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.dict-search::placeholder { color: rgba(255,255,255,.45); }
.dict-search:focus {
  border-color: #21c4a6;
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 3px rgba(33,196,166,.18);
}
.dict-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.dict-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.5);
  pointer-events: none;
}
.dict-search:focus ~ .dict-search-icon,
.dict-search-wrap:focus-within .dict-search-icon { color: #21c4a6; }
.dict-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.75);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.dict-search-clear:hover {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.dict-search-clear[hidden] { display: none; }

/* ========== カテゴリチップ ========== */
.dict-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0 4px;
}
.dict-chip {
  padding: 8px 16px;
  border: 1.5px solid var(--d-border);
  border-radius: 20px;
  background: var(--d-white);
  color: var(--d-muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.dict-chip:hover {
  border-color: var(--d-teal);
  color: var(--d-teal-dark);
}
.dict-chip.is-active {
  background: var(--d-teal-light);
  border-color: var(--d-teal);
  color: var(--d-teal-dark);
  font-weight: 700;
}

/* ========== 統計 ========== */
.dict-stats {
  font-size: .82rem;
  color: var(--d-muted);
  margin-bottom: 28px;
  padding: 0 6px;
}
.dict-stats span { color: var(--d-teal-dark); font-weight: 700; }

/* ========== セクション(カテゴリ別) ========== */
.dict-section {
  margin-bottom: 36px;
}
.dict-section__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--d-teal-dark);
  margin: 0 0 16px;
  padding: 10px 0 10px 14px;
  border-left: 4px solid var(--d-teal);
  border-bottom: 1px solid var(--d-border);
  line-height: 1.4;
}

/* ========== グリッド + カード ========== */
.dict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.dict-card {
  position: relative;
  display: block;
  padding: 18px 18px 16px;
  border: 1.5px solid var(--d-border);
  border-radius: 14px;
  background: var(--d-white);
  text-decoration: none;
  color: inherit;
  transition: all .2s;
  box-shadow: var(--d-shadow);
}
.dict-card:hover {
  border-color: var(--d-teal);
  transform: translateY(-2px);
  box-shadow: var(--d-shadow-md);
}
.dict-card__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.dict-card__term {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--d-teal-dark);
}
.dict-card__alias {
  font-size: .72rem;
  color: var(--d-muted);
  font-weight: 600;
}
.dict-card__reading {
  font-size: .72rem;
  color: var(--d-muted);
  margin-bottom: 8px;
}
.dict-card__short {
  font-size: .85rem;
  color: var(--d-ink-2);
  line-height: 1.55;
  margin: 0;
  padding-right: 16px;
}
.dict-card__arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--d-muted);
  font-size: 1.3rem;
  font-weight: 600;
  transition: color .2s, transform .2s;
}
.dict-card:hover .dict-card__arrow {
  color: var(--d-teal);
  transform: translateY(-50%) translateX(3px);
}

/* ========== 空状態 ========== */
.dict-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--d-muted);
  font-size: .92rem;
  line-height: 1.7;
}

/* ========== ボトムCTA(invoice-search の invoice-final-cta__card と統一) ========== */
.dict-final-cta { margin-top: 48px; margin-bottom: 32px; }
.dict-final-cta__card {
  position: relative;
  background: rgb(11 27 43);
  border-radius: 24px;
  overflow: hidden;
  padding: 64px 48px;
  text-align: center;
}
.dict-final-cta__glow {
  position: absolute; top: -80px; right: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(33,196,166,.2);
  filter: blur(60px);
  pointer-events: none;
}
.dict-final-cta__eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #21c4a6;
  margin-bottom: 0;
}
.dict-final-cta__title {
  margin-top: 20px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: #fff;
}
.dict-final-cta__sub {
  margin-top: 20px;
  font-size: .95rem;
  color: rgba(255,255,255,.65);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}
.dict-final-cta__sub strong { color: #b1e56c; }
.dict-final-cta__actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.dict-btn-lime {
  display: inline-block;
  padding: 14px 28px;
  font-size: .95rem;
  font-weight: 700;
  border-radius: 50px;
  background: #b1e56c;
  color: #024560;
  text-decoration: none;
  transition: background .2s;
}
.dict-btn-lime:hover { background: #c5f07a; }
.dict-btn-ghost {
  display: inline-block;
  padding: 14px 28px;
  font-size: .95rem;
  font-weight: 500;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  text-decoration: none;
  transition: border-color .2s;
}
.dict-btn-ghost:hover { border-color: rgba(255,255,255,.4); }

/* スマホ調整 */
@media (max-width: 768px) {
  .dict-final-cta__card { padding: 48px 24px; }
  .dict-final-cta__actions { flex-direction: column; }
  .dict-btn-lime, .dict-btn-ghost { width: 100%; box-sizing: border-box; }
}

/* ========================================================================
   個別ページ (term.html)
   ======================================================================== */

.dict-term__head {
  /* 既存の blog.css の header { position:sticky } が当たらないよう明示 */
  position: static;
  background: transparent;
  z-index: auto;
  margin: 16px 0 32px;
  padding: 16px 0 24px;
  border: 0;
  border-bottom: 2px solid var(--d-teal-light);
}
.dict-term__cat {
  display: inline-block;
  background: var(--d-teal-light);
  color: var(--d-teal-dark);
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.dict-term__title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--d-teal-dark);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.dict-term__reading {
  font-size: .85rem;
  color: var(--d-muted);
  margin-bottom: 4px;
}
.dict-term__alias {
  font-size: .82rem;
  color: var(--d-muted);
}

/* ひと言で */
.dict-term__hitokoto {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left: 4px solid #f59e0b;
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin-bottom: 28px;
}
.dict-term__hitokoto-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--d-amber-text);
  margin-bottom: 6px;
  letter-spacing: .04em;
}
.dict-term__hitokoto p {
  font-size: 1.02rem;
  color: var(--d-ink);
  line-height: 1.7;
  margin: 0;
  font-weight: 600;
}

/* 本文 (Markdown 出力) */
.dict-term__body {
  font-size: .95rem;
  line-height: 2.0;
  color: var(--d-ink-2);
  margin-bottom: 40px;
}
.dict-term__body > *:first-child { margin-top: 0; }
.dict-term__body h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--d-teal-dark);
  margin: 44px 0 18px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--d-teal-light);
  line-height: 1.5;
}
.dict-term__body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--d-ink);
  margin: 32px 0 14px;
  line-height: 1.5;
}
.dict-term__body p { margin: 0 0 20px; }
.dict-term__body ul, .dict-term__body ol { margin: 0 0 24px; padding-left: 1.5em; }
.dict-term__body li { margin-bottom: 10px; line-height: 1.85; }
.dict-term__body li:last-child { margin-bottom: 0; }
.dict-term__body strong { color: var(--d-teal-dark); font-weight: 700; }
.dict-term__body code {
  background: var(--d-surface);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--d-ink);
}
.dict-term__body pre {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: .85rem;
  margin: 12px 0 18px;
}
.dict-term__body pre code { background: none; padding: 0; }
.dict-term__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  font-size: .88rem;
}
.dict-term__body th {
  background: var(--d-teal-dark);
  color: var(--d-white);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
}
.dict-term__body td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--d-border);
  vertical-align: top;
}
.dict-term__body tr:nth-child(even) td { background: var(--d-surface); }

/* AiXcel での扱い */
.dict-term__aixcel {
  background: linear-gradient(135deg, #e0f7f3 0%, #f0fdfa 100%);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 40px;
}
.dict-term__aixcel-label {
  font-size: .82rem;
  font-weight: 800;
  color: var(--d-teal-dark);
  margin-bottom: 12px;
}
.dict-term__aixcel p {
  font-size: .92rem;
  line-height: 1.9;
  color: var(--d-ink-2);
  margin: 0 0 16px;
}
.dict-term__aixcel-btn {
  display: inline-block;
  background: var(--d-teal-dark);
  color: var(--d-white);
  font-weight: 700;
  font-size: .85rem;
  padding: 9px 20px;
  border-radius: 10px;
  text-decoration: none;
  transition: all .2s;
}
.dict-term__aixcel-btn:hover {
  background: #013e54;
  transform: translateY(-1px);
}

/* 関連用語タグ */
.dict-term__section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--d-teal-dark);
  margin: 0 0 14px;
}
.dict-term__related {
  margin-bottom: 28px;
}
.dict-term__related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dict-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--d-teal-light);
  color: var(--d-teal-dark);
  border-radius: 16px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}
.dict-tag:hover {
  background: var(--d-teal);
  color: var(--d-white);
  transform: translateY(-1px);
}

/* 関連ブログ */
.dict-term__blogs {
  margin-bottom: 32px;
}
.dict-term__blogs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dict-blog-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--d-white);
  border: 1.5px solid var(--d-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--d-ink);
  transition: all .2s;
}
.dict-blog-card:hover {
  border-color: var(--d-teal);
  background: var(--d-surface);
  transform: translateX(3px);
}
.dict-blog-card__cat {
  font-size: .68rem;
  font-weight: 700;
  background: var(--d-teal-light);
  color: var(--d-teal-dark);
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.dict-blog-card__title {
  font-size: .88rem;
  font-weight: 600;
  flex: 1;
  line-height: 1.5;
}
.dict-blog-card__arrow {
  color: var(--d-muted);
  font-size: 1.2rem;
  font-weight: 600;
}

/* 個別ページの末尾CTAは .dict-final-cta を共通利用(invoice-final-cta__cardと統一) */

/* 戻るリンク */
.dict-term__back {
  margin-top: 32px;
  text-align: center;
}
.dict-term__back-link {
  color: var(--d-muted);
  font-size: .85rem;
  text-decoration: none;
  font-weight: 600;
  transition: color .2s;
}
.dict-term__back-link:hover { color: var(--d-teal-dark); }

/* ========================================================================
   レスポンシブ
   ======================================================================== */
@media (max-width: 768px) {
  .dict-hero { padding: 36px 22px; }
  .dict-hero h1 { font-size: 1.5rem; }
  .dict-hero__lead { font-size: .88rem; }

  .dict-term__title { font-size: 1.5rem; }
  .dict-term__hitokoto p { font-size: .95rem; }
  .dict-term__body { font-size: .9rem; line-height: 1.78; }
  .dict-term__body h2 { font-size: 1.08rem; }
  .dict-term__aixcel { padding: 18px 18px; }

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

@media (max-width: 480px) {
  .dict-container { padding: 16px 14px 60px; }
  .dict-chip { font-size: .8rem; padding: 7px 13px; }
}
