:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --line-strong: #c5ccd8;
  --brand: #176b5b;
  --brand-strong: #0e4f42;
  --brand-soft: #e8f4f1;
  --accent: #b7552d;
  --danger: #ba1a1a;
  --warning: #936c00;
  --success: #176b5b;
  --shadow: 0 16px 38px rgba(29, 41, 57, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
}

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

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 36px;
  align-items: center;
}

.login-intro h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.login-intro p {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.login-card,
.panel,
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  padding: 28px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  padding: 0 8px 8px;
}

.brand-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 11px 12px;
  background: transparent;
  color: #344054;
  text-align: left;
}

.nav button.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.user-box {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 16px 8px 0;
}

.user-name {
  font-weight: 700;
}

.user-role {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h2,
.panel h3,
.modal h3 {
  margin: 0;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
}

.panel {
  padding: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

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

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

.btn {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 14px;
  background: #fff;
  color: #344054;
  min-height: 40px;
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  background: var(--brand-strong);
}

.btn.danger {
  border-color: #f1b4b4;
  color: var(--danger);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.chat-window {
  min-height: 360px;
  max-height: 58vh;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 4px;
}

.message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 8px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.message.bot {
  justify-self: start;
  background: #eef2f6;
}

.message.user {
  justify-self: end;
  background: var(--brand);
  color: #fff;
}

.hint-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.summary-list {
  display: grid;
  gap: 9px;
}

.section-divider {
  border-top: 1px solid var(--line);
  margin: 22px 0 18px;
}

.summary-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.summary-item span:first-child {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  background: #eef2f6;
  color: #344054;
}

.badge.success {
  background: #e8f4f1;
  color: var(--success);
}

.badge.warning {
  background: #fff3cd;
  color: var(--warning);
}

.badge.danger {
  background: #fdecec;
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #fafbfc;
}

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

.notice {
  border: 1px solid #e8d6a8;
  border-radius: 8px;
  background: #fff9e8;
  color: #604900;
  padding: 12px 14px;
  line-height: 1.7;
}

.drop-zone {
  position: relative;
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fafbfc;
  padding: 18px;
  color: var(--muted);
}

.drop-zone.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.drop-zone strong {
  color: var(--text);
}

.drop-zone input {
  display: none;
}

.status-line {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.status-line.error {
  color: var(--danger);
}

.status-line.ok {
  color: var(--success);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
  z-index: 20;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 20px;
}

#toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
}

.toast {
  min-width: min(360px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 4px solid var(--success);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 13px 12px 13px 14px;
}

.toast strong {
  display: block;
  color: var(--success);
}

.toast p {
  margin: 4px 0 0;
  color: #344054;
  line-height: 1.5;
}

.toast-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.toast-close:hover {
  background: #eef2f6;
  color: var(--text);
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .login-shell,
  .app-shell,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .user-box {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 18px 14px;
  }

  .topbar,
  .row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 100%;
  }
}
