:root {
  color-scheme: dark;
  --bg: #0f1011;
  --panel: rgba(24, 24, 26, 0.96);
  --panel-strong: rgba(34, 34, 36, 0.98);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f2f3;
  --text-muted: rgba(242, 242, 243, 0.62);
  --text-soft: rgba(242, 242, 243, 0.38);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-ui:
    "Segoe UI Variable Display", "Bahnschrift", "PingFang SC",
    "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(
      circle at top center,
      rgba(0, 70, 139, 0.15),
      transparent 40%
    ),
    linear-gradient(180deg, #111213 0%, #080a0d 100%);
  color: var(--text);
  font-family: var(--font-ui);
}

body {
  padding: 4px;
}

button,
textarea,
a,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

.page-shell {
  min-height: calc(100vh - 8px);
}

.app-frame {
  position: relative;
  min-height: calc(100vh - 8px);
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, #151516 0%, #111214 100%);
  box-shadow: var(--shadow);
}

.left-emblem-outline {
  position: absolute;
  top: 122px;
  left: -214px;
  z-index: 0;
  width: min(54vw, 720px);
  pointer-events: none;
  opacity: 0.58;
  transform: scale(1.02);
  filter: drop-shadow(0 0 24px rgba(255, 255, 255, 0.06));
}

.left-emblem-mark {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, rgba(236, 239, 244, 0.95) 0%, rgba(174, 180, 188, 0.78) 52%, rgba(245, 247, 250, 0.92) 100%);
  -webkit-mask: url('/assets/images/xdu-logo.png') center / contain no-repeat;
  mask: url('/assets/images/xdu-logo.png') center / contain no-repeat;
}

.topbar,
.workspace {
  position: relative;
  z-index: 1;
}

.topbar {
  padding: 24px 34px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.brand-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.workspace {
  min-height: calc(100vh - 66px);
  padding: 12px 24px 32px;
}

.hero {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 8px 16px 40px;
}

.hero-copy {
  text-align: center;
}

.hero-kicker {
  margin: 0 0 14px;
  opacity: 0.94;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, #8bb1d8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
}

.hero-title {
  margin: 0;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.98;
  font-weight: 650;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, #ffffff 0%, #8bb1d8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
}

.hero-subtitle {
  max-width: 820px;
  margin: 14px auto 0;
  color: var(--text-muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.5;
}

.quick-prompts {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-prompt-card {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.02)
    ),
    rgba(255, 255, 255, 0.02);
  text-align: left;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.quick-prompt-card strong {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.quick-prompt-card span {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.quick-prompt-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.03)
    ),
    rgba(255, 255, 255, 0.03);
}

.quick-prompt-card:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
}

.conversation-panel {
  width: min(1120px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 460px;
  min-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.message {
  max-width: 82%;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.message-assistant {
  align-self: flex-start;
}

.message-user {
  align-self: flex-end;
  background: linear-gradient(
    135deg,
    rgba(0, 70, 139, 0.85) 0%,
    rgba(26, 99, 179, 0.85) 100%
  );
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 70, 139, 0.2);
}

.message-meta {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.message-body {
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  line-height: 1.65;
}

.message-body > :first-child {
  margin-top: 0;
}

.message-body > :last-child {
  margin-bottom: 0;
}

.message-body p,
.message-body ul,
.message-body ol,
.message-body blockquote,
.message-body pre,
.message-body .md-code-shell,
.message-body .md-table-wrap {
  margin: 0 0 12px;
}

.message-body h1,
.message-body h2,
.message-body h3 {
  margin: 0 0 12px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.message-body h1 {
  font-size: 1.32em;
}

.message-body h2 {
  font-size: 1.18em;
}

.message-body h3 {
  font-size: 1.05em;
}

.message-body ul,
.message-body ol {
  padding-left: 22px;
}

.message-body li + li {
  margin-top: 4px;
}

.message-body blockquote {
  padding-left: 14px;
  border-left: 3px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
}

.message-body a {
  color: #9fd0ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-body code {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.92em;
}

.message-body pre {
  margin: 0;
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.message-body pre code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  white-space: pre;
}

.md-code-shell {
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.md-code-lang {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.md-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease;
}

.md-copy-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--text);
}

.md-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  background: rgba(255, 255, 255, 0.03);
}

.md-table th,
.md-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.md-table thead th {
  color: var(--text);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

.md-table tbody tr:last-child td {
  border-bottom: 0;
}

.message-support {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.message-support-line {
  font-size: 13px;
  line-height: 1.5;
}

.message-source-hint {
  color: #8ec5ff;
}

.message-followup-hint {
  color: var(--text-muted);
}

.composer-shell {
  width: min(1120px, 100%);
  margin-top: 18px;
  padding: 14px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--panel);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.composer-shell:focus-within {
  border-color: rgba(0, 70, 139, 0.5);
  box-shadow:
    0 0 0 3px rgba(0, 70, 139, 0.15),
    0 26px 70px rgba(0, 0, 0, 0.5);
}

.composer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.composer-head strong {
  font-size: 16px;
  font-weight: 600;
}

.composer-head span {
  color: var(--text-muted);
  font-size: 14px;
}

.composer-body {
  padding-top: 12px;
}

.system-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(0, 70, 139, 0.28);
  background: rgba(0, 70, 139, 0.12);
}

.system-notice strong {
  flex: 0 0 auto;
  color: #a6d1ff;
  font-size: 14px;
}

.system-notice span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.6;
}

.prompt-input {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.prompt-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.prompt-input:focus {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.attachment-input {
  display: none;
}

.attachment-status-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.attachment-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.attachment-status-head strong {
  font-size: 15px;
  font-weight: 600;
}

.attachment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.attachment-badge[data-state="loading"] {
  background: rgba(243, 211, 140, 0.14);
  color: #f3d38c;
}

.attachment-badge[data-state="ready"] {
  background: rgba(199, 233, 186, 0.14);
  color: #c7e9ba;
}

.attachment-badge[data-state="error"] {
  background: rgba(243, 165, 165, 0.14);
  color: #f3a5a5;
}

.attachment-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.attachment-status-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.attachment-status-label {
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.attachment-status-item strong {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.attachment-followups {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.followup-chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 600;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.followup-chip:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(0, 70, 139, 0.45);
  background: rgba(0, 70, 139, 0.18);
}

.followup-chip:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.attachment-hint {
  margin: 12px 4px 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 4px 0;
}

.secondary-button {
  min-width: 96px;
  height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.secondary-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.06);
}

.secondary-button-muted {
  background: rgba(255, 255, 255, 0.015);
}

.send-button {
  min-width: 88px;
  height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00468b 0%, #17549c 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 70, 139, 0.2);
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #005bb5 0%, #1e6ac2 100%);
  box-shadow: 0 6px 16px rgba(0, 70, 139, 0.4);
}

.send-button:disabled {
  cursor: not-allowed;
  transform: none;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.32);
}

.footer-note {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 960px) {
  .topbar {
    padding: 20px 20px 0;
  }

  .workspace {
    padding: 12px 12px 18px;
  }

  .conversation-panel,
  .composer-shell,
  .quick-prompts {
    width: 100%;
  }

  .quick-prompts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attachment-status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .app-frame {
    min-height: 100vh;
    border-radius: 0;
  }

  .brand-title {
    font-size: 18px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .message {
    max-width: 100%;
  }

  .quick-prompts {
    grid-template-columns: 1fr;
  }

  .composer-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .system-notice {
    flex-direction: column;
    gap: 8px;
  }

  .attachment-actions {
    width: 100%;
  }

  .composer-foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .prompt-input {
    min-height: 150px;
  }

  .send-button,
  .secondary-button {
    width: 100%;
  }

  .md-table {
    min-width: 360px;
  }
}
.message-body h4,
.message-body h5,
.message-body h6 {
  margin: 0 0 10px;
  line-height: 1.3;
}

.message-body h4 {
  font-size: 1em;
}

.message-body h5,
.message-body h6 {
  font-size: 0.95em;
  color: var(--text-muted);
}

.message-body hr {
  margin: 14px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.message-body del {
  opacity: 0.72;
}

.md-task-list {
  list-style: none;
  padding-left: 0;
}

.md-task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.md-task-checkbox {
  margin-top: 5px;
  accent-color: #4d97df;
}

.message-followup-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-followup-label {
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-followup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-followup-chip {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.attachment-panel {
  margin-top: 12px;
}

.attachment-panel .attachment-status-card {
  margin-top: 0;
}

.attachment-toggle-button {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.attachment-toggle-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(0, 70, 139, 0.42);
  background: rgba(0, 70, 139, 0.14);
}

.attachment-toggle-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
@media (max-width: 980px) {
  .left-emblem-outline {
    top: 156px;
    left: -156px;
    width: min(62vw, 470px);
    opacity: 0.34;
  }
}

@media (max-width: 640px) {
  .left-emblem-outline {
    display: none;
  }
}