/*
Theme Name: kjqbj
Theme URI: https://example.com/
Description: 跨境电商情报局 Typecho 主题
Version: 1.0.0
Author: Codex
*/

:root {
  --bg: #f6faf8;
  --panel: #ffffff;
  --panel-soft: #edf7f4;
  --ink: #13231f;
  --muted: #5e716b;
  --line: #d7e9e4;
  --brand: #00876c;
  --brand-strong: #006f59;
  --accent: #0b9fb3;
  --shadow: 0 14px 36px rgba(0, 76, 61, 0.08);
  --radius: 8px;
  --action-border: #cfe3de;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fbfffd 0%, var(--bg) 54%, #f0f8f5 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--brand-strong);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 135, 108, 0.22);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 24px;
  background: rgba(247, 255, 252, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-main,
.layout {
  width: min(1540px, 100%);
  margin: 0 auto;
}

.topbar-main {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 420px;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  color: inherit;
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

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

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ghost,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.ghost {
  color: var(--brand-strong);
  background: var(--panel-soft);
}

.primary {
  color: #fff;
  background: var(--brand);
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 420px;
  gap: 18px;
  padding: 22px 24px 32px;
}

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

.sidebar,
.digest {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding-right: 2px;
}

.section,
.news-card,
.comment-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(0, 76, 61, 0.05);
}

.section,
.comment-panel {
  padding: 16px;
}

.section h2,
.feed-head h2,
.comment-panel h2 {
  margin: 0;
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.metric {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.metric span,
.topic span {
  color: var(--muted);
  font-size: 12px;
}

.brief {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fffc;
}

.brief b {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-strong);
  font-size: 13px;
}

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

.topic-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.topic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  background: #f4fbf8;
  text-align: left;
  text-decoration: none;
}

.topic b {
  font-size: 13px;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 2px;
}

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

.sort {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.sort a {
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.sort a.active {
  color: #fff;
  background: var(--brand);
}

.news-list {
  display: grid;
  gap: 12px;
}

.news-card {
  padding: 16px;
  content-visibility: auto;
  contain-intrinsic-size: 260px;
}

.news-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
}

.news-meta a,
.inline-filter {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.news-card h3,
.article-detail h2 {
  margin: 0;
  line-height: 1.35;
}

.news-card h3 {
  font-size: 18px;
}

.news-card h3 a {
  color: inherit;
  text-decoration: none;
}

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

.insight-preview,
.author-insight {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.insight-preview b,
.author-insight h3 {
  display: block;
  margin: 0 0 6px;
  color: var(--brand-strong);
  font-size: 13px;
}

.insight-preview p,
.insight-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.score {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #effaf7;
  text-align: center;
}

.score strong {
  display: block;
  color: var(--brand-strong);
  font-size: 22px;
  line-height: 1;
}

.score span {
  color: var(--muted);
  font-size: 11px;
}

.inline-score {
  margin-top: 14px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.card-actions span:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.mini-action,
.link-action {
  display: inline-flex;
  align-items: center;
  color: var(--brand-strong);
  background: #fff;
  border: 1px solid var(--action-border);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
}

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

.mini-action.negative.active {
  background: var(--muted);
  border-color: var(--muted);
}

.article-category a,
.post-category a {
  color: var(--brand-strong);
  font-weight: 800;
  text-decoration: none;
}

.article-content {
  margin-top: 18px;
  font-size: 16px;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.page-card {
  min-height: 420px;
}

.page-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.archive-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.archive-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

.archive-item:hover {
  border-color: rgba(0, 135, 108, 0.34);
  box-shadow: 0 10px 26px rgba(0, 76, 61, 0.08);
}

.archive-item time {
  color: var(--muted);
  font-size: 13px;
}

.archive-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-box {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.contact-box p {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}

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

.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.comment-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fefb;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-head span,
.comment-item p,
.comment-actions span {
  color: var(--muted);
  font-size: 13px;
}

.comment-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.comment-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.comment-fields .wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.comment-panel textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: #fbfffd;
}

.comment-panel textarea {
  min-height: 112px;
  margin-top: 12px;
  resize: vertical;
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.site-links {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.site-links nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-links a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.page-nav {
  padding: 12px 0;
}

.page-navigator {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.page-navigator a,
.page-navigator .current {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(19, 35, 31, 0.32);
}

.modal-backdrop.show {
  display: grid;
}

.share-modal {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.share-url {
  margin-top: 14px;
  padding: 10px;
  border-radius: var(--radius);
  background: #f4fbf8;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.back-top {
  position: fixed;
  right: 20px;
  bottom: 76px;
  z-index: 20;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .topbar-main,
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .top-actions,
  .digest {
    grid-column: 1 / -1;
  }

  .digest {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    padding: 14px;
  }

  .topbar-main,
  .layout {
    grid-template-columns: 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar-main {
    padding-left: 0;
    padding-right: 0;
  }

  .brand,
  .search,
  .top-actions {
    width: 100%;
    max-width: none;
  }

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

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .section,
  .news-card,
  .comment-panel {
    box-shadow: none;
  }

  .feed-head,
  .news-top,
  .card-actions,
  .comment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sort {
    width: 100%;
  }

  .sort a {
    flex: 1;
    text-align: center;
  }

  .score {
    width: 100%;
    height: auto;
    padding: 10px;
  }

  .card-actions span:last-child {
    justify-content: flex-start;
  }

  .comment-fields {
    grid-template-columns: 1fr;
  }

  .comment-fields .wide {
    grid-column: auto;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .archive-item span {
    white-space: normal;
  }

  .contact-box p {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .back-top {
    right: 14px;
    bottom: 70px;
  }
}
