:root {
  color-scheme: dark;
  --bg: #0d1422;
  --surface: #151f31;
  --raised: #1b2940;
  --line: #35445f;
  --text: #edf3ff;
  --muted: #b5c2d9;
  --accent: #95e6df;
  --ink: #122d33;
  font: 1rem/1.55 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.16; }
h2 { font-size: 1.17rem; }
h3 { font-size: 1.02rem; }
.muted { color: var(--muted); }
.topbar { border-bottom: 1px solid var(--line); background: #111b2b; }
.topbar-inner, .content { width: min(100% - 2.5rem, 69rem); margin-inline: auto; }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  min-height: 4.6rem; padding: .55rem 0;
}
.brand, .account { display: flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 650; }
.brand-mark {
  display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem;
  background: var(--accent); color: var(--ink); border-radius: .65rem;
}
.role { font-size: .82rem; padding: .18rem .55rem; border-radius: .35rem; background: var(--raised); color: var(--muted); }
.content { margin-block: clamp(2rem, 6vw, 4rem); }
.page-title { padding-bottom: 1.45rem; }
.page-title p { margin-top: .65rem; }
.back { display: inline-block; margin-bottom: .85rem; }
.section-nav {
  display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 1.35rem;
  padding: 0 0 1.25rem; border-bottom: 1px solid var(--line);
}
.section-nav a {
  color: var(--text); background: var(--surface); border: 1px solid var(--line);
  padding: .35rem .8rem; border-radius: .5rem; font-size: .91rem;
}
.section-nav a:hover { border-color: var(--accent); }
.group { margin-bottom: 1.7rem; scroll-margin-top: 1rem; }
.group h2 { margin-bottom: .65rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.service, .api, .login-card, .settings-panel, .empty-state {
  border: 1px solid var(--line); border-radius: .85rem; background: var(--surface);
}
.service {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .85rem;
  min-height: 5.7rem; padding: .9rem 1rem; color: var(--text);
}
.service:hover { border-color: #79a5b5; background: var(--raised); }
.app-mark {
  display: grid; place-items: center; width: 2.55rem; aspect-ratio: 1; border-radius: .65rem;
  background: #304261; color: #e1ecff; font-size: .89rem; font-weight: 750;
}
.mark-chat, .mark-nextchat { background: #3b365b; color: #ede1ff; }
.mark-browser1, .mark-browser2 { background: #204b55; color: #aef1eb; }
.mark-n8n { background: #503a4a; color: #ffd4e5; }
.mark-cloud { background: #334764; color: #d3e6ff; }
.card-copy { display: grid; gap: .18rem; }
.card-copy > span { color: var(--muted); font-size: .88rem; }
.card-arrow { color: var(--accent); }
.api, .settings-panel, .empty-state { padding: 1rem 1.15rem; }
.api-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: .6rem; }
.api code { color: var(--accent); overflow-wrap: anywhere; }
.api-token { margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--line); }
#api-token-value:not([hidden]) {
  display: block; margin-top: .6rem; padding: .6rem .7rem;
  border: 1px solid var(--line); border-radius: .45rem; background: #101929;
  user-select: all;
}
.model-grid { margin-bottom: .85rem; }
.model-grid h2 + p { margin-top: .5rem; }
.model-open { margin-top: .85rem; }
.model-panel label { display: block; font-weight: 650; margin-top: .75rem; }
.model-panel + .model-panel { margin-top: .85rem; }
.model-panel select {
  flex: 1 1 15rem; min-width: 0; padding: .65rem .75rem;
  border: 1px solid var(--line); border-radius: .55rem;
  background: #101929; color: var(--text); font: inherit;
}
.button, .quiet, .password-toggle {
  min-height: 2.45rem; border-radius: .55rem; padding: .5rem .85rem; display: inline-block;
}
.button { border: 1px solid var(--accent); background: var(--accent); color: var(--ink); font-weight: 750; }
.button:hover { background: #c3f9f3; }
.quiet, .password-toggle { border: 1px solid var(--line); background: transparent; color: var(--text); }
.quiet:hover, .password-toggle:hover { border-color: var(--accent); }
.entry {
  display: grid; place-items: center; padding: clamp(1rem, 6vh, 4rem) 1rem;
  background: radial-gradient(ellipse at 28% 12%, #20384d, var(--bg) 60%);
}
.login-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.03fr);
  width: min(100%, 57rem); min-height: 29rem; border: 1px solid var(--line);
  border-radius: 1.15rem; overflow: hidden; box-shadow: 0 22px 80px #0307116e;
}
.login-aside {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
  padding: clamp(1.2rem, 4vw, 2.5rem);
  background: linear-gradient(145deg, #1d3854, #172c40 48%, #182c3a);
}
.login-context p { color: var(--muted); }
.login-context h2 { font-size: clamp(2rem, 5vw, 3.35rem); margin-block: .25rem .4rem; line-height: 1.15; }
.login-card { width: min(100%, 29rem); padding: clamp(1.25rem, 4vw, 2.5rem); }
.login-layout .login-card {
  width: 100%; border: 0; border-radius: 0; display: flex; flex-direction: column; justify-content: center;
}
.login-card h1 { font-size: 1.85rem; margin-bottom: .45rem; }
.login-card form { display: grid; gap: 1rem; margin-top: 1.35rem; }
.login-card label { display: block; margin-bottom: .3rem; font-weight: 650; }
.login-card form .button { display: flex; justify-content: space-between; align-items: center; }
input[type=text], input[type=password] {
  min-width: 0; width: 100%; background: #101929; border: 1px solid var(--line);
  border-radius: .55rem; color: var(--text); padding: .67rem .75rem;
}
.password-field { display: flex; gap: .4rem; }
.password-toggle { white-space: nowrap; }
.error { padding: .65rem .85rem; border-radius: .5rem; background: #492f40; color: #ffe0e7; }
.entry a.button { margin-block: .95rem; }
.connection { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin-top: .6rem; }
.connection dd { margin: 0; overflow-wrap: anywhere; }
.connection dt { color: var(--muted); }
.settings-panel { max-width: 43rem; }
.settings-panel fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.settings-panel legend { font-weight: 700; margin-bottom: .35rem; }
.check {
  display: flex; align-items: center; gap: .8rem; padding: .75rem .25rem;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.check:hover { background: var(--raised); }
.check input { accent-color: var(--accent); width: 1.15rem; height: 1.15rem; flex: none; }
.settings-panel .button { margin-top: .95rem; }
.feedback { color: var(--accent); margin-top: .55rem; }
.feedback:empty { display: none; }
.website-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .65rem; }
.website-heading h2 { margin: 0; }
.website-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  border: 1px solid var(--line); border-radius: .85rem; background: var(--surface);
}
.website-card .service { border: 0; }
.website-card .card-copy { overflow-wrap: anywhere; }
.website-edit { margin: 0 .7rem; padding: .45rem .6rem; border-radius: .45rem; }
.website-edit:hover { background: var(--raised); }
.website-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.danger { color: #ffc8d1; }
.danger:hover { border-color: #ee93a5; }
.danger-button { color: #fff4f6; background: #8f3149; border-color: #ee93a5; }
.danger-button:hover { background: #a43d57; }
.website-form { display: grid; gap: .65rem; }
.website-form .button { margin-top: 0; justify-self: start; }
.website-form label { font-weight: 650; }
.website-form select {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .55rem;
  font: inherit; color: var(--text); background: #101929;
}
.people-list { margin: .6rem 0 0; padding: 0; list-style: none; }
.person-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .75rem 0; border-top: 1px solid var(--line);
}
.person-row strong, .person-apps { overflow-wrap: anywhere; }
.person-row a { flex: none; }
.person-apps { color: var(--muted); font-size: .86rem; margin-top: .2rem; }
@media (max-width: 640px) {
  .login-layout { width: min(100%, 29rem); min-height: auto; grid-template-columns: 1fr; }
  .login-context { display: none; }
  .entry { place-items: start center; }
  .grid { grid-template-columns: 1fr; }
  .topbar-inner, .content { width: calc(100% - 1.5rem); }
  .account { font-size: .86rem; gap: .4rem; }
  .account .role { display: none; }
  .account .quiet { padding-inline: .55rem; }
}
