/* ===== Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #1c1917;
  --color-text-muted: #78716c;
  --color-accent: #d97706;
  --color-accent-light: #fef3c7;
  --color-border: #e7e5e4;
  --color-link: #b45309;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Meiryo", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

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

a:hover {
  text-decoration: underline;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 32px 0;
  margin-bottom: 32px;
}

.site-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-description {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.site-meta {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

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

/* ===== Category Nav ===== */
.category-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.category-label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
}

.category-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
  cursor: grab;
}

.category-scroll.dragging {
  cursor: grabbing;
  user-select: none;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  white-space: nowrap;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.chip-count {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.5;
}

.category-chip:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
}

.category-chip.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  text-decoration: none;
}

.category-chip.active .chip-count {
  opacity: 0.8;
}

.filter-status {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

/* ===== Article Card ===== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.article-card:hover {
  box-shadow: var(--shadow-lg);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.article-category {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.article-meta time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.article-source {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.article-source.source-anthropic {
  background: #f5f5f4;
  color: #57534e;
  border-color: #d6d3d1;
}

.article-source.source-claude {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.article-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.5;
}

.article-title a {
  color: var(--color-text);
}

.article-title a:visited {
  color: var(--color-text-muted);
}

.article-title a:hover {
  color: var(--color-link);
  text-decoration: none;
}

.article-summary {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.7;
}

.article-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.point {
  font-size: 0.8rem;
  color: var(--color-text);
  background: var(--color-bg);
  padding: 4px 10px;
  border-radius: 8px;
}

.article-footer {
  display: flex;
  gap: 16px;
  align-items: center;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-link);
}

.original-link {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ===== Article Detail ===== */
.article-detail {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.article-detail-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
}

.original-title {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.article-section {
  margin-bottom: 28px;
}

.article-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}

.article-body {
  font-size: 0.95rem;
  line-height: 2;
  color: var(--color-text);
}

.points-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.points-list li {
  padding: 12px 16px;
  background: var(--color-bg);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.7;
  position: relative;
  padding-left: 36px;
}

.points-list li::before {
  content: "✅";
  position: absolute;
  left: 12px;
}

.analogy-section {
  background: var(--color-accent-light);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.analogy-text {
  font-size: 0.95rem;
  line-height: 1.9;
}

.article-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 40px 0 8px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}

.pg-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pg-num,
.pg-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  background: transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  user-select: none;
}

.pg-num:hover,
.pg-arrow:hover:not(.disabled) {
  background: var(--color-bg);
  color: var(--color-accent);
  text-decoration: none;
}

.pg-num.active {
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
  cursor: default;
}

.pg-arrow {
  color: var(--color-text-muted);
}

.pg-arrow:hover:not(.disabled) {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.pg-arrow.disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 40px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  letter-spacing: 2px;
  user-select: none;
}

@media (max-width: 600px) {
  .pg-num,
  .pg-arrow {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  margin-top: 40px;
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .site-title {
    font-size: 1.3rem;
  }

  .article-detail {
    padding: 24px 16px;
  }

  .article-detail-title {
    font-size: 1.3rem;
  }

  .article-actions {
    flex-direction: column;
  }

  .btn {
    text-align: center;
  }
}
