:root {
  --bg: #f6f8fb;
  --paper: #ffffff;
  --paper-soft: #fbfcfe;
  --ink: #121817;
  --muted: #66716f;
  --line: rgba(18, 24, 23, 0.12);
  --line-strong: rgba(18, 24, 23, 0.2);
  --accent: #0f8c7a;
  --accent-2: #c24a5a;
  --accent-3: #2f69c8;
  --warm: #f3b44b;
  --soft: #eaf4f2;
  --code: #101615;
  --shadow: 0 18px 46px rgba(20, 29, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 420px),
    var(--bg);
  font-family: "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Arial, "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.75;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

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

::selection {
  color: #fff;
  background: var(--accent);
}

.blog-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 46px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 120px;
}

.brand img {
  display: block;
  width: min(212px, 38vw);
}

.blog-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-nav a,
.tool-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
}

.blog-nav a {
  color: var(--muted);
}

.blog-nav a:hover,
.ghost-button {
  color: var(--ink);
  background: var(--soft);
  border-color: var(--line);
}

.blog-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 72px) 0 86px;
}

.blog-index-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 30px;
  padding: clamp(28px, 6vw, 56px);
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 140, 122, 0.96), rgba(47, 105, 200, 0.92) 62%, rgba(194, 74, 90, 0.92)),
    #0f8c7a;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.blog-index-head::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 36px 36px;
  content: "";
  opacity: 0.25;
}

.blog-index-head > * {
  position: relative;
}

.section-label,
.article-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.blog-index-head .section-label {
  color: rgba(255, 255, 255, 0.78);
}

.blog-index-head h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 0.98;
}

.blog-index-head p:not(.section-label) {
  max-width: 620px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.blog-index-meta {
  display: grid;
  place-items: center;
  width: 118px;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.blog-index-meta span {
  display: block;
  font-size: 2.45rem;
  font-weight: 900;
  line-height: 1;
}

.blog-index-meta small {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 800;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.post-card {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  content-visibility: auto;
  contain-intrinsic-size: 240px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.post-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-3), var(--accent-2));
  content: "";
  opacity: 0;
  transition: opacity 160ms ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 140, 122, 0.38);
  box-shadow: var(--shadow);
}

.post-card:hover::before {
  opacity: 1;
}

.post-card a {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 238px;
  text-decoration: none;
}

.post-card-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 140, 122, 0.92), rgba(47, 105, 200, 0.84)),
    var(--soft);
  border-bottom: 1px solid var(--line);
}

.post-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.post-card:hover .post-card-image img {
  transform: scale(1.035);
}

.post-card-image-empty {
  position: relative;
}

.post-card-image-empty::after {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  content: "";
}

.post-card-body {
  display: block;
  padding: 22px 24px 24px;
}

.post-card time {
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 900;
}

.post-card h2 {
  margin: 14px 0 10px;
  font-size: clamp(1.18rem, 2vw, 1.42rem);
  line-height: 1.35;
}

.post-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-tags,
.tag-row span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.article-wrap {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(30px, 6vw, 58px) 0 86px;
}

.article {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.article-head {
  position: relative;
  padding: clamp(32px, 7vw, 68px);
  background:
    linear-gradient(180deg, rgba(234, 244, 242, 0.78), rgba(255, 255, 255, 0)),
    var(--paper);
  border-bottom: 1px solid var(--line);
}

.article-head::after {
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 28px;
  background: linear-gradient(90deg, var(--accent), var(--warm), var(--accent-2));
  border-radius: 999px;
  content: "";
}

.article-head h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(1.9rem, 5.4vw, 3.7rem);
  line-height: 1.12;
}

.article-lead {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag-row span {
  padding: 4px 10px;
  background: var(--soft);
  border: 1px solid rgba(15, 140, 122, 0.12);
  border-radius: 999px;
}

.eyecatch {
  margin: 0;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.eyecatch img {
  display: block;
  width: 100%;
}

.article-body {
  padding: clamp(30px, 7vw, 68px);
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body > :last-child {
  margin-bottom: 0;
}

.article-body h2 {
  margin: 52px 0 16px;
  padding-top: 8px;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.32;
}

.article-body h2::before {
  display: block;
  width: 42px;
  height: 3px;
  margin-bottom: 13px;
  background: var(--accent);
  border-radius: 999px;
  content: "";
}

.article-body h3 {
  margin: 38px 0 12px;
  font-size: 1.23rem;
  line-height: 1.42;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote {
  margin: 22px 0;
}

.article-body p,
.article-body li {
  font-size: 1.04rem;
}

.article-body a {
  color: var(--accent-3);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.article-body a:hover {
  color: var(--accent-2);
}

.article-body blockquote {
  padding: 14px 18px;
  color: var(--muted);
  background: var(--soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.article-body pre {
  overflow-x: auto;
  padding: 18px;
  color: #f4fff9;
  background: var(--code);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.article-body code {
  padding: 0.16em 0.35em;
  color: #0f5f55;
  background: var(--soft);
  border-radius: 5px;
}

.article-body pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.article-body table {
  width: 100%;
  margin: 28px 0;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

.article-body th,
.article-body td {
  padding: 10px;
  border: 1px solid var(--line);
}

.article-body th {
  background: var(--paper-soft);
}

.article-body figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-body figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: center;
}

.article-body .small-media img {
  width: min(288px, 100%);
}

.article-body .medium-media img {
  width: min(372px, 100%);
}

.article-body .embed {
  position: relative;
  width: 100%;
  margin: 36px 0;
  overflow: hidden;
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-body .embed::before {
  display: block;
  padding-top: 56.25%;
  content: "";
}

.article-body .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.article-body .profile-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 32px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-body .profile-link:hover {
  border-color: var(--accent);
}

.article-body .profile-link img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.article-body .link-card,
.article-body .file-card {
  display: flex;
  gap: 16px;
  margin: 36px 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.article-body .link-card:hover,
.article-body .file-card:hover {
  border-color: var(--accent);
}

.article-body .link-card-body,
.article-body .file-card-body {
  flex: 1;
  padding: 16px;
}

.article-body .link-card-title,
.article-body .file-card-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  line-height: 1.5;
}

.article-body .link-card-desc,
.article-body .link-card-url,
.article-body .file-card-note {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.article-body .link-card-image {
  flex: 0 0 190px;
  min-height: 132px;
  background: center / cover no-repeat;
  border-left: 1px solid var(--line);
}

.article-body .file-card {
  align-items: center;
}

.article-body .file-card-button {
  margin: 16px;
  padding: 9px 14px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 800;
  background: var(--ink);
  border-radius: 8px;
  white-space: nowrap;
}

.article-body .list-like,
.article-body .source-note {
  padding: 18px 20px;
  background: var(--soft);
  border-radius: 8px;
}

.article-body .source-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.post-nav a {
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.post-nav a:hover {
  border-color: var(--accent);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.editor-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: -12px 0 24px;
}

.editor-guide div {
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 29, 36, 0.04);
}

.editor-guide strong,
.editor-guide span {
  display: block;
}

.editor-guide strong {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 0.92rem;
}

.editor-guide span,
.help-text {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.editor-main,
.preview-panel {
  grid-column: 2;
}

.preview-panel {
  position: sticky;
  top: 82px;
}

.panel {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 29, 36, 0.05);
}

.panel-head {
  padding: 16px 18px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.panel-body {
  padding: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.field input[type="file"] {
  padding: 8px;
}

.file-field {
  margin-top: 14px;
}

.field input:focus,
.field textarea:focus,
.markdown-input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 140, 122, 0.14);
}

.field textarea {
  min-height: 128px;
  resize: vertical;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.tool-button {
  color: #fff;
  background: var(--ink);
}

.tool-button:hover {
  background: #26302e;
}

.tool-button.secondary {
  color: var(--ink);
  background: var(--soft);
  border-color: var(--line);
}

.tool-button.secondary:hover,
.ghost-button:hover {
  border-color: var(--accent);
}

.markdown-input {
  width: 100%;
  min-height: 520px;
  padding: 18px;
  color: var(--ink);
  background: #fff;
  border: 0;
  resize: vertical;
  font: 0.98rem/1.7 Consolas, "SFMono-Regular", Menlo, monospace;
}

.html-input {
  min-height: 210px;
  font: 0.92rem/1.65 Consolas, "SFMono-Regular", Menlo, monospace;
}

.preview {
  min-height: 520px;
  padding: 24px;
  background: #fff;
}

.article-preview {
  padding: 0;
  background: var(--bg);
}

.article-preview .article {
  width: 100%;
  box-shadow: none;
}

.preview-article .article-head {
  padding: 30px;
}

.preview-article .article-head h1 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.preview-article .article-body {
  padding: 30px;
}

.preview h1,
.preview h2,
.preview h3 {
  line-height: 1.3;
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}

.stats-grid div {
  display: grid;
  gap: 2px;
  padding: 10px;
  text-align: center;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-grid strong {
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.button-row.stack {
  align-items: stretch;
  flex-direction: column;
}

.button-row.stack .tool-button,
.button-row.stack .ghost-button {
  width: 100%;
}

.output-box {
  display: grid;
  gap: 5px;
  margin: 12px 0 16px;
  padding: 12px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.output-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.output-box code {
  overflow-wrap: anywhere;
  color: var(--accent-3);
  font-size: 0.9rem;
}

.image-preview {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin-bottom: 14px;
  overflow: hidden;
  color: var(--muted);
  background:
    linear-gradient(45deg, #f0f3f6 25%, transparent 25%),
    linear-gradient(-45deg, #f0f3f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f3f6 75%),
    linear-gradient(-45deg, transparent 75%, #f0f3f6 75%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #fff;
}

.asset-list {
  display: grid;
  gap: 10px;
}

.asset-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.asset-item img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.asset-item strong,
.asset-item code {
  display: block;
  overflow-wrap: anywhere;
}

.asset-item strong {
  font-size: 0.9rem;
  line-height: 1.35;
}

.asset-item code {
  margin: 4px 0 8px;
  color: var(--accent-3);
  font-size: 0.72rem;
}

.asset-item input {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.86rem;
}

.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.asset-actions button {
  min-height: 30px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.asset-actions button:hover {
  border-color: var(--accent);
}

.check-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.check-list span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: #fff;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

.check-list .ok span {
  background: var(--accent);
}

.check-list .warn span {
  background: var(--accent-2);
}

.empty-state {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 760px) {
  .blog-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .blog-nav {
    justify-content: flex-start;
  }

  .blog-index-head {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .blog-index-head h1 {
    line-height: 1.08;
  }

  .blog-index-meta {
    width: 92px;
  }

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

  .editor-guide {
    grid-template-columns: 1fr;
  }

  .editor-main,
  .preview-panel {
    grid-column: auto;
  }

  .preview-panel {
    position: static;
  }

  .asset-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .asset-item img {
    width: 64px;
    height: 64px;
  }

  .article-body .link-card,
  .article-body .file-card {
    display: block;
  }

  .article-body .link-card-image {
    height: 180px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .markdown-input,
  .preview {
    min-height: 380px;
  }
}
