﻿:root {
  font-family: Inter, Arial, sans-serif;
  color: #191b1f;
  background: #f4f6f8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.hidden {
  display: none !important;
}
button,
input,
textarea {
  font: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef2f7;
}
.login form {
  width: min(420px, calc(100% - 32px));
  padding: 36px;
  background: white;
  border: 1px solid #dce1e8;
  border-radius: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}
.brand b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #0866ff;
  color: white;
  border-radius: 5px;
  font-size: 22px;
}
.login h1 {
  margin: 34px 0 8px;
  font-size: 28px;
}
.login p {
  color: #737c88;
  margin-bottom: 28px;
}
.login label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin: 15px 0 7px;
}
.login input,
.panel textarea,
.filters input[type="text"],
.filters > input {
  width: 100%;
  border: 1px solid #cbd2db;
  border-radius: 5px;
  padding: 12px;
  outline: none;
}
.login button,
.panel > button,
header > button,
.task-actions button {
  width: 100%;
  height: 46px;
  margin-top: 20px;
  border: 0;
  border-radius: 5px;
  background: #0866ff;
  color: white;
  font-weight: 800;
  cursor: pointer;
}
.task-actions button {
  width: auto;
  margin-top: 0;
  padding: 0 16px;
}
.task-actions button.secondary {
  background: #eef2f7;
  color: #17202b;
}
.task-actions button.danger {
  background: #fff0ef;
  color: #b42318;
}
.task-actions button:disabled {
  cursor: not-allowed;
}
.error {
  color: #c62828;
  margin-top: 12px;
  font-size: 13px;
}
#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
aside {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  background: #17191d;
  color: white;
  display: flex;
  flex-direction: column;
}
aside nav {
  margin-top: 48px;
  display: grid;
  gap: 8px;
}
aside nav button,
.logout {
  height: 44px;
  border: 0;
  background: transparent;
  color: #aeb5bf;
  text-align: left;
  padding: 0 14px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
}
aside nav button.active {
  background: #2b3037;
  color: white;
}
aside nav i {
  float: right;
  background: #3e444d;
  border-radius: 10px;
  padding: 2px 7px;
  font-style: normal;
  font-size: 11px;
}
.logout {
  margin-top: auto;
}
main {
  min-width: 0;
  padding: 38px 42px;
}
main > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 34px;
}
main > header p {
  margin: 0 0 6px;
  color: #0866ff;
  font-size: 11px;
  font-weight: 900;
}
main > header h1 {
  margin: 0;
  font-size: 30px;
}
main > header > button {
  width: auto;
  margin: 0;
  padding: 0 22px;
}
.sync-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sync-actions > button {
  width: auto;
  height: 46px;
  border: 0;
  border-radius: 5px;
  padding: 0 22px;
  background: #0866ff;
  color: white;
  font-weight: 800;
  cursor: pointer;
}
.task-progress {
  width: 250px;
}
.task-progress span {
  display: block;
  margin-bottom: 7px;
  text-align: right;
  color: #66707c;
  font-size: 11px;
}
.task-progress div {
  height: 6px;
  overflow: hidden;
  background: #dfe4ea;
  border-radius: 3px;
}
.task-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: #0866ff;
  transition: width 0.3s;
}
.panel {
  max-width: 780px;
  padding: 26px;
  background: white;
  border: 1px solid #dce1e8;
  border-radius: 8px;
}
.panel h2,
.section-head h2,
.task-card h2 {
  margin: 0;
  font-size: 20px;
}
.panel p,
.task-card p {
  color: #737c88;
  font-size: 13px;
}
.panel textarea {
  height: 116px;
  resize: vertical;
}
.panel > button {
  width: auto;
  padding: 0 20px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 40px 0 16px;
}
.section-head span {
  color: #7a838e;
  font-size: 13px;
}
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  background: #fff8ed;
  border: 1px solid #f3d6a6;
  border-radius: 6px;
}
.bulk-actions span {
  margin-right: auto;
  color: #8a5a00;
  font-size: 13px;
  font-weight: 800;
}
.bulk-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6f4b00;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.bulk-actions input {
  width: 15px;
  height: 15px;
}
.bulk-actions button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.bulk-actions button.secondary {
  background: white;
  color: #374151;
  border: 1px solid #d6dde6;
}
.bulk-actions button.danger {
  background: #d93025;
  color: white;
}
.bulk-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid #dce1e8;
  border-radius: 7px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1750px;
}
#meta-tab table {
  min-width: 760px;
}
th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0f3;
  text-align: left;
  font-size: 13px;
}
th {
  background: #fafbfc;
  color: #76808d;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
}
th[data-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th[data-sort]::after {
  content: "↕";
  margin-left: 6px;
  color: #a7b0bd;
  font-size: 10px;
}
th[data-sort].sorted {
  color: #0866ff;
}
th[data-sort].sorted::after {
  content: "↓";
  color: #0866ff;
}
th[data-sort].sorted[data-dir="asc"]::after {
  content: "↑";
}
.select-col {
  width: 42px;
  text-align: center;
}
.select-col input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.page-list strong {
  display: block;
  max-width: 750px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-cell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 260px;
}
.page-cell small,
.status-note {
  display: block;
  color: #79828d;
  font-size: 12px;
}
.page-cell img,
.avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #e9edf1;
}
.avatar-fallback {
  display: grid;
  place-items: center;
  color: #6b7280;
  font-weight: 900;
}
.status-note {
  margin-top: 4px;
}
.text-link {
  color: #0866ff;
  text-decoration: none;
  font-weight: 700;
}
.text-link:hover {
  text-decoration: underline;
}
.clip-cell {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delete {
  width: 34px;
  height: 34px;
  margin-left: 10px;
  border: 0;
  background: #f0f2f5;
  color: #68717d;
  border-radius: 4px;
  font-size: 20px;
  cursor: pointer;
  vertical-align: middle;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.details-btn {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d3d9e0;
  background: white;
  color: #374151;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}
.quick-sync {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #b8cffc;
  background: #eef5ff;
  color: #0866ff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.quick-sync:disabled {
  opacity: 0.65;
  cursor: wait;
}
.details-row td {
  background: #fafbfc;
}
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 6px 0 2px;
}
.details-grid div {
  padding: 10px 12px;
  background: white;
  border: 1px solid #e4e9ef;
  border-radius: 5px;
}
.details-grid b {
  display: block;
  margin-bottom: 4px;
  color: #6d7682;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.details-grid span {
  display: block;
  word-break: break-word;
  font-size: 12px;
}
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.meta-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: white;
  border: 1px solid #dce1e8;
  border-radius: 8px;
}
.meta-status-bar strong,
.meta-status-bar span {
  display: block;
}
.meta-status-bar strong {
  font-size: 15px;
}
.meta-status-bar span {
  margin-top: 5px;
  color: #66707c;
  font-size: 12px;
}
.meta-status-bar .task-actions {
  flex-wrap: nowrap;
  margin-top: 0;
}
.meta-account-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.meta-account-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, auto) auto;
  align-items: center;
  gap: 20px;
  padding: 14px 16px;
  background: white;
  border: 1px solid #dce1e8;
  border-radius: 6px;
}
.meta-account-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.meta-account-identity strong,
.meta-account-identity span,
.meta-account-detail span,
.meta-account-detail strong,
.meta-account-detail small {
  display: block;
}
.meta-account-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.meta-account-identity div > span,
.meta-account-detail span {
  margin-top: 4px;
  color: #697382;
  font-size: 12px;
}
.meta-account-detail strong {
  margin-top: 4px;
  font-size: 12px;
}
.meta-account-detail small {
  max-width: 280px;
  margin-top: 4px;
  color: #b42318;
  font-size: 11px;
}
.meta-account-actions {
  flex-wrap: nowrap;
  margin-top: 0;
}
.meta-config-grid {
  margin-bottom: 28px;
}
.meta-redirect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.meta-redirect-row button {
  min-width: 64px;
  border: 1px solid #cbd2db;
  border-radius: 5px;
  background: #eef2f7;
  color: #17202b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.permission-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}
.permission-list code {
  padding: 10px 12px;
  overflow-wrap: anywhere;
  background: #f4f6f8;
  border: 1px solid #e1e6ec;
  border-radius: 5px;
  color: #343b45;
  font-size: 12px;
}
.meta-page-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 190px;
}
.meta-page-name img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  object-fit: cover;
}
.connection-pill {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 4px;
  background: #f3e7e5;
  color: #9d2f25;
  font-size: 11px;
  font-weight: 800;
}
.connection-pill.ready {
  background: #e4f2ea;
  color: #18794e;
}
.task-card {
  padding: 20px;
  background: white;
  border: 1px solid #dce1e8;
  border-radius: 8px;
}
.task-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.cron-form {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  color: #606975;
  font-size: 13px;
}
.cron-form input[type="number"] {
  width: 82px;
  padding: 8px 10px;
  border: 1px solid #cbd2db;
  border-radius: 5px;
}
.cron-status {
  display: block;
  margin-top: 12px;
  color: #7b8490;
  font-size: 12px;
}
.settings-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.settings-form label {
  color: #66707c;
  font-size: 12px;
  font-weight: 800;
}
.settings-form input,
.settings-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd2db;
  border-radius: 5px;
  outline: none;
}
.settings-form textarea {
  min-height: 76px;
  resize: vertical;
}
.secret-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  gap: 8px;
}
.secret-input-row button {
  min-width: 54px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #cbd2db;
  border-radius: 5px;
  background: #eef2f7;
  color: #17202b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.task-list {
  display: grid;
  gap: 10px;
}
.task-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: start;
  padding: 14px 16px;
  background: white;
  border: 1px solid #dce1e8;
  border-radius: 6px;
}
.task-list strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.task-list span {
  display: block;
  color: #697382;
  font-size: 12px;
}
.task-list b {
  padding: 5px 8px;
  border-radius: 4px;
  background: #eef1f4;
  color: #415063;
  font-size: 11px;
  text-transform: uppercase;
}
.task-list article.running b {
  background: #d7e8ff;
  color: #0866ff;
}
.task-list article.completed b {
  background: #e6f5ec;
  color: #18794e;
}
.task-list article.cancelled b,
.task-list article.failed b {
  background: #fdecec;
  color: #b42318;
}
.filters {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}
.filters > input {
  max-width: 420px;
}
.filters label {
  color: #606975;
  font-size: 13px;
}
.video {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
  width: 360px;
  color: #17191d;
  text-decoration: none;
  font-weight: 700;
}
.video img {
  width: 68px;
  height: 46px;
  object-fit: cover;
  background: #e9edf1;
  border-radius: 4px;
}
.thumb-fallback {
  width: 68px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #e9edf1;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
}
.video span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.page-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #707986;
}
.metric {
  font-weight: 900;
}
.viral {
  background: #fff9e9;
}
.viral .metric {
  color: #b05c00;
}
.viral-tag,
.normal-tag,
.done-tag {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.viral-tag {
  background: #ffdb6e;
  color: #724000;
}
.normal-tag {
  background: #eef1f4;
  color: #66707c;
}
.done-tag {
  background: #dff7ea;
  color: #18794e;
}
.tag-stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.manager-pill {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #0866ff;
  font-size: 11px;
  font-weight: 800;
}
.tag-p2 {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #334155;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.tag-p2.active {
  border-color: #9bdab6;
  background: #e9f9f0;
  color: #18794e;
}
.tag-p2:disabled {
  opacity: 0.65;
  cursor: wait;
}
.tag-time {
  display: block;
  margin-top: 4px;
  color: #7b8490;
  font-size: 11px;
}
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: #737c88;
  font-size: 12px;
}
.pager button {
  width: 34px;
  height: 32px;
  border: 1px solid #d3d9e0;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}
.empty {
  text-align: center;
  padding: 36px;
  color: #7b8490;
}
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 13px 16px;
  background: #202329;
  color: white;
  border-radius: 5px;
  font-size: 13px;
  box-shadow: 0 12px 30px #0003;
}
#toast:empty {
  display: none;
}
#toast.success {
  background: #18794e;
}
#toast.error {
  background: #b42318;
}
@media (max-width: 800px) {
  #app {
    grid-template-columns: 1fr;
  }
  aside {
    position: static;
    height: auto;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  aside nav {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  aside nav button {
    position: relative;
    height: 52px;
    padding: 0 8px;
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
  }
  aside nav i {
    position: absolute;
    top: 3px;
    right: 4px;
    float: none;
    padding: 1px 5px;
  }
  .logout {
    display: none;
  }
  main {
    padding: 24px 16px;
  }
  main > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .sync-actions {
    width: 100%;
    justify-content: space-between;
  }
  .task-grid {
    grid-template-columns: 1fr;
  }
  .meta-status-bar {
    align-items: flex-start;
    flex-direction: column;
  }
  .meta-status-bar .task-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .meta-account-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .meta-account-actions {
    width: 100%;
  }
  #meta-page-list .empty {
    padding: 24px 0;
    text-align: left;
  }
  .filters {
    align-items: flex-start;
    flex-direction: column;
  }
  .filters > input {
    max-width: none;
  }
  .video {
    width: 100%;
  }
  .page-list strong {
    max-width: 65vw;
  }
}
@media (max-width: 480px) {
  .secret-input-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .secret-input-row input {
    grid-column: 1 / -1;
  }
}
