/* Default Theme - Minimal */
:root {
  --color-text: #333;
  --color-bg: #fff;
  --color-link: #0066cc;
  --color-link-hover: #004499;
  --color-border: #e0e0e0;
  --color-code-bg: #f5f5f5;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 800px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

.container { max-width: var(--max-width); margin: 0 auto; }

h1, h2, h3, h4, h5, h6 { margin-top: 1.5em; margin-bottom: 0.5em; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--color-code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
}

pre code { background: none; padding: 0; }

blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--color-border);
  color: #666;
}

table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { padding: 0.5rem; border: 1px solid var(--color-border); text-align: left; }
th { background: var(--color-code-bg); }

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

.top-nav {
  margin: 0;
  padding: 0.5rem 0.75rem;
}

.hidden,
.search-modal.hidden {
  display: none !important;
}

footer,
.site-footer {
  background: #1f1f1f;
  color: #f5f5f5;
  font-size: 0.75rem;
  text-align: center;
  margin: 0;
  padding: 0.5rem 1rem;
  border-radius: 0;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}

/* =====================================================
   Page List — page-list.html 専用レイアウト
   ===================================================== */
.page-list-header { padding: 2rem 1.5rem 1rem; max-width: 640px; margin: 0 auto; }
.page-list-header h1 { margin: 0; font-size: 1.4rem; font-weight: 600; color: #fff; }
.page-list-container { max-width: 640px; margin: 0 auto; padding: 0 1.5rem 2rem; }
.page-list-loading { text-align: center; color: #888; padding: 2rem 0; }
.page-list-footer { max-width: 640px; margin: 0 auto; padding: 1rem 1.5rem 2rem; text-align: center; font-size: 0.8rem; color: #555; }

/* =====================================================
   Search Modal
   ===================================================== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.search-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.search-modal__content {
  position: relative;
  width: min(560px, 100%);
  max-height: min(620px, calc(100vh - 2rem));
  overflow: auto;
  padding: 1.25rem;
  background: var(--blog-surface, var(--color-bg));
  color: var(--blog-text, var(--color-text));
  border: 1px solid var(--blog-border, var(--color-border));
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.search-modal__content h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-result-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--blog-border, var(--color-border));
}

.search-result-list li:last-child {
  border-bottom: 0;
}

.search-hint {
  margin: 1rem 0 0;
  color: var(--blog-text-muted, #666);
  font-size: 0.9rem;
}

.search-modal__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.search-modal__actions button {
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  color: var(--blog-text, var(--color-text));
  background: transparent;
  border: 1px solid var(--blog-border, var(--color-border));
  border-radius: 6px;
  cursor: pointer;
}

.search-modal__actions button:hover {
  background: rgba(127, 127, 127, 0.12);
}

/* =====================================================
   Page Counter Menu / Page List Popup
   ===================================================== */
.pc-menu { position: fixed; right: 12px; bottom: 60px; z-index: 10000; min-width: 180px; background: #f5f5f5; color: #333; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); padding: 0.35rem 0; }
.pc-menu.hidden { display: none; }
.pc-menu__item { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.85rem; border: none; background: none; color: #333; font-size: 0.85rem; cursor: pointer; text-align: left; }
.pc-menu__item:hover { background: rgba(0,0,0,0.06); }
.pc-menu__icon { font-size: 1rem; flex-shrink: 0; }
.pc-menu__label { flex: 1; font-weight: 500; }
.pc-menu__count { font-size: 0.75rem; color: #888; }

.page-list-popup { position: fixed; right: 12px; bottom: 60px; z-index: 10000; width: 340px; height: 360px; display: flex; flex-direction: column; overflow: hidden; background: #1a1a1a; color: #e0e0e0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.page-list-popup.hidden { display: none; }
.page-list-popup__header { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.08); background: #1a1a1a; z-index: 1; }
.page-list-popup__title { font-size: 0.85rem; font-weight: 600; color: #fff; }
.page-list-popup__close { background: none; border: none; color: #888; font-size: 1rem; cursor: pointer; padding: 0.15rem 0.4rem; border-radius: 4px; }
.page-list-popup__close:hover { color: #fff; background: rgba(255,255,255,0.1); }
.page-list-popup__body { flex: 1; min-height: 0; padding: 0.25rem 0; overflow-y: auto; }

.page-list__items { list-style: none; padding: 0; margin: 0; }
.page-list__item { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.45rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.page-list__item:last-child { border-bottom: none; }
.page-list__page-no { flex-shrink: 0; width: 2rem; font-size: 0.8rem; color: #888; }
.page-list__page-info { flex: 1; min-width: 0; }
.page-list__page-title { font-size: 0.85rem; color: #ddd; word-break: break-word; }
.page-list__page-title a { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,0.3); }
.page-list__page-title a:hover { border-bottom-color: #6fc3df; }
.page-list__item:not(.is-visited) .page-list__page-title { color: #555; font-style: italic; }
.page-list__page-meta { font-size: 0.75rem; color: #666; margin-top: 0.1rem; }
.page-list__page-check { flex-shrink: 0; width: 1.2rem; text-align: center; color: #6fc3df; font-size: 0.85rem; }

@media (max-width: 480px) {
  .page-list-header { padding: 1.5rem 1rem 0.75rem; }
  .page-list-container { padding: 0 1rem 1.5rem; }
  .page-list-header h1 { font-size: 1.2rem; }
  .page-list-popup { right: 8px; left: 8px; width: auto; height: 70vh; bottom: 44px; }
  .page-list__item { gap: 0.4rem; padding: 0.4rem 0.6rem; }
  .page-list__page-no { width: 1.8rem; font-size: 0.75rem; }
}