:root {
  --accent: #FF9900;
  --accent-dark: #E68A00;
  --accent-light: #FFF3E0;
  --text: #1a2332;
  --text-light: #5a6577;
  --bg: #ffffff;
  --bg-subtle: #f8f9fb;
  --border: #e2e8f0;
  --code-bg: #1e1e2e;
  --code-text: #cdd6f4;
  --header-bg: #0f1923;
  --header-text: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
}

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

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background: var(--header-bg);
  padding: 0.9rem 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-title {
  text-decoration: none;
  color: var(--header-text);
  font-weight: 700;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.2s;
}
.site-title:hover {
  opacity: 0.85;
}
.site-logo {
  width: 30px;
  height: 30px;
}
.header-tagline {
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* Main */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  min-height: 60vh;
}

/* Index Hero */
.index-hero {
  background: linear-gradient(135deg, var(--header-bg) 0%, #1a2d42 100%);
  color: white;
  margin: -2.5rem -1.5rem 2.5rem;
  padding: 3rem 2rem;
  border-radius: 0 0 var(--radius) var(--radius);
}
.index-hero h1 {
  font-size: 1.8rem;
  border: none;
  padding: 0;
  margin-bottom: 0.6rem;
  color: white;
}
.index-hero h1 .accent {
  color: var(--accent);
}
.index-hero p {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  line-height: 1.7;
}
.profile {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  color: rgba(255,255,255,0.55);
}

/* Article List */
.article-list {
  margin-top: 0.5rem;
}
.article-list h2 {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.article-list h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
}
.cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.article-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 1.4rem 1.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.article-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: var(--radius) 0 0 var(--radius);
}
.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.article-card h3 {
  font-size: 1.05rem;
  margin: 0.3rem 0 0.4rem;
  line-height: 1.5;
}
.card-category {
  font-size: 0.75rem;
  color: var(--accent-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-light);
  padding: 0.15em 0.5em;
  border-radius: 3px;
}
.card-date {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.breadcrumb a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

/* Article */
article h1 {
  font-size: 1.7rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  border: none;
  padding: 0;
}
.article-meta {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.article-meta .category {
  color: var(--accent-dark);
  font-weight: 700;
  background: var(--accent-light);
  padding: 0.15em 0.5em;
  border-radius: 3px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Article Body */
.article-body h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  border-left: none;
  padding-left: 0;
}
.article-body h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.5rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
}
.article-body h4, .article-body h5, .article-body h6 {
  font-size: 1rem;
  margin: 1.5rem 0 0.4rem;
  color: var(--text);
}
.article-body p {
  margin: 0.85rem 0;
}
.article-body ul, .article-body ol {
  margin: 0.75rem 0 0.75rem 1.5rem;
}
.article-body li {
  margin: 0.3rem 0;
}

/* Code blocks - dark theme */
.article-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  border: none;
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  font-family: 'Inconsolata', 'Consolas', monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 1.25rem 0;
  box-shadow: var(--shadow-sm);
}
.article-body code {
  font-family: 'Inconsolata', 'Consolas', monospace;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  color: #c7254e;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Syntax highlighting (Pygments - monokai) */
.codehilite .hll { background-color: #49483e }
.codehilite .c { color: #6a9955; font-style: italic } /* Comment */
.codehilite .k { color: #c586c0 } /* Keyword */
.codehilite .o { color: #d4d4d4 } /* Operator */
.codehilite .p { color: #d4d4d4 } /* Punctuation */
.codehilite .cm { color: #6a9955; font-style: italic } /* Comment.Multiline */
.codehilite .cp { color: #6a9955 } /* Comment.Preproc */
.codehilite .c1 { color: #6a9955; font-style: italic } /* Comment.Single */
.codehilite .cs { color: #6a9955; font-style: italic } /* Comment.Special */
.codehilite .gd { color: #f44747 } /* Generic.Deleted */
.codehilite .gi { color: #b5cea8 } /* Generic.Inserted */
.codehilite .ge { font-style: italic } /* Generic.Emph */
.codehilite .gs { font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #569cd6 } /* Generic.Subheading */
.codehilite .kc { color: #569cd6 } /* Keyword.Constant */
.codehilite .kd { color: #569cd6 } /* Keyword.Declaration */
.codehilite .kn { color: #c586c0 } /* Keyword.Namespace */
.codehilite .kp { color: #569cd6 } /* Keyword.Pseudo */
.codehilite .kr { color: #569cd6 } /* Keyword.Reserved */
.codehilite .kt { color: #4ec9b0 } /* Keyword.Type */
.codehilite .m { color: #b5cea8 } /* Literal.Number */
.codehilite .s { color: #ce9178 } /* Literal.String */
.codehilite .na { color: #9cdcfe } /* Name.Attribute */
.codehilite .nb { color: #dcdcaa } /* Name.Builtin */
.codehilite .nc { color: #4ec9b0 } /* Name.Class */
.codehilite .no { color: #9cdcfe } /* Name.Constant */
.codehilite .nd { color: #dcdcaa } /* Name.Decorator */
.codehilite .ni { color: #d4d4d4 } /* Name.Entity */
.codehilite .ne { color: #4ec9b0 } /* Name.Exception */
.codehilite .nf { color: #dcdcaa } /* Name.Function */
.codehilite .nl { color: #d4d4d4 } /* Name.Label */
.codehilite .nn { color: #4ec9b0 } /* Name.Namespace */
.codehilite .nt { color: #569cd6 } /* Name.Tag */
.codehilite .nv { color: #9cdcfe } /* Name.Variable */
.codehilite .ow { color: #c586c0 } /* Operator.Word */
.codehilite .mi { color: #b5cea8 } /* Literal.Number.Integer */
.codehilite .mf { color: #b5cea8 } /* Literal.Number.Float */
.codehilite .mh { color: #b5cea8 } /* Literal.Number.Hex */
.codehilite .mo { color: #b5cea8 } /* Literal.Number.Oct */
.codehilite .sa { color: #ce9178 } /* Literal.String.Affix */
.codehilite .sb { color: #ce9178 } /* Literal.String.Backtick */
.codehilite .sc { color: #ce9178 } /* Literal.String.Char */
.codehilite .dl { color: #ce9178 } /* Literal.String.Delimiter */
.codehilite .sd { color: #ce9178 } /* Literal.String.Doc */
.codehilite .s2 { color: #ce9178 } /* Literal.String.Double */
.codehilite .se { color: #d7ba7d } /* Literal.String.Escape */
.codehilite .sh { color: #ce9178 } /* Literal.String.Heredoc */
.codehilite .si { color: #ce9178 } /* Literal.String.Interpol */
.codehilite .sx { color: #ce9178 } /* Literal.String.Other */
.codehilite .sr { color: #d16969 } /* Literal.String.Regex */
.codehilite .s1 { color: #ce9178 } /* Literal.String.Single */
.codehilite .ss { color: #ce9178 } /* Literal.String.Symbol */

/* Mermaid */
.mermaid {
  background: white !important;
  color: var(--text) !important;
  text-align: center;
  margin: 1.5rem 0;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
}
.article-body th {
  background: var(--header-bg);
  color: var(--header-text);
  font-weight: 700;
  font-size: 0.85rem;
}
.article-body tr:nth-child(even) {
  background: var(--bg-subtle);
}
.article-body img {
  max-width: 100%;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.article-body a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:hover {
  color: var(--accent);
  text-decoration: none;
}
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  color: var(--text-light);
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Admonition */
.admonition {
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  background: var(--bg-subtle);
}
.admonition-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-light);
  font-size: 0.82rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* 404 */
.not-found {
  text-align: center;
  padding: 5rem 1rem;
}
.not-found h1 {
  border: none;
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.not-found p {
  margin: 0.5rem 0;
  color: var(--text-light);
}
.not-found a {
  color: var(--accent-dark);
  font-weight: 700;
}

/* Responsive */
@media (max-width: 600px) {
  main { padding: 1.5rem 1rem; }
  .index-hero {
    margin: -1.5rem -1rem 2rem;
    padding: 2rem 1.25rem;
  }
  .index-hero h1 { font-size: 1.4rem; }
  article h1 { font-size: 1.35rem; }
  .article-body h2 { font-size: 1.15rem; }
  .article-card { padding: 1.1rem 1.2rem; }
  .article-body pre { padding: 1rem; font-size: 0.82rem; }
  .header-tagline { display: none; }
}
