:root {
  --bg-h: 210;
  --bg-s: 50%;
  --bg-l: 98%;
  --bg: hsl(var(--bg-h), var(--bg-s), var(--bg-l));
  --surface: hsla(0, 0%, 100%, 0.7);
  --surface-strong: #ffffff;
  --line: hsla(210, 30%, 90%, 0.8);
  --text: hsl(210, 30%, 20%);
  --text-muted: hsl(210, 15%, 45%);
  --heading: hsl(210, 40%, 12%);
  --primary: hsl(206, 100%, 50%);
  --primary-glow: hsla(206, 100%, 50%, 0.15);
  --primary-strong: hsl(206, 100%, 40%);
  --primary-soft: hsl(206, 100%, 96%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 12px 24px -8px rgba(0, 40, 80, 0.12);
  --shadow-lg: 0 32px 64px -16px rgba(0, 40, 80, 0.18);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --glass-blur: 12px;
  font-family: "IBM Plex Sans JP", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(62, 168, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f5faff 100%);
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.shell {
  width: min(100% - 20px, 860px);
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero,
.card,
.article-shell {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hero {
  padding: 28px;
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
}

.hero-link,
.eyebrow,
.meta-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-link,
.eyebrow {
  color: var(--primary-strong);
  font-size: 0.74rem;
  font-weight: 800;
}

.eyebrow {
  margin-top: 10px;
}

.hero h1,
.article-title {
  margin-top: 12px;
  color: var(--heading);
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-copy,
.article-lead,
.article-body p,
.article-body li {
  margin-top: 16px;
  color: var(--text-muted);
  line-height: 1.9;
  font-size: 1rem;
}

.article-dek {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.article-serial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.layout {
  display: grid;
  gap: 16px;
}

.card,
.article-shell {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2,
.article-body h2 {
  margin-top: 8px;
  color: var(--heading);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-box,
.latest-box,
.archive-item,
.article-meta-item,
.source-item {
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.stat-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.stat-box strong {
  display: block;
  margin-top: 4px;
  color: var(--heading);
  font-family: "Manrope", sans-serif;
  font-size: 1.2rem;
}

.stat-box span,
.meta-label {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.latest-box {
  padding: 20px;
  border-radius: var(--radius-md);
}

.card-link-box {
  display: block;
  color: inherit;
  cursor: pointer;
}

.card-link-box:hover {
  text-decoration: none;
}

.latest-box h3,
.archive-item h3 {
  color: var(--heading);
  font-size: 1.2rem;
  line-height: 1.45;
}

.article-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.serial-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.article-meta,
.archive-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.rank-label {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
}

.rank-label::before {
  content: "Rank ";
}

.latest-box p,
.archive-item p {
  margin-top: 12px;
  color: var(--text-muted);
  line-height: 1.85;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 16px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.archive-list {
  display: grid;
  gap: 12px;
}

.archive-item {
  padding: 18px;
  border-radius: var(--radius-md);
}

.article-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.article-card-link {
  flex: 1;
  min-width: 0;
}

.star-toggle {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  box-shadow: none;
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.star-toggle:hover {
  transform: translateY(-1px);
  color: #64748b;
  background: transparent;
}

.star-toggle:focus,
.star-toggle:active {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  box-shadow: none;
  outline: none;
}

.star-toggle.is-active {
  color: #f59e0b;
  background: transparent;
}

.footer {
  padding: 12px 2px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.article-shell {
  width: min(100% - 20px, 860px);
  margin: 24px auto 40px;
}

.article-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.article-back {
  font-size: 0.9rem;
  font-weight: 700;
}

.article-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.article-meta-item,
.source-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.article-meta-item strong {
  display: block;
  margin-top: 4px;
  color: var(--heading);
}

.article-body {
  margin-top: 28px;
}

.article-body h2 {
  margin-top: 28px;
}

.article-body ul {
  padding-left: 20px;
}

.article-body a {
  word-break: break-word;
}

/* Monitor Specific Styles */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent, var(--primary));
  opacity: 0.6;
}

.tool-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent, var(--primary));
}

.tool-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Manrope", sans-serif;
}

.tool-status {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.changelog-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.94rem;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.changelog-item {
  position: relative;
  padding-left: 18px;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.6;
}

.changelog-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent, var(--primary));
  font-weight: bold;
}

.changelog-date {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.tool-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.latest-tag {
  font-family: "Manrope", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-strong);
}

.status-tag {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  border: 1px solid var(--primary-glow);
}

/* Tool Specific Accents */
.card-claudecode  { --accent: #d97706; }
.card-antigravity { --accent: #7c3aed; }
.card-cursor      { --accent: #2563eb; }
.card-windsurf    { --accent: #0891b2; }
.card-cline       { --accent: #db2777; }
.card-geminicli   { --accent: #4f46e5; }
.card-copilot     { --accent: #000000; }
.card-codex       { --accent: #059669; }
.card-openclaw    { --accent: #e11d48; }
.card-chatgpt     { --accent: #10a37f; }
.card-gemini      { --accent: #1a73e8; }
.card-claude      { --accent: #c96442; }
.card-grok        { --accent: #1d1d1d; }
.card-grokcli     { --accent: #4b5563; }
.card-genspark    { --accent: #f59e0b; }
.card-perplexity  { --accent: #20b2aa; }
.card-aistudio    { --accent: #4285f4; }
.card-notebooklm  { --accent: #34a853; }
.card-obsidian    { --accent: #7c3aed; }

@media (max-width: 720px) {
  .shell {
    width: 100%;
    padding: 12px 0 24px;
  }

  .article-shell {
    width: 100%;
    margin: 0 auto 24px;
  }

  .hero,
  .card,
  .article-shell {
    padding: 20px 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .hero {
    margin-bottom: 8px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-copy {
    font-size: 0.92rem;
    margin-top: 10px;
  }

  .layout {
    gap: 8px;
  }

  .section-head h2 {
    font-size: 1.2rem;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-box {
    padding: 10px 8px;
  }

  .stat-box strong {
    font-size: 1rem;
  }

  .article-meta-grid {
    grid-template-columns: 1fr;
  }

  .article-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .archive-item {
    padding: 14px;
    border-radius: var(--radius-sm);
  }

  .latest-box {
    padding: 14px;
  }

  .article-card-head {
    gap: 10px;
  }

  .star-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .tool-card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .tool-name {
    font-size: 1.15rem;
  }

  .footer {
    padding: 8px 16px 0;
  }
}

/* Top Navigation */
.top-nav {
  position: sticky;
  top: 0;
  background: #f8fafc;
  display: flex;
  justify-content: stretch;
  align-items: center;
  gap: 0;
  z-index: 100;
  border-bottom: 1px solid #e2e8f0;
  padding: 6px 8px;
}
.top-nav .nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 4px;
  text-decoration: none;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 8px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.top-nav .nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}
.top-nav .nav-item.active {
  font-weight: 700;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  border-color: currentColor;
}

/* 各タブ固有の色 */
.top-nav .nav-item[href="./index.html"]            { color: #1e293b; }
.top-nav .nav-item[href="./github-trend.html"]     { color: #0969da; }
.top-nav .nav-item[href="./ai-tools-monitor.html"] { color: #7c3aed; }
.top-nav .nav-item[href="./my-tools.html"]         { color: #059669; }
.top-nav .nav-item[href="./links.html"]            { color: #d97706; }

/* Page Theme Colors */
.theme-home   { --theme-color: #1e293b; --hero-bg: #f1f5f9; }
.theme-github { --theme-color: #0969da; --hero-bg: #dbeafe; }
.theme-aitools { --theme-color: #7c3aed; --hero-bg: #ede9fe; }
.theme-project { --theme-color: #059669; --hero-bg: #d1fae5; }
.theme-bookmark { --theme-color: #d97706; --hero-bg: #fef3c7; }

[class^="theme-"] .hero {
  background: var(--hero-bg);
  border-color: transparent;
}

[class^="theme-"] .hero .eyebrow,
[class^="theme-"] .hero .hero-link {
  color: var(--theme-color);
}


/* =====================================================
   Tool Card Accordion
   ===================================================== */

/* Single-column list layout for accordion */
.tool-grid:has(details.tool-card) {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 20px;
}

/* Reset card padding — summary handles it */
details.tool-card {
  padding: 0;
  overflow: hidden;
}

/* No lift-on-hover for accordion */
details.tool-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line);
}

details.tool-card[open] {
  border-color: var(--accent, var(--primary));
}

/* Summary row */
details.tool-card > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

details.tool-card > summary::-webkit-details-marker { display: none; }
details.tool-card > summary::marker { display: none; content: ''; }

/* Tool name inside summary — smaller, inline, no margin */
details.tool-card > summary .tool-name {
  font-size: 0.95rem;
  margin-bottom: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 110px;
}

/* Date + title pair */
.tool-summary-latest {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.tool-summary-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 0 0 auto;
  white-space: nowrap;
}

.tool-summary-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chevron */
.tool-summary-chevron {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  margin-left: 4px;
}

details[open].tool-card > summary .tool-summary-chevron {
  transform: rotate(180deg);
}

/* Expanded body */
.tool-details-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.tool-details-body .tool-status {
  margin-top: 16px;
  margin-bottom: 0;
}

.tool-category-header {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--line);
  margin-top: 8px;
}
