* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --wx-green: #07c160;
  --wx-green-dark: #06ad56;
  --bg-page: #ededed;
  --bg-sidebar: #e6e6e6;
  --bg-panel: #f7f7f7;
  --bg-white: #ffffff;
  --line: #d9d9d9;
  --line-soft: #e7e7e7;
  --text-main: #111111;
  --text-sub: #666666;
  --text-faint: #8c8c8c;
  --danger: #d9485f;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
}

.app-shell {
  width: min(1320px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--bg-white);
  border: 1px solid #dddddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
}

.main-panel {
  background: var(--bg-panel);
  padding: 24px;
}

.brand-block,
.sidebar-section,
.form-strip,
.table-section,
.main-header {
  background: var(--bg-white);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  margin-bottom: 16px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #1cd66d, var(--wx-green));
}

.brand-subtitle,
.header-copy,
.hint-text,
.meta-list dt,
.meta-list dd,
.pairing-meta,
.form-status,
.job-sub,
.muted,
.empty-row {
  color: var(--text-sub);
}

h1,
h2,
p,
pre,
dl,
dd {
  margin: 0;
}

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

h2 {
  font-size: 16px;
  font-weight: 700;
}

.sidebar-section {
  padding: 16px;
  margin-bottom: 14px;
}

.section-title-row,
.main-title-row,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.meta-list div {
  display: grid;
  gap: 4px;
}

.meta-list dt {
  font-size: 12px;
}

.meta-list dd {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-success {
  color: #04763b;
  background: #dff7e8;
}

.status-running {
  color: #14532d;
  background: #d9f6e2;
}

.status-error {
  color: #9f1d35;
  background: #fde5ea;
}

.status-idle {
  color: #555555;
  background: #f0f0f0;
}

.primary-btn,
.ghost-btn,
.mini-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.primary-btn {
  height: 42px;
  min-width: 132px;
  padding: 0 18px;
  background: var(--wx-green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.primary-btn:hover {
  background: var(--wx-green-dark);
}

.primary-btn:disabled,
.ghost-btn:disabled,
.mini-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.ghost-btn,
.mini-btn {
  background: #f5f5f5;
  color: #222;
  border: 1px solid var(--line-soft);
}

.ghost-btn {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.mini-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.connector-actions {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.connector-tip {
  margin-top: 10px;
}

.pairing-panel.hidden {
  display: none;
}

.pairing-panel {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.advanced-details {
  display: block;
}

.advanced-summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.advanced-details > *:not(summary) {
  margin-top: 14px;
}

.pairing-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 10px;
}

.pairing-code {
  height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  background: #f7fff9;
  border: 1px dashed #7fd8a4;
  color: #0a8a45;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
}

.command-card {
  display: grid;
  gap: 8px;
}

.command-label,
.eyebrow,
.field span {
  font-size: 12px;
  color: var(--text-faint);
}

.command-box {
  margin: 0;
  padding: 12px;
  background: #111111;
  color: #d9ffd9;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.main-header {
  padding: 18px 20px;
  margin-bottom: 16px;
}

.eyebrow {
  margin-bottom: 8px;
}

.header-copy {
  line-height: 1.6;
  font-size: 13px;
}

.form-strip,
.table-section {
  padding: 18px 20px;
}

.form-strip {
  margin-bottom: 16px;
}

.archive-form {
  display: grid;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.field-wide {
  width: 100%;
}

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

input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 14px;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: #2ab669;
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

.results {
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.result {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #efefef;
  background: #fff;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.result:last-child {
  border-bottom: 0;
}

.result:hover {
  background: #f7fff9;
}

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

.jobs-table th,
.jobs-table td {
  padding: 14px 10px;
  border-bottom: 1px solid #efefef;
  vertical-align: top;
  text-align: left;
  font-size: 13px;
  word-break: break-word;
}

.jobs-table th {
  color: var(--text-faint);
  font-weight: 600;
}

.job-name {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.job-sub {
  font-size: 12px;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-link {
  color: #08864a;
  text-decoration: none;
}

.action-link:hover {
  text-decoration: underline;
}

.empty-row {
  padding: 20px 0;
}

@media (max-width: 980px) {
  .app-shell {
    width: calc(100vw - 16px);
    margin: 8px auto;
    min-height: calc(100vh - 16px);
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .main-panel,
  .sidebar {
    padding: 14px;
  }

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

  .section-title-row,
  .form-actions,
  .pairing-code-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .jobs-table {
    display: block;
    overflow-x: auto;
  }
}
