* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f4f7f3;
  color: #17201b;
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
  line-height: 1.68;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 247, 243, 0.93);
  border-bottom: 1px solid #d9e0d7;
  backdrop-filter: blur(16px);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #10231e;
  color: #f7fbf4;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  margin: 3px 0 0;
  color: #66736c;
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool {
  min-height: 36px;
  border: 1px solid #ced8cf;
  background: #ffffff;
  border-radius: 8px;
  color: #19231f;
  padding: 0 11px;
  font: inherit;
  font-size: 14px;
}

.tool.search {
  min-width: 290px;
}

.tool.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}

.tool.button.dark {
  background: #10231e;
  color: #f7fbf4;
  border-color: #10231e;
}

.main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 48px;
}

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

.panel {
  background: #ffffff;
  border: 1px solid #dce4dc;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(26, 39, 32, 0.04);
}

.panel-head {
  padding: 13px 14px;
  border-bottom: 1px solid #e4ebe4;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
}

.panel-head p {
  margin: 2px 0 0;
  color: #68756e;
  font-size: 13px;
}

.panel-body {
  padding: 14px;
}

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

.stat {
  border: 1px solid #e3e9e2;
  border-radius: 8px;
  padding: 11px;
  background: #f9fbf8;
}

.stat.local {
  background: #f3f7ff;
  border-color: #dbe7ff;
}

.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
}

.stat span {
  display: block;
  color: #6d766f;
  font-size: 12px;
  margin-top: 4px;
}

.ignored-count {
  margin-top: 10px;
  color: #6a756e;
  font-size: 12px;
}

.source-list {
  display: grid;
  gap: 7px;
}

.source-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2ee;
  font-size: 13px;
}

.source-row:last-child {
  border-bottom: 0;
}

.source-row a {
  font-weight: 720;
  text-decoration: none;
}

.source-row span {
  color: #6e776f;
}

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

.tab {
  min-height: 34px;
  border: 1px solid #d2dcd3;
  border-radius: 999px;
  background: #ffffff;
  padding: 0 12px;
  cursor: pointer;
  color: #34423a;
}

.tab.active {
  background: #135e4b;
  color: #ffffff;
  border-color: #135e4b;
}

.feed-list,
.library-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.item {
  background: #ffffff;
  border: 1px solid #e3e9e2;
  border-radius: 8px;
  padding: 15px;
  display: grid;
  gap: 9px;
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.item.is-ignored {
  opacity: 0.48;
  border-style: dashed;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.item h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.38;
}

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

.chip {
  border: 1px solid #dce3dc;
  background: #f7faf6;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  color: #56635c;
}

.chip.x {
  background: #edf7f4;
  color: #125a48;
  border-color: #c9e8df;
}

.chip.podcast {
  background: #fff3df;
  color: #8a4c0c;
  border-color: #ffd9a8;
}

.chip.blog {
  background: #eef1ff;
  color: #39459a;
  border-color: #d6dbff;
}

.chip.local {
  background: #f1f5ff;
  color: #29427b;
  border-color: #d9e4ff;
}

.text {
  margin: 0;
  color: #324038;
  font-size: 14px;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-btn {
  min-height: 32px;
  border: 1px solid #d4ddd5;
  background: #ffffff;
  border-radius: 8px;
  padding: 0 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 730;
  cursor: pointer;
}

.small-btn.primary {
  background: #135e4b;
  color: #ffffff;
  border-color: #135e4b;
}

.small-btn.primary.just-added {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(47, 191, 113, 0.16);
}

.small-btn.ghost {
  color: #6b4a50;
  border-color: #ecd1d6;
  background: #fff7f8;
}

.workflow {
  display: grid;
  gap: 10px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.step-no {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #10231e;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 13px;
}

.workflow-step h3 {
  margin: 0;
  font-size: 14px;
}

.workflow-step p {
  margin: 2px 0 0;
  color: #607068;
  font-size: 13px;
}

.pick-status {
  display: none;
  margin-bottom: 10px;
}

.pick-status.show {
  display: block;
}

.pick-status-card {
  border: 1px solid #bce5cb;
  background: #effaf2;
  border-radius: 8px;
  padding: 10px;
  animation: statusIn 260ms ease-out;
}

.pick-status-card strong {
  display: block;
  color: #135e4b;
  font-size: 13px;
}

.pick-status-card span {
  display: block;
  color: #53635b;
  font-size: 12px;
  margin-top: 2px;
}

.pick-list {
  display: grid;
  gap: 8px;
}

.pick {
  border: 1px solid #e3e9e2;
  background: #f9fbf8;
  border-radius: 8px;
  padding: 10px;
}

.pick:first-child {
  border-color: #bce5cb;
  background: #f1fbf4;
}

.pick strong {
  display: block;
  font-size: 13px;
}

.pick p {
  margin: 4px 0 0;
  color: #62716a;
  font-size: 12px;
}

.library-panel {
  margin-top: 16px;
}

.library-head {
  align-items: flex-start;
}

.library-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.library-tabs {
  margin-bottom: 12px;
}

.vault-card {
  background: #ffffff;
}

.cell-list {
  display: grid;
  gap: 7px;
}

.cell-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
}

.cell-line span {
  color: #6c7870;
}

.cell-line strong {
  color: #233029;
  font-weight: 650;
}

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

.note-headings span {
  border: 1px solid #e0e7e0;
  background: #f8faf8;
  border-radius: 999px;
  padding: 3px 8px;
  color: #5b6861;
  font-size: 12px;
}

.firework {
  position: fixed;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 80;
}

.firework span {
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  animation: fireworkBurst 720ms cubic-bezier(0.12, 0.72, 0.18, 1) forwards;
}

.empty {
  color: #7b817d;
  font-size: 13px;
}

.footer {
  margin-top: 20px;
  color: #6f786f;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.focus {
  outline: 2px solid #d25073;
  outline-offset: 2px;
}

@keyframes fireworkBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.35);
  }

  70% {
    opacity: 1;
    transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%)) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(calc(var(--x) * 1.18 - 50%), calc(var(--y) * 1.18 - 50%)) scale(0.15);
  }
}

@keyframes statusIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .firework,
  .small-btn.primary.just-added,
  .pick-status-card {
    animation: none;
  }
}

@media (max-width: 1120px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    grid-template-columns: 1fr;
  }

  .tool.search {
    min-width: 0;
    width: 100%;
  }

  .toolbar {
    align-items: stretch;
    justify-content: stretch;
  }

  .tool {
    flex: 1;
  }

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

@media (max-width: 680px) {
  .topbar-inner,
  .main {
    padding-left: 14px;
    padding-right: 14px;
  }

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

  .item-head {
    display: grid;
  }

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

  .tool.search {
    grid-column: 1 / -1;
  }

  .tool.button.dark {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .cell-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
