/* ============================================================
   《世界非遗博览》电子期刊 · 公共样式
   主色调：大地色系 / 朱砂红 / 金；大量留白；衬线标题
   ============================================================ */

:root {
  --ink:        #2b231c;   /* 主文字，深褐 */
  --ink-soft:   #6b5d4f;   /* 次文字 */
  --earth:      #f7f1e6;   /* 页面底色，米白 */
  --earth-2:    #efe6d4;   /* 卡片/区块底色 */
  --earth-3:    #e6d8bf;   /* 描边/分隔 */
  --cinnabar:   #9b2c22;   /* 朱砂红 */
  --cinnabar-d: #7a211a;   /* 深朱砂 */
  --gold:       #b48a46;   /* 金 */
  --gold-soft:  #d9bd83;
  --line:       #ddd0ba;
  --radius:     4px;
  --maxw:       1180px;
  --serif:      "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans:       "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--earth);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cinnabar-d); text-decoration: none; }
a:hover { color: var(--cinnabar); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; color: var(--ink); line-height: 1.4; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部条 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 48px; width: auto; flex: none; }
/* 文字块整体与 Logo 垂直居中；副标题留空时只剩一行刊名，正好与 Logo 中线对齐 */
.brand .brand-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.brand .name { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: 1px; line-height: 1.2; }
.brand .sub  { display: block; font-size: 12px; color: var(--ink-soft); letter-spacing: 2px; margin-top: 3px; line-height: 1.3; }

/* ---------- 导航 ---------- */
.nav { display: flex; align-items: center; gap: 2px; }
.nav > li { position: relative; list-style: none; }
.nav > li > a {
  display: block; padding: 10px 16px; color: var(--ink);
  font-size: 15px; letter-spacing: 1px; border-bottom: 2px solid transparent;
}
.nav > li > a:hover, .nav > li.active > a { color: var(--cinnabar); border-bottom-color: var(--cinnabar); }
.nav .dropdown {
  position: absolute; top: 100%; left: 0; min-width: 180px;
  background: #fff; border: 1px solid var(--line); border-top: 2px solid var(--cinnabar);
  box-shadow: 0 12px 30px rgba(43,35,28,.12);
  display: none; padding: 6px 0;
}
.nav > li:hover .dropdown { display: block; }
.nav .dropdown a { display: block; padding: 9px 18px; color: var(--ink); font-size: 14px; white-space: nowrap; }
.nav .dropdown a:hover { background: var(--earth-2); color: var(--cinnabar); }

/* 手机端展开下拉的箭头；桌面端隐藏，仍用 hover 展开 */
.nav-expand { display: none; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; }

/* ---------- 区块标题 ---------- */
.section { padding: 64px 0; }
.section.tight { padding: 40px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head .kicker { color: var(--gold); letter-spacing: 4px; font-size: 13px; }
.section-head h2 { font-size: 28px; margin: 8px 0 6px; position: relative; display: inline-block; }
.section-head h2::after {
  content: ""; display: block; width: 46px; height: 3px; background: var(--cinnabar);
  margin: 12px auto 0;
}
.section-head p { color: var(--ink-soft); margin: 6px 0 0; }

/* ---------- Hero（高级轮播：切片擦除 + Ken Burns 缓放 + 文字上浮 + 进度条 + 指示点） ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  /* 有图时高度完全由图片决定：切换层 inset:0 才能与底层图片严格对齐，不露底、不跳动 */
  /* 首图作为背景占位：<img> 未加载完成时也直接显示图，避免"先红底文字再切图"的闪现 */
  background-color: #2b231c;
  background-size: 100% auto; background-position: left top; background-repeat: no-repeat;
}
/* 无轮播图时：朱砂红渐变 + 最小高度兜底，不至于露出米色、不至于塌成一条 */
.hero:not([style*="background-image"]) {
  min-height: 380px;
  background-image: radial-gradient(circle at 30% 20%, #b0483a 0%, #9b2c22 35%, #2b231c 100%);
}
/* Grid 同格叠放：容器高度 = 最高那张图按宽度等比缩放后的高度，图片完整显示、不裁切、切换不跳动 */
.hero .slides { position: relative; display: grid; width: 100%; }
.hero .slide { grid-area: 1 / 1; opacity: 0; z-index: 0; pointer-events: none; }
.hero .slide.active { opacity: 1; z-index: 1; pointer-events: auto; }
.hero.ready .slide { transition: opacity 1s ease; }
/* 切片擦除完成瞬间换底层：瞬时切换，不再叠加一次淡入 */
.hero.switching .slide { transition: none !important; }
/* auto 3/1：图片未加载时先按 3:1 撑开高度防塌陷；加载完成后自动改用图片真实比例（传多大显示多高） */
.hero .slide-img { width: 100%; height: auto; aspect-ratio: auto 3 / 1; display: block; transform: scale(1.12); transform-origin: center; }
/* 当前幻灯片图片缓慢放大（Ken Burns），更有电影感 */
.hero .slide.active .slide-img { animation: kenburns 8s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
/* 切换层：新图以「切片 / 百叶窗 / 方块 / 淡入推近」等花样擦入，盖在旧图上（html5zoo 同款随机多效果） */
.hero-slices { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.hero-slices .sl { position: absolute; background-repeat: no-repeat;
  clip-path: var(--clip-from, inset(0 100% 0 0)); transition: clip-path .7s cubic-bezier(.76,0,.24,1); will-change: clip-path; }
.hero-slices .sl.in { clip-path: inset(0 0 0 0); }
/* 整幅淡入＋推近（第四种效果） */
.hero-slices.zoom .sl { clip-path: none; opacity: 0; transform: scale(1.14);
  transition: opacity .9s ease, transform 1.2s cubic-bezier(.2,.7,.2,1); }
.hero-slices.zoom .sl.in { opacity: 1; transform: scale(1); clip-path: none; }
/* 底部加重的暗化蒙版，保证文字清晰（位于切片层之上、文字之下） */
.hero .overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(43,35,28,.30) 0%, rgba(43,35,28,.10) 40%, rgba(43,35,28,.82) 100%); }
.hero .inner { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 100%; height: 100%; z-index: 4;
  display: flex; flex-direction: column; justify-content: center; max-width: var(--maxw); padding: 0 24px; box-sizing: border-box; pointer-events: none; opacity: 0; }
.hero.ready .inner { opacity: 1; transition: opacity .6s ease; }
.hero .inner .cta { pointer-events: auto; }
/* 每次切换重新触发文字错落上浮动画 */
.hero.ready .inner.anim .kicker,
.hero.ready .inner.anim h1,
.hero.ready .inner.anim #heroText,
.hero.ready .inner.anim .cta { animation: heroRise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero.ready .inner.anim h1 { animation-delay: .08s; }
.hero.ready .inner.anim #heroText { animation-delay: .16s; }
.hero.ready .inner.anim .cta { animation-delay: .24s; }
@keyframes heroRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
/* 顶部小标签（最小字） */
.hero .kicker { color: var(--gold-soft); letter-spacing: 4px; font-size: 14px; margin-bottom: 12px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
/* 大标题（最大字，加粗） */
.hero h1 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.12; margin: 0 0 16px; color: #fff; font-weight: 800; text-shadow: 0 2px 18px rgba(0,0,0,.5); }
/* 小字（明显小于大标题，略透明） */
.hero #heroText { max-width: 640px; color: rgba(255,255,255,.9); font-size: clamp(14px, 1.3vw, 18px); line-height: 1.7; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.hero .cta { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }
/* 指示点 */
.hero-dots { position: absolute; left: 50%; transform: translateX(-50%); bottom: 28px; z-index: 5; display: flex; gap: 10px; pointer-events: auto; }
.hero-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; transition: all .3s ease; }
.hero-dots .dot.active { background: var(--gold); width: 28px; border-radius: 6px; }
/* 切换进度条 */
.hero-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--gold), #fff); z-index: 5; opacity: .9; pointer-events: none; }
.hero-progress.run { transition: width 6s linear; }
.hero .cta { margin-top: 26px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 26px; border-radius: var(--radius); font-size: 15px;
  letter-spacing: 1px; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--cinnabar); color: #fff; }
.btn-primary:hover { background: var(--cinnabar-d); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color:#fff; }

/* ---------- 电子杂志封面（首页图片式） ---------- */
.mag-hero { background: var(--earth-2); }
.mag-grid { display: grid; grid-template-columns: 320px 1fr; gap: 48px; align-items: center; }
.mag-cover { position: relative; }
.mag-cover a { display: block; border: 1px solid var(--earth-3); padding: 10px; background: #fff; box-shadow: 0 18px 40px rgba(43,35,28,.16); }
.mag-cover img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.mag-cover .ribbon {
  position: absolute; left: -8px; top: 18px; background: var(--cinnabar); color:#fff;
  padding: 6px 14px; font-size: 13px; letter-spacing: 2px; box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.toc-list .num { font-family: var(--serif); color: var(--gold); font-size: 20px; min-width: 36px; }
.toc-list .meta { flex: 1; }
.toc-list .meta .t { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.toc-list .meta .t a { color: var(--ink); }
.toc-list .meta .t a:hover { color: var(--cinnabar); }
.toc-list .meta .s { color: var(--ink-soft); font-size: 13px; }

/* ---------- 文章卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card { background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(43,35,28,.14); }
.card .ph { aspect-ratio: 3/2; background: var(--earth-3); background-size: cover; background-position: center; display:flex; align-items:center; justify-content:center; color: var(--gold); font-family: var(--serif); font-size: 42px; }
/* 无封面时显示刊名，不要用单个大字占位 */
.card .ph .ph-name { font-size: clamp(15px, 1.6vw, 22px); line-height: 1.5; letter-spacing: 2px; font-weight: 600; text-align: center; padding: 0 16px; overflow-wrap: anywhere; }
.card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card .cat { color: var(--cinnabar); font-size: 12px; letter-spacing: 2px; margin-bottom: 6px; }
.card h3 { font-size: 18px; margin: 0 0 8px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--cinnabar); }
.card .sum { color: var(--ink-soft); font-size: 14px; flex: 1; }
.card .foot { margin-top: 14px; font-size: 12px; color: #a99a86; display: flex; justify-content: space-between; }

/* 双栏不对称：左大右列表 */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.split .feature { }
.split .feature .ph { aspect-ratio: 4/3; background: var(--earth-3); background-size: cover; background-position: center; }
.split ul.list2 { list-style: none; margin: 0; padding: 0; }
.split ul.list2 li { padding: 14px 0; border-bottom: 1px dashed var(--line); }

/* ---------- 公告/投稿 ---------- */
.notice-band { background: var(--ink); color: var(--earth); }
.notice-band .container { display: flex; gap: 40px; flex-wrap: wrap; padding: 36px 24px; }
.notice-band .col { flex: 1; min-width: 260px; }
.notice-band .col .tag { color: var(--gold-soft); letter-spacing: 3px; font-size: 13px; }
.notice-band .col p { margin: 8px 0 0; }
/* 公告栏深色底上的链接用浅金，避免继承全局朱砂红看不清 */
.notice-band a { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }
.notice-band a:hover { color: #fff; }

/* ---------- 文章详情 ---------- */
.article-head { text-align: center; padding: 56px 0 30px; }
.article-head .cat { color: var(--cinnabar); letter-spacing: 3px; font-size: 13px; }
.article-head h1 { font-size: 34px; margin: 12px auto; max-width: 900px; }
.article-head .sub { color: var(--ink-soft); font-size: 16px; }
.article-meta { color: #a99a86; font-size: 13px; margin-top: 14px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.article-body { max-width: 820px; margin: 0 auto; padding: 10px 0 30px; }
.article-body p { margin: 0 0 1.2em; }
.article-body h3 { font-size: 21px; margin: 1.6em 0 .6em; color: var(--cinnabar-d); }
.article-body img { margin: 20px auto; border: 1px solid var(--line); }
.article-body a.read { display:inline-block; margin-top: 10px; background: var(--earth-2); color: var(--cinnabar-d); padding: 10px 20px; border-radius: var(--radius); }
.article-body a.read:hover { background: var(--earth-3); }
/* 上一篇 / 下一篇：左右各占一半，长标题只在自己那一列内折行，不会互串行 */
.pager { max-width: 820px; margin: 30px auto 0; display: flex; align-items: flex-start; gap: 36px; border-top: 1px solid var(--line); padding-top: 20px; }
.pager > span { flex: 1 1 0; min-width: 0; }
.pager > span:last-child { text-align: right; }
.pager-label { display: block; font-size: 12px; letter-spacing: 2px; color: var(--ink-soft); margin-bottom: 6px; }
.pager a { display: block; color: var(--ink); line-height: 1.7; overflow-wrap: anywhere; word-break: break-word; }
.pager a:hover { color: var(--cinnabar); }
@media (max-width: 720px) {
  .pager { flex-direction: column; gap: 14px; }
  .pager > span { width: 100%; }
  .pager > span:last-child { text-align: left; border-top: 1px dashed var(--line); padding-top: 14px; }
}

/* ---------- 页脚 ---------- */
.footer { background: #211a14; color: #d8cbb6; margin-top: 0; }
.footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 56px 24px 30px; }
.footer h4 { color: var(--gold-soft); font-size: 15px; letter-spacing: 2px; margin: 0 0 16px; }
.footer a { color: #d8cbb6; }
.footer a:hover { color: #fff; }
.footer .about { font-size: 14px; line-height: 1.9; }
.footer .links li, .footer .contact li { list-style: none; padding: 5px 0; font-size: 14px; }
.footer .bottom { border-top: 1px solid rgba(255,255,255,.12); text-align: center; padding: 22px 24px; font-size: 13px; color: #a8997e; line-height: 1.9; }
.footer .bottom a { color: #a8997e; }
/* 后台版权声明是 CKEditor 富文本（自带 <p>），去掉默认外边距并让它排成一行 */
.footer .bottom p { display: inline; margin: 0; }

/* ---------- 列表页 ---------- */
.page-head { background: var(--earth-2); border-bottom: 1px solid var(--line); }
.page-head .container { padding: 48px 24px; }
.page-head .kicker { color: var(--gold); letter-spacing: 4px; font-size: 13px; }
.page-head h1 { font-size: 32px; margin: 8px 0 6px; }
.page-head p { color: var(--ink-soft); margin: 0; max-width: 760px; }
.list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.list-grid .card .ph { aspect-ratio: 16/9; }

/* ---------- 电子杂志页 ---------- */
.issue-feature { background: var(--earth-2); }
.issue-feature .mag-grid { align-items: center; }
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.archive-grid .card .ph { aspect-ratio: 3/4; }

/* ---------- 单页 ---------- */
.page-body { max-width: 860px; margin: 0 auto; }
.page-body h3 { color: var(--cinnabar-d); font-size: 20px; margin: 1.6em 0 .6em; }

/* ---------- 面包屑 ---------- */
.crumb { font-size: 13px; color: var(--ink-soft); padding: 14px 0; }
.crumb a { color: var(--ink-soft); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .cards, .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .mag-grid, .split { grid-template-columns: 1fr; gap: 28px; }
  .footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topbar .container { height: 64px; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: stretch; border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav.open { max-height: 80vh; overflow: auto; }
  .nav > li { display: flex; flex-wrap: wrap; align-items: center; }
  .nav > li > a { flex: 1 1 auto; padding: 12px 20px; border-bottom: 1px solid var(--line); }
  .nav .dropdown { position: static; box-shadow: none; border: 0; display: none; padding-left: 16px; width: 100%; box-sizing: border-box; }
  .nav-expand {
    display: block; flex: 0 0 48px; align-self: stretch; position: relative;
    background: #fff; border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
  }
  .nav-expand::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px;
    border-right: 2px solid var(--cinnabar); border-bottom: 2px solid var(--cinnabar);
    transform: translate(-50%, -60%) rotate(45deg); transition: transform .2s ease;
  }
  .nav > li.open .nav-expand::after { transform: translate(-50%, -30%) rotate(225deg); }
  /* 触屏的 :hover 会粘住，手机端只允许 .open 展开 */
  .nav > li:hover .dropdown { display: none; }
  .nav > li.open .dropdown, .nav > li.open:hover .dropdown { display: block; }
  .hero h1 { font-size: 30px; }
  .cards, .archive-grid, .list-grid { grid-template-columns: 1fr; }
  .footer .container { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .section-head h2 { font-size: 24px; }
}
