/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #37352f;
  background: #fff;
}
a { color: #2f80ed; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  background: #f7f6f3;
  border-right: 1px solid #ebebea;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: #37352f;
  padding: 6px 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-title .icon { font-size: 18px; }
.sidebar-search {
  margin: 0 8px 16px 8px;
}
.sidebar-search input {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #e1e1de;
  border-radius: 4px;
  background: #fff;
}
.sidebar-section {
  font-size: 11px;
  font-weight: 600;
  color: #9b9a97;
  padding: 12px 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.nav-list {
  list-style: none;
}
.nav-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 14px;
  color: #37352f;
  border-radius: 4px;
}
.nav-list li a:hover {
  background: #ebebea;
  text-decoration: none;
}
.nav-list li a.active {
  background: #e8e7e3;
  font-weight: 600;
}
.nav-list li a .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ===== Main content ===== */
.main {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 80px 120px;
}
@media (max-width: 900px) {
  .main { padding: 40px 24px 80px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
}

.page-icon {
  font-size: 56px;
  margin-bottom: 12px;
  display: block;
}
.page-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}
.page-subtitle {
  color: #9b9a97;
  font-size: 14px;
  margin-bottom: 32px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-top: 8px;
  border-top: 1px solid #ebebea;
  padding-top: 24px;
}
h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 24px 0 8px;
}
h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 6px;
}
p { margin: 8px 0; }
ul, ol { padding-left: 24px; margin: 8px 0; }
li { margin: 4px 0; }

/* ===== Callout (Notion風コールアウト) ===== */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 4px;
  margin: 16px 0;
  background: #f7f6f3;
}
.callout .callout-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1.4;
}
.callout .callout-body { flex: 1; }
.callout.blue { background: #e7f3f8; }
.callout.green { background: #ddedea; }
.callout.yellow { background: #fbf3db; }
.callout.red { background: #fbe4e4; }
.callout.purple { background: #efe7f3; }
.callout.gray { background: #f1f1ef; }

/* ===== Toggle (折りたたみ) ===== */
details {
  margin: 8px 0;
  padding: 0;
}
details summary {
  cursor: pointer;
  padding: 6px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details summary::before {
  content: "▶";
  font-size: 10px;
  color: #9b9a97;
  transition: transform 0.15s;
}
details[open] summary::before {
  transform: rotate(90deg);
}
details summary::-webkit-details-marker { display: none; }
details > *:not(summary) {
  padding-left: 18px;
}

/* ===== Code / Inline code ===== */
code {
  background: #f1f1ef;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: #eb5757;
}
pre {
  background: #f7f6f3;
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
}
pre code {
  background: none;
  padding: 0;
  color: #37352f;
}

/* ===== Table ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
th, td {
  border: 1px solid #ebebea;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f7f6f3;
  font-weight: 600;
}

/* ===== Cards (DB grid風) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.card {
  display: block;
  padding: 16px;
  border: 1px solid #ebebea;
  border-radius: 6px;
  background: #fff;
  transition: box-shadow 0.15s;
}
.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-decoration: none;
}
.card .card-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}
.card .card-title {
  font-size: 15px;
  font-weight: 600;
  color: #37352f;
  margin-bottom: 4px;
}
.card .card-desc {
  font-size: 12px;
  color: #9b9a97;
  line-height: 1.5;
}

/* ===== Image placeholder ===== */
.img-placeholder {
  background: #f1f1ef;
  border: 1px dashed #c8c8c5;
  border-radius: 6px;
  padding: 40px 20px;
  text-align: center;
  color: #9b9a97;
  font-size: 13px;
  margin: 16px 0;
}
.img-placeholder .ph-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

/* ===== Tag chip ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  margin: 0 2px;
}
.tag-brown { background: #e9e5e3; color: #64473a; }
.tag-purple { background: #efe7f3; color: #6940a5; }
.tag-white { background: #f1f1ef; color: #37352f; }
.tag-blue { background: #e7f3f8; color: #287895; }
.tag-yellow { background: #fbf3db; color: #835011; }
.tag-green { background: #ddedea; color: #2c6b5d; }
.tag-red { background: #fbe4e4; color: #842c2c; }

/* ===== Footer ===== */
.footer-note {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid #ebebea;
  color: #9b9a97;
  font-size: 12px;
}

/* ===== Demo banner ===== */
.demo-banner {
  background: #fff8e1;
  border-bottom: 1px solid #f6d27a;
  padding: 10px 20px;
  text-align: center;
  font-size: 13px;
  color: #835011;
  position: sticky;
  top: 0;
  z-index: 100;
}
