﻿@font-face {
  font-family: "Nimbus Sans TW01";
  src: url("https://db.onlinewebfonts.com/c/bb5de19d87c09a95216dc6ccd96e37c6?family=Nimbus+Sans+TW01");
}

:root {
  --font: "Nimbus Sans TW01", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --panel: #1a1a1c;
  --panel-2: #202023;
  --panel-3: #27272b;
  --line: rgba(255,255,255,.09);
  --text: #f4f4f5;
  --muted: rgba(255,255,255,.58);
  --faint: rgba(255,255,255,.36);
  --accent: #e8553f;
  --green: #28c840;
  --gold: #febc2e;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(232,85,63,.22), transparent 34%),
    linear-gradient(180deg, rgba(246,247,248,.88), rgba(229,232,235,.96));
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100svh; padding: 18px; }
.topbar {
  width: min(1500px, calc(100vw - 36px));
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #151518;
}
.brand, .side-logo { display: flex; align-items: center; gap: 10px; }
.brand svg, .side-logo svg { width: 22px; height: 22px; color: currentColor; }
.brand strong { display: block; font-size: 15px; line-height: 1.2; }
.brand span { display: block; margin-top: 2px; font-size: 11px; color: rgba(0,0,0,.52); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status-dot {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 9px 12px;
  background: rgba(255,255,255,.64); color: #242427; font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-dot b { font-weight: 700; }
.pill {
  border: 0; border-radius: 999px; padding: 10px 16px;
  font-size: 13px; font-weight: 800;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.pill:hover { transform: translateY(-1px); }
.pill.dark { background: #111; color: #fff; box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.pill.ghost { background: rgba(255,255,255,.68); color: #222; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.pill:disabled { cursor: not-allowed; opacity: .45; transform: none; }

.workspace {
  width: min(1500px, calc(100vw - 36px));
  min-height: calc(100svh - 86px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 90px rgba(0,0,0,.28);
}
.sidebar {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(180px, 1fr);
  gap: 14px;
  padding: 18px 14px;
  background: #1e1e21;
  border-right: 1px solid var(--line);
  min-height: 0;
}
.side-logo { color: rgba(255,255,255,.86); font-weight: 800; }
.side-item {
  display: block; width: 100%; border: 0; background: transparent;
  color: rgba(255,255,255,.62); text-align: left;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 4px; font-size: 13px;
}
.side-item.active, .side-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.component-panel, .sidebar-log, .progress-panel {
  border-radius: 14px; padding: 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  min-width: 0;
}
.mini-title { font-size: 12px; font-weight: 900; letter-spacing: .04em; margin-bottom: 8px; }
.component-panel p { margin: 0 0 10px; color: var(--faint); font-size: 12px; line-height: 1.55; }
.component-list { display: grid; gap: 8px; }
.component-chip {
  width: 100%; border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; background: rgba(255,255,255,.055); color: #fff;
  padding: 10px 12px; text-align: left;
}
.component-chip:hover { background: rgba(255,255,255,.09); }
.component-chip b { display: block; font-size: 12px; }
.component-chip span { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; line-height: 1.35; }
.sidebar-log { overflow: hidden; display: flex; flex-direction: column; }
.sidebar-log pre {
  flex: 1; min-height: 180px; max-height: none;
  margin: 0; overflow: auto; white-space: pre-wrap;
  color: rgba(255,255,255,.65); font-size: 11px; line-height: 1.55;
}
.job-progress.empty p {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.55;
}
.progress-summary {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
}
.progress-summary b {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
}
.progress-summary span {
  color: var(--faint);
  font-size: 11px;
}
.phase-list {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.phase-list::-webkit-scrollbar { width: 6px; }
.phase-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; }
.phase-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.12);
  opacity: .62;
}
.phase-item i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.72);
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}
.phase-item b {
  display: block;
  color: rgba(255,255,255,.88);
  font-size: 11px;
  line-height: 1.25;
}
.phase-item span, .phase-item em {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.35;
  font-style: normal;
}
.phase-item.active {
  opacity: 1;
  border-color: rgba(135,216,255,.45);
  background: linear-gradient(135deg, rgba(56,189,248,.16), rgba(255,255,255,.045));
  box-shadow: 0 0 0 1px rgba(56,189,248,.08), 0 12px 34px rgba(56,189,248,.10);
}
.phase-item.active i {
  color: #102033;
  background: #8bdcff;
}
.phase-item.done { opacity: .9; }
.phase-item.done i {
  color: #102015;
  background: #7ee7a7;
}
.phase-item.failed {
  opacity: 1;
  border-color: rgba(255,96,96,.45);
  background: rgba(255,80,80,.12);
}
.phase-item.failed i {
  color: #fff;
  background: #f05252;
}

.main-panel { padding: 22px; overflow: auto; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-head > div:first-child { display: flex; align-items: center; gap: 12px; }
.workspace-badge { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: white; font-weight: 900; }
.panel-head h1 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px; border-radius: 15px; overflow: hidden;
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
}
.stats div { padding: 15px 16px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats small { display: block; color: var(--faint); font-size: 9px; letter-spacing: .12em; }
.stats b { display: block; margin-top: 6px; font-size: 25px; font-weight: 500; }
.stats span { color: var(--muted); font-size: 11px; }

.keyword-panel {
  display: grid; grid-template-columns: minmax(360px, 1fr) auto;
  gap: 14px; align-items: end; margin-bottom: 16px; padding: 16px;
  border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.keyword-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
label { display: block; margin: 12px 0 7px; color: var(--muted); font-size: 11px; }
.search-pill { display: flex; align-items: center; gap: 8px; border-radius: 999px; background: rgba(255,255,255,.78); padding: 6px 6px 6px 16px; }
.search-pill input { border: 0; background: transparent; color: #111; padding: 8px 0; }
.search-pill input::placeholder { color: rgba(0,0,0,.45); }
.search-pill button { width: 38px; height: 38px; border-radius: 999px; border: 0; background: #111; color: #fff; font-size: 18px; }
input, textarea, select {
  width: 100%; border: 1px solid rgba(255,255,255,.10); border-radius: 11px;
  background: rgba(255,255,255,.055); color: #fff; outline: none; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 96px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
textarea::-webkit-scrollbar, pre::-webkit-scrollbar { width: 8px; height: 8px; }
textarea::-webkit-scrollbar-thumb, pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,.20); border-radius: 999px; }
select option { color: #111; }

.view-panel { display: none; }
.view-panel.active { display: block; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title h2 { margin: 0; font-size: 16px; font-weight: 800; }
.section-title span { color: var(--faint); font-size: 11px; }
.brief-editor.empty, .empty-card, .structure-canvas.empty {
  border-radius: 14px; padding: 18px; color: var(--muted); font-size: 13px; line-height: 1.7;
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
}
.brief-loading { display: grid; gap: 6px; padding: 16px; border-radius: 12px; background: rgba(255,255,255,.045); border: 1px solid var(--line); }
.brief-loading b { font-size: 14px; }
.brief-loading span { color: var(--muted); font-size: 12px; }
.strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.brief-read-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
}
.brief-read-head b { display: block; font-size: 15px; }
.brief-read-head span { display: block; margin-top: 4px; color: var(--faint); font-size: 12px; }
.brief-card {
  padding: 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.brief-card.wide { grid-column: span 2; }
.brief-card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 800; color: rgba(255,255,255,.88); }
.brief-card.read-card p { margin: 0; color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.65; }
.readonly-list { display: grid; gap: 8px; }
.readonly-list p { padding: 9px 10px; border-radius: 10px; background: rgba(0,0,0,.13); }
.readonly-list b { color: rgba(255,255,255,.48); }
.brief-card > label, .brief-row label { margin: 0; padding: 0 0 7px; color: var(--faint); font-size: 10px; text-transform: uppercase; }
.zh-edit { min-height: 86px; font-size: 12px; line-height: 1.55; background: rgba(255,255,255,.07); }
.ja-readonly { margin-top: 10px; padding: 12px; border-radius: 11px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.06); }
.ja-readonly span { display: block; margin-bottom: 6px; color: var(--faint); font-size: 10px; text-transform: uppercase; }
.ja-readonly p { margin: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.7; }
.ja-readonly.compact { min-height: 42px; padding: 10px 12px; }
.brief-list { display: grid; gap: 10px; }
.brief-row { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; padding: 10px; border-radius: 10px; background: rgba(0,0,0,.13); }
.row-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 900; }
.row-editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.row-editors label { grid-column: span 2; }
.empty-line { color: var(--faint); font-size: 12px; }

.canvas-wrap { border-radius: 18px; padding: 14px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.canvas-toolbar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 12px; }
.structure-canvas {
  min-height: 760px;
  padding: 26px;
  border-radius: 18px;
  overflow: auto;
  background:
    linear-gradient(rgba(0,0,0,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.045) 1px, transparent 1px),
    #eef0f2;
  background-size: 24px 24px;
  border: 1px solid rgba(0,0,0,.08);
}
.structure-canvas.drag-over { outline: 3px dashed rgba(232,85,63,.65); outline-offset: -10px; }
.structure-canvas.empty, .structure-canvas.loading { min-height: 520px; display: grid; place-items: center; color: #333; }
.structure-block {
  position: relative;
  width: min(880px, 100%);
  margin: 0 auto 18px;
  padding: 18px 18px 18px 24px;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  color: #151518;
  box-shadow: 0 16px 36px rgba(0,0,0,.14);
  border: 1px solid rgba(0,0,0,.08);
  overflow: hidden;
}
.structure-block::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: #888; }
.structure-block.cover::before { background: #e8553f; }
.structure-block.toc::before { background: #6c8cff; }
.structure-block.intro::before { background: #febc2e; }
.structure-block.section::before { background: #28c840; }
.structure-block.image::before, .structure-block.manga::before { background: #d63c75; }
.structure-block.keypoint::before { background: #f59e0b; }
.structure-block.internal_link::before { background: #8b5cf6; }
.structure-block.faq::before { background: #10b981; }
.structure-block.cta::before { background: #111; }
.block-head { display: grid; grid-template-columns: 34px 180px minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 12px; }
.block-index { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: #111; color: #fff; font-size: 12px; font-weight: 900; }
.block-actions { display: flex; justify-content: flex-end; gap: 6px; }
.block-actions button {
  border: 0; border-radius: 999px; padding: 7px 10px;
  background: #f0f0f2; color: #555; font-size: 12px; font-weight: 800;
}
.structure-block select, .structure-block input, .structure-block textarea {
  background: #fff; color: #111; border: 1px solid rgba(0,0,0,.13);
}
.structure-block label { color: #777; font-weight: 800; }
.structure-block textarea { min-height: 104px; line-height: 1.55; }
.structure-block .ja-readonly { background: #f5f5f6; border-color: rgba(0,0,0,.06); }
.structure-block .ja-readonly span { color: #8a8a8e; }
.structure-block .ja-readonly p { color: #555; }

.article-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.article-card { padding: 14px; min-height: 144px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.article-card.latest {
  border-color: rgba(126,231,167,.42);
  background: linear-gradient(135deg, rgba(126,231,167,.12), rgba(255,255,255,.045));
  box-shadow: 0 14px 42px rgba(126,231,167,.08);
}
.article-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 10px;
}
.article-time span {
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.72);
  font-weight: 900;
}
.article-card.latest .article-time span {
  background: #7ee7a7;
  color: #102015;
}
.article-time time { font-variant-numeric: tabular-nums; }
.article-card h3 { margin: 0; font-size: 14px; line-height: 1.42; font-weight: 700; }
.article-card p { margin: 8px 0 12px; color: var(--faint); font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; margin-bottom: 12px; }
.chips span { border-radius: 999px; padding: 4px 8px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); font-size: 10px; }
.actions { display: flex; gap: 8px; }
.actions a { text-decoration: none; color: white; border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.08); font-size: 12px; font-weight: 800; }
.actions a.primary { background: white; color: #111; }
.disabled-link {
  pointer-events: none;
  opacity: .45;
}
.is-hidden { display: none !important; }
.batch-panel {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.batch-input,
.batch-status {
  border-radius: 14px;
  padding: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}
.batch-input textarea {
  min-height: 250px;
  line-height: 1.7;
}
.upload-row,
.sample-row,
.batch-lookup {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.upload-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.upload-row input,
.batch-lookup input {
  min-width: 0;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: #fff;
  background: rgba(0,0,0,.16);
  padding: 0 12px;
}
.sample-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.text-btn {
  border: 0;
  border-radius: 999px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.06);
  padding: 9px 10px;
  font-weight: 800;
  cursor: pointer;
}
.text-btn:hover { background: rgba(255,255,255,.11); }
.batch-controls {
  display: grid;
  grid-template-columns: 72px 88px 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.batch-controls label {
  margin: 0 0 11px;
}
.batch-controls input {
  height: 40px;
}
.batch-controls .pill,
.batch-controls a.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  text-decoration: none;
  text-align: center;
}
.batch-lookup {
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: end;
}
.batch-lookup label {
  color: var(--faint);
  font-size: 11px;
  padding-bottom: 12px;
}
.batch-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.batch-list-empty {
  color: var(--faint);
  font-size: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
.batch-list-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: #fff;
  background: rgba(0,0,0,.12);
  padding: 10px 12px;
  cursor: pointer;
}
.batch-list-item span { color: var(--faint); }
.batch-id-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.batch-id-card span {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.batch-id-card b {
  font-size: 13px;
  word-break: break-all;
}
.batch-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
}
.batch-summary div {
  padding: 13px;
  border-right: 1px solid var(--line);
}
.batch-summary div:last-child { border-right: 0; }
.batch-summary span {
  display: block;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .12em;
}
.batch-summary b {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.2;
}
.batch-bar {
  position: relative;
  height: 10px;
  margin: 14px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.batch-bar span {
  position: absolute;
  right: 0;
  top: -18px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}
.batch-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ee7a7, #8bdcff);
  transition: width .25s ease;
}
.batch-meta {
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 12px;
}
.batch-jobs {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}
.batch-job {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.16);
}
.batch-job.completed {
  border-color: rgba(126,231,167,.36);
  background: rgba(126,231,167,.10);
}
.batch-job.failed {
  border-color: rgba(255,96,96,.42);
  background: rgba(255,80,80,.12);
}
.batch-job.running {
  border-color: rgba(139,220,255,.42);
  background: rgba(56,189,248,.12);
}
.batch-job b {
  font-size: 13px;
  line-height: 1.45;
}
.batch-job span {
  color: var(--faint);
  font-size: 11px;
}
.batch-job small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 6px;
  word-break: break-word;
}
.batch-job div {
  display: flex;
  gap: 8px;
}
.batch-job a {
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255,255,255,.09);
  font-size: 11px;
  font-weight: 900;
}
.batch-log {
  margin: 12px 0 0;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  line-height: 1.55;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.06);
}

@keyframes fade-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hero-rise { from { opacity: 0; transform: translateY(28px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.animate-fade-down { animation: fade-down .55s cubic-bezier(.22,1,.36,1) both; }
.animate-hero-rise { animation: hero-rise .7s cubic-bezier(.22,1,.36,1) both; }
@media (prefers-reduced-motion: reduce) { .animate-fade-down, .animate-hero-rise { animation: none; } }
@media (max-width: 1200px) {
  .workspace { grid-template-columns: 260px minmax(0,1fr); }
  .strategy-grid, .article-list, .keyword-panel { grid-template-columns: 1fr; }
  .brief-card.wide { grid-column: span 1; }
  .row-editors { grid-template-columns: 1fr; }
  .row-editors label { grid-column: span 1; }
}
@media (max-width: 860px) {
  .app-shell { padding: 12px; }
  .topbar { width: 100%; flex-direction: column; align-items: stretch; }
  .workspace { width: 100%; grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; }
  .batch-panel { grid-template-columns: 1fr; }
  .batch-controls { grid-template-columns: 1fr; }
  .batch-summary { grid-template-columns: 1fr 1fr; }
  .keyword-actions { flex-direction: column; align-items: stretch; }
  .block-head { grid-template-columns: 34px 1fr; }
  .block-actions { grid-column: span 2; justify-content: flex-start; }
}

/* Dify-like structure canvas: compact nodes + floating editor */
.insert-hint {
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(232,85,63,.12);
  color: rgba(255,255,255,.72);
  border: 1px solid rgba(232,85,63,.22);
  font-size: 11px;
  line-height: 1.45;
}
.structure-canvas.node-canvas {
  position: relative;
  display: block;
  min-height: 760px;
  padding: 34px 360px 34px 34px;
}
.node-flow {
  width: min(620px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.structure-block.node-card {
  width: 100%;
  min-height: 76px;
  margin: 0;
  padding: 14px 14px 14px 18px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  border-radius: 16px;
}
.structure-block.node-card.selected {
  outline: 3px solid rgba(232,85,63,.42);
  box-shadow: 0 18px 42px rgba(232,85,63,.20), 0 16px 36px rgba(0,0,0,.14);
}
.node-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.node-main { min-width: 0; }
.node-type {
  display: inline-flex;
  margin-bottom: 4px;
  color: #777;
  font-size: 11px;
  font-weight: 900;
}
.node-main h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #151518;
  font-size: 15px;
  line-height: 1.3;
}
.node-actions {
  display: flex;
  gap: 6px;
  opacity: .62;
}
.structure-block.node-card:hover .node-actions,
.structure-block.node-card.selected .node-actions { opacity: 1; }
.node-actions button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f0f0f2;
  color: #555;
  font-size: 12px;
  font-weight: 800;
}
.block-popover {
  position: sticky;
  top: 16px;
  float: right;
  width: 330px;
  max-height: calc(100vh - 160px);
  margin-right: -342px;
  margin-top: 0;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(25,25,28,.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  z-index: 5;
}
.popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.popover-head span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
}
.popover-head h3 {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.35;
}
.popover-head button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 800;
}
.block-popover input,
.block-popover textarea,
.block-popover select {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
}
.block-popover textarea { min-height: 92px; }
.block-popover .ja-readonly {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
}
.block-popover .ja-readonly p { color: rgba(255,255,255,.68); }
@media (max-width: 1200px) {
  .structure-canvas.node-canvas { padding-right: 26px; }
  .block-popover {
    position: relative;
    float: none;
    width: min(620px, 100%);
    max-height: none;
    margin: 18px auto 0;
  }
}

/* keep editor floating at right side of the canvas */
.structure-canvas.node-canvas .block-popover {
  position: absolute;
  top: 26px;
  right: 26px;
  float: none;
  margin: 0;
}
@media (max-width: 1200px) {
  .structure-canvas.node-canvas .block-popover {
    position: relative;
    top: auto;
    right: auto;
    margin: 18px auto 0;
  }
}

/* Landing + auth */
.landing-body, .auth-body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 12% 12%, rgba(232,85,63,.34), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(108,140,255,.28), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(40,200,64,.18), transparent 26%),
    #101014;
  color: #fff;
}
.landing-shell { width: min(1180px, calc(100vw - 36px)); margin: 0 auto; padding: 24px 0 56px; }
.landing-nav { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.landing-brand { display:flex; align-items:center; gap:10px; font-weight:900; }
.brand-mark { display:grid; place-items:center; width:36px; height:36px; border-radius:12px; background:#e8553f; }
.landing-actions { display:flex; gap:10px; align-items:center; }
.landing-actions a, .hero-buttons a { color:#fff; text-decoration:none; border-radius:999px; padding:10px 16px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); font-weight:800; }
.landing-actions a.hot, .hero-buttons a.primary { background:#fff; color:#111; }
.hero-grid { min-height: calc(100svh - 110px); display:grid; grid-template-columns: minmax(0,1fr) 480px; gap:60px; align-items:center; }
.eyebrow { display:inline-flex; padding:8px 12px; border-radius:999px; color:#ffd6ce; background:rgba(232,85,63,.16); border:1px solid rgba(232,85,63,.28); font-size:12px; font-weight:900; }
.hero-copy h1 { margin:18px 0 16px; font-size: clamp(42px, 6vw, 76px); line-height:.96; letter-spacing:-.05em; }
.hero-copy p { max-width:680px; color:rgba(255,255,255,.68); font-size:16px; line-height:1.8; }
.hero-buttons { display:flex; gap:12px; margin-top:28px; }
.hero-buttons a { padding:13px 20px; }
.hero-orbit { position:relative; min-height:520px; border-radius:34px; background:linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.03)); border:1px solid rgba(255,255,255,.12); overflow:hidden; box-shadow:0 30px 100px rgba(0,0,0,.36); }
.hero-orbit::before { content:""; position:absolute; inset:50px; border:1px dashed rgba(255,255,255,.18); border-radius:50%; animation: spin 18s linear infinite; }
.orbit-card { position:absolute; border-radius:22px; padding:18px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.16); backdrop-filter: blur(14px); box-shadow:0 18px 50px rgba(0,0,0,.22); font-weight:900; }
.main-card { left:50%; top:50%; transform:translate(-50%,-50%); width:260px; min-height:150px; background:#fff; color:#111; }
.main-card span, .main-card em { display:block; color:#777; font-size:12px; font-style:normal; }
.main-card b { display:block; margin:18px 0; font-size:26px; }
.c1 { left:32px; top:70px; } .c2 { right:42px; top:95px; } .c3 { left:58px; bottom:78px; } .c4 { right:56px; bottom:68px; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-body { display:grid; place-items:center; padding:20px; }
.auth-card { width:min(430px, 100%); padding:30px; border-radius:28px; background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.15); backdrop-filter: blur(18px); box-shadow:0 28px 90px rgba(0,0,0,.36); }
.auth-back { color:rgba(255,255,255,.7); text-decoration:none; font-size:13px; }
.auth-card h1 { margin:18px 0 8px; font-size:34px; }
.auth-card p { color:rgba(255,255,255,.68); line-height:1.7; }
.auth-card input { background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.16); }
.auth-card button { width:100%; margin-top:18px; border:0; border-radius:999px; padding:13px 18px; background:#fff; color:#111; font-weight:900; }
.feishu-login { display:flex; align-items:center; justify-content:center; width:100%; min-height:46px; margin:18px 0 14px; border-radius:999px; background:#0f88eb; color:#fff; font-weight:900; text-decoration:none; box-shadow:0 14px 34px rgba(15,136,235,.28); }
.auth-divider { display:flex; align-items:center; gap:12px; color:rgba(255,255,255,.48); font-size:12px; font-weight:800; margin:0 0 12px; }
.auth-divider:before, .auth-divider:after { content:""; height:1px; flex:1; background:rgba(255,255,255,.16); }
.auth-msg { min-height:22px; margin-top:12px; color:#ffb4a6; font-size:13px; }
.auth-switch a { color:#fff; font-weight:900; }
.user-pill { display:inline-flex; align-items:center; gap:8px; border-radius:999px; padding:9px 12px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.10); color:rgba(255,255,255,.78); font-size:12px; }
.user-pill button { border:0; border-radius:999px; padding:5px 9px; background:rgba(255,255,255,.12); color:#fff; font-size:11px; font-weight:800; }
@media (max-width: 920px) { .hero-grid { grid-template-columns:1fr; padding-top:60px; } .hero-orbit { min-height:420px; } }

/* Studio three-module layout */
.module-workspace {
  grid-template-columns: 280px minmax(0, 1fr);
}
.module-tab {
  display: grid;
  gap: 4px;
  padding: 13px 12px;
}
.module-tab b {
  font-size: 13px;
}
.module-tab span {
  color: var(--faint);
  font-size: 11px;
  line-height: 1.35;
}
.module-tab.active span,
.module-tab:hover span {
  color: rgba(255,255,255,.62);
}
.studio-hero {
  padding: 18px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    radial-gradient(circle at 85% 20%, rgba(232,85,63,.24), transparent 32%);
  border: 1px solid var(--line);
}
.module-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.module-card {
  display: grid;
  gap: 7px;
  min-height: 126px;
  padding: 16px;
  text-align: left;
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
}
.module-card:hover,
.module-card.active {
  background: linear-gradient(135deg, rgba(232,85,63,.18), rgba(255,255,255,.055));
  border-color: rgba(232,85,63,.38);
}
.module-card span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.module-card b {
  font-size: 17px;
}
.module-card em {
  max-width: 32ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  font-style: normal;
}
.single-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.single-control,
.brief-shell,
.history-layout > div,
.history-side {
  border-radius: 14px;
  padding: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}
.single-control .keyword-actions {
  margin-top: 14px;
}
.single-control .keyword-actions .pill {
  flex: 1 1 160px;
}
.single-note {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.06);
}
.single-note b {
  display: block;
  font-size: 13px;
}
.single-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.section-title.compact {
  margin-bottom: 12px;
}
.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}
.history-batch-board {
  border-radius: 14px;
  padding: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.history-head h3 {
  margin: 0;
  font-size: 14px;
}
.batch-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.batch-card-grid .mini-title {
  display: none;
}
.batch-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 146px;
  padding: 14px;
  text-align: left;
}
.batch-card-time {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
}
.batch-card b {
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
}
.batch-card em {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  font-style: normal;
}
.batch-card i {
  align-self: end;
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  padding: 5px 8px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.08);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}
.modal-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.52);
  backdrop-filter: blur(10px);
  z-index: 30;
}
.modal-card {
  width: min(920px, 100%);
  max-height: min(820px, calc(100svh - 48px));
  overflow: hidden;
  border-radius: 18px;
  background: #1a1a1c;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 30px 100px rgba(0,0,0,.46);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head span {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.modal-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.35;
}
.modal-head button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-size: 22px;
}
.modal-card .history-batch-detail {
  max-height: calc(100svh - 148px);
  overflow: auto;
  padding: 16px;
  margin: 0;
}
.article-batches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
  min-height: 24px;
}
.article-batches span,
.batch-badge {
  border: 0;
  border-radius: 999px;
  padding: 5px 8px;
  color: rgba(255,255,255,.68);
  background: rgba(255,255,255,.07);
  font-size: 10px;
  font-weight: 900;
}
.batch-badge {
  color: #111;
  background: #febc2e;
}
.batch-list-item.active {
  border-color: rgba(254,188,46,.5);
  background: rgba(254,188,46,.13);
}
.history-batch-detail {
  margin-top: 14px;
}
.history-batch-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.history-batch-top span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.history-batch-top b {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}
.history-batch-top em {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
  font-style: normal;
  word-break: break-all;
}
.batch-export-link {
  text-decoration: none;
  white-space: nowrap;
}
.history-batch-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.history-batch-numbers span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  color: var(--faint);
  background: rgba(0,0,0,.14);
  font-size: 10px;
}
.history-batch-numbers b {
  color: #fff;
  font-size: 13px;
}
.history-batch-articles {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}
.history-batch-article {
  display: grid;
  gap: 5px;
  padding: 11px;
  border-radius: 12px;
  background: rgba(0,0,0,.15);
  border: 1px solid rgba(255,255,255,.08);
}
.history-batch-article.completed {
  border-color: rgba(126,231,167,.35);
}
.history-batch-article b {
  font-size: 12px;
  line-height: 1.4;
}
.history-batch-article span,
.history-batch-article p {
  margin: 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.35;
}
.history-batch-article div {
  display: flex;
  gap: 7px;
  margin-top: 4px;
}
.history-batch-article a {
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(255,255,255,.09);
  font-size: 11px;
  font-weight: 900;
}
.legacy-hidden {
  display: none !important;
}
@media (max-width: 1200px) {
  .module-cards,
  .single-layout,
  .history-layout,
  .batch-card-grid {
    grid-template-columns: 1fr;
  }
}
