/* ========================================
   NaoSoft 共通スタイル（ピュアCSS）
   外部フレームワークなし
======================================== */

:root {
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-text: #2c3e50;
  --color-text-muted: #5a6a7a;
  --color-primary: #009999;
  --color-primary-dark: #007a7a;
  --color-accent: #3498db;
  --color-danger: #e74c3c;
  --color-warning: #f39c12;
  --color-success: #27ae60;
  --color-border: #e1e8ed;
  --color-tag-bg: #e8f4f4;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --max-width: 1100px;
  --space: clamp(0.75rem, 2vw, 1.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }
ul, ol { margin: 0; padding-left: 1.4rem; }
p { margin: 0 0 0.8rem; }

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* ========== Header ========== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.75rem;
}
.logo img { height: 48px; width: auto; }
.tagline {
  font-size: 0.8rem;
  color: var(--color-primary);
  margin: 0;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover,
.nav a.active {
  background: var(--color-tag-bg);
  color: var(--color-primary);
  text-decoration: none;
}
.nav a.active { font-weight: 600; }

/* ========== Main / Section ========== */
main { padding-block: 1.5rem 2rem; }
.section { margin-bottom: 2.5rem; }
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  margin: 0 0 1rem;
}

/* ========== Alerts ========== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-danger  { background: #fdecea; border: 1px solid #f5c6cb; color: #721c24; }
.alert-warning { background: #fff8e6; border: 1px solid #f0d78c; color: #856404; }
.alert-info    { background: #e8f4f8; border: 1px solid #b8daff; color: #004085; }
.alert-success { background: #e6f4ea; border: 1px solid #c3e6cb; color: #155724; }

/* ========== お知らせ（トップページ冒頭） ========== */
.notice {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  background: #fff8e6;
  border: 1px solid #f0d78c;
  border-inline-start: 4px solid var(--color-warning);
  color: #856404;
}
.meta-links {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* ========== Cards / Boxes ========== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-tag-bg);
  padding-bottom: 0.4rem;
}

/* ========== Tables ========== */
.table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  padding: 0.85rem 0.75rem;
  text-align: start;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
table.data th {
  background: #f0f4f8;
  font-weight: 600;
  white-space: nowrap;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfc; }

.soft-name {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.soft-name img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.soft-name .desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

/* ========== Badges ========== */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 500;
}
.badge-share  { background: #e8f0fe; color: #1a73e8; }
.badge-free   { background: #e6f4ea; color: #137333; }
.badge-ended  { background: #fce8e6; color: #c5221f; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn:hover {
  background: #2980b9;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-hover);
}
.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
}
.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
}
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ========== FAQ Accordion-like ========== */
.faq-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.faq-nav a {
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  font-size: 0.9rem;
}
.faq-nav a:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}
.faq-item {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.faq-a {
  font-size: 0.95rem;
  color: var(--color-text);
}

/* ========== Footer ========== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: 1.5rem;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.sns { display: flex; gap: 1rem; }
.sns a { color: var(--color-text-muted); }
.sns a:hover { color: var(--color-primary); }

/* ========== Utility ========== */
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ========== History grid (index) ========== */
.history-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .history-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}
.history-list {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}
.history-list p { margin: 0.35rem 0; }
.side-image {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.side-image img {
  border-radius: var(--radius-sm);
  margin-inline: auto;
  max-height: 280px;
  object-fit: cover;
}
.side-image .links {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.software-intro {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--color-tag-bg);
  border-radius: var(--radius);
  border-inline-start: 4px solid var(--color-primary);
}

.price-num { font-weight: 600; }
.price-paypal { color: #c0392b; font-weight: 600; }

/* ========== ソフトウェア一覧テーブル修正 ========== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: auto; /* 崩れる場合は fixed に変更して試す */
}

table.data th,
table.data td {
  padding: 0.85rem 0.75rem;
  text-align: start;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  word-break: break-word;
}

table.data th {
  background: #f0f4f8;
  font-weight: 600;
  white-space: nowrap;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data tr:hover td {
  background: #fafbfc;
}

/* ソフト名＋アイコン */
.soft-name {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 0; /* flex子要素の溢れ防止 */
}

.soft-name img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.soft-name > div {
  min-width: 0; /* 長い説明文で崩れないように */
}

.soft-name .desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
  line-height: 1.5;
}

/* 種別・Version・OS列はできるだけ狭く */
table.data th:nth-child(1),
table.data td:nth-child(1) {
  width: 5.5rem;
  white-space: nowrap;
}

table.data th:nth-child(3),
table.data td:nth-child(3) {
  width: 4.5rem;
  white-space: nowrap;
}

table.data th:nth-child(4),
table.data td:nth-child(4) {
  width: 7.5rem;
  white-space: nowrap;
}

/* モバイルでさらに崩れる場合 */
@media (max-width: 640px) {
  table.data {
    font-size: 0.82rem;
  }
  table.data th,
  table.data td {
    padding: 0.65rem 0.5rem;
  }
  .soft-name {
    flex-direction: column;
    gap: 0.35rem;
  }
  .soft-name img {
    width: 28px;
    height: 28px;
  }
}

/* ========== ソフト個別ページ ========== */
.soft-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.soft-hero img.icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}
.soft-hero .info h1 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  color: var(--color-primary);
}
.soft-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}
.soft-meta a {
  margin-right: 0.5rem;
}
.feature-list {
  margin: 0;
  padding-left: 0;      /* 左余白を消す */
  list-style: none;     /* ・ を消す */
}
.feature-list li {
  margin-bottom: 1rem;
}
.feature-list strong {
  color: var(--color-primary);
}
.screenshot {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1rem 0;
}
.dl-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.link-with-desc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.link-with-desc .btn {
  flex-shrink: 0;
}
.link-with-desc .desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.faq-toc {
  margin: 0;
  padding-left: 1.25rem;
}
.faq-toc li {
  margin-bottom: 0.35rem;
}

/* 価格表：列を等間隔に */
table.price {
  table-layout: fixed;
  width: 100%;
}

table.price th,
table.price td {
  text-align: center;
  vertical-align: middle;
}

/* ソフト名列だけ広め */
table.price th:first-child,
table.price td:first-child {
  width: 28%;
  text-align: start;
}

/* 料金3列を等幅 */
table.price th:nth-child(2),
table.price td:nth-child(2),
table.price th:nth-child(3),
table.price td:nth-child(3),
table.price th:nth-child(4),
table.price td:nth-child(4) {
  width: 24%;
}

/* 通常料金：塗りつぶしボタン */
table.price input[type="submit"] {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-family: inherit;
  line-height: 1.3;
  color: #fff;
  background: var(--color-accent);
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

table.price input[type="submit"]:hover {
  background: #2980b9;
  border-color: #2980b9;
}

/* ベクターだけ：反転（アウトライン） */
.btn-cart {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--color-accent);
  background: transparent;
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.btn-cart:hover {
  color: #fff;
  background: var(--color-accent);
  text-decoration: none;
}

/* PayPal画像ボタンの位置合わせ */
table.price input[type="image"] {
  margin-top: 0.35rem;
  vertical-align: middle;
}

/* アンカーリンクでジャンプしたとき、stickyヘッダー分の余白を確保 */
.faq-item,
.section,
[id^="q"],
[id^="t"],
[id^="QA"],
[id^="TB"],
#jimu,
#tech,
#else {
  scroll-margin-top: 9.5rem; /* ヘッダー高さ + もう1行分 */
}