/* 皮影戏网站 - 外部式 CSS3 样式与动画（传统非遗暖色主题） */
:root {
  /* 主色：深绛红/枣红，贴合传统戏台与非遗气质 */
  --primary-dark: #5c2e36;
  --primary-blue: #7d3c47;
  /* 强调色：传统金/琥珀，用于标题线、按钮、高亮 */
  --accent-orange: #b8860b;
  --accent-orange-light: #c9a227;
  /* 背景：暖米白/幕布感 */
  --gray-bg: #f5f0e8;
  --gray-card: #e8e2d8;
  /* 文字：深褐/墨色 */
  --text-dark: #2c2416;
  --text-muted: #6b5b4f;
  --white: #fefdfb;
  --shadow: 0 4px 6px rgba(44, 36, 22, 0.08);
  --shadow-hover: 0 10px 25px rgba(44, 36, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

/* 子页面：main 内 .content-section 撑满剩余空间，footer 自然贴底 */
body > main > .container.content-section {
  flex: 1 1 auto;
  min-height: 0;
}

body > main > .footer-custom,
main > .footer-custom {
  margin-top: auto;
  flex-shrink: 0;
}

/* ========== 导航栏 ========== */
.navbar-custom {
  background: #76362c !important;
  box-shadow: var(--shadow);
  padding: 0.5rem 1rem;
}

.navbar-custom .navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white) !important;
  letter-spacing: 2px;
}

.navbar-custom .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: 0.6rem 1rem !important;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: var(--white) !important;
  background: rgba(255, 255, 255, 0.15);
}

.navbar-custom .nav-link.login-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.navbar-custom .login-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* ========== 轮播图区域（使用 images 目录图片） ========== */
.carousel-section {
  position: relative;
  overflow: hidden;
}

.carousel-item {
  height: 920px;
  background: var(--primary-dark);
  color: var(--white);
}

.carousel-item .carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-item .carousel-caption span {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.carousel:hover .carousel-control-prev-icon,
.carousel:hover .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.6);
  transform: scale(1.1);
}

/* ========== 何为皮影戏 介绍区（与全站区块标题统一，内边距由 Bootstrap py-* 控制） ========== */
.intro-section {
  background: var(--white);
}

.intro-section .section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  text-align: center;
}

.intro-section .title-underline {
  width: 80px;
  height: 4px;
  background: var(--accent-orange);
  margin: 0 auto 2rem;
  border-radius: 2px;
}

.intro-section .badge-intro {
  display: inline-block;
  background: var(--accent-orange);
  color: var(--white);
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.intro-section .intro-text {
  line-height: 1.9;
  color: var(--text-dark);
}

.intro-section .intro-img-wrap {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.intro-section .intro-img-wrap:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.intro-section .intro-img-wrap .intro-video-player {
  width: 100%;
  display: block;
  vertical-align: middle;
}

/* ========== 皮影艺术的魅力 卡片（内边距由 Bootstrap py-* 控制） ========== */
.charm-section {
  background: var(--gray-bg);
}

.charm-section .section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  text-align: center;
}

.charm-section .title-underline {
  width: 80px;
  height: 4px;
  background: var(--accent-orange);
  margin: 0 auto 2rem;
  border-radius: 2px;
  animation: expand-width 0.6s ease forwards;
}

.charm-section .charm-intro {
  max-width: 720px;
  line-height: 1.85;
  color: var(--text-dark);
  font-size: 1rem;
}

@keyframes expand-width {
  from { width: 0; opacity: 0; }
  to { width: 80px; opacity: 1; }
}

.charm-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 100%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.charm-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.charm-card.charm-card-active {
  background: var(--white);
}

.charm-card .charm-img-placeholder {
  height: 140px;
  background: var(--gray-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.charm-card .charm-img-placeholder .charm-placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.charm-card .charm-img-placeholder .charm-icon {
  width: 48px;
  height: 48px;
  opacity: 0.85;
  color: var(--primary-blue);
}

.charm-card.charm-card-active .charm-img-placeholder {
  background: var(--gray-card);
}

.charm-card .card-body {
  padding: 1.25rem;
}

.charm-card .card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.charm-card .card-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.charm-card.charm-card-active .card-title {
  color: var(--primary-dark);
}

.charm-card.charm-card-active .card-text {
  color: var(--text-muted);
}

/* ========== 现代传承板块（内边距由 Bootstrap py-* 控制） ========== */
.modern-inheritance-section {
  background: var(--white);
}

.modern-inheritance-section .section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  text-align: center;
}

.modern-inheritance-section .title-underline {
  width: 80px;
  height: 4px;
  background: var(--accent-orange);
  margin: 0 auto 2rem;
  border-radius: 2px;
}

.modern-inheritance-text {
  line-height: 1.9;
  color: var(--text-dark);
  margin-bottom: 1.25rem;
}

.btn-inheritance-custom {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
  color: var(--white) !important;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-inheritance-custom:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: var(--white) !important;
}

.modern-inheritance-img-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 220px;
}

.modern-inheritance-img-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.modern-inheritance-img-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ========== 传承人模块（内边距由 Bootstrap py-* 控制） ========== */
.inheritors-section {
  background: var(--white);
}

.inheritors-section .section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  text-align: center;
}

.inheritors-section .title-underline {
  width: 80px;
  height: 4px;
  background: var(--accent-orange);
  margin: 0 auto 2rem;
  border-radius: 2px;
}

/* 传承人区块：使用 Bootstrap 栅格 row/col，移动端自动上下堆叠 */
.inheritor-block-photo {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--gray-bg) 0%, var(--gray-card) 100%);
  box-shadow: var(--shadow);
}

.inheritor-block-photo .inheritor-block-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inheritor-block-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
}

.inheritor-block-photo-placeholder svg {
  width: 64px;
  height: 64px;
  opacity: 0.6;
}

.inheritor-block-content {
  min-width: 0;
}

/* 传承人多行之间的分隔（Bootstrap 栅格下用 row + row 相邻选择器） */
.inheritors-section .row.align-items-start + .row.align-items-start {
  border-top: 1px solid var(--gray-bg);
  padding-top: 2rem;
}

.inheritor-block-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}

.inheritor-block-title {
  font-size: 0.95rem;
  color: var(--accent-orange);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.inheritor-block-birth {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.inheritor-block-intro {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text-dark);
}

.inheritor-block-intro p {
  margin-bottom: 0.75rem;
}

.inheritor-block-intro p:last-child {
  margin-bottom: 0;
}

.inheritor-card {
  background: var(--gray-bg);
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  transition: all 0.35s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.inheritor-card:hover {
  border-color: var(--accent-orange);
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.inheritor-card .avatar-placeholder,
.inheritor-card .inheritor-avatar-wrap {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 1.5rem auto 0.75rem;
  overflow: hidden;
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, var(--gray-bg) 0%, var(--gray-card) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.inheritor-card .avatar-placeholder {
  color: var(--primary-blue);
  font-size: 0.85rem;
}

.inheritor-card .inheritor-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inheritor-card .card-body {
  padding: 1rem 1.25rem 1.5rem;
  text-align: center;
}

.inheritor-card .inheritor-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.inheritor-card .inheritor-birth {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.inheritor-card .btn-inheritor-detail {
  background: var(--accent-orange);
  color: var(--white);
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.inheritor-card .btn-inheritor-detail:hover {
  background: var(--accent-orange-light);
  color: var(--white);
  transform: scale(1.05);
}

/* ========== 页脚（上下内边距由 Bootstrap py-* 控制，粘性贴底） ========== */
.footer-custom {
  background: #76362c;
  color: rgba(255, 255, 255, 0.9);
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  min-height: 3.5rem;
  box-sizing: border-box;
}

/* ========== 二级/三级页面 通用 ========== */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
  color: var(--white);
  padding: 2.5rem 0;
  margin-bottom: 2rem;
}

.page-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-hero .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.page-hero .breadcrumb-item a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.page-hero .breadcrumb-item.active {
  color: rgba(255, 255, 255, 0.7);
}

.content-section {
  padding: 2rem 0 4rem;
}

.content-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent-orange);
  display: inline-block;
}

.content-section p {
  line-height: 1.9;
  color: var(--text-dark);
}

/* ========== 登录/注册 模态框 ========== */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
  color: var(--white);
  border-radius: 12px 12px 0 0;
  padding: 1rem 1.5rem;
  border: none;
}

.modal-header .btn-close {
  filter: invert(1);
}

.modal-body .form-label {
  font-weight: 600;
  color: var(--text-dark);
}

.modal-body .form-control {
  border-radius: 8px;
  border: 1px solid var(--gray-card);
}

.modal-body .form-control:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.25);
}

.modal-footer .btn-primary-custom {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  border-radius: 8px;
  padding: 0.5rem 1.5rem;
}

.modal-footer .btn-primary-custom:hover {
  background: var(--accent-orange-light);
  border-color: var(--accent-orange-light);
}

/* ========== 按钮主题（与整站主色/强调色一致） ========== */
.btn-primary-custom,
.btn.btn-primary-custom {
  background: var(--accent-orange) !important;
  border-color: var(--accent-orange) !important;
  color: var(--white) !important;
}

.btn-primary-custom:hover,
.btn.btn-primary-custom:hover {
  background: var(--accent-orange-light) !important;
  border-color: var(--accent-orange-light) !important;
  color: var(--white) !important;
}

.btn-outline-primary {
  color: var(--primary-dark);
  border-color: var(--accent-orange);
  border-width: 2px;
}

.btn-outline-primary:hover {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: var(--white) !important;
}

.btn-outline-secondary {
  color: var(--text-muted);
  border-color: var(--gray-card);
}

.btn-outline-secondary:hover {
  background: var(--gray-bg);
  border-color: var(--gray-card);
  color: var(--text-dark) !important;
}

/* 登录页「去注册」「去登录」文字链接 */
#goRegisterTab,
#goLoginTab {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 600;
}

#goRegisterTab:hover,
#goLoginTab:hover {
  color: var(--accent-orange-light);
  text-decoration: underline;
}

/* ========== 图标 SVG 占位/自定义 ========== */
.icon-piyin {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
}

/* ========== 动画：淡入上移 ========== */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ========== 搜索框（功能模块） ========== */
.search-box-wrap {
  max-width: 400px;
  margin: 0 auto 2rem;
}

.search-box-wrap .form-control {
  border-radius: 24px;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--gray-bg);
}

.search-box-wrap .form-control:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.2);
}

.search-box-wrap .btn-search {
  border-radius: 24px;
  background: var(--accent-orange);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.5rem;
  margin-left: 0.5rem;
  transition: all 0.3s ease;
}

.search-box-wrap .btn-search:hover {
  background: var(--accent-orange-light);
  color: var(--white);
  transform: scale(1.05);
}

/* ========== 传承人详情 弹层 ========== */
.inheritor-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.inheritor-detail-overlay.show {
  opacity: 1;
  visibility: visible;
}

.inheritor-detail-card {
  background: var(--white);
  border-radius: 12px;
  max-width: 480px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.inheritor-detail-overlay.show .inheritor-detail-card {
  transform: scale(1);
}

.inheritor-detail-card .detail-header {
  background: linear-gradient(90deg, var(--accent-orange) 0%, var(--accent-orange-light) 100%);
  color: var(--white);
  padding: 1.25rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.inheritor-detail-card .detail-subtitle {
  font-size: 0.85rem;
  opacity: 0.95;
  margin-top: 0.35rem;
  font-weight: normal;
}

.inheritor-detail-card .detail-close {
  background: rgba(255,255,255,0.3);
  border: none;
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.inheritor-detail-card .detail-close:hover {
  background: rgba(255,255,255,0.5);
}

.inheritor-detail-card .detail-body {
  padding: 1.5rem;
}

.inheritor-detail-card .detail-body p {
  line-height: 1.8;
  color: var(--text-dark);
}

/* ========== 登录/注册独立页面 ========== */
.auth-page-main {
  min-height: calc(100vh - 56px - 60px);
  padding-top: calc(56px + 3rem);
  padding-bottom: 3rem;
  display: flex;
  align-items: center;
}

.auth-card {
  border-radius: 16px;
  border: none;
}

.auth-tabs .nav-link {
  color: var(--text-muted);
  font-weight: 600;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.auth-tabs .nav-link:hover {
  color: var(--primary-dark);
  background: var(--gray-bg);
}

.auth-tabs .nav-link.active {
  color: var(--accent-orange);
  background: rgba(184, 134, 11, 0.12);
}

.auth-tabs .nav-link:focus {
  outline: none;
}

/* ========== Bootstrap 响应式补充（仅保留栅格无法实现的部分） ========== */
/* 小屏下魅力引导文案：small 字号，md 及以上恢复正常 */
.small-md-normal {
  font-size: 0.875rem;
}
@media (min-width: 768px) {
  .small-md-normal {
    font-size: 1rem;
  }
}

/* 轮播图高度：Bootstrap 无内置响应式高度，仅在此做断点覆盖 */
@media (max-width: 767.98px) {
  .carousel-section-mobile .carousel-item {
    height: 280px;
  }
  .carousel-section-mobile .carousel-control-prev-icon,
  .carousel-section-mobile .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
  }
}
@media (max-width: 575.98px) {
  .carousel-section-mobile .carousel-item {
    height: 240px;
  }
}
