/* ============================================
   エンジニアのガジェット研究室 - スタイルシート
   Core Web Vitals 最適化: 最小CSS、外部フォント不使用
   ============================================ */

:root {
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-surface-hover: #242836;
  --color-text: #e4e6ef;
  --color-text-muted: #8b8fa3;
  --color-accent: #6c63ff;
  --color-accent-hover: #5a52e0;
  --color-amazon: #ff9900;
  --color-rakuten: #bf0000;
  --color-yahoo: #ff0033;
  --color-ali: #e43f35;
  --color-mercari: #4dc9f6;
  --color-border: #2a2e3e;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  --max-width: 880px;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  font-size: 16px;
}

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

/* ---- Header ---- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-logo {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}
.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--color-text); }

/* ---- Hero ---- */
.home-hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.home-hero h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--color-accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-description { color: var(--color-text-muted); margin-top: 0.5rem; }

/* ---- Article Grid ---- */
.latest-articles h2 { font-size: 1.3rem; margin-bottom: 1.5rem; }
.article-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }

.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.12);
}
.article-card img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 1rem 1.2rem; }
.card-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.card-body h3 { font-size: 1rem; line-height: 1.5; }
.card-body h3 a { color: var(--color-text); text-decoration: none; }
.card-body h3 a:hover { color: var(--color-accent); }
.card-summary { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.5rem; }
.category-badge {
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 0.5rem;
}

/* ---- Single Article ---- */
.article-single { padding: 2rem 0; }
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 1.8rem; line-height: 1.4; }
.article-lead { color: var(--color-text-muted); font-size: 1.05rem; margin-top: 0.5rem; }
.article-hero-image img { width: 100%; border-radius: var(--radius); margin-bottom: 2rem; }
.article-content { font-size: 1rem; }
.article-content h2 { font-size: 1.4rem; margin: 2rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--color-accent); }
.article-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; }
.article-content p { margin-bottom: 1rem; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.article-content th, .article-content td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-size: 0.9rem;
}
.article-content th { background: var(--color-surface); font-weight: 600; }
.article-content ul, .article-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-tags { margin-top: 2rem; }
.tag {
  display: inline-block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  text-decoration: none;
  margin: 4px;
  transition: background 0.2s;
}
.tag:hover { background: var(--color-surface-hover); color: var(--color-text); }

/* ---- Article Images ---- */
.article-hero-image {
  margin: 1.5rem 0 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.article-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem auto;
  display: block;
  border: 1px solid var(--color-border);
}
.article-content a {
  color: #38bdf8;
  text-decoration: underline;
  text-decoration-color: rgba(56, 189, 248, 0.6);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}
.article-content a:hover {
  color: #7dd3fc;
  text-decoration-color: #7dd3fc;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}
.article-content table a {
  color: #38bdf8;
  display: inline-block;
  font-weight: 600;
}
.article-content table a:hover {
  color: #7dd3fc;
}

/* ---- Visual Diagram Box (図解・スコア比較カード) ---- */
.diagram-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.diagram-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.score-row {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  align-items: center;
}
.score-label {
  color: var(--color-text-muted);
  font-weight: 600;
}
.score-val-a {
  color: #60a5fa;
  font-weight: 600;
}
.score-val-b {
  color: #f87171;
  font-weight: 600;
}
.score-bar-bg {
  background: rgba(255, 255, 255, 0.1);
  height: 6px;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 3px;
}
.score-bar-a { background: #3b82f6; }
.score-bar-b { background: #ef4444; }

/* ---- Diagram 4: VS Battle Summary Box (検証背景・対決構図図解) ---- */
.vs-summary-box {
  background: linear-gradient(135deg, rgba(26, 29, 39, 0.95), rgba(36, 40, 54, 0.95));
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.vs-header {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.2rem;
}
.vs-cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}
@media (max-width: 600px) {
  .vs-cards { grid-template-columns: 1fr; }
}
.vs-side-card {
  background: rgba(15, 17, 23, 0.6);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.vs-side-a { border-top: 3px solid #3b82f6; }
.vs-side-b { border-top: 3px solid #ef4444; }
.vs-side-label { font-size: 0.75rem; color: var(--color-text-muted); margin-bottom: 4px; }
.vs-side-title { font-size: 1rem; font-weight: 700; color: #fff; }
.vs-side-price { font-size: 1.15rem; font-weight: 800; margin-top: 6px; }
.vs-side-a .vs-side-price { color: #60a5fa; }
.vs-side-b .vs-side-price { color: #f87171; }
.vs-badge-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.vs-circle {
  background: var(--color-accent);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(108, 99, 255, 0.5);
}
.vs-diff-badge {
  font-size: 0.75rem;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.vs-points {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.vs-point-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--color-text);
}

/* ---- Diagram 5: Scene Matrix Box (実務シーン別判定図解) ---- */
.scene-matrix-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid #10b981;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.scene-matrix-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}
.scene-matrix-table {
  width: 100%;
  border-collapse: collapse;
}
.scene-matrix-table th, .scene-matrix-table td {
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}
.scene-matrix-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-weight: 600;
}
.scene-icon-good {
  color: #34d399;
  font-weight: 800;
  margin-right: 4px;
}
.scene-icon-ok {
  color: #fbbf24;
  font-weight: 800;
  margin-right: 4px;
}
.scene-icon-bad {
  color: #f87171;
  font-weight: 800;
  margin-right: 4px;
}

/* ---- Diagram 2: Pros & Cons Comparison Cards (メリット・デメリット図解) ---- */
.pros-cons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin: 2rem 0;
}
@media (min-width: 640px) {
  .pros-cons-grid { grid-template-columns: 1fr 1fr; }
}
.pros-card, .cons-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--color-border);
}
.pros-card { border-top: 4px solid #10b981; }
.cons-card { border-top: 4px solid #f59e0b; }
.card-header-pros {
  color: #34d399;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-header-cons {
  color: #fbbf24;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.card-list li {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.6rem;
  padding-left: 1.2rem;
  position: relative;
  color: var(--color-text);
}
.pros-card .card-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #34d399;
  font-weight: bold;
}
.cons-card .card-list li::before {
  content: "▲";
  position: absolute;
  left: 0;
  color: #fbbf24;
  font-size: 0.75rem;
  top: 2px;
}

/* ---- Diagram 3: Decision & Recommendation Cards (選び方・決断図解) ---- */
.decision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin: 2rem 0;
}
@media (min-width: 640px) {
  .decision-grid { grid-template-columns: repeat(3, 1fr); }
}
.decision-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}
.decision-card:hover {
  transform: translateY(-3px);
  border-color: #6366f1;
}
.decision-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 0.8rem;
  width: fit-content;
}
.badge-pro { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid #6366f1; }
.badge-budget { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid #f43f5e; }
.badge-smart { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid #38bdf8; }
.decision-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}
.decision-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.decision-action {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---- Purchase Block (Affiliate Links) ---- */
.purchase-block {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.purchase-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
.purchase-row { margin-bottom: 1rem; }
.purchase-label { display: block; font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.purchase-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
}
.btn:hover { opacity: 0.9; transform: scale(1.02); }
.btn-amazon { background: var(--color-amazon); color: #111; }
.btn-rakuten { background: var(--color-rakuten); }
.btn-yahoo { background: var(--color-yahoo); }
.btn-ali { background: var(--color-ali); }
.btn-mercari { background: var(--color-mercari); color: #111; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 4rem;
}

/* ============================================
   ナビゲーション & タクソノミー（カテゴリ・タグ・About）強化
   ============================================ */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.site-nav a:hover {
  color: #fff;
  background: var(--color-surface-hover);
}

/* ---- ページヘッダー共通 ---- */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}

.page-sub {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: #38bdf8;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ---- カテゴリ一覧（カードグリッド） ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: #38bdf8;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15);
}

.cat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cat-card-icon {
  font-size: 1.8rem;
}

.cat-card-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.cat-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
}

.cat-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  flex-grow: 1;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.cat-card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #38bdf8;
  align-self: flex-start;
}

/* ---- タグクラウド ---- */
.tags-cloud-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 3rem;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #131722;
  border: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.tag-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-2px);
}

.tag-chip .tag-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
}

/* ---- このサイトについて（About） ---- */
.about-hero {
  background: linear-gradient(135deg, #1e2433 0%, #111827 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 3rem;
}

.about-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
}

.about-lead {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.8;
}

.about-section {
  margin-bottom: 3.5rem;
}

.about-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  padding-left: 0.8rem;
  border-left: 4px solid #38bdf8;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.policy-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.8rem;
}

.policy-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.policy-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.8rem;
}

.policy-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.profile-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--color-border);
}

.profile-avatar {
  font-size: 2.5rem;
  background: #111827;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #38bdf8;
}

.profile-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.profile-role {
  font-size: 0.85rem;
  color: #38bdf8;
  font-weight: 600;
}

.profile-bio p {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: 0.8rem;
}

.compliance-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.8rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.compliance-box ul {
  margin: 1rem 0 1rem 1.5rem;
}

.compliance-box li {
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.compliance-note {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 1rem;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .site-header .container { flex-direction: column; gap: 0.8rem; }
  .site-nav { gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
  .site-nav a { font-size: 0.85rem; padding: 0.3rem 0.6rem; }
  .home-hero h1 { font-size: 1.5rem; }
  .purchase-buttons { flex-direction: column; }
  .btn { text-align: center; }
  .category-grid, .policy-grid { grid-template-columns: 1fr; }
}

