/**
 * 健忘録 共通CSS
 * シンプル・白黒ベースデザイン
 */

/* ========================================
   リセット・ベース
======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  background: #fff;
  color: #222;
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: #222;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

ul, ol {
  list-style: none;
}

.mt-4 ol {
  list-style: auto;
}

/* ========================================
   レイアウト
======================================== */
.tools-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   ヘッダー
======================================== */
.tools-header {
  border-bottom: 1px solid #e5e5e5;
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}

.tools-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.tools-header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tools-header__logo img {
  height: 32px;
  width: auto;
}

.tools-header__logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  letter-spacing: 0.02em;
}

.tools-header__nav ul {
  display: flex;
  gap: 24px;
}

.tools-header__nav a {
  font-size: 14px;
  font-weight: 600;
  color: #555;
}

.tools-header__nav a:hover {
  color: #000;
  opacity: 1;
}

/* ========================================
   TOPページ - ヒーロー
======================================== */
.tools-hero {
  position: relative;
  width: 100%;
  height: auto;
  background-color: #000;
  background-image: radial-gradient(circle at top right, rgba(121, 68, 154, 0.13), transparent),
    radial-gradient(circle at 20% 80%, rgba(41, 196, 255, 0.13), transparent);
  padding: 40px 0;
  border-bottom: 1px solid #e5e5e5;
  overflow: hidden;
}

.tools-hero canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.tools-hero__title,
.tools-hero__subtitle,
.tools-hero__nav {
  position: relative;
  z-index: 1;
}

.tools-hero__title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.tools-hero__subtitle {
  font-size: 15px;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.tools-hero__nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.tools-hero__nav-btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgb(255,255,255,0.2);
  border: 1px solid #947e00;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

/* .tools-hero__nav-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 5%;
  width: 90%;
  height: 3px;
  display: block;
  background: repeating-linear-gradient(45deg, #000000, #000000 14px, #FFD900 14px, #FFD900 28px);
  border-radius: 6px;
}

.tools-hero__nav-btn::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 5%;
  width: 90%;
  height: 3px;
  display: block;
  background: repeating-linear-gradient(45deg, #000000, #000000 14px, #FFD900 14px, #FFD900 28px);
  border-radius: 6px;
} */

.tools-hero__nav-btn:hover {
  background: rgba(37, 37, 37, 0.8);
  color: #fff;
  border: 1px solid #524600;
  opacity: 1;
}

/* ========================================
   TOPページ - ツール集
======================================== */
.tools-section {
  padding: 48px 0;
}

.tools-section__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #222;
  display: inline-block;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tools-card {
  display: block;
  padding: 20px 24px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #f9f9f9;
}

.tools-card:hover {
  background: #fff;
  border-color: #222;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* NEWバッジ（カードに .new を付けるだけで表示） */
.tools-card.new {
  position: relative;
}

.tools-card.new::after {
  content: "NEW";
  position: absolute;
  top: -9px;
  right: -5px;
  z-index: 2;
  pointer-events: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  background: rgb(255 0 0 / 96%);
  color: #fffa0d;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;

  box-shadow: 0px 7px 4px rgba(0, 0, 0, 0.12);
  animation: tools-card-new-blink 1.2s ease-in-out infinite;
}

.tools-card.update {
  position: relative;
}

/* .new と併用した場合も UPDATE を優先（後勝ち） */
.tools-card.update::after {
  content: "UPDATE";
  position: absolute;
  top: -9px;
  right: -5px;
  z-index: 2;
  pointer-events: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  background: rgb(255 0 0 / 96%);
  color: #fff;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;

  box-shadow: 0px 7px 4px rgba(0, 0, 0, 0.12);
  animation: tools-card-new-blink 1.2s ease-in-out infinite;
}

.tools-card:hover::after {
  opacity: 1;
}

@keyframes tools-card-new-blink {
  0%   { opacity: 1;   transform: scale(1); }
  45%  { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1;   transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .tools-card.new::after {
    animation: none;
  }
  .tools-card.update::after {
    animation: none;
  }
}

.tools-card > a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tools-card > a:hover {
  opacity: 1;
}

.tools-card__name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

.tools-card__desc {
  font-size: 13px;
  color: #222;
  line-height: 1.5;
}

.tools-card__tag {
  display: inline-block;
  font-size: 11px;
  color: #fdfdfd;
  background: #3d3d3d;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
}

.tools-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.tools-card__link {
  font-size: 12px;
  color: #666;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tools-card__link:hover {
  color: #222;
  opacity: 1;
}

.tools-card__link svg {
  width: 12px;
  height: 12px;
}

/* ========================================
   下層ページ - ツール共通
======================================== */
.tool-page {
  padding: 20px 0 80px;
}

.tool-page__header {
  text-align: center;
  margin-bottom: 40px;
}

.tool-page__title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tool-page__desc {
  font-size: 14px;
  color: #666;
}

.tool-page__breadcrumb {
  font-size: 13px;
  color: #888;
  margin-bottom: 24px;
}

.tool-page__breadcrumb a {
  color: #666;
}

.tool-page__breadcrumb a:hover {
  color: #222;
}

.tool-page__breadcrumb span {
  margin: 0 8px;
  color: #aaa;
}

/* ツールコンテンツエリア */
.tool-content {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
  position: relative;
}

/* テンプレの「使い方」エリアだけ枠線を消す */
.tool-content.mt-4 {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin-bottom: 0;
}

.tool-content__section {
  margin-bottom: 24px;
}

.tool-content__section:last-child {
  margin-bottom: 0;
}

.tool-content__label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

/* フォーム要素 */
.tool-input,
.tool-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  transition: all 0.2s ease;
}

.tool-input:focus,
.tool-textarea:focus {
  outline: none;
  border-color: #222;
  background: #fff;
}

.tool-textarea {
  min-height: 150px;
  resize: vertical;
  font-family: inherit;
}

/* ボタン */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn--primary {
  background: #222;
  color: #fff;
}

.tool-btn--primary:hover {
  background: #444;
}

.tool-btn--secondary {
  background: #f5f5f5;
  color: #222;
  border: 1px solid #ddd;
}

.tool-btn--secondary:hover {
  background: #eee;
  border-color: #ccc;
}

.tool-btn--large {
  padding: 16px 32px;
  font-size: 16px;
  width: 100%;
}

/* スライダー */
.tool-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e5e5e5;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.tool-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #222;
  cursor: pointer;
}

.tool-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #222;
  cursor: pointer;
  border: none;
}

/* 結果表示 */
.tool-result {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 24px;
}

.tool-result__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #666;
}

/* プログレスバー */
.tool-progress {
  width: 100%;
  height: 8px;
  background: #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
}

.tool-progress__fill {
  height: 100%;
  background: #222;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* カード（プレビュー用） */
.tool-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.tool-preview-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}

.tool-preview-card__image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f5f5f5;
}

.tool-preview-card__info {
  padding: 12px;
}

.tool-preview-card__name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-preview-card__meta {
  font-size: 12px;
  color: #888;
}

/* バッジ */
.tool-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
}

.tool-badge--success {
  background: #e8f5e9;
  color: #2e7d32;
}

.tool-badge--error {
  background: #ffebee;
  color: #c62828;
}

.tool-badge--pending {
  background: #f5f5f5;
  color: #666;
}

/* ========================================
   フッター
======================================== */
.tools-footer {
  border-top: 1px solid #e5e5e5;
  border-bottom: 20px solid #1a1a1a;
  padding: 40px 0;
  margin-top: 60px;
  background: #fafafa;
  position: relative;
}

.tools-footer::before {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  height: 10px;
  display: block;
  background: repeating-linear-gradient(45deg, #000000, #000000 14px, #FFD900 14px, #FFD900 28px);
}

.tools-footer__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.tools-footer__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.tools-footer__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: 24px;
}

.tools-footer__links a {
  font-size: 13px;
  font-weight: 500;
  color: #666;
}

.tools-footer__links a:hover {
  color: #222;
}

.tools-footer__copyright {
  font-size: 12px;
  color: #999;
}

/* ========================================
   ページTOPボタン
======================================== */
.pagetop-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  background: #222;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99;
}

.pagetop-btn:hover {
  background: #444;
  transform: translateY(-2px);
  opacity: 1;
}

.pagetop-btn.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   ユーティリティ
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.flex-center { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}
.flex-between { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
}
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ========================================
   レスポンシブ
======================================== */
@media (max-width: 768px) {
  .tools-header__nav {
    display: none;
  }

  .tools-hero {
    padding: 48px 24px;
  }

  .tools-hero__title {
    font-size: 22px;
  }

  .tools-section {
    padding: 32px 0;
  }

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

  .tool-content {
    padding: 20px;
  }

  .tool-preview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tools-footer__links {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .tools-wrapper {
    padding: 0 16px;
  }

  .tool-preview-grid {
    grid-template-columns: 1fr;
  }
}
