/* AI 开发审美看板 — polished board
   Accent: ink teal. One accent only. No gradients / glass / emoji. */

:root {
  --frame: #e8ebe6;
  --rail: #dde3db;
  --sheet: #ffffff;
  --ink: #141816;
  --muted: #5c6660;
  --line: #e2e6e1;
  --chip: #f3f5f2;
  --accent: #0f6b5c;
  --accent-soft: #e6f3f0;
  --bookmark: #0f6b5c;
  --new: #8a4b12;
  --new-soft: #f7efe6;
  --radius-card: 8px;
  --radius-ctrl: 6px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --frame: #121614;
    --rail: #1a1f1c;
    --sheet: #1c211e;
    --ink: #eef2ef;
    --muted: #9aa59e;
    --line: #2a312c;
    --chip: #252b27;
    --accent: #3dbaa4;
    --accent-soft: #1a2e29;
    --bookmark: #3dbaa4;
    --new: #e0a06a;
    --new-soft: #2c241c;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--frame);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

/* App frame: tinted chrome + white sheet (drop on phone) */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 48px 1fr;
  grid-template-columns: 56px 1fr;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--rail);
  border-bottom: 1px solid var(--line);
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--sheet);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.brand-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.rail {
  background: var(--rail);
  border-right: 1px solid var(--line);
}

.sheet-wrap {
  padding: 16px;
  min-width: 0;
}

.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: calc(100vh - 48px - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header inside sheet */
.sheet-head {
  padding: 28px 28px 16px;
}

.sheet-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.sheet-head .subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.meta-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stat {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--chip);
  border-radius: 999px;
  padding: 4px 10px;
}

.stat strong {
  color: var(--ink);
  font-weight: 600;
}

/* Sticky filters */
.filters {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--sheet);
  border-bottom: 1px solid var(--line);
  padding: 12px 28px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
}

.chip {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 10px 2px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease),
    transform 120ms var(--ease);
}

.chip:hover {
  color: var(--ink);
}

.chip:active {
  transform: scale(0.97);
}

.chip[aria-pressed="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.label-tiny {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-right: 8px;
  letter-spacing: 0.06em;
  text-transform: none;
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: var(--sheet);
  outline: none;
  transition: border-color 160ms var(--ease);
}

.search-wrap input:focus {
  border-color: var(--accent);
}

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

/* Grid */
.grid-wrap {
  padding: 20px 28px 32px;
  flex: 1;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--sheet);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  opacity: 0;
  transform: translateY(8px);
  animation: enter 480ms var(--ease) forwards;
  transition: border-color 160ms var(--ease), transform 120ms var(--ease);
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.card:active {
  transform: scale(0.99);
}

@keyframes enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.source-pill {
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.source-pill.bookmark {
  color: var(--bookmark);
  background: var(--accent-soft);
}

.source-pill.new {
  color: var(--new);
  background: var(--new-soft);
}

.card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.author {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.blurb {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

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

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: var(--chip);
  border-radius: 999px;
  padding: 3px 8px;
}


.card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 2px;
  min-height: 44px;
}

.open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  width: fit-content;
  transition: color 160ms var(--ease), border-color 160ms var(--ease),
    transform 120ms var(--ease);
}

.open-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.open-link:active {
  transform: scale(0.97);
}

.open-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  margin-top: auto;
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.footer .sig {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
}

.footer .sig .dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--sheet);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .app {
    display: block;
  }

  .topbar,
  .rail {
    display: none;
  }

  .sheet-wrap {
    padding: 0;
  }

  .sheet {
    border: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .sheet-head,
  .filters,
  .grid-wrap,
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sheet-head {
    padding-top: 22px;
  }

  .filters {
    top: 0;
  }

  .search-wrap {
    max-width: none;
    width: 100%;
  }

  .filter-row.source-row {
    gap: 4px 12px;
  }

  .filter-row.source-row .search-wrap {
    flex-basis: 100%;
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .chip,
  .open-link,
  .card,
  .search-wrap input {
    transition: none;
  }
}

/* Card body preview (full text opens in modal) */
.body-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.body-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.body-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.body-preview {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.body-open {
  appearance: none;
  align-self: flex-start;
  background: transparent;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  transition: color 160ms var(--ease), transform 120ms var(--ease);
}

.body-open:hover {
  color: var(--ink);
}

.body-open:active {
  transform: scale(0.97);
}

.blurb {
  flex: 0 0 auto;
}

.card {
  min-height: 0;
}

.open-link.github-link {
  color: var(--ink);
  font-weight: 600;
}

.open-link.x-link {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

.open-link.x-link:hover {
  color: var(--muted);
  border-bottom-color: var(--muted);
}

/* Modal */
body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: modalIn 280ms var(--ease) forwards;
}

@keyframes modalIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
}

.modal-head-text {
  min-width: 0;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.modal-meta {
  margin: 4px 0 0;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
}

.modal-close {
  appearance: none;
  flex-shrink: 0;
  min-height: 44px;
  min-width: 64px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: var(--chip);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 160ms var(--ease), transform 120ms var(--ease),
    background 160ms var(--ease);
}

.modal-close:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.modal-close:active {
  transform: scale(0.97);
}

.modal-body {
  padding: 14px 16px 20px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.body-text {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  background: var(--chip);
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--line);
}

.body-text-zh {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

@media (max-width: 720px) {
  .modal {
    padding: 0;
    place-items: stretch;
  }

  .modal-panel {
    width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .body-open,
  .modal-close {
    transition: none;
  }

  .modal-panel {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
