/* 佛学文化资料馆 - 核心视觉样式 (高密度紧凑·古风典雅设计) */
:root {
  --paper: #faf6ee;
  --paper-card: #ffffff;
  --paper-subtle: #f6efe2;
  --ink: #231c16;
  --cinnabar: #8d3a2a;
  --cinnabar-light: #ab4734;
  --gold: #b8860b;
  --gold-light: #d4a373;
  --gold-bg: rgba(184, 134, 11, 0.08);
  --pine: #1b4d36;
  --pine-light: #2a694b;
  --line: #e6dcce;
  --line-light: #f0e7db;
  --muted: #73675b;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", "Songti SC", "SimSun", serif;
  background:
    radial-gradient(ellipse at 88% 20%, rgba(207, 174, 137, 0.14), transparent 14rem),
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.7), transparent 26rem),
    linear-gradient(90deg, rgba(118, 89, 55, 0.03) 1px, transparent 1px),
    linear-gradient(var(--paper), #fbf7ee);
  background-size: auto, auto, 20px 20px, auto;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

a, button {
  -webkit-tap-highlight-color: rgba(27, 77, 54, 0.16);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

a[href], button:not(:disabled) {
  cursor: pointer;
}

a[href]:hover, button:not(:disabled):hover {
  filter: brightness(1.03);
}

a[href]:active, button:not(:disabled):active {
  transform: translateY(1px) scale(0.98);
}

button, input, textarea, select {
  font: inherit;
}

.hidden {
  display: none !important;
}

/* ==================== 顶部常驻导航栏 ==================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 50px;
  background: rgba(250, 246, 238, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(86, 60, 32, 0.03);
}

.nav-inner {
  width: min(1440px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--cinnabar);
  letter-spacing: 1px;
}

.nav-icon {
  font-size: 18px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-item {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}

.nav-item:hover {
  color: var(--cinnabar);
}

.nav-extra {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-pill-btn {
  font-size: 12.5px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--pine);
  color: #fff !important;
  font-weight: 600;
}

.nav-admin-link {
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0e6d6;
  color: #554433;
  border: 1px solid var(--line);
}

/* ==================== 紧凑雅致 Hero 横幅 ==================== */
.hero {
  position: relative;
  min-height: 105px;
  padding: 20px 20px 22px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, #f4ede1 0%, #faf6ee 100%);
  border-bottom: 1px solid var(--line);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
}

.hero h1 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 700;
  color: var(--cinnabar);
  letter-spacing: 2px;
}

.hero p {
  margin: 4px 0 10px;
  font-size: clamp(13px, 1.4vw, 15px);
  color: var(--muted);
}

.buddha-mark {
  position: absolute;
  right: 28px;
  top: 18px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 134, 11, 0.35);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.65);
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.1);
  pointer-events: none;
}

/* 馆藏数据统计概览条 */
.stat-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: #4f4236;
  box-shadow: 0 2px 6px rgba(86, 60, 32, 0.04);
}

.stat-bar strong {
  color: var(--cinnabar);
  font-weight: 700;
}

.stat-sep {
  color: #d8c8b4;
}

/* ==================== 平台说明横幅 ==================== */
.notice-banner {
  width: min(1440px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 8px 14px;
  background: #fbf3e6;
  border: 1px solid #edd5b8;
  border-radius: 8px;
  font-size: 13.5px;
  color: #5c4228;
}

.notice-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-icon {
  font-size: 16px;
}

/* ==================== 页面外壳 ==================== */
.shell, .wide-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 14px auto 32px;
  position: relative;
  z-index: 3;
}

/* ==================== 搜索与分类筛选区 ==================== */
.search-filter-section {
  margin-bottom: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: 0 2px 6px rgba(86, 60, 32, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.12);
}

.search-icon {
  font-size: 16px;
  color: #8c7b6d;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: var(--ink);
}

.clear-search {
  background: transparent;
  border: none;
  font-size: 15px;
  color: #998877;
  padding: 2px 6px;
  border-radius: 4px;
}

.search-result-hint {
  font-size: 13px;
  color: var(--cinnabar);
  margin-top: 6px;
  padding: 4px 8px;
  background: #fdf2f0;
  border-radius: 4px;
  display: inline-block;
}

/* 分类切换药丸标签 */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #4a3e35;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.cat-tab:hover {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
  background: #fffdfb;
}

.cat-tab.active {
  background: var(--cinnabar);
  color: #ffffff;
  border-color: var(--cinnabar);
  box-shadow: 0 2px 6px rgba(141, 58, 42, 0.22);
}

/* ==================== 统一卡片面板 ==================== */
.panel, .archive-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 16px rgba(86, 60, 32, 0.04);
  padding: 16px 20px;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-light);
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--cinnabar);
  letter-spacing: 0.5px;
}

.section-sub {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}

.lotus-mini {
  font-size: 16px;
}

.row-title .more-link {
  margin-left: auto;
  font-size: 13px;
  color: var(--pine);
  font-weight: 600;
}

/* ==================== 重点经典卡片 (高密度紧凑·微标化) ==================== */
.important-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.resource-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf8;
  padding: 13px 15px;
  min-height: unset;
  transition: all 0.18s ease;
}

.resource-card:hover {
  border-color: var(--gold-light);
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(86, 60, 32, 0.08);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

/* 核心改进：图标从 112px 缩减至 40px 精致徽章 */
.card-icon-badge {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px;
  background: #fcf4e8;
  border: 1px solid rgba(184, 134, 11, 0.25);
  display: grid;
  place-items: center;
  color: var(--gold);
}

.card-icon-badge svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  stroke: var(--gold);
  stroke-width: 2.4;
  fill: none;
}

.card-title-wrap {
  flex: 1;
  min-width: 0;
}

.card-title-wrap h3 {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: Arial, sans-serif;
}

.badge-pdf {
  background: #fdf0ed;
  color: #a33827;
  border: 1px solid #f5cfc7;
}

.badge-zip {
  background: #eff6f3;
  color: #1a6344;
  border: 1px solid #cce3d8;
}

.badge-mp3 {
  background: #fcf4e8;
  color: #b06e14;
  border: 1px solid #f3dcb8;
}

.card-meta {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed var(--line-light);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 27px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.12s;
}

.read-btn {
  background: var(--pine);
  color: #ffffff !important;
  border: 1px solid var(--pine);
  flex: 1;
  text-align: center;
}

.read-btn:hover {
  background: var(--pine-light);
}

.down-btn {
  background: #ffffff;
  color: #55483a;
  border: 1px solid #d5c8b6;
}

.down-btn:hover {
  border-color: var(--pine);
  color: var(--pine);
  background: #f6faf7;
}

.listen-btn {
  background: #fbf5ea;
  color: #9a5f10;
  border: 1px solid #ebd3af;
}

.listen-btn:hover {
  background: #f5e7ce;
}

/* ==================== 十小咒专区 (紧凑胶囊微标) ==================== */
.small-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 9px;
}

.small-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  min-height: unset;
  transition: all 0.15s;
}

.small-item:hover {
  border-color: var(--gold-light);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(86, 60, 32, 0.05);
  transform: translateY(-1px);
}

.small-icon-badge {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 6px;
  background: #fcf4e8;
  border: 1px solid rgba(184, 134, 11, 0.22);
  display: grid;
  place-items: center;
  color: var(--gold);
}

.small-icon-badge svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  stroke: var(--gold);
  stroke-width: 2.2;
  fill: none;
}

.small-body {
  flex: 1;
  min-width: 0;
}

.small-body h3 {
  margin: 0 0 2px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.small-meta {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.small-actions {
  display: flex;
  gap: 4px;
}

.read-mini-btn {
  padding: 2px 8px;
  font-size: 11.5px;
  height: 24px;
  border-radius: 4px;
  background: var(--pine);
  color: #fff !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.listen-mini-btn {
  padding: 0 6px;
  font-size: 11px;
  height: 24px;
  border-radius: 4px;
  background: #fdf5ea;
  color: #9a5f10;
  border: 1px solid #ebd3af;
  cursor: pointer;
}

/* ==================== 常用经书与资料下载双栏 ==================== */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.book-list.compact, .download-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.book-row, .download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #fffcf8;
  border: 1px solid var(--line-light);
  transition: all 0.12s;
}

.book-row:hover, .download-row:hover {
  background: #ffffff;
  border-color: #d8c7b2;
}

.book-left, .download-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.book-left .num {
  width: 20px;
  height: 20px;
  min-width: 20px;
  font-size: 11.5px;
  border-radius: 4px;
  background: #f0e7db;
  color: #5a4b3d;
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.book-title, .download-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #201a14;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-icon {
  font-size: 14px;
}

.download-size {
  font-size: 11.5px;
  color: var(--muted);
  background: #f0eae1;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: Arial, sans-serif;
}

.file-type {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.book-right, .download-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.read-pill, .down-pill, .listen-pill {
  padding: 2px 8px;
  height: 24px;
  font-size: 11.5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}

.read-pill {
  background: var(--pine);
  color: #fff !important;
}

.down-pill {
  background: #ffffff;
  color: #55483a;
  border: 1px solid #d5c8b6;
}

.listen-pill {
  background: #fbf5ea;
  color: #9a5f10;
  border: 1px solid #ebd3af;
}

.disabled-pill {
  font-size: 11.5px;
  color: #999;
  padding: 2px 6px;
}

/* ==================== 音频专区 ==================== */
.audio-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.audio-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffcf8;
}

.audio-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.audio-badge {
  font-size: 16px;
}

.audio-text-wrap {
  min-width: 0;
}

.audio-text-wrap strong {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-meta {
  font-size: 11.5px;
  color: var(--muted);
}

/* ==================== 功能介绍条 ==================== */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.feature-item {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-light);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.feature-icon {
  font-size: 18px;
  display: block;
  margin-bottom: 2px;
}

.feature-item strong {
  display: block;
  font-size: 13px;
  color: var(--cinnabar);
  margin-bottom: 2px;
}

.feature-item p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* ==================== 留言板 ==================== */
.message-panel {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.2fr);
  gap: 20px;
}

.message-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-form input, .message-form textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fffcf8;
  font-size: 13.5px;
}

.message-form button {
  align-self: flex-start;
  padding: 5px 16px;
  border-radius: 5px;
  background: var(--cinnabar);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.message-item {
  padding: 8px 10px;
  border-radius: 6px;
  background: #fbf7ee;
  border-bottom: 1px dashed var(--line);
}

.message-item div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--cinnabar);
}

.message-item time {
  font-size: 11.5px;
  color: #998877;
}

.message-item p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #3d332a;
}

/* ==================== 全局浮动音频播放条 ==================== */
.audio-player-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 32px));
  z-index: 999;
  background: rgba(35, 28, 22, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(184, 134, 11, 0.4);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  padding: 7px 16px;
  color: #fbf7ee;
}

.audio-player-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audio-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.audio-texts {
  min-width: 0;
}

.audio-texts strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f5eedc;
}

.audio-texts span {
  font-size: 11px;
  color: #a89f91;
  font-family: Arial, sans-serif;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-btn {
  background: transparent;
  border: none;
  color: #fbf7ee;
  font-size: 15px;
  cursor: pointer;
  padding: 3px 6px;
}

.audio-btn.loop.active {
  color: var(--gold-light);
}

#audioProgress {
  width: 100px;
  height: 4px;
  accent-color: var(--gold);
}

.admin-entry {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 990;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cinnabar);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(141, 58, 42, 0.3);
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 900px) {
  .nav-menu {
    display: none;
  }
  .two-columns {
    grid-template-columns: 1fr;
  }
  .feature-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .message-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .feature-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .important-grid {
    grid-template-columns: 1fr;
  }
  .small-grid {
    grid-template-columns: 1fr;
  }
}
