:root {
  --bg: #0d1117;
  --bg-soft: #151b23;
  --panel: rgba(13, 17, 23, 0.82);
  --panel-strong: rgba(19, 25, 34, 0.92);
  --text: #d7dde7;
  --muted: #8d99ab;
  --line: rgba(141, 153, 171, 0.24);
  --accent: #7cc7ff;
  --accent-deep: #4b9fe0;
  --accent-soft: rgba(124, 199, 255, 0.14);
  --hero-glow: rgba(124, 199, 255, 0.16);
  --content-width: 1160px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(circle at top, rgba(124, 199, 255, 0.08), transparent 26%),
    linear-gradient(180deg, #0b0f14 0%, #111720 100%);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.9;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.24;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: #a8dbff;
}

#container {
  max-width: none;
  margin: 0;
  background: transparent;
}

#wrapper,
#main,
#main-inner,
#box2,
#box2-inner,
#content-inner {
  min-width: 0;
}

#blog-title {
  position: relative;
  margin: 0 0 44px;
  width: 100%;
  padding: 112px 24px 72px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(6, 9, 13, 0.82), rgba(10, 14, 20, 0.54)),
    radial-gradient(circle at 18% 18%, rgba(124, 199, 255, 0.18), transparent 26%),
    linear-gradient(135deg, #10151d 0%, #1a2230 48%, #0b1016 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#blog-title::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
  mix-blend-mode: screen;
  opacity: 0.28;
}

#blog-title::after {
  content: "";
  position: absolute;
  right: 8%;
  top: 50%;
  width: 360px;
  height: 360px;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(124, 199, 255, 0.26) 0%, rgba(124, 199, 255, 0.04) 34%, transparent 68%);
  filter: blur(10px);
  opacity: 0.9;
}

#blog-title-inner,
#content-inner,
#footer-inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-width);
  margin: 0 auto;
}

#title {
  max-width: 760px;
}

#title a {
  display: inline-block;
  color: #f5f7fb;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.04em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

#title a::after {
  content: "LIFELONG PROGRAMMER'S NOTEBOOK";
  display: block;
  margin-top: 20px;
  color: rgba(215, 221, 231, 0.76);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.28em;
}

#blog-description {
  margin-top: 18px;
  max-width: 560px;
  color: rgba(215, 221, 231, 0.68);
  font-size: 0.98rem;
}

#content {
  padding: 0 24px 48px;
}

#content-inner {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 290px !important;
  gap: 56px !important;
  align-items: start;
  width: 100%;
}

#wrapper {
  width: 100% !important;
  max-width: var(--content-width) !important;
  margin: 0 auto !important;
  float: none !important;
}

#main {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  min-width: 0;
}

#main-inner {
  width: auto !important;
  margin: 0 !important;
}

#box2 {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  min-width: 0;
}

#box2-inner {
  width: auto !important;
  margin: 0 !important;
}

.entry,
.archive-entry {
  position: relative;
  margin: 0;
  padding: 0 0 42px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.entry::before,
.archive-entry::before {
  content: "";
  position: absolute;
  top: 0;
  left: -28px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, rgba(124, 199, 255, 0.55), transparent);
  opacity: 0.4;
}

.entry-header,
.archive-entry-header {
  position: relative;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.date,
.entry-date,
.archive-entry-date {
  display: block;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
}

.entry-title,
.archive-entry-title {
  margin: 0;
  line-height: 1.35;
}

.entry-title a,
.archive-entry-title a {
  color: #f3f6fb;
  font-size: clamp(1.25rem, 1.8vw, 1.9rem);
  font-weight: 800;
  line-height: 1.38;
}

.archive-entry-title a {
  font-size: clamp(1.25rem, 1.55vw, 1.65rem);
}

.categories,
.entry-categories,
.archive-entry-categories {
  margin-top: 18px;
}

.categories a,
.entry-categories a,
.archive-entry-categories a {
  display: inline-block;
  margin: 0 10px 8px 0;
  padding: 4px 10px;
  border: 1px solid rgba(124, 199, 255, 0.28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #b5e1ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.entry-content {
  font-size: 1.03rem;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5 {
  color: #f5f7fb;
  line-height: 1.5;
}

.entry-content h2 {
  margin-top: 2.8em;
  margin-bottom: 0.95em;
  padding: 0.05em 0 0.05em 0.85em;
  border-left: 5px solid #59b7ff;
  border-bottom: 0;
  font-size: 1.45rem;
  color: #f7fbff;
  background: linear-gradient(90deg, rgba(89, 183, 255, 0.12), transparent 72%);
}

.entry-content h3 {
  margin-top: 2.1em;
  margin-bottom: 0.8em;
  padding-left: 0.85em;
  border-left: 4px solid #59b7ff;
  font-size: 1.12rem;
  color: #f4f8fd;
  background: linear-gradient(90deg, rgba(89, 183, 255, 0.08), transparent 70%);
}

.entry-content p,
.entry-content li {
  color: var(--text);
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.4em;
}

.entry-content blockquote {
  margin: 1.8em 0;
  padding: 0.8em 1.1em;
  border-left: 3px solid rgba(180, 190, 205, 0.45);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.04);
  color: #bcc8d6;
  font-style: italic;
  line-height: 1.7;
}

.entry-content blockquote > :first-child {
  margin-top: 0;
}

.entry-content blockquote > :last-child {
  margin-bottom: 0;
}

.entry-content pre {
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid rgba(124, 199, 255, 0.12);
  border-radius: 14px;
  background: #0a0f15;
  color: #dce9f5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.entry-content code {
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: rgba(124, 199, 255, 0.12);
  color: #b5e1ff;
  font-size: 0.92em;
}

.entry-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.entry-content img,
.entry-content iframe {
  max-width: 100%;
  border-radius: 12px;
}

.pager {
  margin: 34px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.pager-prev a,
.pager-next a,
.archive-entry-readmore a {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid rgba(124, 199, 255, 0.22);
  border-radius: 999px;
  background: rgba(124, 199, 255, 0.08);
  color: #c1e5ff;
  font-weight: 700;
}

.hatena-module {
  margin-bottom: 30px;
  padding: 18px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.hatena-module-title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: #f5f7fb;
  font-size: 1.08rem;
  font-weight: 700;
}

.hatena-module-body,
.hatena-module li,
.hatena-module p {
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.85;
}

.profile-icon {
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.hatena-module ul,
.hatena-module ol {
  margin: 0;
  padding-left: 1.2em;
}

#search-box,
.search-form {
  position: relative;
}

#search-box input,
.search-form input[type="text"] {
  width: 100%;
  padding: 12px 42px 12px 14px;
  border: 1px solid rgba(124, 199, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

#box2 .hatena-module-title,
#box2 .hatena-module-body {
  position: relative;
  z-index: 2;
}

#box2 .hatena-module-title {
  background: linear-gradient(180deg, rgba(11, 15, 20, 0.96), rgba(11, 15, 20, 0.9));
}

#box2 .hatena-module-body {
  padding: 12px 14px 14px;
  border: 1px solid rgba(124, 199, 255, 0.08);
  border-radius: 14px;
  background: rgba(12, 17, 24, 0.72);
  backdrop-filter: blur(6px);
}

#search-box input::placeholder,
.search-form input[type="text"]::placeholder {
  color: #8793a6;
}

#footer {
  margin: 0;
  padding: 22px 24px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

@media (max-width: 960px) {
  #blog-title {
    padding-top: 88px;
    padding-bottom: 58px;
  }

  #wrapper {
    max-width: none !important;
  }

  #content-inner {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .entry::before,
  .archive-entry::before {
    display: none;
  }

}

@media (max-width: 640px) {
  #blog-title {
    padding: 72px 18px 48px;
  }

  #content,
  #footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  #title a {
    font-size: 2.2rem;
  }

  #title a::after {
    letter-spacing: 0.18em;
    font-size: 0.76rem;
  }

  .entry-title a,
  .archive-entry-title a {
    font-size: 1.42rem;
  }
}

/* 記事内テーブル */
.entry-content table {
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
  border: 1px solid rgba(124, 199, 255, 0.22);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(12, 17, 24, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.entry-content th,
.entry-content td {
  padding: 12px 14px;
  border: 1px solid rgba(141, 153, 171, 0.28);
  vertical-align: top;
}

.entry-content th {
  background: rgba(124, 199, 255, 0.14);
  color: #f5f7fb;
  font-weight: 800;
  white-space: nowrap;
}

.entry-content td {
  color: var(--text);
  background: rgba(255, 255, 255, 0.015);
}

.entry-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.035);
}

/* スマホ対策 */
@media (max-width: 640px) {
  .entry-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .entry-content th,
  .entry-content td {
    padding: 10px 12px;
  }
}

/* スマホ時レイアウト調整 */
@media (max-width: 960px) {
  #content-inner {
    grid-template-columns: 1fr !important;
  }
  #content-inner {
    display: block !important;
  }

  #wrapper,
  #main,
  #box2 {
    width: 100% !important;
    max-width: 100% !important;
  }

  #box2 {
    margin-top: 40px !important;
  }
}
