/* style.css - OpenClaw PHP - Modern, Fashionable, User-friendly UI */

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-color: #f8fafc;
  --sidebar-bg: #ffffff;
  --chat-bubble-user: #2563eb;
  --chat-bubble-assistant: #f1f5f9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

@keyframes pulse {
  0% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.4; transform: scale(0.95); }
}

@keyframes liveDots {
  0%, 20% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
  100% { opacity: 0.25; transform: translateY(0); }
}

@keyframes caretBlink {
  0%, 45% { opacity: 0; }
  50%, 95% { opacity: 1; }
  100% { opacity: 0; }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  height: 60px;
  background-color: #fff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  margin-left: 16px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

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

/* Container */
.container {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-width: 0;
}

.admin-layout-main {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
}

.btn-new-chat {
  width: 100%;
  padding: 10px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn-new-chat:hover {
  background-color: var(--primary-hover);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chat-item {
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.chat-item:hover {
  background-color: var(--bg-color);
}

.chat-item.active {
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
}

.chat-item-title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

/* Chat Main Area */
.chat-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  position: relative;
  overflow: hidden;
}

.chat-top-bar {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.chat-top-bar-main,
.chat-top-bar-status,
.chat-top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.chat-top-bar-main {
  flex: 1 1 380px;
}

.chat-top-bar-status {
  flex: 999 1 420px;
  min-width: min(420px, 100%);
}

.chat-top-bar-actions {
  margin-left: auto;
  justify-content: flex-end;
  flex: 0 1 auto;
}

.select-model, .select-role {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 14px;
  background-color: #fff;
  min-width: 0;
}

.select-model {
  flex: 1 1 260px;
  max-width: 420px;
}

.select-role {
  flex: 0 1 180px;
  max-width: 220px;
}

#roleModeIndicator,
#effectiveModelIndicator {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Messages */
.message {
  max-width: 80%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.message-user {
  align-self: flex-end;
}

.message-assistant {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  position: relative;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.message-user .message-content {
  background-color: var(--chat-bubble-user);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message-assistant .message-content {
  background-color: var(--chat-bubble-assistant);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

.message-actions {
  margin-top: 4px;
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.message-action-btn {
  cursor: pointer;
}

.message-action-btn:hover {
  color: var(--primary-color);
}

.message-live-indicator {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.message-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2563eb;
  animation: pulse 1.2s infinite;
}

.message-live-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.message-live-dots span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.25;
  animation: liveDots 1.2s infinite ease-in-out;
}

.message-live-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.message-live-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.message-content-live {
  position: relative;
  border-left: 3px solid rgba(56, 189, 248, 0.9);
  padding-left: 12px;
}

.message-content-live::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -2px;
  background: #38bdf8;
  border-radius: 999px;
  animation: caretBlink 1s infinite;
}

.message-content p {
  margin: 0 0 10px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content pre {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.18);
  color: #0f172a;
}

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

.message-content blockquote {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 3px solid #cbd5e1;
  color: #475569;
}

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

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 10px 0 8px;
  line-height: 1.35;
}

.message-content h1 { font-size: 24px; }
.message-content h2 { font-size: 22px; }
.message-content h3 { font-size: 20px; }
.message-content h4 { font-size: 18px; }
.message-content h5 { font-size: 16px; }
.message-content h6 { font-size: 14px; }

.message-content a {
  color: #2563eb;
  text-decoration: underline;
}

.message-content hr {
  margin: 14px 0;
  border: 0;
  border-top: 1px solid #cbd5e1;
}

.message-content .task-list {
  list-style: none;
  padding-left: 0;
}

.message-content .task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.message-attachments {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-edited-badge {
  margin-top: 6px;
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.message-attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 12px;
}

.message-attachment-generated {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(360px, 100%);
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.24);
  gap: 10px;
}

.message-assistant .message-attachment-generated {
  background: #fff;
}

.message-attachment-generated-image {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.message-attachment-generated-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message-attachment-generated-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.message-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.message-inline-btn:hover {
  background: #eff6ff;
}

.message-user .message-attachment-item {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.message-attachment-name {
  font-weight: 600;
}

.message-attachment-type {
  opacity: 0.8;
}

.message-attachment-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.message-reference-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message-reference-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #dbeafe;
  color: #1d4ed8;
}

.message-workbench-prompt {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 12px;
}

.message-workbench-saved {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 12px;
}

.message-workbench-saved strong {
  font-size: 12px;
}

.code-block {
  position: relative;
  margin: 10px 0;
}

.code-block pre {
  margin: 0;
  max-width: 100%;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.token-keyword {
  color: #93c5fd;
}

.token-string {
  color: #86efac;
}

.token-number {
  color: #fca5a5;
}

.token-comment {
  color: #94a3b8;
}

.table-wrap {
  margin: 10px 0;
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  overflow: hidden;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  background: #eff6ff;
  font-weight: 700;
}

.footnotes {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  font-size: 13px;
  color: #475569;
}

.footnote-item {
  margin-top: 6px;
}

.footnote-ref {
  color: #2563eb;
}

/* Chat Input */
.chat-input-container {
  padding: 24px;
  background-color: #fff;
  border-top: 1px solid var(--border-color);
  width: 100%;
  min-width: 0;
}

.chat-input-wrapper {
  width: 100%;
  max-width: none;
  margin: 0;
  position: relative;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.writing-preset-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.writing-preset-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
}

.writing-preset-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.writing-preset-actions .btn-secondary {
  padding: 8px 12px;
  font-size: 12px;
}

.writing-brief-card {
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.writing-brief-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.writing-brief-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a8a;
}

.writing-brief-desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: #64748b;
}

.writing-brief-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: #64748b;
}

.writing-brief-hint[data-tone="success"] {
  color: #15803d;
}

.writing-brief-hint[data-tone="error"] {
  color: #b91c1c;
}

.writing-brief-hint[data-tone="loading"] {
  color: #1d4ed8;
}

.writing-brief-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.writing-brief-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 180px;
  gap: 12px;
}

.writing-brief-grid-span {
  grid-column: 1 / -1;
}

.writing-brief-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0) 0%, rgba(248, 251, 255, 0.96) 28%, rgba(248, 251, 255, 1) 100%);
}

.writing-brief-context-panel {
  margin-top: 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #eff6ff;
  padding: 14px;
  max-height: min(28vh, 240px);
  overflow-y: auto;
}

.writing-brief-context-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.writing-brief-context-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
}

.writing-brief-context-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.writing-brief-context-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.writing-brief-context-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.writing-brief-context-card {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.writing-brief-context-label {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.writing-brief-context-text {
  font-size: 12px;
  line-height: 1.8;
  color: #475569;
  max-height: 120px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#writingAssistBar,
#writingBriefBar,
#workflowStatusBar,
#reasoningPanel,
#workflowPanel,
#reasoningPanelBody,
#workflowPanelBody,
#workflowPlanPreview,
#workflowStepList {
  min-width: 0;
}

#writingBriefBar {
  flex-shrink: 0;
  max-height: min(52vh, 560px);
  overflow-y: auto;
}

#workflowPanel details,
#workflowPanel summary,
#workflowPanel pre,
#reasoningPanel pre {
  max-width: 100%;
}

#workflowPanel pre,
#reasoningPanel pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: auto;
}

.chat-input-textarea {
  width: 100%;
  border: none;
  resize: none;
  outline: none;
  font-size: 15px;
  min-height: 40px;
  max-height: 200px;
}

.chat-input-toolbar {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  border: 1px solid #bfdbfe;
}

.attachment-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  border: none;
  background: none;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.toolbar-left {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.toolbar-btn {
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s;
}

.toolbar-btn:hover {
  background-color: var(--bg-color);
  color: var(--primary-color);
}

.btn-send {
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.btn-send:hover {
  background-color: var(--primary-hover);
}

@media (max-width: 1200px) {
  .chat-top-bar-actions {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .chat-top-bar {
    padding: 12px 16px;
    gap: 12px;
  }

  .chat-history,
  .chat-input-container {
    padding: 16px;
  }

  .chat-top-bar-main,
  .chat-top-bar-status,
  .chat-top-bar-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .select-model,
  .select-role {
    max-width: none;
  }

  .writing-preset-bar-inner,
  .writing-brief-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .writing-brief-grid {
    grid-template-columns: 1fr;
  }

  .writing-brief-context-grid {
    grid-template-columns: 1fr;
  }



  .toolbar-right {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .workflow-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .workflow-action-panel {
    flex: 1 1 100%;
    min-width: 0;
  }

  .workflow-action-panel .workflow-detail-actions {
    flex-direction: row;
  }

  .workflow-action-panel .workflow-action-link {
    width: auto;
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: 220px;
  }

  .message {
    max-width: 92%;
  }

  .chat-top-bar-main {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-top-bar-status {
    flex-direction: column;
    align-items: stretch;
  }

  #roleModeIndicator,
  #effectiveModelIndicator {
    white-space: normal;
  }

  .chat-input-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .toolbar-right .btn-secondary,
  .toolbar-right .btn-send {
    width: 100%;
  }

  .agent-confirm-modal-content {
    width: calc(100vw - 20px);
    max-height: 88vh;
    padding: 16px;
  }

  .agent-confirm-body {
    max-height: calc(88vh - 142px);
  }

  .agent-confirm-modal-content .modal-footer {
    flex-direction: column;
  }

  .agent-confirm-modal-content .modal-footer .btn-secondary,
  .agent-confirm-modal-content .modal-footer .btn-primary {
    width: 100%;
  }

  .workflow-summary-grid {
    grid-template-columns: 1fr;
  }

  .workflow-detail-actions a {
    width: 100%;
    text-align: center;
  }

  .workflow-action-panel .workflow-detail-actions {
    flex-direction: column;
  }

  .workflow-action-panel .workflow-action-link {
    width: 100%;
  }
}

/* Footer */
.footer {
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  background-color: #fff;
  border-top: 1px solid var(--border-color);
}

/* Dashboard Styles */
.dashboard-container {
  width: 100%;
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
  padding-bottom: 32px;
}

.dashboard-container.novel-admin-page {
  max-width: calc(100vw - 32px);
  margin: 12px 0 24px 0;
  padding: 12px 12px 32px 12px;
}

.card {
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.workflow-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.workflow-detail-heading {
  flex: 1 1 540px;
  min-width: 0;
}

.workflow-action-panel {
  flex: 0 0 260px;
  min-width: 240px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  box-shadow: var(--shadow-sm);
}

.workflow-action-title {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 10px;
}

.workflow-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
}

.workflow-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.workflow-action-panel .workflow-detail-actions {
  flex-direction: column;
}

.workflow-action-panel .workflow-action-link {
  width: 100%;
}

.workflow-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.workflow-step-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.workflow-step-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.workflow-scroll-panel {
  max-height: 240px;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workflow-user-input-preview {
  max-height: 220px;
}

.workflow-final-answer {
  max-height: 180px;
  font-size: 14px;
  font-weight: 600;
}

.workflow-rich-text {
  color: #334155;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.workflow-rich-text p {
  margin: 0 0 10px;
}

.workflow-rich-text p:last-child {
  margin-bottom: 0;
}

.workflow-rich-text ul,
.workflow-rich-text ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.workflow-rich-text li + li {
  margin-top: 6px;
}

.workflow-empty-text {
  color: #94a3b8;
  font-size: 13px;
}

.workflow-mono-panel {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.workflow-raw-response {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #1e293b;
  max-height: 320px;
}

.workflow-error-panel {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
  max-height: 220px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary-color);
}

.btn-primary {
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

/* Auth Pages */
.auth-page {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
}

.auth-card {
  width: 400px;
  background-color: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.auth-title {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 32px;
  color: var(--primary-color);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: #fff;
  border-radius: var(--radius-lg);
  width: 500px;
  max-width: 90%;
  padding: 24px;
  box-shadow: var(--shadow-md);
  transform: translateY(-20px);
  transition: all 0.2s;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  line-height: 1;
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.agent-confirm-modal-content {
  width: min(720px, calc(100vw - 32px));
  max-height: min(82vh, 900px);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.agent-confirm-modal-content .modal-header {
  margin-bottom: 14px;
  flex-shrink: 0;
}

.agent-confirm-body {
  font-size: 14px;
  color: var(--text-main);
  overflow-y: auto;
  max-height: calc(82vh - 150px);
  padding-right: 6px;
}

.agent-confirm-body ol {
  max-height: 32vh;
  overflow-y: auto;
  padding-right: 4px;
}

.agent-confirm-body pre {
  white-space: pre-wrap;
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow-x: auto;
}

.agent-confirm-raw {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.agent-confirm-raw summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  color: #475569;
  list-style: none;
}

.agent-confirm-raw summary::-webkit-details-marker {
  display: none;
}

.agent-confirm-raw pre {
  margin: 0 12px 12px 12px;
}

.agent-confirm-modal-content .modal-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  background: #fff;
  flex-shrink: 0;
}

.workbench-insert-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-secondary {
  padding: 10px 20px;
  background-color: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

/* Novel Workbench */
.novel-admin-page {
  position: relative;
  width: calc(100vw - 32px);
  max-width: calc(100vw - 32px);
  margin: 16px 0 24px 0;
  padding: 12px 12px 32px 12px;
  isolation: isolate;
}

.novel-admin-page::before,
.novel-admin-page::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.65;
  pointer-events: none;
}

.novel-admin-page::before {
  width: 320px;
  height: 320px;
  top: -30px;
  left: -60px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(99, 102, 241, 0) 72%);
}

.novel-admin-page::after {
  width: 360px;
  height: 360px;
  top: 120px;
  right: -90px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(56, 189, 248, 0) 72%);
}

.novel-admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.novel-admin-sidebar {
  position: sticky;
  top: 24px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.93) 100%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.novel-admin-sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 120px;
  background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.28), rgba(96, 165, 250, 0));
  pointer-events: none;
}

.novel-admin-sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 14px;
  position: relative;
}

.novel-admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.novel-admin-nav .nav-link {
  display: block;
  width: 100%;
  margin-left: 0;
  padding: 11px 14px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.08);
  backdrop-filter: blur(8px);
}

.novel-admin-nav .nav-link.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: #eff6ff;
  border-color: rgba(96, 165, 250, 0.26);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(37, 99, 235, 0.18);
}

.novel-admin-nav .nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.novel-workbench-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.novel-workbench-shell > .card,
.novel-workbench-grid > .card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.92) 100%);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.novel-workbench-hero {
  margin-bottom: 0;
  position: relative;
  padding: 30px 30px 28px 30px;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.22), rgba(96, 165, 250, 0) 36%),
    radial-gradient(circle at left center, rgba(167, 139, 250, 0.18), rgba(167, 139, 250, 0) 28%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, #eef4ff 100%);
  overflow: hidden;
}

.novel-workbench-hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0));
  pointer-events: none;
}

.novel-workbench-hero-main {
  min-width: 0;
  position: relative;
}

.novel-workbench-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 8px;
}

.novel-workbench-title {
  margin-bottom: 10px;
}

.novel-workbench-subtitle {
  max-width: 880px;
  color: #475569;
  font-size: 14px;
  line-height: 1.8;
}

.novel-workbench-hero-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.novel-workbench-stat-row {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.workbench-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.chip-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.chip-green {
  background: #dcfce7;
  color: #15803d;
}

.chip-yellow {
  background: #fef3c7;
  color: #a16207;
}

.chip-pink {
  background: #fce7f3;
  color: #be185d;
}

.chip-purple {
  background: #ede9fe;
  color: #6d28d9;
}

.workbench-notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.workbench-warning {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  line-height: 1.7;
  font-size: 13px;
}

.novel-workbench-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1.45fr) 340px;
  gap: 18px;
  align-items: start;
}

.novel-workbench-grid.compact-layout {
  grid-template-columns: 260px minmax(0, 1fr);
}

.workbench-pane {
  margin-bottom: 0;
  min-width: 0;
  position: relative;
}

.workbench-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.workbench-pane-header.compact {
  margin-bottom: 12px;
}

.workbench-pane-header.no-margin {
  margin-bottom: 0;
}

.workbench-pane-header h3,
.workbench-pane-header h4 {
  margin: 0;
  color: #0f172a;
}

.workbench-pane-header p {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.workbench-empty-state {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.workbench-empty-state.large {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.workbench-book-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-book-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.94) 100%);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.work-book-card.is-active {
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 20px 36px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.work-book-card-main {
  display: block;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.work-book-card-main:hover {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.7) 0%, rgba(248, 250, 252, 0.2) 100%);
}

.work-book-card-title-row,
.chapter-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.work-book-card-desc,
.chapter-card-preview {
  margin-top: 10px;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}

.work-book-card-meta,
.work-book-card-footer,
.chapter-card-stats {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 12px;
}

.work-book-card-footer {
  color: #94a3b8;
}

.work-book-card-actions,
.chapter-card-actions,
.chapter-editor-actions,
.preset-link-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.work-book-card-actions {
  padding: 0 16px 16px 16px;
}

.work-book-card-actions .btn-secondary,
.chapter-card-actions .btn-secondary,
.preset-link-list .btn-secondary {
  padding: 8px 12px;
  font-size: 12px;
  text-decoration: none;
}

.btn-secondary.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.chapter-header-main {
  margin-bottom: 12px;
}

.chapter-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chapter-header-actions .btn-secondary,
.chapter-header-actions .btn-primary {
  text-decoration: none;
}

.chapter-summary-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chapter-create-card,
.chapter-list-card,
.chapter-editor-card,
.inspector-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.9) 100%);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.chapter-list-card,
.chapter-editor-card,
.inspector-card + .inspector-card {
  margin-top: 16px;
}

.workbench-form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workbench-form-stack.compact-stack {
  gap: 10px;
  margin-top: 14px;
}

.workbench-form-stack label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.workbench-form-grid {
  display: grid;
  gap: 12px;
}

.workbench-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workbench-form-grid.two {
  grid-template-columns: 220px minmax(0, 1fr);
}

.field-hint {
  align-self: end;
  font-size: 12px;
  color: #64748b;
  line-height: 1.7;
}

.chapter-directory-table {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.chapter-directory-head,
.chapter-directory-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: center;
}

.chapter-directory-head {
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.chapter-directory-row {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  transition: background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.chapter-directory-row:last-child {
  border-bottom: none;
}

.chapter-directory-row:hover {
  background: rgba(248, 250, 252, 0.88);
  transform: translateY(-1px);
}

.chapter-directory-row.is-active {
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.92) 0%, rgba(239, 246, 255, 0.8) 100%);
}

.chapter-directory-index strong {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 13px;
}

.chapter-directory-title {
  min-width: 0;
}

.chapter-directory-title strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-directory-meta {
  margin-top: 6px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
}

.chapter-directory-status {
  color: #1d4ed8;
  font-weight: 700;
}

.chapter-directory-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.chapter-directory-actions .btn-secondary {
  min-width: 58px;
  padding: 8px 10px;
  font-size: 12px;
  text-align: center;
  text-decoration: none;
}

.chapter-editor-modal-content {
  width: min(1080px, calc(100vw - 32px));
}

.chapter-editor-modal-subtitle {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.chapter-editor-modal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
}

.chapter-editor-textarea.modal-editor {
  min-height: calc(82vh - 190px);
}

.chapter-editor-actions.small-gap {
  gap: 6px;
}

.chapter-editor-textarea {
  min-height: 560px;
  font-family: "SFMono-Regular", Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.inspector-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.workbench-pane-books {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.93) 100%),
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.08), rgba(96, 165, 250, 0));
}

.workbench-pane-chapters {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%),
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.08), rgba(167, 139, 250, 0));
}

.workbench-pane-inspector {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.92) 100%),
    radial-gradient(circle at top left, rgba(52, 211, 153, 0.08), rgba(52, 211, 153, 0));
}

.inspector-stat-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inspector-summary-text,
.inspector-notes-text {
  font-size: 13px;
  line-height: 1.8;
  color: #475569;
}

.inspector-notes-text {
  margin-top: 10px;
  color: #9a3412;
}

.inspector-mini-groups {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.inspector-mini-groups strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #0f172a;
}

.inspector-mini-groups ul {
  padding-left: 18px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
}

.inspector-helper-text {
  margin-top: 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
}

.novel-workbench-modal {
  width: min(860px, calc(100vw - 32px));
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}

.modal-form {
  overflow-y: auto;
  padding-right: 4px;
}

.work-detail-modal-content,
.chapter-preview-modal-content {
  width: min(980px, calc(100vw - 32px));
}

.work-detail-modal-body,
.chapter-preview-scroll {
  overflow-y: auto;
  padding-right: 4px;
}

.work-detail-modal-body {
  display: grid;
  gap: 16px;
}

.work-detail-section h4 {
  margin-bottom: 10px;
}

.work-detail-block,
.work-detail-file-card,
.work-detail-empty {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.8;
  color: #475569;
}

.work-detail-file-card + .work-detail-file-card {
  margin-top: 10px;
}

.work-detail-file-card strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

.chapter-preview-scroll {
  max-height: calc(86vh - 84px);
  padding: 8px 4px 0 0;
}

.chapter-reading-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 12px 26px 12px;
  color: #1f2937;
  font-size: 17px;
  line-height: 2;
}

.chapter-reading-article p + p {
  margin-top: 18px;
}

@media (max-width: 1200px) {
  .novel-workbench-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .workbench-pane-inspector {
    grid-column: 1 / -1;
  }

  .novel-workbench-grid.compact-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .novel-admin-layout {
    grid-template-columns: 1fr;
  }

  .novel-admin-sidebar {
    position: static;
  }

  .novel-admin-page {
    width: 100%;
    max-width: 100%;
    margin: 12px 0 20px 0;
    padding: 8px 8px 24px 8px;
  }

  .novel-workbench-grid {
    grid-template-columns: 1fr;
  }

  .novel-workbench-grid.compact-layout {
    grid-template-columns: 1fr;
  }

  .chapter-directory-head,
  .chapter-directory-row,
  .workbench-form-grid.three,
  .workbench-form-grid.two {
    grid-template-columns: 1fr;
  }

  .chapter-directory-head {
    display: none;
  }

  .chapter-directory-row {
    gap: 12px;
  }

  .chapter-directory-actions {
    justify-content: flex-start;
  }
}
