/* 文章管理 */
.panel-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.articles-toolbar {
  grid-template-columns: minmax(200px, 1.3fr) repeat(6, minmax(110px, 0.7fr)) auto;
}

.forum-toolbar {
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(120px, 0.7fr)) auto;
}

.forum-tabs + .panel {
  border-top-left-radius: 0;
}

.forum-table {
  min-width: 1120px;
}

.toolbar-check {
  display: grid;
  gap: 6px;
}

.toolbar-check > span,
.inline-check b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.inline-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.article-status-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.article-status-badge.draft {
  background: #eef2f4;
  color: var(--muted);
}

.article-status-badge.pending_review {
  background: #fff1e6;
  color: #b85c00;
}

.article-status-badge.rejected {
  background: #fde8e8;
  color: var(--red);
}

.article-status-badge.published {
  background: #e4f0ed;
  color: var(--accent-strong);
}

.article-status-badge.scheduled {
  background: #eef2ff;
  color: #3454b4;
}

.article-status-badge.archived {
  background: #fff4df;
  color: var(--amber);
}

.article-check-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
}

.article-check-badge.unknown {
  background: #eef2f4;
  color: var(--muted);
}

.article-check-badge.ok {
  background: #e4f0ed;
  color: var(--accent-strong);
}

.article-check-badge.warning {
  background: #fff4df;
  color: var(--amber);
}

.article-check-badge.error {
  background: #ffe8e3;
  color: var(--red);
}

.article-ops-cell {
  display: grid;
  gap: 4px;
  min-width: 160px;
  color: var(--muted);
  font-size: 12px;
}

.article-ops-cell span {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.article-ops-cell .is-due {
  color: var(--red);
  font-weight: 900;
}

.article-ops-cell small {
  color: var(--muted);
  line-height: 1.4;
}

.article-feature-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.article-feature-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 900;
}

.article-feature-badge.pinned {
  background: #e6eef7;
  color: var(--blue);
}

.article-feature-badge.highlighted {
  background: #fff4df;
  color: var(--amber);
}

.article-feature-badge.expired {
  background: #eef2f4;
  color: var(--muted);
}

.article-settings-panel {
  max-width: 920px;
  margin: 0 auto;
}

.article-settings-form {
  display: grid;
  gap: 18px;
}

.article-settings-card {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.article-editor-page {
  max-width: 1120px;
  margin: 0 auto;
}

.article-moderation-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e9b44c;
  border-radius: 12px;
  background: #fffaf0;
}

.article-moderation-panel[hidden] {
  display: none;
}

.article-moderation-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.article-moderation-panel textarea {
  width: 100%;
  resize: vertical;
}

.article-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.article-modal-head h2 {
  margin: 4px 0 0;
}

.article-form {
  display: grid;
  gap: 14px;
}

.article-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.article-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-form label {
  display: grid;
  gap: 6px;
}

.article-content-field {
  display: grid;
  gap: 6px;
}

.article-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.article-form span i {
  color: var(--red);
  font-style: normal;
}

.article-form input,
.article-form select,
.article-form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

.article-form textarea {
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

.article-content-source[hidden] {
  display: none;
}

.article-editor {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.article-editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #f7faf8;
}

.article-editor-tabs button {
  width: auto;
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.article-editor-tabs button:hover {
  color: var(--text);
  background: rgba(23, 107, 91, 0.06);
}

.article-editor-tabs button.is-active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
  background: var(--surface);
}

.article-editor-body {
  min-height: 420px;
}

.article-content-editor {
  width: 100%;
  min-height: 420px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  padding: 14px;
  line-height: 1.75;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.article-editor.is-text-mode .article-content-editor {
  display: block;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.article-editor.is-text-mode .article-content-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(23, 107, 91, 0.18);
}

.article-editor .tox-tinymce {
  border: 0;
  border-radius: 0;
}

.article-editor .tox .tox-edit-area__iframe {
  background: var(--surface);
}

.article-editor .tox .tox-toolbar-overlord,
.article-editor .tox .tox-toolbar__primary {
  background: #f7faf8;
}

.article-editor .tox .tox-statusbar {
  border-top: 1px solid var(--line);
}

.article-form input:focus,
.article-form select:focus,
.article-form textarea:focus {
  border-color: var(--accent);
}

.article-form-message {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.article-form-message.error {
  color: var(--red);
}

.article-form-message.success {
  color: var(--accent);
}

.article-preview-panel,
.article-check-panel,
.article-assist-panel,
.article-version-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
  padding: 14px;
}

.article-conflict-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #e7b05b;
  border-radius: var(--radius);
  padding: 14px;
  background: #fff8e8;
  color: #7a4d00;
}

.article-conflict-panel[hidden] {
  display: none;
}

.article-conflict-panel p {
  margin: 0;
  color: inherit;
  line-height: 1.6;
}

.article-preview-panel.is-stale,
.article-check-panel.is-stale,
.article-assist-panel.is-stale {
  border-color: #e7b05b;
  background: #fffaf0;
}

.article-stale-note {
  margin: 0;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.article-preview-panel[hidden],
.article-check-panel[hidden],
.article-assist-panel[hidden],
.article-version-panel[hidden] {
  display: none;
}

.article-preview-panel h3 {
  margin: 0;
  font-size: 18px;
}

.article-preview-panel p,
.article-preview-warnings {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.article-preview-warnings {
  color: var(--amber);
}

.article-preview-panel img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #f1f4f0;
}

.article-preview-content {
  color: var(--text);
  line-height: 1.75;
}

.article-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.article-tool-head span {
  color: var(--muted);
  font-size: 12px;
}

.article-check-panel p,
.article-assist-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.article-check-meter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-check-meter span {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.article-check-meter .ok,
.article-check-list .ok {
  color: var(--accent-strong);
  background: #e4f0ed;
}

.article-check-meter .warning,
.article-check-list .warning {
  color: var(--amber);
  background: #fff4df;
}

.article-check-meter .error,
.article-check-list .error {
  color: var(--red);
  background: #ffe8e3;
}

.article-check-list,
.article-assist-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-check-list li {
  display: grid;
  gap: 4px;
  border-radius: var(--radius);
  padding: 10px;
}

.article-check-list a {
  color: inherit;
  word-break: break-all;
}

.article-assist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.article-assist-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.article-assist-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.article-assist-grid dd {
  margin: 0;
  line-height: 1.5;
}

.article-assist-list li {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 10px;
  color: var(--text);
}

.article-version-head,
.article-version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.article-version-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.article-version-item span {
  color: var(--muted);
  font-size: 12px;
}

.article-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
}

.article-modal-foot-main {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

@media (max-width: 860px) {
  .articles-toolbar,
  .forum-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .article-field-grid {
    grid-template-columns: 1fr;
  }

  .contact-message-meta div,
  .contact-message-reply-history dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .article-assist-grid {
    grid-template-columns: 1fr;
  }

  .articles-toolbar,
  .forum-toolbar {
    grid-template-columns: 1fr;
  }

  .article-modal-foot {
    display: grid;
    grid-template-columns: 1fr;
  }

  .article-modal-foot-main {
    display: grid;
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .article-modal-foot-main button,
  .article-modal-foot > button {
    width: 100%;
  }
}

.topbar-copy:empty {
  display: none;
}

.notfound-page {
  display: grid;
  place-items: center;
  min-height: min(58vh, 560px);
  padding: 24px 8px 48px;
}

.notfound-card {
  width: min(420px, 100%);
  padding: 36px 28px 32px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 12% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--surface)), var(--surface));
  box-shadow: 0 18px 40px rgba(25, 34, 40, 0.08);
  text-align: center;
}

.notfound-code {
  margin: 0 0 8px;
  font-size: clamp(56px, 10vw, 76px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--amber) 50%, var(--accent)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.notfound-card h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.02em;
}

.notfound-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.notfound-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.notfound-home:hover {
  background: var(--accent-strong);
}

@media (max-width: 620px) {
  body {
    background: var(--surface);
  }

  .admin-shell {
    display: block;
  }

  .mobile-menu-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 80;
    display: inline-grid;
    gap: 4px;
    place-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(25, 34, 40, 0.12);
  }

  .mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
  }

  .admin-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(15, 23, 42, 0.28);
  }

  .admin-menu-backdrop[hidden] {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 75;
    width: min(82vw, 300px);
    height: 100vh;
    padding: 18px 14px;
    gap: 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    background: var(--surface);
    box-shadow: 18px 0 36px rgba(25, 34, 40, 0.16);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  body.admin-menu-open .sidebar {
    transform: translateX(0);
  }

  .brand > div > span,
  .topbar .eyebrow,
  .topbar-copy,
  .panel-copy,
  .users-stat-card p,
  .metric-card p {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .nav-list {
    gap: 4px;
  }

  .nav-item {
    min-height: 38px;
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 0 8px;
  }

  .nav-icon {
    width: 22px;
    height: 22px;
  }

  .main {
    padding: 58px 10px 10px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 17px;
  }

  .panel,
  .metric-card,
  .users-stat-card,
  .admin-gate-card {
    box-shadow: none;
  }

  .panel {
    padding: 12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .panel-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .dashboard-metrics-grid,
  .users-stats-grid {
    gap: 8px;
    margin-bottom: 10px;
  }

  .metric-card,
  .users-stat-card {
    min-height: 76px;
    padding: 10px 12px;
  }

  .metric-card strong,
  .users-stat-card strong {
    margin-bottom: 0;
    font-size: 22px;
  }

  .user-toolbar {
    padding: 10px;
    border-radius: 0;
  }

  .users-table-wrap {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .users-table th,
  .users-table td {
    padding: 9px;
  }

  .drawer-head,
  .drawer-body,
  .drawer-foot,
  .user-detail-head,
  .user-detail-body,
  .user-detail-foot {
    padding: 12px;
  }

  .drawer-section {
    margin-bottom: 14px;
  }

  .drawer-meta div {
    min-height: 0;
    padding: 8px 10px;
  }

  .article-editor-page,
  .article-settings-panel,
  .user-detail-panel {
    max-width: none;
  }

  .article-settings-grid {
    grid-template-columns: 1fr;
  }
}
