:root {
  --bg: #ffffff;
  --subtle: #f8f9fb;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --brand: #3858e9;
  --brand-soft: #eff3ff;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.surface { display: none; }
.surface.is-active { display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--subtle); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #ffffff; }
.btn-brand:hover { background: #2c4ad3; }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ================= PUBLIC SAAS WEBSITE ================= */
.s-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}
.s-nav-in {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand-lock { display: inline-flex; align-items: center; gap: 9px; font-size: 15.5px; white-space: nowrap; }
.brand-sq {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--ink);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.s-links { display: flex; align-items: center; gap: 26px; font-size: 14px; color: var(--ink-2); }
.s-links a:hover { color: var(--ink); }

/* Split SaaS Hero */
.s-hero {
  padding: 64px 0 72px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.s-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 44px;
  align-items: center;
}
.s-hero-grid > * { min-width: 0; }
.s-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.s-hero h1 {
  margin: 0 0 16px;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.s-hero p {
  margin: 0 0 26px;
  font-size: 15.5px;
  color: var(--ink-2);
}
.s-hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.s-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.s-proof strong { display: block; font-size: 20px; font-weight: 400; }
.s-proof span { font-size: 12px; color: var(--ink-3); }

/* Product Window Mockup */
.win-frame {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}
.win-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--subtle);
  border-bottom: 1px solid var(--line);
}
.win-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.win-tab {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.win-tab.is-active { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.win-body { padding: 18px; }
.win-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.win-row:last-child { border-bottom: 0; padding-bottom: 0; }
.win-src { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.win-dst { font-size: 14px; color: var(--ink); }
.win-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; display: flex; justify-content: space-between; }
.hl-term { background: var(--brand-soft); color: var(--brand); padding: 1px 4px; border-radius: 3px; }
.hl-bad { background: var(--bad-soft); color: var(--bad); padding: 1px 4px; border-radius: 3px; text-decoration: line-through; }

/* Sections */
.s-sec { padding: 68px 0; }
.s-sec-alt { background: var(--subtle); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.s-sec-head { margin-bottom: 36px; max-width: 640px; }
.s-sec-head h2 { margin: 0 0 8px; font-size: 26px; font-weight: 400; }
.s-sec-head p { margin: 0; font-size: 14.5px; color: var(--ink-2); }

.use-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.use-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.use-ico { color: var(--brand); margin-bottom: 12px; display: inline-flex; }
.use-card h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 400; }
.use-card p { margin: 0; font-size: 13px; color: var(--ink-2); }

/* Matrix Table */
.matrix-wrap {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  max-width: 100%;
}
.matrix-wrap table { min-width: 640px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 400; color: var(--ink-3); background: var(--subtle); font-size: 12.5px; }
tr:last-child td { border-bottom: 0; }
.matrix-note { margin: 14px 0 0; font-size: 13px; color: var(--ink-3); }

/* API & MCP Capabilities Section */
.s-sec-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.s-sec-bar .s-sec-head { margin-bottom: 0; }
.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.api-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.api-card-head { display: flex; align-items: center; gap: 10px; }
.api-card h3 { margin: 0; font-size: 15.5px; font-weight: 400; }
.api-card p { margin: 0; font-size: 13px; color: var(--ink-2); }
.api-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.api-tag {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--subtle);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
.api-tag-mcp { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.mcp-mini-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.mcp-mini-item {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--subtle);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-2);
}
.mcp-mini-item code { display: block; font-family: var(--mono); color: var(--brand); font-size: 11px; }
.btn-dark-outline { background: transparent; color: #ffffff; border-color: #475569; }
.btn-dark-outline:hover { background: rgba(255, 255, 255, .08); border-color: #94a3b8; }
.s-footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.s-footer-links a:hover { color: var(--ink); }

/* CTA Strip & Footer */
.s-cta-band {
  padding: 56px 0;
  background: var(--ink);
  color: #ffffff;
}
.s-cta-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.s-cta-in h2 { margin: 0 0 6px; font-size: 24px; font-weight: 400; }
.s-cta-in p { margin: 0; color: #94a3b8; font-size: 14px; }
.s-footer { padding: 34px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.s-footer-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }

/* ================= PRO SAAS WORKSPACE ================= */
.ws-shell { display: flex; min-height: 100vh; background: var(--subtle); }
.ws-side {
  width: 228px;
  flex: none;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.ws-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.ws-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.ws-nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.ws-nav-btn:hover { background: var(--subtle); color: var(--ink); }
.ws-nav-btn.is-active { background: var(--brand-soft); color: var(--brand); }
.ws-quota {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: var(--subtle);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.ws-bar { height: 5px; border-radius: 99px; background: var(--line); margin: 8px 0; overflow: hidden; }
.ws-bar i { display: block; height: 100%; width: 18.4%; background: var(--brand); }

.ws-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-top {
  height: 54px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.ws-body { padding: 24px; max-width: 1120px; width: 100%; margin: 0 auto; }
.ws-view { display: none; }
.ws-view.is-active { display: block; }
.ws-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.ws-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.ws-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ws-grid-2 > *, .ws-grid-3 > * { min-width: 0; }
.field {
  border: 1px solid var(--line-2);
  background: var(--bg);
  border-radius: 7px;
  padding: 7px 11px;
  font-size: 13px;
  outline: 0;
  min-width: 0;
}
.field:focus { border-color: var(--brand); }
.code-pre {
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--ink);
  color: #ffffff;
  padding: 9px 15px;
  border-radius: 7px;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 40;
}
.toast.is-show { opacity: 1; }

@media (max-width: 920px) {
  .wrap { padding: 0 16px; }
  .s-links, .brand-lock .mono { display: none; }
  .s-nav-in { gap: 10px; }
  .s-hero { padding: 36px 0 44px; }
  .s-hero h1 { font-size: 28px; }
  .s-proof { gap: 10px; }
  .s-proof strong { font-size: 17px; }
  .win-frame { max-width: 100%; min-width: 0; }
  .s-hero-grid, .use-grid, .api-grid, .mcp-mini-list, .ws-grid-3, .ws-grid-2 { grid-template-columns: 1fr; }
  .ws-shell { flex-direction: column; }
  .ws-side { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .ws-quota { display: none; }
  .ws-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .ws-top { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .ws-body { padding: 14px; }
}
