/* LayNews 门户模板主样式 */
:root {
  --brand: #1b64f2;
  --brand-soft: rgba(27, 100, 242, .10);
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #16181d;
  --text-2: #4b5563;
  --muted: #8b93a3;
  --line: #e8ebf2;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(20, 26, 45, .06);
  --shadow-lg: 0 14px 42px rgba(20, 26, 45, .10);
  --header: rgba(255, 255, 255, .86);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", Georgia, serif;
}
html[data-mode="dark"] {
  --bg: #0e1117;
  --card: #151a23;
  --text: #e6e9ef;
  --text-2: #aab2c0;
  --muted: #7b8494;
  --line: #232a36;
  --header: rgba(14, 17, 23, .86);
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 42px rgba(0, 0, 0, .45);
  --brand-soft: rgba(90, 140, 255, .16);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .18s; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
.container { width: min(1200px, 94%); margin: 0 auto; }

/* 顶部 */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.logo-mark { width: 30px; height: 30px; color: var(--brand); }
.logo-img { width: 30px; height: 30px; object-fit: contain; border-radius: 8px; }
.brand-text small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: .5px; }
.main-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { background: var(--brand-soft); color: var(--brand); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.search-mini { position: relative; }
.search-mini input {
  width: 168px; height: 36px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); padding: 0 34px 0 14px; color: var(--text); font-size: 13px; outline: none;
}
.search-mini input:focus { border-color: var(--brand); }
.search-mini button { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.menu-btn { display: none; }

/* 轮播 */
.hero { margin: 22px auto 26px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: var(--card); }
.hero .layui-carousel { border-radius: 18px; height: 420px; }
.slide-link { position: absolute; inset: 0; z-index: 3; }
.slide { position: relative; height: 100%; display: flex; align-items: flex-end; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 12, 24, .05) 30%, rgba(8, 12, 24, .78) 100%); }
.slide-caption { position: relative; z-index: 2; padding: 34px 40px; color: #fff; max-width: 760px; }
.slide-caption h2 { font-size: 26px; margin: 0 0 10px; font-weight: 700; line-height: 1.4; }
.slide-caption p { margin: 0; opacity: .82; font-size: 14px; }
.slide-tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); margin-bottom: 12px; }

/* 布局 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; padding-bottom: 40px; }
.layout.single { grid-template-columns: minmax(0, 1fr); }

/* 区块标题 */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.section-head h2 { font-size: 18px; margin: 0; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ""; width: 4px; height: 18px; border-radius: 3px; background: var(--brand); }
.section-head a { font-size: 13px; color: var(--muted); }

/* 推荐卡 */
.recommend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 30px; }
.recommend-card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); min-height: 170px; }
.recommend-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; opacity: .92; }
.recommend-card .rc-mask { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(8, 12, 24, .82)); }
.recommend-card .rc-body { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 18px 20px; color: #fff; }
.recommend-card .rc-body span { font-size: 12px; opacity: .72; letter-spacing: .4px; }
.recommend-card .rc-body h3 { margin: 6px 0 0; font-size: 16px; font-weight: 600; line-height: 1.5; }

/* 列表 */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-item { display: flex; gap: 18px; padding: 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid transparent; transition: transform .18s, box-shadow .18s, border-color .18s; }
.article-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line); }
.article-thumb { width: 186px; height: 118px; flex: 0 0 186px; border-radius: 10px; overflow: hidden; background: var(--brand-soft); }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.article-meta { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.article-meta .cat { color: var(--brand); background: var(--brand-soft); padding: 1px 8px; border-radius: 6px; }
.article-item h3 { margin: 8px 0 6px; font-size: 18px; font-weight: 650; line-height: 1.5; }
.article-item p { margin: 0; color: var(--text-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-foot { margin-top: auto; padding-top: 10px; display: flex; gap: 16px; font-size: 12px; color: var(--muted); }

/* 分页 */
.pager { display: flex; justify-content: center; gap: 8px; margin: 26px 0 8px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 12px; display: grid; place-items: center; border-radius: 9px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .disabled { opacity: .45; }

/* 侧栏 */
.aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 86px; }
.widget { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.widget h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.widget h3::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--brand); }
.hot-list { counter-reset: hot; display: flex; flex-direction: column; gap: 12px; }
.hot-list a { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.hot-list a::before { counter-increment: hot; content: counter(hot); flex: 0 0 20px; height: 20px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 12px; display: grid; place-items: center; }
.hot-list a:nth-child(-n+3)::before { background: var(--brand); color: #fff; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { padding: 5px 11px; border-radius: 999px; background: var(--bg); color: var(--text-2); font-size: 12.5px; border: 1px solid var(--line); }
.tag-cloud a:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.link-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12.5px; }
.link-list a { color: var(--muted); }

/* 文章页 */
.article-wrap { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 34px 40px 40px; }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb em { font-style: normal; margin: 0 6px; }
.article-title { font-size: 30px; line-height: 1.42; margin: 0 0 14px; font-weight: 750; letter-spacing: -.2px; }
.article-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.article-hero { margin: 24px 0 8px; border-radius: 12px; overflow: hidden; }
.article-hero img { width: 100%; max-height: 420px; object-fit: cover; }
.lead-answer { background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; padding: 14px 18px; font-size: 15px; color: var(--text); line-height: 1.8; margin: 22px 0; }
.article-content { font-size: 16px; line-height: 1.95; color: var(--text); }
.article-content h2 { font-size: 21px; margin: 34px 0 14px; font-weight: 700; position: relative; padding-left: 14px; }
.article-content h2::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 3px; background: var(--brand); }
.article-content h3 { font-size: 17px; margin: 26px 0 10px; }
.article-content p { margin: 0 0 16px; }
.article-content ul, .article-content ol { padding-left: 22px; margin: 0 0 18px; }
.article-content li { margin: 6px 0; }
.article-content blockquote { margin: 20px 0; padding: 12px 18px; background: var(--bg); border-radius: 10px; color: var(--text-2); border-left: 3px solid var(--line); }
.article-content pre { background: #0f1729; color: #dbe4f5; padding: 16px; border-radius: 10px; overflow: auto; font-size: 13px; }
.article-content code { background: var(--bg); padding: 2px 6px; border-radius: 5px; font-size: 13px; }
.article-content a.geo-link { color: var(--brand); border-bottom: 1px dashed var(--brand); }
.article-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid var(--line); padding: 9px 12px; }
.article-content th { background: var(--bg); }

.toc-box { background: var(--bg); border-radius: 12px; padding: 16px 20px; margin: 22px 0; font-size: 13.5px; }
.toc-box strong { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); letter-spacing: .5px; }
.toc-box ol { margin: 0; padding-left: 18px; }
.toc-box li { margin: 4px 0; }

.faq-box { margin-top: 34px; }
.faq-box h2 { font-size: 19px; margin: 0 0 14px; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: var(--card); }
.faq-q { padding: 14px 18px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.faq-q::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq-item.open .faq-q::after { content: "−"; }
.faq-a { display: none; padding: 0 18px 16px; color: var(--text-2); font-size: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.faq-item.open .faq-a { display: block; }

.entity-box { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.entity-box b { font-weight: 500; color: var(--muted); }
.entity-tag { padding: 3px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); color: var(--text-2); }

.article-tags { margin-top: 26px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.article-tags span { font-size: 12.5px; color: var(--muted); }
.article-tags a { padding: 4px 11px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }

.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.article-nav a { padding: 14px 18px; border-radius: 12px; background: var(--bg); font-size: 13.5px; color: var(--text-2); display: block; }
.article-nav a b { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-bottom: 4px; }
.article-nav a:hover { background: var(--brand-soft); color: var(--brand); }

.geo-bar { margin-top: 26px; padding: 14px 18px; border-radius: 12px; border: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12.5px; color: var(--muted); }
.geo-bar b { color: var(--brand); font-weight: 600; }

/* 页面头 */
.page-hero { background: var(--card); border-radius: 18px; padding: 30px 34px; margin: 22px 0 24px; box-shadow: var(--shadow); }
.page-hero h1 { margin: 0 0 8px; font-size: 26px; font-weight: 700; }
.page-hero p { margin: 0; color: var(--muted); font-size: 14px; }

/* 搜索页 */
.search-form { display: flex; gap: 10px; margin: 8px 0 22px; }
.search-form input { flex: 1; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 18px; font-size: 15px; color: var(--text); outline: none; }
.search-form input:focus { border-color: var(--brand); }
.search-form button { height: 46px; padding: 0 26px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; font-size: 15px; cursor: pointer; }

/* 页脚 */
.site-footer { margin-top: 40px; background: var(--card); border-top: 1px solid var(--line); padding: 36px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-brand .logo-mark { width: 34px; height: 34px; }
.footer-brand h4 { margin: 0 0 6px; font-size: 15px; }
.footer-brand p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.footer-col h5 { margin: 0 0 12px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.footer-col a { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.footer-bottom { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }

/* 空状态 */
.empty { text-align: center; padding: 70px 20px; background: var(--card); border-radius: var(--radius); color: var(--muted); }
.empty b { display: block; font-size: 16px; color: var(--text-2); margin-bottom: 8px; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .header-tools .search-mini { display: none; }
}
@media (max-width: 760px) {
  .main-nav { display: none; }
  .main-nav.open { display: flex; position: absolute; left: 0; right: 0; top: 66px; background: var(--card); padding: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .menu-btn { display: grid; }
  .header-inner { gap: 12px; }
  .article-item { flex-direction: column; }
  .article-thumb { width: 100%; height: 180px; flex: none; }
  .article-wrap { padding: 22px 18px 26px; border-radius: 12px; }
  .article-title { font-size: 23px; }
  .recommend-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .slide-caption { padding: 22px 20px; }
  .slide-caption h2 { font-size: 19px; }
  .article-nav { grid-template-columns: 1fr; }
  .hero { border-radius: 12px; }
  .hero .layui-carousel, .slide { height: 300px !important; }
}
