﻿/* ─── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: #fff7ed;
  color: #1c1917;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────── */
header {
  background: #ea580c;
  color: #fff;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(234,88,12,.35);
}
.header-inner { max-width: 1000px; width: 100%; margin: 0 auto; }
.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }

/* ─── Main ───────────────────────────────────────── */
main { max-width: 1000px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }

/* ─── Hero ───────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 1.25rem; }
.hero-icon { font-size: 3rem; margin-bottom: .5rem; }
.hero h1 { font-size: 1.75rem; font-weight: 800; color: #ea580c; margin-bottom: .5rem; }
.description { color: #57534e; font-size: .95rem; line-height: 1.7; }

/* ─── Mode Tabs ──────────────────────────────────── */
.mode-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
}
.mode-tab {
  padding: .55rem 1.2rem;
  border: 2px solid #e7e5e4;
  border-radius: 999px;
  background: #fff;
  color: #57534e;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
}
.mode-tab:hover  { border-color: #ea580c; color: #ea580c; }
.mode-tab.active { background: #ea580c; border-color: #ea580c; color: #fff; }

/* ─── Converter Layout ───────────────────────────── */
.converter-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

/* ─── Pane ───────────────────────────────────────── */
.pane {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid #fed7aa;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .85rem;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  flex-wrap: wrap;
}
.pane-label {
  font-size: .82rem;
  font-weight: 700;
  color: #ea580c;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pane-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

/* ─── Pane Buttons ───────────────────────────────── */
.pane-btn {
  padding: .28rem .7rem;
  border: 1.5px solid #e7e5e4;
  border-radius: 6px;
  background: #fff;
  color: #57534e;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.pane-btn:hover { border-color: #ea580c; color: #ea580c; }
.pane-btn.copied { border-color: #22c55e; color: #16a34a; }

/* ─── View Toggle (Source / Preview) ────────────── */
.view-toggle {
  display: flex;
  border: 1.5px solid #e7e5e4;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.view-btn {
  padding: .28rem .65rem;
  border: none;
  background: transparent;
  color: #78716c;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.view-btn + .view-btn { border-left: 1px solid #e7e5e4; }
.view-btn.active { background: #ea580c; color: #fff; }

/* ─── Textarea ───────────────────────────────────── */
.pane-textarea {
  width: 100%;
  height: 380px;
  min-height: 200px;
  resize: vertical;
  border: none;
  outline: none;
  padding: .85rem 1rem;
  font-family: 'SFMono-Regular', 'Consolas', 'Menlo', 'Monaco', monospace;
  font-size: .85rem;
  line-height: 1.65;
  color: #1c1917;
  background: #fff;
  tab-size: 2;
}
.pane-textarea::placeholder { color: #c4b5a5; }

/* ─── Output (source) ───────────────────────────── */
.pane-output {
  height: 380px;
  overflow: auto;
  flex: 1;
}
.output-pre {
  margin: 0;
  padding: .85rem 1rem;
  font-family: 'SFMono-Regular', 'Consolas', 'Menlo', 'Monaco', monospace;
  font-size: .84rem;
  line-height: 1.65;
  color: #292524;
  background: #fafaf9;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 100%;
}

/* ─── Preview ────────────────────────────────────── */
.pane-preview {
  background: #fff;
}
.markdown-body {
  padding: 1rem 1.25rem;
  font-size: .9rem;
  line-height: 1.75;
  color: #1c1917;
}

/* Markdown プレビュー タイポグラフィ */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-weight: 700;
  margin-top: 1.25em;
  margin-bottom: .5em;
  line-height: 1.3;
  color: #1c1917;
}
.markdown-body h1 { font-size: 1.6rem; border-bottom: 2px solid #fed7aa; padding-bottom: .3em; }
.markdown-body h2 { font-size: 1.3rem; border-bottom: 1px solid #e7e5e4; padding-bottom: .2em; }
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body h4 { font-size: 1rem; }
.markdown-body h5, .markdown-body h6 { font-size: .9rem; }

.markdown-body p { margin-bottom: .85em; }

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.5em;
  margin-bottom: .85em;
}
.markdown-body li { margin-bottom: .2em; }
.markdown-body li > ul,
.markdown-body li > ol { margin-bottom: 0; }

.markdown-body blockquote {
  margin: .85em 0;
  padding: .5em 1em;
  border-left: 4px solid #ea580c;
  background: #fff7ed;
  color: #57534e;
  border-radius: 0 6px 6px 0;
}
.markdown-body blockquote p { margin-bottom: 0; }

.markdown-body pre {
  background: #1c1917;
  border-radius: 8px;
  padding: .85em 1em;
  overflow-x: auto;
  margin-bottom: .85em;
}
.markdown-body pre code {
  font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
  font-size: .82rem;
  color: #e7e5e4;
  background: none;
  padding: 0;
  border-radius: 0;
}
.markdown-body code {
  font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
  font-size: .85em;
  background: #fff7ed;
  color: #c2410c;
  padding: .15em .35em;
  border-radius: 4px;
  border: 1px solid #fed7aa;
}

.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: .85em;
  font-size: .875rem;
}
.markdown-body th,
.markdown-body td {
  border: 1px solid #e7e5e4;
  padding: .45em .7em;
  text-align: left;
}
.markdown-body th {
  background: #ea580c;
  color: #fff;
  font-weight: 700;
}
.markdown-body tr:nth-child(even) td { background: #fff7ed; }

.markdown-body a {
  color: #ea580c;
  text-decoration: none;
}
.markdown-body a:hover { text-decoration: underline; }

.markdown-body hr {
  border: none;
  border-top: 2px solid #e7e5e4;
  margin: 1.25em 0;
}

.markdown-body img {
  max-width: 100%;
  border-radius: 6px;
}

/* ─── Pane Footer ────────────────────────────────── */
.pane-footer {
  padding: .35rem .85rem;
  background: #fafaf9;
  border-top: 1px solid #f5f5f4;
  display: flex;
  justify-content: flex-end;
}
.char-count,
.line-count {
  font-size: .75rem;
  color: #a8a29e;
}

/* ─── Info Card ──────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
  padding: 1.5rem;
  margin-top: .5rem;
  box-shadow: 0 2px 8px rgba(234,88,12,.07);
}
.card h2 { font-size: 1.1rem; font-weight: 700; color: #ea580c; margin-bottom: .75rem; }
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item  { display: flex; gap: .75rem; }
.tip-icon  { font-size: 1.5rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .2rem; font-size: .9rem; }
.tip-text p { font-size: .82rem; color: #78716c; line-height: 1.5; }

/* ─── Footer ─────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: .82rem;
  color: #a8a29e;
  border-top: 1px solid #e7e5e4;
  margin-top: auto;
}
footer a { color: #ea580c; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: .3rem; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 720px) {
  .converter-layout {
    grid-template-columns: 1fr;
  }
  .pane-textarea,
  .pane-output { height: 280px; }
}
@media (max-width: 600px) {
  .tips-grid { grid-template-columns: 1fr; }
  .pane-header { gap: .3rem; }
  .view-toggle { font-size: .74rem; }
}

/* ━━━ Amazonおすすめ ━━━ */
.amazon-card h2 { margin-bottom: 0.25rem; }
.amazon-note { font-size: 0.82rem; color: #999; margin-bottom: 1rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.amazon-item {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.amazon-item:hover {
  border-color: #FF9900;
  box-shadow: 0 2px 8px rgba(255,153,0,0.15);
  transform: translateY(-1px);
}
.amazon-item-icon { font-size: 1.7rem; margin-bottom: 0.35rem; }
.amazon-item-name { font-size: 0.88rem; font-weight: bold; margin-bottom: 0.2rem; }
.amazon-item-desc { font-size: 0.76rem; color: #888; line-height: 1.5; margin-bottom: 0.45rem; }
.amazon-item-link { font-size: 0.78rem; color: #FF9900; font-weight: bold; }

.amazon-notice {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 0.2rem;
}

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #ea580c; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }

/* ━━━ ヒーローバッジ ━━━ */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.badge {
  display: inline-block;
  padding: 5px 13px;
  background: #fff7ed;
  color: #ea580c;
  border: 1.5px solid #fed7aa;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ━━━ 活用シーン ━━━ */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.scene-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
}
.scene-icon { font-size: 1.7rem; flex-shrink: 0; }
.scene-body strong { display: block; font-size: .88rem; font-weight: 700; color: #ea580c; margin-bottom: .2rem; }
.scene-body p { font-size: .78rem; color: #78716c; line-height: 1.55; margin: 0; }

/* ━━━ 関連ツール ━━━ */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.related-tool-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #ea580c; box-shadow: 0 2px 8px rgba(234,88,12,.12); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #ea580c; margin-bottom: .2rem; }
.related-tool-item p { font-size: .76rem; color: #78716c; line-height: 1.5; margin: 0; }

@media (max-width: 600px) {
  .scene-grid { grid-template-columns: 1fr; }
  .related-tools { grid-template-columns: 1fr; }
}
