:root {
  --bg: #f4f6fb;
  --bg-card: #ffffff;
  --bg-hover: #dadada;
  --border: #cfcfcf;
  --accent: #4531b4;
  --accent2: #4a33c9;
  --text: #1a202c;
  --text-muted: #4a5568;
  --text-faint: #969696;
  --code-bg: #e6e6e6;
  --code-header-bg: #ffffff;
  --code-border: rgb(219, 219, 219);
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .1);
  --glow: 0 0 40px rgba(79, 110, 247, .12);

  --sb-track: #e8ebf2;
  --sb-thumb: #b4bcd4;
  --sb-thumb-hover: #8592b8;
  --sb-width: 8px;
  --sb-radius: 6px;
}

[data-theme="dark"] {
  --bg: #1c1c1e;
  --bg-card: #252527;
  --bg-hover: #2e2e30;
  --border: #3a3a3c;
  --accent: #6765da;
  --accent2: #4644b6;
  --text: #f0ede8;
  --text-muted: #9a9896;
  --text-faint: #5a5856;
  --code-bg: #0f172a;
  --code-header-bg: #1e293b;
  --code-border: #334155;
  --shadow: 0 4px 24px rgba(0, 0, 0, .55);
  --glow: 0 0 40px rgba(255, 255, 255, 0.116);

  --sb-track: #141414;
  --sb-thumb: #202020;
  --sb-thumb-hover: #313131;
}

.no-transition,
.no-transition *,
.no-transition *::before,
.no-transition *::after {
  transition: none !important;
  animation: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color .3s ease,
    background .3s ease,
    color .3s ease,
    border-color .3s ease,
    box-shadow .3s ease,
    fill .3s ease,
    stroke .1s ease;
}

html {
  scroll-behavior: smooth;

  scrollbar-width: thin;
  scrollbar-color: var(--sb-thumb) var(--sb-track);
}

::-webkit-scrollbar {
  width: var(--sb-width);
  height: var(--sb-width);
}

::-webkit-scrollbar-track {
  background: var(--sb-track);
  border-radius: var(--sb-radius);
}

::-webkit-scrollbar-thumb {
  background: var(--sb-thumb);
  border-radius: var(--sb-radius);
  border: 2px solid var(--sb-track);
  transition: background .2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sb-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: var(--sb-track);
}

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .3s, color .3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(244, 246, 251, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}

[data-theme="dark"] #site-header {
  background: rgba(28, 28, 30, .88);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.theme-light-show {
  display: block !important;
}

.theme-dark-show {
  display: none !important;
}

[data-theme="dark"] .theme-light-show {
  display: none !important;
}

[data-theme="dark"] .theme-dark-show {
  display: block !important;
}

.header-nav {
  display: flex;
  gap: 8px;
  margin-right: auto;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: .9rem;
  transition: color .2s, background .2s;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 36px 7px 36px;
  font-size: .875rem;
  width: 220px;
  transition: border-color .2s, box-shadow .2s, width .3s;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 142, 245, .2);
  width: 280px;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .2s;
}

.search-clear:hover {
  color: var(--text);
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

#main-content {
  flex: 1;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 36px 24px 28px;
  text-align: center;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(108, 142, 245, .15), rgba(167, 139, 250, .15));
  border: 1px solid rgba(108, 142, 245, .35);
  color: var(--accent);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

.tags-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  transition: background .3s, border-color .3s;
}

.tags-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.tags-group {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
  min-width: 0;
}

.tags-group::-webkit-scrollbar {
  display: none;
}

.tags-label {
  color: var(--text-muted);
  font-size: .8rem;
  flex-shrink: 0;
  transition: color .3s;
}

.tags-list {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.tag-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  cursor: pointer;
  transition: background .3s, border-color .3s, color .3s;
  white-space: nowrap;
}

.tag-btn:hover,
.tag-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  align-self: flex-end;
}

.sort-label {
  color: var(--text-muted);
  font-size: .8rem;
  flex-shrink: 0;
  transition: color .3s;
}

.sort-list {
  display: flex;
  background: var(--bg-hover);
  padding: 2px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.sort-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 18px;
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}

.sort-btn:hover {
  color: var(--text);
}

.sort-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

[data-theme="dark"] .sort-btn.active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

@media (max-width: 640px) {
  .tags-bar-inner {
    padding: 8px 16px;
    gap: 10px;
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease,
    background-color .3s ease, background .3s ease, color .3s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow), var(--glow);
  border-color: var(--accent);
}

.post-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.post-card-tag {
  background: rgba(108, 142, 245, .12);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
}

.post-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}

.post-card-desc {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.post-card-date {
  font-size: .78rem;
  color: var(--text-faint);
}

.post-card-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .76rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.post-card-views svg {
  opacity: .7;
  flex-shrink: 0;
}

.post-card-read {
  font-size: .78rem;
  color: var(--text-faint);
  margin-left: auto;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 280px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-text {
  color: var(--text-muted);
  font-size: 1rem;
}

.article-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.article-main {
  min-width: 0;
}

.article-sidebar {
  position: sticky;
  top: calc(var(--header-h, 60px) + 16px);
  align-self: start;
}

.article-meta-top {
  margin-bottom: 24px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: .875rem;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}

.back-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.article-tag {
  background: rgba(108, 142, 245, .12);
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}

.article-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.3;
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 24px;
}

.markdown-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-weight: 700;
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.markdown-body h1 {
  font-size: 1.8rem;
  margin: 40px 0 16px;
}

.markdown-body h2 {
  font-size: 1.4rem;
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.markdown-body h3 {
  font-size: 1.15rem;
  margin: 28px 0 10px;
  color: var(--accent);
}

.markdown-body h4 {
  font-size: 1rem;
  margin: 20px 0 8px;
}

.markdown-body p {
  margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 16px 24px;
}

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(108, 142, 245, .07);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 8px 14px;
  text-align: left;
}

.markdown-body th {
  background: var(--bg-hover);
  font-weight: 600;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.markdown-body a {
  color: var(--accent);
}

.markdown-body img {
  border-radius: 8px;
  margin: 16px 0;
  border: 1px solid var(--border);
}

.markdown-body :not(pre)>code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: .875em;
  color: var(--accent2);
}

.code-block-wrapper {
  position: relative;
  margin: 24px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--code-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .code-block-wrapper {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--code-header-bg);
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--code-border);
}

.code-lang {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 500;
  transition: all .2s ease;
}

.code-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--accent);
}

.code-copy-btn.copied {
  color: #10b981;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

[data-theme="dark"] .code-copy-btn.copied {
  color: #34d399;
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}

.code-block-wrapper pre {
  margin: 0;
  overflow-x: auto;
  padding: 16px 20px;
  background: var(--code-bg) !important;
}

.code-block-wrapper pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: .875rem;
  line-height: 1.6;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

:root {
  --hljs-text: #383a42;
  --hljs-keyword: #a626a4;
  --hljs-string: #50a14f;
  --hljs-number: #986801;
  --hljs-title: #4078f2;
  --hljs-attr: #d19a66;
  --hljs-built_in: #0184bc;
  --hljs-comment: #239c41;
  --hljs-meta: #e45649;
}

.hljs {
  color: var(--hljs-text) !important;
}

.hljs-keyword {
  color: var(--hljs-keyword) !important;
}

.hljs-string {
  color: var(--hljs-string) !important;
}

.hljs-number {
  color: var(--hljs-number) !important;
}

.hljs-title {
  color: var(--hljs-title) !important;
}

.hljs-attr {
  color: var(--hljs-attr) !important;
}

.hljs-built_in {
  color: var(--hljs-built_in) !important;
}

.hljs-comment {
  color: var(--hljs-comment) !important;
  font-style: italic;
}

.hljs-literal {
  color: var(--hljs-keyword) !important;
}

.hljs-type {
  color: var(--hljs-title) !important;
}

[data-theme="dark"] {
  --hljs-text: #abb2bf;
  --hljs-keyword: #c678dd;
  --hljs-string: #98c379;
  --hljs-number: #d19a66;
  --hljs-title: #61afef;
  --hljs-attr: #d19a66;
  --hljs-built_in: #e5c07b;
  --hljs-comment: #127a2c;
  --hljs-meta: #e06c75;
}

[data-theme="dark"] .hljs {
  color: var(--hljs-text) !important;
}

[data-theme="dark"] .hljs-keyword {
  color: var(--hljs-keyword) !important;
}

[data-theme="dark"] .hljs-string {
  color: var(--hljs-string) !important;
}

[data-theme="dark"] .hljs-number {
  color: var(--hljs-number) !important;
}

[data-theme="dark"] .hljs-title {
  color: var(--hljs-title) !important;
}

[data-theme="dark"] .hljs-attr {
  color: var(--hljs-attr) !important;
}

[data-theme="dark"] .hljs-built_in {
  color: var(--hljs-built_in) !important;
}

[data-theme="dark"] .hljs-comment {
  color: var(--hljs-comment) !important;
  font-style: italic;
}

[data-theme="dark"] .hljs-literal {
  color: var(--hljs-keyword) !important;
}

[data-theme="dark"] .hljs-type {
  color: var(--hljs-title) !important;
}

.md-callout {
  border-radius: 10px;
  padding: 14px 18px;
  margin: 24px 0;
  border-left: 4px solid;
}

.md-callout-header {
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.md-callout-body {
  font-size: .92rem;
  line-height: 1.7;
}

.md-callout.md-callout-note {
  background: rgba(59, 130, 246, .08);
  border-color: #3b82f6;
}

.md-callout-note .md-callout-header {
  color: #3b82f6;
}

.md-callout.md-callout-tip {
  background: rgba(16, 185, 129, .08);
  border-color: #10b981;
}

.md-callout-tip .md-callout-header {
  color: #10b981;
}

.md-callout.md-callout-important {
  background: rgba(168, 85, 247, .08);
  border-color: #a855f7;
}

.md-callout-important .md-callout-header {
  color: #a855f7;
}

.md-callout.md-callout-warning {
  background: rgba(245, 158, 11, .08);
  border-color: #f59e0b;
}

.md-callout-warning .md-callout-header {
  color: #f59e0b;
}

.md-callout.md-callout-caution {
  background: rgba(239, 68, 68, .08);
  border-color: #ef4444;
}

.md-callout-caution .md-callout-header {
  color: #ef4444;
}

.md-blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(108, 142, 245, .07);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}

mark.md-highlight {
  background: rgba(245, 158, 11, .22);
  color: var(--text);
  border-radius: 3px;
  padding: 1px 5px;
  font-style: normal;
}

[data-theme="dark"] mark.md-highlight {
  background: rgba(245, 158, 11, .28);
}

u.md-underline {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-size: 100% 2px;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  font-style: normal;
}

.md-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 1px 11px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  vertical-align: middle;
  line-height: 1.8;
}

.md-kbd {
  display: inline-block;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--border);
  border-radius: 5px;
  padding: 1px 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78em;
  color: var(--text-muted);
  vertical-align: middle;
  line-height: 1.8;
}

.unity-player-wrapper {
  margin: 32px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow);
}

.unity-player-container {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: #000;
}

.unity-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;

  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.unity-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #050508;
  z-index: 10;
  gap: 16px;
  transition: opacity .5s;
}

.unity-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.unity-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(108, 142, 245, .2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.unity-loading-text {
  color: #9aa3b5;
  font-size: .9rem;
}

.unity-progress-bar-outer {
  width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, .1);
  border-radius: 4px;
  overflow: hidden;
}

.unity-progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width .2s;
  width: 0%;
}

.unity-progress-pct {
  color: #6c88a2;
  font-size: .78rem;
}

.unity-error-msg {
  color: #f87171;
  font-size: .85rem;
  text-align: center;
  max-width: 360px;
  padding: 0 16px;
}

.unity-controls {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
  background: #080808;
  border-top: 1px solid #1a1a1a;
}

.unity-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #9aa3b5;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: .8rem;
  transition: all .2s;
}

.unity-fullscreen-btn:hover {
  background: rgba(108, 142, 245, .2);
  border-color: var(--accent);
  color: #fff;
}

.unity-fullscreen-btn svg {
  width: 15px;
  height: 15px;
}

.unity-player-container:fullscreen,
.unity-player-container:-webkit-full-screen,
.unity-player-container:-ms-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.unity-player-container:fullscreen .unity-canvas,
.unity-player-container:-webkit-full-screen .unity-canvas,
.unity-player-container:-ms-fullscreen .unity-canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: calc(100vh * 16 / 9) !important;
  max-height: calc(100vw * 9 / 16) !important;
  aspect-ratio: 16 / 9 !important;
  margin: auto !important;
  display: block;
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.article-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}

.article-nav-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.article-nav-btn.next {
  text-align: right;
}

.nav-dir {
  font-size: .78rem;
  color: var(--accent);
  font-weight: 600;
}

.nav-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}

.toc-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.toc-header {
  padding: 12px 16px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
  flex-shrink: 0;
}

.toc-nav {
  padding: 10px 0;
  max-height: calc(100vh - var(--header-h) - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.toc-nav::-webkit-scrollbar {
  width: 5px;
}

.toc-nav::-webkit-scrollbar-track {
  background: transparent;
}

.toc-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.toc-nav::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.toc-link {
  display: block;
  padding: 5px 16px;
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s, background .2s;
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-link.level-3 {
  padding-left: 28px;
  font-size: .78rem;
}

.not-found {
  text-align: center;
  padding: 120px 24px;
}

.not-found-code {
  font-size: 6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 16px;
}

.not-found-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.not-found-text {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
}

.btn-primary:hover {
  opacity: .85;
  transform: translateY(-2px);
}

#site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.footer-copy {
  color: var(--text-faint);
  font-size: .82rem;
}

.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(108, 142, 245, .5);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .3s, transform .3s;
  z-index: 200;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
}

.scroll-top:hover {
  transform: translateY(-2px);
}

.muku-ai-usage-container {
  padding: 10px 14px;
  background: var(--bg-hover);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.muku-ai-usage-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.muku-ai-usage-percent {
  font-family: sans-serif;
  font-weight: 700;
  color: #ffa600;
}

.muku-ai-usage-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.muku-ai-usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #ffb310, #d68a19, #ffb310);

  width: 100%;
  transition: width 3s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.muku-ai-usage-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #eab308);
}

.muku-ai-usage-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f43f5e);
}

.muku-ai-usage-text {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: right;
  font-weight: 500;
}

.muku-ai-usage-limit-warning {
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.08);
  border-top: 1px solid rgba(239, 68, 68, 0.16);
  color: #ef4444;
  font-size: 0.78rem;
  line-height: 1.4;
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.muku-ai {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 260;
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

.muku-ai.is-moving,
.muku-ai.is-resizing {
  user-select: none;
}

.muku-ai-toggle {
  min-width: 128px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 700;
  transition:
    opacity .2s ease,
    transform .2s ease,
    background-color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.muku-ai-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.muku-ai.is-open .muku-ai-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.96);
}

.muku-ai-toggle-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #d46f18;
  color: #fff;
  font-size: .72rem;
  letter-spacing: 0;
}

.muku-ai-toggle-text {
  font-size: .9rem;
}

.muku-ai-panel {
  position: fixed;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 24px));
  min-width: min(300px, calc(100vw - 24px));
  min-height: min(360px, calc(100vh - 24px));
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .18), var(--shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(.97);
  transform-origin: 24px calc(100% - 24px);
  transition:
    opacity .22s ease,
    transform .24s cubic-bezier(.2, .8, .2, 1),
    visibility 0s linear .24s,
    background-color .3s ease,
    border-color .3s ease,
    box-shadow .3s ease;
}

.muku-ai.is-open .muku-ai-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity .18s ease,
    transform .24s cubic-bezier(.2, .8, .2, 1),
    visibility 0s,
    background-color .3s ease,
    border-color .3s ease,
    box-shadow .3s ease;
}

.muku-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
  cursor: move;
  touch-action: none;
}

.muku-ai-label {
  color: #c4830c;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.muku-ai-title {
  color: var(--text);
  font-size: .98rem;
  line-height: 1.35;
  margin: 2px 0 0;
}

.muku-ai-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.muku-ai-close:hover {
  color: var(--text);
  border-color: var(--accent);
}

.muku-ai-messages {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 120px;
}

.muku-ai-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.muku-ai-message.is-user {
  align-items: flex-end;
}

.muku-ai-message.is-fullwidth {
  align-items: stretch;
}

.muku-ai-bubble {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.muku-ai-message.is-user .muku-ai-bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.muku-ai-message.is-pending .muku-ai-bubble {
  color: #ffffff00;
}

.muku-ai-message-content {
  width: 100%;
  padding: 6px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: .88rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.muku-ai-message-content.is-typing {
  white-space: pre-wrap;
}

.muku-ai-type-char {
  animation: muku-ai-char-fade 0.5s ease forwards;
  opacity: 0;
  display: inline;
}

.muku-ai-type-char.finished {
  animation: none;
  opacity: 1;
}

[data-theme="dark"] .muku-ai-message-content {
  background: transparent;
  box-shadow: none;
}

.muku-ai-message-content.is-typing::after {
  display: none;
}

@keyframes muku-ai-caret-blink {
  50% {
    opacity: 0;
  }
}

@keyframes muku-ai-char-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.muku-ai-refs {
  max-width: 90%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.muku-ai-refs a {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 118, 110, .1);
  color: #0f766e;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.muku-ai-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.muku-ai-input {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  font-size: .88rem;
  line-height: 22px;
  outline: none;
  overflow-y: hidden;
}

.muku-ai-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(69, 49, 180, .16);
}

.muku-ai-send {
  align-self: end;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(69, 49, 180, .28);
  transition:
    transform .18s ease,
    opacity .2s ease,
    box-shadow .2s ease;
}

.muku-ai-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(69, 49, 180, .34);
}

.muku-ai-send svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateX(.5px) translateY(-.5px);
}

.muku-ai-send:disabled,
.muku-ai-input:disabled {
  opacity: .65;
  cursor: wait;
}

.muku-ai-resize {
  position: absolute;
  touch-action: none;
  z-index: 2;
}

.muku-ai-resize-n,
.muku-ai-resize-s {
  left: 14px;
  right: 14px;
  height: 8px;
  cursor: ns-resize;
}

.muku-ai-resize-n {
  top: -3px;
}

.muku-ai-resize-s {
  bottom: -3px;
}

.muku-ai-resize-e,
.muku-ai-resize-w {
  top: 14px;
  bottom: 14px;
  width: 8px;
  cursor: ew-resize;
}

.muku-ai-resize-e {
  right: -3px;
}

.muku-ai-resize-w {
  left: -3px;
}

.muku-ai-resize-ne,
.muku-ai-resize-nw,
.muku-ai-resize-se,
.muku-ai-resize-sw {
  width: 18px;
  height: 18px;
}

.muku-ai-resize-ne {
  top: -3px;
  right: -3px;
  cursor: nesw-resize;
}

.muku-ai-resize-nw {
  top: -3px;
  left: -3px;
  cursor: nwse-resize;
}

.muku-ai-resize-se {
  right: -3px;
  bottom: -3px;
  cursor: nwse-resize;
}

.muku-ai-resize-sw {
  left: -3px;
  bottom: -3px;
  cursor: nesw-resize;
}

.muku-ai-resize-se::before {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  opacity: .8;
}

.muku-ai-bubble .code-block-wrapper {
  margin: 8px 0;
}

.muku-ai-bubble pre {
  white-space: pre;
  overflow-x: auto;
}

.muku-ai-bubble pre code {
  white-space: pre;
}

.muku-ai-bubble p {
  margin: 4px 0;
}

.muku-ai-bubble ul,
.muku-ai-bubble ol {
  margin: 4px 0;
  padding-left: 20px;
}

.muku-ai-bubble li {
  margin: 2px 0;
}

.muku-ai-bubble h1,
.muku-ai-bubble h2,
.muku-ai-bubble h3,
.muku-ai-bubble h4,
.muku-ai-bubble h5,
.muku-ai-bubble h6 {
  margin: 6px 0 4px 0;
  font-weight: 600;
  line-height: 1.4;
}

.muku-ai-bubble h1 {
  font-size: 1rem;
}

.muku-ai-bubble h2 {
  font-size: .95rem;
}

.muku-ai-bubble h3 {
  font-size: .90rem;
}

.muku-ai-bubble blockquote {
  margin: 6px 0;
  padding-left: 10px;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
  font-style: italic;
}

.muku-ai-bubble a {
  color: var(--accent);
  text-decoration: underline;
}

.muku-ai-bubble strong {
  font-weight: 700;
}

.muku-ai-bubble em {
  font-style: italic;
}

.muku-ai-message-content .code-block-wrapper {
  margin: 16px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--code-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .muku-ai-message-content .code-block-wrapper {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.muku-ai-message-content .code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--code-header-bg);
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--code-border);
}

.muku-ai-message-content .code-lang {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.muku-ai-message-content .code-copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 500;
  transition: all .2s ease;
}

.muku-ai-message-content .code-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--accent);
}

.muku-ai-message-content .code-copy-btn.copied {
  color: #10b981;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

[data-theme="dark"] .muku-ai-message-content .code-copy-btn.copied {
  color: #34d399;
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}

.muku-ai-message-content pre {
  margin: 0;
  overflow-x: auto;
  padding: 16px 20px;
  background: var(--code-bg) !important;
}

.muku-ai-message-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: .875rem;
  line-height: 1.6;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.muku-ai-message-content p {
  margin: 8px 0;
  line-height: 1.75;
}

.muku-ai-message-content ul,
.muku-ai-message-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.muku-ai-message-content li {
  margin: 4px 0;
}

.muku-ai-message-content h1,
.muku-ai-message-content h2,
.muku-ai-message-content h3,
.muku-ai-message-content h4,
.muku-ai-message-content h5,
.muku-ai-message-content h6 {
  margin: 12px 0 6px 0;
  font-weight: 600;
  line-height: 1.4;
}

.muku-ai-message-content h1 {
  font-size: 1.1rem;
}

.muku-ai-message-content h2 {
  font-size: 1rem;
}

.muku-ai-message-content h3 {
  font-size: .95rem;
}

.muku-ai-message-content blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--bg-hover);
  border-radius: 4px;
  color: var(--text-muted);
  font-style: italic;
}

.muku-ai-message-content a {
  color: var(--accent);
  text-decoration: underline;
}

.muku-ai-message-content strong {
  font-weight: 700;
}

.muku-ai-message-content em {
  font-style: italic;
}

@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    display: none;
  }
}

@media (max-width: 640px) {
  .search-input {
    width: 140px;
  }

  .search-input:focus {
    width: 160px;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 48px 16px 40px;
  }

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

  .container {
    padding: 24px 16px 60px;
  }

  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .article-layout {
    padding: 24px 16px 60px;
  }

  .scroll-top {
    bottom: 16px;
    right: 16px;
  }

  .muku-ai {
    left: 16px;
    bottom: 16px;
  }

  .muku-ai-toggle {
    min-width: 46px;
    width: 46px;
    padding: 0;
  }

  .muku-ai-toggle-text {
    display: none;
  }

  .muku-ai-panel {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toc-mobile-wrapper {
  display: none;
  margin: 24px 0;
}

@media (max-width: 960px) {


  .article-sidebar {
    display: none;
  }


  .toc-mobile-wrapper {
    display: block;
  }


  .toc-mobile-wrapper .toc-box {
    width: 100%;
    background-color: var(--bg-hover);
    border: 1px solid var(--border);
  }
}

.muku-ai-message-content .md-toc-link {
  color: #007bff;

  text-decoration: underline;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.muku-ai-message-content .md-toc-link:hover {
  opacity: 0.7;
  color: #0056b3;
}

:target {
  scroll-margin-top: 80px;
}

.not-found-img {
  width: 300px;
  height: 225px;
  position: absolute;
  left: calc(50% + 30px);
  top: 25%;
  transform: translate(-50%, -50%);
}