:root {
  color-scheme: light;
  --bg: oklch(0.98 0.015 318);
  --bg-soft: oklch(0.99 0.01 96);
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-muted: rgba(252, 249, 255, 0.8);
  --surface-tint: rgba(248, 243, 255, 0.72);
  --surface-dark: rgba(81, 71, 118, 0.08);
  --text: #111111;
  --muted: #343434;
  --line: rgba(136, 119, 172, 0.16);
  --line-strong: rgba(136, 119, 172, 0.28);
  --accent: #8f7fe6;
  --accent-strong: #6959bb;
  --accent-soft: #efe8ff;
  --accent-blush: #ffe6f0;
  --accent-mint: #def5ea;
  --accent-peach: #ffe7d9;
  --accent-butter: #fff4cd;
  --danger: #ca648e;
  --success: #5e9a80;
  --shadow-lg: 0 28px 80px rgba(155, 138, 185, 0.2);
  --shadow-md: 0 18px 40px rgba(155, 138, 185, 0.14);
  --shadow-sm: 0 10px 24px rgba(155, 138, 185, 0.1);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", "Songti SC", serif;
  --font-body: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  position: relative;
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 230, 240, 0.8), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(234, 241, 255, 0.82), transparent 28%),
    radial-gradient(circle at 62% 82%, rgba(221, 248, 236, 0.85), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(180deg, var(--bg), color-mix(in oklab, var(--bg-soft) 72%, white 28%));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(136, 119, 172, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(136, 119, 172, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.34;
  z-index: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  color: inherit;
}

button,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--accent) 58%, white 42%);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none !important;
  box-shadow: none !important;
}

input::placeholder {
  color: color-mix(in oklab, var(--muted) 92%, white 8%);
}

.hidden {
  display: none !important;
}

.page-aura {
  position: fixed;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.72;
  z-index: 0;
}

.aura-lilac {
  top: -12rem;
  right: -8rem;
  background: radial-gradient(circle, rgba(214, 203, 255, 0.9), transparent 68%);
}

.aura-peach {
  bottom: -14rem;
  left: -6rem;
  background: radial-gradient(circle, rgba(255, 224, 211, 0.92), transparent 68%);
}

.aura-mint {
  top: 40%;
  left: 35%;
  width: 26rem;
  height: 26rem;
  background: radial-gradient(circle, rgba(216, 247, 233, 0.8), transparent 68%);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)),
    linear-gradient(90deg, rgba(116, 98, 153, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(116, 98, 153, 0.03) 1px, transparent 1px);
  background-size: auto, 18px 18px, 18px 18px;
  z-index: 1;
}

.shell,
.gate,
.palette {
  position: relative;
  z-index: 2;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.rail,
.workspace,
.gate-panel,
.palette-panel,
.showcase-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--shadow-lg);
}

.rail::before,
.workspace::before,
.gate-panel::before,
.palette-panel::before,
.showcase-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), transparent 34%);
}

.rail,
.workspace {
  border-radius: var(--radius-xl);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 245, 255, 0.82)),
    var(--surface);
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 247, 255, 0.82)),
    var(--surface);
}

.brand-block,
.content-heading,
.gate-head,
.palette-intro,
.preview-copy,
.overview-copy,
.overview-side {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.brand-block {
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(136, 119, 172, 0.12);
}

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

.brand-block h1,
.content-heading h2,
.directory-head h2,
.preview-copy h3,
.overview-copy h3,
.showcase-card strong,
.gate-showcase h1,
.gate-head h2,
.palette-intro h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.brand-block h1 {
  font-size: clamp(1.26rem, 1.6vw, 1.58rem);
}

.directory-head h2 {
  font-size: clamp(1.02rem, 1.4vw, 1.24rem);
  line-height: 1.28;
}

.content-heading h2 {
  font-size: clamp(1.38rem, 2vw, 1.9rem);
  line-height: 1.12;
}

.preview-copy h3,
.overview-copy h3,
.palette-intro h2 {
  font-size: clamp(1.14rem, 1.5vw, 1.34rem);
  line-height: 1.2;
}

.gate-showcase h1 {
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  line-height: 0.98;
}

.gate-head h2 {
  font-size: clamp(1.44rem, 2vw, 1.88rem);
  line-height: 1.1;
}

.showcase-card strong {
  font-size: 1.18rem;
  line-height: 1.2;
}

.eyebrow,
.showcase-label {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail-copy,
.gate-copy,
.directory-subtitle,
.content-subtitle,
.palette-copy,
.preview-copy p,
.overview-copy p,
.overview-card p,
.empty-state,
.empty-inline,
.search-result span,
.search-side small,
.tree-link small,
.palette-meta {
  color: var(--muted);
}

.rail-copy,
.gate-copy,
.directory-subtitle,
.content-subtitle,
.palette-copy,
.preview-copy p,
.overview-copy p,
.overview-card p,
.empty-state,
.empty-inline,
.search-result span,
.search-side small,
.tree-link small,
.palette-meta,
.crumb {
  font-size: 0.86rem;
  line-height: 1.55;
}

.rail-copy,
.gate-copy,
.directory-subtitle,
.content-subtitle,
.palette-copy,
.preview-copy p,
.overview-copy p,
.overview-card p {
  margin: 0;
}

.brand-status,
.brand-meta span,
.gate-meta span,
.workspace-tags span,
.meta-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(136, 119, 172, 0.14);
  font-size: 0.75rem;
  line-height: 1;
}

.brand-status {
  background: rgba(255, 246, 234, 0.92);
  border-color: rgba(236, 198, 126, 0.34);
  color: var(--text);
}

.brand-meta,
.gate-meta,
.workspace-tags,
.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-meta span,
.gate-meta span,
.workspace-tags span {
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.meta-pill {
  justify-content: flex-start;
  background: rgba(241, 236, 255, 0.88);
  color: var(--muted);
}

.badge {
  background: rgba(255, 247, 231, 0.92);
  border-color: rgba(235, 199, 128, 0.32);
  color: var(--text);
  white-space: nowrap;
}

.directory-section,
.content-toolbar,
.preview-panel,
.text-view,
.code-block,
.markdown-view,
.image-wrap,
.overview-card,
.empty-state,
.empty-inline,
.search-result {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.rail-button,
.secondary-button,
.primary-button,
.text-button,
.segmented button,
.search-result,
.crumb,
.tree-toggle,
.tree-link {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.rail-button,
.secondary-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.search-button {
  align-items: flex-start;
  padding: 16px;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 245, 249, 0.92), rgba(239, 241, 255, 0.9));
  border-color: rgba(136, 119, 172, 0.12);
}

.search-button:hover,
.secondary-button:hover,
.primary-button:hover,
.text-button:hover,
.search-result:hover,
.crumb:hover,
.tree-toggle:hover,
.tree-link:hover {
  transform: translateY(-1px);
}

.search-copy {
  display: grid;
  gap: 4px;
}

.search-copy strong {
  font-size: 0.96rem;
  line-height: 1.28;
}

.search-copy small {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}

.search-button kbd {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(136, 119, 172, 0.16);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
}

.secondary-button,
.text-button,
.crumb,
.segmented {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.secondary-button:hover,
.text-button:hover,
.crumb:hover {
  border-color: color-mix(in oklab, var(--accent) 28%, var(--line));
  background: rgba(255, 255, 255, 0.9);
}

.primary-button {
  position: relative;
  color: rgba(255, 255, 255, 0.98);
  background: linear-gradient(135deg, #8e7ae6, #a88dfa 45%, #f3bad1 100%);
  border-color: rgba(126, 106, 201, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 16px 32px rgba(143, 126, 232, 0.24);
}

.primary-button:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 20px 36px rgba(143, 126, 232, 0.3);
}

.primary-button[data-loading="true"]::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: rgba(255, 255, 255, 0.96);
  animation: spin 0.85s linear infinite;
}

.text-button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.84rem;
}

.directory-section {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 245, 255, 0.7)),
    var(--surface-muted);
  overflow: hidden;
}

.directory-head,
.directory-actions,
.content-toolbar,
.content-actions,
.preview-hero,
.overview-hero,
.palette-head,
.search-side,
.entry-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.directory-head,
.content-toolbar {
  flex-wrap: wrap;
}

.directory-actions,
.content-actions {
  flex-wrap: wrap;
  flex-shrink: 0;
}

.breadcrumb-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.crumb {
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}

.crumb.is-active {
  background: rgba(241, 236, 255, 0.92);
  border-color: color-mix(in oklab, var(--accent) 32%, var(--line));
  color: var(--text);
}

.crumb-separator {
  color: color-mix(in oklab, var(--muted) 70%, white 30%);
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
}

.segmented button {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.segmented button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(136, 119, 172, 0.12);
  box-shadow: var(--shadow-sm);
}

.directory-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 8px;
  padding-right: 6px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.tree-menu,
.tree-node,
.tree-children {
  display: grid;
}

.tree-menu {
  gap: 14px;
}

.tree-node {
  gap: 6px;
}

.tree-children {
  gap: 4px;
}

.tree-node-root {
  padding: 12px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 243, 255, 0.7));
  box-shadow: var(--shadow-sm);
}

.tree-row {
  --level: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-left: calc(var(--level) * 11px);
}

.tree-toggle,
.tree-spacer {
  width: 20px;
  min-width: 20px;
  height: 20px;
  margin-top: 11px;
}

.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0;
}

.tree-toggle::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.tree-toggle:hover {
  color: var(--text);
  border-color: rgba(136, 119, 172, 0.14);
}

.tree-toggle.is-expanded {
  transform: rotate(90deg);
}

.tree-link {
  position: relative;
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 12px 14px 12px 36px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  text-align: left;
}

.tree-link::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: linear-gradient(180deg, #beaefa, #8b79d8);
  box-shadow: 0 0 0 5px rgba(239, 232, 255, 0.82);
}

.tree-link[data-kind="file"]::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f4c3d8, #d5bed5);
  box-shadow: 0 0 0 5px rgba(255, 239, 247, 0.84);
}

.tree-node-root > .tree-row .tree-link {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(136, 119, 172, 0.12);
}

.tree-link:hover {
  border-color: rgba(136, 119, 172, 0.14);
  background: rgba(255, 255, 255, 0.8);
}

.tree-link.is-active {
  border-color: color-mix(in oklab, var(--accent) 34%, var(--line));
  background: linear-gradient(135deg, rgba(241, 236, 255, 0.96), rgba(255, 248, 252, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.tree-link.is-active::after {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), #f0a9c7);
}

.tree-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.tree-link small {
  overflow-wrap: anywhere;
}

.tree-loading,
.tree-empty {
  padding-left: calc((var(--level) * 11px) + 36px);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.directory-section.is-dragging {
  position: relative;
}

.directory-section.is-dragging::after {
  content: "拖放文件到这里即可上传到当前目录";
  position: absolute;
  inset: 110px 18px 18px;
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in oklab, var(--accent) 56%, var(--line));
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-strong);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  z-index: 3;
}

.rail-footer {
  margin-top: auto;
}

.content-toolbar {
  align-items: flex-end;
  padding: 24px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(245, 241, 255, 0.9)),
    var(--surface-strong);
}

.content-heading {
  max-width: 70ch;
}

.workspace-tags {
  margin-top: 4px;
}

.preview-panel {
  flex: 1 1 auto;
  min-height: 0;
  padding: 26px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 249, 255, 0.88)),
    var(--surface-strong);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.preview-hero,
.overview-hero {
  position: sticky;
  top: -6px;
  z-index: 2;
  margin-bottom: 20px;
  padding-bottom: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.92) 72%, transparent);
}

.preview-hero-main,
.overview-side {
  display: grid;
  gap: 10px;
}

.text-view,
.code-block,
.markdown-view,
.image-wrap {
  margin: 0;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 243, 255, 0.6)),
    var(--surface-muted);
  overflow: auto;
}

.text-view,
.code-block code,
.text-view code {
  font-family: var(--font-mono);
}

.text-view {
  font-size: 0.86rem;
  line-height: 1.68;
}

.code-block {
  display: grid;
  gap: 14px;
}

.code-lang {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.markdown-view {
  display: grid;
  gap: 18px;
  max-width: min(100%, 84ch);
  line-height: 1.72;
}

.markdown-view h1,
.markdown-view h2,
.markdown-view h3,
.markdown-view h4,
.markdown-view h5,
.markdown-view h6 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.markdown-view p,
.markdown-view ul,
.markdown-view ol,
.markdown-view blockquote,
.markdown-view table,
.markdown-view hr {
  margin: 0;
}

.markdown-view ul,
.markdown-view ol {
  padding-left: 20px;
}

.markdown-view blockquote {
  padding-left: 16px;
  border-left: 3px solid color-mix(in oklab, var(--accent) 42%, var(--line));
  color: color-mix(in oklab, var(--muted) 82%, var(--text) 18%);
}

.markdown-view code {
  padding: 0.16em 0.42em;
  border-radius: 7px;
  background: rgba(106, 92, 149, 0.08);
  font-family: var(--font-mono);
  font-size: 0.94em;
}

.markdown-view table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.markdown-view th,
.markdown-view td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.markdown-view th {
  background: rgba(245, 240, 255, 0.88);
}

.markdown-view a {
  color: var(--accent-strong);
  text-decoration: none;
}

.image-wrap {
  display: grid;
  place-items: center;
  min-height: 220px;
}

.image-wrap img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(72vh, 960px);
  height: auto;
  border-radius: 16px;
}

.overview {
  display: grid;
  gap: 18px;
}

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

.overview-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 243, 255, 0.72)),
    var(--surface-muted);
}

.overview-card span {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.overview-card strong {
  font-size: 1.26rem;
  line-height: 1.18;
}

.overview-card-feature {
  grid-column: span 2;
}

.overview-card-tint strong {
  font-family: var(--font-display);
  font-size: 1.48rem;
}

.overview-card-blush {
  background: linear-gradient(135deg, rgba(255, 241, 247, 0.96), rgba(255, 255, 255, 0.88));
}

.overview-card-mint {
  background: linear-gradient(135deg, rgba(236, 250, 244, 0.96), rgba(255, 255, 255, 0.88));
}

.overview-card-butter {
  background: linear-gradient(135deg, rgba(255, 247, 222, 0.96), rgba(255, 255, 255, 0.88));
}

.path-value {
  font-size: 1rem !important;
  word-break: break-all;
}

.empty-state,
.empty-inline {
  padding: 18px 20px;
  border-radius: 22px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.66);
}

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

.entry-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  text-align: left;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
}

.entry-card.is-active {
  border-color: color-mix(in oklab, var(--accent) 34%, var(--line));
  background: linear-gradient(135deg, rgba(241, 236, 255, 0.96), rgba(255, 248, 252, 0.92));
}

.entry-card h3,
.search-result strong {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.entry-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.entry-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.entry-kind {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(241, 236, 255, 0.92);
  color: var(--accent-strong);
  font-size: 0.74rem;
}

.palette,
.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 238, 248, 0.58);
  backdrop-filter: blur(16px);
  z-index: 20;
}

.gate-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.84fr);
  gap: 20px;
}

.gate-showcase {
  display: grid;
  gap: 16px;
}

.showcase-card {
  border-radius: var(--radius-xl);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 243, 255, 0.8)),
    var(--surface);
}

.showcase-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.showcase-card-primary {
  min-height: 280px;
  align-content: end;
  background:
    linear-gradient(135deg, rgba(255, 248, 251, 0.96), rgba(237, 240, 255, 0.94) 56%, rgba(233, 248, 240, 0.9)),
    var(--surface);
}

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

.gate-panel {
  width: min(480px, 100%);
  justify-self: end;
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 245, 255, 0.84)),
    var(--surface);
}

.gate-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.gate-form label {
  font-size: 0.8rem;
  color: var(--muted);
}

.gate-form .primary-button {
  justify-content: center;
}

.palette-panel {
  width: min(920px, 96vw);
  min-height: 360px;
  border-radius: 32px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 245, 255, 0.9)),
    var(--surface);
}

.palette-head {
  align-items: stretch;
  margin-top: 18px;
}

.palette-head input,
.gate-form input {
  width: 100%;
  min-height: 50px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  outline: none;
}

.palette-head input:focus,
.gate-form input:focus {
  border-color: color-mix(in oklab, var(--accent) 36%, var(--line));
  box-shadow:
    0 0 0 4px rgba(143, 126, 232, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.palette-meta {
  margin: 14px 4px;
}

.palette-results {
  display: grid;
  gap: 10px;
  max-height: min(60vh, 560px);
  padding-right: 4px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.search-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 243, 255, 0.76)),
    var(--surface-muted);
  text-align: left;
}

.search-result:hover {
  border-color: color-mix(in oklab, var(--accent) 24%, var(--line));
  background: rgba(255, 255, 255, 0.94);
}

.search-result span {
  display: block;
  margin-top: 4px;
}

.search-side {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.message {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.78rem;
  color: var(--danger);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 30;
}

.toast {
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  transition: transform 220ms ease, opacity 220ms ease;
}

.toast-success {
  border-color: color-mix(in oklab, var(--success) 30%, var(--line));
}

.toast-error {
  border-color: color-mix(in oklab, var(--danger) 34%, var(--line));
}

.toast.is-gone {
  opacity: 0;
  transform: translateY(10px);
}

.directory-list,
.preview-panel,
.palette-results {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--accent) 24%, var(--line)) transparent;
}

.directory-list::-webkit-scrollbar,
.preview-panel::-webkit-scrollbar,
.palette-results::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.directory-list::-webkit-scrollbar-thumb,
.preview-panel::-webkit-scrollbar-thumb,
.palette-results::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 24%, rgba(136, 119, 172, 0.3));
  background-clip: padding-box;
}

.directory-list::-webkit-scrollbar-track,
.preview-panel::-webkit-scrollbar-track,
.palette-results::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 1121px) {
  body {
    overflow: hidden;
  }

  .shell {
    height: 100vh;
  }

  .rail,
  .workspace {
    height: calc(100vh - 40px);
  }
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

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

  .rail,
  .workspace {
    min-height: auto;
    height: auto;
  }

  .directory-list {
    max-height: 42vh;
  }

  .gate-shell {
    grid-template-columns: 1fr;
  }

  .gate-panel {
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 820px) {
  .shell,
  .gate,
  .palette {
    padding: 14px;
  }

  .rail,
  .workspace,
  .gate-panel,
  .palette-panel,
  .showcase-card {
    border-radius: 26px;
  }

  .rail,
  .workspace,
  .gate-panel,
  .palette-panel {
    padding: 18px;
  }

  .brand-row,
  .content-toolbar,
  .directory-head,
  .palette-head,
  .search-result,
  .preview-hero,
  .overview-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .directory-actions,
  .content-actions {
    width: 100%;
  }

  .content-toolbar {
    padding: 20px;
  }

  .preview-panel {
    padding: 18px;
  }

  .search-side {
    align-items: flex-start;
  }

  .showcase-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-card-feature {
    grid-column: auto;
  }

  .segmented {
    width: 100%;
    justify-content: space-between;
  }

  .segmented button {
    flex: 1 1 0;
    text-align: center;
  }

  .directory-section.is-dragging::after {
    inset: 138px 18px 18px;
  }
}

@media (max-width: 560px) {
  .shell {
    gap: 12px;
    padding: 12px;
  }

  .page-aura {
    width: 24rem;
    height: 24rem;
  }

  .gate-showcase h1 {
    font-size: clamp(1.9rem, 11vw, 2.6rem);
  }

  .directory-section,
  .preview-panel,
  .content-toolbar,
  .showcase-card,
  .gate-panel,
  .palette-panel {
    border-radius: 22px;
  }

  .rail-button,
  .secondary-button,
  .primary-button,
  .text-button {
    width: 100%;
  }

  .meta-pills,
  .workspace-tags,
  .brand-meta,
  .gate-meta {
    gap: 6px;
  }

  .palette-panel {
    width: min(100%, 96vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .page-aura {
    display: none;
  }
}
