:root {
  --page: #f3f6fa;
  --panel: #ffffff;
  --line: #e2e8f0;
  --line-strong: #d4deeb;
  --text: #182230;
  --muted: #718096;
  --muted-strong: #52637a;
  --blue: #1477ed;
  --blue-dark: #0f68d5;
  --blue-soft: #eaf3ff;
  --green: #12a665;
  --green-soft: #e9f8f0;
  --red: #e33f49;
  --red-soft: #fff0f1;
  --orange: #d9822b;
  --orange-soft: #fff5e9;
  --shadow: 0 1px 2px rgba(25, 45, 75, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: #34445c;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #9fc6fa;
  color: var(--blue);
  background: #f7fbff;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(20, 119, 237, 0.24);
  outline-offset: 1px;
}

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

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 119, 237, 0.2);
}

button.primary:hover:not(:disabled) {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: #fff;
}

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

h1 {
  font-size: 15px;
  line-height: 1.25;
}

h2 {
  font-size: 14px;
  line-height: 1.35;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand {
  min-width: 290px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #dceeff;
  color: var(--blue);
  font-size: 17px;
  font-weight: 800;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy > span {
  display: none;
}

.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #3d4d63;
  cursor: pointer;
}

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

.switch-label i {
  position: relative;
  width: 32px;
  height: 18px;
  flex: 0 0 32px;
  border-radius: 999px;
  background: #c8d1dc;
  transition: background 0.18s ease;
}

.switch-label i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 35, 55, 0.2);
  transition: transform 0.18s ease;
}

.switch-label input:checked + i {
  background: var(--blue);
}

.switch-label input:checked + i::after {
  transform: translateX(14px);
}

.run-button {
  min-width: 76px;
}

.logout-button {
  width: 32px;
  height: 30px;
  padding: 0;
  border-color: #d7dde6;
  color: #526176;
  background: #fff;
  font-size: 9px;
}

.logout-button:hover:not(:disabled) {
  border-color: #aeb8c5;
  background: #f5f7fa;
}

.stat {
  min-width: 62px;
  text-align: center;
}

.stat span {
  display: block;
  color: #38475d;
  font-size: 10px;
  white-space: nowrap;
}

.stat strong {
  display: block;
  margin-top: 2px;
  color: var(--blue);
  font-size: 15px;
  line-height: 1.15;
}

.stat.success strong {
  color: var(--green);
}

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

.last-run-stat {
  min-width: 148px;
  text-align: left;
}

.last-run-stat strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
}

.dashboard-shell {
  width: 100%;
  min-height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: clamp(180px, 18vw, 230px) minmax(500px, 1fr) clamp(270px, 26vw, 340px);
  gap: 8px;
  padding: 8px;
}

.sidebar,
.workspace,
.settings {
  min-width: 0;
}

.sidebar {
  position: relative;
  min-height: calc(100vh - 74px);
  display: flex;
  flex-direction: column;
  padding: 10px 8px 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}

.sidebar-actions button {
  min-width: 0;
  padding: 0 5px;
  white-space: nowrap;
}

.sidebar-actions .secondary {
  border-color: #9fc6fa;
  color: var(--blue);
}

.search,
.search-box,
.add-form input,
.add-form select,
.setting-input,
.setting-select {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: #26364b;
}

.search,
.add-form input,
.add-form select,
.setting-input,
.setting-select {
  padding: 0 8px;
}

.sidebar-search {
  margin-bottom: 3px;
}

.message {
  min-height: 18px;
  padding-top: 3px;
  color: var(--red);
  font-size: 10px;
}

.quiet-hours-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.quiet-hours-control .time-input {
  width: 100%;
  padding: 0 3px;
}

.history-page {
  min-height: 100vh;
}

.history-topbar {
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 8px max(14px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.history-back {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #34445c;
  text-decoration: none;
  font-size: 18px;
}

.history-heading {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.history-heading span {
  color: var(--muted);
}

.history-refresh {
  font-size: 16px;
}

.history-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 14px auto;
}

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.history-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
}

.history-toolbar select,
.history-toolbar input {
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.history-toolbar select {
  min-width: 112px;
  padding: 0 8px;
}

.history-search-field {
  flex: 1;
}

.history-search-field input {
  width: min(360px, 100%);
  padding: 0 9px;
}

.history-panel {
  overflow: hidden;
}

.history-table-scroll {
  overflow: auto;
}

.history-table {
  min-width: 760px;
}

.history-table td {
  height: 42px;
}

.history-result {
  min-width: 220px;
}

.history-empty {
  min-height: 180px;
  place-items: center;
  color: var(--muted);
}

.history-empty:not([hidden]) {
  display: grid;
}

.history-footer {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
}

@media (max-width: 760px) {
  .history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .history-toolbar label,
  .history-search-field input {
    width: 100%;
  }

  .history-toolbar select,
  .history-toolbar input {
    flex: 1;
  }
}

.task-alert {
  padding: 8px 12px;
  border: 1px solid #f4b8bd;
  border-radius: 6px;
  background: #fff6f6;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.task-alert:empty,
.task-alert[hidden] {
  display: none;
}

.tree {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.tree-group {
  margin-bottom: 5px;
}

.tree-item,
.tree-blogger {
  width: 100%;
  height: auto;
  min-height: 32px;
  display: grid;
  align-items: center;
  border: 0;
  text-align: left;
  box-shadow: none;
}

.tree-item {
  grid-template-columns: 20px minmax(0, 1fr) auto 16px;
  gap: 3px;
  padding: 4px 7px;
  color: #26364b;
  font-weight: 650;
  background: transparent;
}

.tree-item:hover,
.tree-blogger:hover {
  border: 0;
  background: #f5f8fc;
}

.tree-item.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.tree-caret-button,
.tree-label-button {
  min-width: 0;
  height: 24px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
}

.tree-caret-button {
  width: 20px;
  color: #73839a;
  font-size: 10px;
}

.tree-label-button {
  width: 100%;
  overflow: hidden;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-caret-button:hover:not(:disabled),
.tree-label-button:hover:not(:disabled) {
  border: 0;
  color: inherit;
  background: transparent;
}

.inline-rename-input {
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0 5px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  color: #26364b;
  background: #fff;
  font-size: 11px;
}

.tree-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-count {
  min-width: 20px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #edf1f5;
  color: #607087;
  font-size: 10px;
  font-weight: 500;
}

.tree-children {
  padding: 1px 0 2px 13px;
}

.tree-blogger {
  grid-template-columns: 23px minmax(0, 1fr) 8px 16px;
  gap: 6px;
  padding: 4px 7px;
  color: #44546a;
  background: transparent;
}

.drag-handle {
  width: 16px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #9aa6b5;
  font-size: 9px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drag-handle:active,
.drag-handle.dragging {
  cursor: grabbing;
  opacity: 0.45;
}

.tree-item.drag-before,
.tree-blogger.drag-before {
  box-shadow: inset 0 2px 0 var(--blue);
}

.tree-item.drag-after,
.tree-blogger.drag-after {
  box-shadow: inset 0 -2px 0 var(--blue);
}

.tree-blogger.active {
  color: var(--blue);
  background: #f4f8ff;
}

.mini-avatar {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2d5c7c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.tree-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aeb8c5;
}

.tree-status-dot.success,
.tree-status-dot.running {
  background: var(--green);
}

.tree-status-dot.failed {
  background: var(--red);
}

.folder-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 5px;
  padding: 6px 7px;
  color: #617188;
  cursor: default;
}

.folder-icon {
  color: var(--blue);
  font-size: 13px;
}

.folder-copy {
  min-width: 0;
}

.folder-copy strong {
  display: block;
  color: #42526a;
  font-size: 11px;
  font-weight: 500;
}

.folder-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8a97a8;
  font-size: 9px;
}

.empty-state {
  padding: 15px 8px;
  color: var(--muted);
  text-align: center;
}

.sidebar-footer {
  position: absolute;
  right: 8px;
  bottom: 12px;
  left: 8px;
  color: #99a5b4;
  font-size: 9px;
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr);
  gap: 8px;
  align-content: start;
}

.workspace.has-task-alert {
  grid-template-rows: auto auto minmax(280px, 1fr);
}

.workspace-environment {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.panel {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-head.compact {
  min-height: 24px;
  margin-bottom: 7px;
}

.panel-head p,
.panel-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.search-box {
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: #8090a4;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: #304159;
  background: transparent;
}

.search-box input::placeholder,
.search::placeholder,
.add-form input::placeholder {
  color: #9aa6b5;
}

.icon-button {
  width: 30px;
  flex: 0 0 30px;
  padding: 0;
  color: #63748a;
  font-size: 15px;
}

.text-button {
  border-color: transparent;
  color: #7d8a9b;
  background: transparent;
}

.add-form {
  display: grid;
  grid-template-columns: 116px 120px minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin: 2px 0 8px;
  padding: 9px;
  border: 1px solid #cfe2fb;
  border-radius: 5px;
  background: #f7fbff;
}

.add-form[hidden] {
  display: none;
}

.form-field {
  min-width: 0;
}

.form-field label {
  display: block;
  margin-bottom: 4px;
  color: #5c6c82;
  font-size: 10px;
}

.form-actions {
  display: flex;
  gap: 6px;
}

.form-actions button {
  padding: 0 10px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 8px 7px;
  border-bottom: 1px solid #e8edf3;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  height: 32px;
  color: #64748a;
  background: #fafbfd;
  font-size: 10px;
  font-weight: 600;
}

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

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover,
tbody tr.selected {
  background: #f7fbff;
}

.blogger-table {
  min-width: 0;
  table-layout: fixed;
}

.blogger-table td {
  height: 54px;
}

.avatar-column,
.toggle-column {
  width: 38px;
  text-align: center;
}

.blogger-table th:nth-child(2) {
  width: 90px;
}

.blogger-table th:nth-child(3) {
  width: 100px;
}

.blogger-table th:nth-child(4) {
  width: 135px;
}

.blogger-table th:nth-child(5) {
  width: 86px;
}

.blogger-table td:first-child,
.blogger-table td:last-child {
  text-align: center;
}

.avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #2f5f77;
  color: #fff;
  font-weight: 700;
}

.avatar.tone-1,
.mini-avatar.tone-1 {
  background: #2f5f77;
}

.avatar.tone-2,
.mini-avatar.tone-2 {
  background: #4d637b;
}

.avatar.tone-3,
.mini-avatar.tone-3 {
  background: #965f4e;
}

.avatar.tone-4,
.mini-avatar.tone-4 {
  background: #39725e;
}

.avatar.tone-5,
.mini-avatar.tone-5 {
  background: #6c5b8c;
}

.avatar-image {
  object-fit: cover;
  background: #eef2f6;
}

.blogger-name {
  color: #1f2c3d;
  font-weight: 600;
}

.blogger-id,
.cell-subtext {
  display: block;
  max-width: 180px;
  margin-top: 3px;
  overflow: hidden;
  color: #8a97a8;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td a {
  display: inline-block;
  max-width: 88px;
  overflow: hidden;
  color: var(--blue);
  text-decoration: none;
  text-overflow: ellipsis;
  vertical-align: middle;
}

td a:hover {
  text-decoration: underline;
}

.recent-video-cell {
  white-space: normal;
}

.video-title {
  display: block;
  max-width: 120px;
  overflow: hidden;
  color: #37475c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-link {
  height: auto;
  min-width: 0;
  margin-top: 3px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 9px;
}

.recent-link:hover:not(:disabled) {
  border: 0;
  background: transparent;
  text-decoration: underline;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #607087;
  font-size: 10px;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #aeb8c5;
}

.status.success {
  color: var(--green);
}

.status.success::before {
  background: var(--green);
}

.status.failed {
  color: var(--red);
}

.status.failed::before {
  background: var(--red);
}

.status.running {
  color: var(--orange);
}

.status.running::before {
  background: var(--orange);
}

.status.idle {
  color: #7e8a9b;
}

.toggle {
  position: relative;
  width: 30px;
  height: 17px;
  display: inline-block;
  flex: 0 0 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  vertical-align: middle;
  cursor: pointer;
  transition: background 0.18s ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 35, 55, 0.2);
}

.toggle.off {
  background: #c8d1dc;
}

.toggle.off::after {
  right: auto;
  left: 2px;
}

.toggle:focus-visible {
  outline: 2px solid rgba(26, 116, 232, 0.35);
  outline-offset: 2px;
}

.toggle:disabled {
  cursor: wait;
  opacity: 0.65;
}

.tree-blogger.duplicate-highlight,
.blogger-table tr.duplicate-highlight td {
  background: #fff1f2;
}

.tree-blogger.duplicate-highlight {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.blogger-table tr.duplicate-highlight td:first-child {
  box-shadow: inset 3px 0 var(--red);
}

.table-footer {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #5f6e82;
}

.table-footer[hidden] {
  display: none;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination button {
  width: 25px;
  height: 25px;
  padding: 0;
  border-color: transparent;
  background: #f5f7fa;
}

.pagination button.active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.task-panel {
  min-height: 0;
}

.task-table-scroll {
  max-height: 420px;
  overflow-y: auto;
}

.task-panel table {
  min-width: 560px;
}

.task-panel td {
  height: 38px;
  font-size: 10px;
}

.settings {
  display: grid;
  gap: 8px;
  align-content: start;
}

.setting-panel {
  padding: 13px 12px;
}

.setting-grid {
  display: grid;
  gap: 0;
}

.settings-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 5px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.settings-subhead h3 {
  margin: 0;
  font-size: 11px;
}

.setting-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.setting-row > label {
  color: #526176;
  font-size: 11px;
  white-space: nowrap;
}

.integration-row {
  padding: 6px 0;
  border-bottom: 1px solid #edf1f5;
}

.integration-row > label {
  color: #26374d;
  font-weight: 600;
}

.integration-row .wpush-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.wpush-row {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f5;
}

.git-row {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f5;
}

.git-row > label {
  color: #26374d;
  font-weight: 600;
}

.git-row > .git-settings-control {
  display: contents;
}

.git-row .wpush-option {
  grid-column: 2;
}

.git-row .compact-setting-field {
  grid-column: 1 / -1;
  grid-template-columns: 72px minmax(0, 1fr);
}

.git-row .integration-last-result {
  grid-column: 1 / -1;
  padding-left: 80px;
}

.wpush-row > label {
  color: #26374d;
  font-weight: 600;
}

.wpush-row > .wpush-settings-control {
  display: contents;
}

.wpush-row .wpush-control {
  grid-column: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.wpush-row .compact-setting-field {
  grid-column: 1 / -1;
  grid-template-columns: 72px minmax(0, 1fr);
}

.wpush-row .integration-last-result {
  grid-column: 1 / -1;
  padding-left: 80px;
}

.schedule-toggle-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.setting-input,
.setting-select {
  min-width: 0;
  height: 27px;
  padding: 0 7px;
  background: #fbfcfe;
  font-size: 10px;
}

.setting-toggle-wrap {
  height: 27px;
  display: flex;
  align-items: center;
}

.api-key-control {
  min-width: 0;
  min-height: 27px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wpush-settings-control {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.git-settings-control {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.wpush-control {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: #53647a;
  font-size: 9px;
}

.wpush-control .api-key-control {
  flex: 1 1 130px;
}

.wpush-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
}

.wpush-option input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--blue);
}

.wpush-key-input {
  width: auto;
  flex: 1 1 90px;
  min-width: 0;
  height: 27px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 10px;
}

.api-secret-input {
  -webkit-text-security: disc;
}

.compact-setting-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  color: #607087;
  font-size: 9px;
}

.setting-textarea {
  width: 100%;
  min-width: 0;
  min-height: 82px;
  padding: 6px 7px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fbfcfe;
  font: inherit;
  line-height: 1.45;
}

.integration-last-result {
  overflow-wrap: anywhere;
  color: #8792a2;
  font-size: 9px;
  line-height: 1.4;
}

.wpush-key-saved {
  min-width: 0;
  overflow: hidden;
  color: #8792a2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wpush-replace-button,
.env-fix-button {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.api-key-save-button {
  flex: 0 0 auto;
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  color: #fff;
  background: var(--blue);
  font-size: 9px;
  cursor: pointer;
}

.api-key-save-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.settings-message,
.env-message {
  min-height: 15px;
  margin-top: 6px;
  color: #607087;
  font-size: 9px;
  line-height: 1.45;
}

.settings-message:empty {
  display: none;
}

.env-message:empty {
  display: none;
}

.wide-button {
  width: 100%;
  min-height: 34px;
  margin-top: 12px;
}

.initialize-environment-button {
  margin-top: 8px;
}

.restore-environment-button {
  margin-top: 8px;
  border-color: #9fc6fa;
  color: var(--blue);
  background: #fff;
}

.restore-environment-button:hover,
.restore-environment-button:focus-visible {
  background: #eef6ff;
}

.env-list {
  display: grid;
  gap: 0;
}

.env-list-inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
}

.env-list-inline .summary,
.env-list-inline .env-normal {
  grid-column: 1 / -1;
}

.env-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 42px;
  gap: 5px;
  align-items: center;
  min-height: 28px;
  border-bottom: 1px solid #edf1f5;
  font-size: 9px;
}

.env-row strong,
.env-row > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-row strong {
  color: #43536a;
  font-weight: 500;
}

.env-row > span:nth-child(2) {
  color: #78869a;
}

.env-row .status {
  justify-self: end;
  font-size: 9px;
}

.env-fix-button {
  justify-self: end;
  color: var(--red);
  font-weight: 600;
}

.env-fix-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.env-normal {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid #ccefdc;
  border-radius: 5px;
  color: #25865a;
  background: var(--green-soft);
}

.env-normal strong {
  font-size: 12px;
}

.env-normal span {
  color: #5d7469;
  font-size: 9px;
}

.summary {
  margin-top: 9px;
  padding: 8px;
  border: 1px solid #ccefdc;
  border-radius: 5px;
  color: #25865a;
  background: var(--green-soft);
  font-size: 9px;
  line-height: 1.5;
}

.summary.warning {
  border-color: #f2d2d5;
  color: #a5363d;
  background: #fff6f6;
}

.management-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 18px 48px rgba(25, 45, 75, 0.18);
}

.management-dialog::backdrop {
  background: rgba(18, 32, 50, 0.34);
}

.dialog-form,
.directory-picker-dialog,
.confirm-dialog {
  padding: 16px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.dialog-head p {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dialog-field {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  color: #4c5d73;
  font-size: 11px;
}

.dialog-field[hidden] {
  display: none;
}

.dialog-field input,
.dialog-field select,
.dialog-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #26364b;
  background: #fff;
  font: inherit;
}

.dialog-field input,
.dialog-field select {
  height: 34px;
  padding: 0 9px;
}

.dialog-field textarea {
  min-height: 72px;
  padding: 8px 9px;
  resize: vertical;
  line-height: 1.5;
}

.profile-preview {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: -2px 0 12px;
  padding: 9px;
  border: 1px solid #dbe6f4;
  border-radius: 6px;
  background: #f7faff;
}

.profile-preview[hidden] {
  display: none;
}

.profile-preview-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2f5f77;
  font-weight: 700;
}

.profile-preview-copy {
  min-width: 0;
}

.profile-preview-copy strong,
.profile-preview-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-preview-copy strong {
  color: #26364b;
  font-size: 12px;
}

.profile-preview-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.blogger-context-menu {
  position: fixed;
  z-index: 80;
  width: 132px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 45, 75, 0.18);
}

.blogger-context-menu[hidden] {
  display: none;
}

.blogger-context-menu button {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 0;
  color: var(--red);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.blogger-context-menu button:hover,
.blogger-context-menu button:focus-visible {
  background: #fff1f2;
}

.confirm-copy {
  margin: 0 0 12px;
  color: #53647a;
  font-size: 11px;
  line-height: 1.65;
}

.danger-button {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.path-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 7px;
}

.path-input-row button {
  height: 34px;
}

.dialog-message {
  min-height: 20px;
  color: var(--red);
  font-size: 10px;
}

.dialog-message.pending {
  color: var(--muted);
}

.dialog-message.success {
  color: var(--green);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 5px;
}

.dialog-actions button {
  min-width: 82px;
}

.dialog-actions .push-left {
  margin-right: auto;
}

.danger-outline-button {
  border-color: #efb6bb;
  color: var(--red);
  background: #fff;
}

.danger-outline-button:hover,
.danger-outline-button:focus-visible {
  background: #fff1f2;
}

.directory-location {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  margin-bottom: 9px;
}

.directory-location code {
  min-width: 0;
  overflow: hidden;
  color: #53647a;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-picker-list {
  min-height: 130px;
  max-height: 300px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 7px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fafbfd;
}

.directory-option {
  width: 100%;
  height: 34px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 0 8px;
  border-color: transparent;
  text-align: left;
  background: #fff;
}

.directory-option span {
  color: var(--blue);
}

.directory-option strong {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-videos-panel {
  min-height: 220px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.recent-videos-panel[hidden] {
  display: none;
}

.recent-videos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.recent-videos-head p {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

.videos {
  display: grid;
  gap: 10px;
}

.video-card {
  width: 100%;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 62px;
  gap: 11px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: inherit;
  background: #fbfcfe;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.video-card:hover,
.video-card:focus-visible {
  border-color: #8dbcf2;
  background: #f5f9ff;
  outline: none;
}

.video-thumb {
  width: 88px;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #5e7696;
  background: #e7eef7;
  font-size: 9px;
}

.video-card strong {
  overflow: hidden;
  color: #33435a;
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-card-copy {
  min-width: 0;
}

.video-card-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.video-card-meta small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card-meta .status {
  flex: 0 0 auto;
}

.video-card-actions {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.video-parse-button {
  min-width: 54px;
  height: 26px;
  padding: 0 8px;
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
  font-size: 10px;
}

.video-parse-button:hover:not(:disabled) {
  color: #fff;
  background: var(--blue);
}

.login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef1f4;
}

.login-shell {
  width: min(760px, 100%);
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.15fr);
  overflow: hidden;
  border: 1px solid #d9dee5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.12);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 44px 36px;
  color: #f7f9fb;
  background: #232a31;
}

.login-brand-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 28px;
  font-size: 21px;
}

.login-brand p,
.login-panel-head p {
  margin: 0 0 8px;
  color: #93a1b2;
  font-size: 10px;
  font-weight: 700;
}

.login-brand h1 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.35;
}

.login-brand > span {
  color: #c6ced8;
  font-size: 12px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px 48px;
}

.login-panel-head {
  margin-bottom: 25px;
}

.login-panel-head h2 {
  margin: 0;
  color: #263241;
  font-size: 21px;
}

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

.login-form[hidden] {
  display: none;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #536174;
  font-size: 11px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #cfd6df;
  border-radius: 5px;
  background: #fbfcfd;
  font-size: 13px;
}

.login-form input:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(26, 116, 232, 0.12);
}

.login-form button {
  height: 40px;
  margin-top: 3px;
}

.login-message {
  min-height: 18px;
  color: var(--red);
  font-size: 10px;
  line-height: 1.5;
}

.auth-setup-required {
  display: grid;
  gap: 12px;
  padding: 15px;
  border-left: 3px solid var(--orange);
  background: #fff8eb;
  color: #596579;
  font-size: 11px;
}

.auth-setup-required code {
  overflow-wrap: anywhere;
  color: #29384a;
  font-size: 10px;
}

.auth-setup-required[hidden] {
  display: none;
}

@media (max-width: 680px) {
  .login-page {
    padding: 0;
    place-items: stretch;
  }

  .login-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-brand {
    min-height: 190px;
    padding: 28px 24px;
  }

  .login-brand-icon {
    margin-bottom: 18px;
  }

  .login-brand h1 {
    font-size: 21px;
  }

  .login-panel {
    justify-content: flex-start;
    padding: 32px 24px 40px;
  }
}

.recent-videos-message {
  margin-bottom: 8px;
  padding: 7px 8px;
  border: 1px solid #f2d2d5;
  border-radius: 5px;
  color: #a5363d;
  background: #fff6f6;
  font-size: 10px;
  line-height: 1.5;
}

.recent-videos-message:empty {
  display: none;
}

.analysis-view {
  min-width: 0;
}

.analysis-toolbar {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.analysis-toolbar h3 {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.5;
}

.analysis-content {
  margin: 0;
  padding: 12px 0;
  overflow-wrap: anywhere;
  color: #33435a;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.75;
  white-space: pre-wrap;
}

@media (min-width: 1360px) {
  body {
    font-size: 13px;
  }

  .dashboard-shell {
    gap: 10px;
    padding: 10px;
  }

  .panel {
    padding: 13px;
  }

  .blogger-table td {
    height: 59px;
  }

  .setting-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .wpush-row,
  .git-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .wpush-row .compact-setting-field,
  .git-row .compact-setting-field {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .wpush-row .integration-last-result,
  .git-row .integration-last-result {
    padding-left: 104px;
  }

}

@media (max-width: 1010px) {
  .dashboard-shell {
    grid-template-columns: clamp(180px, 22vw, 220px) minmax(0, 1fr);
  }

  .settings {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
  }

  .last-run-stat {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .brand {
    width: 100%;
    min-width: 0;
  }

  .brand-copy h1 {
    white-space: normal;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .stat {
    min-width: 48px;
  }

  .dashboard-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    min-height: auto;
    max-height: 420px;
  }

  .workspace,
  .settings {
    grid-column: 1;
  }

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

  .add-form {
    grid-template-columns: 1fr;
  }

  .form-actions {
    justify-content: flex-end;
  }

  .blogger-table {
    min-width: 500px;
  }

  .env-list-inline {
    grid-template-columns: minmax(0, 1fr);
  }

  .env-list-inline .summary,
  .env-list-inline .env-normal {
    grid-column: auto;
  }

  .recent-videos-panel {
    padding: 12px;
  }

  .video-card {
    grid-template-columns: 76px minmax(0, 1fr) 56px;
    min-height: 66px;
  }

  .video-thumb {
    width: 76px;
  }
}
