:root {
  color-scheme: light;
  --paper: #f3f6fc;
  --surface: #ffffff;
  --ink: #172a4a;
  --muted: #506280;
  --line: #dce5f2;
  --blue: #2455d9;
  --blue-dark: #1d43af;
  --blue-pale: #edf3ff;
  --blue-line: #cad9fa;
  --rose: #9d2f46;
  --rose-dark: #802338;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Heiti SC", sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 35px 18px 22px;
  border-inline-end: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.sidebar > * { flex-shrink: 0; }
.sidebar nav { margin-block-end: 24px; }

.brand-mark {
  display: block;
  width: min(146px, 100%);
  height: auto;
  margin: 0 auto 21px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-inline-start: 2px solid var(--blue);
  border-radius: 4px;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: .9375rem;
  font-weight: 650;
  text-decoration: none;
}

.list-icon {
  position: relative;
  width: 14px;
  height: 16px;
  border: 1px solid var(--blue);
  border-radius: 2px;
}

.list-icon::after {
  position: absolute;
  top: 4px;
  left: 3px;
  width: 6px;
  height: 1px;
  background: var(--blue);
  box-shadow: 0 3px var(--blue), 0 6px var(--blue);
  content: "";
}

.main {
  width: 100%;
  max-width: 1570px;
  margin-inline: auto;
  padding: 49px clamp(24px, 4vw, 64px) 56px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block-end: 25px;
  border-bottom: 1px solid var(--line);
}

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

h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.23;
  letter-spacing: -.035em;
}

.batch-actions, .dialog-actions, .pagination, .row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

.batch-actions .button { min-width: 84px; }

.button-primary { color: var(--surface); background: var(--blue); border-color: var(--blue); }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.button-primary:disabled { background: #dfe9fc; border-color: var(--blue-line); color: #415d92; }
.button-outline { border-color: #e2b9c4; background: var(--surface); color: var(--rose); }
.button-outline:hover:not(:disabled) { background: #fff0f3; border-color: #ba6379; }
.button-outline:disabled { background: #f7f9fd; border-color: var(--line); color: #60718c; }
.button-danger { background: var(--rose); border-color: var(--rose); color: var(--surface); }
.button-danger:hover:not(:disabled) { background: var(--rose-dark); border-color: var(--rose-dark); }
.button-neutral, .button-page { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button-neutral:hover, .button-page:hover:not(:disabled) { background: var(--blue-pale); border-color: var(--blue-line); }
.button-page:disabled { color: #63738f; background: transparent; }

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-block-start: auto;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--paper);
}

.sidebar-account-identity:not([hidden]) {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar-account-avatar {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: .875rem;
  font-weight: 700;
}

.sidebar-account-name {
  overflow: hidden;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.logout {
  flex-shrink: 0;
  min-height: 32px;
  margin-inline-start: auto;
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
}

.logout:hover:not(:disabled) { background: var(--blue-pale); color: var(--blue-dark); }
.logout:disabled { opacity: .65; }

.article-list {
  margin-top: 25px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 19px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.filters button {
  min-height: 35px;
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  white-space: nowrap;
}

.filters button:hover:not(:disabled) { background: #f4f7ff; color: var(--blue-dark); }
.filters button[aria-pressed="true"] {
  border-color: var(--blue-line);
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-weight: 700;
}

.selection {
  color: var(--muted);
  font-size: .875rem;
  white-space: nowrap;
}

.selection.has-selection { color: var(--blue-dark); font-weight: 700; }

.notice {
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--blue-line);
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: .875rem;
}

.notice.error { background: #fff0f3; border-color: #efcdd6; color: var(--rose-dark); }
.notice:focus { outline-offset: -3px; }

.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  text-align: left;
  font-size: .9375rem;
}

th {
  padding: 12px 15px;
  border-block: 1px solid var(--line);
  color: #3e526f;
  background: #f6f8fe;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}

td {
  height: 63px;
  padding: 12px 15px;
  border-bottom: 1px solid #e7eef8;
  vertical-align: middle;
}

th.check-cell, td.check-cell { width: 53px; padding-inline: 19px 13px; }
tbody tr.is-selected { background: var(--blue-pale); }
tbody tr:not(.is-selected):hover { background: #f8faff; }

input[type="checkbox"] {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

input[type="checkbox"]:disabled { cursor: default; }

.title-cell { min-width: 200px; width: 32%; }

.article-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-width: 100%;
  padding: 2px 0;
  border: 0;
  border-radius: 2px;
  color: var(--ink);
  background: transparent;
  font-weight: 650;
  line-height: 1.45;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-align: left;
}

.article-title:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; }
.article-url-cell { min-width: 180px; max-width: 300px; width: 25%; }
.article-link { color: var(--blue-dark); overflow-wrap: anywhere; text-underline-offset: 3px; }
.article-link:hover { color: var(--blue); }
.article-url {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: .875rem;
  line-height: 1.45;
}
.empty-article-url { color: var(--muted); }
.date-cell { color: var(--muted); font-size: .875rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #edf1f8;
  color: #455978;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pending { background: #fff2d8; color: #805108; }
.status-approved { background: #e4f7ef; color: #116252; }
.status-rejected { background: #fbeaf2; color: #963451; }

.row-actions { gap: 13px; min-width: 102px; }

.row-action {
  min-height: 30px;
  padding: 2px 0;
  border: 0;
  border-radius: 2px;
  color: var(--blue-dark);
  background: transparent;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}

.row-action.reject { color: var(--rose); }
.row-action:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.row-action:disabled, .empty-action { color: #63738f; }

.table-message {
  height: 190px;
  padding: 27px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

.table-message .button { margin-top: 12px; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 19px;
  color: var(--muted);
  font-size: .875rem;
}

.button-page { min-height: 34px; padding: 4px 10px; }
#current-page { min-width: 45px; text-align: center; font-variant-numeric: tabular-nums; }

.dialog {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 16px 65px #172a4a33;
}

.dialog::backdrop { background: #172a4a66; }
.dialog h2 { font-size: 1.25rem; line-height: 1.45; }
.article-dialog { width: 660px; }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.detail-content { min-height: 128px; padding: 25px 24px 32px; }
.detail-content h3 { font-size: 1.3125rem; line-height: 1.45; overflow-wrap: anywhere; }

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin: 14px 0 20px;
  color: var(--muted);
  font-size: .875rem;
}

.detail-meta div { display: flex; align-items: baseline; gap: 6px; }
.detail-meta dt { font-weight: 650; }
.detail-meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.detail-meta .detail-address { flex-basis: 100%; align-items: flex-start; }
.detail-address dt { flex-shrink: 0; }
.article-body { padding-top: 18px; border-top: 1px solid var(--line); line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.decision-dialog { width: 420px; padding: 23px 24px; }
.decision-dialog p { margin: 10px 0 23px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.dialog-actions { justify-content: flex-end; }

@media (max-width: 1030px) {
  .workspace { grid-template-columns: 182px minmax(0, 1fr); }
  .main { padding-inline: 25px; }
}

@media (max-width: 720px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { position: static; flex-flow: row wrap; align-items: center; justify-content: space-between; gap: 8px 14px; height: auto; overflow-y: visible; padding: 12px 17px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { margin-block-end: 0; }
  .brand-mark { width: 92px; margin: 0; }
  .nav-item { min-height: 38px; }
  .sidebar-account { flex-basis: 100%; margin-block-start: 3px; }
  .logout { min-height: 38px; }
  .main { padding: 28px 16px 32px; }
  .page-header { padding-bottom: 20px; gap: 14px; }
  .article-list { margin-top: 19px; }
}

@media (max-width: 460px) {
  .page-header { align-items: flex-start; flex-direction: column; }
  .batch-actions { align-self: flex-end; }
  .table-toolbar, .table-footer { padding-inline: 12px; }
  .filters button { padding-inline: 8px; }
}
