/**
 * @file
 * 火彩商城 - 大师详情页面样式
 * 参考 tea-garden-detail.css 设计
 */

/* ========== 大师详情页面容器 ========== */
.layout-master-detail {
  min-height: 100vh;
  background: #F5F5F7;
}

.site-main-master-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 136px 16px 60px;
}

/* ========== Hero Section - 封面区域 ========== */
.master-detail-hero {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  margin-bottom: 16px;
  z-index: 1;
}

/* 隐藏默认的空背景 */
.master-detail-hero:has(.hero-background-default) {
  display: none;
}

.video-card {
  width: 100%;
  height: 100%;
}

.video-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-background {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-background-default {
  background: linear-gradient(135deg, #7B1FA2 0%, #4A148C 100%);
}

/* ========== 大师概述卡片 ========== */
.master-overview {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin: 16px;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.master-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.master-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #CE93D8 0%, #AB47BC 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 16px rgba(123, 31, 162, 0.3);
}

.master-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.master-avatar-large .avatar-emoji {
  font-size: 60px;
}

.master-info-main {
  flex: 1;
}

.master-name {
  font-size: 28px;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.master-titles {
  font-size: 14px;
  color: #6E6E73;
  line-height: 1.6;
}

.master-titles ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.master-titles li {
  padding: 4px 0;
}

.master-titles strong {
  color: #7B1FA2;
}

/* ========== 座右铭 ========== */
.master-motto {
  background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.motto-icon {
  width: 24px;
  height: 24px;
  color: #7B1FA2;
  flex-shrink: 0;
  margin-top: 2px;
}

.motto-text {
  font-size: 15px;
  color: #4A148C;
  font-style: italic;
  line-height: 1.6;
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
}

/* ========== 简介和详情 ========== */
.master-bio-section,
.master-detail-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #F5F5F7;
}

.master-detail-section {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin: 16px;
  border-top: none;
}

.detail-content-card {
  font-size: 15px;
  color: #6E6E73;
  line-height: 1.7;
}

.detail-content-card p {
  margin-bottom: 12px;
}

.detail-content-card p:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.bio-content,
.detail-content {
  font-size: 15px;
  color: #6E6E73;
  line-height: 1.7;
}

.bio-content p,
.detail-content p {
  margin-bottom: 12px;
}

.bio-content p:last-child,
.detail-content p:last-child {
  margin-bottom: 0;
}

/* ========== 证书和聘书 ========== */
.master-certificates,
.master-appointments,
.master-detail-section {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin: 16px;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.certificate-card {
  aspect-ratio: 3/4;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #F5F5F7;
  border: 2px solid transparent;
}

.certificate-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #7B1FA2;
}

.certificate-card:focus {
  outline: none;
  border-color: #7B1FA2;
  box-shadow: 0 0 0 4px rgba(123, 31, 162, 0.2);
}

.certificate-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== 代表作 ========== */
.master-representative {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin: 16px;
}

.master-representative .section-title {
  font-size: 18px;
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.related-card {
  background: #F5F5F7;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.related-card-image-wrapper {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8E8ED;
  overflow: hidden;
}

.related-card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-placeholder-icon {
  width: 48px;
  height: 48px;
  color: #6E6E73;
}

.related-info {
  padding: 12px;
}

.related-title {
  font-size: 14px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-price-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-price {
  font-size: 16px;
  font-weight: 700;
  color: #7B1FA2;
}

.related-original-price {
  font-size: 13px;
  color: #6E6E73;
  text-decoration: line-through;
}

/* ========== 相关产品 ========== */
.master-products {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin: 16px;
}

.master-products .section-title {
  font-size: 18px;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 14px;
  color: #6E6E73;
  margin-bottom: 16px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.product-card {
  background: #F5F5F7;
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  text-align: center;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-name {
  font-size: 13px;
  font-weight: 500;
  color: #1D1D1F;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  font-size: 15px;
  font-weight: 700;
  color: #7B1FA2;
}

/* ========== CTA Section ========== */
.master-cta {
  background: linear-gradient(135deg, #7B1FA2 0%, #4A148C 100%);
  border-radius: 20px;
  padding: 40px 24px;
  margin: 16px;
  text-align: center;
  color: white;
}

.master-cta .container {
  max-width: 600px;
  margin: 0 auto;
}

.cta-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cta-subtitle {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 24px;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.cta-btn.primary {
  background: white;
  color: #7B1FA2;
}

.cta-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.cta-btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.cta-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
}

/* ========== 视频加载样式 ========== */
.video-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 10;
}

.video-loading-overlay.hidden {
  display: none;
}

.video-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: video-spin 0.8s linear infinite;
}

@keyframes video-spin {
  to { transform: rotate(360deg); }
}

.video-loading-text {
  margin-top: 12px;
  font-size: 14px;
}

/* ========== 响应式设计 ========== */
@media (min-width: 768px) {
  .site-main-master-detail {
    padding-top: 136px;
  }

  .master-overview {
    margin: 16px;
    padding: 60px 40px 32px;
  }

  .master-profile-header {
    flex-direction: row;
    text-align: left;
  }

  .master-avatar-large {
    margin-bottom: 0;
    margin-right: 24px;
    width: 140px;
    height: 140px;
  }

  .master-name {
    font-size: 32px;
  }

  .master-titles {
    font-size: 15px;
  }

  .certificates-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }

  .related-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
}

/* ========== 深色模式支持（已隐藏） ========== */
/*
@media (prefers-color-scheme: dark) {
  .layout-master-detail {
    background: #000000;
  }

  .master-overview,
  .master-certificates,
  .master-appointments,
  .master-representative,
  .master-products {
    background: #1C1C1E;
  }

  .master-name {
    color: #F5F5F7;
  }

  .master-titles,
  .bio-content,
  .detail-content,
  .section-subtitle {
    color: #86868B;
  }

  .section-title {
    color: #F5F5F7;
  }

  .related-card,
  .product-card {
    background: #2C2C2E;
  }

  .related-title,
  .product-name {
    color: #F5F5F7;
  }

  .certificate-card {
    background: #2C2C2E;
  }

  .master-motto {
    background: linear-gradient(135deg, #4A148C 0%, #7B1FA2 100%);
  }

  .motto-text {
    color: #F3E5F5;
  }
}
*/

/* ========== 无障碍增强 ========== */
@media (prefers-reduced-motion: reduce) {
  .certificate-card,
  .related-card,
  .product-card,
  .cta-btn {
    transition: none;
  }
}

.certificate-card:focus-visible,
.cta-btn:focus-visible {
  outline: 2px solid #0066CC;
  outline-offset: 2px;
}
