:root {
  color-scheme: light;
  --brand: #4c77df;
  --action: #315bc0;
  --ink: #1b2233;
  --muted: #556178;
  --line: #dbe2ee;
  --paper: #fbfcfe;
  --soft: #edf3ff;
  --green: #176957;
  --green-bg: #e7f3ee;
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button:enabled, summary { cursor: pointer; }
button, input, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-defs { position: absolute; pointer-events: none; }
.wrap { width: min(1152px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; font-weight: 770; }
.brand img { display: block; width: 30px; height: 30px; }
.brand-divider { height: 20px; border-left: 1px solid var(--line); margin-inline: 4px; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sub-brand, .muted { color: var(--muted); }
.sub-brand { font-size: 13px; font-weight: 550; }
.text-link { color: var(--action); font-weight: 680; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 14px; border: 1px solid #becbe2; border-radius: 7px; background: #fff; color: #2a4779; font-size: 14px; line-height: 1.4; font-weight: 700; text-align: center; white-space: nowrap; }
.btn:hover { background: #f1f5fd; border-color: #9eb4e0; }
.btn.primary { color: #fff; background: var(--action); border-color: var(--action); }
.btn.primary:hover { background: #264da7; }
.btn.danger { color: #a32840; border-color: #e5bfd0; }
.btn.danger:hover { background: #fff2f4; border-color: #d88da2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { color: #59657a; background: #f0f2f6; border-color: var(--line); }
.icon-button { display: grid; place-items: center; min-width: 42px; min-height: 42px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 6px; }
.icon-button:hover { color: var(--action); background: var(--soft); }
.badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 8px; border-radius: 5px; background: #eef1f6; color: #495569; font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.badge.good { color: var(--green); background: var(--green-bg); }
.badge.warn { color: #765213; background: #fbf1dc; }
.badge.info { color: #2b53ae; background: #e8efff; }
.badge i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.note { color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--action); font-size: 13px; font-weight: 760; }
.site-footer { border-top: 1px solid var(--line); padding-block: 18px; color: var(--muted); font-size: 12px; }
.footer-inner { display: flex; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.status-region { font-size: 13px; color: var(--green); min-height: 21px; overflow-wrap: anywhere; }

.auth-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: min(700px, calc(100svh - 124px)); }
.auth-main { display: grid; place-items: center; min-width: 0; padding: 36px 28px; background: #fff; }
.auth-inner { width: min(100%, 370px); }
.auth-inner h1 { margin: 9px 0 4px; font-size: 33px; line-height: 1.28; }
.auth-inner form { display: grid; gap: 14px; margin-top: 22px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-size: 14px; font-weight: 700; }
.field input { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px 11px; background: #fff; border: 1px solid #aebbd0; border-radius: 7px; color: var(--ink); }
.field input:focus { outline: 2px solid #a7bff4; outline-offset: 1px; border-color: var(--brand); }
.field input::placeholder { color: #617087; }
.field small { color: var(--muted); font-size: 12px; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 49px; }
.input-wrap .icon-button { position: absolute; top: 1px; right: 1px; }
.auth-inner form .primary { width: 100%; margin-top: 3px; }
.auth-alt { margin: 9px 0 15px; font-size: 14px; color: var(--muted); }
.demo-link { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; }
.auth-aside { display: grid; place-items: center; padding: 36px; overflow: hidden; border-left: 1px solid #d4e0f7; background-color: #eaf1ff; background-image: linear-gradient(to right, #4c77df13 1px, transparent 1px), linear-gradient(to bottom, #4c77df13 1px, transparent 1px); background-size: 40px 40px; }
.auth-art { width: min(100%, 470px); }
.auth-art .art-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #b6c7ed; color: #38568d; font-size: 12px; font-weight: 700; }
.art-stage { display: grid; place-items: center; position: relative; isolation: isolate; min-height: 290px; }
.art-stage span { position: absolute; z-index: -1; color: #c8d8f7; font-weight: 900; font-size: 122px; user-select: none; }
.art-stage img { width: 210px; height: 280px; object-fit: contain; filter: drop-shadow(0 12px 13px #27498d38); }
.art-title { font-size: 27px; line-height: 1.3; font-weight: 800; }
.art-subtitle { margin-top: 7px; color: #3d567f; font-size: 14px; }

.settings-layout { display: grid; grid-template-columns: 223px minmax(0, 1fr); align-items: start; gap: 54px; padding-block: 36px 64px; min-height: calc(100svh - 126px); }
.settings-aside { position: sticky; top: 24px; align-self: start; }
.account-chip { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 9px 17px; border-bottom: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 37px; height: 37px; flex: none; border-radius: 7px; background: #e3edff; color: #2d57b8; font-size: 13px; font-weight: 800; }
.account-chip > span:last-child { min-width: 0; }
.account-chip strong, .account-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip small { color: var(--muted); font-size: 12px; }
.group-label { margin: 17px 0 6px 10px; color: var(--muted); font-size: 12px; font-weight: 650; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid transparent; border-radius: 7px; color: #414d64; font-size: 14px; font-weight: 640; }
.nav-link .icon { width: 17px; height: 17px; }
.nav-link:hover { background: #eef2f8; }
.nav-link[aria-current] { border-color: #d1dff9; background: #e9f0ff; color: #244da9; }
.nav-link .trail { margin-inline-start: auto; width: 15px; height: 15px; }
.sidebar-return { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 10px; }
.qq-code-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; min-width: 0; }
.qq-code-row code { display: block; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow-x: auto; padding: 12px; background: var(--soft); border-radius: 5px; }
.qq-code-row .btn { width: auto; flex: 0 0 auto; }
.qq-hint, .qq-status { overflow-wrap: anywhere; }
/* QQ 加好友二维码卡片：沿用 .connection 卡片的边框/圆角/配色 */
.qq-friend-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; margin: 16px 0; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qq-friend-qr img { display: block; width: 168px; height: auto; border-radius: 5px; }
.qq-friend-copy h3 { margin: 0 0 5px; font-size: 15px; }
@media (max-width: 480px) { .qq-code-row { flex-wrap: wrap; } .qq-code-row code { flex-basis: 100%; } .qq-friend-card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } }
.settings-main { min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: start; gap: 13px; border-bottom: 1px solid var(--line); padding-bottom: 19px; margin-bottom: 24px; }
.page-heading h1 { font-size: 31px; line-height: 1.35; margin: 3px 0 5px; }
.page-heading .badge { margin-top: 4px; }
.settings-main h2 { font-size: 17px; line-height: 1.4; }
.settings-main h3 { font-size: 14px; }
.section-title { margin: 25px 0 7px; }
.action-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.action-row > div { min-width: 0; }
.action-row strong, .action-row small { display: block; overflow-wrap: anywhere; }
.action-row small { color: var(--muted); font-size: 13px; }
.id-list { margin-top: 8px; }
.id-list > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.id-list dt { color: var(--muted); font-size: 14px; }
.id-list dd { overflow-wrap: anywhere; }
.row-leading { display: flex; align-items: center; gap: 12px; }
.row-leading .icon { color: var(--action); }
.row-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.connection { display: grid; grid-template-columns: 41px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.connection-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 7px; color: var(--action); background: var(--soft); }
.connection-icon.teal { color: var(--green); background: var(--green-bg); }
.task-steps { padding: 0 0 0 21px; margin: 8px 0 16px; color: var(--muted); font-size: 14px; }
.task-steps li { padding-left: 3px; margin-bottom: 5px; }
.code-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 11px 0; }
.code-box code { color: #23489c; background: var(--soft); padding: 7px 11px; border-radius: 5px; font-size: 15px; }
.client-list { margin-top: 4px; }
.pet-profile { display: flex; align-items: center; gap: 17px; margin-top: 15px; border-bottom: 1px solid var(--line); }
.pet-profile img { width: 73px; height: 90px; object-fit: contain; align-self: flex-end; }
.segment { display: inline-flex; gap: 4px; padding: 4px; background: #eef2f9; border: 1px solid var(--line); border-radius: 8px; }
.segment button { border: 1px solid transparent; border-radius: 5px; min-height: 35px; padding: 4px 12px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; }
.segment [aria-pressed="true"] { color: var(--action); border-color: #cbd8f0; background: #fff; }
.ability-list { margin-top: 12px; border-top: 1px solid var(--line); }
.ability-list .action-row { cursor: pointer; }
.ability-list .action-row:hover { background: #f4f7fd; }
.switch { appearance: none; width: 39px; height: 22px; flex: none; display: grid; align-items: center; padding: 2px; border: 1px solid #8797b1; border-radius: 12px; background: #e0e6ef; cursor: pointer; margin: 0 2px 0 0; }
.switch::before { content: ""; width: 16px; height: 16px; border: 1px solid #a8b5c9; border-radius: 50%; background: #fff; }
.switch:checked { border-color: var(--action); background: var(--action); }
.switch:checked::before { transform: translateX(17px); border-color: #fff; }
.workbench-preview { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: center; }
.workbench-footer { padding: 11px 9px 6px; background: #f6f7f8; border: 1px solid #dce1e8; border-radius: 8px; }
.workbench-footer .account-chip { padding: 4px 4px 10px; }
.workbench-footer .group-label { margin-top: 9px; }
.workbench-footer .nav-link { min-height: 36px; }
.workbench-footer .nav-link + .nav-link { margin-top: 1px; }
.workbench-preview p + p { margin-top: 8px; }
dialog { width: min(100% - 32px, 400px); padding: 21px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 16px 60px #18274429; color: var(--ink); }
dialog::backdrop { background: #17274665; }
dialog h2 { font-size: 19px; }
dialog p { margin-top: 8px; color: var(--muted); font-size: 14px; }
dialog form { display: flex; justify-content: end; gap: 8px; margin-top: 20px; }

@media (max-width: 880px) {
  .settings-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 27px; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 56px; }
  .brand { font-size: 14px; gap: 7px; }
  .brand img { width: 25px; height: 25px; }
  .brand-divider, .sub-brand { display: none; }
  .header-actions .btn { min-height: 35px; font-size: 12px; padding-inline: 9px; }
  .auth-grid { grid-template-columns: 1fr; min-height: calc(100svh - 113px); }
  .auth-main { padding: 29px 19px 34px; }
  .auth-aside { display: none; }
  .auth-inner h1 { font-size: 28px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 21px; padding-block: 16px 38px; }
  .settings-aside { position: static; }
  .settings-aside .account-chip, .settings-aside .group-label, .sidebar-return { display: none; }
  .settings-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .nav-link { gap: 6px; padding: 6px 7px; }
  .page-heading { margin-bottom: 17px; padding-bottom: 13px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 14px; }
  .workbench-preview { grid-template-columns: minmax(0, 300px); gap: 18px; }
}
@media (max-width: 365px) {
  .connection { grid-template-columns: 35px minmax(0, 1fr) auto; padding-inline: 8px; gap: 8px; }
  .connection-icon { width: 35px; height: 35px; }
  .row-leading { gap: 8px; }
  .action-row .btn { font-size: 12px; padding-inline: 8px; }
}

/* 桌宠绑定沿用账号模板；密钥只在独立代码区横向滚动。 */
.pet-binding { min-width: 0; }
.pet-field { min-width: 0; margin-block: 18px; }
.pet-field label { display: block; margin-bottom: 8px; }
.pet-code-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pet-field code { display: block; min-width: 0; white-space: nowrap; overflow-x: auto; word-break: normal; overflow-wrap: normal; padding: 12px; background: var(--surface-soft, #f3f6fc); border-radius: 8px; }
.pet-code-row code { flex: 1 1 0; }
.pet-binding button, .pet-table button { width: auto; white-space: nowrap; }
.pet-code-row button { flex: 0 0 auto; }
.pet-hint, .pet-status { line-height: 1.8; }
.pet-table-wrap { max-width: 100%; overflow-x: auto; }
.pet-table { width: 100%; border-collapse: collapse; text-align: left; }
.pet-table td, .pet-table th { padding: 12px 8px; border-bottom: 1px solid #e3e8ec; }
@media (max-width: 600px) {
  .pet-code-row { flex-wrap: wrap; }
  .pet-code-row code { flex-basis: 100%; }
}
