/* シリーズ永続ページ・シリーズ一覧ページ共通スタイルシート */
:root {
  --header-bg: #2a2421;
  --header-border: #1e1916;
  --header-btn-bg: #3d3430;
  --header-btn-border: #524742;
  --bg-page: #f6f4f1;
  --bg-card: #ffffff;
  --text-main: #2a2421;
  --text-muted: #736b66;
  --text-light: #8c827a;
  --border-color: #e5dfda;
  --border-subtle: #eeebe5;
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-soft: #fef3c7;
  --accent-border: #fcd34d;
  --amazon-orange: #ff9900;
  --amazon-btn: #ffd814;
  --amazon-btn-hover: #f7ca00;
  --amazon-btn-text: #0f1111;
  --badge-sale-bg: #fef2f2;
  --badge-sale-text: #b91c1c;
  --badge-sale-border: #fecaca;
  --active-green: #15803d;
  --active-bg: #dcfce7;
  --radius-sm: 6px;
  --radius-md: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --header-bg: #1e1916;
    --header-border: #14100e;
    --header-btn-bg: #2a2421;
    --header-btn-border: #3d3430;
    --bg-page: #171412;
    --bg-card: #231f1c;
    --text-main: #f5f2ef;
    --text-muted: #a89f99;
    --text-light: #857a70;
    --border-color: #38312c;
    --border-subtle: #2b2420;
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --accent-soft: #382513;
    --accent-border: #78350f;
    --amazon-btn: #ffd814;
    --amazon-btn-hover: #f7ca00;
    --badge-sale-bg: #450a0a;
    --badge-sale-text: #fca5a5;
    --badge-sale-border: #7f1d1d;
    --active-green: #4ade80;
    --active-bg: #143820;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  padding: 0 0 40px;
}
.series-header-bar {
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-border);
  color: #fff;
  padding: 16px 20px 14px;
  margin-bottom: 24px;
}
.series-header-bar .container {
  padding: 0;
}
.header-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}
.btn-back-top,
.btn-portal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--header-btn-bg);
  border: 1px solid var(--header-btn-border);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 6px;
  transition: background 0.15s;
}
.btn-back-top:hover,
.btn-portal-back:hover {
  background: var(--header-btn-border);
  text-decoration: none;
}
.breadcrumbs {
  font-size: 0.85rem;
  color: #b8aba3;
  margin: 0;
}
.breadcrumbs a {
  color: #f3edea;
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
  color: #fff;
}
.breadcrumbs span {
  color: #d7ccc8;
}
.breadcrumbs span.current {
  color: #f59e0b;
  font-weight: 600;
}
.header-notice {
  font-size: 11.5px;
  line-height: 1.45;
  color: #b8aba3;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}
body[data-page-type="series_index"] .container {
  max-width: 960px;
}

/* シリーズ詳細ページ固有 */
.series-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.series-cover {
  width: 140px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.series-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}
.series-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  color: var(--text-main);
}
.series-meta-row {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.btn-amazon-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amazon-btn);
  color: var(--amazon-btn-text);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 16px;
  border: 1px solid #d5d9d9;
  box-shadow: 0 2px 5px rgba(213,217,217,.5);
  transition: background 0.2s;
}
.btn-amazon-buy:hover {
  background: var(--amazon-btn-hover);
}
.active-sale-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.badge-now-on-sale {
  display: inline-block;
  background: var(--badge-sale-bg);
  color: var(--badge-sale-text);
  border: 1px solid var(--badge-sale-border);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.badge-neutral {
  display: inline-block;
  background: var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.active-sale-desc {
  font-size: 0.95rem;
}
.active-sale-desc a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 700;
}
.active-sale-desc a:hover {
  color: var(--accent-hover);
}
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  color: var(--text-main);
}
.history-list {
  list-style: none;
}
.history-item {
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  display: grid;
  grid-template-columns: minmax(165px, auto) minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
}
.history-item:last-child {
  border-bottom: none;
}
.history-meta {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 165px;
  padding-top: 2px;
}
.history-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.badge-active {
  background: var(--badge-sale-bg);
  color: var(--badge-sale-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--badge-sale-border);
}
.badge-past {
  background: rgba(115, 107, 102, 0.1);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.history-title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.history-link {
  color: var(--accent);
  text-decoration: none;
}
.history-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}
.history-discount {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  font-size: 0.9rem;
  font-weight: 700;
  color: #cc0c39;
}
.history-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px 0;
}
.history-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* シリーズ一覧ページ固有 */
.page-head { margin-bottom: 20px; }
.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.page-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.filter-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-light);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}
.search-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.syllabary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 28px;
  position: sticky;
  top: 12px;
  z-index: 20;
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-item .nav-cnt {
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--text-light);
}
.nav-item.empty {
  color: var(--text-light);
  opacity: 0.45;
  cursor: default;
}
.syllabary-section {
  margin-bottom: 32px;
  scroll-margin-top: 80px;
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
body[data-page-type="series_index"] .section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  border-left: none;
  padding-left: 0;
  margin-bottom: 0;
}
.section-count {
  font-size: 0.85rem;
  color: var(--text-light);
}
.series-list {
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.series-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  transition: background 0.15s;
}
.series-row:last-child {
  border-bottom: none;
}
.series-row:hover {
  background: rgba(180, 83, 9, 0.03);
}
.series-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 300px;
}
.series-title-link {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
}
.series-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
body[data-page-type="series_index"] .badge-active {
  background: var(--active-bg);
  color: var(--active-green);
  border: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.series-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.total-vols {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
footer a {
  color: var(--accent);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* セール開催履歴 集計サマリ (T-045 Phase 3) */
.history-summary {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}
.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.history-summary-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
}
.history-summary-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.history-summary-value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.history-summary-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.history-summary-lead {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 600px) {
  .history-summary-grid {
    grid-template-columns: 1fr;
  }
  .series-header-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .series-cover {
    width: 120px;
    height: 170px;
  }
  .btn-amazon-buy {
    width: 100%;
  }
  .history-item {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .history-meta,
  .history-title,
  .history-discount {
    grid-column: 1;
    grid-row: auto;
  }
  .header-nav-row {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}
