/* ─────────────────────────────────────────────────────────────
   Components · 全站复用的 UI 组件
   顶部导航 / 抽屉 / 面板 / 轮播 / 卡片 / 表单 / 按钮 / 页脚 / 弹窗
   ───────────────────────────────────────────────────────────── */

/* ══ 顶栏（青蓝渐变）══ */
.site-head {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: linear-gradient(100deg, var(--header-1) 0%, var(--header-2) 58%, var(--header-3) 100%);
  color: var(--header-ink);
  box-shadow: 0 2px 14px rgba(37, 99, 235, .22);
}
.head-inner {
  display: flex;
  align-items: center;
  gap: calc(var(--pad) * 3);
  min-height: 62px;
  flex-wrap: wrap;
}
.head-brand { display: flex; align-items: center; gap: var(--pad); flex: none; }
.head-brand img { width: 32px; height: 32px; object-fit: contain; }
.head-brand b { font-size: 18px; letter-spacing: 1px; white-space: nowrap; }

.head-nav { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: wrap; }
.head-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  opacity: .9;
  white-space: nowrap;
}
.head-nav a:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
.head-nav a.active { background: rgba(255, 255, 255, .22); opacity: 1; font-weight: 600; }

.head-actions { display: flex; align-items: center; gap: var(--pad); margin-left: auto; flex-wrap: wrap; }
.head-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .14);
  color: var(--header-ink);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.head-pill:hover { background: rgba(255, 255, 255, .26); }
.pill-badge {
  background: #e04b4b;
  color: #fff;
  border-radius: 9px;
  padding: 0 6px;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 16px;
}

/* ══ 通知浮层 ══ */
.bell-panel {
  position: fixed;
  right: 16px;
  top: 56px;
  width: min(340px, 92vw);
  max-height: 440px;
  overflow: auto;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-bell);
  padding: var(--pad);
  font-size: 13px;
  color: var(--ink);
}
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 8px; }
.bell-head a { color: var(--primary); font-size: 12px; }
.bell-item { padding: 8px; border-top: 1px solid var(--line); }
.bell-item.unread .bt { font-weight: 600; }
.bell-item .bb { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bell-item .bd { color: var(--muted-2); font-size: 11.5px; margin-top: 3px; }
.bell-empty { padding: 20px; text-align: center; color: var(--muted); }

/* ══ 面板 ══ */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: calc(var(--pad) * 2);
  margin-bottom: calc(var(--pad) * 2);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pad);
  margin-bottom: calc(var(--pad) * 2);
}
.panel-head h2 {
  margin: 0;
  font-size: 19px;
  padding-left: 12px;
  position: relative;
  letter-spacing: .5px;
}
.panel-head h2::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 18px;
  border-radius: 2px;
  background: linear-gradient(var(--header-2), var(--header-1));
}
.panel-head .more { color: var(--muted); font-size: 13px; }
.panel-head .more:hover { color: var(--primary); }

/* ══ 轮播 ══ */
.hero {
  position: relative;
  margin: 0 auto calc(var(--pad) * 2);
  aspect-ratio: 16 / 9;
  max-height: 520px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0f2c4a;
  box-shadow: 0 6px 24px rgba(16, 42, 74, .18);
}
.hero .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .6s ease;
  display: flex;
  align-items: flex-end;
}
.hero .slide.on { opacity: 1; }
.hero .slide .cap {
  width: 100%;
  padding: 60px 24px 20px;
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  background: linear-gradient(transparent, rgba(0, 0, 0, .68));
}
.hero .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 60px;
  border: 0;
  background: rgba(0, 0, 0, .28);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s;
}
.hero:hover .arrow { opacity: 1; }
.hero .arrow.prev { left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.hero .arrow.next { right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.hero .dots { position: absolute; right: 20px; bottom: 16px; display: flex; gap: 8px; }
.hero .dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  cursor: pointer;
}
.hero .dots span.on { background: var(--card); }
.hero .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--pad);
  color: #fff;
  background: radial-gradient(circle at 30% 30%, #0e7490, #0c2d5a 70%);
}
.hero .placeholder img { width: 80px; height: 80px; object-fit: contain; }
.hero .placeholder b { font-size: 24px; letter-spacing: 4px; }
.hero .placeholder span { color: #bfe6f5; font-size: 13px; letter-spacing: 2px; }

/* 首屏底部的波浪装饰（静态 SVG，纯装饰） */
.wave-deco {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
}
.wave-deco svg { display: block; width: 100%; height: auto; }

/* ══ 精选作品 ══ */
.featured { display: grid; grid-template-columns: 1.55fr 1fr; gap: calc(var(--pad) * 2); }
.feature-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 300px;
  display: block;
  color: #fff;
  background: #0f2c4a;
}
.feature-main .thumb { position: absolute; inset: 0; aspect-ratio: auto; }
.feature-main .thumb .shade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 70px 20px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .68));
  color: #fff;
}
.feature-main .thumb .shade b { display: block; font-size: 19px; line-height: 1.5; }
.feature-main .thumb .shade em { font-style: normal; font-size: 12.5px; opacity: .85; }
.feature-main .thumb img,
.feature-main .thumb video { width: 100%; height: 100%; object-fit: cover; }
.feature-main:hover .thumb img,
.feature-main:hover .thumb video { transform: scale(1.03); }
.cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .35s;
}
.cover.video { background: linear-gradient(135deg, #1d4ed8, #0891b2); }
.cover.music { background: linear-gradient(135deg, #7a1fd6, #e0517a); }
.cover.article { background: linear-gradient(135deg, #0f766e, #22a06b); }
.cover .icon { font-size: 50px; opacity: .9; }
.cover .shade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 70px 20px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
}
.cover .shade b { display: block; font-size: 19px; line-height: 1.5; }
.cover .shade em { font-style: normal; font-size: 12.5px; opacity: .85; }
.cover .kind {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(255, 255, 255, .2);
  border-radius: var(--radius-sm);
  padding: 2px 10px;
  font-size: 12px;
}
.feature-list { display: flex; flex-direction: column; gap: 2px; }
.feature-item { display: block; padding: 10px 8px; border-bottom: 1px dashed var(--line); }
.feature-item:last-child { border-bottom: 0; }
.feature-item:hover { background: var(--surface-hover); border-radius: var(--radius-sm); }
.feature-item .t { font-size: 15px; line-height: 1.5; }
.feature-item:hover .t { color: var(--primary); }
.feature-item .m { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ══ 公告列表 ══ */
.news-item { display: flex; align-items: flex-start; gap: var(--pad); padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-date { flex: none; width: 58px; text-align: center; color: var(--header-2); border-right: 1px solid var(--line); }
.news-date b { display: block; font-size: 19px; line-height: 1.2; }
.news-date span { font-size: 11.5px; color: var(--muted); }
.news-body { min-width: 0; }
.news-body .t { font-size: 15px; }
.news-item:hover .t { color: var(--primary); }
.news-body .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pin { display: inline-block; background: var(--primary-soft); color: var(--primary); border-radius: var(--radius-sm); font-size: 11.5px; padding: 0 6px; margin-right: 6px; }

/* ══ Tab ══ */
.tabs { display: flex; gap: var(--pad); margin-bottom: calc(var(--pad) * 2); flex-wrap: wrap; }
.tab {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
}
.tab:hover { border-color: var(--header-2); color: var(--header-2); }
.tab.active { background: var(--header-2); border-color: var(--header-2); color: #fff; }

/* ══ 卡片网格 ══ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: calc(var(--pad) * 2); }
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card .body { padding: calc(var(--pad) * 2); flex: 1; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card video { width: 100%; height: 180px; background: #000; object-fit: contain; display: block; }
.card audio { width: 100%; display: block; margin: 10px 0 4px; }

/* 封面缩略图（统一 16:9，没有封面时用类型渐变占位） */
.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #0d1424;
  overflow: hidden;
  flex: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.thumb:hover img { transform: scale(1.03); }
.thumb .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .92);
}
.thumb .ph.video { background: linear-gradient(135deg, #1d4ed8, #0891b2); }
.thumb .ph.music { background: linear-gradient(135deg, #7a1fd6, #e0517a); }
.thumb .ph.article { background: linear-gradient(135deg, #0f766e, #22a06b); }
.thumb .ph .mi { width: 42px; height: 42px; }
.thumb .badge-kind {
  position: absolute;
  left: 10px; top: 10px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

/* .body 是 flex 列，标签和按钮要按内容宽度显示，不能被拉满 */
.card .tag, .card .more-btn { align-self: flex-start; }

.meta { color: var(--muted); font-size: 12px; margin: 6px 0; }
.desc { color: var(--ink-2); font-size: 13px; margin-top: var(--pad); white-space: pre-wrap; word-break: break-word; }
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-size: 12px; }

.card .lyrics { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: var(--pad); }
.card .lyrics summary { cursor: pointer; font-size: 13px; color: var(--primary); }
.card .lyrics pre { margin: 6px 0 0; font-family: inherit; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

.article .content { font-size: 14px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; word-break: break-word; max-height: 7.6em; overflow: hidden; position: relative; }
.article .content.open { max-height: none; }
.article .fade { position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(rgba(255, 255, 255, 0), var(--card)); }
.article .content.open .fade { display: none; }
.more-btn { margin-top: 6px; background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; padding: 0; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: var(--pad); margin: 10px 0 4px; }
.imgs img { width: 100%; height: 90px; object-fit: cover; border-radius: var(--radius-sm); cursor: zoom-in; background: var(--line); }

/* ══ 正文 ══ */
.prose { font-size: 15.5px; line-height: 1.9; color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose img { display: block; max-width: 100%; margin: 14px 0; border-radius: var(--radius-sm); }
.prose a { color: var(--primary); text-decoration: underline; }
.prose strong { color: var(--ink); }
.article-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 18px; }
.article-head h1 { margin: 0 0 8px; font-size: 23px; line-height: 1.5; }
.article-head .info { color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ══ 按钮 ══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-ink); color: #fff; }
.btn.danger { color: var(--danger-fg); border-color: var(--danger-bg); }
.btn.danger:hover { background: var(--danger-fg); border-color: var(--danger-fg); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ══ 表单 ══ */
input[type=text], input[type=search], input[type=password], input[type=file], textarea, select {
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--info-bg); border-color: var(--header-2); }
textarea { resize: vertical; line-height: 1.7; }
label.field { display: block; margin-bottom: calc(var(--pad) * 2); font-weight: 600; font-size: 14px; }
label.field > span.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ══ 页脚 ══ */
footer {
  background: var(--deep);
  color: #b3c2dd;
  margin-top: calc(var(--pad) * 4);
  padding: calc(var(--pad) * 3) 0 calc(var(--pad) * 2);
  font-size: 13px;
}
footer .f-top {
  display: flex;
  justify-content: space-between;
  gap: calc(var(--pad) * 2);
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  padding-bottom: calc(var(--pad) * 2);
  margin-bottom: calc(var(--pad) * 2);
}
footer .f-name { color: #fff; font-size: 18px; letter-spacing: 2px; margin-bottom: 4px; }
footer .f-sub { color: #8ea3c4; font-size: 12.5px; }
footer .f-links { display: flex; gap: calc(var(--pad) * 2); flex-wrap: wrap; align-items: center; }
footer .f-links a:hover { color: #fff; }
footer .copy { font-size: 12.5px; line-height: 2; color: #8398b8; }

/* ══ 回到顶部 ══ */
.totop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--header-2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: var(--z-totop);
}
.totop.on { opacity: 1; pointer-events: auto; }

/* ══ 图标 ══ */
.mi {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  background-color: currentColor;
  -webkit-mask: var(--mi) center / contain no-repeat;
  mask: var(--mi) center / contain no-repeat;
  flex: none;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.cover .icon .mi { width: 52px; height: 52px; vertical-align: 0; }
.drawer-sec h4 .mi { width: 15px; height: 15px; vertical-align: -2px; }

/* ══ 侧边抽屉 ══ */
.drawer-btn {
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.drawer-btn:hover { background: rgba(255, 255, 255, .3); }
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(12, 28, 52, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: var(--z-mask);
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(340px, 86vw);
  background: var(--card);
  z-index: var(--z-drawer);
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
}
.drawer.on { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--pad) * 2) calc(var(--pad) * 2.5);
  border-bottom: 1px solid var(--line);
}
.drawer-head b { font-size: 16px; }
.drawer-head button { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.drawer-body { overflow: auto; padding: var(--pad) calc(var(--pad) * 2) calc(var(--pad) * 3); }
.drawer-sec { margin-top: calc(var(--pad) * 2); }
.drawer-sec h4 { margin: 0 0 var(--pad); font-size: 13px; color: var(--muted); font-weight: 600; }
.pin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pad);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
}
.pin-item:hover { background: var(--surface-hover); color: var(--primary); }
.pin-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-item em { font-style: normal; font-size: 11.5px; color: var(--muted); flex: none; }
.drawer-empty { font-size: 12.5px; color: var(--muted-2); padding: 4px 10px; line-height: 1.6; }
.drawer-links { display: flex; flex-direction: column; }
.drawer-links a { padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14px; }
.drawer-links a:hover { background: var(--surface-hover); color: var(--primary); }

/* ══ 弹窗 ══ */
.dlg-mask {
  position: fixed;
  inset: 0;
  background: rgba(12, 28, 52, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: var(--z-toast);
}
.dlg {
  width: min(440px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dlg-head { padding: 16px 20px 0; font-size: 16px; font-weight: 600; }
.dlg-body { padding: 12px 20px; color: var(--ink); font-size: 14px; }
.dlg-body textarea { margin-top: 8px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }

/* ══ Toast ══ */
.toast-box {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-toast);
  pointer-events: none;
}
.toast {
  background: #10243f;
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ══ 响应式 ══ */
@media (max-width: 900px) {
  .head-inner { gap: var(--pad); padding: 8px 0; }
  .head-brand b { font-size: 16px; }
  .head-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .head-nav a { padding: 6px 10px; font-size: 14px; }
  .featured { grid-template-columns: 1fr; }
  .hero { border-radius: var(--radius-sm); }
  .panel { padding: calc(var(--pad) * 2); border-radius: var(--radius-sm); }
}

/* ══ 头像 ══ */
.avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: linear-gradient(135deg, var(--header-1), var(--header-2));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm.sm { width: 28px; height: 28px; font-size: 12px; }