/* ========================================
   链闻社 - 区块链新闻博客 主样式
   迅睿CMS模板配套CSS
   ======================================== */

/* SECTION: reset & base */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #1a1a1a;
  --text-sub: #555;
  --text-muted: #999;
  --border: #eaeaea;
  --gold: #c8a02e;
  --gold-bg: rgba(200,160,46,.1);
  --cyan: #0ea5b8;
  --cyan-bg: rgba(14,165,184,.08);
  --red: #dc3545;
  --green: #1a9e5c;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--cyan); }
img { max-width: 100%; height: auto; display: block; }

/* SECTION: header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
}

.site-logo em {
  font-style: normal;
  color: var(--gold);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  padding: 4px;
  order: -1;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.main-nav a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-sub);
  padding: .4rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

/* SECTION: container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* SECTION: market bar */
.market-bar {
  display: flex;
  background: var(--text);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.market-item {
  flex: 1;
  padding: 1rem 1.25rem;
  border-right: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.market-item:last-child { border-right: none; }

.market-item .sym {
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.market-item .val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.market-item .chg {
  font-size: .78rem;
  font-weight: 600;
}

.chg.up { color: var(--green); }
.chg.down { color: var(--red); }

/* SECTION: chart */
.chart-section {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-top h3 {
  font-size: 1rem;
  font-weight: 700;
}

.chart-tabs {
  display: flex;
  gap: .4rem;
}

.chart-tab {
  padding: .35rem .9rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.chart-tab:hover { border-color: var(--cyan); color: var(--cyan); }

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

#priceChart { width: 100%; height: 280px; }

/* SECTION: ticker */
.ticker-bar {
  background: var(--gold-bg);
  border: 1px solid rgba(200,160,46,.18);
  border-radius: 8px;
  padding: .6rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  overflow: hidden;
}

.ticker-label {
  background: var(--gold);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  height: 22px;
  position: relative;
}

.ticker-scroll {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  position: absolute;
  top: 0;
  left: 0;
  animation: ticker-x 50s linear infinite;
}

.ticker-scroll span {
  font-size: .82rem;
  color: var(--text-sub);
}

.ticker-scroll .t-time {
  color: var(--gold);
  font-weight: 600;
  margin-right: .4rem;
}

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

/* SECTION: section title */
.sec-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.sec-title::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--gold);
  border-radius: 2px;
}

.sec-title .more {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.sec-title .more:hover { color: var(--cyan); }

/* SECTION: news list */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.news-item:first-child { padding-top: 0; }

.news-item:hover .news-title { color: var(--cyan); }

.news-thumb {
  width: 180px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-alt);
}

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

.news-body { flex: 1; min-width: 0; }

.news-top {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .4rem;
}

.tag {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 4px;
  letter-spacing: .3px;
}

.tag-gold { background: var(--gold-bg); color: var(--gold); }
.tag-cyan { background: var(--cyan-bg); color: var(--cyan); }

.news-date {
  font-size: .75rem;
  color: var(--text-muted);
}

.news-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: .35rem;
  transition: color .2s;
}

.news-summary {
  font-size: .88rem;
  color: var(--text-sub);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .5rem;
  font-size: .78rem;
  color: var(--text-muted);
}

.news-author { color: var(--cyan); font-weight: 500; }

/* SECTION: list page filters */
.filter-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: .4rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-sub);
  font-size: .82rem;
  font-weight: 500;
  transition: all .2s;
}

.filter-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.filter-btn.active,
.filter-btn a.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* SECTION: pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-top: 2rem;
  padding-bottom: 1rem;
}
.pagination li{list-style: none;}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-sub);
  font-size: .85rem;
  font-weight: 500;
  transition: all .2s;
}

.pagination a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.pagination .current,
.pagination span.current {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* SECTION: article / show page */
.article-wrap {
  max-width: 780px;
  margin: 0 auto;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-sub);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: all .2s;
}

.nav-back:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.nav-back svg { width: 16px; height: 16px; }

.breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--cyan); }
.breadcrumb a:hover { text-decoration: underline; }

.art-header { margin-bottom: 1.5rem; }

.art-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.art-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.art-meta .author-name { color: var(--cyan); font-weight: 500; }

.art-tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.art-body {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  line-height: 1.9;
  font-size: .95rem;
  color: var(--text-sub);
}

.art-body h2,
.art-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.8rem 0 .8rem 0;
  padding-left: .75rem;
  border-left: 3px solid var(--gold);
}

.art-body p { margin-bottom: 1rem; }

.art-body img {
  border-radius: 8px;
  margin: 1rem 0;
}

.art-body blockquote {
  border-left: 3px solid var(--cyan);
  padding: .75rem 1rem;
  background: var(--cyan-bg);
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
  color: var(--text-sub);
}

/* prev / next */
.art-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.art-pager-item {
  flex: 1;
  padding: 1rem;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color .2s;
}

.art-pager-item:hover { border-color: var(--cyan); }

.art-pager-item .label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.art-pager-item .title {
  font-size: .9rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-pager-item.next { text-align: right; }

/* related section */
.related-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* SECTION: two-column layout（列表页、内容页左右布局） */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.75rem;
  align-items: start;
}

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

/* 内容页原本是居中单栏，放进左栏后取消限宽 */
.layout .article-wrap { max-width: none; margin: 0; }

/* 侧栏卡片 */
.side-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem .4rem;
  margin-bottom: 1.25rem;
}

.side-card:last-child { margin-bottom: 0; }

.side-title {
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .6rem;
  margin-bottom: .3rem;
  border-bottom: 1px solid var(--border);
}

.side-title::before {
  content: '';
  width: 3px;
  height: 15px;
  background: var(--gold);
  border-radius: 2px;
}

/* 侧栏：纯文字列表 */
.side-list,
.side-rank {
  display: flex;
  flex-direction: column;
}

.side-list li,
.side-rank li {
  list-style: none;
  border-bottom: 1px dashed var(--border);
}

.side-list li:last-child,
.side-rank li:last-child { border-bottom: none; }

.side-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .55rem 0;
  font-size: .85rem;
  color: var(--text-sub);
}

.side-list .s-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.side-list .s-date {
  flex-shrink: 0;
  font-size: .72rem;
  color: var(--text-muted);
}

.side-list a:hover .s-text,
.side-thumb:hover .t { color: var(--cyan); }

/* 侧栏：带缩略图的列表 */
.side-thumb {
  display: flex;
  gap: .7rem;
  padding: .6rem 0;
  border-bottom: 1px dashed var(--border);
}

.side-thumb:last-child { border-bottom: none; }

.side-thumb img {
  width: 92px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.side-thumb .t {
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-thumb .d {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* 侧栏：排行榜，序号由计数器生成 */
.side-rank { counter-reset: rank; }

.side-rank li {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .55rem 0;
  font-size: .85rem;
  color: var(--text-sub);
}

.side-rank li::before {
  counter-increment: rank;
  content: counter(rank);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: .12rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.side-rank li:nth-child(-n+3)::before {
  background: var(--gold);
  color: #fff;
}

.side-rank li a {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-rank li a:hover { color: var(--cyan); }

/* 侧栏：栏目/关键词 chips */
.side-cats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .5rem 0 .75rem;
}

.side-cats a {
  padding: .3rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .8rem;
  color: var(--text-sub);
}

.side-cats a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .layout .article-wrap { margin: 0; }
}

/* SECTION: footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  margin-top: 3rem;
}

/* SECTION: responsive */
@media (max-width: 768px) {
  .header-inner { height: 54px; padding: 0 1rem; position: relative; }
  .site-logo {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
  }
  .site-logo img { max-height: 40px; width: auto; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: 0; left: -260px;
    width: 260px; height: 100vh;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    padding: 5rem 1.5rem 2rem;
    border-right: 1px solid var(--border);
    transition: left .3s ease;
    z-index: 95;
    overflow-y: auto;
  }
  .main-nav.open { left: 0; }
  .main-nav a { font-size: 1rem; padding: .75rem 0;text-align: center;width: 100%; border-bottom: 1px solid var(--border); border-bottom-color: transparent; }
  .main-nav a:hover, .main-nav a.active { border-bottom-color: transparent; color: var(--gold); }
  .nav-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 90;
  }
  .nav-overlay.show { display: block; }
  .container { padding: 1rem; }

  .market-bar { flex-wrap: wrap; border-radius: 8px; }
  .market-item {
    flex: 1 1 45%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: .8rem 1rem;
  }
  .market-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.08); }

  .chart-top { flex-direction: column; gap: .75rem; align-items: flex-start; }
  #priceChart { height: 220px; }

  .news-item { flex-direction: column; }
  .news-thumb { width: 100%; height: auto;}
  .news-title { font-size: .95rem; }

  .art-header h1 { font-size: 1.35rem; }
  .art-meta { flex-direction: column; gap: .4rem; }
  .art-pager { flex-direction: column; }
}

@media (max-width: 480px) {
  .market-item { flex: 1 1 100%; border-right: none !important; }
  .market-item:nth-child(odd) { border-right: none; }
  .news-thumb { width: 100%; height: auto;}
  .filter-bar { gap: .4rem; }
  .filter-btn { padding: .35rem .8rem; font-size: .78rem; }
}
