/* ========================================
   mobile.css - 双柱木工锯业 手机版样式
   UTF-8 | Pure CSS3 | No framework
   ======================================== */

:root {
  --primary: #1a5276;
  --primary-dark: #0e3a58;
  --secondary: #e8f4f8;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --bg: #f5f5f5;
  --white: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --header-height: 48px;
}

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

a, button, .contact-btn, .nav-link, .product-card, .news-item, .product-item, .lang-btn {
  touch-action: manipulation;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  max-width: 768px;
  margin: 0 auto;
  padding-top: var(--header-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
}

/* ========== Header ========== */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  max-width: 768px;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.mobile-header.header-hidden {
  transform: translateY(-100%);
}

.mobile-header .logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.mobile-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  background: var(--white);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  min-width: 44px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.lang-toggle:active {
  background: var(--secondary);
}

/* Hamburger button */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  padding: 0;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== Overlay ========== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========== Side Menu ========== */
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 70%;
  max-width: 320px;
  height: 100%;
  background: var(--white);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  padding: 20px;
}

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

.side-menu .menu-close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.side-menu .menu-close button {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.side-menu nav a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.side-menu nav a:active {
  color: var(--primary);
  background: var(--secondary);
}

/* ========== Carousel ========== */
.carousel {
  position: relative;
  overflow: hidden;
  background: #000;
  margin-bottom: 0;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
}

.carousel-slide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-dots span.active {
  background: var(--white);
}

/* ========== Section Titles ========== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  padding: 16px;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--primary);
  margin: 8px auto 0;
  border-radius: 2px;
}

/* ========== Product Grid ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 16px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.product-card:active {
  transform: scale(0.97);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.product-card .card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--secondary);
}

.product-card .card-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.product-card .card-body {
  padding: 10px 12px;
}

.product-card .card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== Product list detail cards ========== */
.product-list {
  padding: 0 16px 16px;
}

/* 两列产品网格 */
.product-list.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.product-list.grid-2col .product-item {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  margin-bottom: 0;
}

.product-list.grid-2col .product-item img,
.product-list.grid-2col .product-item .item-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f5f5f5;
  min-width: unset;
  height: auto;
}

.product-list.grid-2col .product-item .item-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.product-list.grid-2col .product-item .item-name,
.product-list.grid-2col .product-item span {
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.product-list.grid-2col .product-item .item-cat {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
}

/* ========== About Section ========== */
.about-section {
  padding: 0 16px 16px;
}

.about-text {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.about-text p {
  margin-bottom: 8px;
}

.about-more {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  margin-top: 8px;
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ========== News List ========== */
.news-list {
  padding: 0 16px 16px;
}

.news-list .news-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.news-list .news-item:active {
  background: var(--secondary);
}

.news-list .news-item::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 12px;
  flex-shrink: 0;
}

.news-list .news-item .news-title {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-list .news-item .news-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 12px;
  white-space: nowrap;
}

/* ========== Contact Section ========== */
.contact-section {
  padding: 0 16px 16px;
}

.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.contact-btn:active {
  background: var(--primary-dark);
}

.contact-btn .btn-icon {
  font-size: 18px;
}

.contact-info {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 16px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-light);
}

.contact-info strong {
  color: var(--text);
  display: inline-block;
  min-width: 56px;
}

/* ========== Footer ========== */
.mobile-footer {
  background: #e8e8e8;
  text-align: center;
  padding: 20px 16px 90px 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-top: 20px;
}

.mobile-footer a {
  color: var(--primary);
  text-decoration: underline;
}

.mobile-footer a:active {
  color: var(--primary-dark);
}

/* ========== Page Header ========== */
.page-title {
  background: var(--white);
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

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

/* ========== Loading placeholder ========== */
.img-loading {
  background: linear-gradient(90deg, #e8f4f8 25%, #d0e8f0 50%, #e8f4f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* ========== Utility ========== */
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.text-center { text-align: center; }

/* ========== Back to Top FAB ========== */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--primary);
  border: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

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

#back-to-top:active {
  background: rgba(255,255,255,0.75);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: scale(0.94);
}

/* ========== Preview Modal ========== */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.preview-modal.active {
  opacity: 1;
  visibility: visible;
}

.preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.preview-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 80vh;
  background: var(--white);
  border-radius: 16px 16px 0 0;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-modal.active .preview-content {
  transform: translateY(0);
}

.preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(0,0,0,0.05);
  border-radius: 50%;
  font-size: 22px;
  color: var(--text-light);
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.preview-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
  border-radius: 16px 16px 0 0;
  background: var(--secondary);
}

.preview-placeholder {
  width: 100%;
  height: 160px;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border-radius: 16px 16px 0 0;
}

.preview-body {
  padding: 16px;
}

.preview-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.preview-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.preview-desc {
  display: none;
}
