/**
 * Data Detail Page CSS - 数据详情页专属样式
 */

/* ========== Hero 区域 ========== */
.data-detail-hero {
  padding: var(--spacing-20) 0;
  background: linear-gradient(135deg, #f8f9fc 0%, #f0f2f8 50%, #e8ecf5 100%);
  overflow: hidden;
}

.data-detail-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-16);
  align-items: center;
}

.data-detail-hero-content {
  padding-right: var(--spacing-8);
}

.data-detail-hero-content .region-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: var(--font-bold);
  color: var(--color-black);
  margin-bottom: var(--spacing-6);
  line-height: 1.2;
}

.data-detail-hero-content .region-desc {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  line-height: 1.75;
  margin-bottom: var(--spacing-4);
}

.data-detail-hero-content .region-desc:last-child {
  margin-bottom: 0;
}

/* ========== 轨道图动画容器 ========== */
.data-orbit-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.orbit-container {
  position: relative;
  width: 400px;
  height: 400px;
}

/* ========== 中心 Logo ========== */
.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 120px;
  height: 120px;
  background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 32px rgba(255, 107, 53, 0.15),
    0 0 0 8px rgba(255, 107, 53, 0.08),
    inset 0 2px 8px rgba(255, 255, 255, 0.8);
  z-index: 10;
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

.orbit-center.animate-in {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.orbit-center-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.orbit-logo-icon {
  width: 36px;
  height: 36px;
}

.orbit-logo-text {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  letter-spacing: -0.3px;
}

/* ========== 轨道环 ========== */
.orbit-rings {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.orbit-ring {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 1.5;
  stroke-dasharray: 8 4;
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.6s ease;
}

.orbit-rings.animate-in .orbit-ring {
  opacity: 1;
  animation: orbitRotate 60s linear infinite;
}

.orbit-ring-2 {
  stroke-dasharray: 4 6;
  animation-direction: reverse !important;
  animation-duration: 45s !important;
}

@keyframes orbitRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== 连接线 ========== */
.orbit-connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.orbit-line {
  fill: none;
  stroke: url(#lineGradient);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  opacity: 0.6;
  transition: stroke-dashoffset 1.2s ease-out;
}

.orbit-connections.animate-in .orbit-line {
  stroke-dashoffset: 0;
}

/* ========== 轨道节点 ========== */
.orbit-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  background: #fff;
  border-radius: 30px;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
  opacity: 0;
  transform: scale(0.5) translateY(20px);
  transition: 
    opacity 0.5s ease,
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
  z-index: 5;
  cursor: pointer;
}

.orbit-node.animate-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.orbit-node:hover {
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06);
  transform: scale(1.05) translateY(-2px);
}

.orbit-node.pulse {
  animation: nodePulse 0.8s ease-out;
}

@keyframes nodePulse {
  0% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); }
  50% { box-shadow: 0 4px 20px rgba(255, 107, 53, 0.25), 0 2px 8px rgba(255, 107, 53, 0.15); }
  100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); }
}

/* 节点位置 */
.orbit-node-top {
  top: 20px;
  left: 50%;
  transform: translateX(-50%) scale(0.5);
}

.orbit-node-top.animate-in {
  transform: translateX(-50%) scale(1);
}

.orbit-node-right {
  top: 50%;
  right: -20px;
  transform: translateY(-50%) scale(0.5);
}

.orbit-node-right.animate-in {
  transform: translateY(-50%) scale(1);
}

.orbit-node-bottom {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) scale(0.5);
}

.orbit-node-bottom.animate-in {
  transform: translateX(-50%) scale(1);
}

.orbit-node-left {
  top: 50%;
  left: -20px;
  transform: translateY(-50%) scale(0.5);
}

.orbit-node-left.animate-in {
  transform: translateY(-50%) scale(1);
}

/* 节点图标 */
.orbit-node-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.orbit-node-icon.statistics {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.orbit-node-icon.statistics::before {
  content: '';
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 3v18h18' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M7 14l4-4 3 3 6-6' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.orbit-node-icon.export {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.orbit-node-icon.export::before {
  content: '';
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5v14M19 12l-7-7-7 7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.orbit-node-icon.shipping {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.orbit-node-icon.shipping::before {
  content: '';
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='2' y='7' width='15' height='10' rx='1' stroke='white' stroke-width='2'/%3E%3Cpath d='M17 12h3l2 3v2h-5v-5z' stroke='white' stroke-width='2'/%3E%3Ccircle cx='6' cy='18' r='2' fill='white'/%3E%3Ccircle cx='18' cy='18' r='2' fill='white'/%3E%3C/svg%3E") center/contain no-repeat;
}

.orbit-node-icon.import {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.orbit-node-icon.import::before {
  content: '';
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 19V5M5 12l7 7 7-7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.orbit-node-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

/* ========== 装饰点 ========== */
.orbit-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3;
}

.orbit-dot.animate-in {
  opacity: 1;
  transform: scale(1);
}

.orbit-dot.glow {
  box-shadow: 0 0 12px 4px rgba(34, 197, 94, 0.4);
}

.orbit-dot-1 {
  top: 75px;
  right: 75px;
}

.orbit-dot-2 {
  bottom: 75px;
  right: 75px;
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.orbit-dot-2.glow {
  box-shadow: 0 0 12px 4px rgba(168, 85, 247, 0.4);
}

.orbit-dot-3 {
  bottom: 75px;
  left: 75px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.orbit-dot-3.glow {
  box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0.4);
}

.orbit-dot-4 {
  top: 75px;
  left: 75px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.orbit-dot-4.glow {
  box-shadow: 0 0 12px 4px rgba(59, 130, 246, 0.4);
}

/* 持续动画状态 */
.orbit-container.animation-ready .orbit-center {
  animation: centerFloat 4s ease-in-out infinite;
}

@keyframes centerFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -52%) scale(1.02); }
}

/* ========== 国家列表区域 ========== */
.countries-section {
  padding: var(--spacing-16) 0;
  background-color: var(--color-white);
}

.countries-section .countries-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-bold);
  color: var(--color-black);
  margin-bottom: var(--spacing-8);
  line-height: 1.3;
}

.countries-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--spacing-5) var(--spacing-8);
}

.country-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-2) 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.country-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.country-flag {
  width: 28px;
  height: 20px;
  background-color: var(--color-gray-100);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.country-flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.country-flag-img.loaded {
  opacity: 1;
}

.flag-emoji {
  font-size: 16px;
  line-height: 1;
}

.country-name {
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  font-weight: var(--font-medium);
}

/* ========== 政策特性表格区域 ========== */
.policies-section {
  padding: var(--spacing-16) 0;
  background-color: var(--color-gray-100);
}

.policies-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-bold);
  color: var(--color-black);
  margin-bottom: var(--spacing-10);
  line-height: 1.3;
}

.policies-table-wrapper {
  overflow-x: auto;
}

.policies-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: var(--color-white);
  border: 1px solid #F4F4F4;
  overflow: hidden;
}

.policies-table th,
.policies-table td {
  padding: var(--spacing-5) var(--spacing-6);
  text-align: left;
  font-size: var(--text-sm);
  vertical-align: top;
  border-left: 1px solid #F4F4F4;
}

.policies-table th:first-child,
.policies-table td:first-child {
  border-left: none;
}

.policies-table th {
  background-color: #FFFCF4;
  font-weight: var(--font-semibold);
  color: var(--color-black);
  padding-top: var(--spacing-5);
  padding-bottom: var(--spacing-5);
  border-bottom: 1px solid #F4F4F4;
}

.policies-table tbody tr {
  background-color: var(--color-white);
}

.policies-table td {
  color: var(--color-gray-600);
  line-height: 1.7;
  padding-top: var(--spacing-5);
  padding-bottom: var(--spacing-5);
  border-bottom: 1px solid #F4F4F4;
}

.policies-table tr:last-child td {
  border-bottom: none;
}

.policies-table .policy-category {
  font-weight: var(--font-semibold);
  color: var(--color-black);
  background-color: #FFFCF4;
}

.policies-table td:nth-child(2),
.policies-table td:nth-child(3) {
  font-style: italic;
  color: var(--color-gray-500);
}

/* 表格高亮链接样式 */
.policies-table .highlight-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-medium);
}

/* 表格加粗文本 */
.policies-table .policy-bold {
  font-weight: var(--font-medium);
  color: var(--color-gray-700);
  font-style: normal;
}

/* 区域副标题 */
.policies-table .region-sub {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  font-weight: var(--font-normal);
}

/* 表格内 strong 标签 */
.policies-table strong {
  font-weight: var(--font-semibold);
  color: var(--color-gray-700);
}

/* rowspan 单元格样式 */
.policies-table td[rowspan] {
  vertical-align: top;
}

/* ========== 数据样例区域 ========== */
.sample-section {
  padding: var(--spacing-16) 0;
  background-color: var(--color-white);
}

.sample-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-6);
}

.sample-header h2 {
  font-size: var(--text-2xl);
  margin-bottom: 0;
}

.sample-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
}

.sample-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-gray-300);
  border-radius: 50%;
  background-color: var(--color-white);
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sample-nav-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.sample-card {
  background-color: var(--color-gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sample-card-header {
  padding: var(--spacing-4) var(--spacing-6);
  background-color: var(--color-black);
  color: var(--color-white);
  font-weight: var(--font-medium);
}

.sample-card-body {
  padding: var(--spacing-6);
}

.sample-data-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-6);
}

.sample-data-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
}

.sample-data-label {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.sample-data-value {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-black);
}

.sample-data-link {
  font-size: var(--text-sm);
  color: var(--color-primary);
  text-decoration: underline;
}

/* More details 按钮 */
.sample-more-details {
  justify-content: flex-end;
  align-items: flex-start;
}

.sample-more-details-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-primary);
  text-decoration: none;
  padding: var(--spacing-2) var(--spacing-4);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
}

.sample-more-details-btn:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.sample-more-details-btn svg {
  transition: transform 0.2s ease;
}

.sample-more-details-btn:hover svg {
  transform: translateX(4px);
}

.sample-counter {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
}

/* 点"下一张"：旧卡片向左滑出 */
.sample-slide-out-left {
  animation: sampleSlideOutLeft 0.25s ease forwards;
}

/* 点"上一张"：旧卡片向右滑出 */
.sample-slide-out-right {
  animation: sampleSlideOutRight 0.25s ease forwards;
}

/* 点"下一张"：新卡片从右侧滑入 */
.sample-slide-in-right {
  animation: sampleSlideInRight 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* 点"上一张"：新卡片从左侧滑入 */
.sample-slide-in-left {
  animation: sampleSlideInLeft 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sampleSlideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-40px);
  }
}

@keyframes sampleSlideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

@keyframes sampleSlideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes sampleSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== CTA 区域 ========== */
.data-cta-section {
  position: relative;
  padding: var(--spacing-16) 0;
  color: var(--color-white);
  text-align: center;
  background-image: url('../images/dataDetail_bg.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* 半透明黑色覆盖层 */
.data-cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.34);
  z-index: 1;
}

.data-cta-section .container {
  position: relative;
  z-index: 2;
}

.data-cta-content {
  max-width: 800px;
  margin: 0 auto;
}

.data-cta-content h2 {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: var(--spacing-4);
}

.data-cta-content p {
  font-size: var(--text-base);
  color: var(--color-gray-200);
  margin-bottom: var(--spacing-8);
  line-height: 1.6;
}

/* ========== 响应式 ========== */
@media (max-width: 1199px) {
  .countries-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .orbit-container {
    width: 360px;
    height: 360px;
  }
  
  .orbit-node {
    padding: 8px 14px 8px 10px;
  }
  
  .orbit-node-label {
    font-size: 12px;
  }
}

@media (max-width: 991px) {
  .data-detail-hero {
    padding: var(--spacing-12) 0;
  }
  
  .data-detail-hero-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-10);
  }
  
  .data-detail-hero-content {
    padding-right: 0;
    text-align: center;
  }
  
  .data-detail-hero-content .region-title {
    font-size: var(--text-3xl);
  }
  
  .data-orbit-diagram {
    min-height: 380px;
  }
  
  .orbit-container {
    width: 380px;
    height: 380px;
  }
  
  .countries-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .sample-data-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .data-detail-hero {
    padding: var(--spacing-10) 0;
  }
  
  .data-detail-hero-content .region-title {
    font-size: var(--text-2xl);
  }
  
  .data-detail-hero-content .region-desc {
    font-size: var(--text-xs);
  }
  
  .data-orbit-diagram {
    min-height: 320px;
  }
  
  .orbit-container {
    width: 300px;
    height: 300px;
  }
  
  .orbit-center {
    width: 90px;
    height: 90px;
  }
  
  .orbit-logo-icon {
    width: 28px;
    height: 28px;
  }
  
  .orbit-logo-text {
    font-size: 11px;
  }
  
  .orbit-node {
    padding: 6px 10px 6px 8px;
    gap: 6px;
  }
  
  .orbit-node-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }
  
  .orbit-node-icon::before {
    width: 12px !important;
    height: 12px !important;
  }
  
  .orbit-node-label {
    font-size: 11px;
  }
  
  .orbit-node-top { top: 10px; }
  .orbit-node-bottom { bottom: 10px; }
  .orbit-node-right { right: -30px; }
  .orbit-node-left { left: -30px; }
  
  .orbit-dot {
    width: 8px;
    height: 8px;
  }
  
  .orbit-dot-1 { top: 55px; right: 55px; }
  .orbit-dot-2 { bottom: 55px; right: 55px; }
  .orbit-dot-3 { bottom: 55px; left: 55px; }
  .orbit-dot-4 { top: 55px; left: 55px; }
  
  .countries-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .policies-table {
    font-size: var(--text-xs);
  }
  
  .sample-data-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .orbit-container {
    width: 280px;
    height: 280px;
  }
  
  .orbit-center {
    width: 80px;
    height: 80px;
  }
  
  .orbit-node-right { right: -40px; }
  .orbit-node-left { left: -40px; }
}
