:root {
  --bg: #eef1ed;
  --panel: #f8f9f6;
  --white: #fff;
  --ink: #17201a;
  --muted: #748079;
  --line: #dce2dc;
  --green: #245c43;
  --green-2: #dceadf;
  --orange: #e87b4d;
  --shadow: 0 20px 55px rgba(39, 55, 44, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.demo-banner {
  min-height: 42px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #dbe8df;
  background: #17201a;
  font-size: 12px;
}

.demo-banner span {
  padding: 4px 7px;
  border: 1px solid #4c5c52;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.demo-banner p { margin: 0; }

.demo-banner a {
  color: #fff;
  font-weight: 700;
  text-underline-offset: 3px;
}

.app-shell {
  min-height: calc(100vh - 42px);
  display: grid;
  grid-template-columns: 246px minmax(390px, 1fr) minmax(390px, .9fr);
}

.sidebar,
.feed-column,
.detail-column {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 42px);
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #f2f5f0;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 6px 28px;
}

.logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  font-family: Georgia, serif;
  font-size: 20px;
  font-style: italic;
}

.logo-row strong,
.logo-row span {
  display: block;
}

.logo-row strong {
  font-family: Georgia, serif;
  font-size: 21px;
}

.logo-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
}

.sync-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(36, 92, 67, .18);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.sync-button:hover { background: #1b4b35; }

.side-section { margin-top: 28px; }

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.side-heading button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.side-label {
  margin: 0 8px 9px;
  color: #8a948d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.side-heading .side-label { margin-inline: 0; }

.side-item,
.source-item {
  width: 100%;
  min-height: 39px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 10px;
  color: #58625b;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.side-item:hover,
.source-item:hover,
.side-item.active,
.source-item.active {
  color: var(--ink);
  background: #e4ebe4;
}

.side-item b,
.source-item b {
  min-width: 21px;
  padding: 3px 5px;
  border-radius: 999px;
  color: #77827a;
  background: rgba(255, 255, 255, .65);
  font-size: 9px;
  text-align: center;
}

.source-name {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.source-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-2);
  font-size: 10px;
  font-weight: 800;
}

.demo-safety {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #d7dfd7;
  border-radius: 12px;
  background: rgba(255, 255, 255, .45);
}

.demo-safety span {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.demo-safety p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.feed-column {
  padding: 42px 38px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.feed-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .16em;
}

.feed-header h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 3vw, 45px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.search {
  width: min(240px, 42%);
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.search span {
  color: var(--muted);
  font-size: 18px;
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.feed-meta {
  padding: 25px 3px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-meta strong,
.feed-meta span {
  display: block;
}

.feed-meta strong { font-size: 13px; }

.feed-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.article-list {
  display: grid;
  gap: 10px;
}

.article-card {
  width: 100%;
  padding: 18px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 15px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: inherit;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border .2s ease, transform .2s ease, box-shadow .2s ease;
}

.article-card:hover,
.article-card.active {
  border-color: #b9c8bd;
  box-shadow: 0 10px 24px rgba(39, 55, 44, .07);
  transform: translateY(-1px);
}

.article-card.unread .article-title::before {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  left: -13px;
  top: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.article-source-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--green);
  background: var(--green-2);
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
}

.article-main { min-width: 0; }

.article-title {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  color: #202923;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-excerpt {
  display: block;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-bottom {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  color: #879189;
  font-size: 9px;
}

.ai-badge {
  padding: 3px 6px;
  border-radius: 999px;
  color: #9b4b2a;
  background: #fae7dd;
  font-weight: 750;
}

.article-star {
  align-self: start;
  color: #8b958e;
  font-size: 16px;
}

.empty-feed {
  padding: 70px 20px;
  border: 1px dashed #cfd6d0;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.detail-column {
  min-height: calc(100vh - 42px);
  padding: 40px;
  background: #fff;
}

.empty-state {
  min-height: calc(100vh - 122px);
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  background: var(--panel);
  font-size: 21px;
}

.empty-state h2 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  font-weight: 500;
}

.empty-state p {
  max-width: 250px;
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
}

.hidden { display: none !important; }

.article-detail {
  max-width: 580px;
  margin: 0 auto;
  animation: detailIn .25s ease both;
}

@keyframes detailIn {
  from { opacity: 0; transform: translateY(8px); }
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.source-chip {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-2);
  font-size: 9px;
  font-weight: 800;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
}

.article-detail > h2 {
  margin: 25px 0 12px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 3vw, 43px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.detail-meta {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.ai-card {
  margin-top: 30px;
  padding: 23px;
  border: 1px solid #cddbcf;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,255,255,.8), transparent 34%),
    #edf5ee;
}

.ai-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--green);
}

.ai-card-heading strong,
.ai-card-heading small {
  display: block;
}

.ai-card-heading strong { font-size: 12px; }

.ai-card-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.ai-card > p {
  margin: 18px 0 0;
  color: #344238;
  font-size: 12px;
  line-height: 1.75;
}

.insight-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.insight-item {
  position: relative;
  padding-left: 18px;
  color: #4e5b52;
  font-size: 10px;
  line-height: 1.6;
}

.insight-item::before {
  content: "↳";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 800;
}

.content-section {
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}

.detail-label {
  margin: 0 0 10px;
  color: #8a948d;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .1em;
}

.content-section > p:last-child {
  margin: 0;
  color: #525d55;
  font-size: 11px;
  line-height: 1.75;
}

.next-action {
  padding: 14px 15px;
  border-left: 3px solid var(--orange);
  color: #49534c;
  background: #faf5f1;
  font-size: 11px;
  line-height: 1.65;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 26px;
}

.detail-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.detail-actions .secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  max-width: min(90vw, 430px);
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  background: #17201a;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 220px minmax(400px, 1fr);
  }

  .detail-column {
    grid-column: 2;
    padding-top: 0;
  }

  .empty-state {
    min-height: 300px;
  }
}

@media (max-width: 760px) {
  .demo-banner {
    justify-content: space-between;
  }

  .demo-banner p { display: none; }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .logo-row {
    margin-bottom: 16px;
  }

  .side-section,
  .demo-safety {
    display: none;
  }

  .feed-column {
    padding: 28px 18px;
    border-right: 0;
  }

  .feed-header {
    display: block;
  }

  .search {
    width: 100%;
    margin-top: 24px;
  }

  .article-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 15px;
  }

  .article-source-icon {
    width: 38px;
    height: 38px;
  }

  .detail-column {
    padding: 28px 18px 60px;
    border-top: 1px solid var(--line);
  }

  .empty-state {
    min-height: 220px;
  }
}
