:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #282825;
  background: #fcfbf9;
  font-synthesis: none;
  --red: #ae302c;
  --muted: #8b8b83;
  --line: #e9e7e2;
}
/* 新版工作台：加载反馈、账户设置、表格与手机屏幕的布局。 */
#global-loading {
  position: fixed;
  z-index: 1100;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 30px;
  background: #fff;
  color: #444;
  box-shadow: 0 5px 28px #0002;
  font-size: 13px;
  pointer-events: none;
}
#global-loading[hidden] {
  display: none;
}
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-top-color: #ae302c;
  border-radius: 50%;
  animation: cheetoo-spin 0.8s linear infinite;
}
@keyframes cheetoo-spin {
  to {
    transform: rotate(360deg);
  }
}
.thinking-dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 10px;
}
.thinking-dots i {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  animation: cheetoo-dot 1.2s ease-in-out infinite;
}
.thinking-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes cheetoo-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}
.page-loading {
  padding: 80px;
  text-align: center;
}
.page-loading .loading-spinner {
  margin-right: 12px;
}
.platform-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 12px 22px;
  font-size: 12px;
  border-top: 1px solid var(--line);
}
.platform-nav label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.platform-nav select {
  max-width: 120px;
}
.platform-nav a {
  color: var(--muted);
  text-decoration: none;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.settings-grid label,
form[data-platform-form] label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 13px;
}
form[data-platform-form] input,
form[data-platform-form] select {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list-row p {
  margin: 5px 0;
  font-size: 12px;
  color: var(--muted);
}
.vertical-actions {
  display: grid;
  gap: 6px;
}
.vertical-actions button {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 12px;
  cursor: pointer;
  border-radius: 7px;
}
.vertical-actions button:hover {
  background: #f2f1ef;
}
.share-selection {
  overflow: auto;
  max-height: 55vh;
  margin: 16px 0;
}
form .share-option {
  display: flex;
  flex-direction: row;
  align-items: start;
  gap: 15px;
  padding: 15px;
  background: #f7f7f7;
  border-radius: 8px;
}
form .share-option input,
form .check input {
  width: auto;
}
.share-option span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.share-option strong {
  display: block;
  margin-bottom: 5px;
}
.shared-message {
  border-bottom: 1px solid var(--line);
  margin: 25px 0;
  padding-bottom: 20px;
}
.user-tools {
  justify-content: flex-end;
}
.api-docs p {
  line-height: 1.85;
}
.api-docs h2 {
  margin-top: 35px;
}
.error-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}
.error-page {
  text-align: center;
  padding: 65px 20px;
  margin: 0 auto;
}
.error-page img {
  width: 56px;
}
.error-code {
  font-size: 96px;
  font-weight: 700;
  color: var(--red);
}
.error-page a {
  display: inline-block;
  margin: 20px 5px;
  text-decoration: none;
}
@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .thinking-dots i {
    animation: none;
  }
}
@media (max-width: 700px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .platform-nav {
    padding: 10px;
  }
  .stats {
    flex-wrap: wrap;
  }
  .message-menu {
    left: auto;
    right: 0;
  }
  .message-actions {
    gap: 4px;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.site-footer {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fcfbf9;
  font-size: 12px;
  line-height: 1.7;
}
.site-footer a:hover {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}
[data-theme="dark"] .site-footer {
  background: #191a1d;
  border-color: #34363c;
}
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;
}
.sidebar-tools { position: absolute; top: 36px; right: 14px; display: flex; gap: 2px; }
.sidebar-tools button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.sidebar-tools button:hover { background: #e8e6e1; color: inherit; }
.history-search { padding: 0 8px 8px; }
.history-search input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.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;
  position: sticky;
  top: 0;
  z-index: 14;
  background: #fcfbf9;
}
.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: 42px 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: #eef3fd;
  border-radius: 20px;
  padding: 10px 16px;
  max-width: 72%;
}
.message.assistant .bubble {
  padding: 0 0 12px;
  width: 100%;
  max-width: 100%;
}
.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;
}
[data-theme="dark"] .chat-composer { background: #191a1d; }
[data-theme="dark"] .hint { background: #191a1d; }
.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);
}

/* 企业管理工作台：稳定的信息层级、独立导航和高密度数据展示。 */
.admin:has(.admin-tabs) {
  --admin-nav-width: 214px;
  max-width: 1440px;
  min-height: calc(100vh - 72px);
  padding: 34px 42px 64px;
  display: grid;
  grid-template-columns: var(--admin-nav-width) minmax(0, 1fr);
  grid-auto-flow: row;
  align-content: start;
  column-gap: 28px;
  row-gap: 0;
}
.admin:has(.admin-tabs) > .eyebrow,
.admin:has(.admin-tabs) > h1,
.admin:has(.admin-tabs) > .admin-subtitle {
  grid-column: 1 / -1;
}
.admin:has(.admin-tabs) > .eyebrow {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.admin:has(.admin-tabs) > h1 {
  margin: 0;
  font-size: clamp(27px, 2.2vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 650;
}
.admin:has(.admin-tabs) > .admin-subtitle {
  margin: 10px 0 26px;
  min-height: 20px;
  font-size: 14px;
  line-height: 1.6;
}
.admin:has(.admin-tabs) > .admin-tabs {
  grid-column: 1;
  grid-row: 4 / span 50;
}
.admin:has(.admin-tabs) > .admin-tabs ~ * {
  grid-column: 2;
}
.admin:has(.admin-tabs) .admin-tabs {
  position: sticky;
  top: 92px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper, #fff) 94%, transparent);
  box-shadow: 0 10px 36px rgba(46, 39, 32, 0.06);
}
.admin:has(.admin-tabs) .admin-tabs button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  color: #686761;
  font-size: 13px;
  font-weight: 520;
  text-align: left;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.admin:has(.admin-tabs) .admin-tabs button:nth-child(5),
.admin:has(.admin-tabs) .admin-tabs button:nth-child(7),
.admin:has(.admin-tabs) .admin-tabs button:nth-child(11) {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 9px 9px;
}
.admin:has(.admin-tabs) .admin-tabs button:hover {
  color: var(--text);
  background: #f5f3ef;
  transform: translateX(2px);
}
.admin:has(.admin-tabs) .admin-tabs button.active {
  color: #9f2b27;
  background: #f7eae8;
  box-shadow: inset 3px 0 0 var(--red);
}
.admin:has(.admin-tabs) .admin-tabs .ui-icon {
  width: 17px;
  height: 17px;
  opacity: 0.82;
  flex: 0 0 auto;
}
.admin:has(.admin-tabs) .stats {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}
.admin:has(.admin-tabs) .stat {
  position: relative;
  min-height: 126px;
  padding: 20px 21px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(54, 45, 35, 0.045);
}
.admin:has(.admin-tabs) .stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--red), #dba39d);
  opacity: 0.85;
}
.admin:has(.admin-tabs) .stat small {
  display: block;
  color: #76746e;
  font-weight: 560;
  letter-spacing: 0.02em;
}
.admin:has(.admin-tabs) .stat b {
  margin-top: 16px;
  color: #24231f;
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 650;
  letter-spacing: -0.03em;
}
.admin:has(.admin-tabs) .panel {
  margin: 0 0 18px;
  padding: 24px 26px;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(54, 45, 35, 0.045);
}
.admin:has(.admin-tabs) .panel > h2 {
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
  color: #292824;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.admin:has(.admin-tabs) .panel > p:first-child {
  margin: 0 0 22px;
  padding: 13px 15px;
  border: 1px solid #ede8df;
  border-radius: 10px;
  background: #faf8f4;
  color: #66635d;
  font-size: 13px;
  line-height: 1.7;
}
.admin:has(.admin-tabs) .settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  align-items: end;
}
.admin:has(.admin-tabs) label {
  color: #5f5d57;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.5;
}
.admin:has(.admin-tabs) input,
.admin:has(.admin-tabs) select,
.admin:has(.admin-tabs) textarea {
  min-height: 43px;
  margin-top: 7px;
  border-color: #ddd9d1;
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.admin:has(.admin-tabs) input:focus,
.admin:has(.admin-tabs) select:focus,
.admin:has(.admin-tabs) textarea:focus {
  outline: 0;
  border-color: #bf6964;
  box-shadow: 0 0 0 3px rgba(174, 48, 44, 0.1);
}
.admin:has(.admin-tabs) .primary,
.admin:has(.admin-tabs) .secondary {
  min-height: 41px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}
.admin:has(.admin-tabs) .table-wrap {
  margin: -4px -8px 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.admin:has(.admin-tabs) table {
  min-width: 720px;
  font-size: 12.5px;
}
.admin:has(.admin-tabs) thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.admin:has(.admin-tabs) th {
  padding: 12px 14px;
  background: #f7f6f3;
  color: #727069;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.admin:has(.admin-tabs) td {
  height: 54px;
  padding: 12px 14px;
  color: #41403b;
}
.admin:has(.admin-tabs) tbody tr:last-child td {
  border-bottom: 0;
}
.admin:has(.admin-tabs) tbody tr:hover td {
  background: #fbfaf8;
}
.admin:has(.admin-tabs) .text-button {
  margin-right: 12px;
  color: #8f312d;
  font-size: 12px;
  font-weight: 560;
}
.admin:has(.admin-tabs) .pagination {
  justify-content: flex-end;
  gap: 10px;
}
.admin:has(.admin-tabs) .pagination button {
  min-width: 72px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.admin:has(.admin-tabs) .list-row {
  min-height: 48px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.admin:has(.admin-tabs) .admin-config {
  padding: 2px;
  line-height: 2.15;
}

[data-theme="dark"] .admin:has(.admin-tabs) .admin-tabs,
[data-theme="dark"] .admin:has(.admin-tabs) .table-wrap,
[data-theme="dark"] .admin:has(.admin-tabs) th,
[data-theme="dark"] .admin:has(.admin-tabs) .pagination button {
  background: #24262b;
  border-color: #3d4048;
}
[data-theme="dark"] .admin:has(.admin-tabs) .admin-tabs button:hover,
[data-theme="dark"] .admin:has(.admin-tabs) tbody tr:hover td {
  background: #2b2d32;
}
[data-theme="dark"] .admin:has(.admin-tabs) .admin-tabs button.active {
  color: #f0a39e;
  background: #392928;
}
[data-theme="dark"] .admin:has(.admin-tabs) .stat b,
[data-theme="dark"] .admin:has(.admin-tabs) .panel > h2,
[data-theme="dark"] .admin:has(.admin-tabs) td {
  color: #e4e5e8;
}
[data-theme="dark"] .admin:has(.admin-tabs) .panel > p:first-child {
  color: #b8b9bd;
  background: #202227;
  border-color: #3d4048;
}

@media (max-width: 980px) {
  .admin:has(.admin-tabs) {
    display: block;
    padding: 28px 24px 50px;
  }
  .admin:has(.admin-tabs) .admin-tabs {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    margin: 20px 0;
    padding: 7px;
    scrollbar-width: thin;
  }
  .admin:has(.admin-tabs) .admin-tabs button,
  .admin:has(.admin-tabs) .admin-tabs button:nth-child(5),
  .admin:has(.admin-tabs) .admin-tabs button:nth-child(7),
  .admin:has(.admin-tabs) .admin-tabs button:nth-child(11) {
    width: auto;
    min-width: max-content;
    margin: 0;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
  }
}
@media (max-width: 620px) {
  .admin:has(.admin-tabs) {
    padding: 22px 14px 42px;
  }
  .admin:has(.admin-tabs) > .admin-subtitle {
    margin-bottom: 18px;
  }
  .admin:has(.admin-tabs) .settings-grid,
  .admin:has(.admin-tabs) .stats {
    grid-template-columns: 1fr;
  }
  .admin:has(.admin-tabs) .panel {
    padding: 18px 16px;
    border-radius: 12px;
  }
  .admin:has(.admin-tabs) .invite-form {
    display: grid;
    grid-template-columns: 1fr;
  }
  .admin:has(.admin-tabs) .invite-form label {
    max-width: none;
  }
}

.message.assistant .bubble {
  white-space: normal;
  min-width: 0;
  flex: 1;
  max-width: calc(100% - 44px);
}
.rich-text p {
  margin: 0 0 1em;
}
.rich-text h2,
.rich-text h3,
.rich-text h4 {
  margin: 1.4em 0 0.6em;
  line-height: 1.4;
}
.rich-text ul,
.rich-text ol {
  padding-left: 1.6em;
  margin: 0.8em 0;
}
.rich-text li {
  margin: 0.4em 0;
}
.rich-text blockquote {
  margin: 1em 0;
  padding: 0.3em 1em;
  border-left: 3px solid #c4c4c4;
  color: #686868;
}
.rich-text :not(pre) > code {
  padding: 0.15em 0.35em;
  border-radius: 4px;
  background: #f0f1f3;
  font-size: 0.9em;
}
.code-block {
  margin: 1.2em 0;
  border: 1px solid #e0e2e5;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f9fb;
}
.code-toolbar {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  background: #f0f1f4;
  color: #616773;
  font: 13px system-ui;
  gap: 6px;
}
.code-toolbar > div {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.code-toolbar button {
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 5px;
  cursor: pointer;
  color: inherit;
}
.code-toolbar button:hover {
  background: #e0e3e8;
}
.code-toolbar button[aria-expanded="false"] svg {
  transform: rotate(180deg);
}
.code-block pre,
.expanded-code {
  margin: 0;
  padding: 18px;
  overflow: auto;
  max-height: 560px;
  white-space: pre;
  overflow-wrap: normal;
  font:
    13px/1.75 Consolas,
    monospace;
  tab-size: 4;
}
.code-block pre[hidden] {
  display: none;
}
.rich-table {
  overflow-x: auto;
  margin: 1em 0;
}
.rich-table th,
.rich-table td {
  border: 1px solid #ddd;
  padding: 8px 12px;
}
.rich-table table {
  border-collapse: collapse;
}
dialog:has(.code-preview),
dialog:has(.expanded-code) {
  width: min(1100px, 94vw);
  max-width: 94vw;
}
.code-preview {
  width: 100%;
  height: 65vh;
  border: 1px solid #ddd;
  background: white;
}
.invite-code {
  white-space: nowrap;
  font:
    13px Consolas,
    monospace;
  user-select: all;
}
.code-list {
  width: 100%;
  min-height: 140px;
  white-space: pre;
  overflow-x: auto;
}
.clipboard-helper {
  position: fixed;
  left: -9999px;
}
.attachment-view {
  display: block;
  background: transparent;
  padding: 0;
  border: 0;
  cursor: pointer;
  margin-bottom: 12px;
}
.attachment-view img {
  display: block;
  max-width: 240px;
  max-height: 180px;
  border-radius: 12px;
  object-fit: contain;
}
.attachment-full {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}
.attachment-draft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 12px;
}
.draft-image { position: relative; }
.draft-image button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #252522;
  color: #fff;
  cursor: pointer;
}
.draft-file { display: flex; align-items: center; gap: 10px; }
.attachment-draft:empty {
  display: none;
}
.attachment-draft img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}
.followup-draft {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f3f2;
  color: var(--muted);
}
.followup-draft::before {
  content: "";
  align-self: stretch;
  width: 3px;
  flex: 0 0 3px;
  border-radius: 2px;
  background: #d4d2cd;
}
.followup-draft span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.followup-draft button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
.followup-quote {
  margin-bottom: 12px;
  padding: 3px 0 3px 12px;
  border-left: 3px solid #d7d5d0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.text-file-card { display: flex; align-items: center; gap: 12px; width: min(420px,100%); padding: 13px 15px; margin-top: 12px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: #f4f5f7; }
.text-file-card .ui-icon { color: #4d73e8; width: 28px; height: 28px; }
.text-file-card strong,.text-file-card small { display:block; }
.text-file-card small { color:var(--muted); margin-top:3px; }
.attach-control {
  display: inline-flex;
  cursor: pointer;
  padding: 8px;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 4px;
  color: #8a8a8a;
  font-size: 12px;
  flex-wrap: wrap;
}
.message-action,
.message-more summary {
  display: flex;
  padding: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 5px;
}
.message-action:hover,
.message-action.active,
.message-more summary:hover {
  color: var(--red);
  background: #f0eeeb;
}
.message-more {
  position: relative;
}
.message-more summary {
  list-style: none;
}
.message-more summary::-webkit-details-marker {
  display: none;
}
.message-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background: white;
  border: 1px solid #e5e5e5;
  box-shadow: 0 8px 24px #0001;
  padding: 9px;
  border-radius: 12px;
  width: 190px;
  z-index: 20;
}
.message-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  border-radius: 6px;
}
.message-menu button:hover {
  background: #f5f5f5;
}
.message-menu button:last-child {
  color: #c23e3e;
}
.saved-label {
  color: var(--red);
}
.document-editor {
  display: block;
  width: 100%;
  min-height: 260px;
  margin: 15px 0;
  padding: 12px;
  font:
    14px/1.7 Consolas,
    monospace;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* 外观模式只改变表现，不改变数据或收费状态。 */
[data-theme="dark"] {
  color-scheme: dark;
  background: #191a1d;
  color: #e4e5e8;
  --line: #34363c;
  --muted: #a0a3ab;
  --red: #df7670;
}
[data-theme="dark"] .sidebar,
[data-theme="dark"] aside,
[data-theme="dark"] header,
[data-theme="dark"] .header {
  background: #202125;
  border-color: #34363c;
}
[data-theme="dark"] .panel,
[data-theme="dark"] .composer,
[data-theme="dark"] dialog,
[data-theme="dark"] .message-menu,
[data-theme="dark"] .suggestion,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .stat,
[data-theme="dark"] #global-loading {
  background: #24262b;
  color: #e4e5e8;
  border-color: #3d4048;
}
[data-theme="dark"] .message.user .bubble,
[data-theme="dark"] .code-toolbar,
[data-theme="dark"] .history-item.active,
[data-theme="dark"] .share-option {
  background: #2f3239;
  color: #e4e5e8;
}
[data-theme="dark"] .followup-draft {
  background: #2f3239;
  color: #e4e5e8;
}
[data-theme="dark"] .followup-quote {
  border-color: #62656d;
}
[data-theme="dark"] .code-block,
[data-theme="dark"] .rich-text :not(pre) > code {
  background: #22242a;
  color: #dedfe4;
  border-color: #3d4048;
}
[data-theme="dark"] .secondary,
[data-theme="dark"] .new-chat,
[data-theme="dark"] .message-menu button,
[data-theme="dark"] .vertical-actions button {
  color: #e4e5e8;
  background: #2c2e34;
  border-color: #3d4048;
}
[data-theme="dark"] a {
  color: #c7b9ec;
}
[data-theme="dark"] .primary,
[data-theme="dark"] .send {
  color: #fff;
  background: #aa4540;
}
.composer {
  border-radius: 26px;
  box-shadow: 0 5px 24px #00000005;
}
.composer .composer-bottom {
  gap: 10px;
}
.composer .mode-select {
  margin-left: auto;
  width: auto;
  max-width: 230px;
}
.attach-control {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  justify-content: center;
  background: #f1f1f1;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.send.is-stopping {
  border-radius: 50%;
  background: #171717;
}
.stop-square {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: white;
  margin: auto;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.admin-tabs {
  flex-wrap: wrap;
}
.table-wrap small {
  display: block;
  white-space: normal;
  font-size: 11px;
}

/* 输入区参考布局：附件在左，状态、模型与停止按钮在右。 */
.composer .mode-select {
  margin-left: 0;
  border: 0;
  background-color: transparent;
  color: var(--text);
  font-size: 14px;
}
.composer .attach-control {
  margin-right: auto;
  cursor: pointer;
  flex-shrink: 0;
}
.composer .send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.composer .send .ui-icon { width: 18px; height: 18px; }
.composer-progress[hidden] {
  display: none;
}
.composer-spinner {
  display: block;
  width: 17px;
  height: 17px;
  border: 3px solid #ddd;
  border-top-color: #777;
  border-radius: 50%;
  animation: composer-spin 1s linear infinite;
}
@keyframes composer-spin {
  to {
    transform: rotate(360deg);
  }
}
.composer textarea {
  resize: none;
}
[data-theme="dark"] .attach-control {
  background: #343434;
}
@media (prefers-reduced-motion: reduce) {
  .composer-spinner {
    animation: none;
  }
}
@media (max-width: 480px) {
  .composer .mode-select {
    max-width: 185px;
    font-size: 12px;
  }
  .composer .composer-bottom {
    gap: 6px;
  }
}

/* 1.2.1：固定侧栏服务入口网格，防止“外观”被压成两行。 */
.platform-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 12px 8px;
  flex-shrink: 0;
}
.platform-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.platform-nav a:hover {
  background: var(--line);
}
.platform-nav label {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  width: 100%;
  padding: 6px 10px;
  box-sizing: border-box;
  white-space: nowrap;
  margin: 0;
}
.platform-nav select {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 8px;
  font-size: 13px;
}
.account-settings h2 {
  margin: 0 0 12px;
}
.account-settings .account-name {
  overflow-wrap: anywhere;
  margin: 0 0 20px;
  color: var(--muted);
}
.account-settings h3 {
  font-size: 15px;
  margin: 24px 0 10px;
}
.account-settings .vertical-actions {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
}
.account-settings .vertical-actions button {
  font-size: 14px;
  min-height: 42px;
  overflow-wrap: anywhere;
}
.account-settings details {
  margin: 18px 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.account-settings summary {
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 12px;
}
.account-settings > p a {
  display: inline-block;
  padding: 4px 0;
  font-size: 14px;
}

/* 1.2.2 紧凑对话菜单及公开分享阅读页。 */
.conversation-popover {
  position: fixed;
  z-index: 1100;
  width: 216px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper, #fff);
  box-shadow: 0 8px 32px #0002;
}
.conversation-popover .vertical-actions {
  gap: 2px;
}
.conversation-popover button {
  min-height: 42px;
  font-size: 14px;
}
[data-theme="dark"] .conversation-popover {
  background: #262626;
}
.share-page .sidebar,
.share-page aside {
  display: none;
}
.share-page {
  padding-left: 0;
}
.share-page .main,
.share-page main,
.share-page .workspace {
  margin-left: 0;
}
.share-page #page {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.share-page .panel {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.share-page .shared-message {
  margin: 32px 0;
  line-height: 1.85;
  overflow-wrap: anywhere;
  min-width: 0;
}
.share-page .shared-message.user {
  margin-left: auto;
  width: fit-content;
  max-width: 85%;
  padding: 16px 22px;
  background: #f2f2f2;
  border-radius: 20px;
}
.share-page .shared-message.user > strong {
  display: none;
}
.share-page .shared-message.assistant > strong {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}
[data-theme="dark"] .shared-message.user {
  background: #303030;
}
@media (max-width: 600px) {
  .share-page #page {
    padding: 20px 16px 48px;
  }
}

.conversation-popover button {
  display: flex;
  gap: 12px;
  align-items: center;
}
.share-picker {
  max-width: 1000px;
  margin: auto;
  padding: 24px 20px 100px;
}
.share-picker > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--paper, #fff);
  z-index: 2;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.share-picker h2 {
  font-size: 18px;
  margin: 0;
}
.share-pick-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  margin: 8px 0;
  border-radius: 12px;
}
.share-pick-row:has(input:checked) {
  background: #f1f1f1;
}
.share-pick-row > input {
  width: 18px;
  height: 18px;
  margin-top: 8px;
}
.share-pick-row .user {
  justify-self: end;
  padding: 12px 18px;
  background: #eee;
  border-radius: 14px;
}
.share-picker footer {
  position: sticky;
  bottom: 0;
  padding: 18px;
  background: var(--paper, #fff);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}
.share-picker footer label {
  display: flex;
  gap: 8px;
  align-items: center;
}
[data-theme="dark"] .share-picker > header,
[data-theme="dark"] .share-picker footer {
  background: #232323;
}
[data-theme="dark"] .share-pick-row:has(input:checked),
[data-theme="dark"] .share-pick-row .user {
  background: #333;
}

#toast[popover],
#global-loading[popover] {
  margin: 0;
  border: 0;
  right: auto;
  width: max-content;
  max-width: calc(100vw - 32px);
}
#toast[popover] {
  top: auto;
}
#global-loading[popover] {
  bottom: auto;
}
#toast[hidden],
#global-loading[hidden] {
  display: none;
}

/* 账号入口始终留在侧栏底部，其余服务点击后展开。 */
.sidebar-bottom > .subtle-link {
  display: none;
}
.account[role="button"] {
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 8px;
}
.account[role="button"]:hover {
  background: var(--line);
}
.account-popover {
  position: fixed;
  z-index: 1200;
  width: 248px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 32px #0002;
  max-height: calc(100dvh - 100px);
  overflow: auto;
}
.account-popover > button,
.account-popover > a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  text-align: left;
  box-sizing: border-box;
}
.account-popover button:hover,
.account-popover a:hover {
  background: var(--line);
}
.account-popover hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px;
}
.menu-arrow {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.18s ease;
  transform-origin: center;
}
[data-account-sub].is-open .menu-arrow {
  transform: rotate(90deg);
}
.account-sub {
  margin: 0 8px 8px 36px;
  padding: 4px;
  border-left: 1px solid var(--line);
}
.account-sub button {
  display: block;
  width: 100%;
  padding: 10px;
  text-align: left;
  border-radius: 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* 开发者中心与 API 文档 */
.developer-hero,.api-key-card{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:24px;border:1px solid var(--line);border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--red) 7%,var(--paper)),var(--paper))}.developer-hero h2,.api-key-card h2{margin:8px 0}.status-pill{display:inline-flex;padding:4px 9px;border-radius:999px;background:var(--line);font-size:12px}.status-pill.success{color:#287548;background:#eaf6ee}.api-docs-shell{display:grid;grid-template-columns:220px minmax(0,860px);gap:48px;max-width:1180px;margin:0 auto;padding:40px 28px 100px}.api-docs-nav{position:sticky;top:88px;align-self:start;display:grid;gap:4px}.api-docs-nav strong{padding:10px 12px}.api-docs-nav a{padding:9px 12px;border-radius:8px;color:var(--muted);text-decoration:none}.api-docs-nav a:hover{color:var(--text);background:var(--line)}.api-docs-content h1{font-size:clamp(32px,5vw,54px);margin:12px 0}.api-docs-content .lead{font-size:18px;color:var(--muted);line-height:1.8}.api-docs-content section{padding-top:28px;scroll-margin-top:80px}.api-overview{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:30px 0}.api-overview>div,.api-model-grid>div{padding:18px;border:1px solid var(--line);border-radius:14px}.api-overview small{display:block;color:var(--muted);margin-bottom:8px}.api-overview code{overflow-wrap:anywhere}.api-code{margin:18px 0;border:1px solid #30343a;border-radius:14px;overflow:hidden;background:#17191d;color:#f4f4f4}.api-code>div{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;background:#23262b;color:#bfc4cc}.api-code button{color:inherit;font-size:13px}.api-code pre{margin:0;padding:18px;overflow:auto;line-height:1.65}.api-code code{color:inherit}.api-endpoint{display:flex;align-items:center;gap:12px;margin-bottom:10px}.api-endpoint span{padding:5px 9px;border-radius:6px;background:#ffe8e6;color:#a62c29;font-weight:700}.api-endpoint.get span{background:#e7f3ff;color:#1769aa}.api-model-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.api-model-grid p{color:var(--muted);line-height:1.6}.api-docs-content table{width:100%}
@media(max-width:800px){.api-docs-shell{display:block;padding:24px 18px 80px}.api-docs-nav{position:static;display:flex;overflow:auto;margin-bottom:24px}.api-docs-nav strong{display:none}.api-docs-nav a{white-space:nowrap}.api-overview,.api-model-grid{grid-template-columns:1fr}.developer-hero,.api-key-card{align-items:flex-start;flex-direction:column}}
[data-theme="dark"] .account-popover {
  background: #262626;
}
/* 1.2.4：用与原侧栏匹配的 ID 选择器覆盖浅色背景，统一交互状态。 */
:root {
  --paper: #fff;
  --text: #282825;
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #24262b;
  --text: #e4e5e8;
}
[data-theme="dark"] #sidebar {
  background: #202125;
  color: #e4e5e8;
  border-color: var(--line);
  scrollbar-color: #50535b #202125;
}
[data-theme="dark"] #sidebar a,
[data-theme="dark"] .brand,
[data-theme="dark"] .header-left a {
  color: #e4e5e8;
}
[data-theme="dark"] #sidebar .brand small,
[data-theme="dark"] #sidebar .history-heading,
[data-theme="dark"] #sidebar .muted,
[data-theme="dark"] #sidebar .account small {
  color: #aeb1ba;
}
[data-theme="dark"] #sidebar .history-item:hover,
[data-theme="dark"] #sidebar .account:hover {
  background: #2b2e34;
}
[data-theme="dark"] #sidebar .history-item.active {
  background: #353039;
  color: #f3b1a9;
}
[data-theme="dark"] #sidebar .history-item.active a {
  color: inherit;
}
[data-theme="dark"] #sidebar .avatar {
  background: #34373f;
  border-color: #4a4d55;
  color: #e4e5e8;
}
[data-theme="dark"] .account-popover,
[data-theme="dark"] .conversation-popover {
  color: #e4e5e8;
  border-color: #3d4048;
}
[data-theme="dark"] .account-popover a {
  color: inherit;
}
[data-theme="dark"] .message-menu button:hover,
[data-theme="dark"] .vertical-actions button:hover {
  background: #3a3d45;
}
[data-theme="dark"] .conversation-popover .danger,
[data-theme="dark"] .message-menu button:last-child {
  color: #f19891;
}
[data-theme="dark"] .notice {
  background: #302d29;
  color: #e4d5bd;
  border-color: #514737;
}

/* 1.2.5 独立分享页：两侧消息均为气泡，隐藏工作台导航。 */
body.share-page #sidebar,
body.share-page .workspace > header {
  display: none;
}
body.share-page .workspace {
  margin-left: 0;
  width: 100%;
}
body.share-page #page {
  width: 100%;
  max-width: 960px;
  padding: 40px 24px 130px;
  box-sizing: border-box;
  margin: 0 auto;
}
.share-heading {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.share-heading h1 {
  font-family: inherit;
  font-size: 28px;
  line-height: 1.4;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.share-heading p,
.share-expiry {
  font-size: 13px;
  color: var(--muted);
}
.share-bubbles {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
body.share-page .shared-message {
  border-radius: 20px;
  padding: 20px 24px;
  margin: 0;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}
body.share-page .shared-message.user {
  align-self: flex-end;
  max-width: 82%;
  background: #ae302c;
  color: #fff;
  border-bottom-right-radius: 6px;
}
body.share-page .shared-message.assistant {
  align-self: flex-start;
  background: #f0f1f3;
  color: #282825;
  border-bottom-left-radius: 6px;
}
.share-speaker {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
  margin-bottom: 8px;
}
.share-page .shared-message.user a {
  color: #fff;
  text-decoration: underline;
}
.share-page .shared-message.user .rich-text > :first-child,
.share-page .shared-message.assistant .rich-text > :first-child {
  margin-top: 0;
}
.share-page .shared-message .rich-text {
  min-width: 0;
}
.share-expiry {
  margin-top: 32px;
}
.share-cta {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}
.share-cta a {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  width: 252px;
  padding: 14px 24px;
  background: #ae302c;
  color: #fff !important;
  border-radius: 30px;
  box-shadow: 0 5px 22px #0002;
  font-size: 15px;
  white-space: nowrap;
}
.share-cta a .ui-icon {
  margin-left: auto;
  flex: 0 0 auto;
}
[data-theme="dark"] body.share-page .shared-message.assistant {
  background: #292c32;
  color: #e4e5e8;
}
[data-theme="dark"] body.share-page .shared-message.user {
  background: #863c37;
}
body.share-page #toast {
  left: 50%;
}
@media (max-width: 600px) {
  body.share-page #page {
    padding: 24px 14px 120px;
  }
  .share-heading h1 {
    font-size: 22px;
  }
  body.share-page .shared-message {
    padding: 16px;
  }
  body.share-page .shared-message.user {
    max-width: 92%;
  }
}

/* 实际请求事件组成的进度记录，不显示虚构百分比。 */
.generation-progress {
  margin: 16px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
/* 进度只属于回答区域，用户问题气泡中不重复展示。 */
.message.user .generation-progress { display: none !important; }
.generation-progress summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: #f1f0ed;
  color: #66645f;
  list-style: none;
}
.generation-progress summary::-webkit-details-marker { display: none; }
.generation-progress .progress-time-wrap { white-space: nowrap; }
.generation-progress summary::after {
  content: "⌄";
  padding-left: 8px;
  transition: transform .18s ease;
}
.generation-progress[open] summary::after { transform: rotate(180deg); }
.generation-progress[open] summary .ui-icon {
  color: var(--red);
}
.generation-progress ol {
  list-style: none;
  margin: 4px 0 10px 0;
  padding: 0 0 0 20px;
  border-left: 1px solid var(--line);
}
.generation-progress li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  position: relative;
  margin: 12px 0;
}
.generation-progress li > div {
  flex: 1;
  overflow-wrap: anywhere;
}
.generation-progress time {
  white-space: nowrap;
  font-size: 11px;
}
.progress-marker {
  position: absolute;
  left: -24px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.progress-marker.is-active {
  background: var(--red);
  animation: pulse 1.5s infinite;
}
[data-theme="dark"] .generation-progress summary {
  background: #292f3a;
  color: #c5cedd;
}
@media (prefers-reduced-motion: reduce) {
  .progress-marker.is-active {
    animation: none;
  }
}
.streaming-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.streaming-text::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 1em;
  margin-left: 0.15em;
  vertical-align: -0.12em;
  border-radius: 2px;
  background: var(--accent);
  animation: stream-caret 0.9s steps(2, jump-none) infinite;
}

@keyframes stream-caret {
  50% { opacity: 0; }
}

.floating-share { position: fixed; top: 100px; right: 22px; z-index: 20; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; box-shadow: 0 5px 18px #0000000d; }
.conversation-map { position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 80; display: flex; flex-direction: column; gap: 3px; pointer-events: auto; }
.conversation-map button { appearance: none; position: relative; width: 34px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; pointer-events: auto; touch-action: manipulation; }
.conversation-map button::after { content: ""; position: absolute; right: 2px; top: 11px; width: 8px; height: 2px; border-radius: 2px; background: #cacaca; }
.conversation-map button:hover::after,.conversation-map button:focus-visible::after { width: 16px; background: #969696; }
.conversation-map button.active::after { width: 20px; background: var(--red); }
.conversation-map button span { display: none; position: absolute; right: 28px; top: 50%; transform: translateY(-50%); width: max-content; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 8px 24px #0002; font-size: 12px; }
.conversation-map button:hover span,.conversation-map button:focus-visible span { display: block; }
[data-theme="dark"] .floating-share,[data-theme="dark"] .conversation-map button span,[data-theme="dark"] .text-file-card { background: #292c32; color: #e4e5e8; }
@media (max-width:1100px) { .conversation-map { display:none; } }

@media (min-width:901px) {
  body.sidebar-collapsed #sidebar { width:76px; padding:24px 12px 18px; align-items:center; }
  body.sidebar-collapsed .workspace { margin-left:76px; }
  body.sidebar-collapsed .brand { width:52px; padding:0 6px 22px; justify-content:center; }
  body.sidebar-collapsed .brand img { width:40px; height:40px; }
  body.sidebar-collapsed .brand span,body.sidebar-collapsed .new-chat kbd,body.sidebar-collapsed .vision-nav span,body.sidebar-collapsed .history-heading,body.sidebar-collapsed #history,body.sidebar-collapsed .subtle-link,body.sidebar-collapsed .account>div,body.sidebar-collapsed .account>button,body.sidebar-collapsed .sidebar-tools button:first-child { display:none; }
  body.sidebar-collapsed .sidebar-tools { position:static; width:48px; margin:0 auto 10px; justify-content:center; order:0; }
  body.sidebar-collapsed .sidebar-tools button:last-child { width:40px; height:40px; border:1px solid transparent; }
  body.sidebar-collapsed .sidebar-tools button:last-child:hover { border-color:var(--line); background:#fff; }
  body.sidebar-collapsed .new-chat { width:48px; min-height:48px; height:48px; padding:0; margin:0 auto; justify-content:center; font-size:0; flex:0 0 48px; }
  body.sidebar-collapsed .new-chat .ui-icon { width:21px; height:21px; }
  body.sidebar-collapsed .vision-nav { width:48px; min-height:46px; margin-top:8px; justify-content:center; padding:0; border-radius:10px; }
  body.sidebar-collapsed .vision-nav:hover { background:#e8e6e1; }
  body.sidebar-collapsed .sidebar-bottom { margin-top:auto; }
  body.sidebar-collapsed .account { width:52px; justify-content:center; padding:12px 0 0; }
}
