:root {
  color-scheme: light;
  --ink: #203b34;
  --muted: #76827a;
  --line: #dfe4db;
  --paper: #f5f5ed;
  --white: #fffefa;
  --green: #27724f;
  --nav: #163d36;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button,
a,
input,
textarea,
select {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #4baf78;
}
button {
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  filter: brightness(0.97);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2 {
  font-family: "Iowan Old Style", "Songti SC", serif;
  font-weight: 500;
}
h1 {
  font-size: 38px;
  letter-spacing: -1px;
}
h2 {
  font-size: 26px;
}
p {
  line-height: 1.7;
}
small,
.muted {
  color: var(--muted);
}
.boot {
  padding: 80px;
  font:
    44px Georgia,
    serif;
}
.boot span {
  display: block;
  font: 14px sans-serif;
  margin-top: 20px;
}
.shell {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  height: 100dvh;
}
.rail {
  background: var(--nav);
  color: #d1ded4;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 30px 10px 18px;
  gap: 9px;
}
.logo {
  font:
    28px Georgia,
    serif;
  color: #fff8dc;
  letter-spacing: -2px;
  margin-bottom: 38px;
}
.nav {
  background: none;
  color: #b6cac0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 8px;
  width: 72px;
  border-radius: 10px;
  font-size: 11px;
}
.nav b {
  font-size: 23px;
  line-height: 24px;
  font-weight: 400;
}
.nav.active {
  background: #2e5347;
  color: #f1f5d1;
}
.rail-bottom {
  margin-top: auto;
}
.main {
  min-width: 0;
  overflow: auto;
}
.page {
  padding: 48px clamp(24px, 4vw, 68px);
  max-width: 1500px;
  margin: auto;
}
.eyebrow {
  letter-spacing: 2.5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}
.page-head p {
  margin-top: 10px;
  color: var(--muted);
}
.btn {
  padding: 11px 18px;
  border-radius: 7px;
  font-weight: 600;
  background: #e9ede3;
  color: var(--ink);
  white-space: nowrap;
}
.btn.primary {
  background: var(--green);
  color: white;
}
.btn.danger {
  color: #ad3a36;
  background: #fff0eb;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.card h3 {
  font-size: 19px;
  font-weight: 600;
}
.card .actions {
  margin-top: auto;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}
.badge {
  padding: 5px 9px;
  border-radius: 5px;
  background: #edf1e8;
  color: #537360;
  font-size: 11px;
  white-space: nowrap;
}
.badge.off {
  color: #887d70;
  background: #f0ece4;
}
.avatar {
  height: 38px;
  width: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #e5ecd9;
  color: #4b6643;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.empty {
  padding: 70px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #d4ddcf;
  border-radius: 12px;
}
.empty h3 {
  color: var(--ink);
  font-size: 20px;
  margin-bottom: 10px;
}
.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.channels {
  border-right: 1px solid var(--line);
  padding: 34px 18px;
  background: #ecefe5;
  overflow: auto;
}
.channels-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 23px;
}
.channels-head h2 {
  font-size: 23px;
}
.icon-btn {
  background: transparent;
  color: var(--ink);
  font-size: 23px;
  padding: 2px 8px;
  border-radius: 6px;
}
.channel-item {
  width: 100%;
  text-align: left;
  background: transparent;
  padding: 16px 13px;
  border-radius: 9px;
  margin: 4px 0;
  color: var(--ink);
}
.channel-item.selected {
  background: #fffefa;
  box-shadow: 0 2px 7px #1b412a08;
}
.channel-name {
  font-weight: 600;
  font-size: 14px;
}
.channel-name span {
  color: #879582;
  margin-right: 9px;
}
.channel-item small {
  display: block;
  margin-top: 7px;
  padding-left: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-info {
  font-size: 11px;
  line-height: 1.8;
  color: #839080;
  padding: 20px 10px;
}
.chat {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 27px 36px;
  gap: 16px;
  background: #f9f9f1;
}
.chat-header h2 {
  font-size: 27px;
}
.chat-header p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.connection {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: var(--muted);
}
.dot {
  width: 6px;
  height: 6px;
  background: #b3b5a4;
  border-radius: 50%;
}
.connection.live .dot {
  background: #419765;
  box-shadow: 0 0 0 3px #41976513;
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 28px clamp(20px, 4vw, 64px);
  scroll-behavior: smooth;
}
.message {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 25px;
  max-width: 920px;
}
.message .avatar {
  margin-top: 2px;
}
.message-body {
  min-width: 0;
  flex: 1;
}
.message-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.message-meta strong {
  font-size: 13px;
}
.message-meta time {
  color: #93998c;
  font-size: 10px;
}
.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.85;
  color: #36483d;
  background: #fffefa;
  border: 1px solid #e7e9df;
  border-radius: 0 10px 10px;
  padding: 14px 18px;
  width: fit-content;
  max-width: 100%;
}
.message.self .message-text {
  background: #edf2e4;
  border-color: #dce7ce;
}
.message.self .avatar {
  background: #cedcbd;
}
.load-older {
  display: block;
  margin: 0 auto 25px;
  background: transparent;
  color: var(--green);
  font-size: 12px;
}
.composer-area {
  padding: 15px clamp(20px, 4vw, 64px) 24px;
}
.composer {
  border: 1px solid #d6decd;
  background: #fffefa;
  border-radius: 11px;
  padding: 14px;
  box-shadow: 0 5px 25px #24452904;
}
.composer textarea {
  border: none;
  background: none;
  resize: vertical;
  min-height: 55px;
  max-height: 200px;
  width: 100%;
  padding: 0;
  outline: none;
  line-height: 1.7;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
}
.composer-foot small {
  font-size: 10px;
}
.chat-empty {
  margin: auto;
  max-width: 420px;
  text-align: center;
  padding: 32px;
}
.chat-empty .orb {
  font:
    78px Georgia,
    serif;
  letter-spacing: -8px;
  color: #b6c8a5;
  margin-bottom: 20px;
}
.chat-empty p {
  color: var(--muted);
  margin: 15px 0 26px;
}
.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-art {
  background: var(--nav);
  color: #f3f1da;
  padding: 60px 12%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-art .logo {
  margin: 0;
}
.login-art h1 {
  font-size: clamp(44px, 5vw, 74px);
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.login-art p {
  color: #a9c1b3;
  margin-top: 25px;
}
.orbit {
  width: 420px;
  height: 420px;
  border: 1px solid #4e7060;
  border-radius: 50%;
  position: absolute;
  right: -160px;
  top: 18%;
  box-shadow:
    0 0 0 70px #385c441a,
    0 0 0 140px #385c4414;
}
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form {
  width: 360px;
}
.login-form h2 {
  font-size: 34px;
  margin-bottom: 10px;
}
.login-form > p {
  color: var(--muted);
  margin-bottom: 32px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.field label,
.field-label {
  font-size: 12px;
  font-weight: 600;
}
.field input,
.field textarea,
.field select {
  border: 1px solid #d6ddcf;
  border-radius: 6px;
  padding: 11px 12px;
  background: #fffefa;
  color: var(--ink);
  width: 100%;
}
.field textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.7;
}
.field .code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  min-height: 220px;
}
.full {
  width: 100%;
  margin-top: 12px;
}
.form-error {
  color: #b43c35;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 12px;
  min-height: 19px;
}
.login-foot {
  font-size: 11px;
  color: #92998b;
  margin-top: 26px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: 13px;
}
.check input {
  accent-color: var(--green);
}
dialog {
  border: 1px solid var(--line);
  padding: 0;
  border-radius: 15px;
  width: min(600px, calc(100vw - 30px));
  max-height: 90dvh;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 100px #163d3625;
}
dialog::backdrop {
  background: #102c2866;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}
.dialog-body {
  padding: 8px 28px 28px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.token {
  overflow-wrap: anywhere;
  padding: 18px;
  border: 1px solid #cbd9bb;
  background: #eaf0df;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  margin: 20px 0;
}
.help {
  background: #e9eee0;
  border-radius: 9px;
  padding: 20px;
  font-size: 12px;
  line-height: 1.9;
}
.help code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: block;
  background: #163d36;
  color: #e7eddc;
  padding: 15px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 11px;
}
.help a {
  color: var(--green);
}
.settings-stack {
  max-width: 800px;
  display: grid;
  gap: 24px;
}
.table-wrap {
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th,
td {
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
td {
  font-size: 13px;
}
tr:last-child td {
  border-bottom: 0;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--nav);
  color: white;
  font-size: 13px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.visible {
  opacity: 1;
}
.skill-list {
  max-height: 150px;
  overflow: auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.section-note {
  margin-bottom: 25px;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .chat-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .chat-header {
    padding: 24px;
  }
  .composer-foot small {
    max-width: 180px;
  }
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}
@media (max-width: 700px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 66px;
  }
  .rail {
    grid-row: 2;
    flex-direction: row;
    padding: 4px 10px;
    justify-content: space-around;
    gap: 0;
  }
  .rail .logo {
    display: none;
  }
  .nav {
    flex-direction: column;
    gap: 3px;
    padding: 7px;
    width: 65px;
    font-size: 10px;
  }
  .nav b {
    font-size: 20px;
  }
  .rail-bottom {
    margin: 0;
  }
  .main {
    grid-row: 1;
    grid-column: 1;
  }
  .page {
    padding: 28px 20px;
  }
  .page-head {
    gap: 12px;
    margin-bottom: 24px;
  }
  .page-head h1 {
    font-size: 31px;
  }
  .page-head p {
    font-size: 12px;
  }
  .page-head .btn {
    padding: 10px 13px;
  }
  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .channels {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .channels-head {
    padding: 0;
    flex-shrink: 0;
  }
  .channels-head h2 {
    display: none;
  }
  .channel-item {
    min-width: 100px;
    width: auto;
    flex-shrink: 0;
    padding: 10px;
  }
  .channel-item small,
  .channel-info {
    display: none;
  }
  .channel-name {
    font-size: 12px;
  }
  .chat-header {
    padding: 16px 20px;
  }
  .chat-header h2 {
    font-size: 23px;
  }
  .chat-header p {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .messages {
    padding: 22px 18px;
  }
  .message {
    gap: 9px;
  }
  .message .avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 12px;
  }
  .message-text {
    padding: 11px 13px;
    font-size: 13px;
  }
  .composer-area {
    padding: 8px 15px 15px;
  }
  .composer-foot small {
    font-size: 9px;
    max-width: 170px;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-art {
    min-height: 230px;
    padding: 28px;
  }
  .login-art h1 {
    font-size: 35px;
    margin-top: 25px;
  }
  .login-art p,
  .login-art footer {
    display: none;
  }
  .login-form-wrap {
    padding: 35px 28px;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .dialog-head {
    padding: 22px 20px 0;
  }
  .dialog-body {
    padding: 8px 20px 22px;
  }
  .connection {
    font-size: 10px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.login-art .login-eyebrow {
  color: #bbce9d;
}
.login-footer-label {
  color: #91ad9c;
}
.help-spacing {
  margin-top: 28px;
}
.compact-head {
  margin-bottom: 16px;
}
.dialog-intro {
  margin-top: 18px;
}
.token-note {
  margin-top: 16px;
}
.chat-eyebrow {
  margin-bottom: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
