/* 澳通国际 - 全局样式 */

:root {
  /* 浅色主题 */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-card: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent-color: #007aff;
  --accent-hover: #0051d5;
  --border-color: #d2d2d7;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  /* 深色主题 */
  --bg-primary: #000000;
  --bg-secondary: #1d1d1f;
  --bg-card: #2d2d2f;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #86868b;
  --accent-color: #0a84ff;
  --accent-hover: #409cff;
  --border-color: #424245;
  --nav-bg: rgba(29, 29, 31, 0.8);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* 减少动画效果（无障碍支持） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 导航栏 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.nav-logo {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-logo:hover {
  color: var(--accent-color);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  font-size: 15px;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--accent-color);
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* 主题切换按钮 */
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
}

.theme-toggle:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  transform: scale(1.05);
}

/* Hero 区域 */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px 60px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, var(--accent-color) 0%, transparent 60%);
  opacity: 0.05;
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.1; }
}

.hero-content {
  max-width: 900px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 72px;
  }
  .hero-subtitle {
    font-size: 28px;
  }
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 30px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

.btn-secondary:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

/* 区域/容器 */
.section {
  padding: 80px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 40px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 18px;
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 60px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 56px;
  }
  .section-subtitle {
    font-size: 20px;
  }
}

/* 卡片 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  font-size: 48px;
  margin-bottom: 20px;
  color: var(--accent-color);
}

.card-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.card-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* 图片画廊 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 4/3;
  cursor: pointer;
  background: var(--bg-secondary); /* 占位背景色 */
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  /* 图片加载前显示占位背景 */
  background: var(--bg-secondary);
}

/* 图片加载优化 */
.gallery-item img[loading="lazy"] {
  /* 使用content-visibility优化渲染性能 */
  content-visibility: auto;
}

/* 图片骨架屏效果 */
.gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  z-index: 1;
}

.gallery-item img {
  position: relative;
  z-index: 2;
}

/* 图片加载完成后隐藏骨架屏 */
.gallery-item img.loaded {
  opacity: 1;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

.gallery-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
}

/* 表单 */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* 联系信息 */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.contact-item {
  text-align: center;
  padding: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.contact-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  box-shadow: var(--shadow);
}

.contact-icon {
  font-size: 36px;
  color: var(--accent-color);
  margin-bottom: 15px;
}

.contact-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.contact-detail {
  font-size: 16px;
  color: var(--text-secondary);
}

/* 二维码区域 */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-top: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.qr-item {
  text-align: center;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.qr-item img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 15px;
}

.qr-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

/* 页脚 */
.footer {
  background: var(--bg-secondary);
  padding: 60px 20px 30px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.footer-company {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.footer-copyright {
  font-size: 14px;
  color: var(--text-tertiary);
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

/* 滚动进度条 */
.scroll-progress {
  position: fixed;
  top: 60px;
  left: 0;
  height: 3px;
  background: var(--accent-color);
  width: 0;
  z-index: 999;
  transition: width 0.1s ease;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(-5px);
}

/* 公告列表 */
.announcement-list {
  max-width: 800px;
  margin: 40px auto;
}

.announcement-item {
  padding: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.announcement-item:hover {
  border-color: var(--accent-color);
  box-shadow: var(--shadow);
}

.announcement-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 18px;
}

/* 响应式设计 - 平板 */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px;
    gap: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: 80vh;
    padding: 80px 20px 40px;
  }

  .section {
    padding: 60px 20px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* 图片懒加载效果 */
img[data-src] {
  filter: blur(10px);
  transition: filter 0.3s ease;
}

img[data-src].loaded {
  filter: blur(0);
}

/* 淡入动画 */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 打印样式 */
@media print {
  .navbar,
  .theme-toggle,
  .back-to-top,
  .scroll-progress {
    display: none;
  }
}

/* ====================================
   玻璃拟态风格 (Glassmorphism)
   ==================================== */

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .glass-card {
  background: rgba(29, 29, 31, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-content-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 60px 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .hero-content-glass {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ====================================
   Hero 背景图样式
   ==================================== */

.hero-with-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.hero-with-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(0, 122, 255, 0.6) 0%,
    rgba(0, 81, 213, 0.8) 100%);
  z-index: 0;
}

[data-theme="dark"] .hero-with-bg::before {
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(10, 132, 255, 0.6) 100%);
}

.hero-with-bg .hero-content {
  position: relative;
  z-index: 1;
}

.hero-with-bg .hero-title,
.hero-with-bg .hero-subtitle {
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 首页 - 海运背景 */
.hero-home {
  background-image: url('../澳通网站素材/海运3.jpg');
}

/* 服务页面 - 集装箱背景 */
.hero-services {
  background-image: url('../澳通网站素材/集装箱2.jpg');
}

/* 仓库页面 - 仓库背景 */
.hero-warehouse {
  background-image: url('../澳通网站素材/仓库1.jpg');
}

/* 联系页面 - 转运背景 */
.hero-contact {
  background-image: url('../澳通网站素材/转运.jpg');
}

/* 公告页面 - 海运背景 */
.hero-announcements {
  background-image: url('../澳通网站素材/海运2.jpg');
}

/* 移动端优化 - 禁用fixed定位以提升性能 */
@media (max-width: 768px) {
  .hero-with-bg {
    background-attachment: scroll;
  }
}

/* ====================================
   卡片玻璃效果增强
   ==================================== */

.card-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .card-glass {
  background: rgba(45, 45, 47, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
