/* ============================================================
 * compounds-list.css — 化合物一覧ページ + 共通カード拡張
 * ダークテーマ（既存CSS変数を継承）
 * ============================================================ */

/* ---------- CSS変数フォールバック ---------- */
:root {
  --bg-dark: #0a0e14;
  --bg-panel: #0d1117;
  --bg-card: #161b22;
  --border: #21262d;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --accent-cyan: #00d4ff;
  --accent-green: #00ff88;
  --accent-purple: #a855f7;
  --accent-pink: #ff6b9d;
  --accent-orange: #ff9500;
}

/* ============================================================
 * 「もっと見る」ボタン（共通）
 * ============================================================ */
.cs-more-btn {
  display: block;
  text-align: center;
  margin: 14px auto 0;
  padding: 10px 24px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  max-width: 320px;
}

.cs-more-btn:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
  text-decoration: none;
}

/* 詳細ページ用: もう少し大きく */
.compounds-page-section .cs-more-btn {
  font-size: 14px;
  padding: 12px 28px;
  max-width: 400px;
  margin-top: 20px;
}

/* ---------- カテゴリラベル ---------- */
.cs-mini-category {
  font-size: 10px;
  color: var(--accent-purple);
  margin: 0 0 4px;
  font-weight: 600;
}

.compounds-page-section .cs-mini-category {
  font-size: 11px;
}

/* ---------- フルカード説明は最大3行 ---------- */
.cs-desc-full {
  -webkit-line-clamp: 3 !important;
  line-clamp: 3 !important;
}

/* ============================================================
 * 一覧ページ レイアウト
 * ============================================================ */
.cl-page {
  font-family: 'Noto Sans JP', 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
}

/* -- ヘッダー -- */
.cl-header {
  background: linear-gradient(135deg, #0a0e14 0%, #111820 50%, #161b22 100%);
  padding: 36px 24px 28px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.cl-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cl-header-symbol {
  font-family: 'Orbitron', 'JetBrains Mono', monospace;
  font-size: clamp(44px, 8vw, 64px);
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 24px rgba(0, 212, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.cl-header-names {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cl-header-name-ja {
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}

.cl-header-name-en {
  font-size: clamp(13px, 2vw, 16px);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: capitalize;
}

.cl-header-desc {
  font-size: clamp(12px, 1.8vw, 15px);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  opacity: 0.85;
}

/* -- ナビ -- */
.cl-nav {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 12px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.cl-nav a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.cl-nav a:hover {
  color: var(--accent-green);
  text-decoration: underline;
}

/* -- コンテナ -- */
.cl-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* -- ツールバー -- */
.cl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cl-count {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cl-count strong {
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
}

.cl-toolbar-spacer {
  flex: 1;
}

.cl-toolbar label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cl-toolbar select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}

.cl-toolbar select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* -- フィルタチップ -- */
.cl-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.cl-chip {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cl-chip:hover {
  border-color: rgba(0, 212, 255, 0.4);
  color: var(--text);
}

.cl-chip.active {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

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

/* 一覧ページ用カードサイズアップ */
.cl-grid .cs-mini-card {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.cl-grid .cs-mini-card:hover {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.12);
  transform: translateY(-2px);
}

.cl-grid .cs-mini-molecule {
  min-height: 100px;
  padding: 14px 12px;
}

.cl-grid .cs-mini-body {
  padding: 10px 14px 12px;
}

.cl-grid .cs-mini-name {
  font-size: 14px;
}

.cl-grid .cs-mini-formula {
  font-size: 13px;
}

.cl-grid .cs-mini-name-en {
  font-size: 11px;
}

.cl-grid .cs-mini-desc {
  font-size: 11px;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.cl-grid .cs-mini-tag {
  font-size: 10px;
  padding: 2px 8px;
}

.cl-grid .cs-mini-category {
  font-size: 11px;
}

/* -- 代表物質バッジ -- */
.cs-priority-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
  margin-left: 6px;
  vertical-align: middle;
}

/* -- 空状態 -- */
.cl-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.cl-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.cl-empty-text {
  font-size: 16px;
  margin-bottom: 8px;
}

.cl-empty-sub {
  font-size: 13px;
}

/* -- エラー / ローディング -- */
.cl-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.cl-loading .cs-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: cs-spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

.cl-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--accent-pink);
  font-size: 14px;
}

/* ============================================================
 * レスポンシブ
 * ============================================================ */
@media (max-width: 640px) {
  .cl-grid {
    grid-template-columns: 1fr;
  }
  .cl-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .cl-toolbar-spacer {
    display: none;
  }
  .cl-toolbar select {
    width: 100%;
  }
}

@media (min-width: 900px) {
  .cl-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
