@charset "utf-8";
/* 王传金说股票期货博客 · site_mb 前端样式
   移动端优先：先写手机基础样式，再由 min-width 媒体查询增强平板 / 桌面 */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --text: #1c2532;
  --muted: #68758a;
  --primary: #1d63d8;
  --primary-dark: #154cae;
  --accent: #f0a020;
  --border: #e3e9f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 14px rgba(28, 51, 92, .06);
  --shadow-lg: 0 10px 30px rgba(28, 51, 92, .10);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 3px solid rgba(29, 99, 216, .45); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--primary);
  color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; color: #fff; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.main { padding-top: 18px; padding-bottom: 32px; min-height: 55vh; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: .94rem; font-weight: 600; line-height: 1.4; transition: background .18s, color .18s, transform .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-main { background: var(--primary); color: #fff; }
.btn-main:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); border-color: #c9d8f2; }
.btn-ghost:hover { background: var(--surface-2); color: var(--primary-dark); }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 22px; text-align: center; }

/* ---------- 顶部 ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); flex: 1; }
.brand:hover { color: var(--text); }
.brand-mark { flex: none; width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), #4d90f5); color: #fff;
  display: grid; place-items: center; font-size: 1.2rem; font-weight: 800; box-shadow: var(--shadow); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.brand-text strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text em { font-style: normal; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.top-search { display: none; }
.nav-toggle { flex: none; width: 42px; height: 38px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); display: grid; align-content: center;
  justify-items: center; gap: 4px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.site-nav { display: none; background: var(--surface); border-bottom: 1px solid var(--border); }
.site-nav.is-open { display: block; }
.nav-inner { padding-top: 6px; padding-bottom: 8px; }
.nav-inner ul { display: flex; flex-direction: column; }
.nav-inner li { border-bottom: 1px solid #f0f3f8; }
.nav-inner li:last-child { border-bottom: 0; }
.nav-inner a { display: block; padding: 10px 6px; color: var(--text); font-size: .95rem; }
.nav-inner a:hover { color: var(--primary); }

/* ---------- 面包屑 ---------- */
.crumb { font-size: .84rem; color: var(--muted); margin: 0 0 16px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }

/* ---------- 首页 ---------- */
.hero { background: linear-gradient(135deg, #eaf1ff 0%, #f7faff 60%, #ffffff 100%);
  border: 1px solid #dde8fa; border-radius: var(--radius); padding: 26px 20px;
  box-shadow: var(--shadow); margin-bottom: 24px; }
.hero-kicker { font-size: .78rem; letter-spacing: .08em; color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.hero h1 { font-size: 1.6rem; margin-bottom: 12px; }
.hero-sub { color: #43506a; font-size: .98rem; max-width: 42em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.hero-note { font-size: .8rem; color: var(--muted); margin: 0; }
.hero-side { display: flex; gap: 10px; margin-top: 20px; }
.hero-stat { flex: 1; background: rgba(255,255,255,.85); border: 1px solid #e0e9f8;
  border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; }
.hero-stat strong { display: block; font-size: 1.3rem; color: var(--primary); line-height: 1.2; }
.hero-stat span { font-size: .72rem; color: var(--muted); }

.sort-entry, .home-latest, .home-cols, .home-intro { margin-bottom: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-more, .block-more { font-size: .84rem; white-space: nowrap; }
.sort-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sort-grid a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 14px; box-shadow: var(--shadow); transition: border-color .18s, transform .18s; }
.sort-grid a:hover { border-color: #b9cff2; transform: translateY(-2px); }
.sort-grid strong { display: block; font-size: .98rem; color: var(--text); }
.sort-grid span { display: block; font-size: .76rem; color: var(--muted); margin-top: 2px; }

.card-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; gap: 12px; padding: 12px; }
.card-thumb { flex: none; width: 92px; height: 92px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { font-size: 1.7rem; font-weight: 800; color: #b7c8e6; }
.card-body { min-width: 0; flex: 1; }
.card-body h3 { font-size: .98rem; margin: 0 0 6px; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--primary); }
.card-body p { font-size: .82rem; color: var(--muted); margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .74rem; color: #8c98aa; }
.card-meta time { margin: 0; }

.home-cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
.home-block, .side-card, .home-intro, .gb-block, .search-page, .related, .gb-intro {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); }
.home-block { padding: 16px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 8px; }
.block-head h2 { font-size: 1.02rem; margin: 0; }
.block-head h2 a { color: var(--text); }
.home-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed #eef1f6; font-size: .88rem; }
.home-list li:last-child { border-bottom: 0; }
.home-list a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-list a:hover { color: var(--primary); }
.home-list time { flex: none; font-size: .74rem; color: #98a2b3; }
.home-intro { padding: 18px; }
.home-intro h2 { font-size: 1.1rem; }
.home-intro p { font-size: .9rem; color: #4a5568; }

/* ---------- 列表 / 内容 通用 ---------- */
.content-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.primary { min-width: 0; }
.list-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.list-head h1 { margin: 0 0 6px; }
.list-head p { font-size: .88rem; color: var(--muted); margin: 0; }
.sort-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; -webkit-overflow-scrolling: touch; }
.sort-tabs a { flex: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; font-size: .84rem; color: var(--muted); }
.sort-tabs a:hover { color: #fff; background: var(--primary); border-color: var(--primary); }

.article-list { display: grid; gap: 12px; }
.article-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); display: flex; gap: 12px; }
.list-thumb { flex: none; width: 84px; height: 84px; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-text { min-width: 0; flex: 1; }
.list-text h2 { font-size: 1.02rem; margin: 0 0 6px; }
.list-text h2 a { color: var(--text); }
.list-text h2 a:hover { color: var(--primary); }
.article-excerpt { font-size: .85rem; color: var(--muted); margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .76rem; color: #98a2b3; margin: 0; }
.article-tag { background: var(--surface-2); color: var(--primary); border-radius: 4px; padding: 0 7px; }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center;
  margin-top: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .86rem; }
.pager a { padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px; }
.pager a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager-num a { display: inline-block; margin: 0 2px; }
.pager-info { color: var(--muted); }

.article-detail { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.detail-head { border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 18px; }
.detail-head h1 { font-size: 1.5rem; margin: 0 0 10px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--muted); margin: 0; }
.article-body { font-size: 1rem; color: #26303f; overflow-wrap: break-word; }
.article-body p { margin: 0 0 1.1em; }
.article-body img { display: block; max-width: 100%; height: auto !important; margin: 12px auto;
  border-radius: var(--radius-sm); }
.article-body iframe, .article-body embed, .article-body video { display: block; width: 100%;
  max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; margin: 16px 0; border-radius: var(--radius-sm); }
.article-body .center-block { text-align: center; max-width: 100%; }
.article-body .center-block iframe { margin-left: auto; margin-right: auto; }
.article-body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.article-body td, .article-body th { border: 1px solid var(--border); padding: 8px; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body h2, .article-body h3 { margin-top: 1.4em; }
.detail-foot { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 16px; }
.detail-keywords { font-size: .82rem; color: var(--muted); }
.prev-next p { display: flex; gap: 8px; align-items: baseline; font-size: .88rem; margin: 0 0 6px; }
.prev-next span { flex: none; color: var(--muted); font-size: .8rem; }
.prev-next a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-actions { display: flex; gap: 16px; font-size: .86rem; margin-top: 12px; }
.related { padding: 16px; margin-top: 18px; }
.related h2 { font-size: 1.05rem; }
.related-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed #eef1f6; font-size: .88rem; }
.related-list li:last-child { border: 0; }
.related-list a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-list time { flex: none; font-size: .74rem; color: #98a2b3; }

.sidebar { display: grid; gap: 14px; }
.side-card { padding: 16px; }
.side-card h2 { font-size: 1rem; margin-bottom: 10px; }
.side-card p { font-size: .86rem; color: var(--muted); }
.side-accent { background: linear-gradient(135deg, #eef4ff, #ffffff); border-color: #d7e4fb; }
.side-note { background: #fbfcfe; }
.side-list li { padding: 6px 0; border-bottom: 1px dashed #eef1f6; font-size: .86rem; }
.side-list li:last-child { border: 0; }
.side-list a { color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list a:hover { color: var(--primary); }

/* ---------- 留言 ---------- */
.comment-area { margin-top: 20px; }
.gb-block { padding: 18px; }
.gb-head h2 { font-size: 1.1rem; margin-bottom: 6px; }
.gb-head p { font-size: .84rem; color: var(--muted); margin-bottom: 16px; }
.gb-form { display: grid; gap: 12px; }
.gb-row { display: grid; gap: 12px; }
.gb-field { display: grid; gap: 5px; font-size: .84rem; color: #4a5568; }
.gb-field i { color: #d64545; font-style: normal; }
.gb-field input, .gb-field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fbfcfe; color: var(--text); font-size: .92rem; }
.gb-field textarea { resize: vertical; min-height: 92px; }
.gb-field input:focus, .gb-field textarea:focus { border-color: var(--primary); background: #fff; outline: none; }
.gb-bottom { align-items: end; }
.gb-code-line { display: flex; gap: 8px; align-items: center; }
.gb-code-line input { flex: 1; min-width: 0; }
.gb-code-img { flex: none; width: 110px; height: 38px; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; background: #fff; }
.gb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gb-submit { justify-self: start; }
.gb-tip { font-size: .84rem; margin: 0; min-height: 1.2em; }
.gb-tip.ok { color: #16814a; }
.gb-tip.err { color: #c23b3b; }
.gb-list-wrap { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.gb-list-wrap h3 { font-size: 1rem; margin-bottom: 12px; }
.gb-list-wrap h3 small { font-size: .78rem; color: var(--muted); font-weight: 400; }
.gb-loading { color: var(--muted); font-size: .86rem; }
.gb-item { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.gb-item:last-child { border-bottom: 0; }
.gb-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.gb-item-head strong { font-size: .9rem; color: var(--text); }
.gb-item-head time { font-size: .74rem; color: #98a2b3; }
.gb-item-body { font-size: .9rem; color: #38445a; white-space: pre-wrap; overflow-wrap: anywhere; }
.gb-reply { margin-top: 8px; padding: 9px 12px; background: var(--surface-2);
  border-left: 3px solid var(--primary); border-radius: 0 6px 6px 0; font-size: .85rem; color: #43506a; }
.gb-reply b { color: var(--primary); }
.gb-pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.gb-pager button { border: 1px solid var(--border); background: #fff; border-radius: 6px;
  padding: 4px 10px; font-size: .82rem; color: var(--muted); }
.gb-pager button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.gb-intro { padding: 16px 18px; margin-bottom: 18px; font-size: .88rem; color: #4a5568; }
.gb-intro p { margin: 0; }

/* ---------- 搜索 / 404 ---------- */
.search-page { padding: 18px; }
.search-form { display: flex; gap: 8px; margin: 0 0 18px; }
.search-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fbfcfe; }
.search-form input:focus { border-color: var(--primary); outline: none; background: #fff; }
.search-page .article-list li { box-shadow: none; border-radius: var(--radius-sm); }
.notfound { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 20px; text-align: center; box-shadow: var(--shadow); }
.notfound-code { font-size: 3.4rem; font-weight: 800; color: #cddcf5; line-height: 1; margin: 0; }
.notfound h1 { font-size: 1.4rem; }
.notfound-info { color: var(--muted); font-size: .9rem; }
.notfound .hero-actions, .notfound .search-form { justify-content: center; max-width: 520px; margin-left: auto; margin-right: auto; }

/* ---------- 页脚 ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--border); margin-top: 26px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 20px; padding-top: 28px; padding-bottom: 20px; }
.footer-col h2 { font-size: .96rem; }
.footer-col p, .footer-links a { font-size: .84rem; color: var(--muted); }
.footer-links li { padding: 3px 0; }
.footer-links a:hover { color: var(--primary); }
.footer-note { font-size: .78rem !important; color: #98a2b3 !important; }
.copyright { border-top: 1px solid var(--border); padding-top: 14px; padding-bottom: 18px;
  font-size: .78rem; color: var(--muted); text-align: center; }
.copyright p { margin: 0 0 4px; }
.back-top { position: fixed; right: 14px; bottom: 18px; width: 42px; height: 42px; border: 0;
  border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.1rem;
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 20; }
.back-top.show { opacity: 1; visibility: visible; }

/* ---------- 平板 / 桌面增强 ---------- */
@media (min-width: 640px) {
  .sort-grid { grid-template-columns: repeat(4, 1fr); }
  .card-list { grid-template-columns: repeat(2, 1fr); }
  .home-cols { grid-template-columns: repeat(2, 1fr); }
  .gb-row { grid-template-columns: repeat(3, 1fr); }
  .gb-bottom { grid-template-columns: 1fr auto; }
  .gb-submit { justify-self: end; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .top-search { display: flex; flex: none; width: 230px; }
  .top-search input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border);
    border-right: 0; border-radius: 8px 0 0 8px; background: #fbfcfe; font-size: .86rem; }
  .top-search input:focus { outline: none; border-color: var(--primary); }
  .top-search button { padding: 0 14px; border: 1px solid var(--primary); background: var(--primary);
    color: #fff; border-radius: 0 8px 8px 0; font-size: .86rem; }
  .top-search button:hover { background: var(--primary-dark); }
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: block; }
  .nav-inner { padding-top: 0; padding-bottom: 0; }
  .nav-inner ul { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .nav-inner li { border-bottom: 0; }
  .nav-inner a { padding: 11px 13px; font-size: .9rem; }
  .nav-inner a:hover { background: var(--surface-2); border-radius: 6px; }
  .hero { padding: 38px 36px; display: grid; grid-template-columns: 1fr 260px; gap: 30px; align-items: center; }
  .hero h1 { font-size: 2rem; }
  .hero-side { margin-top: 0; display: grid; gap: 10px; }
  .hero-stat { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; }
  .hero-stat span { font-size: .8rem; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
@media (min-width: 1024px) {
  .wrap { padding: 0 20px; }
  .main { padding-top: 22px; }
  .content-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; }
  .sidebar { position: sticky; top: 16px; }
  .card-list { grid-template-columns: repeat(3, 1fr); }
  .home-cols { grid-template-columns: repeat(3, 1fr); }
  .article-list li, .card-item { padding: 16px; }
  .list-thumb { width: 128px; height: 96px; }
  .article-detail { padding: 26px 30px; }
  .detail-head h1 { font-size: 1.85rem; }
  .gb-block { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
