@charset "UTF-8";

:root {
  --bg-color: #121417;
  --card-bg: #1c1f24;
  --text-primary: #ddd;
  --text-secondary: #8b949e;
  --border-color: #30363d;
  --accent-color: #58a6ff;
  --link-color: #79c0ff;
  --btn-hover: #262c36;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.85;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 18px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.series-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: normal;
}

/* table of contents button */
.toc-trigger-btn {
  background-color: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s;
}

.toc-trigger-btn:hover {
  background-color: var(--btn-hover);
  border-color: var(--text-secondary);
}

.page-title {
  font-size: 1.6rem;
  line-height: 1.4;
  margin-top: 8px;
  color: #ddd;
}

/* 16:9 main visual */
.main-visual {
  width: 100%;
  margin-bottom: 24px;
}

.main-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

article {
  word-break: break-word;
}

h2 {
  font-size: 1.25rem;
  margin: 44px 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--accent-color);
  color: #ddd;
}

p {
  margin-bottom: 1.5em;
}

ul {
  margin: 0 0 1.5em 20px;
}

li {
  margin-bottom: 0.6em;
}

strong {
  color: #fdd;
}

a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 40px 0;
}

/* dialogue layout */
.dialogue-thread {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.chat-block {
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
}

/* 【I】area */
.chat-block.user {
  border-color: #3b4252;
  background-color: #161b22;
}

/* 【Gemini】area */
.chat-block.assistant {
  border-color: #234165;
  background-color: #0d1b2a;
}

.speaker-label {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.chat-block.user .speaker-label {
  color: #79c0ff;
}

.chat-block.assistant .speaker-label {
  color: #7ee787;
}

.chat-content > *:last-child {
  margin-bottom: 0;
}

/* sources */
.source-list {
  font-size: 0.9rem;
  color: var(--text-primary);
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 20px 24px;
  border-radius: 8px;
  margin-top: 36px;
}

.source-list-title {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 16px;
  color: #ddd;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.source-list ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.source-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.source-list a {
  font-weight: bold;
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-list a:hover {
  text-decoration: none;
}

.source-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 2px;
}

/* SNS buttons */
.sns-share {
  margin-top: 40px;
  padding: 20px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
}

.share-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  min-height: 40px;
  min-width: 100px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.2s, background-color 0.2s;
}

.share-btn:hover {
  opacity: 0.85;
}

.share-btn.x-btn {
  background-color: #000000;
  color: #ddd;
  border-color: #444;
}

.share-btn.line-btn {
  background-color: #06c755;
  color: #ddd;
}

.share-btn.copy-btn {
  background-color: #21262d;
  color: var(--text-primary);
  border-color: var(--border-color);
  font-family: inherit;
}

.share-btn.copy-btn.copied {
  background-color: #238636;
  color: #ddd;
  border-color: #2ea043;
}

/* page navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  min-height: 48px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--card-bg);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  flex: 1;
  transition: background-color 0.2s, border-color 0.2s;
}

.nav-btn.prev {
  text-align: left;
}

.nav-btn.next {
  text-align: right;
}

.nav-btn:hover {
  background-color: var(--btn-hover);
  border-color: var(--text-secondary);
}

.nav-btn.disabled {
  visibility: hidden;
}

/* outer contents list */
.toc-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.toc-modal.active {
  opacity: 1;
  visibility: visible;
}

.toc-container {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  border-radius: 12px 12px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

@media (min-width: 601px) {
  .toc-modal {
    align-items: center;
  }
  .toc-container {
    border-radius: 8px;
    max-height: 70vh;
  }
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.toc-title {
  font-weight: bold;
  font-size: 1rem;
  color: #ddd;
}

.toc-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.toc-close-btn:hover {
  color: var(--text-primary);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.toc-list li {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}

.toc-list li a {
  display: block;
  padding: 14px 18px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.15s;
}

.toc-list li a:hover,
.toc-list li a:active {
  background-color: var(--btn-hover);
  color: var(--link-color);
}

/* footer */
footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

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

/* smartphone */
@media (max-width: 600px) {
  .container {
    padding: 20px 16px 60px;
  }

  .page-title {
    font-size: 1.35rem;
  }

  h2 {
    font-size: 1.15rem;
    margin-top: 36px;
  }
}

/* amazon */
.recommend-box {
  margin-top: 40px;
  padding: 16px 20px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.recommend-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.recommend-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--text-primary);
}

.recommend-link:hover .recommend-title {
  color: var(--link-color);
}

.recommend-title {
  font-size: 0.95rem;
  font-weight: bold;
  line-height: 1.5;
}

.recommend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background-color: #f08804;
  color: #111;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.recommend-link:hover .recommend-btn {
  opacity: 0.85;
}

@media (max-width: 600px) {
  .recommend-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .recommend-btn {
    width: 100%;
  }
}

    /* 404ページ用の固有配置調整 */
    .error-container {
      text-align: center;
      padding-top: 40px;
    }
    .error-title {
      font-size: 3rem;
      margin-bottom: 24px;
      color: #ddd;
    }
    .error-visual {
      max-width: 640px;
      margin: 0 auto 24px;
    }
    .error-message {
      font-size: 1.05rem;
      margin-bottom: 12px;
      color: var(--text-primary);
    }
    .error-link {
      font-size: 1.05rem;
      margin-bottom: 40px;
    }