:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --panel: #ffffff;
  --ink: #161616;
  --muted: #626260;
  --muted-2: #85827d;
  --line: #ded8cf;
  --line-strong: #c8c0b6;
  --accent: #00796b;
  --radius: 8px;
  --focus: 0 0 0 3px rgba(0, 121, 107, 0.18);
  --font-ui: "SF Pro Text", "SF Pro Display", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-ui);
  line-height: 1.45;
  letter-spacing: 0;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 242, 237, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.topbar-actions,
.control-row,
.summary-strip,
.tool-card-top,
.tag-row,
.card-actions,
.open-page {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  color: #fff;
  background: #161616;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  font-weight: 700;
}

.brand small {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 12px;
}

.topbar-actions {
  gap: 4px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
}

.icon-button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.icon-button:focus-visible,
.category-pill:focus-visible,
.search-box:focus-within,
.tool-card:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.app-shell {
  display: grid;
  grid-template-columns: 188px minmax(0, 920px);
  gap: 24px;
  justify-content: center;
  width: min(1180px, calc(100vw - 36px));
  margin: 34px auto 44px;
}

.side-rail {
  position: sticky;
  top: 88px;
  align-self: start;
}

.rail-label,
.eyebrow {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 600;
}

.category-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.category-pill {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: #515154;
  background: transparent;
  text-align: left;
}

.category-pill:hover {
  background: rgba(0, 0, 0, 0.04);
}

.category-pill[data-active="true"] {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.07);
}

.workspace {
  min-width: 0;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workspace h1 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
}

.summary-strip {
  gap: 10px;
  color: var(--muted-2);
  font-size: 13px;
}

.summary-strip strong {
  margin-right: 2px;
  color: var(--ink);
  font-size: 14px;
}

.control-row {
  margin-top: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.search-box span {
  color: var(--muted-2);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tool-card {
  display: grid;
  min-height: 188px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.tool-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: none;
}

.tool-card-top {
  justify-content: space-between;
  gap: 10px;
}

.tool-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--tool-accent, var(--accent));
  background: color-mix(in srgb, var(--tool-accent, var(--accent)) 13%, #ffffff);
}

.status-badge {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #f7f5f1;
  font-size: 12px;
  font-weight: 650;
}

.tool-card h3 {
  margin: 18px 0 6px;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 650;
}

.tool-desc {
  display: -webkit-box;
  min-height: 40px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-row {
  align-content: start;
  flex-wrap: wrap;
  gap: 6px;
  margin: 13px 0 8px;
}

.tag-row span {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #f7f5f1;
  font-size: 12px;
}

.card-actions {
  align-self: end;
  justify-content: flex-end;
}

.open-page {
  gap: 5px;
  color: var(--tool-accent, var(--accent));
  font-size: 13px;
  font-weight: 650;
}

.open-page svg {
  width: 15px;
  height: 15px;
}

.empty-state {
  margin: 18px 0 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
}

@media (max-width: 780px) {
  .topbar {
    padding: 0 14px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 720px);
    margin-top: 20px;
  }

  .side-rail {
    position: static;
  }

  .category-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .category-pill {
    flex: 0 0 auto;
  }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .workspace h1 {
    font-size: 30px;
  }

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

  .tool-card {
    min-height: 176px;
  }
}

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