.detail-page {
  min-height: calc(100vh - var(--header-height));
  padding: 30px 0;
  background: var(--bg-page);
}

.detail-header {
  margin-bottom: 24px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary-brown);
}

.breadcrumb .sep {
  margin: 0 8px;
  color: var(--text-tertiary);
}

.spectrum-hero {
  position: relative;
  background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #8B4513 100%);
  border-radius: 4px;
  padding: 36px 48px;
  color: #fff;
  overflow: hidden;
}

.hero-deco {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(201, 169, 110, 0.3);
  border-radius: 50%;
  pointer-events: none;
}

.hero-deco-left {
  top: -40px;
  left: -40px;
}

.hero-deco-right {
  bottom: -50px;
  right: 80px;
  width: 180px;
  height: 180px;
}

.hero-deco::before,
.hero-deco::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 50%;
}

.hero-deco::before {
  width: 70%;
  height: 70%;
}

.hero-deco::after {
  width: 40%;
  height: 40%;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  z-index: 1;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
}

.hero-surname-box {
  flex-shrink: 0;
}

.surname-seal {
  width: 80px;
  height: 80px;
  background: var(--primary-gold);
  border: 3px solid #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  color: #8B4513;
  font-family: 'STKaiti', 'KaiTi', 'SimSun', serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.hero-info {
  flex: 1;
  min-width: 0;
}

.hero-title {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 14px 0;
  font-family: 'STKaiti', 'KaiTi', 'SimSun', serif;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.hero-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.hero-meta .meta-item:first-child {
  padding-left: 0;
}

.meta-label {
  color: var(--primary-gold);
  font-weight: 500;
}

.meta-value {
  color: rgba(255, 255, 255, 0.9);
}

.meta-divider {
  color: rgba(201, 169, 110, 0.5);
}

.hero-right {
  flex-shrink: 0;
}

.hero-tree-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.tree-btn-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  background: linear-gradient(135deg, #D4B87F 0%, #C9A96E 50%, #B8956A 100%);
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tree-btn-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.hero-tree-btn:hover .tree-btn-inner {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hero-tree-btn:hover .tree-btn-inner::before {
  left: 120%;
}

.hero-tree-btn:active .tree-btn-inner {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tree-btn-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.tree-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.tree-btn-title {
  font-size: 18px;
  font-weight: 700;
  color: #5C3A1E;
  font-family: 'STKaiti', 'KaiTi', 'SimSun', serif;
  letter-spacing: 2px;
}

.tree-btn-subtitle {
  font-size: 11px;
  color: #8B6914;
  margin-top: 3px;
  font-style: italic;
}

.tree-btn-arrow {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-left: 6px;
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.hero-tree-btn:hover .tree-btn-arrow {
  transform: rotate(180deg) translateX(4px);
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-section {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 40px;
  height: 2px;
  background: var(--primary-orange);
}

.section-content {
  font-size: 14px;
  line-height: 1.8;
  color: #666;
}

.ancestor-info {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.ancestor-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.ancestor-avatar img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.ancestor-detail h4 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.ancestor-detail p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

.generations-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gen-item {
  padding: 8px 16px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 14px;
  color: #666;
  border-left: 3px solid var(--primary-orange);
}

.migrate-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.migrate-item {
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.migrate-place {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.migrate-count {
  font-size: 13px;
  color: #999;
}

.detail-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.side-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed #f0f0f0;
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list .label {
  color: #999;
}

.info-list .value {
  color: #333;
  font-weight: 500;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-box {
  text-align: center;
  padding: 12px 8px;
  background: #f8f9fa;
  border-radius: 8px;
}

.stat-box .num {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-orange);
  margin-bottom: 4px;
}

.stat-box .txt {
  font-size: 12px;
  color: #999;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn.primary.view-tree-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, var(--primary-brown), var(--primary-gold)) !important;
  box-shadow: 0 4px 16px rgba(139, 69, 19, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease !important;
  border-color: transparent !important;
  color: #fff !important;
}

.view-tree-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.action-btn.primary.view-tree-btn:hover::before {
  left: 100%;
}

.action-btn.primary.view-tree-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
  opacity: 1 !important;
  color: #fff !important;
}

.action-btn.primary.view-tree-btn:active {
  transform: translateY(0);
}

.view-tree-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.view-tree-text {
  flex: 1;
  text-align: center;
  letter-spacing: 2px;
}

.view-tree-arrow {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  transform: rotate(180deg);
}

.view-tree-btn:hover .view-tree-arrow {
  transform: rotate(180deg) translateX(4px);
}

.action-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  color: #666;
}

.action-btn:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary-gold), var(--primary-orange));
  color: #fff;
  border-color: transparent;
  font-weight: 500;
}

.action-btn.primary:hover {
  opacity: 0.9;
  color: #fff;
}

.action-btn.small {
  padding: 6px 16px;
  font-size: 13px;
  width: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.section-header .section-title {
  margin: 0;
  padding: 0;
  border-bottom: none;
}

.section-header .section-title::after {
  display: none;
}

.member-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.member-search-bar .form-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

.member-search-bar .form-input:focus {
  outline: none;
  border-color: var(--primary-orange);
}

.member-search-bar .search-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary-gold), var(--primary-orange));
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.member-search-bar .search-btn:hover {
  opacity: 0.9;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 6px;
  transition: background 0.2s;
}

.member-item:hover {
  background: #f0f0f0;
}

.member-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.member-avatar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.member-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.member-meta {
  font-size: 12px;
  color: #999;
}

.member-actions {
  display: flex;
  gap: 8px;
}

.member-action-btn {
  padding: 4px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.member-action-btn:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.member-action-btn.primary {
  background: var(--primary-orange);
  color: #fff;
  border-color: var(--primary-orange);
}

.member-action-btn.primary:hover {
  opacity: 0.9;
  color: #fff;
}

.loading, .empty {
  text-align: center;
  padding: 40px 0;
  color: #999;
  font-size: 14px;
}
