:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d7dce3;
  --accent: #c62828;
  --accent-dark: #9f1f1f;
  --green: #16794f;
  --warn: #9a5b00;
}

/* Browser access and independent accounts */
.auth-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: #f3f5f8;
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", Arial, sans-serif;
}

.auth-layout { width: min(420px, calc(100% - 32px)); }
.auth-panel {
  display: grid;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(23, 32, 42, .08);
}
.auth-panel h1 { margin: 0 0 6px; font-size: 26px; }
.auth-panel p { margin: 0; color: var(--muted); }
.auth-brand { width: 48px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: #e62117; }
.auth-brand span { width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid #fff; margin-left: 3px; }
.auth-form { display: grid; gap: 14px; }
.auth-form label, .credentials-dialog label, .users-create-form label { display: grid; gap: 6px; font-weight: 700; }
.auth-form input, .credentials-dialog input, .users-create-form input { min-height: 42px; }
.auth-notice { padding: 12px; border-left: 3px solid #c62828; background: #fff3f3; color: #692323; }
.auth-status { min-height: 22px; color: var(--green) !important; }
.auth-status.error { color: #b42318 !important; }

.users-page { display: grid; gap: 16px; }
.users-create-band, .users-list-band { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.users-create-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 12px; align-items: end; }
.table-subtext { display: block; margin-top: 4px; color: var(--muted); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.state-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-weight: 700; }
.state-badge.good { background: #eaf7f0; color: #16794f; }
.state-badge.warn { background: #fff6e5; color: #8a5200; }
.state-badge.danger { background: #fff0f0; color: #b42318; }
.credentials-dialog { width: min(460px, calc(100% - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 8px; }
.credentials-dialog::backdrop { background: rgba(20, 25, 32, .45); }
.credentials-dialog label { margin: 14px 0; }
.dialog-close { position: absolute; top: 10px; right: 10px; border: 0; background: transparent; font-size: 24px; }
.workspace-account { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workspace-account[hidden], [data-admin-only][hidden] { display: none !important; }
.workspace-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.workspace-logout { padding: 6px 9px; }

@media (max-width: 720px) {
  .users-create-form { grid-template-columns: 1fr; }
  .auth-panel { padding: 24px; }
}

/* Matrix publishing */
.matrix-publish-page {
  display: grid;
  gap: 16px;
}

.matrix-publish-header {
  align-items: center;
}

.matrix-publish-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.matrix-publish-summary span {
  min-width: 90px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.matrix-publish-summary strong {
  margin-left: 5px;
  color: var(--text);
}

.matrix-publish-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.matrix-publish-tabs button {
  border: 0;
  background: transparent;
}

.matrix-publish-tabs button.active {
  color: #c91f2b;
  background: #fff0f1;
}

.matrix-publish-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.matrix-root-toolbar {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.matrix-root-toolbar > label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.matrix-root-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 8px;
}

.matrix-root-controls input {
  width: 100%;
}

.matrix-root-toolbar .status {
  display: block;
  min-height: 20px;
  margin-top: 7px;
}

.matrix-effect-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.matrix-effect-controls label {
  font-weight: 700;
}

.matrix-effect-controls select {
  min-width: 180px;
}

.matrix-effect-controls span {
  color: var(--muted);
  font-size: 13px;
}

.matrix-scan-toolbar,
.matrix-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.matrix-scan-toolbar > div,
.matrix-panel-heading {
  gap: 12px;
}

.matrix-panel-heading h2 {
  margin: 0 0 3px;
  font-size: 18px;
}

.matrix-panel-heading span,
.matrix-scan-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.matrix-publish-table-wrap {
  overflow-x: auto;
}

.matrix-publish-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.matrix-publish-table th,
.matrix-publish-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.matrix-publish-table th {
  color: var(--muted);
  font-size: 12px;
  background: #fafbfc;
}

.matrix-publish-table th:first-child,
.matrix-publish-table td:first-child {
  width: 42px;
  text-align: center;
}

.matrix-publish-table td strong,
.matrix-publish-table td small {
  display: block;
}

.matrix-publish-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.matrix-publish-table tr.invalid {
  background: #fff8f8;
}

.matrix-validation,
.matrix-job-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.matrix-validation.good,
.matrix-job-state.ready {
  color: #07825b;
}

.matrix-validation.bad,
.matrix-job-state.error {
  color: #cb2632;
}

.matrix-job-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b96a8;
}

.matrix-job-state.rendering i,
.matrix-job-state.planning i,
.matrix-job-state.finalizing i {
  background: #0fa878;
}

.matrix-job-state.error i {
  background: #d92735;
}

.matrix-job-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e7ebf0;
}

.matrix-job-progress span {
  display: block;
  height: 100%;
  background: #d92735;
}

.matrix-job-table th:first-child,
.matrix-job-table td:first-child {
  width: auto;
  text-align: left;
}

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

.matrix-publish-empty {
  height: 150px;
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 900px) {
  .matrix-publish-header,
  .matrix-scan-toolbar,
  .matrix-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .matrix-root-controls {
    grid-template-columns: 1fr;
  }

  .matrix-effect-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .matrix-publish-tabs {
    width: 100%;
  }

  .matrix-publish-tabs button {
    flex: 1;
  }
}

/* Shared personal workbench shell */
body.workspace-body {
  overflow-x: hidden;
  background: #f4f6f8;
}

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

.workspace-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #dde2e8;
  background: #ffffff;
}

.workspace-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e8ed;
}

.workspace-brand-mark,
.workspace-nav-short {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #e0b5b5;
  border-radius: 6px;
  background: #fff5f5;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.workspace-brand-mark {
  position: relative;
  overflow: hidden;
  background: #fff4f4;
}

.workspace-youtube-illustration {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.workspace-youtube-illustration::before {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffd9dc;
  content: "";
}

.workspace-youtube-illustration::after {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 9px;
  height: 3px;
  border-radius: 3px;
  background: #efb3b7;
  content: "";
  transform: rotate(-18deg);
}

.workspace-youtube-screen {
  position: relative;
  z-index: 1;
  display: grid;
  width: 25px;
  height: 18px;
  border-radius: 6px;
  background: #e6212b;
  box-shadow: 0 3px 7px rgb(159 31 31 / 24%);
  place-items: center;
  transform: rotate(-2deg);
}

.workspace-youtube-screen::after {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: rgb(255 255 255 / 26%);
  content: "";
}

.workspace-youtube-play {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid #ffffff;
  filter: drop-shadow(0 1px 1px rgb(126 17 23 / 18%));
}

.workspace-brand-text {
  min-width: 0;
}

.workspace-brand-text strong,
.workspace-brand-text small {
  display: block;
  white-space: nowrap;
}

.workspace-brand-text strong {
  font-size: 16px;
}

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

.workspace-collapse {
  position: absolute;
  right: -14px;
  bottom: -14px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.workspace-nav {
  padding: 14px 10px 24px;
}

.workspace-nav-group + .workspace-nav-group {
  margin-top: 15px;
}

.workspace-nav-label {
  padding: 0 10px 6px;
  color: #8a94a3;
  font-size: 12px;
  font-weight: 600;
}

.workspace-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 10px;
  border-left: 3px solid transparent;
  border-radius: 4px;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.workspace-nav-link:hover {
  background: #f7f8fa;
}

.workspace-nav-link.active {
  border-left-color: var(--accent);
  background: #fff1f1;
  color: var(--accent-dark);
}

.workspace-nav-link .workspace-nav-short {
  width: 28px;
  height: 28px;
  border-color: #e2e6eb;
  background: #f8f9fb;
  color: #596273;
  line-height: 0;
}

.workspace-nav-icon {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.workspace-nav-link.active .workspace-nav-short {
  border-color: #e0b5b5;
  background: #ffffff;
  color: var(--accent);
}

.workspace-main {
  min-width: 0;
}

.workspace-main > .shell {
  width: min(1680px, calc(100% - 40px));
  padding-top: 18px;
}

.workspace-page-header {
  align-items: center;
  min-height: 64px;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--line);
}

.workspace-page-header h1 {
  font-size: 24px;
}

.workspace-page-header .actions:empty {
  display: none;
}

.workspace-mobile-menu {
  display: none;
}

body.workspace-nav-collapsed .workspace-app {
  grid-template-columns: 76px minmax(0, 1fr);
}

body.workspace-nav-collapsed .workspace-brand {
  justify-content: center;
  padding-inline: 10px;
}

body.workspace-nav-collapsed .workspace-brand-text,
body.workspace-nav-collapsed .workspace-nav-label,
body.workspace-nav-collapsed .workspace-nav-text {
  display: none;
}

body.workspace-nav-collapsed .workspace-nav-link {
  justify-content: center;
  padding-inline: 4px;
}

body.workspace-nav-collapsed .workspace-collapse {
  transform: rotate(180deg);
}

@media (max-width: 900px) {
  .workspace-app,
  body.workspace-nav-collapsed .workspace-app {
    display: block;
  }

  .workspace-sidebar {
    position: fixed;
    left: 0;
    width: 248px;
    transform: translateX(-100%);
    transition: transform 160ms ease;
    box-shadow: 8px 0 24px rgb(16 24 40 / 14%);
  }

  body.workspace-nav-open .workspace-sidebar {
    transform: translateX(0);
  }

  body.workspace-nav-collapsed .workspace-brand-text,
  body.workspace-nav-collapsed .workspace-nav-label,
  body.workspace-nav-collapsed .workspace-nav-text {
    display: block;
  }

  body.workspace-nav-collapsed .workspace-nav-link {
    justify-content: flex-start;
    padding-inline: 10px;
  }

  .workspace-main > .shell {
    width: min(100% - 24px, 1680px);
    padding-top: 10px;
  }

  .workspace-mobile-menu {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
  }

  .workspace-page-header {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

/* Workbench overview */
.workspace-content {
  padding-top: 20px;
}

.workspace-loading,
.workspace-load-error,
.workspace-empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.workspace-load-error {
  border: 1px solid #edb8b8;
  background: #fff5f5;
  color: var(--accent-dark);
}

.workspace-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.workspace-stat {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
}

.workspace-stat:hover {
  border-color: #b6bec9;
  box-shadow: 0 4px 14px rgb(16 24 40 / 6%);
}

.workspace-stat span,
.workspace-stat small {
  color: var(--muted);
}

.workspace-stat strong {
  margin: 8px 0 5px;
  font-size: 25px;
}

.workspace-stat small {
  font-size: 12px;
}

.workspace-quick-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.workspace-quick-band p {
  margin-top: 5px;
  font-size: 13px;
}

.workspace-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-quick-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.workspace-quick-actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.workspace-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.workspace-library-panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: #ffffff;
}

.workspace-library-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.workspace-library-panel > header a {
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}

.workspace-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  border-bottom: 1px solid #edf0f3;
  color: var(--text);
  text-decoration: none;
}

.workspace-recent-item:last-child {
  border-bottom: 0;
}

.workspace-recent-item strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-recent-item span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1200px) {
  .workspace-stat-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .workspace-library-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace-stat-grid {
    grid-template-columns: 1fr;
  }

  .workspace-quick-band {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-quick-actions a {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}

/* Knowledge, competitor, and prompt libraries */
.library-editor-band,
.library-list-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.library-editor-form {
  padding: 16px;
}

.library-editor-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.knowledge-editor-grid,
.prompt-editor-grid {
  grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 0.8fr) 160px;
}

.benchmark-editor-grid {
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.6fr) minmax(180px, 0.7fr);
}

.library-editor-form textarea,
.library-inline-form textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
}

.library-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.library-list-panel {
  min-height: 240px;
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.library-toolbar > div > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.library-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-filters input {
  width: min(280px, 30vw);
}

.library-entry-list {
  padding: 0 16px 16px;
}

.library-entry {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.library-entry.is-pinned {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.library-entry:last-child {
  border-bottom: 0;
}

.library-entry-head,
.library-entry-foot,
.library-entry-title,
.library-entry-actions {
  display: flex;
  align-items: center;
}

.library-entry-head,
.library-entry-foot {
  justify-content: space-between;
  gap: 12px;
}

.library-entry-title,
.library-entry-actions {
  flex-wrap: wrap;
  gap: 7px;
}

.library-entry-title strong {
  font-size: 17px;
}

.library-badge,
.library-category {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #d9dfe7;
  border-radius: 4px;
  background: #f8f9fb;
  color: #596273;
  font-size: 12px;
}

.library-badge.formal {
  border-color: #c7d8f4;
  background: #f0f5ff;
  color: #315a9d;
}

.library-badge.pinned {
  border-color: #edb8b8;
  background: #fff3f3;
  color: var(--accent-dark);
}

.library-category {
  margin-top: 7px;
}

.library-entry-content,
.prompt-preview {
  margin: 13px 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.prompt-preview {
  padding: 12px;
  border: 1px solid #e3e7ec;
  background: #fafbfc;
}

.prompt-usage {
  margin: -3px 0 13px;
  color: var(--muted);
  font-size: 13px;
}

.benchmark-channel-link {
  color: #0f4c98;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.benchmark-channel-link:hover,
.benchmark-video-item a:hover {
  text-decoration: underline;
}

.benchmark-videos {
  margin: 12px 0;
  border: 1px solid #e1e6ec;
}

.benchmark-videos-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e1e6ec;
  background: #fafbfc;
}

.benchmark-videos-title span,
.benchmark-video-empty {
  color: var(--muted);
  font-size: 12px;
}

.benchmark-video-empty {
  padding: 14px 12px;
}

.benchmark-video-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f3;
}

.benchmark-video-item > div {
  min-width: 0;
}

.benchmark-video-item a,
.benchmark-video-item span {
  display: block;
}

.benchmark-video-item a {
  color: #0f4c98;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.benchmark-video-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.benchmark-video-item button {
  flex: 0 0 auto;
  height: 32px;
}

.benchmark-video-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(260px, 1.3fr) minmax(160px, 0.8fr) auto;
  gap: 8px;
  padding: 10px 12px;
  background: #fafbfc;
}

@media (max-width: 900px) {
  .benchmark-video-form {
    grid-template-columns: 1fr;
  }

  .benchmark-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.library-entry-foot small {
  color: var(--muted);
}

.library-entry-actions button {
  height: 34px;
  padding-inline: 11px;
  font-size: 13px;
}

.library-empty {
  padding: 54px 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .knowledge-editor-grid,
  .prompt-editor-grid,
  .benchmark-editor-grid {
    grid-template-columns: 1fr;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .library-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .library-filters input,
  .library-filters select,
  .library-filters button {
    width: 100%;
  }

  .library-entry-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* BitBrowser account matrix */
.matrix-config-band,
.matrix-list-panel,
.matrix-link-form {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.matrix-config-form {
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) minmax(230px, 1fr) auto auto auto auto;
  gap: 8px;
  padding: 16px;
}

.matrix-clear-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.matrix-clear-token input {
  width: 16px;
  height: 16px;
}

.matrix-config-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
}

.matrix-connection {
  display: flex;
  align-items: center;
  gap: 8px;
}

.matrix-connection > span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid #c9cfd7;
  border-radius: 50%;
  background: #ffffff;
}

.matrix-connection.good > span {
  border-color: #159866;
  background: #159866;
}

.matrix-connection.warn > span {
  border-color: #d89518;
  background: #f4b740;
}

.matrix-connection small {
  color: var(--muted);
}

.matrix-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.matrix-summary-grid > div {
  min-height: 94px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.matrix-summary-grid span,
.matrix-summary-grid strong {
  display: block;
}

.matrix-summary-grid span {
  color: var(--muted);
  font-size: 13px;
}

.matrix-summary-grid strong {
  margin-top: 8px;
  font-size: 26px;
}

.matrix-link-form {
  display: grid;
  grid-template-columns: minmax(170px, 0.6fr) minmax(180px, 0.8fr) minmax(280px, 1.4fr) minmax(180px, 0.8fr) auto auto;
  gap: 8px;
  padding: 14px 16px;
}

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

.matrix-link-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.matrix-link-title span {
  color: var(--muted);
  font-size: 12px;
}

.matrix-link-title strong {
  overflow: hidden;
  margin-top: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-list-panel {
  min-height: 280px;
}

.matrix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.matrix-toolbar > div > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.matrix-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.matrix-filters input {
  width: min(320px, 32vw);
}

.matrix-table-wrap {
  overflow-x: auto;
}

.matrix-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.matrix-table th,
.matrix-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e8ed;
  text-align: left;
  vertical-align: middle;
}

.matrix-table th {
  background: #fafbfc;
  color: var(--muted);
  font-size: 12px;
}

.matrix-table td {
  color: #344054;
  font-size: 13px;
}

.matrix-table td:nth-child(1) {
  width: 62px;
}

.matrix-table td:nth-child(2) {
  width: 220px;
}

.matrix-table td:nth-child(6) {
  width: 120px;
}

.matrix-table td:nth-child(7) {
  width: 156px;
}

.matrix-table td > strong,
.matrix-table td > small,
.matrix-table td > a {
  display: block;
}

.matrix-table td > small {
  max-width: 230px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-table td > a {
  color: #0f4c98;
  font-weight: 600;
  text-decoration: none;
}

.matrix-table td > a:hover {
  text-decoration: underline;
}

.matrix-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.matrix-state i {
  width: 9px;
  height: 9px;
  border: 1px solid #c7cdd5;
  border-radius: 50%;
  background: #ffffff;
}

.matrix-state.running {
  color: var(--green);
}

.matrix-state.running i {
  border-color: #18a16d;
  background: #18a16d;
}

.matrix-state.closed {
  color: var(--muted);
}

.matrix-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.matrix-actions button {
  height: 34px;
  padding-inline: 10px;
  font-size: 13px;
}

.matrix-empty {
  height: 170px;
  color: var(--muted) !important;
  text-align: center !important;
}

@media (max-width: 1200px) {
  .matrix-config-form {
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr) auto auto;
  }

  .matrix-clear-token {
    grid-column: span 2;
  }

  .matrix-link-form {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 700px) {
  .matrix-config-form,
  .matrix-link-form {
    grid-template-columns: 1fr;
  }

  .matrix-clear-token {
    grid-column: auto;
  }

  .matrix-config-foot,
  .matrix-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .matrix-connection {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .matrix-summary-grid {
    grid-template-columns: 1fr;
  }

  .matrix-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .matrix-filters input,
  .matrix-filters select {
    width: 100%;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 700;
}

h2 {
  font-size: 18px;
}

p,
.section-title span,
.status,
th {
  color: var(--muted);
}

.topbar p {
  margin-top: 8px;
  font-size: 14px;
}

.actions,
.channel-form,
.config-form,
.section-title,
.channel-card,
.toggle {
  display: flex;
  align-items: center;
}

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

.tool-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.tool-nav a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.tool-nav a.active {
  background: var(--accent);
  color: #ffffff;
}

button,
input,
select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

button {
  padding: 0 14px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: #aeb6c2;
}

button.primary,
.channel-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

button.primary:hover,
.channel-form button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

input,
select {
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
}

.inline-edit {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.group-value {
  min-width: 54px;
  font-weight: 600;
}

.compact-select {
  max-width: 150px;
  height: 32px;
  padding: 0 30px 0 10px;
  font-size: 13px;
}

.mini-edit {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.mini-edit:hover {
  color: var(--accent);
  border-color: #f0b6b6;
  background: #fff1f1;
}

.edit-popover {
  position: absolute;
  left: 0;
  top: 30px;
  z-index: 40;
  display: none;
  min-width: 120px;
  max-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.18);
}

.inline-edit.open .edit-popover {
  display: grid;
  gap: 4px;
}

.edit-popover button {
  justify-content: flex-start;
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border-color: transparent;
  text-align: left;
}

.edit-popover button:hover {
  background: #f6f7f9;
}

.toggle {
  gap: 6px;
  height: 40px;
  color: var(--muted);
}

.toggle input {
  width: 16px;
  height: 16px;
}

.input-band,
.analysis-band,
.channel-band,
.table-band,
.tag-tool,
.tag-results {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.channel-form {
  gap: 10px;
}

.config-form {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.config-form input {
  flex: 0 1 360px;
}

.config-form button,
.small-action {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.analysis-form {
  display: flex;
  gap: 10px;
}

.analysis-form input {
  flex: 1 1 420px;
}

.analysis-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.live-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.live-filter-row select {
  min-width: 180px;
}

.live-filter-row .status {
  margin-top: 0;
}

.live-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.live-refresh-countdown {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 148px;
  height: 40px;
  padding: 7px 10px;
  border: 1px solid #efb0b4;
  border-radius: 6px;
  background: #fffafa;
  white-space: nowrap;
}

.live-refresh-countdown span {
  color: var(--muted);
  font-size: 13px;
}

.live-refresh-countdown strong {
  color: #cf2029;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.live-auto-toggle {
  height: 40px;
  font-weight: 800;
}

.live-auto-toggle.is-resume {
  border-color: #178a4b;
  color: #147a43;
  background: #f2fbf6;
}

.live-refresh-schedule {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
  padding: 9px 12px;
  border-left: 3px solid #cf2029;
  background: #fffafa;
  color: #4f5663;
  font-size: 13px;
}

.live-refresh-schedule strong {
  color: #182033;
  font-size: 14px;
}

.live-refresh-schedule b {
  margin-left: auto;
  color: #178a4b;
}

@media (max-width: 760px) {
  .live-refresh-schedule b {
    width: 100%;
    margin-left: 0;
  }
}

.live-channel-form {
  margin-bottom: 0;
}

.live-channel-form input[name="group"] {
  flex: 0 0 220px;
}

.vps-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 0.8fr) minmax(180px, 1fr) 90px minmax(120px, 0.8fr) minmax(140px, 0.9fr) minmax(180px, 1fr) 90px 90px auto;
  gap: 10px;
}

.vps-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.vps-command-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.vps-command-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.vps-command-card h2 {
  margin: 0;
  font-size: 18px;
}

.vps-command-row,
.vps-stream-grid,
.vps-command-output {
  display: grid;
  gap: 8px;
}

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

.vps-stream-grid {
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 0.85fr) minmax(130px, 0.85fr) auto auto;
}

.stream-duration-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.stream-duration-option input {
  width: 16px;
  height: 16px;
}

.vps-command-output {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.vps-command-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.vps-command-output textarea {
  min-height: 72px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.vps-command-card button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.vps-command-card button.secondary-action {
  background: #ffffff;
  color: var(--accent);
}

.vps-command-card button.secondary-action:hover {
  background: #fff5f5;
}

.vps-layout {
  display: grid;
  grid-template-columns: minmax(360px, 390px) minmax(0, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
}

.vps-layout .channel-band,
.vps-layout .table-band {
  min-width: 0;
  border-top: 0;
}

.vps-server-list {
  display: grid;
  gap: 10px;
}

.vps-server-list .channel-card {
  width: 100%;
  min-width: 0;
  min-height: 78px;
  gap: 8px;
  padding: 8px 36px 8px 10px;
}

.vps-server-list .channel-meta > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vps-file-actionbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
  padding: 6px 0;
}

.vps-file-actionbar span {
  color: var(--muted);
  font-size: 13px;
}

.vps-file-actionbar span.is-unlocked {
  color: var(--green);
  font-weight: 700;
}

.vps-file-action-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.vps-upload-controls {
  display: flex;
  align-items: center;
  flex: 1 1 760px;
  flex-wrap: wrap;
  gap: 8px;
}

.vps-upload-target {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: min(360px, 100%);
  color: var(--muted);
  font-size: 13px;
}

.vps-upload-target input {
  flex: 1;
  min-width: 150px;
  height: 36px;
}

.vps-uploader-status.is-ready {
  color: var(--green);
  font-weight: 700;
}

.vps-uploader-status.is-error {
  color: var(--red);
}

.vps-upload-queue {
  display: grid;
  gap: 8px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--line);
}

.vps-upload-queue[hidden] {
  display: none;
}

.upload-result-notice {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 3000;
  display: flex;
  width: min(620px, calc(100vw - 32px));
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 12px 18px;
  border: 2px solid #15803d;
  border-radius: 8px;
  background: #f0fdf4;
  box-shadow: 0 16px 40px rgb(15 23 42 / 24%);
  color: #14532d;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  transform: translateX(-50%);
}

.upload-result-notice[hidden] {
  display: none;
}

.upload-result-notice.is-error {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

.upload-result-notice button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: currentColor;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.upload-result-notice button:hover {
  background: rgb(15 23 42 / 8%);
}

.vps-upload-item {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(160px, 2fr) minmax(100px, .6fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.vps-upload-item.is-uploading { border-left-color: var(--green); }
.vps-upload-item.is-complete { border-left-color: #16a34a; background: #f7fcf9; }
.vps-upload-item.is-error { border-left-color: var(--red); background: #fff8f8; }

.vps-upload-file strong,
.vps-upload-file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vps-upload-file small,
.vps-upload-meta {
  color: var(--muted);
  font-size: 12px;
}

.vps-upload-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8edf2;
}

.vps-upload-progress i {
  display: block;
  height: 100%;
  background: var(--green);
  transition: width 160ms linear;
}

.vps-upload-progress-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.vps-upload-eta {
  color: #b4232d;
  font-weight: 700;
  white-space: nowrap;
}

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

.vps-upload-actions button {
  height: 32px;
  padding: 0 10px;
}

@media (max-width: 1050px) {
  .vps-upload-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .vps-upload-progress {
    grid-column: 1 / -1;
  }
}

.vps-file-select-cell {
  width: 44px;
  text-align: center;
}

.vps-file-select-cell input {
  width: 16px;
  height: 16px;
}

.vps-file-row.is-selected {
  background: #fff8e8;
}

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

.vps-detail-actions button {
  height: 34px;
}

.vps-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.vps-stats article {
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.vps-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vps-stat-head b {
  color: var(--muted);
  font-size: 12px;
}

.vps-stats span,
.vps-stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.vps-stats strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 22px;
}

.vps-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.vps-progress i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: #2563eb;
}

.vps-progress.good i {
  background: #0f9f6e;
}

.vps-progress.warn i {
  background: #d97706;
}

.vps-progress.danger i {
  background: #c9232b;
}

.vps-progress.muted-progress i {
  min-width: 0;
}

.pm2-panel {
  margin-bottom: 12px;
}

.pm2-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.pm2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pm2-head h3 {
  margin: 0;
  font-size: 17px;
}

.pm2-head span,
.pm2-item small {
  color: var(--muted);
  font-size: 12px;
}

.pm2-list {
  display: grid;
  gap: 8px;
}

.pm2-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .75fr) 132px 72px 92px 82px 90px 86px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #cfd7e2;
  border-radius: 8px;
  background: #fbfcfd;
}

.pm2-item.has-action {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .75fr) 132px 72px 92px 82px 90px 86px auto;
}

.pm2-process-action {
  min-width: 58px;
  height: 34px;
  padding: 0 10px;
}

.pm2-item.is-healthy {
  border-left-color: #0f9f6e;
}

.pm2-item.is-warning {
  border-left-color: #d97706;
}

.pm2-item.is-stalled,
.pm2-item.is-stopped {
  border-left-color: #c9232b;
  background: #fff8f8;
}

.pm2-item strong,
.pm2-item small {
  display: block;
}

.pm2-key {
  min-width: 0;
}

.pm2-key span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.pm2-key code {
  display: block;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pm2-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 6px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pm2-item .pm2-status {
  background: #e6f7ef;
  color: #087347;
}

.pm2-health b,
.pm2-health small {
  display: block;
}

.pm2-health b {
  font-size: 14px;
}

.pm2-health-healthy b {
  color: #087347;
}

.pm2-health-warning b {
  color: #b45309;
}

.pm2-health-stalled b,
.pm2-health-stopped b {
  color: #c9232b;
}

.pm2-health-unknown b {
  color: var(--muted);
}

.vps-path-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.vps-path-row input {
  flex: 1;
}

.table-wrap.is-collapsed {
  display: none;
}

.vps-dir-row {
  cursor: pointer;
}

.vps-dir-row:hover {
  background: #fbfcfd;
}

.analysis-results {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.analysis-summary,
.version-group {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.analysis-summary {
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(240px, 1.4fr);
  align-items: center;
}

.analysis-summary span,
.version-group-head span,
.evidence-line,
.version-item em {
  color: var(--muted);
  font-style: normal;
}

.version-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.version-list {
  display: grid;
  gap: 8px;
}

.version-item {
  display: grid;
  grid-template-columns: 88px minmax(220px, 1fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.version-item:hover {
  border-color: #aeb6c2;
  background: #fbfcfd;
}

.version-item span {
  color: var(--accent);
  font-weight: 800;
}

.version-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.group-form input {
  width: min(320px, 100%);
}

.group-form button {
  border-color: var(--accent);
  color: var(--accent);
}

.channel-form input[name="remark"] {
  flex: 0 0 220px;
}

.channel-form select[name="group"] {
  flex: 0 0 180px;
}

.channel-form input[name="url"] {
  flex: 1 1 420px;
}

.status {
  min-height: 22px;
  margin-top: 10px;
  font-size: 14px;
}

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

.status.warn {
  color: var(--warn);
}

.group-form select {
  flex: 0 0 200px;
}

.group-form .danger-outline {
  border-color: #c8232c;
  color: #c8232c;
  background: #fff;
}

.group-form .danger-outline:disabled,
.group-form select:disabled {
  border-color: var(--line);
  color: var(--muted);
  opacity: 0.65;
  cursor: not-allowed;
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.channel-list {
  display: grid;
  gap: 14px;
}

.group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.group-tab span {
  color: var(--muted);
  font-size: 12px;
}

.group-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.channel-group {
  display: grid;
  gap: 8px;
}

.group-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.publish-timer-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.publish-timer-panel strong {
  min-width: 120px;
  color: var(--text);
  font-size: 14px;
}

.publish-clock-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.publish-clock-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.publish-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  background: #101828;
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.publish-clock.remaining {
  color: #ff3b30;
}

.publish-clock.remaining.due {
  background: #fff1f1;
  color: var(--accent);
}

.publish-clock.elapsed {
  color: #33d17a;
}

.publish-interval {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.publish-interval input {
  width: 72px;
  height: 30px;
  padding: 0 8px;
}

.publish-mark-btn {
  height: 32px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.channel-card {
  position: relative;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px 38px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.channel-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.channel-meta {
  min-width: 0;
}

.channel-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-meta a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1d4f91;
  text-decoration: none;
}

.channel-meta small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.live-channel-card {
  flex-direction: column;
  align-items: stretch;
  min-height: 126px;
  padding-right: 38px;
  cursor: default;
}

.channel-list .group-grid {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.channel-live-total {
  display: flex;
  align-items: baseline;
  align-self: end;
  gap: 5px;
  color: #cf2029;
  white-space: nowrap;
}

.live-channel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  width: 100%;
}

.channel-plan-note {
  width: 100%;
  margin-top: 8px;
}

.channel-plan-note textarea {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: none;
}

.channel-plan-note textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(207, 32, 41, 0.12);
}

.channel-plan-note small {
  display: block;
  min-height: 16px;
  margin-top: 3px;
  text-align: right;
}

.channel-plan-note small.good {
  color: #168447;
}

.channel-plan-note small.warn {
  color: var(--accent);
}

.channel-live-total strong {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.channel-live-total span {
  font-size: 15px;
  font-weight: 800;
}

.vps-slot-badge {
  flex: 0 0 auto;
  min-width: 98px;
  margin-right: 16px;
  padding: 4px 8px;
  border: 1px solid #d8e0ea;
  border-radius: 6px;
  background: #f8fbff;
  text-align: center;
}

.vps-slot-badge label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  cursor: text;
}

.vps-slot-badge input {
  display: block;
  width: 36px;
  height: 24px;
  margin-top: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  cursor: text;
}

.vps-slot-auto {
  display: block;
  width: 36px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.vps-slot-badge input:focus {
  color: var(--accent);
}

.vps-slot-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
}

.vps-slot-pair span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.vps-stream-lights {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 14px;
  margin-top: 5px;
}

.vps-stream-light {
  display: block;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 1px solid #b8c2cf;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.04);
}

.vps-stream-light.is-green {
  border-color: #078d5d;
  background: #12a56d;
}

.vps-stream-light.is-yellow {
  border-color: #d98500;
  background: #f5a000;
}

.vps-stream-light.is-red {
  border-color: #b91f2b;
  background: #d12835;
}

.vps-stream-light.is-gray {
  border-color: #7c8999;
  background: #9aa6b5;
}

.vps-stream-light.is-white {
  background: #ffffff;
}

.plan-board {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.plan-editor,
.plan-list-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.plan-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  gap: 10px;
}

.plan-editor textarea {
  width: 100%;
  min-height: 150px;
  margin-top: 10px;
  resize: vertical;
}

.plan-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.plan-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.plan-note {
  border: 1px solid #ccd7e5;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px 16px;
}

.plan-note.is-pinned {
  border-color: #f0b8b8;
  background: #fffafa;
}

.plan-note-head,
.plan-note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-note-head strong {
  font-size: 18px;
}

.plan-note-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pin-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #d72727;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 8px;
}

.plan-note p {
  margin: 12px 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.plan-note-foot small {
  color: var(--muted);
}

.plan-note-foot div {
  display: flex;
  gap: 8px;
}

.plan-note-actions button {
  min-width: 42px;
}

.plan-note-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.danger-light {
  border-color: #f2b8b8;
  color: var(--accent);
  background: #fff7f7;
}

.delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-color: transparent;
  border-radius: 50%;
  background: transparent;
  color: #8a1c1c;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.delete-btn:hover {
  border-color: #f0b6b6;
  background: #fff1f1;
}

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

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

.channel-table {
  min-width: 1320px;
}

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

th {
  font-size: 13px;
  font-weight: 600;
  background: #fbfcfd;
}

td {
  font-size: 14px;
}

td:first-child {
  white-space: nowrap;
}

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

.selected-row {
  background: #fff7f7;
}

.live-group-shaded td {
  background: #fff5f8;
}

.live-group-shaded td:first-child {
  border-left: 4px solid #f2a7b7;
}

.live-group-start td {
  border-top: 2px solid #edf0f5;
}

.live-group-end td {
  border-bottom: 2px solid #edf0f5;
}

.live-group-shaded:hover td {
  background: #ffeaf0;
}

.live-table tbody tr:not(.live-group-shaded):hover td {
  background: #f7f9fc;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.views-count {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.channel-table .views-count {
  font-size: 17px;
}

.channel-table td:first-child {
  min-width: 220px;
}

.channel-table td:first-child strong,
.channel-table td:first-child a {
  display: block;
}

.channel-table td:first-child a {
  max-width: 260px;
  overflow: hidden;
  color: #1d4f91;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.small-action {
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.ypp-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.traffic {
  color: var(--green);
  font-weight: 700;
}

.video-thumb {
  position: relative;
  display: block;
  width: 96px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef1f5;
  transition: transform 140ms ease, box-shadow 140ms ease;
  transform-origin: left center;
  z-index: 1;
}

.video-thumb:hover {
  overflow: visible;
  transform: scale(2.85);
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.28);
  z-index: 80;
}

.video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb span {
  display: block;
  width: 100%;
  height: 100%;
}

.video-thumb b,
.live-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.video-thumb b {
  position: absolute;
  left: 5px;
  bottom: 5px;
  height: 18px;
  padding: 0 5px;
}

.live-pill {
  height: 22px;
  padding: 0 7px;
}

.remark-text {
  font-weight: 600;
}

.flag-editor {
  min-width: 58px;
}

.flag-popover {
  min-width: 70px;
}

.flag-icon,
.flag-choice {
  font-size: 22px;
  font-weight: 800;
}

.flag-choice {
  justify-content: center;
}

.flag-none {
  color: var(--muted);
}

.flag-red { color: #d92d20; }
.flag-orange { color: #f79009; }
.flag-yellow { color: #b54708; }
.flag-green { color: #039855; }
.flag-blue { color: #1570ef; }
.flag-purple { color: #7a5af8; }
.flag-pink { color: #dd2590; }

.muted {
  color: var(--muted);
}

.empty {
  height: 120px;
  color: var(--muted);
  text-align: center;
}

.tag-form {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.tag-form textarea {
  flex: 0 1 520px;
  min-height: 40px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.tag-form button {
  min-width: 108px;
}

.cover-batch-tool {
  margin-top: 14px;
}

.cover-batch-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 110px minmax(340px, 0.9fr) auto;
  gap: 10px;
}

.cover-batch-form-wide {
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 0.9fr) auto;
}

.cover-batch-form-cover {
  grid-template-columns: minmax(260px, 1fr) 120px 110px minmax(300px, 0.9fr) auto;
}

.folder-picker {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.folder-picker input {
  flex: 1;
  min-width: 0;
}

.folder-picker button {
  flex: 0 0 auto;
}

.cover-batch-summary {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.cover-batch-summary span {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.cover-batch-list {
  display: grid;
  gap: 8px;
}

.cover-batch-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 90px;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #ffffff;
}

.cover-batch-item.failed {
  border-left-color: var(--warn);
}

.cover-batch-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-batch-item span,
.cover-batch-item small {
  color: var(--muted);
  font-size: 13px;
}

.tag-results,
.cover-results {
  display: grid;
  gap: 20px;
}

.info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
}

.command-output {
  width: 100%;
  min-height: 110px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: 13px Consolas, "Courier New", monospace;
}

.tag-result-card {
  display: grid;
  gap: 14px;
}

.tag-video-title {
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.warn-text {
  color: var(--warn);
}

.tag-chip-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tag-chip {
  height: 40px;
  padding: 0 20px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
}

.tag-chip.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.tag-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.localization-result {
  padding-bottom: 8px;
}

.localization-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.localization-heading > strong {
  color: var(--accent);
  font-size: 18px;
  white-space: nowrap;
}

.localization-summary {
  display: grid;
  grid-template-columns: 160px minmax(180px, 1fr) 130px minmax(180px, 1fr);
  gap: 8px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.localization-summary span,
.localization-row label,
.localization-language span {
  color: var(--muted);
  font-size: 13px;
}

.localization-list {
  display: grid;
}

.localization-row {
  display: grid;
  grid-template-columns: 150px minmax(240px, 0.8fr) minmax(320px, 1.4fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.localization-row:last-child {
  border-bottom: 0;
}

.localization-language,
.localization-row > div {
  min-width: 0;
}

.localization-row p {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.localization-description {
  white-space: pre-wrap;
}

.select-all-btn {
  border-color: #ffb547;
  background: #ffb547;
  color: #ffffff;
  font-weight: 700;
}

.copy-selected-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.tag-empty {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.cover-results {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.media-grid.single {
  grid-template-columns: minmax(0, 720px);
}

.media-result {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.media-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.media-title span {
  color: var(--muted);
  font-size: 13px;
}

.media-result img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f5;
}

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

.media-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.totp-item-form {
  display: grid;
  grid-template-columns: 180px 180px minmax(260px, 1fr) auto;
  gap: 10px;
}

.totp-item-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.totp-button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.totp-button-wrap {
  position: relative;
  display: inline-flex;
}

.totp-account-btn {
  min-width: 82px;
  height: 46px;
  padding: 0 24px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
}

.totp-account-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.inline-delete {
  top: -8px;
  right: -8px;
  background: #ffffff;
}

.totp-code-panel {
  min-height: 160px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.totp-code-meta {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.totp-code-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
}

.totp-copy-btn {
  min-width: 96px;
}

.totp-stop-btn {
  border-color: var(--line);
  color: var(--muted);
  font-weight: 700;
}

.totp-stop-btn:hover {
  border-color: #aeb6c2;
  color: var(--text);
}

.totp-code-row strong {
  font-size: 58px;
  letter-spacing: 0;
  line-height: 1;
}

.ypp-account-form,
.ypp-entry-form,
.ypp-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ypp-account-form {
  margin-bottom: 10px;
}

.ypp-account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  margin: 2px 0 10px;
}

.ypp-account-tab {
  min-width: 78px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
}

.ypp-account-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.ypp-account-form input {
  width: min(320px, 100%);
}

.ypp-account-form button,
.ypp-entry-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.ypp-entry-form {
  flex-wrap: wrap;
}

.ypp-entry-form select {
  width: 180px;
}

.ypp-entry-form input[type="date"],
.ypp-entry-form input[type="number"] {
  width: 160px;
}

.ypp-entry-form input[name="note"] {
  flex: 1 1 240px;
}

.ypp-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.ypp-summary-grid article {
  min-height: 94px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.ypp-summary-grid article:last-child {
  border-right: 0;
}

.ypp-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ypp-summary-grid strong {
  display: block;
  margin-top: 8px;
  color: #050b12;
  font-size: 28px;
  letter-spacing: 0;
}

.ypp-chart-panel {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  padding: 10px 12px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.ypp-chart-panel canvas {
  display: block;
  width: 100%;
  height: 360px;
}

.ypp-tooltip {
  position: absolute;
  z-index: 5;
  display: none;
  min-width: 128px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.18);
  pointer-events: none;
}

.ypp-tooltip small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ypp-tooltip strong {
  display: block;
  margin-top: 3px;
  color: #209fd6;
  font-size: 22px;
}

.danger-text {
  height: 30px;
  padding: 0 8px;
  border-color: transparent;
  color: var(--accent);
  background: transparent;
}

.danger-text:hover {
  border-color: #f0b6b6;
  background: #fff1f1;
}

@media (max-width: 1100px) {
  .vps-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .vps-server-list {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .vps-layout .table-band {
    padding-top: 0;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 14px;
  }

  .topbar,
  .channel-form,
  .config-form,
  .analysis-form,
  .group-form,
  .tag-form {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  .tool-nav {
    width: 100%;
    height: auto;
    justify-content: stretch;
  }

  .tool-nav a {
    flex: 1;
    justify-content: center;
  }

  .channel-form input[name="remark"],
  .channel-form select[name="group"],
  .channel-form input[name="url"],
  .config-form input,
  .config-form button {
    flex-basis: auto;
    width: 100%;
  }

  .tag-form textarea,
  .tag-form button {
    width: 100%;
  }

  .cover-batch-form,
  .cover-batch-summary,
  .cover-batch-item {
    grid-template-columns: 1fr;
  }

  .folder-picker {
    flex-direction: column;
  }

  .tag-actions {
    grid-template-columns: 1fr;
  }

  .localization-heading {
    flex-direction: column;
  }

  .localization-summary,
  .localization-row {
    grid-template-columns: 1fr;
  }

  .analysis-summary,
  .version-item {
    grid-template-columns: 1fr;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

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

  .ypp-account-form,
  .ypp-entry-form,
  .ypp-filters,
  .ypp-account-tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .ypp-account-form input,
  .ypp-account-form button,
  .ypp-entry-form select,
  .ypp-entry-form input,
  .ypp-entry-form button,
  .ypp-account-tab,
  .ypp-filters select {
    width: 100%;
  }

  .ypp-summary-grid {
    grid-template-columns: 1fr;
  }

  .ypp-summary-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ypp-summary-grid article:last-child {
    border-bottom: 0;
  }

  .vps-command-band,
  .vps-command-row,
  .vps-stream-grid,
  .vps-command-output {
    grid-template-columns: 1fr;
  }

  .pm2-item {
    grid-template-columns: minmax(0, 1fr) 130px;
  }

  .totp-code-row {
    align-items: stretch;
    flex-direction: column;
  }

  .totp-code-row strong {
    font-size: 42px;
  }

  .live-channel-card {
    padding-right: 38px;
  }

  .live-channel-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .channel-list .group-grid {
    grid-template-columns: 1fr;
  }

  .channel-live-total strong {
    font-size: 24px;
  }
}
