:root {
  --bg: #edf3f6;
  --bg-accent: #dce8ee;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --text: #101828;
  --muted: #5f6b75;
  --line: #d8e2e9;
  --brand: #0f766e;
  --brand-strong: #0b5f59;
  --chip: #e8f2f1;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(15, 118, 110, 0.11), transparent 30%),
    radial-gradient(circle at 92% 14%, rgba(245, 158, 11, 0.1), transparent 33%),
    linear-gradient(140deg, var(--bg), var(--bg-accent));
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Segoe UI",
    sans-serif;
}

.page-shell {
  width: min(1460px, 96vw);
  margin: 18px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topbar,
.controls,
.feed-panel,
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
}

.ticker-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(92deg, #0f172a, #1f2937);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 12px;
}

.ticker-label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #facc15;
}

.ticker-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
  animation: ticker-scroll 36s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  border: 0;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}

.ticker-source {
  color: #93c5fd;
  font-weight: 600;
}

.ticker-title {
  color: #f8fafc;
}

.ticker-empty {
  font-size: 13px;
  color: #cbd5e1;
}

.brand h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-kicker {
  margin: 0 0 4px;
  color: var(--brand);
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.top-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 10px;
  align-self: center;
}

.stat {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 10px 12px;
}

.stat p {
  margin: 0;
}

.stat .k {
  color: var(--muted);
  font-size: 12px;
}

.stat .v {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 700;
}

.controls {
  padding: 12px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.3fr;
  gap: 8px;
  align-items: center;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 0 12px;
}

.search-icon {
  opacity: 0.75;
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
}

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

.tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.filters {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

select,
.ghost-btn,
.solid-btn,
.load-more-btn,
.close-detail-btn {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 13px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

select {
  min-width: 110px;
}

.ghost-btn,
.solid-btn,
.load-more-btn,
.close-detail-btn {
  cursor: pointer;
}

.ghost-btn.active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.solid-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.solid-btn:hover {
  background: var(--brand-strong);
}

.workspace {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  min-height: calc(100vh - 216px);
}

.feed-panel,
.detail-panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 320px);
  overflow: auto;
  padding-right: 4px;
}

.feed-list::-webkit-scrollbar {
  width: 8px;
}

.feed-list::-webkit-scrollbar-thumb {
  background: #c9d6df;
  border-radius: 999px;
}

.news-item {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
}

.news-item.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.thumb {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #0f766e, #14b8a6);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-body h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.28;
}

.item-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px 8px;
  font-size: 12px;
  background: var(--chip);
}

.chip.info-source {
  background: #e5eef8;
}

.chip.source {
  background: #f8ece2;
}

.chip.category {
  background: #eaf4e4;
}

.item-date {
  color: var(--muted);
  font-size: 12px;
}

.item-state {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
}

.state-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px 8px;
}

.state-pill.read {
  background: #e9fbf4;
  color: #166534;
}

.state-pill.favorite {
  background: #fff7ec;
  color: #b45309;
}

.load-more-btn {
  margin-top: 10px;
  width: 100%;
  height: 40px;
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.detail-panel {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.detail-header-mobile {
  display: none;
}

.detail-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.23;
  letter-spacing: -0.02em;
}

.detail-meta {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-image {
  width: 100%;
  border-radius: 12px;
  margin: 8px 0 14px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 16px;
}

.detail-actions a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

.detail-actions a.primary {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.detail-actions .action-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.detail-actions .favorite-btn {
  border-color: #f59e0b;
  color: #b45309;
  background: #fff7ed;
}

.detail-actions .share-btn {
  border-color: #60a5fa;
  color: #1d4ed8;
  background: #eff6ff;
}

.detail-body {
  line-height: 1.72;
  font-size: 15px;
  color: #1f2937;
}

.detail-body p {
  margin: 0 0 12px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-feed,
.empty-detail {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 24px 18px;
  background: var(--panel-soft);
  text-align: center;
  color: var(--muted);
}

.mobile-mask {
  display: none;
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

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

  .filters {
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .feed-list {
    max-height: 56vh;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: 98vw;
    margin: 10px auto 14px;
    gap: 10px;
  }

  .topbar {
    flex-direction: column;
    padding: 14px;
  }

  .top-stats {
    width: 100%;
    grid-template-columns: repeat(2, minmax(80px, 1fr));
  }

  .brand h1 {
    font-size: 28px;
  }

  .controls {
    padding: 10px;
    gap: 10px;
  }

  .ticker-bar {
    border-radius: 10px;
    padding: 7px 10px;
  }

  .ticker-item {
    font-size: 12px;
  }

  .search-wrap,
  select,
  .ghost-btn,
  .solid-btn {
    height: 42px;
    font-size: 14px;
  }

  .news-item {
    grid-template-columns: 56px 1fr;
    gap: 10px;
    padding: 9px;
  }

  .item-state {
    grid-column: 2 / 3;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .item-body h3 {
    font-size: 16px;
  }

  .detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: none;
    border-radius: 0;
    transform: translateX(104%);
    transition: transform 0.24s ease;
    z-index: 40;
    padding: 12px;
  }

  .detail-header-mobile {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
  }

  .close-detail-btn {
    height: 34px;
  }

  .detail-title {
    font-size: 24px;
  }

  .mobile-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.detail-open .detail-panel {
    transform: translateX(0);
  }

  body.detail-open .mobile-mask {
    opacity: 1;
    pointer-events: auto;
  }
}
