/* KYN Logistics 公共样式 - 马士基风格 */

/* ==================== Header 透明/实色状态样式 ==================== */
/* 透明状态（初始/顶部） */
#main-header.header-transparent {
  background: linear-gradient(to bottom, rgba(0, 36, 61, 0.8) 0%, rgba(0, 36, 61, 0.4) 50%, transparent 100%);
}
#main-header.header-transparent .header-top-bar {
  border-color: rgba(255, 255, 255, 0.2);
}
#main-header.header-transparent .header-text-primary {
  color: white;
}
#main-header.header-transparent .header-text-secondary {
  color: rgba(255, 255, 255, 0.7);
}
#main-header.header-transparent .header-btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
}
#main-header.header-transparent .header-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}
#main-header.header-transparent .header-user-btn {
  background: rgba(255, 255, 255, 0.1);
}
#main-header.header-transparent .header-user-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
#main-header.header-transparent .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}
#main-header.header-transparent .nav-link.nav-active {
  background: rgba(255, 255, 255, 0.15);
}

/* 白色状态（滚动后） */
#main-header.header-solid {
  background: white;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}
#main-header.header-solid .header-top-bar {
  border-color: #e5e7eb;
}
#main-header.header-solid .header-text-primary {
  color: #00243D;
}
#main-header.header-solid .header-text-secondary {
  color: #64748b;
}
#main-header.header-solid .header-btn-outline {
  border: 1px solid #00243D;
  color: #00243D;
}
#main-header.header-solid .header-btn-outline:hover {
  background: #00243D;
  color: white;
}
#main-header.header-solid .header-user-btn {
  background: #f1f5f9;
}
#main-header.header-solid .header-user-btn:hover {
  background: #e2e8f0;
}
#main-header.header-solid .nav-link:hover {
  background: #f1f5f9;
}
#main-header.header-solid .nav-link.nav-active {
  background: #e0f2fe;
  color: #0369a1;
}

/* 隐藏状态 */
#main-header.header-hidden {
  transform: translateY(-100%);
}

/* ==================== 基础变量 ==================== */
:root {
  --maersk-dark: #00243D;
  --maersk-primary: #004165;
  --maersk-light: #42B4E6;
  --maersk-accent: #00A5D5;
  --maersk-sky: #E5F4FB;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==================== 动画 ==================== */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeDown {
  animation: fadeDown 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeUp {
  animation: fadeUp 0.4s ease-out;
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.animate-slideLeft {
  animation: slideLeft 0.3s ease;
}

/* ==================== 页面布局 ==================== */
/* 页面内容区 - 为固定header留空间 */
.page-content {
  padding-top: 104px; /* header双行高度 */
}

/* ==================== 页面标题区 ==================== */
.page-hero {
  background: linear-gradient(135deg, var(--maersk-dark) 0%, var(--maersk-primary) 100%);
  color: white;
  padding: 80px 0 60px;
}
.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
}
.page-hero p {
  font-size: 1.125rem;
  opacity: 0.8;
  margin-top: 16px;
}

/* ==================== 面包屑 ==================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
}
.breadcrumb a {
  color: var(--maersk-light);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: white;
}

/* ==================== 卡片样式 ==================== */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 24px;
}

.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 36, 61, 0.12);
}

.card-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 36, 61, 0.15);
}

/* ==================== 按钮样式 ==================== */
.btn-primary {
  background: var(--maersk-primary);
  color: white;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover {
  background: var(--maersk-dark);
}

.btn-secondary {
  background: var(--maersk-light);
  color: var(--maersk-dark);
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-secondary:hover {
  background: white;
}

.btn-outline {
  border: 2px solid var(--maersk-primary);
  color: var(--maersk-primary);
  padding: 12px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
}
.btn-outline:hover {
  background: var(--maersk-primary);
  color: white;
}

/* ==================== 表单元素 ==================== */
.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--maersk-light);
  box-shadow: 0 0 0 3px rgba(66, 180, 230, 0.15);
}

.form-select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}
.form-select:focus {
  border-color: var(--maersk-light);
  box-shadow: 0 0 0 3px rgba(66, 180, 230, 0.15);
}

/* ==================== 表格样式 ==================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  background: #f8fafc;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
}
.data-table tr:hover {
  background: #f8fafc;
}

/* ==================== 搜索框 ==================== */
.search-box {
  display: flex;
  gap: 12px;
  background: white;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.search-box input,
.search-box select {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.search-box input:focus,
.search-box select:focus {
  border-color: var(--maersk-light);
  box-shadow: 0 0 0 3px rgba(66, 180, 230, 0.15);
}

/* ==================== 状态标签 ==================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}
.status-success {
  background: #dcfce7;
  color: #166534;
}
.status-warning {
  background: #fef3c7;
  color: #92400e;
}
.status-info {
  background: var(--maersk-sky);
  color: var(--maersk-primary);
}
.status-error {
  background: #fee2e2;
  color: #991b1b;
}

/* ==================== 时间线 ==================== */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}
.timeline-item {
  position: relative;
  padding-bottom: 28px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--maersk-primary);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--maersk-primary);
}
.timeline-item.completed::before {
  background: #22c55e;
  box-shadow: 0 0 0 2px #22c55e;
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--maersk-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #64748b;
}
.empty-state svg {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

/* ==================== 区块标题样式 ==================== */
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--maersk-light);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--maersk-dark);
  line-height: 1.2;
}

/* ==================== 统计数字样式 ==================== */
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--maersk-primary);
  line-height: 1;
}
.stat-label {
  font-size: 14px;
  color: #64748b;
  margin-top: 4px;
}

/* ==================== 服务卡片 ==================== */
.service-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}
.service-card:hover {
  box-shadow: 0 12px 40px rgba(0, 36, 61, 0.12);
}
.service-card-header {
  height: 180px;
  background: linear-gradient(135deg, var(--maersk-dark), var(--maersk-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.service-card-body {
  padding: 24px;
}

/* ==================== 导航激活状态 ==================== */
.nav-link.active {
  background: rgba(255, 255, 255, 0.15);
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
  .page-content {
    padding-top: 90px;
  }

  .page-hero {
    padding: 60px 0 40px;
  }

  .page-hero h1 {
    font-size: 1.875rem;
  }

  .section-title {
    font-size: 1.75rem;
  }
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==================== 选择高亮 ==================== */
::selection {
  background: var(--maersk-light);
  color: var(--maersk-dark);
}

/* ==================== 回到顶部按钮 ==================== */
.back-to-top {
  position: fixed;
  bottom: 100px;  /* 在客服按钮上方 */
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--maersk-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 36, 61, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 90;
}

.back-to-top:hover {
  background: var(--maersk-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 36, 61, 0.35);
}

.back-to-top:active {
  transform: translateY(0);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 90px;  /* 在客服按钮上方 */
    right: 20px;
    width: 40px;
    height: 40px;
  }

  .back-to-top svg {
    width: 18px;
    height: 18px;
  }
}

/* ==================== 客服聊天窗口 ==================== */
/* 客服按钮 */
.chat-widget-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;  /* 右下角 */
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--maersk-primary), var(--maersk-dark));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 36, 61, 0.3);
  transition: all 0.3s ease;
  z-index: 100;
}

.chat-widget-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(0, 36, 61, 0.4);
}

.chat-widget-btn svg {
  width: 26px;
  height: 26px;
}

.chat-widget-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 聊天窗口 */
.chat-widget {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  height: 100vh;
  background: white;
  border-radius: 0;
  box-shadow: -4px 0 30px rgba(0, 36, 61, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition: all 0.3s ease;
  z-index: 101;
  overflow: hidden;
}

.chat-widget.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* 聊天头部 */
.chat-header {
  background: linear-gradient(135deg, var(--maersk-primary), var(--maersk-dark));
  color: white;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-avatar {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar svg {
  width: 26px;
  height: 26px;
}

.chat-header-text h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.chat-header-text p {
  font-size: 13px;
  opacity: 0.85;
  margin: 4px 0 0;
}

.chat-close-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chat-close-btn svg {
  width: 18px;
  height: 18px;
}

/* 聊天消息区 */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  min-height: 0; /* 让 flex 子元素可以缩小 */
}

/* 消息气泡 */
.chat-message {
  display: flex;
  gap: 12px;
  max-width: 90%;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--maersk-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-message-avatar svg {
  width: 20px;
  height: 20px;
}

.chat-message.user .chat-message-avatar {
  background: #64748b;
}

.chat-message-content {
  background: white;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chat-message-content a {
  color: var(--maersk-light);
  text-decoration: underline;
}

.chat-message-content a:hover {
  color: var(--maersk-primary);
}

.chat-message.bot .chat-message-content {
  border-bottom-left-radius: 6px;
}

.chat-message.user .chat-message-content {
  background: var(--maersk-primary);
  color: white;
  border-bottom-right-radius: 6px;
}

/* 快捷问题按钮 */
.chat-quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.chat-quick-btn {
  background: var(--maersk-sky);
  color: var(--maersk-primary);
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-quick-btn:hover {
  background: var(--maersk-light);
  color: white;
  transform: translateY(-1px);
}

/* 联系卡片 */
.chat-contact-card {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: 14px;
  padding: 18px;
  margin-top: 12px;
}

.chat-contact-card h5 {
  font-size: 15px;
  font-weight: 600;
  color: var(--maersk-dark);
  margin: 0 0 14px;
}

.chat-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  color: #334155;
}

.chat-contact-item svg {
  width: 20px;
  height: 20px;
  color: var(--maersk-primary);
  flex-shrink: 0;
}

.chat-qrcode {
  text-align: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #bae6fd;
}

.chat-qrcode img {
  width: 130px;
  height: 130px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: white;
  padding: 4px;
}

.chat-qrcode p {
  font-size: 13px;
  color: #64748b;
  margin: 10px 0 0;
}

/* 输入区域 */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
  background: white;
}

.chat-input {
  flex: 1;
  padding: 14px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.chat-input:focus {
  border-color: var(--maersk-light);
  box-shadow: 0 0 0 3px rgba(66, 180, 230, 0.1);
}

.chat-input::placeholder {
  color: #94a3b8;
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  background: var(--maersk-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--maersk-dark);
  transform: scale(1.05);
}

.chat-send-btn svg {
  width: 22px;
  height: 22px;
}

/* 打字动画 */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .chat-widget-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }

  .chat-widget-btn svg {
    width: 24px;
    height: 24px;
  }

  .chat-widget {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .chat-header {
    padding: 16px 18px;
  }

  .chat-avatar {
    width: 40px;
    height: 40px;
  }

  .chat-header-text h4 {
    font-size: 15px;
  }

  .chat-messages {
    padding: 16px;
    gap: 14px;
  }

  .chat-message-content {
    padding: 12px 14px;
    font-size: 14px;
  }

  .chat-quick-questions {
    gap: 8px;
  }

  .chat-quick-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .chat-contact-card {
    padding: 14px;
  }

  .chat-qrcode img {
    width: 110px;
    height: 110px;
  }

  .chat-input-area {
    padding: 14px 16px;
  }

  .chat-input {
    padding: 12px 16px;
    font-size: 14px;
  }

  .chat-send-btn {
    width: 44px;
    height: 44px;
  }
}

/* ==================== 微信二维码悬停样式 ==================== */
.wechat-qrcode-wrapper {
  position: relative;
  display: inline-block;
}
.wechat-qrcode-popup {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  display: none !important;
  z-index: 50;
  min-width: 160px;
}
.wechat-qrcode-wrapper:hover .wechat-qrcode-popup {
  display: block !important;
}
.wechat-qrcode-popup img {
  width: 140px;
  height: 140px;
}
.wechat-qrcode-popup p {
  white-space: nowrap;
}
.wechat-qrcode-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}
