/*
Theme Name: 怒云资源站主题
Theme URI: http://ziyuan.nuyun.cn/
Author: Nuyun Team
Description: 资源分享站自适应模板：顶部标语横幅 + 横向分类导航 + 广告位区块 + 最近更新双列文章列表 + 右侧在线工具入口，科技蓝青配色，移动端汉堡菜单单列自适应，后台主题设置可控制标语、公告与三个广告位（顶部横幅 / 文章底部横幅 / 底飘悬浮）。
Version: 2.3.1
License: GNU General Public License v2 or later
Text Domain: ziyuan
*/

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

:root {
  --bg: #f2f5fa;
  --card: #ffffff;
  --card2: #f7f9fc;
  --line: #e6ebf3;
  --text: #182235;
  --muted: #6b7a93;
  --brand: #1f6feb;
  --brand2: #06b6d4;
  --grad: linear-gradient(120deg, #1e5eff, #0ea5e9);
  --grad-soft: linear-gradient(120deg, #eaf1ff, #e6fbff);
  --danger: #ef4444;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15,40,90,.06), 0 8px 20px rgba(15,40,90,.07);
  --shadow-hover: 0 4px 10px rgba(15,40,90,.10), 0 16px 32px rgba(30,80,200,.14);
}

body {
  font-family: "PingFang SC","Microsoft YaHei",Helvetica,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== 顶部深色横幅 ===== */
.topbar {
  background: linear-gradient(120deg, #0b1526, #10213d 60%, #0e2b3f);
  color: #cfe0ff;
  padding: 7px 0;
  font-size: 12.5px;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.topbar a { color: #7dd3fc; }
.topbar .tb-right { display: flex; gap: 14px; align-items: center; }

/* ===== 主头部 ===== */
.masthead {
  background: linear-gradient(135deg, #0d1b30 0%, #123052 60%, #0b2f46 100%);
  color: #fff;
  padding: 22px 0 20px;
  position: relative;
  overflow: hidden;
}
.masthead::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(520px 220px at 82% -20%, rgba(56,189,248,.35), transparent 60%),
    radial-gradient(420px 200px at 8% 120%, rgba(30,90,255,.30), transparent 60%);
  pointer-events: none;
}
.masthead .wrap { position: relative; z-index: 1; }
.site-brand { text-align: center; }
.site-logo {
  font-size: 34px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(100deg, #7dd3fc, #60a5fa 45%, #a5b4fc);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.site-logo b { font-weight: 900; }
.site-desc { margin-top: 6px; color: #9fb8dd; font-size: 13.5px; letter-spacing: .5px; }

/* 标语公告条 */
.slogan {
  margin: 14px auto 0;
  max-width: 780px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(125,211,252,.25);
  border-radius: 999px;
  padding: 8px 22px;
  color: #cfeaff;
  font-size: 13px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.slogan b { color: #7dd3fc; }

/* ===== 导航 ===== */
.mainnav {
  background: #fff;
  border-bottom: 2px solid var(--line);
  box-shadow: 0 3px 14px rgba(20,50,90,.08);
  position: sticky; top: 0; z-index: 100;
}
.mainnav .wrap { display: flex; align-items: center; }
.nav-list { display: flex; list-style: none; flex-wrap: wrap; }
.nav-list li { position: relative; }
.nav-list a {
  display: block; padding: 14px 18px;
  font-size: 15px; font-weight: 600; color: #33415c;
  transition: color .2s;
}
.nav-list a:hover { color: var(--brand); }
.nav-list .current a { color: var(--brand); }
.nav-list a::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px;
  background: var(--grad); border-radius: 2px;
  transform: scaleX(0); transition: transform .25s;
}
.nav-list a:hover::after, .nav-list .current a::after { transform: scaleX(1); }
.nav-search { margin-left: auto; }
.nav-search form { display: flex; align-items: center; }
.nav-search input {
  border: 1px solid var(--line); border-radius: 999px 0 0 999px;
  padding: 8px 14px; font-size: 13px; width: 190px; outline: none;
}
.nav-search button {
  border: none; border-radius: 0 999px 999px 0;
  background: var(--grad); color: #fff; padding: 8px 15px; font-size: 13px; cursor: pointer;
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  border: none; background: none; cursor: pointer;
  padding: 12px;
}
.nav-toggle .bar { display: block; width: 22px; height: 2.5px; background: #33415c; margin: 5px 0; border-radius: 2px; }

/* ===== 页主体 ===== */
.main { padding: 22px 0 40px; }
.main .wrap { display: flex; gap: 22px; align-items: flex-start; }

/* 左侧主区 */
.content-main { flex: 1; min-width: 0; }

/* 版块标题 */
.sec-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.sec-head .t {
  font-size: 19px; font-weight: 800; color: #14213a;
  position: relative; padding-left: 14px;
}
.sec-head .t::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 5px;
  border-radius: 3px; background: var(--grad);
}
.sec-head .more { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.sec-head .count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.sec-head .count b { color: var(--brand); font-size: 14px; }

/* 广告位：顶部横幅 */
.ad-banner { margin: 4px 0 16px; text-align: center; }
.ad-banner img {
  max-width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}

/* 最近更新列表（x6d 双列小条目） */
.updates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upd-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.upd-item:hover {
  transform: translateY(-2px);
  border-color: rgba(31,111,235,.45);
  box-shadow: var(--shadow-hover);
}
.upd-date {
  flex: none;
  background: var(--grad-soft);
  color: var(--brand);
  border: 1px solid #d6e4ff;
  border-radius: 8px;
  font-size: 11px; font-weight: 700;
  text-align: center;
  padding: 4px 7px;
  line-height: 1.35;
  min-width: 46px;
}
.upd-date i { display: block; font-style: normal; font-size: 9px; font-weight: 500; color: #6d8cc8; }
.upd-title {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 600; color: #24324d;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.upd-item:hover .upd-title { color: var(--brand); }
.upd-cat {
  flex: none; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px;
  background: var(--card2);
  white-space: nowrap;
}
.upd-view {
  flex: none;
  font-size: 12px; color: #fff;
  background: var(--grad);
  border-radius: 999px; padding: 4px 12px;
  white-space: nowrap;
}
.upd-item:hover .upd-view { box-shadow: 0 4px 12px rgba(30,90,255,.4); }

/* 置顶条 */
.upd-top {
  border-left: 3px solid var(--danger);
}

/* 热门推荐板块（横向卡片） */
.hot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.hot-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
  position: relative;
}
.hot-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.hot-card .hc-thumb {
  height: 88px;
  background: var(--grad-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: var(--brand);
  border-bottom: 1px solid var(--line);
}
.hot-card .hc-thumb.thumb2 { background: linear-gradient(120deg, #eaf1ff, #f3e8ff); color: #7c3aed; }
.hot-card .hc-thumb.thumb3 { background: linear-gradient(120deg, #e6fbff, #eaf1ff); color: #06b6d4; }
.hot-card .hc-thumb.thumb4 { background: linear-gradient(120deg, #fef3e8, #fdf2f8); color: #f97316; }
.hot-card .hc-body { padding: 10px 12px 12px; }
.hot-card .hc-title {
  font-size: 13px; font-weight: 700; color: #24324d; line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  min-height: 39px;
}
.hot-card:hover .hc-title { color: var(--brand); }
.hot-card .hc-meta { margin-top: 8px; font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.hot-card .hc-meta .hc-cat {
  background: var(--grad-soft); color: var(--brand);
  border-radius: 4px; padding: 1px 6px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px;
}

/* 分页 */
.pagination { margin-top: 18px; text-align: center; }
.pagination .page-numbers {
  display: inline-block; padding: 7px 14px; margin: 0 3px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #33415c; font-size: 13px;
}
.pagination .current { background: var(--grad); color: #fff; border-color: transparent; }

/* ===== 右侧栏 ===== */
.sidebar { width: 300px; flex: none; }
.widget {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.widget-title {
  font-size: 15px; font-weight: 800; color: #14213a;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: relative; padding-left: 24px;
}
.widget-title::before {
  content: ""; position: absolute; left: 14px; top: 14px; bottom: 14px;
  width: 4px; border-radius: 2px; background: var(--grad);
}
.widget-body { padding: 12px 16px; }

/* 在线工具入口格 */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-cell {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card2);
  padding: 12px 8px;
  text-align: center;
  font-size: 12.5px; font-weight: 600; color: #2b3a55;
  transition: all .18s;
}
.tool-cell:hover {
  border-color: rgba(31,111,235,.5);
  color: var(--brand);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.tool-cell .ic { display: block; font-size: 20px; margin-bottom: 5px; }

/* 热门排行 */
.hot-list { list-style: none; }
.hot-list li {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
  font-size: 13px; color: #2b3a55;
}
.hot-list li:last-child { border-bottom: none; }
.hot-list .n {
  flex: none; width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 5px; font-size: 11px; font-weight: 700;
  background: #eef2fa; color: #7a8aa6;
}
.hot-list li:nth-child(1) .n, .hot-list li:nth-child(2) .n, .hot-list li:nth-child(3) .n {
  background: var(--grad); color: #fff;
}
.hot-list a:hover { color: var(--brand); }

/* 分类入口 */
.cat-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-tags a {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px; color: #33415c;
  background: var(--card2);
  transition: all .18s;
}
.cat-tags a:hover { border-color: var(--brand); color: var(--brand); background: #f0f6ff; }

/* ===== 文章页 ===== */
.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.post-title { font-size: 26px; font-weight: 800; line-height: 1.4; margin-bottom: 12px; color: #14213a; word-break: break-word; overflow-wrap: break-word; }
.post-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12.5px; color: var(--muted);
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}
.post-meta b { color: var(--brand); }
.post-content { font-size: 15.5px; line-height: 1.9; color: #27344d; }
.post-content p { margin-bottom: 1em; }
.post-content h2 { font-size: 21px; margin: 1.5em 0 .6em; padding-left: 12px; border-left: 4px solid var(--brand); }
.post-content h3 { font-size: 17px; margin: 1.3em 0 .5em; color: #1b2a44; }
.post-content ul, .post-content ol { margin: .6em 0 1em 1.6em; }
.post-content li { margin-bottom: .4em; }
.post-content img { border-radius: 8px; }
.post-content a { color: var(--brand); border-bottom: 1px dashed rgba(31,111,235,.5); }

/* 文章底部广告 */
.ad-post { margin: 20px 0 6px; text-align: center; }
.ad-post img { max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }

.post-nav {
  margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; gap: 14px;
  font-size: 13.5px; color: #33415c;
}
.post-nav a:hover { color: var(--brand); }

/* ===== 页脚 ===== */
.footer {
  background: #0b1526;
  color: #8fa3c4;
  padding: 26px 0;
  font-size: 13px;
  margin-top: 10px;
}
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: #7dd3fc; }
.footer .f-brand { font-size: 18px; font-weight: 800; color: #dbe7ff; }
.footer .f-links { display: flex; gap: 16px; }

/* ===== 底飘广告 ===== */
.ad-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999; max-width: 230px;
  animation: adFloatIn .45s ease;
}
.ad-float img {
  display: block; width: 100%; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 10px 30px rgba(5,15,40,.35);
}
.ad-float-close {
  position: absolute; top: -12px; right: -12px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--danger); color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
@keyframes adFloatIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 980px) {
  .main .wrap { flex-direction: column; }
  .sidebar { width: 100%; }
  .updates { grid-template-columns: 1fr; }
  .hot-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; margin-left: auto; }
  .nav-list {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column;
    box-shadow: 0 12px 26px rgba(20,50,90,.15);
    border-top: 1px solid var(--line);
  }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 13px 18px; border-bottom: 1px solid #f0f3f9; }
  .nav-list a::after { display: none; }
  .nav-search { display: none; }
  .topbar .wrap { flex-direction: column; gap: 4px; text-align: center; }
}
@media (max-width: 560px) {
  .site-logo { font-size: 27px; }
  .post-title { font-size: 21px; }
  .upd-view { padding: 3px 9px; font-size: 11px; }
  .ad-float { max-width: 160px; right: 10px; bottom: 10px; }
}
