:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #282825;
  background: #fcfbf9;
  font-synthesis: none;
  --red: #ae302c;
  --muted: #8b8b83;
  --line: #e9e7e2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
  background: transparent;
  color: inherit;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #ce8175;
  outline-offset: 4px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #be6c59;
  outline-offset: 2px;
}
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: #f3f2ee;
  border-right: 1px solid var(--line);
  padding: 32px 20px 20px;
  display: flex;
  flex-direction: column;
  z-index: 15;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 32px;
}
.brand img {
  width: 40px;
  height: 40px;
}
.brand span {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
}
.brand b {
  font-weight: 500;
  letter-spacing: 0;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #8b8b83;
  margin-top: 5px;
}
.new-chat {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid #dedbd4;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  box-shadow: 0 2px 3px #23221b03;
}
.new-chat > span {
  font-size: 22px;
  color: var(--red);
}
kbd {
  margin-left: auto;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 4px;
  color: #aaa;
}
.history-heading {
  font-size: 12px;
  color: var(--muted);
  padding: 30px 11px 12px;
  display: flex;
  justify-content: space-between;
}
#history {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.history-item {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 3px;
}
.history-item:hover {
  background: #eae8e2;
}
.history-item.active {
  background: #e9e6df;
  color: var(--red);
}
.history-item a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.history-item button {
  font-size: 20px;
  padding: 0 4px;
}
.history-empty {
  font-size: 13px;
  line-height: 1.8;
  padding: 10px;
}
.sidebar-bottom {
  padding-top: 20px;
}
.subtle-link {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 12px;
}
.account {
  border-top: 1px solid var(--line);
  padding: 17px 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #dcd7ce;
  border-radius: 50%;
  background: #ebe8e1;
}
.account small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.account > button {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.workspace {
  margin-left: 260px;
  min-height: 100dvh;
}
header {
  height: 83px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid #f0eeea;
}
.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.model-label {
  font-weight: 600;
  font-size: 17px;
}
.model-label span {
  font-weight: 400;
  font-size: 11px;
  margin-left: 10px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #83837c;
}
.free-badge {
  font-size: 12px;
  color: #73756b;
  display: flex;
  align-items: center;
  gap: 7px;
}
.free-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #779475;
}
#header-auth {
  font-size: 13px;
}
#menu {
  display: none;
}
#page {
  min-height: calc(100dvh - 83px);
}
.welcome {
  max-width: 800px;
  margin: auto;
  padding: clamp(55px, 11vh, 125px) 30px 20px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: #ae8270;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow:before {
  content: "";
  height: 1px;
  width: 28px;
  background: #b98b76;
}
h1 {
  font-family: "Songti SC", "SimSun", serif;
  font-weight: 500;
  font-size: 42px;
  letter-spacing: 2px;
  line-height: 1.5;
  margin: 17px 0 10px;
}
h1 em {
  font-style: normal;
  color: var(--red);
}
.intro {
  color: #909087;
  font-size: 14px;
  line-height: 1.8;
}
.composer {
  border: 1px solid #dedbd3;
  background: white;
  border-radius: 18px;
  padding: 18px 20px 12px;
  box-shadow: 0 6px 28px #30271805;
  margin-top: 35px;
}
.composer textarea {
  width: 100%;
  min-height: 84px;
  max-height: 230px;
  resize: vertical;
  border: 0;
  outline: none;
  font-size: 16px;
  line-height: 1.7;
  background: transparent;
}
.composer textarea::placeholder {
  color: #afafa6;
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
}
.mode-chip {
  border: 1px solid #e7dfd5;
  background: #faf7f2;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  color: #94704f;
}
.send {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  color: white;
  background: var(--red);
  font-size: 22px;
}
.hint {
  text-align: center;
  color: #a5a59c;
  font-size: 11px;
  line-height: 1.7;
  margin: 12px 0 0;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-top: 38px;
}
.suggestion {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  background: #ffffff60;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.suggestion:hover {
  transform: translateY(-3px);
  border-color: #cbb5a8;
}
.suggestion .icon {
  font-size: 20px;
  color: #b67f5e;
  display: block;
  margin-bottom: 22px;
}
.suggestion strong {
  font-size: 14px;
  font-weight: 500;
  display: block;
}
.suggestion small {
  font-size: 12px;
  color: #99988f;
  display: block;
  margin-top: 8px;
}
.welcome-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #aba69b;
  font-size: 10px;
  letter-spacing: 1px;
  margin: 55px 0 10px;
}
.welcome-footer:before,
.welcome-footer:after {
  content: "";
  width: 25px;
  height: 1px;
  background: #ddd7cd;
}
.chat-view {
  max-width: 870px;
  margin: auto;
  padding: 24px 35px;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 83px);
}
.chat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.chat-top h2 {
  font-weight: 500;
  font-size: 16px;
  flex: 1;
  margin: 0;
  overflow-wrap: anywhere;
}
.text-button {
  font-size: 12px;
  color: var(--muted);
  padding: 6px;
}
.danger {
  color: #ad3934;
}
.messages {
  flex: 1;
}
.message {
  margin: 22px 0;
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.message.user {
  justify-content: flex-end;
}
.message-logo {
  width: 29px;
  height: 29px;
  border-radius: 8px;
}
.bubble {
  max-width: 90%;
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user .bubble {
  background: #f0eee8;
  border-radius: 13px 13px 3px 13px;
  padding: 13px 18px;
}
.message.assistant .bubble {
  padding: 0 0 12px;
}
.message-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.copy {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.chat-composer {
  position: sticky;
  bottom: 0;
  background: #fcfbf9;
  padding: 5px 0 14px;
  margin-top: 20px;
}
.chat-composer .composer {
  margin: 0;
}
.chat-composer textarea {
  min-height: 55px;
}
.loading {
  padding: 70px;
  text-align: center;
  color: var(--muted);
}
.notice {
  border-radius: 8px;
  background: #f5ede2;
  color: #997347;
  padding: 11px 14px;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 18px;
}
.auth-wrap {
  max-width: 430px;
  padding: 65px 24px;
  margin: auto;
}
.auth-wrap h1 {
  font-size: 32px;
}
.auth-wrap p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.auth-form {
  margin-top: 30px;
  display: grid;
  gap: 18px;
}
label {
  display: grid;
  gap: 8px;
  font-size: 13px;
}
input,
select {
  width: 100%;
  border: 1px solid #dfdbd3;
  background: white;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 14px;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}
.check {
  display: flex;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.7;
  gap: 8px;
  color: #8a887f;
}
.check a {
  color: var(--red);
}
.primary {
  background: var(--red);
  color: white;
  border-radius: 9px;
  padding: 12px 18px;
  font-size: 14px;
}
.secondary {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 17px;
  background: white;
  font-size: 14px;
}
.auth-link {
  text-align: center;
  font-size: 13px;
  margin-top: 24px;
}
.auth-link a {
  color: var(--red);
}
.document,
.admin {
  max-width: 1000px;
  padding: 40px;
  margin: auto;
}
.document {
  max-width: 760px;
  line-height: 1.9;
  font-size: 15px;
}
.document h1 {
  font-size: 32px;
}
.document h2 {
  font-size: 18px;
  margin-top: 30px;
}
.document p {
  color: #77766e;
}
.back {
  font-size: 13px;
  color: var(--red);
}
.admin h1 {
  font-size: 32px;
}
.admin-subtitle {
  font-size: 14px;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 26px 0;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.stat small {
  color: var(--muted);
  font-size: 12px;
}
.stat b {
  display: block;
  font-size: 30px;
  font-weight: 500;
  margin-top: 12px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 24px;
  margin-bottom: 20px;
}
.panel h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 20px;
}
.invite-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.invite-form label {
  max-width: 160px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
th {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}
th,
td {
  padding: 14px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tag {
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 11px;
  background: #f0f3ec;
  color: #73816a;
}
.tag.off {
  background: #f2efeb;
  color: #a49b8d;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 20px;
  font-size: 13px;
}
.code-list {
  width: 100%;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  font-size: 13px;
  resize: vertical;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: calc(50% + 130px);
  transform: translateX(-50%);
  background: #34342e;
  color: white;
  padding: 13px 22px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 90vw;
  z-index: 100;
  box-shadow: 0 5px 25px #0002;
}
#progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  background: var(--red);
  z-index: 100;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(450px, 90vw);
  padding: 28px;
  color: #333;
  background: #fcfbf9;
}
dialog::backdrop {
  background: #24221e55;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 20px;
  font-weight: 500;
}
dialog p {
  font-size: 14px;
  line-height: 1.7;
  color: #868178;
}
dialog .close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 24px;
  color: #888;
}
dialog .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
.muted {
  color: var(--muted);
}
.error-box {
  text-align: center;
  padding: 60px 20px;
  line-height: 2;
}
.retry {
  font-size: 12px;
  color: var(--red);
  display: block;
  margin-top: 8px;
}
.admin-config {
  font-size: 13px;
  line-height: 2;
  overflow-wrap: anywhere;
}
.pending {
  color: #9e8672;
  font-size: 13px;
  padding: 16px 0;
}
.empty-chat {
  text-align: center;
  padding: 50px 0;
  color: #999;
  line-height: 2;
  font-size: 14px;
}
@media (max-width: 1000px) {
  #sidebar {
    width: 225px;
  }
  .workspace {
    margin-left: 225px;
  }
  header {
    padding: 0 25px;
  }
  .welcome {
    padding-left: 25px;
    padding-right: 25px;
  }
  h1 {
    font-size: 36px;
  }
  #toast {
    left: calc(50% + 112px);
  }
}
@media (max-width: 720px) {
  #sidebar {
    transform: translateX(-100%);
    width: 260px;
    transition: transform 0.2s;
    box-shadow: 10px 0 30px #0001;
  }
  body.sidebar-open #sidebar {
    transform: translateX(0);
  }
  .workspace {
    margin-left: 0;
  }
  header {
    height: 67px;
    padding: 0 17px;
  }
  #menu {
    display: block;
  }
  .header-left {
    gap: 10px;
  }
  .header-right {
    gap: 10px;
  }
  .free-badge {
    display: none;
  }
  .model-label span {
    font-size: 10px;
    margin-left: 5px;
  }
  .welcome {
    padding: 65px 21px 20px;
  }
  h1 {
    font-size: 31px;
    letter-spacing: 1px;
  }
  .intro {
    font-size: 13px;
  }
  .suggestions {
    gap: 8px;
    margin-top: 25px;
  }
  .suggestion {
    padding: 14px 10px;
  }
  .suggestion strong {
    font-size: 12px;
  }
  .suggestion small {
    font-size: 10px;
    line-height: 1.6;
  }
  .suggestion .icon {
    margin-bottom: 18px;
  }
  .composer {
    margin-top: 28px;
    padding: 15px;
  }
  .welcome-footer {
    font-size: 8px;
    margin-top: 40px;
    letter-spacing: 0;
  }
  .chat-view {
    padding: 20px 18px;
    min-height: calc(100dvh - 67px);
  }
  .chat-top {
    gap: 2px;
  }
  .bubble {
    font-size: 14px;
  }
  .admin,
  .document {
    padding: 25px 18px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 14px;
  }
  .stat b {
    font-size: 24px;
  }
  .panel {
    padding: 17px;
  }
  .invite-form {
    flex-wrap: wrap;
  }
  .invite-form label {
    flex: 1;
  }
  .invite-form .primary {
    width: 100%;
  }
  #toast {
    left: 50%;
  }
  .auth-wrap {
    padding-top: 45px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.ui-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}
.mode-chip,
.pending,
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.send .ui-icon {
  width: 21px;
  height: 21px;
}
.suggestion .ui-icon {
  width: 24px;
  height: 24px;
}
.history-item > .ui-icon {
  width: 15px;
  height: 15px;
}
.new-chat > .ui-icon {
  color: var(--red);
}
.primary > .ui-icon {
  margin-right: 6px;
}
.mode-select {
  font-size: 12px;
  width: auto;
  max-width: 220px;
  padding: 7px 10px;
  background: #faf7f2;
  color: #8c644d;
  border: 1px solid #e7dfd5;
}
.mode-select:disabled {
  opacity: 1;
  cursor: default;
}
.vision-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 10px 0;
  font-size: 13px;
}
.vision-nav small {
  display: block;
  color: #999;
  font-size: 11px;
  margin-top: 5px;
}
.vision form > label > textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.7;
}
.image-options {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  margin-top: 20px;
  justify-content: space-between;
}
.image-options input {
  font-size: 12px;
}
.gallery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gallery-heading h2 {
  font-size: 18px;
  font-weight: 500;
}
.image-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.image-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.image-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.image-card p {
  padding: 0 15px;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.image-actions {
  padding: 12px 15px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.image-placeholder {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 12px;
  background: #f0ede6;
  color: #9b8b73;
  text-align: center;
  padding: 15px;
}
@media (max-width: 720px) {
  .image-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .image-options {
    display: block;
  }
  .image-options .primary {
    width: 100%;
    margin-top: 16px;
  }
}
[hidden] {
  display: none !important;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin: 25px 0;
}
.admin-tabs button {
  font-size: 14px;
  padding: 12px 15px;
  color: #888;
  border-bottom: 2px solid transparent;
}
.admin-tabs button.active {
  color: var(--red);
  border-color: var(--red);
}
