/* ===== CSS カスタムプロパティ（ライト/ダーク共通） ===== */
:root {
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-surface-alt: #f0f0f2;
  --color-border: #d2d2d7;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-accent: #0066cc;
  --color-accent-hover: #004fa3;
  --color-mac: #1d1d1f;
  --color-mac-hover: #3a3a3c;
  --color-win: #0078d4;
  --color-win-hover: #005a9e;
  --color-success-bg: #e8f5e9;
  --color-success-text: #1b5e20;
  --color-fix-bg: #fff8e1;
  --color-fix-text: #5d4037;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-surface: #1c1c1e;
    --color-surface-alt: #2c2c2e;
    --color-border: #3a3a3c;
    --color-text: #f5f5f7;
    --color-text-secondary: #98989d;
    --color-accent: #2997ff;
    --color-accent-hover: #5aafff;
    --color-mac: #3a3a3c;
    --color-mac-hover: #48484a;
    --color-win: #2684d4;
    --color-win-hover: #3a95e0;
    --color-success-bg: #1b3a1e;
    --color-success-text: #81c784;
    --color-fix-bg: #3a2c00;
    --color-fix-text: #ffcc80;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== レイアウト ===== */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== ヘッダー ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 48px 0 40px;
  text-align: center;
}

.site-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.site-header .tagline {
  color: var(--color-text-secondary);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== メインコンテンツ ===== */
main {
  padding: 40px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ===== カード ===== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  margin-bottom: 16px;
}

/* ===== 最新バージョンセクション ===== */
.latest-version {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.version-badge {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.version-date {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* ===== ダウンロードボタン ===== */
.download-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, transform 0.1s ease;
  flex: 1;
  min-width: 180px;
  justify-content: center;
}

.btn-download:active {
  transform: scale(0.98);
}

.btn-mac {
  background: var(--color-mac);
  color: #ffffff;
}

.btn-mac:hover {
  background: var(--color-mac-hover);
}

.btn-windows {
  background: var(--color-win);
  color: #ffffff;
}

.btn-windows:hover {
  background: var(--color-win-hover);
}

.btn-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* ===== リリース履歴 ===== */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.history-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.82rem;
  color: var(--color-accent);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-toggle:hover {
  background: var(--color-surface-alt);
}

/* ===== リリースアイテム ===== */
.release-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.release-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.release-item[hidden] {
  display: none;
}

.release-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: var(--color-surface);
  flex-wrap: wrap;
}

.release-summary::-webkit-details-marker { display: none; }

.release-summary:hover {
  background: var(--color-surface-alt);
}

.release-version {
  font-weight: 700;
  font-size: 1rem;
  min-width: 60px;
}

.release-tag {
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}

.release-date {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  flex: 1;
}

.release-dl-links {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-dl-small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.btn-dl-small.mac { background: var(--color-mac); }
.btn-dl-small.win { background: var(--color-win); }

/* ===== リリースノート（開閉コンテンツ） ===== */
.release-notes {
  padding: 20px 20px 20px 20px;
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notes-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.notes-section.features h4 {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.notes-section.fixes h4 {
  background: var(--color-fix-bg);
  color: var(--color-fix-text);
}

.notes-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notes-section li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.notes-section li::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 7px;
}

.notes-section.features li::before { background: var(--color-success-text); }
.notes-section.fixes li::before { background: var(--color-fix-text); }

/* ===== フッター ===== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.site-footer a {
  color: var(--color-accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ===== エラー表示 ===== */
.error-message {
  text-align: center;
  padding: 40px;
  color: var(--color-text-secondary);
}

/* ===== レスポンシブ ===== */
@media (max-width: 520px) {
  .card { padding: 24px 20px; }

  .download-buttons {
    flex-direction: column;
  }

  .btn-download {
    min-width: unset;
  }

  .release-summary {
    flex-wrap: wrap;
    gap: 8px;
  }

  .release-dl-links {
    width: 100%;
  }

  .btn-dl-small {
    flex: 1;
    justify-content: center;
  }
}
