:root {
  --bg: #070b09;
  --bg-2: #0d1411;
  --card: #101815;
  --line: rgba(214, 232, 214, 0.12);
  --text: #f4f7f4;
  --muted: #9aa89f;
  --green: #3ddc97;
  --green-2: #1fa86e;
  --danger: #ff8d8d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 70% 8%, rgba(61, 220, 151, 0.16), transparent 60%),
    radial-gradient(700px 420px at 18% 0%, rgba(24, 92, 64, 0.35), transparent 55%),
    var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

a { color: inherit; }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 40px;
  background: rgba(7, 11, 9, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: radial-gradient(circle at 30% 30%, #d9ffe9, var(--green) 42%, #0c3d2a);
  box-shadow: 0 0 18px rgba(61, 220, 151, 0.45);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small, .brand small { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }

nav {
  display: flex;
  gap: 28px;
  justify-content: center;
}

nav a {
  color: #d5ddd8;
  text-decoration: none;
  font-size: 14px;
}

nav a.active { color: #fff; box-shadow: inset 0 -2px 0 var(--green); }

[hidden] { display: none !important; }
.nav-cta, .button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logout {
  margin: 0;
  background: transparent;
  color: #f4f7f4;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.nav-cta, .button.light {
  background: #fff;
  color: #111;
  border: 0;
}

.hero, .section, .roles, .close, .site-foot, main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.hero { padding: 72px 0 20px; text-align: center; }

.eyebrow, .kicker {
  color: var(--green);
  letter-spacing: 0.16em;
  font-size: 12px;
  text-transform: uppercase;
}
.eyebrow a { color: inherit; text-decoration: none; }
.facts { display: grid; gap: 16px; margin: 28px 0; }
.facts div { display: grid; gap: 4px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; white-space: pre-wrap; }

.spark {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

h1 {
  margin: 12px 0;
  font-size: 58px;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.accent {
  color: var(--green);
  box-shadow: inset 0 -0.28em 0 rgba(61, 220, 151, 0.28);
}

.lede { color: var(--muted); font-size: 17px; }
.lede.center, .close .lede { margin-left: auto; margin-right: auto; max-width: 560px; }

.hero-actions, .row-actions, .search-row, .page-head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-actions { justify-content: center; }

.button.primary, button.primary {
  background: var(--green);
  color: #062117;
  border: 0;
  font-weight: 700;
}
.chat-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  height: calc(100vh - 120px);
  max-width: 1080px;
  margin: 0 auto;
}
.history {
  border-right: 1px solid var(--line);
  padding-right: 12px;
  overflow: auto;
}
.history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 650; }
.history-head button { margin: 0; padding: 4px 8px; font-size: 12px; }
.history-item {
  display: block;
  width: 100%;
  margin: 2px 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item.active { background: rgba(61, 220, 151, 0.12); color: var(--text); }
.chat-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-log {
  flex: 1;
  overflow: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color-scheme: dark;
  scrollbar-color: rgba(154, 168, 159, 0.35) transparent;
  scrollbar-width: thin;
}
.chat-log::-webkit-scrollbar {
  width: 10px;
  background: transparent;
}
.chat-log::-webkit-scrollbar-track {
  background: transparent;
}
.chat-log::-webkit-scrollbar-thumb {
  background: rgba(154, 168, 159, 0.35);
  border-radius: 8px;
}
.turn {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.turn.user { align-self: flex-end; }
.turn.assistant { align-self: flex-start; width: 100%; }
.bubble-text {
  padding: 10px 12px;
  border-radius: 16px;
  white-space: pre-wrap;
}
.turn.user .bubble-text { background: rgba(61, 220, 151, 0.16); }
.turn.assistant .bubble-text {
  max-width: 680px;
  padding: 2px 0;
  line-height: 1.7;
}
.turn.assistant .bubble-text p { margin: 0 0 0.7em; }
.turn.assistant .bubble-text p:last-child { margin-bottom: 0; }
.turn.assistant .bubble-text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}
.turn.assistant .bubble-text a { color: var(--green); }
.process-group { margin: 8px 0 12px; color: var(--muted); font-size: 13px; }
.thinking-section__header {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8b8d95;
  font-size: 14px;
  cursor: pointer;
}
.thinking-content {
  margin: 6px 0 0 7px;
  padding-left: 12px;
  border-left: 1px solid #4b5563;
}
.thinking-content.is-collapsed { display: none; }
.process-group__header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.process-group__collapsible { display: grid; grid-template-rows: 0fr; }
.process-group__collapsible.is-expanded { grid-template-rows: 1fr; }
.process-group__body { min-height: 0; overflow: hidden; }
.process-line {
  padding: 2px 0 2px 12px;
  border-left: 2px solid rgba(61, 220, 151, 0.35);
}
.process-line.running { color: var(--text); }
.bubble {
  max-width: 760px;
  padding: 12px 14px;
  border-radius: 16px;
  white-space: pre-wrap;
}
.bubble.user {
  align-self: flex-end;
  background: rgba(61, 220, 151, 0.16);
}
.bubble.assistant {
  align-self: flex-start;
  background: transparent;
}
.turn.streaming .bubble-text::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: #3ddc97;
  vertical-align: text-bottom;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret {
  50% { opacity: 0; }
}
.composer {
  position: relative;
  z-index: 10;
  margin: 8px 0 12px;
  padding: 12px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #101815;
}
.composer.drag-over { border-color: var(--green); }
.composer textarea {
  width: 100%;
  min-height: 52px;
  max-height: 240px;
  border: 0;
  resize: none;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.6;
  padding: 0 8px;
}
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.composer-hint { color: var(--muted); font-size: 12px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(61, 220, 151, 0.12);
  font-size: 13px;
}
.file-chip[hidden] { display: none; }
.file-chip button { margin: 0; padding: 2px 8px; }
.send-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #062117;
  font-weight: 700;
}
.send-btn:disabled { opacity: 0.45; }
.action-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
button.action {
  flex: 1;
  min-height: 48px;
  margin-top: 0;
  padding: 12px 18px;
  font-size: 16px;
}
button.action.ready {
  background: #fff;
  color: #111;
  border: 0;
  opacity: 1;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button.action:disabled,
button.action.primary:disabled {
  background: #24312c;
  color: #8ea099;
  border: 0;
}

.button.ghost, button {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.checks {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 0;
  margin: 18px 0 0;
  color: var(--muted);
  list-style: none;
  font-size: 13px;
}

.checks li::before { content: "✓ "; color: var(--green); }

.stage { position: relative; margin-top: 42px; }

.orb {
  position: absolute;
  right: 8%;
  top: -18px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #eafff5, var(--green) 40%, #0b3d2b);
  box-shadow: 0 0 40px rgba(61, 220, 151, 0.55);
}

.window {
  display: grid;
  grid-template-columns: 180px 1fr;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #121a17, #0c1210);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.window aside { padding: 18px 14px; border-right: 1px solid var(--line); }
.win-brand { margin: 0 0 16px; color: var(--green); font-weight: 700; }
.win-item { margin: 0; padding: 8px 10px; color: var(--muted); border-radius: 8px; }
.win-item.on { color: var(--text); background: rgba(61, 220, 151, 0.12); }
.win-main { padding: 22px 24px 28px; }
.win-title { margin: 0; color: var(--muted); font-size: 13px; }
.win-line.ok { color: var(--green); }
.win-copy { color: #d5ddd8; }
.win-url {
  display: inline-block;
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(61, 220, 151, 0.1);
  color: var(--green);
}

.audiences { text-align: center; padding: 54px 0 10px; color: var(--muted); }
.audiences ul {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 0;
  list-style: none;
}
.audiences li::before { content: "○ "; color: var(--green); }

.section, .roles, .close { padding: 64px 0; text-align: center; }
.cards, .roles { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(3, 1fr); text-align: left; margin-top: 28px; }
.cards article, .panel, .empty, pre, .table-wrap {
  background: rgba(16, 24, 21, 0.86);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}
.icon { color: var(--green); font-size: 20px; }
h2 { margin: 8px 0; font-size: 36px; letter-spacing: -0.03em; }
h3 { margin: 10px 0; font-size: 18px; }

.roles {
  grid-template-columns: 1.1fr 1fr;
  text-align: left;
  align-items: center;
}
.roles ol { list-style: none; margin: 0; padding: 0; }
.roles li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.roles li span { color: var(--green); }
.roles li em { grid-column: 2; color: var(--muted); font-style: normal; }

.close { position: relative; overflow: hidden; }
.watermark {
  position: absolute;
  left: -20px;
  bottom: -28px;
  margin: 0;
  font-size: 140px;
  font-weight: 800;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.04);
}

.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.doc {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 24px;
}

.doc h1 { margin: 8px 0 12px; font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.04em; line-height: 1.15; }
.doc h2 { margin: 36px 0 8px; font-size: 22px; }
.doc p, .doc li { color: var(--muted); }
.doc strong { color: var(--text); }
.doc-steps { padding-left: 20px; }
.doc-steps li + li { margin-top: 8px; }
.doc-actions { display: flex; gap: 12px; margin-top: 36px; }
.doc-foot { width: min(760px, calc(100% - 48px)); margin: 0 auto; }

main { padding: 42px 0 72px; }
body[data-view="chat"] {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body[data-view="chat"] .top { flex: none; }
body[data-view="chat"] main {
  flex: 1;
  min-height: 0;
  padding: 12px 28px 16px;
  overflow: hidden;
}
body[data-view="chat"] #chat:not([hidden]) {
  display: flex;
  height: 100%;
  min-height: 0;
}
body[data-view="chat"] .chat-layout {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body[data-view="chat"] .chat-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body[data-view="chat"] .history {
  height: 100%;
  min-height: 0;
  overflow: auto;
}
body[data-view="chat"] .chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
body[data-view="chat"] .composer { flex: none; }
body[data-view="home"] main,
body[data-view="account"] main { display: none; }

body[data-view="contact"] {
  height: 100vh;
  overflow: hidden;
}
.contact-stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 76px 16px 24px;
}
.contact-copy { text-align: center; }
.contact-copy h1 { margin: 4px 0; font-size: 40px; line-height: 1.15; }
.contact-copy .lede { margin: 0; color: var(--muted); }
.wecom {
  width: min(340px, calc(100% - 32px));
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}
.wecom-head {
  position: relative;
  height: 168px;
  overflow: hidden;
}
.wecom-photo {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: center 40%;
}
.wecom-name {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 34px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.wecom-name p { margin: 0; font-size: 13px; letter-spacing: 0.02em; }
.wecom-name strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.wecom-body { padding: 14px 18px 14px; text-align: center; }
.wecom-qr {
  display: block;
  width: min(220px, 78%);
  margin: 0 auto;
}
.wecom-body p {
  margin: 10px 0 0;
  color: #66716c;
  font-size: 13px;
}

.auth-wrap {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 64px;
}
.auth-card {
  width: min(420px, 100%);
  padding: 36px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(12, 18, 16, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  text-align: left;
}
.auth-card .mark { margin-bottom: 18px; }
.auth-card h1 {
  font-size: 32px;
  margin: 4px 0 8px;
}
.auth-copy, .auth-note { color: var(--muted); }
.auth-card input { width: 100%; max-width: none; }
.auth-card button {
  width: 100%;
  margin-top: 16px;
}
.auth-card #register-button {
  margin-top: 10px;
  background: transparent;
}
.auth-note { margin-top: 22px; font-size: 13px; }

.page-head { justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
#refresh-list { margin: 0; }
.page-head h1, #detail h1, #create-form h1, #log-view h1 { font-size: 40px; }
label { display: block; margin: 14px 0 6px; color: var(--muted); }
input {
  width: min(100%, 460px);
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1210;
  color: var(--text);
  font: inherit;
}
.search-row input { flex: 1; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; font-weight: 600; }
a { color: var(--green); }
.address a { color: var(--green); }
.status, .pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
}
.pill.ok, .status.ok { background: rgba(61, 220, 151, 0.16); color: var(--green); }
.pill.bad, .status.bad { background: rgba(255, 141, 141, 0.12); color: var(--danger); }
.pill.busy, .status.busy { background: rgba(232, 196, 104, 0.14); color: #e8c468; }
.notice, .error, .ok-note { margin: 12px 0; }
.error { color: var(--danger); }
.ok-note { color: var(--green); font-weight: 700; }
.panel { margin-top: 16px; }
.dropzone {
  position: relative;
  margin-top: 8px;
  padding: 28px 18px;
  border: 1px dashed rgba(61, 220, 151, 0.45);
  border-radius: 16px;
  background: rgba(61, 220, 151, 0.05);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.dragover, .dropzone.has-file {
  border-color: var(--green);
  background: rgba(61, 220, 151, 0.12);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-title { margin: 0; font-size: 16px; font-weight: 700; }
.drop-hint, .drop-name { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.drop-name:empty { display: none; }
.dropzone.has-file .drop-name { color: var(--green); }
#ai-issues { margin: 12px 0 0; padding: 0; list-style: none; }
#ai-issues li { padding: 10px 0; border-top: 1px solid var(--line); }
#ai-issues strong { display: block; }
#ai-issues .high { color: #ffb4b4; }
#ai-issues .medium { color: #e8c468; }
.danger { color: var(--danger); border-color: rgba(255, 141, 141, 0.4); }
.row-buttons { display: flex; gap: 8px; }
.row-buttons button { margin: 0; padding: 6px 10px; font-size: 13px; }
pre { white-space: pre-wrap; min-height: 180px; color: #d7e2db; }

@media (max-width: 860px) {
  .top { grid-template-columns: 1fr; gap: 12px; }
  nav, .nav-cta { justify-self: start; }
  h1 { font-size: 36px; }
  .cards, .roles, .window, .audiences ul { grid-template-columns: 1fr; display: grid; }
  .audiences ul { gap: 8px; }
}
