:root {
  color-scheme: light;
  --sidebar: #10201c;
  --sidebar-muted: #8aa39c;
  --sidebar-hover: #18362f;
  --orange: #00a884;
  --orange-soft: #e8f8f3;
  --red: #ff5b61;
  --green: #2fbf71;
  --blue: #3f6fd8;
  --ink: #17211f;
  --muted: #84868e;
  --line: #e6eeeb;
  --bg: #f7faf9;
  --panel: #ffffff;
  --soft: #f1f7f5;
  --radius: 8px;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1100px;
  margin: 0;
  background:
    linear-gradient(180deg, #f7faf9 0, #fff 260px),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 178px;
  background: linear-gradient(180deg, #10201c 0%, #132823 100%);
  color: #f5f5f5;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 14px 13px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), #38c7d0);
  color: #fff;
  font-weight: 900;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: 0;
}

.brand-lockup small {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.side-nav {
  display: grid;
  gap: 6px;
  padding: 18px 9px 24px;
}

.side-link {
  display: grid;
  height: 44px;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #8f9198;
  padding: 0 12px;
  text-align: left;
}

.side-link:hover,
.side-link.active {
  background: var(--sidebar-hover);
  color: var(--orange);
}

.side-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: inherit;
  font-size: 16px;
}

.userbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 18px 20px;
}

.userbar span {
  overflow: hidden;
  color: #f4f4f5;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.userbar small {
  overflow: hidden;
  color: var(--sidebar-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.userbar button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--orange);
  padding: 4px 0 0;
  font-weight: 800;
}

.main {
  margin-left: 178px;
}

.auth-mode {
  min-width: 0;
  background: #f7f7f8;
}

.auth-mode .sidebar,
.auth-mode .main {
  display: none;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 28px;
  box-shadow: 0 22px 52px rgba(16, 32, 28, 0.1);
}

.login-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--orange), #38c7d0);
  color: #fff;
  font-weight: 900;
}

.login-card h1 {
  margin: 16px 0 8px;
}

.login-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.login-error {
  border: 1px solid #f6c8ce;
  border-radius: var(--radius);
  background: #fff6f7;
  color: #c7363d;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 700;
}

.login-submit {
  width: 100%;
}

.crumbbar {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  color: #8e9098;
  padding: 0 18px;
  font-size: 12px;
}

.crumbbar strong {
  color: #4b4e57;
}

.page {
  padding: 28px 18px 36px;
}

.tabs {
  display: flex;
  gap: 23px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.tab-button {
  position: relative;
  height: 31px;
  border: 0;
  background: transparent;
  color: #686b73;
  padding: 0 0 11px;
  font-weight: 600;
}

.tab-button.active {
  color: #2c2e33;
}

.tab-button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--orange);
  content: "";
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 7px;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
}

.title-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button,
.ghost-button,
.chip,
.link-button,
.icon-action {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 12px;
  font-weight: 700;
}

.button {
  border: 0;
  background: linear-gradient(135deg, var(--orange), #22b8a2);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 168, 132, 0.18);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #32343a;
}

.link-button {
  height: auto;
  border: 0;
  background: transparent;
  color: #52545b;
  padding: 0;
}

.chip {
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  color: #555861;
}

.chip.active {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: #007a64;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: -5px 0 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  min-height: 98px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 56px 16px 18px;
  box-shadow: 0 10px 28px rgba(16, 32, 28, 0.04);
}

.stat-card span,
.stat-card small {
  display: block;
  color: #8a8d96;
}

.stat-card strong {
  display: block;
  margin: 8px 0 3px;
  font-size: 27px;
  letter-spacing: 0;
}

.stat-card i {
  position: absolute;
  right: 19px;
  top: 31px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange);
  font-style: normal;
  font-weight: 800;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(16, 32, 28, 0.04);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px 16px;
}

.recent-list,
.card-grid {
  display: grid;
  gap: 10px;
}

.recent-list {
  padding: 4px 26px 24px;
}

.recent-item {
  display: grid;
  min-height: 54px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.thumb {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 4px;
  background: #16312b;
  color: #fff;
  font-size: 11px;
}

.recent-title,
.card-title,
.table-title {
  overflow: hidden;
  margin-bottom: 4px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta,
.metrics {
  color: #898b93;
  font-size: 12px;
}

.metrics {
  display: flex;
  gap: 12px;
  white-space: nowrap;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-card,
.video-card {
  display: grid;
  min-height: 68px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 11px 12px;
  box-shadow: 0 8px 22px rgba(16, 32, 28, 0.035);
}

.account-card .thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d7f5ec, #b8d9ff);
  color: #24262b;
}

.video-card {
  grid-template-columns: 52px minmax(0, 1fr) auto;
}

.video-card .thumb {
  width: 48px;
  height: 48px;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.icon-action {
  width: 25px;
  height: 25px;
  border: 0;
  background: transparent;
  color: #7c7f87;
  padding: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #fbfbfc;
  color: #888b94;
  font-size: 12px;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.checkbox {
  width: 14px;
  height: 14px;
  border: 1px solid #5bc7af;
  border-radius: 4px;
}

.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: #f6f6f7;
  color: #555861;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}

.tag.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.tag.green {
  background: #eaf8f0;
  color: #23985b;
}

.tag.blue {
  background: #eef3ff;
  color: var(--blue);
}

.tag.gray {
  background: #efeeed;
  color: #5e5f64;
}

.money {
  line-height: 1.5;
}

.money small {
  display: block;
  color: #8d9097;
}

.row-actions {
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.row-actions button {
  border: 0;
  background: transparent;
  color: #33363c;
  font-weight: 700;
}

.row-actions .danger {
  color: var(--red);
}

.notice-title {
  max-width: 260px;
  color: var(--orange);
  font-weight: 700;
}

.webhook-text {
  display: inline-block;
  max-width: 360px;
  overflow: hidden;
  color: #62656d;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  color: #777a82;
}

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

.template-card {
  display: grid;
  min-height: 188px;
  align-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(16, 32, 28, 0.035);
}

.template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.builder-panel {
  display: grid;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 24px;
}

.builder-section {
  display: grid;
  gap: 12px;
}

.section-title {
  color: #24262b;
  font-weight: 800;
}

.section-title span {
  color: var(--muted);
  font-weight: 600;
}

.helper-text {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.segmented {
  display: flex;
  gap: 8px;
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: inline-flex;
  height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #30323a;
  padding: 0 14px;
  font-weight: 800;
}

.segmented input:checked + span {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: #007a64;
}

.target-picker {
  display: grid;
  gap: 10px;
}

.target-search {
  width: 100%;
}

.target-list {
  display: grid;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.target-option {
  display: grid;
  min-height: 42px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
}

.target-option:last-child {
  border-bottom: 0;
}

.target-option strong,
.target-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.condition-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.switch-row input {
  width: 38px;
  height: 22px;
  accent-color: var(--orange);
}

.builder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.task-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: -4px 0 14px;
}

.task-overview article {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 16px;
}

.task-overview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-overview strong {
  color: #15211e;
  font-size: 24px;
  letter-spacing: 0;
}

.task-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 150px 150px auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.task-toolbar .search-field {
  width: 100%;
}

.task-toolbar .field {
  gap: 5px;
  color: #72757e;
  font-size: 12px;
}

.task-toolbar .field select {
  height: 34px;
  padding: 6px 10px;
}

.task-table table {
  min-width: 1180px;
}

.task-count {
  color: var(--orange);
  font-weight: 800;
  white-space: nowrap;
}

.table-select-toggle {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid var(--orange);
  border-radius: 4px;
  background: #fff;
  padding: 0;
}

.table-select-toggle.checked {
  background: var(--orange);
}

.table-select-toggle.checked::after {
  color: #fff;
  content: "✓";
  font-size: 11px;
  line-height: 1;
}

.content-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -8px 0 16px;
}

.search-field {
  display: grid;
  width: 320px;
  height: 34px;
  grid-template-columns: 30px 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  padding: 0 10px;
}

.search-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.account-card,
.video-card {
  position: relative;
}

.account-card {
  cursor: pointer;
}

.selected-card {
  border-color: #5bc7af;
  background: #f2fbf8;
}

.select-toggle {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  border: 1px solid #5bc7af;
  border-radius: 4px;
  background: #fff;
  padding: 0;
}

.select-toggle.checked {
  background: var(--orange);
}

.select-toggle.checked::after {
  display: block;
  color: #fff;
  content: "✓";
  font-size: 11px;
  line-height: 15px;
  text-align: center;
}

.danger-icon {
  color: var(--red);
}

.danger-text {
  color: var(--red);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: #1f2228;
  margin: -8px 0 18px;
  padding: 0;
  font-size: 15px;
  font-weight: 800;
}

.account-detail-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 26px;
  padding: 20px;
}

.account-avatar {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #d7f5ec, #b8d9ff);
  color: #24262b;
  font-size: 20px;
  font-weight: 900;
}

.account-detail-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 18px;
}

.account-detail-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head-row h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.section-head-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

.detail-video-card {
  position: relative;
  display: grid;
  min-height: 88px;
  grid-template-columns: 64px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.video-platform-thumb {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 6px;
  background: #16312b;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(17, 18, 22, 0.36);
}

.modal {
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.modal-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.field {
  display: grid;
  gap: 7px;
  color: #4c4f56;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.field textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin: 6px -18px -18px;
  padding: 14px 18px;
}

.toast {
  position: fixed;
  z-index: 12;
  right: 22px;
  bottom: 22px;
  border-radius: var(--radius);
  background: #202126;
  color: #fff;
  padding: 11px 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  font-weight: 700;
}
