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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0a0b;
  color: #e8e8e8;
  min-height: 100vh;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 0;
}

.container {
  width: 100%;
  max-width: 640px;
  flex: 1;
}

/* ヘッダー */
header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  flex-shrink: 0;
}

header h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
}

.subtitle {
  color: #777;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* プラットフォームカード */
.platforms {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.platform-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  background: #141416;
  border: 1px solid #1e1e22;
  border-radius: 10px;
  color: #555;
  font-size: 0.8rem;
  font-weight: 500;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.platform-card svg {
  width: 18px;
  height: 18px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

/* ハイライト状態 */
.platform-card.active {
  border-color: #7c5cfc;
  color: #fff;
  background: #1a1a2e;
}

.platform-card.active svg {
  opacity: 1;
}

/* プラットフォームバッジ（結果カード用） */
.platform-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  color: #fff;
  background: #333;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.platform-badge.tiktok {
  background: #fe2c55;
}

.platform-badge.twitter {
  background: #1d9bf0;
}

.platform-badge.instagram {
  background: #e4405f;
}

/* 入力セクション */
.input-section {
  margin-bottom: 24px;
}

.input-wrapper {
  display: flex;
  gap: 8px;
  background: #141416;
  border: 1px solid #1e1e22;
  border-radius: 12px;
  padding: 6px;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: #7c5cfc;
}

#url-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.95rem;
  padding: 12px;
  outline: none;
}

#url-input::placeholder {
  color: #444;
}

#fetch-btn {
  background: #7c5cfc;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}

#fetch-btn:hover {
  background: #6a4de0;
}

#fetch-btn:active {
  transform: scale(0.97);
}

#fetch-btn:disabled {
  background: #333;
  cursor: not-allowed;
  transform: none;
}

/* エラー */
.error {
  color: #fe2c55;
  font-size: 0.85rem;
  margin-top: 10px;
  padding-left: 4px;
}

/* ローディング */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: #666;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #222;
  border-top-color: #7c5cfc;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 結果カード */
.result-card {
  background: #141416;
  border: 1px solid #1e1e22;
  border-radius: 14px;
  overflow: hidden;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 24px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  padding: 16px 20px 0;
}

.result-content {
  display: flex;
  gap: 20px;
  padding: 12px 20px 20px;
}

.thumbnail-wrapper {
  flex-shrink: 0;
  width: 150px;
  height: 190px;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0a0b;
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.author {
  color: #888;
  font-size: 0.85rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.meta-item {
  color: #666;
  font-size: 0.8rem;
}

.description {
  color: #777;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ダウンロードボタン */
.download-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 14px;
  background: #7c5cfc;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.download-btn:hover {
  background: #6a4de0;
}

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

.download-btn:disabled {
  background: #333;
  cursor: not-allowed;
  transform: none;
}

/* セクション共通 */
.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* 使い方ステップ - カードグリッド */
.how-to {
  margin-top: 48px;
  margin-bottom: 36px;
}

.step-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.step-card {
  background: #141416;
  border: 1px solid #1e1e22;
  border-radius: 12px;
  padding: 20px 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.step-card:hover {
  border-color: #2a2a30;
  transform: translateY(-2px);
}

.step-card-visual {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step-badge {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: #7c5cfc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.step-card h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 6px;
}

.step-card p {
  font-size: 0.78rem;
  color: #666;
  line-height: 1.5;
}

/* 注意事項 */
.notice {
  margin-bottom: 48px;
}

.notice-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notice-list li {
  position: relative;
  padding: 12px 16px 12px 40px;
  background: #141416;
  border: 1px solid #1e1e22;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #888;
  line-height: 1.4;
}

.notice-list li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #555;
  border-radius: 50%;
}

/* フッター */
.footer {
  width: 100%;
  padding: 24px 20px;
  border-top: 1px solid #141416;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.8rem;
  color: #444;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #555;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #999;
}

.footer-link svg {
  width: 16px;
  height: 16px;
}

.footer-divider {
  color: #333;
}

.footer-copy {
  color: #444;
}

/* ユーティリティ */
.hidden {
  display: none !important;
}

/* レスポンシブ */
@media (max-width: 520px) {
  .page-wrapper {
    padding: 24px 16px 0;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .platforms {
    gap: 6px;
  }

  .platform-card {
    padding: 10px 4px;
    font-size: 0.7rem;
    gap: 4px;
  }

  .platform-card svg {
    width: 16px;
    height: 16px;
  }

  .input-wrapper {
    flex-direction: column;
  }

  #fetch-btn {
    width: 100%;
  }

  .result-content {
    flex-direction: column;
    align-items: center;
  }

  .thumbnail-wrapper {
    width: 100%;
    height: 220px;
  }

  .step-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .step-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
  }

  .step-card-visual {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .step-card h4 {
    margin-bottom: 2px;
  }
}
