:root {
  --bg: #f6f2ee;
  --panel: #fffaf6;
  --paper: #fffdf9;
  --ink: #24232d;
  --muted: #74707c;
  --line: #e5ddd4;
  --violet: #6e4aa8;
  --rose: #cf5e7d;
  --teal: #18847d;
  --gold: #c9953a;
  --shadow: 0 24px 70px rgba(35, 31, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(207, 94, 125, 0.14), transparent 28rem),
    linear-gradient(135deg, #faf5ef 0%, #f3eee9 42%, #eef5f4 100%);
  font-family: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: rgba(255, 250, 246, 0.92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--rose));
  border-radius: 18px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(110, 74, 168, 0.24);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
}

.brand-block p,
.status,
.eyebrow,
.entry-meta,
.blog-date,
.blog-source {
  color: var(--muted);
}

.panel-section {
  display: grid;
  gap: 10px;
}

.section-caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.local-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 6px;
  color: #3f3947;
  font-size: 13px;
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea,
input {
  padding: 11px 12px;
}

select {
  padding: 10px 12px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(110, 74, 168, 0.12);
}

textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.45;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--violet);
}

.range-row {
  grid-template-columns: auto minmax(34px, auto);
  align-items: center;
}

.range-row input {
  grid-column: 1 / -1;
}

.slider-value {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inline-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 74, 168, 0.42);
  box-shadow: 0 12px 26px rgba(35, 31, 43, 0.10);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.button.primary {
  color: #fff;
  border-color: transparent;
  background: var(--violet);
}

.button.accent {
  color: #fff;
  border-color: transparent;
  background: var(--teal);
}

.button.subtle {
  min-height: 36px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
}

.status {
  margin-top: auto;
  padding: 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.35;
}

.status.is-error {
  color: #a33c4d;
  border-color: rgba(207, 94, 125, 0.35);
  background: rgba(207, 94, 125, 0.08);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  min-height: 100vh;
}

.list-pane {
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.56);
  overflow: auto;
}

.pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 900;
}

.pane-heading strong {
  color: var(--violet);
  font-size: 24px;
}

.feed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

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

.entry-item {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.entry-item:hover,
.entry-item.is-selected {
  border-color: var(--violet);
  box-shadow: 0 10px 24px rgba(35, 31, 43, 0.09);
}

.entry-item.is-translated {
  border-left: 4px solid var(--teal);
}

.entry-title {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 850;
  line-height: 1.38;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.entry-meta {
  margin-top: 8px;
  font-size: 12px;
}

.preview-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
  overflow: auto;
}

.preview-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.preview-toolbar h2 {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.2;
}

.eyebrow {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#sourceLink {
  color: var(--violet);
  font-weight: 900;
  text-decoration: none;
}

.blog-card {
  justify-self: center;
  width: min(760px, 100%);
  min-height: 840px;
  padding: 54px;
  border: 1px solid rgba(36, 35, 45, 0.08);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.blog-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(110, 74, 168, 0.12) 0 12px, transparent 12px),
    radial-gradient(circle at 88% 8%, rgba(201, 149, 58, 0.16), transparent 12rem);
}

.theme-sakura::before {
  background:
    linear-gradient(90deg, rgba(207, 94, 125, 0.14) 0 12px, transparent 12px),
    radial-gradient(circle at 88% 8%, rgba(24, 132, 125, 0.12), transparent 12rem);
}

.theme-ink::before {
  background:
    linear-gradient(90deg, rgba(36, 35, 45, 0.16) 0 12px, transparent 12px),
    radial-gradient(circle at 88% 8%, rgba(110, 74, 168, 0.12), transparent 12rem);
}

.blog-card.theme-official {
  background: #fff;
}

.theme-official::before {
  background:
    linear-gradient(180deg, var(--member-a, #b447c8) 0 5px, transparent 5px),
    linear-gradient(145deg, var(--member-soft-a, rgba(180, 71, 200, 0.12)), transparent 34%, var(--member-soft-b, rgba(127, 42, 165, 0.12))),
    linear-gradient(180deg, transparent 0 208px, rgba(247, 247, 248, 0.94) 208px 420px, transparent 420px);
}

.theme-official .blog-kicker {
  justify-content: center;
  margin-bottom: 58px;
  color: var(--member-a, #b447c8);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.16em;
}

.theme-official .blog-member {
  color: var(--member-a, #b447c8);
}

.theme-official .blog-date {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  margin-top: 26px;
}

.theme-official .blog-title {
  color: var(--member-a, #b447c8);
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 34px;
  font-weight: 500;
  margin-bottom: 0;
}

.theme-official .blog-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 0 -54px 32px;
  min-height: 214px;
  padding: 46px 54px 48px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.34)),
    #f7f7f8;
}

.theme-official .blog-title-meta {
  min-width: 0;
}

.theme-official .blog-share {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #d9dce4;
  border-radius: 50%;
  color: #4c5260;
  background: rgba(255, 255, 255, 0.72);
  position: relative;
}

.theme-official .blog-share::before,
.theme-official .blog-share::after {
  content: "";
  position: absolute;
  left: 17px;
  width: 15px;
  height: 1.5px;
  background: #4c5260;
  transform-origin: left center;
}

.theme-official .blog-share::before {
  top: 17px;
  transform: rotate(-28deg);
}

.theme-official .blog-share::after {
  top: 25px;
  transform: rotate(28deg);
}

.theme-official .blog-share i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4c5260;
}

.theme-official .blog-share i:nth-child(1) {
  left: 12px;
  top: 19px;
}

.theme-official .blog-share i:nth-child(2) {
  right: 12px;
  top: 12px;
}

.theme-official .blog-share i:nth-child(3) {
  right: 12px;
  bottom: 12px;
}

.theme-official .blog-source {
  margin-bottom: 56px;
}

.blog-card > * {
  position: relative;
}

.blog-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.blog-member-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.blog-roman {
  color: currentColor;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0.56;
}

.blog-member {
  color: var(--violet);
}

.theme-sakura .blog-member {
  color: var(--rose);
}

.theme-ink .blog-member {
  color: var(--ink);
}

.blog-title {
  margin-bottom: 16px;
  font-size: 42px;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
}

.blog-title-row {
  display: block;
}

.blog-title-meta {
  min-width: 0;
}

.blog-share {
  display: none;
}

[contenteditable="true"] {
  border-radius: 6px;
  outline: 0;
  transition: background 160ms ease, box-shadow 160ms ease;
}

[contenteditable="true"]:hover {
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.58);
}

[contenteditable="true"]:focus {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 3px var(--member-mid-a, rgba(110, 74, 168, 0.24));
}

.blog-summary {
  margin: 20px 0 30px;
  padding-left: 18px;
  border-left: 4px solid var(--gold);
  color: #514b58;
  font-size: 18px;
  line-height: 1.7;
  font-weight: 700;
}

.blog-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 34px;
}

.blog-photo {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(36, 35, 45, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  aspect-ratio: 4 / 3;
}

.blog-photo:first-child:nth-last-child(1) {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.blog-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-body .blog-photo {
  width: 100%;
  margin: 8px 0;
}

.blog-body .blog-photo img {
  object-fit: contain;
  background: #fff;
}

.blog-body {
  display: grid;
  gap: var(--body-paragraph-gap, 34px);
  color: #202638;
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans", "Meiryo", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: var(--body-font-size, 20px);
  font-weight: 500;
  line-height: var(--body-line-height, 1.85);
}

.blog-body p {
  margin: 0;
  white-space: pre-wrap;
}

.blog-body ruby {
  ruby-position: over;
}

.blog-body rt {
  color: currentColor;
  font-size: var(--ruby-size, 10px);
  font-weight: 800;
  line-height: 1;
  opacity: var(--ruby-opacity, 0.62);
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.blog-tags span {
  padding: 6px 10px;
  border: 1px solid rgba(110, 74, 168, 0.18);
  border-radius: 999px;
  color: var(--violet);
  background: rgba(110, 74, 168, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.empty-state {
  display: grid;
  place-content: center;
  min-height: 720px;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
  font-size: 24px;
}

@media (max-width: 1120px) {
  .app-shell,
  .workspace {
    grid-template-columns: 1fr;
  }

  .control-panel,
  .list-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .control-panel {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .control-panel,
  .list-pane,
  .preview-pane {
    padding: 18px;
  }

  .inline-controls,
  .button-row {
    grid-template-columns: 1fr;
  }

  .preview-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .blog-card {
    padding: 34px 26px;
    min-height: 680px;
  }

  .blog-title {
    font-size: 30px;
  }

  .theme-official .blog-title-row {
    align-items: center;
    flex-direction: row;
    gap: 14px;
    margin-left: -26px;
    margin-right: -26px;
    min-height: 178px;
    padding: 34px 26px;
  }

  .theme-official .blog-title {
    font-size: 28px;
  }

  .theme-official .blog-date {
    margin-top: 18px;
  }

  .theme-official .blog-share {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .blog-gallery {
    grid-template-columns: 1fr;
  }
}
