/* AI / Health 共通カード版スタイル（スキル ai-news-monitoring を流用） */

.topic-page {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-subtle: #9a9a9a;
  --border: #e5e0d5;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --star-active: #d4a017;
  --star-inactive: #d8d4c8;
  /* AI 用カテゴリ色 */
  --c-model: #1e3a5f;    --c-model-bg: #e8eef5;
  --c-research: #5a3a7c; --c-research-bg: #efe9f5;
  --c-tool: #1d6657;     --c-tool-bg: #e3f0ec;
  --c-industry: #9c4a1e; --c-industry-bg: #f7e9df;
  /* Health 用カテゴリ色 */
  --c-myokine: #b8341a;    --c-myokine-bg: #f7e1dc;
  --c-gut: #7a5a2e;        --c-gut-bg: #f0e6d4;
  --c-cell: #2a5f8f;       --c-cell-bg: #dce8f3;
  --c-training: #1d6657;   --c-training-bg: #e3f0ec;
  --c-nutrition: #6a8e1e;  --c-nutrition-bg: #ecf2dc;
  --c-osteopathy: #5a3a7c; --c-osteopathy-bg: #efe9f5;
  --c-supplement: #9c5a1e; --c-supplement-bg: #f7ebdc;
  --c-skin: #b85a85;       --c-skin-bg: #f7e3ed;

  margin: 0;
  padding: 24px 16px 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  min-height: 100vh;
}

@media (prefers-color-scheme: dark) {
  .topic-page {
    --bg: #1a1c1f;
    --surface: #25282d;
    --text: #f0ede5;
    --text-muted: #a8a8a8;
    --text-subtle: #7a7a7a;
    --border: #3a3d42;
    --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.3);
    --star-active: #e6b938;
    --star-inactive: #4a4742;
    --c-model: #7fa8d8;    --c-model-bg: #2a3a4f;
    --c-research: #b89cd8; --c-research-bg: #3a2f4a;
    --c-tool: #6dbfa8;     --c-tool-bg: #1f3a32;
    --c-industry: #e09870; --c-industry-bg: #4a3122;
    --c-myokine: #f0856b;     --c-myokine-bg: #4a2519;
    --c-gut: #d8b878;         --c-gut-bg: #3d2f1c;
    --c-cell: #82b8e8;        --c-cell-bg: #1f3148;
    --c-training: #6dbfa8;    --c-training-bg: #1f3a32;
    --c-nutrition: #b8d878;   --c-nutrition-bg: #2f3a1c;
    --c-osteopathy: #b89cd8;  --c-osteopathy-bg: #3a2f4a;
    --c-supplement: #e0a070;  --c-supplement-bg: #4a3122;
    --c-skin: #e8a8c5;        --c-skin-bg: #4a2535;
  }
}

.topic-page * { box-sizing: border-box; }

.topic-page .container { max-width: 880px; margin: 0 auto; }

.topic-page .top-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  font-size: 13px;
  flex-wrap: wrap;
}
.topic-page .top-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.15s;
}
.topic-page .top-nav a:hover { color: var(--text); border-color: var(--text-muted); }
.topic-page .top-nav a.active { color: var(--text); background: var(--text); color: var(--bg); border-color: var(--text); }

.topic-page .masthead {
  border-bottom: 3px double var(--text-muted);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.topic-page .masthead .kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.topic-page .masthead h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }

.topic-page .date-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 28px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.topic-page .date-bar .date-label {
  font-size: 14px;
  font-weight: 600;
}
.topic-page .date-bar .date-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}
.topic-page .date-bar button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.topic-page .date-bar button:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.topic-page .date-bar button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.topic-page .section { margin-bottom: 36px; }
.topic-page .section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 3px solid currentColor;
}
.topic-page .section.cat-model    .section-title { color: var(--c-model); }
.topic-page .section.cat-research .section-title { color: var(--c-research); }
.topic-page .section.cat-tool     .section-title { color: var(--c-tool); }
.topic-page .section.cat-industry .section-title { color: var(--c-industry); }
.topic-page .section.cat-myokine    .section-title { color: var(--c-myokine); }
.topic-page .section.cat-gut        .section-title { color: var(--c-gut); }
.topic-page .section.cat-cell       .section-title { color: var(--c-cell); }
.topic-page .section.cat-training   .section-title { color: var(--c-training); }
.topic-page .section.cat-nutrition  .section-title { color: var(--c-nutrition); }
.topic-page .section.cat-osteopathy .section-title { color: var(--c-osteopathy); }
.topic-page .section.cat-supplement .section-title { color: var(--c-supplement); }
.topic-page .section.cat-skin       .section-title { color: var(--c-skin); }

.topic-page .card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--cat-color, var(--text-muted));
}
.topic-page .card.cat-model    { --cat-color: var(--c-model);    --cat-bg: var(--c-model-bg); }
.topic-page .card.cat-research { --cat-color: var(--c-research); --cat-bg: var(--c-research-bg); }
.topic-page .card.cat-tool     { --cat-color: var(--c-tool);     --cat-bg: var(--c-tool-bg); }
.topic-page .card.cat-industry { --cat-color: var(--c-industry); --cat-bg: var(--c-industry-bg); }
.topic-page .card.cat-myokine    { --cat-color: var(--c-myokine);    --cat-bg: var(--c-myokine-bg); }
.topic-page .card.cat-gut        { --cat-color: var(--c-gut);        --cat-bg: var(--c-gut-bg); }
.topic-page .card.cat-cell       { --cat-color: var(--c-cell);       --cat-bg: var(--c-cell-bg); }
.topic-page .card.cat-training   { --cat-color: var(--c-training);   --cat-bg: var(--c-training-bg); }
.topic-page .card.cat-nutrition  { --cat-color: var(--c-nutrition);  --cat-bg: var(--c-nutrition-bg); }
.topic-page .card.cat-osteopathy { --cat-color: var(--c-osteopathy); --cat-bg: var(--c-osteopathy-bg); }
.topic-page .card.cat-supplement { --cat-color: var(--c-supplement); --cat-bg: var(--c-supplement-bg); }
.topic-page .card.cat-skin       { --cat-color: var(--c-skin);       --cat-bg: var(--c-skin-bg); }

.topic-page .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.topic-page .badge {
  display: inline-block;
  background: var(--cat-bg);
  color: var(--cat-color);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.topic-page .impact {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 1px;
}
.topic-page .impact .on  { color: var(--star-active); }
.topic-page .impact .off { color: var(--star-inactive); }
.topic-page .impact-label {
  font-size: 10px;
  color: var(--text-subtle);
  margin-right: 4px;
  letter-spacing: 0.05em;
}
.topic-page .card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.45;
  color: var(--text);
}
.topic-page .card-body {
  color: var(--text);
  font-size: 14px;
  margin: 0 0 14px;
  line-height: 1.7;
}

/* === v2: 共通セクションスタイル === */
.topic-page .block-section {
  margin: 14px 0;
}
.topic-page .block-section .block-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--cat-color);
  margin-bottom: 8px;
}

/* === 🎯 つまり（最重要・cat-bg背景） === */
.topic-page .block-takeaway {
  background: var(--cat-bg);
  border-radius: 10px;
  padding: 12px 16px 14px;
}
.topic-page .block-headline {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.55;
  margin: 2px 0 10px;
  letter-spacing: -0.005em;
}

/* === 共通: 箇条書きリスト === */
.topic-page .block-keypoints {
  list-style: none;
  margin: 0;
  padding: 0;
}
.topic-page .block-keypoints li {
  position: relative;
  padding: 4px 0 4px 22px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
}
.topic-page .block-keypoints li::before {
  content: "▸";
  position: absolute;
  left: 4px;
  top: 4px;
  color: var(--cat-color);
  font-weight: 700;
  font-size: 13px;
}

/* === 🏃/💡 行動セクション（左ボーダーで区別） === */
.topic-page .block-action {
  border-left: 3px solid var(--cat-color);
  padding: 6px 0 6px 14px;
}
.topic-page .block-action .block-keypoints li::before {
  content: "▶";
  font-size: 11px;
  top: 6px;
}

/* === 👤/🎯 対象セクション === */
.topic-page .block-bestfor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px 12px;
}
.topic-page .block-bestfor-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  font-weight: 500;
}

/* === タグチップ === */
.topic-page .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 10px;
}
.topic-page .tag {
  display: inline-block;
  font-size: 11px;
  color: var(--cat-color);
  background: var(--cat-bg);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

/* === 元情報（折りたたみ・補足扱い） === */
.topic-page .block-body {
  margin: 10px 0 6px;
  font-size: 13px;
}
.topic-page .block-body summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 0;
  user-select: none;
}
.topic-page .block-body summary:hover {
  color: var(--text);
}
.topic-page .block-body p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 6px 0 0;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 6px;
}
.topic-page .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}
.topic-page .stat {
  background: var(--cat-bg);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 70px;
  flex: 0 0 auto;
}
.topic-page .stat-value {
  display: block;
  color: var(--cat-color);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.topic-page .stat-label {
  display: block;
  color: var(--cat-color);
  opacity: 0.75;
  font-size: 10px;
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.topic-page .sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.topic-page .sources-label {
  font-size: 10px;
  color: var(--text-subtle);
  margin-right: 4px;
  align-self: center;
  letter-spacing: 0.05em;
}
.topic-page .source-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.15s;
}
.topic-page .source-chip:hover {
  background: var(--cat-bg);
  color: var(--cat-color);
  border-color: var(--cat-color);
}

.topic-page .empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.topic-page footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 12px;
  text-align: center;
}
