:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #1f2329;
  --muted: #646a73;
  --line: #e5e6eb;
  --accent: #0f6b4c;
  --danger: #c23b3b;
  --nav-h: 40px;
  --control-h: 34px;
  --filter-h: 28px;
  --row-h: 44px;
  --space: 10px;
  --space-sm: 6px;
  --read-size: 16.5px;
  --read-lh: 1.7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.wrap {
  width: 100%;
  margin: 0 auto;
  padding: var(--space);
}

/* Operate across the available screen; constrain prose and editors separately. */
.content-list {
  padding: var(--space);
}
.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-sm);
}
.search-field {
  flex: 0 1 440px;
  min-width: 0;
  margin: 0;
}
.search-field input {
  width: 100%;
}
.quiet {
  background: #fff;
  color: var(--text);
  border: 1px solid #b8bfc6;
}
.text-button {
  background: transparent;
  color: var(--accent);
  padding-inline: 6px;
}
.batch-filter {
  margin: 0 0 0 auto;
}
.batch-filter summary {
  padding-block: 10px;
  color: var(--muted);
}
.batch-filter[open] {
  flex-basis: 100%;
}
.batch-filter label {
  display: inline-block;
  margin-right: 12px;
}
.batch-filter input {
  max-width: 160px;
  margin-right: 8px;
}
.filter-group {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  padding: 3px 0 3px 76px;
  min-inline-size: 0;
  position: relative;
}
.filter-group legend {
  float: left;
  width: 76px;
  margin-left: -76px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 13px;
}
.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}
.filter-group .filter-choice {
  display: inline-flex;
  position: relative;
  margin: 0;
  cursor: pointer;
  gap: 0;
}
.filter-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
}
.filter-choice span {
  display: inline-flex;
  align-items: center;
  min-height: var(--filter-h);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
}
.filter-choice input:checked + span {
  color: #0a573d;
  background: #e5f1eb;
  border-color: #86b5a2;
  font-weight: 600;
}
.filter-choice:hover span {
  background: #eff5f1;
}
.filter-choice input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}
.tag-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px 8px;
  vertical-align: middle;
}
.tag-tools input {
  inline-size: 160px;
  min-width: 0;
  min-height: var(--filter-h);
  font-size: 14px;
}
.tag-filter .filter-group {
  display: inline;
}
.tag-filter .filter-options {
  display: inline-flex;
}
#tag-options.expanded {
  max-block-size: 260px;
  overflow-y: auto;
  padding: 3px;
}
#tag-empty {
  margin-left: 76px;
}
.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-block: 6px 4px;
  border-top: 1px solid var(--line);
}
#list-status {
  font-size: 14px;
  color: var(--muted);
}
#result-table[aria-busy="true"] tbody {
  opacity: 0.45;
  pointer-events: none;
}
.content-list td,
.content-list th {
  padding-block: 8px;
}
.content-list .article-title {
  width: 54%;
  max-width: none;
}
.content-list td:not(.article-title) {
  white-space: nowrap;
}
.check-column {
  width: 40px;
}
.content-title-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  line-height: 1.6;
}
.content-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.digest-mark {
  color: var(--accent);
}
.pagination {
  justify-content: flex-end;
  margin-top: 20px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.section-heading h2 {
  margin: 0;
  font-size: 22px;
}
.settings-page {
  padding: 24px;
}
.settings-form {
  max-width: 680px;
}
.settings-form .config-fields {
  padding: 0;
  margin: 0 0 24px;
  border: 0;
  min-width: 0;
}
.config-fields > input:not([type="checkbox"]),
.config-fields > textarea {
  display: block;
  width: 100%;
}
.config-fields .toggle-label {
  display: flex;
}
.settings-values {
  margin: 0;
}
.settings-values > div {
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
}
.settings-values dt {
  color: var(--muted);
}
.settings-values dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.preserve-lines {
  white-space: pre-wrap;
  line-height: 1.8;
}
.trial-layout {
  display: grid;
  grid-template-columns: minmax(240px, 440px) minmax(0, 1fr);
  gap: 40px;
}
.trial-layout .card-preview {
  margin-top: 0;
  width: 100%;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  margin-top: 32px;
  border-top: 1px solid var(--line);
}
.detail-body {
  min-width: 0;
}
.detail-sidebar {
  padding-block: 24px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.detail-sidebar details {
  margin: 0 0 16px;
}
.detail-sidebar summary {
  font-weight: 600;
}
.content-detail .reading {
  font-size: var(--read-size);
  line-height: var(--read-lh);
  margin: 20px auto;
}
.reading p {
  margin-block: 0 1.2em;
}
.reading h1,
.reading h2,
.reading h3 {
  margin-block: 1.8em 0.75em;
  line-height: 1.5;
}
.reading li {
  margin-block: 0.45em;
}
.reading blockquote {
  margin: 24px 0;
  padding: 8px 20px;
  border-left: 1px solid #b8c9bf;
  color: var(--muted);
}
.reading img {
  display: block;
  margin: 24px auto;
  cursor: zoom-in;
}
.reading a {
  overflow-wrap: anywhere;
}
.reading .missing-image {
  display: none;
}
.asset-diag {
  margin: 12px 0;
  font-size: 13px;
  color: var(--muted);
}
.content-summary {
  margin: 24px auto;
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.8;
}
#structure:empty {
  display: none;
}
#notice:empty {
  display: none;
}
@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .detail-sidebar {
    border-top: 1px solid var(--line);
  }
  .trial-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}
@media (max-width: 640px) {
  :root {
    --control-h: 44px;
    --filter-h: 44px;
  }
  .content-list {
    padding: 16px;
  }
  .search-field {
    flex-basis: 100%;
  }
  .filter-group {
    padding: 8px 0;
  }
  .filter-group legend {
    float: none;
    width: auto;
    margin: 0;
    padding: 8px 0;
  }
  .filter-choice span {
    padding-inline: 10px;
  }
  .tag-tools {
    margin-left: 0;
  }
  #filter .tag-tools input {
    width: 160px;
  }
  .content-list .article-title {
    min-width: 240px;
  }
  .settings-page {
    padding: 16px;
  }
  .settings-values > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .content-detail .reading {
    font-size: 16px;
  }
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
h1,
h2 {
  margin: 0 0 12px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
input,
select,
button,
textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}
button.secondary {
  background: #4e5969;
}
button.danger {
  background: var(--danger);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f0;
  font-size: 12px;
}
.badge.draft {
  background: #fff3e0;
}
.badge.unpublished {
  background: #fdecea;
}
.badge.published {
  background: #e8f5e9;
}
.login-box {
  max-width: 360px;
  margin: 12vh auto;
}
.err {
  color: var(--danger);
  margin-top: 8px;
}
.pre {
  white-space: pre-wrap;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.6;
}

header {
  justify-content: space-between;
  margin-bottom: 16px;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
label {
  display: block;
  margin: 12px 0 6px;
}
form input:not([type="checkbox"]):not([type="file"]),
form textarea {
  max-width: 100%;
}
form:not(.row) > input:not([type="checkbox"]),
form:not(.row) > textarea {
  display: block;
  width: 100%;
  margin-bottom: 16px;
}
input,
button,
select,
textarea {
  min-height: var(--control-h);
  font-size: 14px;
}
header.row {
  min-height: var(--nav-h);
  margin-bottom: var(--space-sm);
}
header h1 {
  font-size: 18px;
  margin: 0;
}
.admin-dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  width: min(640px, calc(100vw - 32px));
  max-height: 85dvh;
}
.admin-dialog::backdrop {
  background: rgba(20, 24, 28, 0.35);
}
.admin-dialog-form {
  display: flex;
  flex-direction: column;
  max-height: 85dvh;
}
.admin-dialog-head,
.admin-dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.admin-dialog-foot {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}
.admin-dialog-head h3 {
  margin: 0;
  font-size: 16px;
}
.admin-dialog-body {
  padding: 12px 16px;
  overflow: auto;
}
.admin-dialog-error {
  color: var(--danger);
  padding: 0 16px 8px;
  margin: 0;
}
.sync-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.sync-tabs a[aria-current="page"] {
  font-weight: 600;
  color: var(--accent);
}
.job-summary {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 12px;
}
.compact-meta {
  color: var(--muted);
  font-size: 12px;
}
input[type="checkbox"] {
  min-height: auto;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
button:hover {
  filter: brightness(0.92);
}
:focus-visible {
  outline: 3px solid #0f6b4c;
  outline-offset: 3px;
}
input,
textarea {
  caret-color: var(--accent);
  border-color: #8d959d;
}
::selection {
  background: #cce8db;
  color: #183d2d;
}
.toolbar {
  margin: 20px 0;
}
.table-wrap {
  overflow-x: auto;
}
.article-title {
  min-width: 200px;
  max-width: 440px;
  overflow-wrap: anywhere;
}
small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}
.reading {
  max-width: 72ch;
  margin: 32px auto;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.reading img {
  max-width: 100%;
  height: auto;
}
.reading table {
  display: block;
  overflow: auto;
}
.reading pre {
  white-space: pre-wrap;
}
.detail-title {
  margin-top: 28px;
  overflow-wrap: anywhere;
}
.card-preview {
  display: block;
  max-width: 440px;
  max-height: 700px;
  object-fit: contain;
  margin: 16px 0;
}
[hidden] {
  display: none !important;
}
.category-row {
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}
.more-actions {
  display: inline-block;
  margin-left: 0.25rem;
}
.more-actions > summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  color: var(--muted);
}
.more-actions > summary::-webkit-details-marker {
  display: none;
}
.more-actions[open] > summary {
  color: var(--text);
}
.more-actions .danger {
  display: block;
  margin-top: 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#notice {
  min-height: 24px;
  overflow-wrap: anywhere;
}
#notice[role="alert"] {
  color: var(--danger);
}
@media (max-width: 640px) {
  .wrap {
    padding: 16px;
  }
  h1 {
    font-size: 24px;
  }
  nav button {
    flex: 1 1 auto;
  }
  .card {
    padding: 16px;
  }
  .row > div {
    max-width: 100%;
  }
  .card-preview {
    max-width: 100%;
  }
  .login-box {
    margin: 8vh 16px;
    max-width: none;
  }
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--nav-h);
  padding: 4px 10px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
}
@media (max-width: 640px) {
  nav a {
    min-height: 44px;
    padding: 8px 12px;
  }
}
nav a[aria-current="page"] {
  color: var(--accent);
  background: #e5f1eb;
  font-weight: 600;
}
nav a:hover {
  background: #e5f1eb;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
header h1 {
  font-size: 22px;
  margin: 0;
}
header.row {
  align-items: flex-start;
  gap: 20px;
}
nav {
  row-gap: 4px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-block: 20px;
}
fieldset label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-inline-end: 20px;
}
details {
  margin-block: 24px;
}
summary {
  cursor: pointer;
  padding: 12px 0;
}
#tag-editor:not(:empty) {
  margin-block: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
#tag-editor form {
  max-width: 640px;
}
td {
  font-variant-numeric: tabular-nums;
}
select {
  max-width: 250px;
}
@media (max-width: 640px) {
  nav {
    width: 100%;
  }
  nav a {
    flex: 1 0 auto;
  }
  #filter > div {
    width: 100%;
  }
  #filter input,
  #filter select {
    width: 100%;
    max-width: 100%;
  }
}
