:root {
  --bg: #f3f5f9;
  --panel: #fff;
  --ink: #1f2937;
  --muted: #7b8492;
  --line: #e6ebf1;
  --soft: #eef2f8;
  --brand: #16c76a;
  --brand-dark: #0a8f4a;
  --blue: #2f8df5;
  --orange: #ff5b22;
  --shadow: 0 12px 28px rgba(31, 41, 55, 0.07);
  --font: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 58px;
  padding: 0 max(28px, calc((100vw - 1540px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(27, 39, 54, 0.08);
  backdrop-filter: blur(12px);
}

.logo strong {
  display: block;
  font-size: 25px;
  letter-spacing: 0;
}

.logo strong::first-letter {
  color: #111827;
}

.logo strong {
  color: var(--brand);
}

.logo span {
  display: block;
  margin-top: 2px;
  color: #9aa3ae;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  white-space: nowrap;
}

.top-nav a {
  position: relative;
  padding: 19px 0;
  color: #2f3742;
  font-size: 15px;
}

.top-nav a.active::after,
.top-nav a:hover::after {
  position: absolute;
  right: 0;
  bottom: 9px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
  content: "";
}

.login-link {
  border-radius: 6px;
  padding: 8px 18px;
  background: #2e3442;
  color: #fff;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  width: min(1540px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

.side-nav {
  position: sticky;
  top: 80px;
  display: grid;
  align-self: start;
  gap: 2px;
  padding: 10px 0;
}

.side-nav a {
  border-left: 3px solid transparent;
  padding: 8px 16px;
  color: #5d6673;
  font-size: 14px;
}

.side-nav a.active,
.side-nav a:hover {
  border-left-color: var(--orange);
  color: var(--orange);
  font-weight: 800;
}

.content {
  min-width: 0;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 420px;
  gap: 22px;
  align-items: start;
  min-height: 124px;
}

.hero-brand {
  padding: 6px 0 0;
}

.hero-brand h1 {
  margin: 0;
  color: #111827;
  font-size: 44px;
  line-height: 0.95;
}

.hero-brand h1::after {
  color: var(--brand);
  content: "";
}

.hero-brand p {
  margin: 8px 0 0;
  color: #a4abb5;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.search-zone {
  padding-top: 0;
}

.search-tabs {
  display: flex;
  gap: 26px;
  align-items: center;
  padding: 0 14px 10px;
}

.search-tabs button {
  position: relative;
  border: 0;
  background: transparent;
  color: #8b929d;
  cursor: pointer;
  font-size: 16px;
}

.search-tabs button.active {
  color: #101827;
  font-weight: 800;
}

.search-tabs button.active::after {
  position: absolute;
  right: 42%;
  bottom: -7px;
  left: 42%;
  height: 5px;
  border-radius: 999px;
  background: #111827;
  content: "";
}

.nav-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px #edf1f6;
}

.nav-search input,
.nav-search button {
  min-width: 0;
  border: 0;
  outline: 0;
}

.nav-search input {
  padding: 13px 18px;
  color: #4b5563;
  font-size: 16px;
}

.nav-search button {
  background: #fff;
  color: #687284;
  cursor: pointer;
  font-weight: 800;
}

.quick-words {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 14px 0;
}

.quick-words a {
  color: #7b8492;
  font-size: 14px;
}

.quick-words a:hover {
  color: var(--brand-dark);
}

.news-card,
.panel,
.link-panel,
.time-strip,
.tabs-bar {
  border-radius: 8px;
  background: var(--panel);
}

.news-card {
  position: relative;
  overflow: hidden;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.news-card::after {
  position: absolute;
  top: 14px;
  right: 58px;
  color: rgba(28, 70, 128, 0.04);
  content: "Weibo Hot Search";
  font-size: 22px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
  white-space: nowrap;
}

.news-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.news-title strong {
  position: relative;
  padding-left: 14px;
  font-size: 17px;
}

.news-title strong::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #111827;
  content: "";
  transform: translateY(-50%);
}

.news-title a,
.link-panel header a {
  color: #9aa3ae;
  font-size: 13px;
}

.news-title a::after {
  content: "›";
  padding-left: 2px;
}

.news-window {
  position: relative;
  z-index: 1;
  height: 88px;
  overflow: hidden;
}

.news-list {
  display: flex;
  flex-direction: column;
  transition: transform 0.45s ease;
  will-change: transform;
}

.news-item {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  overflow: hidden;
  min-height: 28px;
  padding: 3px 0;
  color: #5d6673;
  font-size: 14px;
}

.news-item::before {
  color: #aab2bd;
  content: "•";
}

.news-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-item em {
  color: #9aa3ae;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.news-item:hover span {
  color: var(--brand-dark);
}

.time-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #929aa6;
  backdrop-filter: blur(12px);
}

.time-strip strong {
  color: #687284;
  font-weight: 500;
}

.time-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.time-strip b {
  font-size: 16px;
  line-height: 1;
}

.tabs-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 6px 8px;
}

.tabs-bar a {
  flex: 1 1 0;
  border-radius: 999px;
  padding: 6px 10px;
  color: #777f8b;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.tabs-bar a.active,
.tabs-bar a:hover {
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.tab-stage {
  margin-bottom: 10px;
}

.tab-stage:empty {
  display: none;
}

.tab-stage .panel,
.tab-stage .link-panel {
  margin-top: 0;
}

.ai-assistant {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 12px;
  margin-top: 14px;
  align-items: stretch;
}

.ai-workspace {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.ai-workspace.history-collapsed {
  grid-template-columns: 48px minmax(0, 1fr);
}

.ai-history,
.ai-chat,
.ai-templates {
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ai-history {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
}

.ai-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 12px;
}

.ai-history-title {
  color: #273142;
  font-size: 14px;
}

.ai-history-head button,
.ai-new-chat,
.ai-history-item,
.ai-history-delete {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.ai-history-head button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: #eef2f8;
  color: #596375;
  font-size: 20px;
  line-height: 1;
}

.ai-new-chat {
  margin: 10px 12px;
  border-radius: 8px;
  padding: 9px 10px;
  background: #2e3442;
  color: #fff;
  font-weight: 800;
}

.ai-history-list {
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  padding: 0 8px 12px;
}

.ai-history-empty {
  padding: 12px 8px;
  color: #98a1ad;
  font-size: 13px;
}

.ai-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 4px;
  align-items: center;
  border-radius: 8px;
  padding: 8px 6px 8px 9px;
  background: transparent;
  color: #4d5665;
  text-align: left;
}

.ai-history-item:hover,
.ai-history-item.active {
  background: #f0f5ff;
  color: #1f5fbf;
}

.ai-history-item span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-history-item small {
  display: block;
  margin-top: 2px;
  color: #9aa3ae;
  font-size: 11px;
  font-weight: 600;
}

.ai-history-delete {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  color: #9aa3ae;
}

.ai-history-delete:hover {
  background: #fff;
  color: #ef4444;
}

.ai-workspace.history-collapsed .ai-history {
  min-width: 48px;
}

.ai-workspace.history-collapsed .ai-history-title,
.ai-workspace.history-collapsed .ai-new-chat,
.ai-workspace.history-collapsed .ai-history-list {
  display: none;
}

.ai-workspace.history-collapsed .ai-history-head {
  justify-content: center;
  padding: 10px;
}

.ai-workspace.history-collapsed #aiHistoryToggle {
  transform: rotate(180deg);
}

.ai-chat {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  height: 620px;
  min-width: 0;
  overflow: hidden;
}

.ai-chat > * {
  min-width: 0;
}

.ai-chat > header {
  grid-row: 1;
}

.ai-account {
  grid-row: 2;
}

.ai-messages {
  grid-row: 3;
}

.ai-attachments {
  grid-row: 4;
}

.ai-input {
  grid-row: 5;
}

.ai-chat header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.ai-chat header span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-chat h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.ai-header-account {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: min(520px, 58%);
}

#aiStatus {
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2f8;
  color: #687284;
  font-size: 12px;
  white-space: nowrap;
}

#aiStatus.ready {
  background: #e8fff3;
  color: var(--brand-dark);
}

.ai-account {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
}

.ai-account[hidden],
.ai-userbar[hidden] {
  display: none !important;
}

.ai-account-forms {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.ai-account input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 16px;
  outline: none;
}

.ai-account input:focus {
  border-color: var(--blue);
}

.ai-account button,
.ai-userbar button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: #eef2f8;
  color: #4a5360;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.ai-account button[data-auth-action="register"] {
  background: var(--blue);
  color: #fff;
}

.ai-userbar {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.ai-userbar span {
  max-width: 280px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f0f6ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-userbar button {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2f8;
  color: #687284;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
  padding: 16px;
  background: #fbfcff;
  scrollbar-width: thin;
}

.ai-messages:empty::before {
  display: grid;
  min-height: 100%;
  place-items: center;
  color: #9aa3ae;
  content: "输入问题，或选择右侧快捷模板开始";
  font-size: 14px;
}

.ai-message {
  max-width: 82%;
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.62;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-message p {
  margin: 0;
}

.ai-message-content {
  display: grid;
  gap: 6px;
}

.ai-message-content p,
.ai-message-content ul,
.ai-message-content ol,
.ai-message-content pre,
.ai-message-content blockquote {
  margin: 0;
}

.ai-message-content ul,
.ai-message-content ol {
  padding-left: 18px;
}

.ai-message-content code {
  border-radius: 5px;
  padding: 1px 4px;
  background: rgba(15, 23, 42, 0.08);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.ai-message-content pre {
  overflow-x: auto;
  border-radius: 8px;
  padding: 10px;
  background: #111827;
  color: #eef2ff;
}

.ai-message-content pre code {
  padding: 0;
  background: transparent;
}

.ai-message-content blockquote {
  border-left: 3px solid #c7d2fe;
  padding-left: 10px;
  color: #5b6472;
}

.ai-message-images,
.ai-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-message-images img {
  width: 110px;
  height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  object-fit: cover;
}

.ai-message.bot {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: #fff;
  color: #384252;
}

.ai-message.thinking {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  max-width: min(360px, 92%);
  background: linear-gradient(135deg, #fff 0%, #f8fbff 100%);
}

.ai-intel {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: conic-gradient(from 40deg, #2f8df5, #8f7cff, #10cfa3, #2f8df5);
  box-shadow: 0 8px 18px rgba(47, 141, 245, 0.25);
  animation: aiPulse 1.6s ease-in-out infinite;
}

.ai-intel::after {
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 7px;
  content: "";
}

.ai-thinking-text {
  display: grid;
  gap: 3px;
}

.ai-thinking-text strong {
  color: #283142;
  font-size: 13px;
}

.ai-thinking-dots {
  display: inline-flex;
  gap: 4px;
}

.ai-thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8aa2c6;
  animation: aiDots 1.2s ease-in-out infinite;
}

.ai-thinking-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.ai-thinking-dots i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes aiPulse {
  0%,
  100% {
    filter: saturate(1);
    transform: scale(1);
  }
  50% {
    filter: saturate(1.35);
    transform: scale(1.04);
  }
}

@keyframes aiDots {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.ai-message.user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 141, 245, 0.18);
}

.ai-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px;
  background: #fff;
}

.ai-attachments {
  border-top: 1px solid var(--line);
  padding: 8px 10px 0;
  background: #fff;
}

.ai-attachment {
  position: relative;
  overflow: hidden;
  width: 72px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.ai-attachment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-attachment button {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.76);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.ai-input textarea {
  width: 100%;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  line-height: 1.45;
}

.ai-input textarea:focus {
  border-color: var(--blue);
}

.ai-input button[type="submit"] {
  align-self: center;
  border: 0;
  border-radius: 8px;
  height: 58px;
  min-width: 78px;
  padding: 0 18px;
  background: #2e3442;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.ai-attach {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fd;
  color: var(--blue);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.ai-input button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.ai-templates {
  display: grid;
  align-content: start;
  gap: 9px;
  height: 620px;
  padding: 14px;
  overflow-y: auto;
}

.ai-templates::before {
  color: #1f2937;
  content: "快捷模板";
  font-size: 16px;
  font-weight: 800;
}

.ai-templates button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: #4a5360;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.ai-templates button:hover {
  border-color: #bdd8ff;
  background: #f4f8ff;
  color: var(--blue);
}

body.tabs-ready [data-tab-source] {
  display: none;
}

body.tabs-ready .content > .columns {
  display: none;
}

.panel {
  padding: 20px 20px 18px;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(82px, 1fr));
  gap: 12px 16px;
}

.site-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 9px 6px;
  color: #3f4652;
  font-size: 14px;
  text-align: center;
}

.site-card:hover {
  background: #f2f5fb;
}

.site-card img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
}

.brand-letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #edf6ff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

.flag-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-size: 31px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px #edf1f6;
}

.link-panel {
  margin-top: 12px;
  padding: 15px 18px;
}

.link-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.link-panel h2 {
  margin: 0;
  font-size: 17px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 22px;
  padding-top: 12px;
}

.link-grid a,
.compact-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  color: #4a5360;
}

.link-grid a:hover,
.compact-list a:hover {
  color: var(--brand-dark);
}

.link-grid span,
.compact-list span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  background: #edf6ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.tool-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 5px;
  object-fit: contain;
}

.text-icon {
  flex: 0 0 auto;
}

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

.compact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  padding-top: 12px;
}

@media (max-width: 1200px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .site-grid {
    grid-template-columns: repeat(5, minmax(82px, 1fr));
  }

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

@media (max-width: 860px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr auto;
    padding: 12px 18px;
  }

  .top-nav {
    grid-column: 1 / -1;
    gap: 18px;
    order: 3;
  }

  .layout {
    display: block;
    width: min(100vw - 24px, 760px);
    padding-top: 20px;
  }

  .side-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    margin-bottom: 14px;
    white-space: nowrap;
  }

  .hero-brand h1 {
    font-size: 44px;
  }

  .search-tabs {
    gap: 18px;
    overflow-x: auto;
    padding-left: 4px;
  }

  .time-strip,
  .columns {
    grid-template-columns: 1fr 1fr;
  }

  .tabs-bar {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 6px;
  }

  .tabs-bar a {
    flex: 0 0 auto;
    min-width: 102px;
    font-size: 14px;
  }

  .site-grid {
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    gap: 10px;
  }

  .ai-assistant {
    grid-template-columns: 1fr;
  }

  .ai-workspace {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .ai-workspace.history-collapsed {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .ai-chat {
    height: 540px;
  }

  .ai-templates {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .login-link {
    padding: 9px 14px;
  }

  .hero-brand p {
    font-size: 18px;
  }

  .nav-search {
    grid-template-columns: minmax(0, 1fr) 62px;
  }

  .site-grid,
  .link-grid,
  .compact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-chat header,
  .ai-account-forms {
    grid-template-columns: 1fr;
  }

  .ai-input {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .ai-input button[type="submit"] {
    grid-column: 1 / -1;
    width: 100%;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .ai-chat header {
    display: grid;
  }

  .ai-header-account {
    justify-content: flex-start;
    min-width: 0;
    max-width: 100%;
  }

  .ai-userbar {
    width: 100%;
  }

  .ai-userbar span {
    max-width: none;
    flex: 1 1 auto;
  }

  .ai-workspace,
  .ai-workspace.history-collapsed {
    grid-template-columns: 1fr;
  }

  .ai-history {
    min-height: 0;
    max-height: 210px;
  }

  .ai-workspace.history-collapsed .ai-history {
    max-height: 48px;
  }

  .ai-workspace.history-collapsed .ai-history-title {
    display: inline;
  }

  .ai-message {
    max-width: 94%;
  }

  .ai-input button[type="submit"] {
    min-height: 44px;
  }

  .ai-chat {
    height: 560px;
  }

  .ai-templates {
    grid-template-columns: 1fr;
  }
}
