:root {
  --gitanes-blue: #0b318f;
  --primary-blue: #0b318f;
  --deep-blue: #00146e;
  --ink-blue: #05143f;
  --sky-blue: #eaf6ff;
  --cyan: #00a3e0;
  --mint: #77c8f2;
  --bg-main: #f6faff;
  --bg-card: #ffffff;
  --text-primary: #0d1b2f;
  --text-secondary: #52627a;
  --border-color: #d8e6f5;
  --shadow-sm: 0 1px 2px rgba(8, 47, 115, 0.08);
  --shadow-md: 0 18px 45px rgba(8, 47, 115, 0.12);
  --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background:
    linear-gradient(180deg, #eaf6ff 0, #f6faff 420px, #ffffff 100%);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: scroll;
}

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

a:visited {
  color: var(--gitanes-blue);
}

/* 記事本文内のリンクには下線を付ける */
.memo-content a {
  text-decoration: underline;
}
.memo-content a:hover {
  text-decoration: none;
}

/* カードなどの大きなリンク要素では下線を消す */
.achievement-card,
.tag,
.links a {
  text-decoration: none !important;
}

.achievement-card:hover {
  text-decoration: none !important;
}

/* カードホバー時に Read More だけ下線を出す */
.achievement-card:hover .external-link {
  text-decoration: underline;
}

.container {
  max-width: 1440px;
  width: 95%;
  margin: 0 auto;
  padding: 0 2.5rem 2.5rem;
  background-color: rgba(255, 255, 255, 0.82);
  border-left: 1px solid rgba(216, 230, 245, 0.9);
  border-right: 1px solid rgba(216, 230, 245, 0.9);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex-grow: 1;
  padding-top: 2.5rem;
}

header.site-header {
  padding: 2rem 2rem 2.25rem;
  text-align: center;
  background:
    linear-gradient(135deg, #00146e 0%, #0b318f 54%, #00a3e0 100%);
  margin: 0 -2.5rem;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  position: relative;
  overflow: hidden;
}

header.site-header::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 5px;
  background: linear-gradient(90deg, #00a3e0, #ffffff 46%, #77c8f2);
  opacity: 0.85;
}

/* 一覧ページのタイトル（"Posts", "Categories", "Tags" など）のスタイル調整 */
#memo-list h2,
#memo-categories h2,
#memo-tags h2 {
  text-align: center;
  border-left: none;
  padding-left: 0;
  margin-top: 1rem;
  margin-bottom: 3rem;
  font-size: 1.8rem;
  position: relative;
  color: var(--text-primary);
}

#memo-list h2::after,
#memo-categories h2::after,
#memo-tags h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  background: var(--cyan);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

#introduction {
  background: #f8fbff;
  margin: -2.5rem -2.5rem 2.5rem -2.5rem;
  padding: 2.25rem 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 35px rgba(4, 20, 48, 0.26);
  position: relative;
  z-index: 1;
}

.profile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

header h1 {
  font-size: 2.35rem;
  margin-bottom: 0.25rem;
  color: #ffffff;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}

header h1 a,
header h1 a:visited,
.links a,
.links a:visited {
  color: #ffffff !important;
  text-decoration: none;
}

header .title {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 1.15rem;
  position: relative;
  z-index: 1;
}

.links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.links a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.links a svg, .link-disabled svg {
  width: 16px !important; /* 参照サイトに合わせて16pxに修正 */
  height: 16px !important;
  stroke-width: 2px;
}


.links a:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
}

.link-disabled {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  user-select: none;
}

/* Terminal Styling */
.terminal-window {
  max-width: 1120px;
  margin: 0 auto;
  background-color: #05143f;
  border-radius: 8px;
  box-shadow: 0 22px 48px rgba(8, 47, 115, 0.18);
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(0, 163, 224, 0.26);
}

.terminal-header {
  background-color: #09205f;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  position: relative;
}

.terminal-buttons {
  display: flex;
  gap: 6px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background-color: #ff5f56; }
.yellow { background-color: #ffbd2e; }
.green { background-color: #27c93f; }

.terminal-title {
  color: #a8c6e7;
  font-size: 0.75rem;
  font-family: 'Courier New', Courier, monospace;
  position: absolute;
  width: 100%;
  text-align: center;
  left: 0;
  pointer-events: none;
}

.terminal-body {
  padding: 1.25rem;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #d9ecff;
}

.terminal-line { display: flex; gap: 8px; margin-bottom: 0.25rem; justify-content: flex-start; }
.prompt { color: #5ed5ff; font-weight: bold; }
.command { color: #f8fafc; }
.terminal-output { margin-bottom: 1rem; color: #c7dcf2; white-space: pre-wrap; text-align: left; }
.cursor {
  display: inline-block;
  width: 7px;
  height: 1.1rem;
  color: transparent;
  background-color: #5ed5ff;
  vertical-align: middle;
  overflow: hidden;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

section { margin-bottom: 3rem; }
section h2 {
  font-size: 1.35rem;
  margin-bottom: 1.5rem;
  color: var(--ink-blue);
  border-left: 4px solid var(--cyan);
  padding-left: 0.9rem;
  letter-spacing: 0;
}

/* Skills Tags */
.skill-category { margin-bottom: 2.5rem; }
.skill-category h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.skill-tags-outer {
  position: relative;
  width: 100%;
  overflow: hidden; /* 子要素のはみ出しを確実にカット */
}

.skill-tags-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  height: auto; /* 高さを自動に */
  max-height: 2.5rem; /* 初期状態の高さ制限 */
  padding-bottom: 2px; /* 下部が微妙に切れないように余白 */
}

@media (max-width: 768px) {
  .skill-tags-inner {
    max-height: 5.0rem; /* モバイル2行分：余裕を持たせて角丸が切れないようにする */
  }
}

.show-more-checkbox:checked ~ .skill-tags-outer .skill-tags-inner {
  max-height: none;
  overflow: visible;
}

.show-more-checkbox:checked ~ .skill-tags-outer .show-more-btn {
  display: none;
}

.tag,
.tag:visited,
.show-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  background: #f8fbff;
  border: 1px solid var(--border-color);
  padding: 0 0.7rem;
  border-radius: 6px;
  color: var(--text-primary) !important;
  transition: all 0.2s ease;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  height: 1.8rem; /* 高さを低くしてコンパクトに */
  box-sizing: border-box;
}

.tag i,
.tag svg,
.show-more-btn i,
.show-more-btn svg {
  width: 12px !important; /* アイコンをさらに小さく */
  height: 12px !important;
}

.tag:hover,
.show-more-btn:hover { 
  background: var(--sky-blue);
  border-color: #9ed9f7;
  color: var(--deep-blue) !important;
}

.show-more-btn {
  background: #eef8ff;
  border-color: var(--border-color);
  font-weight: bold;
}

.tag-pride { background: var(--gitanes-blue); color: #ffffff; border: none; }
.tag-pride:hover { background: var(--deep-blue); color: #ffffff; }

/* Career Journey (Timeline) */
.timeline { border-left: 2px solid #b7def4; padding-left: 2rem; margin-left: 1rem; }
.timeline-item { position: relative; margin-bottom: 3rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -2.1rem; top: 0.22rem;
  width: 16px; height: 16px; background: #ffffff;
  border: 3px solid var(--cyan); border-radius: 50%;
  transform: translateX(-50%); z-index: 1;
}
.timeline-date { font-size: 0.9rem; font-weight: bold; color: var(--gitanes-blue); margin-bottom: 0.5rem; }
.timeline-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 0.75rem; }
.timeline-desc { color: var(--text-secondary); font-size: 1rem; background: #f6faff; border-left: 3px solid #b7def4; padding: 1rem; border-radius: 8px; margin-bottom: 0.75rem; }

/* Achievements */
.achievement-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .achievement-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .achievement-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.achievement-card {
  background: #ffffff; border-radius: 8px; border: 1px solid var(--border-color);
  overflow: hidden; text-decoration: none; color: var(--text-primary);
  box-shadow: none; transition: all 0.3s ease;
  display: flex; flex-direction: column;
  height: 100%;
}
.achievement-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #9ed9f7; color: var(--text-primary); }
.achievement-thumb { width: 100%; aspect-ratio: 1792 / 1024; background-color: #eef8ff; position: relative; overflow: hidden; }
.achievement-thumb img { width: 100%; height: 100%; display: block; object-fit: contain; }
.achievement-content { padding: 1.25rem; flex-grow: 1; display: flex; flex-direction: column; }
.achievement-category { font-size: 0.75rem; font-weight: bold; color: var(--cyan); text-transform: uppercase; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.4rem; }
.achievement-content h3 {
  font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-primary); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 4.2em;
}
.achievement-content p {
  flex-grow: 1; margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.6;
  min-height: 8em; /* 5行分の高さを確保 */
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.external-link { font-size: 0.85rem; font-weight: bold; color: var(--gitanes-blue); display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
.external-link svg { width: 14px; height: 14px; stroke-width: 2.5; }

/* Hobby & Values */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.card { background: #ffffff; padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: none; transition: transform 0.2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #9ed9f7; }
.card h3 { margin-bottom: 0.75rem; color: var(--ink-blue); font-size: 1.1rem; display: flex; align-items: center; gap: 0.75rem; }

/* --- Post Detail (Grasys Style) --- */
#memo-post {
  max-width: 980px;
  margin: 0 auto;
}

.post-header { margin-bottom: 1.5rem; padding-top: 1rem; padding-left: 1.3rem; }
.post-header h2 {
  font-size: 2rem; margin-bottom: 0.75rem; color: var(--text-primary);
  border-left: 4px solid var(--cyan); padding-left: 1.3rem; margin-left: -1.3rem;
}
.post-meta { display: flex; align-items: center; gap: 1.25rem; margin: 0.5rem 0 1.5rem 0; color: var(--text-secondary); font-size: 0.85rem; }
.meta-item { display: flex; align-items: center; gap: 0.35rem; }
.post-header .achievement-thumb { 
  margin-bottom: 1.5rem; 
  border-radius: 8px;
  overflow: hidden; 
  border: 1px solid var(--border-color);
  margin-left: -1.3rem; 
  margin-right: -1.3rem;
  width: calc(100% + 2.6rem); 
}
.post-header .achievement-thumb img { width: 100%; height: auto; display: block; }

.memo-content { line-height: 1.8; color: var(--text-primary); margin-bottom: 3rem; padding-left: 1.3rem; }
.memo-content h2 {
  font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 1.25rem;
  color: var(--ink-blue); border-left: 4px solid var(--cyan); padding-left: 1.3rem; margin-left: -1.3rem;
}
.memo-content h3 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: 0.75rem; color: var(--text-primary); }
.memo-content p { margin-bottom: 1.25rem; }
.memo-content ul, .memo-content ol { margin-bottom: 1.25rem; padding-left: 1.2rem; }
.memo-content li { margin-bottom: 0.5rem; }
.memo-content strong { font-weight: 700; }

.author-profile {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 2.5rem;
  margin: 5rem 1.3rem 3rem 1.3rem;
  background: #f8fbff;
  border-radius: 8px;
  box-shadow: none;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.author-profile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg,
    #00146e 0% 25%,
    #0067c5 25% 50%,
    #00a3e0 50% 75%,
    #37d5ff 75% 100%
  );
}


.author-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--gitanes-blue);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.author-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #f1f5f9;
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-info { flex-grow: 1; }
.author-name { font-weight: 800; font-size: 1.25rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.author-bio { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

.share-buttons { 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  gap: 0; 
  flex-wrap: wrap; 
  margin: 1rem auto 3rem auto; 
  width: 100%; 
}
.share-buttons .tag,
.share-buttons .tag:visited { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 0.3rem; 
  height: 24px; 
  padding: 0 0.7rem; 
  font-size: 10px; 
  font-weight: 600; 
  text-decoration: none !important; 
  border: none !important; 
  border-radius: 0; 
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
  cursor: pointer; 
  transition: opacity 0.2s ease;
}

.share-btn-x { background: #000 !important; color: #fff !important; }
.share-btn-fb { background: #1877f2 !important; color: #fff !important; }
.share-btn-hatena { background: #00a4de !important; color: #fff !important; }
.share-btn-copy { background: #555 !important; color: #fff !important; }

.share-buttons .tag:hover {
  opacity: 0.8;
  background: inherit;
  color: #fff !important;
}

/* --- New Styles (Integrated) --- */
.balloon { display: flex; align-items: flex-start; margin: 2rem 0; gap: 1.5rem; }
.balloon-icon { flex-shrink: 0; width: 80px; height: 80px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gitanes-blue); background-color: #fff; box-shadow: var(--shadow-sm); }
.balloon-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.balloon-content { position: relative; background-color: #f8fbff; padding: 1.25rem; border-radius: 8px; border: 1px solid var(--border-color); flex-grow: 1; }
.balloon-title { display: block; font-weight: bold; font-size: 0.85rem; color: var(--gitanes-blue); margin-bottom: 0.25rem; }
.balloon-content::before { content: ""; position: absolute; top: 30px; left: -10px; border-style: solid; border-width: 10px 10px 10px 0; border-color: transparent #f8fbff transparent transparent; z-index: 1; }
.balloon-content::after { content: ""; position: absolute; top: 30px; left: -11px; border-style: solid; border-width: 10px 10px 10px 0; border-color: transparent var(--border-color) transparent transparent; z-index: 0; }
.balloon.right { flex-direction: row-reverse; }
.balloon.right .balloon-content::before { left: auto; right: -10px; border-width: 10px 0 10px 10px; border-color: transparent transparent transparent #f8fbff; }
.balloon.right .balloon-content::after { left: auto; right: -11px; border-width: 10px 0 10px 10px; border-color: transparent transparent transparent var(--border-color); }

.notice-block { margin: 2rem 0; padding: 1.25rem 1.5rem; background-color: #f8fbff; border: 1px solid var(--border-color); border-radius: 8px; }
.notice-title { font-weight: bold; color: var(--gitanes-blue); font-size: 0.85rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.notice-title::before { content: "✦"; }
.notice-content { font-size: 1.05rem; line-height: 1.7; color: var(--text-primary); }
.caution-block { margin: 2rem 0; padding: 1.25rem 1.5rem; background: #fff8e6; border: 1px solid #f0c56a; border-left: 4px solid #d48a00; border-radius: 8px; }
.caution-title { font-weight: bold; color: #8a5200; font-size: 0.9rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.caution-title i { width: 1.1rem; height: 1.1rem; stroke-width: 2.4; flex-shrink: 0; }
.caution-content { font-size: 1.02rem; line-height: 1.7; color: var(--text-primary); }
.caution-content p, .caution-content li { color: var(--text-primary); }
.caution-content > :first-child { margin-top: 0; }
.caution-content > :last-child { margin-bottom: 0; }

.image-wrapper { text-align: center; margin: 1.5rem 0; }
.image-wrapper img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: block; margin: 0 auto; }
.image-caption { text-align: center; font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.8rem; line-height: 1.4; }

.post-header .skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

.memo-content details { margin: 1.5rem 0; padding: 0; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; background-color: #f8fbff; }
.memo-content summary { padding: 1rem 1.25rem; font-weight: bold; cursor: pointer; background-color: #f8fbff; color: var(--text-primary); display: flex; align-items: center; list-style: none; }
.memo-content summary:hover { background-color: var(--sky-blue); }
.memo-content details[open] { box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); }
.memo-content summary::before { content: ""; display: inline-block; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10.4px; border-color: transparent transparent transparent var(--gitanes-blue); margin-right: 1rem; transition: transform 0.2s ease; }
.memo-content details[open] summary::before { transform: rotate(90deg); }
.details-inner { padding: 0.5rem; background-color: #f8fbff; }
.details-inner p { margin-bottom: 0; }
.details-inner .image-wrapper { margin: 0; }
.details-inner .image-wrapper img { border-radius: 0; box-shadow: none; width: 100%; }

footer { text-align: center; padding: 4rem 0 2rem; color: var(--text-secondary); font-size: 0.85rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .cards { grid-template-columns: 1fr; }
  .timeline { padding-left: 1.5rem; margin-left: 0.5rem; }
  .timeline-item::before { left: -1.6rem; }
}

@media (max-width: 640px) {
  .container { padding: 0 1.25rem 1.25rem; width: 100%; border-radius: 0; border-left: 0; border-right: 0; margin: 0; }
  main { padding-top: 0; }
  header.site-header { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-radius: 0; padding: 2rem 1rem; }
  header h1 { font-size: 1.8rem; }
  
  /* モバイルではヘッダーのリンクを少しコンパクトにする (urchin-hat.org準拠) */
  .links { gap: 0.5rem; }
  .links a, .link-disabled {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }

  #introduction { width: 100vw; margin: 0 calc(50% - 50vw) 2rem; padding: 1.5rem 0.5rem; }
  
  .memo-content details {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .terminal-line {
    display: block;
    word-break: break-all;
    line-height: 1.5;
    margin-bottom: 0.5rem;
  }

  .terminal-line .prompt,
  .terminal-line .command {
    display: inline;
    margin: 0;
    padding: 0;
  }

  /* プロンプトとコマンドの間に適切なスペースを確保 */
  .terminal-line .prompt::after {
    content: " ";
    display: inline;
  }

  .terminal-body {
    font-size: 0.82rem;
    padding: 0.8rem;
  }
  }

  .details-inner {
    background-color: #f8fbff;
  }
  .details-inner p {
    margin-bottom: 0;
  }
  
  .memo-content { padding-left: 0; }
  .memo-content h2, .post-header h2 { margin-left: 0; padding-left: 1rem; }
  .post-header .achievement-thumb {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1.25rem;
  }
  .author-profile { flex-direction: column; align-items: center; text-align: center; padding: 2rem 1.25rem; margin: 3rem 0; gap: 1.25rem; }
  .notice-block, .caution-block { margin: 1.5rem 0; padding: 1.25rem; border-radius: 8px; }
  .balloon { flex-direction: row; gap: 0.75rem; }
  .balloon-icon { width: 65px; height: 65px; }

  /* モバイルではカテゴリータグのサイズをコンパクトにする */
  .tag, .tag:visited, .show-more-btn {
    font-size: 0.75rem; /* 0.85remから縮小 */
    padding: 0.35rem 0.75rem;
    height: auto;
    min-height: 1.8rem;
    line-height: 1.2;
  }
}

/* --- Code Block Styles --- */
.memo-content pre {
  margin: 1.5rem 0;
  background-color: #05143f;
  border-radius: 8px;
  border: 1px solid rgba(0, 163, 224, 0.26);
  box-shadow: 0 18px 35px rgba(8, 47, 115, 0.12);
  overflow: hidden;
  position: relative;
}

.memo-content pre:hover .copy-button {
  opacity: 1;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
  z-index: 10;
}

.copy-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.copy-button.copied {
  background-color: #27c93f;
  color: #fff;
  border-color: #27c93f;
}

.copy-button svg {
  width: 14px !important;
  height: 14px !important;
}

.memo-content pre code {
  display: block;
  padding: 1.25rem 1.5rem;
  color: #d9ecff;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
  tab-size: 4;
}

/* Scrollbar styling for code blocks */
.memo-content pre code::-webkit-scrollbar {
  height: 8px;
}
.memo-content pre code::-webkit-scrollbar-track {
  background: #05143f;
}
.memo-content pre code::-webkit-scrollbar-thumb {
  background: #24487d;
  border-radius: 4px;
}
.memo-content pre code::-webkit-scrollbar-thumb:hover {
  background: #3165a8;
}

/* Inline Code Style */
.memo-content :not(pre) > code {
  background-color: #eef8ff;
  color: var(--deep-blue);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.9em;
  border: 1px solid var(--border-color);
}

/* Language Header Styles */
.memo-content pre:has(code[class*="language-"])::before {
  content: "CODE";
  display: block;
  background-color: #09205f;
  color: #a8c6e7;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  letter-spacing: 0;
  border-bottom: 1px solid rgba(0, 163, 224, 0.22);
  text-transform: uppercase;
}

.memo-content pre:has(code.language-yaml)::before { content: "YAML CONFIGURATION"; }
.memo-content pre:has(code.language-bash)::before { content: "BASH SCRIPT"; }
.memo-content pre:has(code.language-sh)::before { content: "SHELL SCRIPT"; }
.memo-content pre:has(code.language-hcl)::before,
.memo-content pre:has(code.language-terraform)::before { content: "TERRAFORM (HCL)"; }
.memo-content pre:has(code.language-json)::before { content: "JSON DATA"; }
.memo-content pre:has(code.language-python)::before { content: "PYTHON"; }
.memo-content pre:has(code.language-javascript)::before,
.memo-content pre:has(code.language-js)::before { content: "JAVASCRIPT"; }
.memo-content pre:has(code.language-typescript)::before,
.memo-content pre:has(code.language-ts)::before { content: "TYPESCRIPT"; }
.memo-content pre:has(code.language-go)::before { content: "GO"; }
.memo-content pre:has(code.language-rust)::before { content: "RUST"; }
.memo-content pre:has(code.language-toml)::before { content: "TOML CONFIG"; }

/* --- Code Block Wrap for Mobile --- */
@media (max-width: 768px) {
  .memo-content pre code {
    white-space: pre-wrap !important;
    word-break: break-all !important;
    padding: 1rem 1.25rem;
  }
}

/* --- Share Buttons (SVG & Text Fix) --- */
.share-buttons .tag svg {
  width: 12px !important;
  height: 12px !important;
  fill: currentColor;
  stroke: none;
  flex-shrink: 0;
}

/* Pagination Styling */
.pagination {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding: 0;
}

.pagination .page-item .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(15, 33, 55, 0.7);
  border: 1px solid rgba(126, 202, 255, 0.2);
  color: #f7fbff;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
  background: var(--cyan);
  border-color: var(--cyan);
  font-weight: bold;
}

.pagination .page-item .page-link:hover:not(.active) {
  background: rgba(0, 119, 211, 0.3);
  border-color: var(--cyan);
}

.share-buttons .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0.8rem;
  font-size: 11px;
}

.share-buttons .tag strong {
  font-size: 11px;
}


/* --- Material Design Blockquote --- */
.memo-content blockquote, .memo-content li blockquote {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem 1.25rem 3rem;
  background-color: #f8fbff;
  border-left: 4px solid var(--cyan);
  box-shadow: none;
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  display: block;
}

.memo-content blockquote::before, .memo-content li blockquote::before {
  content: "“";
  position: absolute;
  top: 0.2rem;
  left: 0.8rem;
  font-size: 2.5rem;
  font-family: serif;
  color: var(--cyan);
  opacity: 0.3;
}

/* 引用符の追加 */
.memo-content blockquote::before {
  content: "“";
  position: absolute;
  top: -10px;
  left: 0.5rem;
  font-size: 4rem;
  font-family: serif;
  color: var(--cyan);
  opacity: 0.2;
}

.memo-content blockquote p {
  margin-bottom: 0; /* 引用内の最後の段落の余白を消す */
}

/* --- Urchin Infra Blue Theme Overrides --- */
:root {
  --gitanes-blue: #0757c2;
  --primary-blue: #0757c2;
  --deep-blue: #001b5d;
  --ink-blue: #071329;
  --sky-blue: #e7f4ff;
  --cyan: #00a7e1;
  --mint: #52d6ff;
  --ops-green: #29d391;
  --warning-amber: #f4b740;
  --bg-main: #f3f8ff;
  --bg-card: #ffffff;
  --text-primary: #0b1728;
  --text-secondary: #536273;
  --border-color: #c9def3;
  --shadow-sm: 0 1px 2px rgba(2, 28, 74, 0.08);
  --shadow-md: 0 18px 45px rgba(2, 28, 74, 0.14);
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

body {
  background:
    linear-gradient(rgba(0, 27, 93, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 27, 93, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(0, 167, 225, 0.16), transparent 28rem),
    linear-gradient(180deg, #e7f4ff 0, #f7fbff 34rem, #ffffff 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.container {
  background-color: rgba(255, 255, 255, 0.9);
  border-left-color: rgba(126, 169, 216, 0.55);
  border-right-color: rgba(126, 169, 216, 0.55);
}

header.site-header {
  background:
    linear-gradient(135deg, rgba(0, 17, 58, 0.98) 0%, rgba(0, 46, 124, 0.98) 58%, rgba(0, 167, 225, 0.92) 100%);
  border-bottom-color: rgba(82, 214, 255, 0.32);
}

header.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 19px, rgba(82, 214, 255, 0.12) 20px, transparent 21px),
    linear-gradient(180deg, transparent 0 19px, rgba(82, 214, 255, 0.1) 20px, transparent 21px);
  background-size: 42px 42px;
  opacity: 0.6;
}

header.site-header::after {
  height: 4px;
  background: linear-gradient(90deg, var(--ops-green), var(--cyan) 38%, #ffffff 58%, var(--warning-amber));
}

header h1,
header .title,
.links {
  position: relative;
  z-index: 1;
}

header .title,
.terminal-title,
.achievement-category,
.post-meta,
.tag-sm {
  font-family: var(--font-mono);
}

.links a,
.link-disabled {
  background: rgba(3, 18, 48, 0.38);
  border-color: rgba(82, 214, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.links a:hover {
  background: rgba(0, 167, 225, 0.22);
  border-color: rgba(82, 214, 255, 0.7);
}

#introduction {
  background:
    linear-gradient(90deg, rgba(0, 167, 225, 0.08), transparent 32%),
    #f8fbff;
}

.terminal-window,
.memo-content pre {
  background: #06162d;
  border-color: rgba(82, 214, 255, 0.34);
  box-shadow: 0 20px 50px rgba(2, 28, 74, 0.2);
}

.terminal-header,
.memo-content pre:has(code[class*="language-"])::before {
  background: #0a2143;
  border-bottom: 1px solid rgba(82, 214, 255, 0.18);
}

.prompt,
.external-link,
.memo-content h2,
section h2 {
  color: var(--gitanes-blue);
}

.command {
  color: #d7fbff;
}

.cursor {
  background-color: var(--ops-green);
}

section h2 {
  border-left-color: var(--ops-green);
}

.tag,
.tag:visited,
.show-more-btn {
  background: #f7fbff;
  border-color: #bfd7f1;
}

.tag:hover,
.show-more-btn:hover {
  background: #e9f7ff;
  border-color: var(--cyan);
}

.tag-pride,
.tag-core {
  background: #063a8c;
  border-color: #063a8c;
  color: #ffffff !important;
}

.achievement-card,
.card,
.author-profile,
.notice-block,
.balloon-content {
  border-color: #bfd7f1;
  box-shadow: 0 1px 0 rgba(7, 87, 194, 0.06);
}

.achievement-card:hover,
.card:hover {
  border-color: var(--cyan);
  box-shadow: 0 18px 45px rgba(2, 28, 74, 0.14);
}

.achievement-thumb {
  background:
    linear-gradient(135deg, rgba(0, 27, 93, 0.04), rgba(0, 167, 225, 0.08)),
    #eef7ff;
}

.timeline {
  border-left-color: #8ecff1;
}

.timeline-item::before {
  border-color: var(--ops-green);
  box-shadow: 0 0 0 4px rgba(41, 211, 145, 0.12);
}

.timeline-desc,
.memo-content :not(pre) > code {
  background: #f1f8ff;
}

.timeline-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.timeline-skills .more-skill {
  display: none;
}

.timeline-skills .tag-more {
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeline-skills .tag-more:hover {
  background: rgba(41, 211, 145, 0.2);
  border-color: var(--ops-green);
}

.timeline-skills .tag-more .less-text {
  display: none;
}

.show-more-checkbox:checked ~ .timeline-skills .more-skill {
  display: inline-flex;
}

.show-more-checkbox:checked ~ .timeline-skills .tag-more .more-text {
  display: none;
}

.show-more-checkbox:checked ~ .timeline-skills .tag-more .less-text {
  display: inline;
}

.show-more-checkbox {
  display: none;
}

.tag-sm,
.tag-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(129, 186, 238, 0.28);
  border-radius: 999px;
  background: rgba(14, 35, 58, 0.88);
  color: #dff4ff;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
}

.tag-more {
  border-color: rgba(41, 211, 145, 0.38);
  color: #aef6d7;
  background: rgba(41, 211, 145, 0.12);
}

.memo-content pre code,
.terminal-body {
  font-family: var(--font-mono);
}

.memo-content blockquote,
.memo-content li blockquote {
  border-left-color: var(--ops-green);
  background: #f7fbff;
}

/* --- Fedora-ish Dark Layout Pass --- */
:root {
  --page-bg: #07111f;
  --page-bg-2: #0b1b35;
  --surface: #0f2137;
  --surface-2: #132943;
  --surface-3: #17385d;
  --text-primary: #ecf6ff;
  --text-secondary: #aebfd2;
  --border-color: rgba(129, 186, 238, 0.28);
  --bg-card: rgba(15, 33, 55, 0.86);
  --bg-main: #0b1b35;
  --shadow-md: 0 22px 60px rgba(0, 0, 0, 0.26);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 119, 211, 0.34), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(41, 211, 145, 0.13), transparent 24rem),
    linear-gradient(rgba(125, 181, 232, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 181, 232, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-2) 42rem, #08111f 100%);
  background-size: auto, auto, 32px 32px, 32px 32px, auto;
}

.container {
  width: min(100%, 1760px);
  max-width: none;
  padding: 0 clamp(1.25rem, 3vw, 4rem) 3rem;
  background: transparent;
  border: 0;
}

main {
  padding-top: clamp(1.5rem, 3vw, 3rem);
}

section {
  margin-bottom: clamp(2rem, 4vw, 4.5rem);
}

section h2 {
  color: #f7fbff;
  font-size: clamp(1.25rem, 1.5vw, 1.7rem);
  border-left-color: var(--cyan);
}

header.site-header {
  display: grid;
  grid-template-columns: auto minmax(18rem, 1fr) minmax(26rem, 0.95fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas:
    "avatar . links"
    "avatar name links"
    "avatar title links"
    "avatar . links";
  align-items: center;
  column-gap: clamp(1.5rem, 3vw, 4rem);
  row-gap: 0;
  text-align: left;
  margin: 0 calc(clamp(1.25rem, 3vw, 4rem) * -1);
  padding: clamp(2rem, 4vw, 4rem) clamp(1.25rem, 3vw, 4rem);
  min-height: 18rem;
  background:
    linear-gradient(135deg, rgba(7, 17, 31, 0.96), rgba(10, 40, 82, 0.94) 52%, rgba(0, 102, 204, 0.76)),
    #07111f;
}

.profile-icon {
  grid-area: avatar;
  width: clamp(112px, 9vw, 160px);
  height: clamp(112px, 9vw, 160px);
  margin: 0;
  border-color: rgba(130, 214, 255, 0.72);
}

.profile-card {
  grid-area: avatar;
  position: relative;
  z-index: 1;
  width: clamp(24rem, 28vw, 28rem);
  padding: 0.9rem;
  border: 1px solid rgba(130, 214, 255, 0.34);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(15, 33, 55, 0.9), rgba(7, 17, 31, 0.82));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.profile-card::before {
  content: "";
  display: block;
  height: 2.2rem;
  margin: -0.9rem -0.9rem 0.8rem;
  border-bottom: 1px solid rgba(130, 214, 255, 0.18);
  border-radius: 16px 16px 0 0;
  background:
    radial-gradient(circle at 1.1rem 1.1rem, #ff5f56 0 0.28rem, transparent 0.3rem),
    radial-gradient(circle at 2.1rem 1.1rem, #ffbd2e 0 0.28rem, transparent 0.3rem),
    radial-gradient(circle at 3.1rem 1.1rem, #27c93f 0 0.28rem, transparent 0.3rem),
    rgba(6, 18, 35, 0.72);
}

.profile-card .profile-icon {
  display: block;
  width: min(100%, 12.5rem);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid rgba(130, 214, 255, 0.72);
  box-shadow:
    0 0 0 5px rgba(0, 167, 225, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.profile-card .profile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-meta {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.profile-handle,
.profile-bio,
.profile-location,
.profile-time,
.profile-x {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #d7edff;
}

.profile-handle {
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.profile-bio {
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.35rem;
  border: 1px solid rgba(129, 186, 238, 0.2);
  border-radius: 8px;
  color: #eaf6ff;
  background: rgba(8, 21, 39, 0.74);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.profile-location,
.profile-time,
.profile-x {
  color: #9bd8ff;
}

.profile-location svg,
.profile-time svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.profile-x .brand-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}

header h1 {
  grid-area: name;
  font-size: clamp(2rem, 4vw, 4.2rem);
  letter-spacing: 0;
  margin: 0 0 0.75rem;
  white-space: nowrap;
}

header .title {
  grid-area: title;
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  margin: 0 0 0 0.5rem;
  color: #b9d8f4;
  opacity: 0.9;
  letter-spacing: 0.05em;
}

.links {
  grid-area: links;
  justify-content: flex-end;
  align-self: end;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.links a,
.link-disabled {
  min-height: 2.5rem;
  background: rgba(8, 21, 39, 0.72);
  border-color: rgba(126, 202, 255, 0.36);
  color: #f7fbff;
}

.links a svg,
.links a svg path,
.links a svg.brand-icon,
.links a svg.brand-icon path {
  fill: currentColor;
  stroke: none;
}

.links a i svg,
.links a > svg:not(.brand-icon) {
  fill: none;
  stroke: currentColor;
}

#introduction {
  margin: clamp(1.5rem, 3vw, 3rem) 0 clamp(2rem, 4vw, 4.5rem);
  padding: clamp(1.25rem, 3vw, 3rem);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.18), rgba(0, 167, 225, 0.06) 42%, rgba(41, 211, 145, 0.08)),
    rgba(8, 21, 39, 0.72);
  border: 1px solid rgba(129, 186, 238, 0.22);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 54px rgba(0, 0, 0, 0.2);
}

#introduction::before,
#introduction::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

#introduction::before {
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 30px, rgba(130, 214, 255, 0.08) 31px, transparent 32px),
    linear-gradient(180deg, transparent 0 30px, rgba(130, 214, 255, 0.06) 31px, transparent 32px);
  background-size: 64px 64px;
  opacity: 0.52;
}

#introduction::after {
  width: clamp(12rem, 22vw, 24rem);
  height: clamp(12rem, 22vw, 24rem);
  right: -6rem;
  top: -7rem;
  border: 1px solid rgba(82, 214, 255, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(82, 214, 255, 0.14), transparent 58%),
    repeating-radial-gradient(circle, rgba(82, 214, 255, 0.18) 0 1px, transparent 1px 20px);
}

.terminal-window {
  max-width: none;
  position: relative;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(13, 32, 56, 0.96), rgba(6, 18, 35, 0.96));
  border-color: rgba(82, 214, 255, 0.32);
}

.terminal-body {
  font-size: clamp(0.9rem, 1vw, 1.05rem);
  padding: clamp(1.25rem, 2vw, 2rem);
}

#skills,
#career,
#achievements,
#hobbies,
#recent-memo,
#memo-home,
#memo-list,
#memo-categories,
#categories,
#memo-tags,
#tags,
#tags-bottom,
#memo-post {
  background: rgba(13, 31, 56, 0.85); /* 透明度を少し下げて色を濃くする */
  border: 1px solid rgba(129, 186, 238, 0.25);
  border-radius: 18px;
  padding: clamp(1.25rem, 2.5vw, 2.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 3rem);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  background-clip: padding-box;
  z-index: 1; /* 重なりによるクリップ防止 */
}

#mobile-categories-bottom {
  display: none; /* デスクトップでは非表示 */
  margin-top: 2rem;
}

#tags-bottom {
  margin-top: 2rem;
}

#tags-bottom h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

#tags-bottom .skill-tags {
  padding: 1rem;
  border: 1px solid rgba(129, 186, 238, 0.28);
  border-radius: 14px;
  background: rgba(8, 22, 42, 0.5);
}

@media (max-width: 720px) {
  #categories,
  #tags {
    display: none; /* スマホでは上部のタグを非表示 */
  }

  #mobile-categories-bottom {
    display: block; /* スマホでは下部に表示 */
    border-radius: 14px;
    padding: 1rem;
    background: rgba(13, 31, 56, 0.85);
    border: 1px solid rgba(129, 186, 238, 0.25);
    overflow: hidden;
    position: relative;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
  }
}

#recent-memo {
  padding-right: 0;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-right: clamp(1.25rem, 2.5vw, 2.5rem);
  margin-bottom: 1.5rem;
}

.section-heading-row h2 {
  margin-bottom: 0;
}

.scroll-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scroll-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(129, 186, 238, 0.32);
  border-radius: 999px;
  color: #eaf6ff;
  background: rgba(8, 21, 39, 0.78);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.scroll-button:hover {
  transform: translateY(-1px);
  background: rgba(0, 119, 211, 0.32);
  border-color: var(--cyan);
}

.scroll-button svg {
  width: 1.2rem;
  height: 1.2rem;
}

.recent-memo-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(18rem, 28vw, 24rem);
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 1.5rem 0.75rem 0;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(82, 214, 255, 0.55) rgba(8, 21, 39, 0.72);
  scrollbar-width: thin;
}

.recent-memo-strip::-webkit-scrollbar {
  height: 10px;
}

.recent-memo-strip::-webkit-scrollbar-track {
  background: rgba(8, 21, 39, 0.72);
  border-radius: 999px;
}

.recent-memo-strip::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--cyan), var(--ops-green));
  border-radius: 999px;
}

.recent-memo-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  color: #edf7ff;
  text-decoration: none;
  border: 1px solid rgba(129, 186, 238, 0.24);
  border-radius: 14px;
  background: rgba(15, 33, 55, 0.82);
  scroll-snap-align: start;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.recent-memo-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: 0 18px 45px rgba(2, 28, 74, 0.2);
}

.recent-memo-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.14), rgba(82, 214, 255, 0.08)),
    #0b1b35;
}

.recent-memo-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.recent-memo-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--cyan);
}

.recent-memo-fallback svg {
  width: 3rem;
  height: 3rem;
}

.recent-memo-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem;
}

.recent-memo-date {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  color: #82d6ff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.recent-memo-date svg {
  width: 14px;
  height: 14px;
}

.recent-memo-content h3 {
  color: #f7fbff;
  font-size: 1rem;
  line-height: 1.45;
  margin-bottom: 0.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-memo-content p {
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

#skills h2,
#skills .skill-category-wide {
  grid-column: 1 / -1;
}

.skill-category {
  margin-bottom: 0;
  padding: 1.35rem;
  border: 1px solid rgba(129, 186, 238, 0.2);
  border-radius: 14px;
  background: rgba(15, 33, 55, 0.62);
}

.skill-category h3 {
  color: #82d6ff;
  font-size: 0.98rem;
  margin-bottom: 1.1rem;
}

.skill-tags,
.skill-tags-inner {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.75rem;
  row-gap: 0.85rem;
  align-items: flex-start;
}

.tag,
.tag:visited,
.show-more-btn {
  background: rgba(14, 35, 58, 0.88);
  border-color: rgba(129, 186, 238, 0.28);
  color: #eaf6ff !important;
  min-height: 2.25rem;
  height: auto;
  padding: 0.42rem 0.85rem;
  font-size: 0.92rem;
  line-height: 1.25;
}

.tag:hover,
.show-more-btn:hover {
  background: rgba(0, 119, 211, 0.28);
  color: #ffffff !important;
}

.tag-pride,
.tag-core {
  background: linear-gradient(135deg, #0066cc, #00a7e1);
  border-color: rgba(130, 214, 255, 0.7);
}

.achievement-cards {
  gap: 1.25rem;
}

@media (min-width: 1180px) {
  .achievement-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.achievement-card,
.card,
.author-profile,
.notice-block,
.balloon-content {
  background: rgba(15, 33, 55, 0.78);
  border-color: rgba(129, 186, 238, 0.24);
  color: #edf7ff;
}

.achievement-content h3,
.card h3,
.timeline-title,
.memo-content h2,
.memo-content h3,
.post-header h2,
.author-name {
  color: #f7fbff;
}

.achievement-content p,
.timeline-desc,
.card p,
.memo-content,
.author-bio,
.error-content p {
  color: var(--text-secondary);
}

.achievement-thumb {
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.14), rgba(82, 214, 255, 0.08)),
    #0b1b35;
}

.timeline-desc,
.memo-content :not(pre) > code,
.memo-content blockquote,
.memo-content li blockquote,
.memo-content details,
.memo-content summary {
  background: rgba(15, 33, 55, 0.78);
}

/* --- Article Readability Fixes for Dark Mode --- */
.memo-content {
  color: #d8e6f5;
}

.memo-content p,
.memo-content li {
  color: #d8e6f5;
}

.memo-content a {
  color: #7ed6ff;
  text-decoration-color: rgba(126, 214, 255, 0.65);
  text-underline-offset: 0.18em;
}

.memo-content strong {
  color: #ffffff;
}

.memo-content :not(pre) > code {
  background: rgba(126, 214, 255, 0.16);
  color: #d9fbff;
  border: 1px solid rgba(126, 214, 255, 0.44);
  box-shadow: inset 0 -1px 0 rgba(126, 214, 255, 0.22);
}

.notice-block,
.memo-content details,
.memo-content blockquote,
.memo-content li blockquote,
.balloon-content {
  background: rgba(20, 48, 78, 0.9);
  border-color: rgba(126, 214, 255, 0.32);
  color: #d8e6f5;
}

.caution-block {
  background: rgba(71, 48, 13, 0.92);
  border-color: rgba(240, 180, 74, 0.42);
  border-left-color: #f0b44a;
  color: #f8ead0;
}

.balloon-content::before {
  border-color: transparent rgba(20, 48, 78, 0.9) transparent transparent;
}

.balloon-content::after {
  border-color: transparent rgba(126, 214, 255, 0.32) transparent transparent;
}

.balloon.right .balloon-content::before {
  border-color: transparent transparent transparent rgba(20, 48, 78, 0.9);
}

.balloon.right .balloon-content::after {
  border-color: transparent transparent transparent rgba(126, 214, 255, 0.32);
}

.notice-title,
.balloon-title {
  color: #82d6ff;
}

.caution-title {
  color: #ffd28a;
}

.notice-content {
  color: #d8e6f5;
}

.caution-content {
  color: #f8ead0;
}

.notice-content p,
.notice-content li,
.balloon-content p,
.balloon-content li {
  color: #d8e6f5;
}

.caution-content p,
.caution-content li {
  color: #f8ead0;
}

.memo-content summary {
  background: rgba(23, 56, 93, 0.92);
  color: #f7fbff;
}

.memo-content summary:hover {
  background: rgba(0, 119, 211, 0.28);
}

.details-inner {
  background: rgba(11, 27, 53, 0.9);
  color: #d8e6f5;
}

.memo-content blockquote,
.memo-content li blockquote {
  color: #c8d9ea;
  border-left-color: var(--ops-green);
}

.memo-content blockquote p {
  color: #c8d9ea;
}

.image-caption {
  color: #aebfd2;
}

/* --- Article Width and Spacing --- */
#memo-post {
  max-width: none;
  width: 100%;
  padding: clamp(1.25rem, 2vw, 2rem);
}

.post-header {
  padding-left: 0.6rem;
}

.post-header h2 {
  padding-left: 1rem;
  margin-left: -0.6rem;
}

.post-header .achievement-thumb {
  margin-left: -0.6rem;
  margin-right: -0.6rem;
  width: calc(100% + 1.2rem);
}

.memo-content {
  padding-left: 0.6rem;
}

.memo-content h2 {
  padding-left: 1rem;
  margin-left: -0.6rem;
}

.author-profile {
  margin-left: 0.6rem;
  margin-right: 0.6rem;
}

footer {
  color: #8ea8c2;
}

@media (max-width: 1100px) {
  header.site-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "avatar name"
      "avatar title"
      "avatar links";
    column-gap: 2rem;
    min-height: 0;
    padding: 2rem clamp(1.25rem, 3vw, 4rem);
  }

  .links {
    justify-content: center;
    align-self: center;
    margin-top: 1rem;
  }

  #skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 1rem 1.5rem;
  }

  header.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 -1rem;
    min-height: 0;
    padding: 2rem 1rem;
  }

  .profile-icon {
    margin: 0 auto 1rem;
  }

  .profile-card {
    width: 95%;
    margin-bottom: 1.5rem;
  }

  .profile-card .profile-icon {
    width: 10rem;
    margin-bottom: 0;
  }

  .links {
    justify-content: center;
  }

  #introduction {
    width: auto;
    margin: 1rem 0 2rem;
    padding: 1rem;
    border-radius: 16px;
  }

  #introduction::after {
    right: -8rem;
    top: -8rem;
  }

  #skills,
  #career,
  #achievements,
  #hobbies,
  #recent-memo,
  #memo-home,
  #memo-list,
  #memo-categories,
  #categories,
  #memo-tags,
  #tags,
  #tags-bottom,
  #memo-post {
    border-radius: 14px;
    padding: 1rem;
    padding-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
  }

  .tag, .tag-sm {
    font-size: 0.75rem !important;
  }

  /* モバイルでタグが詰まりすぎないよう調整 */
  .skill-tags-inner {
    padding-bottom: 4px;
  }

  #skills {
    grid-template-columns: 1fr;
  }

  .recent-memo-strip {
    grid-auto-columns: minmax(16rem, 82vw);
    padding-right: 1rem;
  }

  .tag-sm,
  .tag-more {
    min-height: 1.95rem;
    padding: 0.35rem 0.75rem;
    line-height: 1.3;
  }
}

#achievements .achievement-thumb {
  aspect-ratio: 2 / 1;
}

/* --- Table Styles for Memo Content --- */
.memo-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(129, 186, 238, 0.25);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 33, 55, 0.6);
  font-size: 0.95rem;
}

.memo-content th {
  background: rgba(23, 56, 93, 0.95);
  color: #f7fbff;
  font-weight: bold;
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(129, 186, 238, 0.25);
}

.memo-content td {
  padding: 1rem;
  color: #d8e6f5;
  border-bottom: 1px solid rgba(129, 186, 238, 0.15);
  line-height: 1.6;
}

.memo-content tr:last-child td {
  border-bottom: none;
}

.memo-content tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.memo-content th:not(:last-child),
.memo-content td:not(:last-child) {
  border-right: 1px solid rgba(129, 186, 238, 0.15);
}

/* Mobile responsive table */
@media (max-width: 768px) {
  .memo-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: 0.85rem;
  }
}

/* --- Fix spacing after code blocks --- */
.memo-content pre {
  margin-bottom: 1.8rem !important;
}

}
