/* CryptoIndex 前台样式 — 无外部依赖，可直接部署在内网/国内服务器 */
:root {
  --bg: #080d18;
  --panel: #101a2e;
  --panel-2: #16223b;
  --border: #22304c;
  --text: #e6edfa;
  --muted: #8b9ab5;
  --dim: #64748f;
  --accent: #5b93ff;
  --accent-soft: rgba(91, 147, 255, .12);
  --up: #f6465d;   /* 涨：红（中国市场习惯） */
  --down: #0ecb81; /* 跌：绿 */
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 顶部行情条 */
.ticker { background: #0c1424; border-bottom: 1px solid var(--border); font-size: 12px; }
.ticker-inner {
  max-width: 1200px; margin: 0 auto; padding: 7px 20px;
  display: flex; align-items: center; gap: 18px; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none;
}
.ticker-inner::-webkit-scrollbar { display: none; }
.ticker-label { color: var(--accent); font-weight: 700; letter-spacing: 1px; flex: none; }
.ticker-item { color: var(--muted); flex: none; }
.ticker-item b { color: var(--text); margin-right: 5px; }
.ticker-price { color: var(--text); margin-right: 5px; }
.up { color: var(--up); }
.down { color: var(--down); }
.ticker-tip { margin-left: auto; color: var(--dim); flex: none; }

/* 站点头部 */
.site-header { background: rgba(16, 26, 46, .92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, #5b93ff, #38e0c8);
  box-shadow: 0 0 18px rgba(91, 147, 255, .45); position: relative;
}
.brand-mark::after { content: ""; position: absolute; inset: 7px; border: 2px solid #0b1222; border-radius: 3px; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); padding: 7px 11px; border-radius: 6px; white-space: nowrap; font-size: 14px; }
.nav a:hover { background: var(--accent-soft); color: #fff; }
.nav a.active { color: #fff; background: var(--accent-soft); }
.search-box { display: flex; flex: none; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #0c1424; }
.search-box input { width: 180px; padding: 8px 12px; border: 0; outline: none; background: transparent; color: var(--text); }
.search-box input::placeholder { color: var(--dim); }
.search-box button { border: 0; padding: 8px 14px; background: var(--accent-soft); color: var(--accent); cursor: pointer; font-size: 13px; }
.search-box button:hover { background: var(--accent); color: #fff; }

/* 公告 */
.notice { background: linear-gradient(90deg, rgba(91,147,255,.14), rgba(56,224,200,.06)); border-bottom: 1px solid var(--border); color: #c8d8f5; font-size: 13px; }
.notice .container { padding-top: 9px; padding-bottom: 9px; }

/* 布局 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding-top: 26px; padding-bottom: 40px; min-height: 60vh; }
.main { min-width: 0; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.page-head h1 { font-size: 21px; margin: 0; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.section-title { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 0 12px; padding-left: 11px; border-left: 3px solid var(--accent); }

/* 文章卡片 */
.article-list { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card { display: flex; gap: 16px; padding: 18px; border-bottom: 1px solid var(--border); transition: background .15s; }
.card:last-child { border-bottom: 0; }
.card:hover { background: var(--panel-2); }
.card-thumb { flex: none; width: 152px; height: 96px; border-radius: 8px; overflow: hidden; background: #0c1424; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; transition: opacity .2s, transform .3s; }
.card:hover .card-thumb img { opacity: 1; transform: scale(1.04); }
.card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.card-meta .source { color: var(--accent); }
.card-meta .dot { color: var(--dim); }
.badge { background: var(--accent-soft); color: #9dc0ff; padding: 1px 8px; border-radius: 4px; font-size: 12px; }
.badge-top { background: rgba(246, 70, 93, .14); color: var(--up); }
.card-title { font-size: 17px; line-height: 1.5; margin: 8px 0 6px; font-weight: 600; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-summary { color: var(--muted); font-size: 13.5px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.tag { color: var(--dim); font-size: 12px; margin-right: 9px; }
.card-actions { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.card-actions .origin { color: var(--accent); }

/* 侧栏 */
.sidebar { min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.panel-title { font-size: 14px; margin: 0 0 14px; font-weight: 700; padding-left: 10px; border-left: 3px solid var(--accent); }
.hot-list { list-style: none; margin: 0; padding: 0; counter-reset: hot; }
.hot-list li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.05); font-size: 13.5px; line-height: 1.55; }
.hot-list li:last-child { border-bottom: 0; }
.hot-list li.empty { color: var(--dim); border: 0; }
.hot-num { flex: none; width: 20px; height: 20px; border-radius: 4px; background: var(--panel-2); color: var(--muted); font-size: 12px; text-align: center; line-height: 20px; }
.hot-list li:nth-child(1) .hot-num, .hot-list li:nth-child(2) .hot-num, .hot-list li:nth-child(3) .hot-num { background: var(--accent); color: #fff; }
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-list a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 6px; color: var(--muted); font-size: 13.5px; }
.cat-list a:hover, .cat-list a.active { background: var(--accent-soft); color: #fff; }
.cat-list em { font-style: normal; color: var(--dim); }
.source-list { display: flex; flex-wrap: wrap; gap: 7px; }
.source-list a, .source-list span { font-size: 12px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); }
.source-list a:hover { border-color: var(--accent); color: var(--accent); }
.panel-tip p { color: var(--muted); font-size: 12.5px; margin: 0; }

/* 分页 / 空状态 */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.page-btn { display: inline-block; min-width: 34px; padding: 6px 11px; text-align: center; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--muted); font-size: 13px; }
.page-btn:hover { border-color: var(--accent); color: #fff; }
.page-btn.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-dots { color: var(--dim); }
.empty-state { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state .big { font-size: 34px; color: var(--dim); margin-bottom: 10px; }
.empty-state a { color: var(--accent); }

/* 详情页 */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--accent); }
.article-box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.article-box h1 { font-size: 26px; line-height: 1.45; margin: 0 0 16px; font-weight: 700; }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.article-summary { margin: 22px 0; font-size: 15.5px; line-height: 1.9; color: #d3def2; }
.article-hero { width: 100%; max-height: 380px; object-fit: cover; border-radius: 8px; margin: 4px 0 20px; display: block; }
.origin-box { background: var(--panel-2); border: 1px dashed var(--border); border-radius: 8px; padding: 18px; margin-top: 22px; }
.origin-box p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.btn-origin { display: inline-block; padding: 10px 20px; background: var(--accent); color: #fff; border-radius: 7px; font-size: 14px; font-weight: 600; }
.btn-origin:hover { background: #79a9ff; color: #fff; }
.origin-url { display: block; margin-top: 10px; color: var(--dim); font-size: 12px; word-break: break-all; }
.article-tags { margin-top: 18px; }
.related { margin-top: 24px; }
.related-list { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 18px; }
.related-list a { display: block; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,.06); font-size: 14px; color: var(--muted); }
.related-list a:last-child { border-bottom: 0; }
.related-list a:hover { color: var(--accent); }

/* 搜索页 */
.search-form { display: flex; gap: 8px; margin-bottom: 20px; }
.search-form input { flex: 1; padding: 11px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; color: var(--text); outline: none; }
.search-form input:focus { border-color: var(--accent); }
.search-form button { padding: 11px 22px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
.search-hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); background: #0b1220; padding: 32px 0 26px; margin-top: 10px; }
.footer-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-brand { font-size: 17px; font-weight: 700; }
.footer-desc { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.footer-links { display: flex; gap: 20px; align-items: center; font-size: 13px; color: var(--muted); }
.disclaimer { margin: 24px 0 10px; padding: 14px 16px; border-left: 3px solid var(--accent); background: rgba(91,147,255,.06); color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.copyright { color: var(--dim); font-size: 12px; margin: 0; text-align: center; }
.back-top { position: fixed; right: 22px; bottom: 24px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; display: none; z-index: 40; }
.back-top:hover { border-color: var(--accent); color: var(--accent); }

/* 响应式 */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .sidebar .panel { margin-bottom: 0; }
  .search-box input { width: 130px; }
}
@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .header-inner { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .brand { font-size: 17px; }
  .nav { order: 3; flex-basis: 100%; }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 14px; gap: 12px; }
  .card-thumb { width: 92px; height: 70px; }
  .card-title { font-size: 15.5px; }
  .card-summary { -webkit-line-clamp: 2; }
  .article-box { padding: 18px; }
  .article-box h1 { font-size: 21px; }
  .ticker-tip { display: none; }
  .footer-links { gap: 12px; flex-wrap: wrap; }
}
@media (max-width: 400px) {
  .card-thumb { display: none; }
  .search-box input { width: 90px; }
}
