/* ===== Base Reset & Variables ===== */
:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --text: #1a1a1a;
  --text-secondary: #555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --code-bg: #f3f4f6;
  --table-stripe: #f9fafb;
  --cta-bg: #2563eb;
  --cta-text: #fff;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181a1b;
    --bg-secondary: #1f2224;
    --text: #e4e4e4;
    --text-secondary: #aaa;
    --accent: #60a5fa;
    --accent-hover: #93bbfd;
    --border: #333;
    --code-bg: #252525;
    --table-stripe: #222;
    --cta-bg: #3b82f6;
    --cta-text: #fff;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; border-radius: 8px; }

/* ===== Layout ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  background: var(--bg);
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.site-title a { color: inherit; }
.site-nav a { margin-left: 1.5rem; font-size: 0.95rem; color: var(--text-secondary); }

.container { max-width: 720px; margin: 0 auto; padding: 2rem 1.5rem; }
.container-wide { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ===== Index / Card List ===== */
.hero { text-align: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.hero p { color: var(--text-secondary); font-size: 1rem; }

.article-list { list-style: none; display: grid; gap: 1.5rem; }
.article-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  transition: box-shadow 0.2s;
}
.article-card:hover { box-shadow: var(--shadow); }
.article-card h2 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.article-card h2 a { color: var(--text); }
.article-card h2 a:hover { color: var(--accent); text-decoration: none; }
.article-card .meta { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.article-card .excerpt { font-size: 0.95rem; color: var(--text-secondary); }

/* ===== Article Page ===== */
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 1.75rem; line-height: 1.4; margin-bottom: 0.5rem; }
.article-header .meta { font-size: 0.9rem; color: var(--text-secondary); }

.article-body h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--border);
}
.article-body h3 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.5rem; }
.article-body li { margin-bottom: 0.4rem; }

/* Table */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.6;
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}
.article-body th { background: var(--bg-secondary); font-weight: 600; }
.article-body tr:nth-child(even) td { background: var(--table-stripe); }

/* Code */
.article-body code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.article-body pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}
.article-body pre code { background: none; padding: 0; }

/* CTA */
.cta-box {
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  text-align: center;
}
.cta-box p { margin-bottom: 0.75rem; font-weight: 500; }
.cta-btn {
  display: inline-block;
  background: var(--cta-bg);
  color: var(--cta-text);
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.cta-btn:hover { background: var(--accent-hover); color: var(--cta-text); text-decoration: none; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .article-header h1 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.3rem; }
  .article-body table { font-size: 0.82rem; }
  .article-card { padding: 1.25rem; }
}
