:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei',
    sans-serif;
  color: #24282d;
  background: #f0f0f1;
  font-size: 14px;
  --blue: #2271b1;
  --border: #c3c4c7;
  --muted: #646970;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #f6f7f7;
  color: #2c3338;
  padding: 7px 13px;
  border-radius: 3px;
  line-height: 1.5;
}
button:hover {
  background: #f0f0f1;
  border-color: #8c8f94;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.primary:hover {
  background: #135e96;
  border-color: #135e96;
}
.danger {
  color: #b32d2e;
}
.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--blue);
}
input,
select,
textarea {
  padding: 8px 10px;
  border: 1px solid #8c8f94;
  border-radius: 3px;
  background: #fff;
  max-width: 100%;
  color: #2c3338;
}
input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 2px solid #72aee6;
  outline-offset: 1px;
}
input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
}
textarea {
  resize: vertical;
  line-height: 1.75;
  min-height: 115px;
}
h1 {
  font-size: 25px;
  font-weight: 500;
  margin: 0;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
h3 {
  font-size: 15px;
  margin: 0 0 16px;
}
p {
  line-height: 1.75;
}
small,
.muted {
  font-size: 12px;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 12vh 20px 50px;
}
.login-brand {
  text-align: center;
  margin-bottom: 25px;
}
.login-brand h1 {
  font-size: 29px;
  letter-spacing: -1px;
  margin-top: 14px;
  font-weight: 650;
}
.login-brand p {
  color: var(--muted);
  margin: 7px;
}
.brand-mark {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--blue);
  color: #fff;
  border-radius: 11px;
  width: 55px;
  height: 55px;
  font-size: 35px;
  font-weight: 650;
}
.brand-mark.small {
  width: 24px;
  height: 24px;
  font-size: 16px;
  border-radius: 5px;
}
.login-card {
  width: 360px;
  max-width: 100%;
  background: #fff;
  padding: 30px;
  border: 1px solid #c3c4c7;
  box-shadow: 0 1px 3px #0000000a;
  display: grid;
  gap: 22px;
}
.login-card input {
  font-size: 20px;
  padding: 10px;
}
.login-card button {
  justify-self: end;
  min-width: 105px;
}
.login-card p {
  margin: 0;
  color: #b32d2e;
}
.login-note {
  font-size: 12px;
  color: var(--muted);
}
.topbar {
  height: 40px;
  background: #1d2327;
  color: #c3c4c7;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 25px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  font-size: 12px;
}
.topbar a {
  color: #ddd;
}
.top-brand {
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 156px;
}
.top-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-user button {
  border: 0;
  background: none;
  color: #ddd;
  font-size: 12px;
  padding: 3px;
}
.sidebar {
  position: fixed;
  top: 40px;
  bottom: 0;
  left: 0;
  width: 190px;
  background: #1d2327;
  color: #c3c4c7;
  display: flex;
  flex-direction: column;
  padding-top: 23px;
}
.site-label {
  font-size: 11px;
  color: #8c8f94;
  letter-spacing: 2px;
  padding: 0 20px 14px;
}
nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e5e5e5;
  padding: 13px 20px;
}
nav button span {
  width: 20px;
  font-size: 20px;
  color: #9ca2a7;
  text-align: center;
  line-height: 1;
}
nav button:hover {
  background: #2c3338;
  color: #72aee6;
}
nav button.active {
  background: var(--blue);
  color: #fff;
}
nav button.active span {
  color: #fff;
}
.nav-divider {
  height: 1px;
  background: #3c434a;
  margin: 20px 15px;
}
.sidebar-foot {
  margin-top: auto;
  padding: 20px;
  color: #c3c4c7;
  font-size: 12px;
  line-height: 1.8;
}
.sidebar-foot span {
  color: #787c82;
  font-size: 11px;
}
main {
  margin: 40px 0 0 190px;
  padding: 30px 32px 18px;
  min-height: calc(100vh - 40px);
}
.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.page-head .muted {
  margin-left: auto;
}
.page-head button {
  color: var(--blue);
  border-color: var(--blue);
}
.welcome {
  border: 1px solid #c3c4c7;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 30px;
  margin-bottom: 24px;
  gap: 24px;
  border-top: 4px solid #2271b1;
}
.welcome h2 {
  font-size: 23px;
  font-weight: 500;
}
.welcome p {
  margin: 10px 0 0;
  color: #646970;
}
.welcome .brand-mark {
  width: 76px;
  height: 76px;
  font-size: 47px;
  background: #edf6fc;
  color: #2271b1;
  flex-shrink: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 25px;
}
.stat {
  background: white;
  border: 1px solid #dcdcde;
  padding: 22px;
}
.stat .number {
  font-size: 35px;
  color: #1d2327;
  margin: 8px 0;
}
.stat small {
  display: block;
}
.panel {
  border: 1px solid #c3c4c7;
  background: white;
  margin-bottom: 24px;
}
.panel-title {
  padding: 15px 20px;
  border-bottom: 1px solid #dcdcde;
}
.panel-body {
  padding: 20px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
}
.status-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.status-list div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .search {
  margin-left: auto;
  display: flex;
  gap: 7px;
}
.toolbar input {
  width: 230px;
}
.toolbar select {
  max-width: 180px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
  flex-wrap: wrap;
}
.filters button {
  border: 0;
  background: none;
  padding: 0 9px 0 0;
  color: var(--blue);
  border-right: 1px solid #ccc;
  border-radius: 0;
}
.filters button:last-child {
  border: 0;
}
.filters button.selected {
  font-weight: 600;
  color: #1d2327;
}
.table-wrap {
  border: 1px solid #c3c4c7;
  overflow-x: auto;
  background: white;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 13px;
}
th {
  font-weight: 500;
  padding: 13px 15px;
  border-bottom: 1px solid #c3c4c7;
  background: white;
  white-space: nowrap;
  color: #50575e;
}
td {
  padding: 15px;
  vertical-align: top;
  border-bottom: 1px solid #eef0f2;
  line-height: 1.7;
}
tbody tr:nth-child(odd) {
  background: #f8f9fa;
}
tbody tr:hover {
  background: #f0f6fc;
}
td strong {
  font-weight: 600;
  color: #2271b1;
  cursor: pointer;
}
.check-cell {
  width: 36px;
  padding-right: 0;
}
.row-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
}
.row-actions button {
  font-size: 12px;
}
.thumb {
  width: 65px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #ddd;
  background: #f0f0f1;
}
.title-cell {
  display: flex;
  gap: 13px;
  min-width: 220px;
}
.status {
  display: inline-block;
  border-radius: 3px;
  font-size: 11px;
  padding: 1px 7px;
  white-space: nowrap;
  background: #f0f0f1;
  color: #50575e;
}
.status.published {
  background: #edfaef;
  color: #197535;
}
.status.pending {
  background: #fff5dc;
  color: #8d6300;
}
.status.rejected {
  background: #fcf0f1;
  color: #b32d2e;
}
.empty {
  padding: 60px 20px;
  text-align: center;
  color: #787c82;
  font-size: 14px;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 0;
  color: #646970;
  font-size: 12px;
}
.pagination span {
  margin-right: 8px;
}
.pagination button {
  padding: 4px 11px;
}
.settings-form {
  max-width: 850px;
}
.settings-form label {
  margin-bottom: 22px;
}
.settings-form .hint {
  font-size: 12px;
  font-weight: 400;
  color: #646970;
}
.settings-form input {
  max-width: 520px;
}
.settings-form textarea {
  min-height: 120px;
}
.inline-check {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}
.media-item {
  border: 1px solid #c3c4c7;
  background: white;
}
.media-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #eee;
}
.media-info {
  padding: 12px;
  overflow-wrap: anywhere;
}
.media-info .row-actions {
  justify-content: space-between;
}
.media-info p {
  margin: 0;
}
.picked-images {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.picked-image {
  position: relative;
}
.picked-image img {
  width: 90px;
  height: 70px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #ddd;
}
.picked-image button {
  position: absolute;
  right: 0;
  top: 0;
  border: 0;
  background: #1d2327dd;
  color: white;
  line-height: 1;
  padding: 3px 5px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 24px;
}
.editor-grid label {
  margin-bottom: 17px;
}
.editor-grid .full {
  grid-column: 1/-1;
}
.fields-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.editor-side {
  border: 1px solid #dcdcde;
  background: #f6f7f7;
  padding: 18px;
  align-self: start;
}
.editor-side h3 {
  border-bottom: 1px solid #ddd;
  padding-bottom: 12px;
}
.editor-actions {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 17px 24px;
  margin: 24px -24px -24px;
}
.editor-actions .saving-text {
  margin-right: auto;
  color: #b32d2e;
}
.text-editor {
  min-height: 300px;
  white-space: pre-wrap;
}
.hint-box {
  background: #f0f6fc;
  border-left: 3px solid #72aee6;
  padding: 12px;
  font-size: 12px;
  line-height: 1.7;
  color: #50575e;
}
.activity {
  margin: 0;
  padding: 0;
  list-style: none;
}
.activity li {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  line-height: 1.7;
}
.activity li:first-child {
  padding-top: 0;
}
.activity small {
  display: block;
}
dialog {
  border: 1px solid #8c8f94;
  border-radius: 4px;
  width: min(1040px, 94vw);
  max-height: 92vh;
  padding: 0;
  color: #24282d;
  box-shadow: 0 10px 70px #0004;
}
dialog::backdrop {
  background: #10182080;
}
.dialog-heading {
  position: sticky;
  top: 0;
  background: white;
  padding: 18px 24px;
  border-bottom: 1px solid #dcdcde;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}
.icon-button {
  border: 0;
  background: none;
  font-size: 26px;
  padding: 0 5px;
  line-height: 1;
}
#editor-form {
  padding: 24px;
}
#picker-content {
  padding: 24px;
}
#notice {
  padding: 13px 18px;
  border: 1px solid #c3c4c7;
  border-left: 4px solid #00a32a;
  background: white;
  margin-bottom: 20px;
  line-height: 1.7;
}
#notice.error {
  border-left-color: #d63638;
}
.loading {
  padding: 80px 20px;
  text-align: center;
  color: #646970;
}
footer {
  margin-top: 35px;
  padding: 10px 0;
  color: #787c82;
  font-size: 12px;
}
.preview-text {
  white-space: pre-wrap;
  padding: 20px;
  border: 1px solid #ddd;
  line-height: 1.85;
}
.role-tag {
  font-size: 12px;
}
.inline-help {
  margin: 0 0 20px;
  color: #646970;
}
.login-error {
  color: #b32d2e;
}
@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .editor-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .editor-side h3 {
    grid-column: 1/-1;
  }
  .editor-side label {
    margin: 0;
  }
}
@media (max-width: 700px) {
  .sidebar {
    width: 58px;
  }
  .site-label,
  .sidebar-foot,
  nav .nav-divider {
    display: none;
  }
  nav button {
    font-size: 0;
    padding: 16px 18px;
    gap: 0;
  }
  nav button span {
    font-size: 22px;
  }
  main {
    margin-left: 58px;
    padding: 22px 14px;
  }
  .topbar {
    gap: 14px;
    padding: 0 10px;
  }
  .top-brand {
    width: auto;
  }
  .topbar > a:nth-child(2) {
    display: none;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat .number {
    font-size: 29px;
  }
  .page-head {
    flex-wrap: wrap;
  }
  .toolbar .search {
    margin-left: 0;
    width: 100%;
  }
  .toolbar input {
    width: 100%;
  }
  .welcome {
    padding: 20px;
  }
  .welcome .brand-mark {
    display: none;
  }
  .fields-two {
    grid-template-columns: 1fr;
  }
  .editor-side {
    display: block;
  }
  dialog {
    width: 97vw;
  }
  #editor-form {
    padding: 18px;
  }
  .editor-actions {
    margin: 20px -18px -18px;
    padding: 14px 18px;
  }
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .title-cell {
    min-width: 180px;
  }
}
#editor-form > label {
  margin-bottom: 18px;
}
#editor-error {
  color: #b32d2e;
}
fieldset {
  border: 1px solid #dcdcde;
  margin: 0 0 20px;
  padding: 16px;
}
fieldset .inline-check {
  margin: 0;
}
.activity {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.source-details {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px 16px;
  line-height: 1.7;
}
.source-details dt {
  color: #646970;
}
.source-details dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .source-details {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .source-details dd {
    margin-bottom: 12px;
  }
}

.status.verified {
  color: #16803c;
  background: #e7f6ec;
}
.status.invalid {
  color: #b32d2e;
  background: #fce8e8;
}
.source-bulk-list {
  max-height: 160px;
  overflow: auto;
  line-height: 1.8;
  padding-left: 24px;
}
.source-review-checks {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
#source-bulk-error {
  color: #b32d2e;
}

.support-messages {
  height: 360px;
  overflow: auto;
  background: #f6f7f7;
  padding: 16px;
  margin: 16px 0;
}
.support-message {
  max-width: 85%;
  padding: 8px 12px;
  background: white;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.support-message.self {
  margin-left: auto;
  background: #e9f3ff;
}
.support-message p {
  white-space: pre-wrap;
  margin: 6px 0;
}
#support-error {
  color: #b32d2e;
}
