.detail-nav {
  position: sticky;
  top: -38px;
  z-index: 4;
  display: flex;
  gap: 8px;
  margin: -10px 0 24px;
  padding: 10px 0;
  background: rgba(252, 253, 252, 0.96);
  border-bottom: 1px solid var(--line);
}

.trash-trigger {
  position: relative;
}

.trash-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--white);
  border-radius: 9px;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
}

.confirm-card,
.trash-card {
  position: relative;
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.trash-card {
  width: min(760px, 100%);
}

.confirm-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #fff0ee;
  color: var(--red);
}

.confirm-icon svg {
  width: 21px;
}

.confirm-card h2 {
  margin: 16px 0 8px;
}

.confirm-card > p {
  margin: 7px 0;
  color: var(--muted);
  line-height: 1.6;
}

.retention-note {
  font-size: 12px;
}

.danger {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid var(--red);
  border-radius: 5px;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
}

.danger svg {
  width: 17px;
}

.trash-list {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.trash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 2px;
  border-bottom: 1px solid var(--line);
}

.trash-item-main {
  min-width: 0;
}

.trash-kind {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.trash-item h3 {
  margin: 5px 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.restore-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--white);
  color: var(--green);
  cursor: pointer;
  font-weight: 700;
}

.restore-btn svg {
  width: 16px;
}

.trash-empty {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.trash-empty svg {
  width: 28px;
}

.trash-empty strong {
  color: var(--ink);
}

.nav-command {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}

.nav-command:hover {
  border-color: var(--green);
  color: var(--green);
  background: #f3f8f4;
}

.nav-command svg {
  width: 17px;
  height: 17px;
}

.copy-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.score-details {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.headline-selector {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.headline-choice-list {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.headline-choice {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 54px 80px;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.headline-choice.is-selected {
  background: #f3f8f4;
}

.headline-rank {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.headline-choice.is-selected .headline-rank {
  background: var(--green);
  color: var(--white);
}

.headline-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.headline-score {
  color: var(--green);
  font-size: 16px;
  text-align: right;
  white-space: nowrap;
}

.headline-score small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.headline-selected,
.headline-select-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.headline-selected {
  color: var(--green);
}

.headline-select-btn {
  border: 1px solid var(--green);
  background: var(--white);
  color: var(--green);
  cursor: pointer;
}

.headline-select-btn:hover:not(:disabled) {
  background: #eef7f0;
}

.headline-select-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}

.headline-selected svg,
.headline-select-btn svg {
  width: 14px;
  height: 14px;
}

.section-title,
.score-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-title span,
.score-head span {
  color: var(--muted);
  font-size: 11px;
}

.section-title h3,
.score-head h4 {
  margin: 3px 0 0;
  letter-spacing: 0;
}

.section-title h3 {
  font-size: 18px;
}

.score-head h4 {
  font-size: 15px;
}

.audit-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 5px;
  font-weight: 700;
}

.audit-result.passed {
  background: #eef7f0;
  color: var(--green);
}

.audit-result.attention {
  background: #fff3e5;
  color: #9a5a00;
}

.audit-result svg {
  width: 15px;
  height: 15px;
}

.score-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.score-summary > div {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.score-summary > div:last-child {
  border-right: 0;
}

.score-summary span,
.score-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.score-summary strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 25px;
  line-height: 1;
}

.score-block {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.score-total {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: none;
}

.score-total strong {
  font-size: 24px;
}

.score-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 24px;
  margin-top: 16px;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(70px, 1.5fr) 42px;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.score-row > span {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row > strong {
  text-align: right;
  font-size: 12px;
}

.score-row small {
  color: var(--muted);
  font-weight: 400;
}

.score-track {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #e7ece8;
}

.score-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.copy-article {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
}

.copy-article:hover {
  background: var(--green2);
}

.copy-article svg {
  width: 17px;
  height: 17px;
}

.delete-article {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #d9aaa5;
  border-radius: 5px;
  background: var(--white);
  color: var(--red);
  cursor: pointer;
  font-weight: 700;
}

.delete-article:hover {
  background: #fff3f1;
  border-color: var(--red);
}

.delete-article svg {
  width: 17px;
  height: 17px;
}

.regenerate-article,
.retry-job {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--white);
  color: var(--green);
  cursor: pointer;
  font-weight: 700;
}

.job-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.job-item.failed .progress span {
  background: var(--red);
}

.job-stage b,
.job-stage span {
  display: block;
}

.job-stage b {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12px;
}

.job-stage span {
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.job-checkpoint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.job-checkpoint svg {
  width: 14px;
  height: 14px;
  color: var(--green);
}

.job-controls button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--white);
  color: var(--green);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.job-controls button.stop-job {
  border-color: #d9aaa5;
  color: var(--red);
}

.job-controls button.delete-failed-job {
  width: 34px;
  justify-content: center;
  padding: 0;
  border-color: #d9aaa5;
  color: var(--red);
}

.job-controls button.delete-failed-job:hover {
  border-color: var(--red);
  background: #fff3f1;
}

.job-controls .retry-job {
  margin-top: 0;
}

.job-controls svg {
  width: 15px;
  height: 15px;
}

.regenerate-article:hover,
.retry-job:hover {
  background: #f3f8f4;
}

.regenerate-article svg,
.retry-job svg {
  width: 17px;
  height: 17px;
}

.retry-job {
  min-height: 34px;
  margin-top: 10px;
  padding: 0 12px;
  font-size: 12px;
}

@media (max-width: 600px) {
  .detail-nav {
    top: -26px;
    margin-top: -6px;
  }

  .nav-command {
    flex: 1;
    justify-content: center;
  }

  .copy-article,
  .delete-article,
  .regenerate-article {
    flex: 1;
  }

  .confirm-card,
  .trash-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 8px 8px 0 0;
    padding: 20px;
  }

  .trash-item {
    align-items: flex-start;
  }

  .trash-item p {
    line-height: 1.6;
  }

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

  .score-summary > div,
  .score-summary > div:last-child {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .score-summary > div:last-child {
    border-bottom: 0;
  }

  .score-summary strong {
    grid-row: 1 / span 2;
    grid-column: 2;
  }

  .score-rows {
    grid-template-columns: 1fr;
  }

  .headline-choice {
    grid-template-columns: 28px minmax(0, 1fr) 48px;
    gap: 8px;
    padding: 12px 2px;
  }

  .headline-selected,
  .headline-select-btn {
    grid-column: 2 / 4;
    justify-self: end;
  }
}

.pagination {
  position: sticky;
  bottom: -1px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 12px rgba(24, 42, 31, 0.04);
}

.pagination > span {
  min-width: 150px;
  text-align: center;
}

.pagination strong,
.pagination small {
  display: block;
}

.pagination strong {
  font-size: 13px;
}

.pagination small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-btn svg {
  width: 18px;
}

.article-item p {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}
