/* 商品推薦ロジック 解説ページ CSS */
:root {
  --ink: #0b1025;
  --muted: #4b5563;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --card-bg: #ffffff;
  --accent: #0ea5e9; /* sky-500 */
  --accent-dark: #0284c7; /* sky-600 */
  --maxw: 980px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1, h2, h3, p, ul, ol, table {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 2rem;
  text-align: center;
  color: var(--ink);
  margin-bottom: 2.5rem;
}

h2 {
  font-size: 1.6rem;
  line-height: 1.4;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  color: var(--accent-dark);
}

h3 {
  font-size: 1.3rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-left: 5px solid var(--accent);
  padding-left: 0.75rem;
}

.card {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.note {
  background: #eff6ff; /* blue-50 */
  border: 1px solid #dbeafe; /* blue-200 */
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 1.25rem;
  font-size: 0.95rem;
}

.formula {
  background: #f8fafc; /* slate-50 */
  border: 1px solid #f1f5f9; /* slate-100 */
  border-radius: 8px;
  padding: 1rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1rem;
  text-align: center;
  margin: 1.5rem 0;
  white-space: pre-wrap;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.75rem;
  text-align: left;
}

thead th {
  background: #f1f5f9; /* slate-100 */
  font-weight: 600;
  text-align: center;
}

tbody tr:nth-child(even) {
  background-color: #f8fafc; /* slate-50 */
}

.highlight {
  color: var(--accent-dark);
  font-weight: bold;
}

/* ===== 商品提案ロジック参考文献 ===== */
#proposal-references {
  --bg: #ffffff;
  --fg: #222;
  --muted: #555;
  --rule: #ddd;
  --link: #0056a3;
  --link-hover: #003d73;

  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  max-width: 960px;
  margin: 2rem auto;
  padding: 2rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  line-height: 1.7;
}

/* 大見出し */
#proposal-references h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #444;
  padding-bottom: .5rem;
}

/* カテゴリ見出し */
#proposal-references h3 {
  font-size: 1.2rem;
  margin: 2rem 0 1rem;
  padding-left: .5rem;
  border-left: 4px solid #444;
  color: #333;
}

/* 番号付きリスト */
#proposal-references ol {
  list-style-position: outside;
  margin: 0;
  padding-left: 1.6rem;
}

#proposal-references li {
  margin-bottom: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px dashed var(--rule);
}

#proposal-references li:last-child {
  border-bottom: none;
}

/* サイト名（イタリック） */
#proposal-references i {
  color: var(--muted);
  font-style: italic;
}

/* リンク */
#proposal-references a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#proposal-references a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

/* 英語文献と日本語補足の区切りを分かりやすく */
#proposal-references li::after {
  content: "";
  display: block;
  margin-top: .3rem;
  color: var(--muted);
  font-size: .95em;
}

/* 小さい画面対応 */
@media (max-width: 600px) {
  #proposal-references {
    padding: 1.2rem;
  }
  #proposal-references h2 {
    font-size: 1.5rem;
  }
  #proposal-references h3 {
    font-size: 1.1rem;
  }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  #proposal-references {
    --bg: #121212;
    --fg: #eee;
    --muted: #aaa;
    --rule: #333;
    --link: #7bb1ff;
    --link-hover: #a9c9ff;
    background: var(--bg);
    border-color: var(--rule);
  }
  #proposal-references h2, 
  #proposal-references h3 {
    border-color: #666;
  }
}
