:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #e3eaf6;
  --line-strong: #c9d8ef;
  --text: #17214d;
  --muted: #69758f;
  --blue: #2f6bff;
  --blue-2: #0fb7ff;
  --blue-soft: #eaf2ff;
  --orange: #f28a2e;
  --orange-2: #ffb25f;
  --shadow: 0 20px 60px rgba(27, 54, 113, .12);
  --radius: 8px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

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

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
  background: rgba(255, 255, 255, .92);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 10;
}

.brand-mini {
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.brand-mini img {
  width: 76px;
  height: auto;
}

.brand-mini span {
  display: none;
}

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

.nav-btn {
  min-height: 62px;
  padding: 8px 6px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #5d6982;
  display: grid;
  place-items: center;
  gap: 5px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-btn:hover,
.nav-btn.active {
  background: linear-gradient(135deg, rgba(47, 107, 255, .12), rgba(15, 183, 255, .12));
  color: var(--blue);
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #edf3ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.nav-btn.active .nav-icon {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
}

.nav-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 72px;
  padding: 12px 32px;
  border-bottom: 1px solid rgba(204, 216, 236, .8);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand img {
  height: 52px;
  width: auto;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 18px;
}

.brand-copy span {
  color: var(--muted);
  font-size: 13px;
}

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

.search {
  min-width: min(440px, 35vw);
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
}

.btn,
.ghost-btn,
.icon-btn {
  height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.btn {
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 10px 26px rgba(47, 107, 255, .22);
}

.btn.orange {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  box-shadow: 0 10px 28px rgba(242, 138, 46, .22);
}

.ghost-btn {
  padding: 0 16px;
  background: #fff;
  color: var(--blue);
  border-color: var(--line-strong);
}

.icon-btn {
  width: 42px;
  padding: 0;
  background: #fff;
  color: var(--blue);
  border-color: var(--line-strong);
}

.content {
  padding: 26px 32px 48px;
}

.hero {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(115deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.9) 48%, rgba(237,245,255,.74) 100%),
    radial-gradient(circle at 76% 28%, rgba(47,107,255,.26), transparent 36%),
    radial-gradient(circle at 88% 78%, rgba(15,183,255,.24), transparent 34%),
    linear-gradient(135deg, #f6f9ff, #eef5ff);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
}

.hero-copy {
  padding: clamp(30px, 4vw, 56px);
  display: grid;
  align-content: center;
  gap: 20px;
}

.eyebrow {
  color: var(--orange);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1,
.page-title h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 4.2vw, 68px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p,
.page-title p {
  margin: 0;
  max-width: 860px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-visual {
  min-height: 280px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 28px;
}

.ai-board {
  width: min(520px, 100%);
  border: 1px solid rgba(47, 107, 255, .18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 24px 80px rgba(47, 107, 255, .14);
  overflow: hidden;
}

.ai-board-head {
  height: 48px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.dots {
  display: flex;
  gap: 7px;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfe0ff;
}

.ai-board-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 18px;
}

.ai-tile {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.ai-tile strong {
  font-size: 22px;
}

.ai-tile span {
  color: var(--muted);
  font-size: 13px;
}

.section {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 36px rgba(26, 53, 106, .07);
}

.section-head {
  padding: 22px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-head h2,
.panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.tabs,
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab,
.chip {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #5b6680;
  font-weight: 800;
}

.tab.active,
.chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

.grid {
  padding: 22px 24px 24px;
  display: grid;
  gap: 18px;
}

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

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

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

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 10px 28px rgba(35, 65, 125, .06);
  display: grid;
  gap: 14px;
  align-content: start;
}

.card:hover {
  border-color: rgba(47, 107, 255, .35);
  transform: translateY(-1px);
  transition: transform .18s ease, border-color .18s ease;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(47, 107, 255, .16), rgba(15, 183, 255, .12));
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.meta {
  color: #7a86a0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.favorite {
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: #f3f7ff;
  color: #8ba0c7;
  font-weight: 900;
}

.favorite.active {
  background: #fff4e8;
  color: var(--orange);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 36px rgba(26, 53, 106, .07);
  padding: 22px;
}

.form {
  display: grid;
  gap: 14px;
}

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

.field label {
  font-weight: 900;
  color: var(--text);
}

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

.input,
.select {
  height: 44px;
  padding: 0 12px;
}

.textarea {
  min-height: 126px;
  padding: 12px;
  resize: vertical;
  line-height: 1.7;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(47, 107, 255, .75);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}

.result {
  min-height: 220px;
  white-space: pre-wrap;
  line-height: 1.8;
  color: #253050;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,251,255,.92)),
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(47,107,255,.06) 32px);
}

.chat-shell {
  height: calc(100vh - 124px);
  min-height: 620px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.session-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.session-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  text-align: left;
  font-weight: 800;
}

.session-item.active {
  border-color: rgba(47, 107, 255, .45);
  background: var(--blue-soft);
}

.chat-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.message-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding-right: 4px;
}

.message {
  max-width: 82%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  line-height: 1.8;
  white-space: pre-wrap;
  background: #fff;
}

.message.user {
  justify-self: end;
  background: linear-gradient(135deg, rgba(47, 107, 255, .95), rgba(15, 183, 255, .92));
  color: #fff;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.notice {
  border: 1px solid rgba(242, 138, 46, .28);
  border-radius: var(--radius);
  background: #fff8f0;
  color: #7c4a1e;
  padding: 12px 14px;
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(11, 19, 46, .42);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: min(520px, 100%);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 100px rgba(10, 24, 66, .28);
  padding: 24px;
  display: grid;
  gap: 16px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 48px));
  border: 1px solid rgba(47, 107, 255, .2);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

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

@media (max-width: 1180px) {
  .grid.cards,
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .search {
    min-width: 260px;
  }
}

@media (max-width: 820px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .side {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: 74px;
    padding: 8px;
    border-right: 0;
    border-top: 1px solid var(--line);
    flex-direction: row;
    overflow-x: auto;
  }

  .brand-mini {
    display: none;
  }

  .nav {
    display: flex;
    gap: 6px;
    width: max-content;
  }

  .nav-btn {
    width: 72px;
    min-height: 56px;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
  }

  .nav-label {
    font-size: 12px;
  }

  .topbar {
    position: static;
    padding: 12px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: stretch;
  }

  .search {
    width: 100%;
    min-width: 0;
  }

  .content {
    padding: 18px 16px 100px;
  }

  .hero-copy,
  .hero-visual {
    padding: 24px;
  }

  .grid.cards,
  .grid.three,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .chat-shell {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 100%;
  }

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