:root {
  color-scheme: light;
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-alt: #f3f4f1;
  --ink: #171717;
  --muted: #6b6f76;
  --line: #e4e5e1;
  --strong-line: #cfd1ca;
  --accent: #111111;
  --green: #287c52;
  --blue: #315f97;
  --red: #b3443c;
  --shadow: 0 20px 60px rgba(23, 23, 23, 0.09);
  --layout-max: 1600px;
  --layout-gutter: clamp(20px, 3vw, 56px);
  --layout-width: min(var(--layout-max), calc(100vw - var(--layout-gutter) * 2));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html[data-restore-view] #landingView {
  display: none !important;
}

html[data-restore-view] #appShell {
  display: block !important;
}

html[data-restore-view]:not([data-restore-view="dashboard"]) #dashboardView {
  display: none !important;
}

html[data-restore-view="pricing"] #dashboardView {
  display: none !important;
}

html[data-restore-view="chat"] #chatWorkspace {
  display: grid !important;
}

html[data-restore-view="tools"] #toolsView {
  display: block !important;
}

html[data-restore-view="api"] #apiView {
  display: block !important;
}

html[data-restore-view="pricing"] #pricingView {
  display: block !important;
}

html[data-restore-view="chat"] body {
  overflow: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: 32px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 0 max(var(--layout-gutter), calc((100vw - var(--layout-width)) / 2));
  background: rgba(251, 251, 250, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: #111;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 56px;
  justify-self: center;
  color: #343434;
  font-size: 15px;
}

.nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: #111;
}

.nav-links a.active {
  color: #111;
  font-weight: 800;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: #111;
  border-radius: 999px;
}

.section-lead {
  margin: 0 auto 28px;
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.tool-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.landing-doc-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.landing-doc-bar span {
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.landing-doc-link {
  min-height: 34px;
  padding: 0 14px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.message.error {
  color: #8f2f2a;
  background: #fff1f0;
  border: 1px solid #f0c8c4;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
  position: relative;
  z-index: 2;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.user-menu {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.user-menu[hidden] {
  display: none;
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 8px 4px 4px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 10px;
}

.account-trigger:hover {
  background: #f2f3f0;
}

.user-avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: #315ce8;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(49, 92, 232, 0.2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.account-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
}

.account-copy > span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

#userEmail {
  max-width: 260px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chevron {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 136px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.account-dropdown[hidden] {
  display: none;
}

.account-dropdown button {
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.account-dropdown button:hover {
  background: #f2f3f0;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 26px rgba(17, 17, 17, 0.16);
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--strong-line);
}

.ghost-button {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.large {
  min-height: 50px;
  padding: 0 22px;
}

main {
  overflow: hidden;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(430px, 1.1fr);
  gap: 32px;
  align-items: center;
  width: var(--layout-width);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 16px 0 8px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(46px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 600px;
  margin: 16px 0;
  color: #45484d;
  font-size: 19px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.trust-row span {
  padding: 8px 12px;
  color: #3e423f;
  background: #eef0ec;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.workspace-preview {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.preview-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #f5f6f3;
}

.preview-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d8dad5;
}

.preview-body {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  min-height: 430px;
}

.preview-doc {
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(49, 95, 151, 0.12), transparent 38%),
    #f2f3ef;
  border-right: 1px solid var(--line);
}

.pdf-page {
  width: min(250px, 100%);
  aspect-ratio: 0.72;
  padding: 28px;
  background: #fff;
  border: 1px solid #dedfdb;
  box-shadow: 0 18px 34px rgba(20, 20, 20, 0.12);
}

.pdf-title,
.pdf-line {
  height: 10px;
  margin-bottom: 12px;
  background: #d8dcd5;
  border-radius: 2px;
}

.pdf-title {
  width: 56%;
  height: 20px;
  margin-bottom: 22px;
  background: #141414;
}

.pdf-line.wide {
  width: 92%;
}

.pdf-line {
  width: 74%;
}

.pdf-line.short {
  width: 48%;
}

.pdf-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 96px;
  margin: 26px 0;
  padding: 12px;
  background: #f3f5f0;
  border: 1px solid var(--line);
}

.pdf-chart i {
  flex: 1;
  background: var(--blue);
}

.pdf-chart i:nth-child(1) {
  height: 32%;
}
.pdf-chart i:nth-child(2) {
  height: 78%;
}
.pdf-chart i:nth-child(3) {
  height: 55%;
}
.pdf-chart i:nth-child(4) {
  height: 88%;
}

.preview-chat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 34px;
  background: #fff;
}

.bubble {
  max-width: 86%;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 15px;
}

.bubble.user {
  align-self: flex-end;
  color: #fff;
  background: #111;
  border-bottom-right-radius: 5px;
}

.bubble.assistant {
  align-self: flex-start;
  background: #f0f2ed;
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.quick-grid button {
  min-height: 38px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.app-grid,
.tools-section,
.api-section,
.pricing-section {
  width: var(--layout-width);
  margin: 0 auto 20px;
  padding: 16px 0 8px;
}

.tool-card input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.app-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.library-panel,
.chat-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.library-panel {
  position: sticky;
  top: 92px;
  overflow: hidden;
}

.panel-heading,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.chat-header > div {
  min-width: 0;
  flex: 1;
}

#activeDocTitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#openPdfLink {
  flex: 0 0 auto;
  white-space: nowrap;
}

.document-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding: 10px;
}

.doc-item {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.doc-item.active {
  border-color: #111;
  box-shadow: inset 4px 0 0 #111;
}

.doc-name {
  font-weight: 800;
}

.doc-meta {
  color: var(--muted);
  font-size: 13px;
}

.chat-panel {
  overflow: hidden;
}

.summary-box {
  margin: 12px 22px 0;
  padding: 12px 16px;
  color: #3f4543;
  background: #f3f5f0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 360px;
  max-height: 560px;
  overflow: auto;
  padding: 16px;
}

.message {
  max-width: min(760px, 88%);
  padding: 13px 15px;
  white-space: pre-wrap;
  border-radius: 12px;
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: #111;
  border-bottom-right-radius: 5px;
}

.message.assistant {
  align-self: flex-start;
  background: #f6f7f4;
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}

.message.assistant.is-typing {
  display: inline-flex;
  align-items: center;
  min-width: 54px;
  min-height: 44px;
  padding: 13px 18px;
}

.typing-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa3ad;
  animation: typingDot 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingDot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbfbfa;
}

.chat-input-row input,
.tool-card input[type="text"] {
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--strong-line);
  border-radius: 8px;
}

.section-heading {
  margin-bottom: 16px;
}

.tool-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tool-card,
.price-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  align-content: start;
  position: relative;
  min-width: 0;
  min-height: 340px;
  padding: 20px 18px 18px;
  background: #fff;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #d5dbe4;
  box-shadow: 0 14px 36px rgba(23, 23, 23, 0.08);
}

.tool-card p,
.price-card li,
.api-copy p {
  color: var(--muted);
}

.tool-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: #111;
  border-radius: 8px;
  font-weight: 900;
}

.tool-card label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px dashed var(--strong-line);
  border-radius: 8px;
  font-weight: 700;
}

.tool-card output {
  min-height: 22px;
  color: var(--green);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.api-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
  align-items: stretch;
}

.api-copy,
pre {
  margin: 0;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

pre {
  overflow: auto;
  color: #e7e7e7;
  background: #151515;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.metric-row span {
  padding: 10px 12px;
  background: #f4f5f1;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.price-card h3 {
  color: #07111f;
  font-size: 26px;
  line-height: 1.1;
}

.price-card.featured {
  border-color: #2f6bed;
  box-shadow: 0 8px 18px rgba(47, 107, 237, 0.16);
}

.popular-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 16px;
  color: #fff;
  background: #2f6bed;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  transform: translateX(-50%);
  white-space: nowrap;
  box-shadow: 0 5px 12px rgba(47, 107, 237, 0.24);
}

.price {
  margin: 0;
  color: #07111f;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.price span {
  margin-left: 2px;
  color: #667085;
  font-size: 20px;
  font-weight: 600;
}

.billing-note {
  margin: -8px 0 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.price-card ul {
  display: grid;
  align-content: start;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.price-card li {
  position: relative;
  padding-left: 28px;
  color: #344054;
  font-size: 15px;
}

.price-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #2074ff;
  font-weight: 900;
}

.price-card .secondary-button,
.price-card .primary-button {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  border-radius: 7px;
  font-size: 16px;
}

.price-card .primary-button {
  background: #2f6bed;
  box-shadow: none;
}

.price-card .secondary-button {
  border-color: #cfd6e3;
}

.pricing-heading {
  text-align: center;
}

.pricing-current {
  margin: 12px 0 0;
  color: var(--blue);
  font-weight: 700;
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.pricing-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 24px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pricing-card:hover {
  transform: translateY(-2px);
}

.pricing-card-featured {
  border-color: #2f6bed;
  box-shadow: 0 12px 32px rgba(47, 107, 237, 0.14);
}

.pricing-card.is-current {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(40, 124, 82, 0.15);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 999px;
  background: #2f6bed;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.pricing-tier {
  font-size: 22px;
  font-weight: 800;
}

.pricing-price {
  font-size: 36px;
  line-height: 1;
}

.pricing-price span {
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.pricing-limit {
  margin: 0;
  color: var(--muted);
}

.pricing-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.pricing-features li {
  position: relative;
  padding-left: 22px;
  color: #344054;
}

.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #2f6bed;
  font-weight: 800;
}

.pricing-note {
  margin: 0 0 16px;
  text-align: center;
  color: var(--muted);
}

.pricing-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
}

.pricing-wechat {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 12;
  flex-shrink: 0;
}

.pricing-wechat-btn {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.pricing-wechat-btn:hover .pricing-wechat-hint {
  color: #111;
}

.pricing-wechat img {
  display: block;
  width: 120px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.pricing-wechat-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wechat-qr-modal {
  width: min(380px, 92vw);
  text-align: center;
}

.wechat-qr-large {
  display: block;
  width: min(300px, 78vw);
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.wechat-qr-caption {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.pricing-bottom-main {
  flex: 1;
  min-width: 0;
}

.pricing-back-btn {
  display: block;
  margin: 0 auto;
}

.info-dot {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  margin-left: 4px;
  padding: 0;
  color: #64748b;
  background: #fff;
  border: 1px solid #98a2b3;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: text-top;
}

.bottom-cta {
  width: 100%;
  margin-top: 24px;
  background: #062f2f;
}

.bottom-cta::after {
  content: "";
  display: block;
  height: 48px;
  background: #fff;
}




.bottom-cta-inner {
  display: grid;
  justify-items: center;
  gap: 28px;
  width: var(--layout-width);
  margin: 0 auto;
  padding: 64px 0 60px;
  text-align: center;
}

.bottom-cta h2 {
  margin: 0;
  color: #fff;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
}

.bottom-cta p {
  margin: 0;
  color: #c7d7db;
  font-size: 19px;
  font-weight: 700;
}

.bottom-cta-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.cta-primary,
.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 6px;
  font-weight: 800;
  border: 1px solid transparent;
}

.cta-primary {
  color: #fff;
  background: #ff612f;
}

.cta-secondary {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.38);
}

.cta-secondary::after {
  content: "→";
  margin-left: 6px;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 120;
  min-width: 280px;
  max-width: min(520px, calc(100vw - 40px));
  padding: 11px 18px;
  color: #303133;
  text-align: center;
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.success {
  color: #67c23a;
  background: #f0f9eb;
  border-color: #e1f3d8;
}

.toast.error {
  color: #f56c6c;
  background: #fef0f0;
  border-color: #fde2e2;
}

.toast.warning {
  color: #e6a23c;
  background: #fdf6ec;
  border-color: #faecd8;
}

.toast.info {
  color: #409eff;
  background: #ecf5ff;
  border-color: #d9ecff;
}

.empty-state {
  padding: 26px 16px;
  color: var(--muted);
  text-align: center;
  background: #f7f8f5;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

@media (max-width: 980px) {
  .site-header {
    padding: 0 18px;
  }

  .nav-links {
    display: none;
  }

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

  .hero-section {
    min-height: auto;
    padding-top: 42px;
  }

  .hero-copy {
    padding-top: 4px;
  }

  .library-panel {
    position: static;
  }

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

@media (max-width: 640px) {
  .site-header {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero-section,
  .app-grid,
  .tools-section,
  .api-section,
  .pricing-section,
  .bottom-cta-inner,
  .app-page,
  .dashboard-inner,
  .landing-body-panel,
  .landing-preview,
  .landing-hero-inner {
    width: var(--layout-width);
  }

  .bottom-cta-inner {
    padding: 78px 0 74px;
  }

  .bottom-cta h2 {
    font-size: 42px;
  }

  .bottom-cta p {
    font-size: 16px;
  }

  .workspace-preview {
    border-radius: 12px;
  }

  .preview-body {
    grid-template-columns: 1fr;
  }

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

  .quick-grid,
  .chat-input-row,
  .tool-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-bottom {
    align-items: center;
  }

  .pricing-wechat {
    right: 12px;
    bottom: 12px;
  }

  .pricing-wechat img {
    width: 104px;
  }

  .api-note p {
    white-space: normal;
  }

  .pricing-bottom-main {
    width: 100%;
  }

  .message {
    max-width: 100%;
  }

}

.auth-page {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 72px 20px 88px;
  overflow: auto;
  background: linear-gradient(145deg, #dce8ff 0%, #edf2ff 28%, #f6f9ff 55%, #e6efff 100%);
}

.auth-page[hidden] {
  display: none;
}

.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-bg::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(72, 110, 255, 0.18) 0%, transparent 68%);
  border-radius: 50%;
}

.auth-bg::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  bottom: -140px;
  left: -100px;
  background: radial-gradient(circle, rgba(88, 140, 255, 0.16) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-shape {
  position: absolute;
  opacity: 0.55;
}

.auth-shape-a {
  width: 120px;
  height: 120px;
  top: 18%;
  left: 12%;
  border: 2px solid rgba(59, 91, 219, 0.12);
  background: rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  transform: rotate(18deg);
}

.auth-shape-b {
  width: 80px;
  height: 80px;
  bottom: 22%;
  right: 14%;
  border: 2px solid rgba(59, 91, 219, 0.10);
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.auth-shape-c {
  width: 520px;
  height: 520px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(72, 110, 255, 0.14) 0%, transparent 68%);
  border-radius: 50%;
}

.auth-shape-d {
  width: 420px;
  height: 420px;
  bottom: -140px;
  left: -100px;
  background: radial-gradient(circle, rgba(88, 140, 255, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-center {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 28px;
  justify-items: center;
  width: min(440px, 92vw);
}

.auth-header-brand {
  position: static;
  transform: none;
}

.auth-brand-name {
  color: #3b5bdb;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.auth-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 220px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(30, 60, 120, 0.08);
  backdrop-filter: blur(12px);
}

.auth-float-left {
  left: max(24px, 6vw);
  bottom: 18%;
}

.auth-float-right {
  right: max(24px, 6vw);
  top: 22%;
}

.auth-float-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: #3b5bdb;
  background: #eef2ff;
  border-radius: 10px;
  font-size: 16px;
}

.auth-float-copy strong {
  display: block;
  margin-bottom: 4px;
  color: #1f2937;
  font-size: 13px;
}

.auth-float-copy p {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

.auth-card {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 40px 36px 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(30, 60, 120, 0.12), 0 6px 20px rgba(30, 60, 120, 0.06);
  display: grid;
  gap: 16px;
}

.auth-card h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  color: #111827;
}

.auth-subtitle {
  text-align: center;
  margin: -6px 0 0;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.auth-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: #374151;
  background: #fff;
  border: 1px solid #d8dee9;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-social-btn:hover {
  border-color: #b8c4dc;
  box-shadow: 0 4px 14px rgba(30, 60, 120, 0.06);
}

.auth-social-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 14px;
  font-weight: 800;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-divider span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 2px;
}

#authForm {
  display: grid;
  gap: 14px;
}

.auth-tab {
  flex: 1;
  min-height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.auth-tab.active {
  color: #3b5bdb;
  border-bottom-color: #3b5bdb;
}

.auth-tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.auth-field {
  display: block;
  position: relative;
}

.auth-field input,
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="tel"] {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #d8dee9;
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field-password input {
  padding-right: 44px;
}

.auth-card label {
  display: block;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  color: #9ca3af;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: #6b7280;
  background: #f3f4f6;
}

.auth-card input:focus {
  outline: none;
  border-color: #3b5bdb;
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.10);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0;
}

.auth-checkbox {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #45484d !important;
  cursor: pointer;
}

.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b5bdb;
}

.auth-forgot {
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: #3b5bdb;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #4c6ef5 0%, #3b5bdb 100%);
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px rgba(59, 91, 219, 0.28);
  transition: transform 0.15s, box-shadow 0.15s;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(59, 91, 219, 0.30);
}

.auth-submit:disabled {
  opacity: 0.6;
  transform: none;
  cursor: not-allowed;
}

.auth-register-link {
  text-align: center;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-register-link button {
  padding: 0;
  color: #3b5bdb;
  background: transparent;
  border: 0;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.auth-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 max(24px, 4vw);
  color: #9ca3af;
  font-size: 12px;
  font-weight: 500;
}

.auth-footer-links {
  display: flex;
  gap: 16px;
}

.auth-footer-link {
  padding: 0;
  color: #3b5bdb;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 960px) {
  .auth-float {
    display: none;
  }
}

@media (max-width: 640px) {
  .auth-page {
    padding: 64px 16px 96px;
  }

  .auth-card {
    padding: 32px 22px 24px;
  }

  .auth-footer {
    flex-direction: column;
    text-align: center;
  }
}

#pageContent[hidden] {
  display: none !important;
}

#pageContent {
  width: 100%;
}

.site-icp {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(251, 251, 250, 0.92);
  border-top: 1px solid var(--line);
  color: #9ca3af;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: saturate(140%) blur(6px);
}

.site-icp-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #9ca3af;
  transition: color 0.15s ease;
}

.site-icp-link:hover {
  color: #3b5bdb;
}

.site-icp-sep {
  color: #c9cdd4;
}

.site-icp-badge {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 auto;
}

main#appContent {
  min-height: 100vh;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: min(420px, 90vw);
  padding: 32px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: grid;
  gap: 18px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  background: #f2f3f0;
}

.modal-card label {
  display: grid;
  gap: 6px;
  color: #2d3338;
  font-size: 13px;
  font-weight: 700;
}

.modal-card input[type="password"],
.modal-card input[type="text"] {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--strong-line);
  border-radius: 10px;
  font-size: 14px;
}

.modal-card input:focus {
  outline: none;
  border-color: #3b5bdb;
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.10);
}

/* ===== pdf.ai 风格：Landing / Dashboard / Workspace ===== */

.landing-view {
  background: #fbfbfa;
  color: var(--ink);
}

.landing-hero-band {
  padding: 56px var(--layout-gutter) 72px;
  background:
    radial-gradient(circle at 20% 20%, rgba(40, 124, 82, 0.18), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(49, 95, 151, 0.12), transparent 35%),
    #1f3d2f;
  color: #fff;
}

.landing-hero-inner {
  width: var(--layout-width);
  margin: 0 auto;
  text-align: center;
}

.mode-toggle {
  display: inline-flex;
  padding: 4px;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.mode-btn {
  min-width: 88px;
  min-height: 38px;
  padding: 0 18px;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
}

.mode-btn.active {
  color: #1f3d2f;
  background: #fff;
}

.landing-copy h1 {
  max-width: none;
  margin: 0 auto 16px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.08;
}

.landing-copy p {
  margin: 0 auto 28px;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.6;
}

.landing-actions {
  justify-content: center;
  margin-bottom: 8px;
}

.landing-cta-primary,
.landing-cta-secondary {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
}

.landing-cta-primary {
  color: #fff;
  background: #e8622a;
  border: 0;
}

.landing-cta-secondary {
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.landing-trust {
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}

.landing-preview {
  width: 100%;
  max-width: 1200px;
  margin: 36px auto 0;
}

.preview-window {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2.2 / 1;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.preview-window-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  background: #f3f3f1;
  border-bottom: 1px solid #e4e5e1;
}

.preview-window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d5d7d2;
}

.preview-window-body {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  flex: 1;
  min-height: 0;
}

.preview-pane {
  min-height: 0;
}

.preview-pane-doc {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #e8e8e4;
  border-right: 1px solid #dddcd6;
}

.preview-doc-toolbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  color: #666;
  font-size: 11px;
  background: #deded8;
  border-bottom: 1px solid #d0d0ca;
}

.preview-doc-zoom {
  padding: 2px 8px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 999px;
}

.preview-doc-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 0;
  padding: 16px 18px;
  background: #fff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
}

.preview-doc-heading {
  margin-bottom: 2px;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.preview-doc-meta {
  margin-bottom: 8px;
  color: #777;
  font-size: 10px;
}

.preview-doc-section {
  margin-top: 4px;
  color: #333;
  font-size: 11px;
  font-weight: 700;
}

.preview-doc-page .pdf-line {
  height: 7px;
  margin-bottom: 6px;
}

.preview-pane-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  justify-content: flex-start;
  padding: 20px 16px 28px;
  background: #fff;
}

.preview-doc-line {
  height: 10px;
  margin-bottom: 12px;
  background: #ddd;
  border-radius: 999px;
}

.preview-doc-line.wide {
  width: 88%;
}

.preview-doc-line.short {
  width: 55%;
}

.preview-doc-block,
.preview-doc-table {
  height: 180px;
  margin-top: 24px;
  background: linear-gradient(180deg, #eef2ea, #e3e8de);
  border-radius: 10px;
}

.preview-chat-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.preview-chat-bubble.user {
  align-self: flex-end;
  margin-left: auto;
  color: #fff;
  background: #111;
}

.preview-chat-bubble.assistant {
  align-self: flex-start;
  margin-right: auto;
  color: #333;
  background: #f3f5f0;
  border: 1px solid #e4e5e1;
}

.preview-pane-json {
  background: #111;
  color: #d6ffe8;
  font-size: 13px;
}

.preview-json-tab {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  background: #222;
  border-radius: 6px;
  font-size: 12px;
}

.preview-pane-json pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.landing-body {
  padding: 64px var(--layout-gutter) 80px;
}

.landing-body-panel {
  width: var(--layout-width);
  margin: 0 auto;
  text-align: center;
}

.landing-body-panel h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 40px);
}

.landing-body-lead {
  margin: 0 auto 28px;
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
}

.landing-steps,
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
  text-align: left;
}

.landing-steps article,
.landing-features article {
  padding: 24px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.step-icon {
  font-size: 28px;
}

.landing-steps h3,
.landing-features h3 {
  margin: 12px 0 8px;
  font-size: 18px;
}

.landing-steps p,
.landing-features p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.landing-body-cta {
  margin-top: 28px;
  min-height: 48px;
  padding: 0 24px;
  color: #fff;
  background: #e8622a;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
}

body.view-home-hub .site-header {
  background: rgba(255, 255, 255, 0.96);
}

.dashboard-view {
  min-height: calc(100vh - 72px);
  padding: 32px var(--layout-gutter) 64px;
  background: linear-gradient(180deg, #fbfbfa 0%, #f3f4f1 100%);
}

.dashboard-inner {
  width: var(--layout-width);
  margin: 0 auto;
}

.dashboard-welcome {
  margin: 0 0 24px;
  font-size: clamp(28px, 4vw, 36px);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.quick-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.quick-card strong {
  font-size: 16px;
}

.quick-card span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.quick-icon {
  font-size: 22px;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-filter {
  min-height: 34px;
  padding: 0 14px;
  color: #444;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.tag-filter.active {
  color: #fff;
  background: #111;
  border-color: #111;
}

.dashboard-docs {
  display: grid;
  gap: 10px;
}

.doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.doc-row-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.doc-row-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-row-meta {
  color: var(--muted);
  font-size: 13px;
}

.doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-tag {
  padding: 2px 10px;
  color: #315f97;
  background: #eef4fb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.doc-parse-badge {
  color: #9a6700;
  font-weight: 700;
}

.doc-parse-badge.failed {
  color: var(--red);
}

.doc-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-row-actions button {
  min-height: 34px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.doc-row-actions .chat-link {
  color: #fff;
  background: #315ce8;
  border-color: #315ce8;
}

.dashboard-upload {
  margin-top: 28px;
  text-align: center;
}

.upload-drop {
  display: grid;
  gap: 8px;
  place-items: center;
  width: 100%;
  min-height: 120px;
  padding: 24px;
  color: var(--muted);
  background: #fff;
  border: 2px dashed var(--strong-line);
  border-radius: 16px;
}

.upload-plus {
  font-size: 28px;
  line-height: 1;
}

.upload-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.chat-workspace {
  height: calc(100vh - 72px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #f7f6f1;
  overflow: hidden;
}

body.view-chat-workspace {
  overflow: hidden;
}

.workspace-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.workspace-toolbar-btn {
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}

.workspace-btn-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.workspace-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  overflow: hidden;
}

.pdf-preview-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #eceae3;
  border-right: 1px solid var(--line);
}

.pdf-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pdf-preview-frame[hidden] {
  display: none;
}

.pdf-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
}

.pdf-preview-empty[hidden] {
  display: none;
}

.pdf-preview-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  background: rgba(236, 234, 227, 0.92);
  z-index: 1;
}

.pdf-preview-loading[hidden] {
  display: none;
}

.chat-thread-bar {
  flex-shrink: 0;
}

.chat-thread-dropdown {
  position: relative;
}

.chat-thread-dropdown .workspace-toolbar-btn {
  padding-right: 12px;
}

.chat-thread-chevron {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.chat-thread-dropdown .workspace-toolbar-btn[aria-expanded="true"] .chat-thread-chevron {
  transform: rotate(180deg);
}

.chat-thread-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(23, 23, 23, 0.12);
}

.chat-thread-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-thread-menu-item:hover {
  background: #f3f5f0;
}

.chat-thread-menu-item.active {
  background: #eef0ec;
}

.chat-thread-menu-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: #6b6f76;
}

.chat-thread-menu-item.active .chat-thread-menu-icon {
  fill: var(--ink);
}

.chat-thread-menu-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #fff;
  overflow: hidden;
}

.chat-workspace .message-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.chat-workspace .message {
  font-size: 13px;
  line-height: 1.65;
  padding: 10px 12px;
}

.chat-workspace .message.user {
  font-size: 13px;
}

.workspace-messages {
  padding: 18px;
}

.chat-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  padding: 0 16px 10px;
  background: #fff;
}

.chat-quick-prompts button {
  min-height: 34px;
  padding: 0 12px;
  color: #333;
  background: #f3f5f0;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.chat-quick-prompts button:hover {
  background: #eceee8;
}

.workspace-chat-input {
  display: grid;
  gap: 8px;
  flex-shrink: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fafaf8;
}

.workspace-chat-input textarea {
  width: 100%;
  min-height: 64px;
  max-height: 160px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--strong-line);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.workspace-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.char-count {
  color: var(--muted);
  font-size: 12px;
}

.app-page {
  width: var(--layout-width);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.api-section-lead {
  margin: 10px 0 0;
  max-width: 720px;
}

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

.api-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 196px;
  padding: 24px;
  background: linear-gradient(180deg, #fff 0%, #fafbf9 100%);
  border: 1px solid #dfe4ec;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(23, 23, 23, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.api-card:hover {
  transform: translateY(-2px);
  border-color: #d5dbe4;
  box-shadow: 0 16px 40px rgba(23, 23, 23, 0.08);
}

.api-method {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  color: var(--green);
  background: #eef7f0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.api-card h3 {
  margin: 0;
  font-size: 20px;
}

.api-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.api-card-path {
  margin: auto 0 0;
}

.api-card-path code,
.api-card-paths code {
  display: block;
  padding: 10px 12px;
  color: #1e3a5f;
  background: #f0f4f8;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.api-card-paths {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.api-note {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin-top: 20px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff 0%, #f7faf8 100%);
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.04);
}

.api-note-icon {
  display: grid;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--green);
  background: #eef7f0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.api-note-title {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.api-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: nowrap;
}

.api-note code {
  padding: 2px 6px;
  color: #1e3a5f;
  background: #f0f4f8;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.limit-modal {
  width: min(440px, calc(100vw - 40px));
  padding: 28px 24px 22px;
  text-align: center;
}

.limit-icon-wrap {
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.limit-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2.5px solid #111;
  border-radius: 12px;
  background: #ffd84d;
  font-size: 24px;
  line-height: 1;
}

.limit-modal h2 {
  margin: 0 0 10px;
  font-size: clamp(20px, 3.5vw, 26px);
  line-height: 1.3;
}

.limit-desc {
  margin: 0 auto 18px;
  max-width: 360px;
  color: #4b4f56;
  font-size: 14px;
  line-height: 1.55;
}

.limit-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.limit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.limit-badge-green {
  color: #1f6b45;
  background: #e8f7ef;
}

.limit-badge-purple {
  color: #5b4bb7;
  background: #f1edff;
}

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

.limit-upgrade-btn,
.limit-later-btn {
  min-height: 46px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
}

.limit-upgrade-btn {
  color: #fff;
  background: #e8622a;
  border: 0;
}

.limit-later-btn {
  color: #333;
  background: #f3f1ea;
  border: 0;
}

.limit-upgrade-btn:hover {
  background: #d85622;
}

.limit-later-btn:hover {
  background: #ebe8df;
}

@media (max-width: 520px) {
  .limit-actions {
    grid-template-columns: 1fr;
  }
}

.nav-guest[hidden],
.nav-app[hidden] {
  display: none;
}

body.view-chat-workspace .site-header {
  border-bottom-color: transparent;
}

@media (max-width: 960px) {
  .quick-actions,
  .workspace-split,
  .api-grid,
  .landing-steps,
  .landing-features,
  .preview-window-body {
    grid-template-columns: 1fr;
  }

  .preview-window {
    aspect-ratio: auto;
    max-height: none;
    min-height: 420px;
  }

  .workspace-split {
    grid-template-rows: 45vh minmax(320px, 1fr);
    grid-template-columns: 1fr;
  }

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

  .nav-links {
    display: none;
  }
}
