:root {
  color-scheme: light;
  --bg: #f5f6fc;
  --panel: rgba(255, 255, 255, .78);
  --card: rgba(255, 255, 255, .9);
  --line: #e9e8f0;
  --text: #262331;
  --muted: #8b8995;
  --purple: #7655e9;
  --purple-2: #9a65ec;
  --purple-soft: #f0efff;
  --green: #2f9b73;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 9% 78%, rgba(194, 195, 255, .28), transparent 28%),
    radial-gradient(circle at 92% 9%, rgba(217, 203, 255, .32), transparent 25%),
    var(--bg);
}

button, a { font: inherit; }
button { cursor: pointer; }
.shell {
  width: min(100% - 24px, 500px);
  margin: 0 auto;
  padding: 18px 0 24px;
}
.brand { text-align: center; padding: 0 0 14px; }
.brand h1 { margin: 0; color: var(--purple); font-size: 20px; font-weight: 750; letter-spacing: .02em; }
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border-radius: 19px 19px 0 0;
  background: rgba(255, 255, 255, .75);
  box-shadow: 0 4px 20px rgba(65, 53, 117, .08);
}
.tab {
  border: 0;
  padding: 11px 8px;
  color: #77727f;
  background: transparent;
  font-weight: 650;
}
.tab.is-active { color: #221839; background: linear-gradient(115deg, #6650ed, #9a58e7); }
.tab:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(118, 85, 233, .3); outline-offset: 2px; }
.tab-panel { padding: 14px 10px 0; }
.card {
  border: 1px solid rgba(231, 230, 239, .85);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 7px 22px rgba(63, 54, 104, .05);
}
.account { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 18px 16px 14px; }
.auth-card { margin-bottom: 12px; overflow: hidden; }
.auth-form { display: grid; gap: 9px; padding: 12px; }
.auth-form label { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px; color: #77727f; font-size: 11px; }
.auth-form input { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; color: var(--text); background: #fff; font-size: 11px; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-actions .soft-button:disabled { cursor: not-allowed; opacity: .5; }
.auth-notice { margin: 0; font-size: 10px; }
.account-main h2 { margin: 0 0 4px; font-size: 17px; }
.muted { color: var(--muted); }
.account p { margin: 0; font-size: 12px; }
.soft-button {
  align-self: center;
  border: 0;
  border-radius: 9px;
  padding: 8px 17px;
  color: var(--purple);
  background: #e7e5ff;
  font-size: 12px;
  font-weight: 750;
}
.service-line { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.service-badge { border-radius: 16px; padding: 6px 10px; color: #cc4777; background: #fde4ed; font-size: 12px; font-weight: 650; }
.service-line a { color: var(--purple); font-size: 12px; text-decoration: none; }
.refresh-button {
  width: 100%;
  margin: 12px 0 4px;
  border: 0;
  border-radius: 10px;
  padding: 9px;
  color: #6052c8;
  background: #dcdcff;
  font-size: 12px;
  font-weight: 700;
}
.refresh-button:active { transform: translateY(1px); }
.notice { min-height: 16px; margin: 4px 5px 8px; color: var(--muted); font-size: 11px; }
.catalog-summary { margin: 0 5px 8px; color: #77728a; font-size: 11px; }
.task-groups { display: grid; gap: 10px; }
.task-group { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.76); }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; color: #35313c; background: #f0f0f1; font-size: 12px; font-weight: 750; }
.section-count { min-width: 20px; color: #9994a2; font-size: 10px; font-weight: 600; text-align: right; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-top: 1px solid var(--line); }
.task-row:first-of-type { border-top: 0; }
.task-title { min-width: 0; font-size: 12px; font-weight: 650; }
.task-key { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.status { white-space: nowrap; color: var(--green); font-size: 11px; }
.status.calibration { color: #c67b3d; }
.status.pending { color: #8c6ab8; }
.status.offline { color: #3b8d95; }
.run-button { border: 1px solid #dedbfb; border-radius: 8px; padding: 5px 8px; color: var(--purple); background: var(--purple-soft); font-size: 11px; font-weight: 700; }
.run-button:disabled { cursor: not-allowed; color: #aaa5b4; background: #f2f1f5; border-color: #e9e7ed; }
.settings-card { margin-bottom: 12px; overflow: hidden; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.setting-row strong { max-width: 60%; overflow: hidden; color: var(--purple); font-size: 11px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.copy, .help-list, .code { padding: 0 14px 14px; margin: 12px 0 0; font-size: 12px; line-height: 1.7; }
.help-list { padding-left: 31px; }
.code { color: #6a6480; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.footer { padding: 16px 0 0; color: #b2afbd; text-align: center; font-size: 10px; }
@media (min-width: 700px) { .shell { padding-top: 28px; } .tab-panel { padding-inline: 14px; } }
/* Profile and agent controls */
.form-grid { display: grid; gap: 10px; padding: 12px; }
.form-grid label { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 8px; color: #77727f; font-size: 11px; }
.form-grid input, .small-number { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; color: var(--text); background: #fff; font-size: 11px; }
.compact-grid { grid-template-columns: 1fr 1fr; padding-top: 0; }
.compact-grid label { grid-template-columns: 58px minmax(0, 1fr); }
.setting-row input[type="checkbox"], .check-grid input, .task-check input { accent-color: var(--purple); }
.toggle-row { cursor: pointer; }
.toggle-row input { width: 17px; height: 17px; margin-left: auto; }
.toggle-row strong { min-width: 30px; }
.check-grid { display: grid; gap: 8px; padding: 12px; }
.resource-grid { grid-template-columns: repeat(4, 1fr); }
.option-grid { grid-template-columns: repeat(3, 1fr); padding-top: 0; }
.check-grid label, .task-check { display: flex; align-items: center; gap: 6px; color: #625e6f; font-size: 11px; }
.form-help { margin: 0; padding: 10px 12px 0; font-size: 10px; line-height: 1.5; }
.enabled-task-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 10px; }
.task-check { min-width: 0; align-items: flex-start; padding: 7px 5px; border: 1px solid transparent; border-radius: 8px; background: rgba(247, 246, 253, .65); }
.task-check:has(input:checked) { border-color: #ddd7ff; background: #f1efff; }
.task-check input { flex: 0 0 auto; margin-top: 2px; }
.task-check span { min-width: 0; display: grid; gap: 2px; }
.task-check strong { overflow: hidden; color: #4b4560; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-check small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.agent-badge { align-self: start; white-space: nowrap; border-radius: 12px; padding: 5px 8px; font-size: 10px; font-weight: 700; }
.agent-badge.online { color: #197b59; background: #def6eb; }
.agent-badge.offline { color: #9a7180; background: #f7e8ef; }
.agent-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px; }
.agent-stat { min-width: 0; display: grid; gap: 3px; }
.agent-stat span, .agent-capabilities span { color: var(--muted); font-size: 10px; }
.agent-stat strong { overflow: hidden; color: #514b64; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.agent-stat strong.good { color: var(--green); }
.agent-capabilities { grid-column: 1 / -1; padding-top: 4px; border-top: 1px solid var(--line); }
.agent-capabilities p { margin: 4px 0 0; color: #615a73; font-size: 10px; }
@media (max-width: 390px) {
  .enabled-task-list { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr 1fr; }
}
