#app {

  --bg: #efe4d1;
  --panel: rgba(255, 251, 241, 0.94);
  --panel-strong: #eadbc0;
  --ink: #2a2118;
  --muted: #746754;
  --line: #d7c3a1;
  --primary: #496f5c;
  --primary-dark: #315143;
  --amber: #a56f2a;
  --rose: #8c5d68;
  --shadow: 0 18px 48px rgba(70, 48, 24, 0.14);
  color-scheme: light;

}


#app, #app * {

  box-sizing: border-box;

}


/* ===== 全局过渡动画基础 ===== */
#app .button, #app .genre-chip, #app .novel-card, #app .outline-item, #app .directory-item, #app .flow-item, #app .tab, #app .icon-button, #app .question-card, #app .character-card, #app .panel, #app .collapse-button, #app .model-badge {

  transition: all 0.2s ease;

}


#app, #app {

  height: 100%;

}


#app {

  margin: 0;
  background:
    linear-gradient(90deg, rgba(239, 228, 209, 0.72), rgba(255, 251, 241, 0.88)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;

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

}


#app button {

  border: 0;
  cursor: pointer;

}


#app .plain {

  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;

}


#app .app-shell {

  display: grid;
  grid-template-columns: 252px minmax(420px, 1fr) 420px;
  min-height: 100%;

}


#app .developer-notice {

  width: min(1040px, calc(100% - 36px));
  margin: 18px auto 0;
  padding: 14px 18px;
  border: 2px solid #b91c1c;
  border-radius: 8px;
  background: #fff7ed;
  color: #7f1d1d;
  box-shadow: 0 12px 30px rgba(127, 29, 29, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  line-height: 1.55;
  font-size: 16px;
  font-weight: 800;

}


#app .developer-notice strong {

  color: #991b1b;
  font-size: 18px;
  white-space: nowrap;

}


#app .app-shell > .developer-notice {

  grid-column: 1 / -1;

}


#app .home-shell {

  min-height: 100%;
  padding: 0 34px 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: center;
  gap: 18px;

}


#app .home-hero {

  width: min(1040px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 251, 241, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  text-align: center;
  position: relative;
  overflow: hidden;

}


#app .home-hero::before {

  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(165, 111, 42, 0.08) 0%, rgba(165, 111, 42, 0.02) 60%, transparent 70%);
  pointer-events: none;

}


#app .home-hero::after {

  content: "";
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(73, 111, 92, 0.06) 0%, transparent 65%);
  pointer-events: none;

}


#app .home-brand {

  margin-bottom: 24px;
  justify-content: center;

}


#app .home-hero h1 {

  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 0 rgba(255, 251, 241, 0.6);

}


#app .home-hero p {

  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.75;

}


#app .home-actions {

  width: min(560px, 100%);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
  justify-content: center;

}


#app .home-actions .button {

  min-height: 52px;
  font-size: 15px;

}


#app .home-primary-action {

  box-shadow: 0 10px 24px rgba(73, 111, 92, 0.22);

}


#app .home-secondary-action {

  border: 1px solid var(--line);

}


#app .home-panel {

  width: min(1040px, 100%);

}


#app .novel-list {

  display: grid;
  gap: 12px;

}


#app .novel-card {

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 253, 247, 0.88);

}


#app .novel-card h3 {

  font-size: 16px;

}


/* ===== 卡片 hover 微浮 ===== */
#app .novel-card:hover {

  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(70, 48, 24, 0.08);

}


#app .novel-actions {

  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;

}


#app .novel-premise {

  margin-top: 8px;
  color: var(--ink);
  line-height: 1.65;
  font-size: 13px;

}


#app .novel-progress {

  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;

}


#app .novel-progress span {

  border: 1px solid rgba(73, 111, 92, 0.2);
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(235, 244, 232, 0.72);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;

}


#app .novel-progress .novel-platform-note {

  border-color: rgba(190, 24, 24, 0.35);
  background: rgba(254, 226, 226, 0.9);
  color: #b91c1c;

}


#app .rail {

  position: sticky;
  top: 0;
  min-height: 100vh;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(63, 46, 30, 0.96), rgba(39, 58, 48, 0.96)),
    rgba(63, 46, 30, 0.96);
  color: #fff7e8;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: auto;

}


#app .brand {

  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;

}


#app .brand-mark {

  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8c27a;
  color: #2a2118;
  font-weight: 900;

}


#app .brand-title {

  font-size: 18px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);

}


#app .brand-subtitle {

  margin-top: 2px;
  color: #dccdb2;
  font-size: 12px;

}


#app .status-card {

  border: 1px solid rgba(255, 247, 232, 0.18);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 14px;

}


#app .status-row {

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #e5d7bd;

}


#app .status-pill {

  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff7e6;

}


#app .dot {

  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d1912f;

}


#app .dot.ok {

  background: #62c08e;
  animation: dotPulse 2s ease-in-out infinite;

}


@keyframes dotPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(98, 192, 142, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(98, 192, 142, 0);
  }
}

#app .step-list {

  display: grid;
  gap: 8px;

}


#app .step-button {

  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  color: #eadfc9;
  background: transparent;
  text-align: left;

}


#app .step-button.active, #app .step-button:hover {

  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;

}


#app .step-button.active {

  background: rgba(255, 255, 255, 0.12);
  border-left: 3px solid #e7b75f;
  padding-left: 7px;

}


#app .step-button.writing-emphasis {

  border-color: rgba(231, 183, 95, 0.75);
  background: rgba(231, 183, 95, 0.12);
  box-shadow: inset 0 0 0 1px rgba(231, 183, 95, 0.22), 0 8px 20px rgba(0, 0, 0, 0.12);

}


#app .step-button.writing-emphasis .step-index {

  background: #e7b75f;
  color: #17302f;

}


#app .step-button.writing-emphasis .step-name::after {

  content: "重点";
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.92);
  color: #315143;
  font-size: 11px;
  font-weight: 900;

}


#app .step-button:not(.active) {

  border-left: 3px solid transparent;
  padding-left: 7px;

}


#app .step-index {

  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 800;

}


#app .step-button.active .step-index {

  background: #e7b75f;
  color: #17302f;

}


#app .step-name {

  display: block;
  font-size: 14px;
  font-weight: 700;

}


#app .step-desc {

  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #d0c2a7;

}


#app .rail-actions {

  margin-top: auto;
  display: grid;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(39, 58, 48, 0), rgba(39, 58, 48, 0.98) 28%);

}


/* ===== focus-visible 键盘导航 ===== */
#app .button:focus-visible, #app .genre-chip:focus-visible, #app .tab:focus-visible, #app .step-button:focus-visible, #app .flow-item:focus-visible, #app .directory-item:focus-visible, #app .written-item:focus-visible, #app .ghost-dark:focus-visible, #app .collapse-button:focus-visible {

  outline: 2px solid var(--primary);
  outline-offset: 2px;

}


#app .icon-button:focus-visible {

  outline: 2px solid var(--primary);
  outline-offset: 2px;

}


#app .ghost-dark {

  color: #f4efe7;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.2s ease;

}


/* ===== ghost-dark hover 反馈 ===== */
#app .ghost-dark:hover {

  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.32);

}


#app .ghost-dark:active:not(:disabled) {

  transform: scale(0.97);

}


#app .workspace {

  min-width: 0;
  padding: 28px;
  overflow: auto;
  background: rgba(255, 251, 241, 0.16);

}


#app .topbar {

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;

}


#app .eyebrow {

  color: var(--primary);
  font-size: 12px;
  font-weight: 800;

}


#app h1, #app h2, #app h3, #app p {

  margin: 0;

}


#app h1 {

  margin-top: 6px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  max-width: 780px;

}


#app .topbar p {

  margin-top: 10px;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.7;

}


#app .toolbar {

  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;

}


#app .toolbar.left {

  justify-content: flex-start;

}


#app .tool-grid {

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;

}


#app .tool-stack {

  display: grid;
  gap: 12px;

}


#app .tool-card, #app .registry-box, #app .info-box, #app .variant-card {

  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.88);

}


#app .warning-box {

  border-color: rgba(217, 119, 6, 0.35);
  background: #fff7ed;

}


#app .tool-card {

  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 148px;

}


#app .tool-card strong, #app .registry-box strong, #app .info-box strong, #app .variant-card strong {

  font-size: 14px;

}


#app .tool-card p, #app .info-box p, #app .variant-card p {

  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;

}


#app .marketing-panel, #app .registry-list, #app .variant-list {

  display: grid;
  gap: 10px;

}


#app .idea-list, #app .rewrite-grid {

  display: flex;
  flex-wrap: wrap;
  gap: 8px;

}


#app .idea-chip {

  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fffaf0;
  color: var(--ink);
  font-weight: 800;

}


#app .registry-list {

  margin-top: 10px;

}


#app .registry-item {

  display: grid;
  gap: 4px;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 10px;
  background: rgba(245, 250, 242, 0.72);

}


#app .registry-item small {

  color: var(--muted);
  line-height: 1.45;

}


#app .button {

  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;

}


#app .button:hover {

  background: var(--primary-dark);

}


#app .button.secondary {

  background: var(--ink);

}


#app .button.subtle {

  color: var(--ink);
  background: #ebe4da;

}


#app .button.warning {

  background: #a86244;

}


#app .button.danger {

  color: #fffaf0;
  background: #8b3f32;

}


#app .button.danger:hover {

  background: #6f2f25;

}


#app .manual-save-primary {

  min-width: 220px;
  min-height: 64px;
  padding: 0 30px;
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(73, 111, 92, 0.24);

}


#app .topbar .manual-save-primary {

  flex: 0 0 auto;

}


#app .button:disabled {

  opacity: 0.6;
  cursor: not-allowed;

}


/* ===== 按钮按下反馈 ===== */
#app .button:active:not(:disabled) {

  transform: scale(0.97);
  transition: transform 0.1s ease;

}


#app .genre-chip:active:not(:disabled), #app .icon-button:active:not(:disabled), #app .tab:active:not(:disabled) {

  transform: scale(0.96);

}


#app .grid {

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;

}


#app .panel {

  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 30px rgba(70, 48, 24, 0.06);
  backdrop-filter: blur(8px);

}


#app .panel-header {

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 0;

}


#app .panel-title {

  font-size: 16px;
  font-weight: 900;

}


#app .panel-note {

  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;

}


#app .panel-body {

  padding: 18px;

}


#app .collapse-button {

  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;

}


#app .live-panel {

  margin-bottom: 16px;

}


#app .live-preview {

  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(rgba(255, 253, 247, 0.94), rgba(255, 253, 247, 0.94)),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(215, 195, 161, 0.28) 32px);
  color: var(--ink);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.75;

}


#app .live-stats {

  margin-bottom: 12px;

}


#app .model-badge {

  min-height: 42px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 247, 229, 0.86);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;

}


#app .field {

  display: grid;
  gap: 8px;
  margin-bottom: 14px;

}


#app .field:last-child {

  margin-bottom: 0;

}


#app .label {

  font-size: 13px;
  font-weight: 800;

}


#app .hint {

  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;

}


#app .field-help {

  display: grid;
  gap: 4px;
  border-left: 3px solid rgba(165, 111, 42, 0.42);
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 247, 229, 0.76);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;

}


#app .field-help .example {

  color: #7b5525;
  font-weight: 700;

}


#app .field-action-row {

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;

}


#app .field-action-button {

  min-width: 132px;
  white-space: nowrap;

}


#app .genre-grid {

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;

}


#app .genre-chip {

  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.86);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;

}


#app .genre-chip:hover, #app .genre-chip.active {

  border-color: var(--primary);
  background: #e3eadf;
  color: var(--primary-dark);

}


#app .save-row {

  margin-top: 10px;

}


#app .folder-picker-row {

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;

}


#app .home-panel .folder-picker-row {

  grid-template-columns: 1fr;

}


#app .folder-display {

  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 253, 247, 0.86);
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

}


#app .save-location {

  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  border: 1px dashed rgba(165, 111, 42, 0.48);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(255, 247, 229, 0.6);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;

}


#app .save-location strong {

  color: var(--ink);
  overflow-wrap: anywhere;

}


#app input, #app textarea, #app select {

  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 253, 247, 0.9), rgba(255, 253, 247, 0.9)),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(215, 195, 161, 0.32) 32px);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;

}


#app textarea {

  min-height: 108px;
  resize: vertical;
  line-height: 1.65;

}


#app input:focus, #app textarea:focus, #app select:focus {

  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 115, 111, 0.13);

}


#app .chapter-option-done {

  background: #d8f3dc;
  color: #14532d;
  font-weight: 700;

}


/* ===== 占位符颜色 ===== */
#app input::placeholder, #app textarea::placeholder {

  color: var(--muted);
  opacity: 0.65;

}


#app .full {

  grid-column: 1 / -1;

}


#app .outline-list {

  display: grid;
  gap: 10px;

}


#app .outline-planner {

  display: grid;
  gap: 14px;

}


#app .word-estimate {

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px dashed rgba(165, 111, 42, 0.52);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 247, 229, 0.72);
  color: var(--muted);
  font-size: 13px;

}


#app .word-estimate strong {

  color: var(--ink);
  font-size: 15px;

}


#app .outline-item {

  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.92);
  border-radius: 8px;
  padding: 12px;

}


#app .outline-item.active {

  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 115, 111, 0.1);

}


#app .outline-title {

  font-weight: 900;

}


#app .outline-meta {

  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;

}


#app .mini-actions {

  display: flex;
  gap: 8px;

}


#app .icon-button {

  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fffaf0;
  font-weight: 900;

}


#app .questions {

  display: grid;
  gap: 12px;

}


#app .question-card {

  border-left: 3px solid var(--amber);
  background: rgba(255, 247, 229, 0.92);
  padding: 12px;
  border-radius: 8px;

}


#app .question-card textarea {

  min-height: 76px;
  margin-top: 10px;

}


#app .context-preview {

  white-space: pre-wrap;

}


#app .writing-main-panel .panel-body {

  display: grid;
  gap: 14px;

}


#app .writing-stats {

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;

}


#app .live-stats {

  grid-template-columns: repeat(4, minmax(0, 1fr));

}


#app .live-detail {

  border: 1px solid rgba(73, 111, 92, 0.26);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px;
  background: rgba(245, 250, 242, 0.86);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;

}


#app .stat-pill {

  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 253, 247, 0.88);

}


#app .stat-pill span {

  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;

}


#app .stat-pill strong {

  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;

}


#app .main-editor {

  min-height: 620px;
  font-size: 16px;

}


#app .main-editor.generating-preview {

  border-color: #8d5cf6;
  animation: purplePreviewPulse 2.4s ease-in-out infinite;

}


#app .written-item, #app .directory-item {

  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--ink);
  text-align: left;

}


#app .written-item {

  display: grid;
  gap: 4px;
  padding: 12px;

}


#app .written-item.active, #app .directory-item.active {

  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 115, 111, 0.1);

}


#app .character-section {

  display: grid;
  gap: 14px;

}


#app .character-grid {

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;

}


#app .character-card {

  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 253, 247, 0.9);

}


#app .character-registry {

  border: 1px dashed rgba(165, 111, 42, 0.52);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 247, 229, 0.72);

}


#app .character-registry p {

  margin-top: 6px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;

}


#app .quality-report {

  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(73, 111, 92, 0.35);
  border-radius: 8px;
  background: rgba(245, 250, 242, 0.78);
  color: var(--ink);

}


#app .quality-report.empty {

  border-style: dashed;
  background: rgba(255, 253, 247, 0.72);

}


#app .quality-report strong {

  font-size: 14px;

}


#app .quality-report p {

  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;

}


#app .character-card-head {

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;

}


#app .character-card-head strong {

  font-size: 15px;

}


#app .compact-field textarea {

  min-height: 74px;

}


#app .relationship-summary {

  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 12px;
  background: rgba(227, 234, 223, 0.7);

}


#app .relationship-summary p {

  margin-top: 6px;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;

}


#app .directory-list {

  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;

}


#app .append-outline-panel {

  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px dashed rgba(73, 111, 92, 0.34);
  border-radius: 8px;
  padding: 10px;
  background: rgba(245, 250, 242, 0.72);

}


#app .directory-item {

  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
  padding: 10px;

}


#app .directory-index {

  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eadcc4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;

}


#app .directory-item.has-draft .directory-index {

  background: var(--primary);
  color: #fffaf0;

}


#app .directory-text {

  min-width: 0;
  display: grid;
  gap: 4px;

}


#app .directory-text strong {

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;

}


#app .directory-title-en {

  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6f7f95;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;

}


#app .directory-text small {

  color: var(--muted);
  font-size: 12px;

}


#app .flow-list {

  display: grid;
  gap: 8px;

}


#app .flow-item {

  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 253, 247, 0.84);
  color: var(--ink);
  text-align: left;

}


#app .flow-item span {

  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eadcc4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;

}


#app .flow-item.active {

  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 115, 111, 0.1);

}


#app .flow-item.done span {

  background: var(--primary);
  color: #fffaf0;

}


#app .writer {

  background:
    linear-gradient(rgba(255, 248, 236, 0.84), rgba(255, 248, 236, 0.9)),
    url("/assets/paper-novel-background.png") center / cover;
  border-left: 1px solid var(--line);
  padding: 22px;
  overflow: auto;

}


#app .writer-card {

  position: sticky;
  top: 22px;
  display: grid;
  gap: 16px;

}


#app .writer .writing-stats {

  grid-template-columns: 1fr;

}


#app .model-grid {

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;

}


#app .model-selector {

  display: grid;
  gap: 8px;
  min-width: min(100%, 520px);

}


#app .model-selector-head {

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

}


#app .compact-button {

  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;

}


#app .home-model-selector {

  width: min(760px, 100%);
  margin: 18px auto 0;
  text-align: left;

}


#app .topbar-model-selector {

  min-width: 420px;

}


#app .model-option-grid {

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;

}


#app .model-option {

  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--ink);
  text-align: left;

}


#app .model-option.active {

  border-color: var(--primary);
  background: rgba(227, 234, 223, 0.9);
  box-shadow: 0 0 0 3px rgba(73, 111, 92, 0.12);

}


#app .model-option strong {

  font-size: 13px;

}


#app .model-option small {

  color: var(--muted);
  font-size: 12px;

}


#app .model-settings-panel {

  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.86);

}


#app .provider-config-grid, #app .custom-model-grid {

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;

}


#app .provider-config, #app .custom-model-form, #app .custom-model-item {

  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;

}


#app .provider-config-title, #app .custom-model-item {

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

}


#app .provider-config-title small, #app .custom-model-item small {

  display: block;
  color: var(--muted);
  font-size: 12px;

}


#app .custom-model-form {

  grid-column: 1 / -1;

}


#app .custom-model-list {

  display: grid;
  gap: 8px;

}


#app .custom-model-item-actions {

  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;

}


#app .custom-model-item .model-test-status {

  display: block;
  margin-top: 2px;

}


#app .custom-model-form-actions {

  display: flex;
  gap: 10px;
  margin-top: 4px;

}


#app .model-page-link {

  margin-bottom: 10px;

}


#app .model-test-status {

  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-all;

}


#app .model-test-status.ok {

  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;

}


#app .model-test-status.fail {

  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;

}


#app .model-test-status.testing {

  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #6d28d9;

}


#app .compact-field {

  gap: 4px;

}


#app .compact-field input {

  min-height: 36px;

}


#app .tabs {

  display: flex;
  padding: 4px;
  border-radius: 8px;
  background: #eadcc4;

}


#app .tab {

  flex: 1;
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;

}


#app .tab.active {

  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(31, 39, 40, 0.08);

}


#app .editor {

  min-height: 430px;
  font-size: 15px;
  background:
    linear-gradient(rgba(255, 253, 247, 0.92), rgba(255, 253, 247, 0.92)),
    repeating-linear-gradient(0deg, transparent 0, transparent 35px, rgba(197, 172, 132, 0.34) 36px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);

}


@keyframes purplePreviewPulse {
  0%,
  100% {
    border-color: #8d5cf6;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.72),
      0 0 0 0 rgba(141, 92, 246, 0.18);
  }
  50% {
    border-color: #b794ff;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.72),
      0 0 0 4px rgba(141, 92, 246, 0.22);
  }
}

#app .toast {

  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  max-width: min(680px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 20;
  opacity: 0;
  animation: toastIn 0.35s ease forwards;

}


#app .toast.error {

  background: #8b352f;

}


@keyframes toastIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

#app .toast.hiding {

  animation: toastOut 0.3s ease forwards;

}


@keyframes toastOut {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
}

#app .loading {

  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(239, 228, 209, 0.72);
  backdrop-filter: blur(4px);
  z-index: 10;

}


#app .loading-box {

  width: min(420px, calc(100vw - 32px));
  border-radius: 8px;
  background: #fffaf0;
  border: 1px solid var(--line);
  padding: 22px;
  box-shadow: var(--shadow);

}


#app .progress {

  height: 8px;
  border-radius: 999px;
  margin-top: 14px;
  overflow: hidden;
  background: #eadfce;

}


#app .progress span {

  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--primary);
  animation: loadingFill 1.6s ease-in-out infinite;

}


@keyframes loadingFill {
  0% {
    width: 0%;
    margin-left: 0;
  }
  50% {
    width: 70%;
    margin-left: 0;
  }
  100% {
    width: 0%;
    margin-left: 100%;
  }
}

/* ===== 目录分批保存进度 ===== */
#app .outline-progress {

  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf0;

}

#app .outline-progress-head {

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.4;

}

#app .outline-progress-label {

  font-weight: 800;
  color: var(--ink);

}

#app .outline-progress-remain {

  color: #a86244;
  font-weight: 700;

}

#app .outline-progress-done {

  color: #2e7d4f;
  font-weight: 700;

}

#app .outline-progress-track {

  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #eadfce;

}

#app .outline-progress-fill {

  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.4s ease;

}


/* ===== 目录预览操作区（仅用现有 N 章确认入口） ===== */
#app .outline-preview-actions {

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;

}


/* ===== 自定义滚动条 ===== */
#app .directory-list::-webkit-scrollbar, #app .writer::-webkit-scrollbar, #app .live-preview::-webkit-scrollbar, #app .workspace::-webkit-scrollbar {

  width: 6px;

}

#app .directory-list::-webkit-scrollbar-track, #app .writer::-webkit-scrollbar-track, #app .live-preview::-webkit-scrollbar-track, #app .workspace::-webkit-scrollbar-track {

  background: transparent;

}

#app .directory-list::-webkit-scrollbar-thumb, #app .writer::-webkit-scrollbar-thumb, #app .live-preview::-webkit-scrollbar-thumb, #app .workspace::-webkit-scrollbar-thumb {

  background: var(--line);
  border-radius: 999px;

}

#app .directory-list::-webkit-scrollbar-thumb:hover, #app .writer::-webkit-scrollbar-thumb:hover, #app .live-preview::-webkit-scrollbar-thumb:hover, #app .workspace::-webkit-scrollbar-thumb:hover {

  background: var(--muted);

}


/* Firefox */
#app .directory-list, #app .writer, #app .live-preview, #app .workspace {

  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;

}


@media (max-width: 1180px) {
  #app .app-shell {

    grid-template-columns: 220px minmax(0, 1fr);
  
}


  #app .writer {

    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  
}


  #app .writer-card {

    position: static;
  
}

}

@media (max-width: 820px) {
  #app .app-shell {

    display: block;
  
}


  #app .rail {

    min-height: auto;
    height: auto;
    position: static;
  
}


  #app .rail-actions {

    position: static;
    background: transparent;
  
}


  #app .step-list {

    grid-template-columns: repeat(2, minmax(0, 1fr));
  
}


  #app .workspace, #app .writer {

    padding: 18px;
  
}


  #app .topbar {

    display: grid;
  
}


  #app .developer-notice {

    width: calc(100% - 24px);
    margin-top: 12px;
    display: grid;
    gap: 4px;
    font-size: 14px;
  
}


  #app .developer-notice strong {

    font-size: 16px;
    white-space: normal;
  
}


  #app .toolbar {

    justify-content: flex-start;
  
}


  #app .grid, #app .model-grid, #app .model-option-grid, #app .provider-config-grid, #app .custom-model-grid, #app .character-grid, #app .tool-grid, #app .writing-stats, #app .live-stats {

    grid-template-columns: 1fr;
  
}


  #app .genre-grid {

    grid-template-columns: repeat(2, minmax(0, 1fr));
  
}


  #app .folder-picker-row {

    grid-template-columns: 1fr;
  
}


  #app .home-actions {

    grid-template-columns: 1fr;
  
}


  #app .home-shell {

    padding: 18px;
  
}


  #app .novel-card {

    grid-template-columns: 1fr;
  
}


  #app .novel-actions {

    justify-content: flex-start;
  
}

}
