:root {
  --blue: #1687f7;
  --green: #13ce66;
  --ink: #182235;
  --muted: #64748b;
  --line: #e5eaf2;
  --bg: #f4f7fb;
  --soft: #eef7ff;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 85% 4%, rgba(22, 135, 247, 0.16), transparent 28%),
    radial-gradient(circle at 12% -8%, rgba(19, 206, 102, 0.18), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%);
  color: var(--ink);
  font-family: Inter, Arial, "Microsoft YaHei", sans-serif;
  margin: 0;
  min-height: 100vh;
  padding-left: 86px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  min-height: 44px;
  padding: 10px 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

input,
select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d8dee8;
  border-radius: 14px;
  color: var(--ink);
  min-height: 44px;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 135, 247, 0.12);
}

.primary {
  background: linear-gradient(180deg, #168bff 0%, var(--blue) 100%);
  box-shadow: 0 12px 28px rgba(0, 122, 255, 0.22);
  color: #ffffff;
}

.secondary {
  background: rgba(22, 135, 247, 0.1);
  color: #0b63ce;
}

.app-sidebar {
  background: rgba(15, 23, 42, 0.86) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 0 28px 28px 0 !important;
  box-shadow: 18px 0 48px rgba(15, 23, 42, 0.18) !important;
  color: #ffffff;
  display: flex !important;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 24px) !important;
  left: 12px !important;
  overflow: hidden !important;
  padding: 14px 10px !important;
  position: fixed !important;
  top: 12px !important;
  transition: width 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  width: 62px !important;
  z-index: 1000;
}

.app-sidebar:hover,
.app-sidebar:focus-within {
  background: rgba(15, 23, 42, 0.94) !important;
  width: 226px !important;
}

.app-sidebar a {
  color: inherit;
  text-decoration: none;
}

.app-sidebar-brand,
.app-nav-item {
  align-items: center;
  border-radius: 18px;
  display: grid !important;
  gap: 12px !important;
  grid-template-columns: 40px 1fr !important;
  min-height: 48px !important;
  padding: 4px !important;
  white-space: nowrap;
}

.app-sidebar-logo,
.app-nav-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px !important;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 40px !important;
  font-size: 16px !important;
  font-weight: 950;
  height: 40px !important;
  justify-content: center;
  width: 40px !important;
}

.app-sidebar-logo {
  background: linear-gradient(145deg, #fff174 0%, #ffd60a 58%, #ffc400 100%);
  color: #101827;
}

.app-sidebar-title,
.app-nav-label {
  min-width: 140px !important;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-sidebar:hover .app-sidebar-title,
.app-sidebar:hover .app-nav-label,
.app-sidebar:focus-within .app-sidebar-title,
.app-sidebar:focus-within .app-nav-label {
  opacity: 1;
  transform: translateX(0);
}

.app-sidebar-title strong,
.app-nav-label {
  display: block;
  font-size: 15px !important;
  font-weight: 950;
}

.app-sidebar-title small {
  color: rgba(255, 255, 255, 0.62);
  display: block;
  font-size: 12px !important;
  margin-top: 2px;
}

.app-sidebar-nav {
  display: grid;
  gap: 8px;
}

.app-nav-item.active {
  background: linear-gradient(135deg, #1687f7, #13ce66);
  color: #ffffff !important;
  box-shadow: 0 14px 30px rgba(22, 135, 247, 0.25);
}

.assistant-page {
  max-width: 1460px;
  padding: 36px 22px 64px;
}

.assistant-hero {
  align-items: center;
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.assistant-mark {
  align-items: center;
  background: linear-gradient(135deg, #10233d, #1687f7 52%, #13ce66);
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(22, 135, 247, 0.24);
  color: #fff;
  display: flex;
  font-size: 25px;
  font-weight: 950;
  height: 62px;
  justify-content: center;
  width: 62px;
}

.assistant-hero h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 0.98;
  margin: 2px 0;
}

.assistant-hero p,
.status,
.eyebrow {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.assistant-store-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  margin-left: auto;
  min-width: 310px;
  padding: 9px 12px;
}

.assistant-store-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.assistant-command,
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.2);
}

.assistant-command {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(160px, 0.7fr) minmax(160px, 0.7fr) auto minmax(280px, 1.6fr);
  margin-bottom: 16px;
  padding: 18px;
}

.assistant-command label {
  display: grid;
  gap: 7px;
}

.assistant-command label span {
  color: #4b5563;
  font-size: 13px;
  font-weight: 950;
}

.assistant-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 290px minmax(520px, 1fr) 310px;
}

.panel {
  padding: 18px;
}

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

.panel-head h2,
.chat-head h2 {
  font-size: 22px;
  line-height: 1.1;
  margin: 4px 0 0;
}

.assistant-tools {
  display: grid;
  gap: 10px;
}

.tool-card {
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border: 1px solid #e6edf7;
  border-radius: 18px;
  color: var(--ink);
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 14px;
  text-align: left;
}

.tool-card:hover {
  border-color: rgba(22, 135, 247, 0.36);
  transform: translateY(-1px);
}

.tool-card strong {
  font-size: 15px;
}

.tool-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.assistant-chat {
  min-height: 680px;
}

.chat-actions {
  display: flex;
  gap: 8px;
}

.chat-messages {
  display: grid;
  gap: 12px;
  max-height: 540px;
  min-height: 520px;
  overflow: auto;
  padding: 4px;
}

.message {
  border-radius: 20px;
  line-height: 1.58;
  padding: 14px 16px;
}

.message.user {
  background: #e8f3ff;
  justify-self: end;
  max-width: 78%;
}

.message.assistant {
  background: #f8fbff;
  border: 1px solid #e6edf7;
}

.message h3 {
  margin: 0 0 8px;
}

.message p {
  margin: 6px 0;
}

.message ul,
.message ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.assistant-input {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 14px;
}

.assistant-input input {
  min-height: 52px;
}

.snapshot-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.snapshot-grid article {
  background: #f8fbff;
  border: 1px solid #e6edf7;
  border-radius: 18px;
  padding: 14px;
}

.snapshot-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 950;
}

.snapshot-grid strong {
  display: block;
  font-size: 27px;
  margin-top: 6px;
}

.next-actions {
  margin-top: 16px;
}

.next-actions h3 {
  font-size: 16px;
  margin: 0 0 10px;
}

.next-actions ol {
  color: #334155;
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.quick-links {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.quick-links a {
  background: rgba(22, 135, 247, 0.1);
  border-radius: 999px;
  color: #0b63ce;
  font-weight: 900;
  padding: 10px 14px;
  text-align: center;
  text-decoration: none;
}

.status {
  font-size: 13px;
  line-height: 1.45;
}

.error-text {
  color: #c5222a !important;
}

@media (max-width: 1280px) {
  .assistant-layout {
    grid-template-columns: 1fr;
  }

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

  .assistant-summary {
    order: -1;
  }

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

@media (max-width: 900px) {
  body {
    padding-left: 0 !important;
  }

  .app-sidebar {
    border-radius: 0 !important;
    height: auto !important;
    left: 0 !important;
    position: static !important;
    top: 0 !important;
    width: 100% !important;
  }

  .app-sidebar:hover,
  .app-sidebar:focus-within {
    width: 100% !important;
  }

  .app-sidebar-brand,
  .app-nav-label,
  .app-sidebar-title {
    display: none !important;
  }

  .app-sidebar-nav {
    display: flex;
    overflow-x: auto;
  }

  .app-nav-item {
    min-height: 54px !important;
    min-width: 54px;
    padding: 0 !important;
  }

  .app-nav-icon {
    flex-basis: 54px !important;
    height: 54px !important;
    width: 54px !important;
  }

  .assistant-page {
    padding: 18px 14px 34px;
  }

  .assistant-hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .assistant-store-card {
    margin-left: 0;
    min-width: 100%;
  }

  .assistant-command,
  .assistant-tools,
  .assistant-input {
    grid-template-columns: 1fr;
  }

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