/* CarpetVault Custom Styles - 基于 stocksnap.io 风格 */

/* ===== 字体 ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');



/* ===== 深色模式 CSS 变量 ===== */
:root {
  --bg-body: #fafafa;
  --bg-card: #fff;
  --bg-nav: rgba(255,255,255,0.72);
  --bg-gray: #f3f4f6;
  --bg-hover: #f3f4f6;
  --bg-white: #fff;
  --bg-mobile-menu: #fff;
  --bg-compare: #f9fafb;
  --bg-masonry-item: #f5f5f5;
  --bg-lightbox-overlay: rgba(0,0,0,0.92);
  --text-primary: #1a1a1a;
  --text-heading: #1a1a2e;
  --text-secondary: #333;
  --text-muted: #888;
  --text-nav: #1a1a2e;
  --text-light: #fff;
  --border-color: #e5e7eb;
  --border-subtle: rgba(0,0,0,0.06);
  --border-dashed: #d1d5db;
  --border-card: #eee;
  --color-primary: #0040a0;
  --color-primary-hover: #0055c4;
  --scrollbar-thumb: #d1d5db;
  --shadow-card: rgba(0,0,0,0.04);
  --shadow-card-hover: rgba(0,0,0,0.08);
  --shadow-nav: rgba(0,0,0,0.12);
}

html.dark {
  --bg-body: #1a1a2e;
  --bg-card: #2a2a3e;
  --bg-nav: rgba(26,26,46,0.88);
  --bg-gray: #2a2a3e;
  --bg-hover: #34344a;
  --bg-white: #2a2a3e;
  --bg-mobile-menu: #222236;
  --bg-compare: #222236;
  --bg-masonry-item: #2a2a3e;
  --bg-lightbox-overlay: rgba(0,0,0,0.95);
  --text-primary: #e8e8e8;
  --text-heading: #f5f5f5;
  --text-secondary: #cccccc;
  --text-muted: #aaa;
  --text-nav: #dddddd;
  --text-light: #fff;
  --border-color: #3a3a50;
  --border-subtle: rgba(255,255,255,0.06);
  --border-dashed: #4a4a60;
  --border-card: #3a3a50;
  --scrollbar-thumb: #4a4a60;
  --shadow-card: rgba(0,0,0,0.2);
  --shadow-card-hover: rgba(0,0,0,0.35);
  --shadow-nav: rgba(0,0,0,0.3);
}
body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;

  min-height: 100vh;
}

/* ===== 导航栏 ===== */
.navbar {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ===== 瀑布流网格 ===== */
.masonry-grid {
  column-count: 4;
  column-gap: 16px;
}

@media (max-width: 1024px) {
  .masonry-grid { column-count: 3; }
}
@media (max-width: 768px) {
  .masonry-grid { column-count: 2; column-gap: 10px; }
}
@media (max-width: 480px) {
  .masonry-grid { column-count: 1; }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-masonry-item);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
}

.masonry-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
}

.masonry-item .item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  padding: 28px 14px 12px;
  pointer-events: none;
}

.masonry-item .item-overlay .overlay-series {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 2px;
}

.masonry-item .item-overlay .overlay-product {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.masonry-item .item-overlay .overlay-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
}

/* ===== 灯箱 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  background: none;
  border: none;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-info {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

/* ===== 系列卡片 ===== */
.series-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-masonry-item);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.series-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.series-card .card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 24px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
}

/* ===== 产品卡片 ===== */
.product-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px var(--shadow-card);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--shadow-card-hover);
}

.product-card .card-img {
  aspect-ratio: 4/3;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .card-img img {
  transform: scale(1.05);
}

/* ===== 上传区 ===== */
.upload-zone {
  border: 2px dashed var(--border-dashed);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  }
.upload-zone { background: var(--bg-gray); }

.upload-zone:hover, .upload-zone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.upload-zone.drag-over {
  border-style: solid;
  background: #dbeafe;
}

/* ===== 图片时间线 ===== */
.timeline-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-thumb { background: var(--bg-masonry-item);
  width: 120px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f5f5f5;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-slide-up {
  animation: slideUp 0.35s ease;
}

/* ===== 头像 ===== */
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb);
}

/* ===== 工具类 ===== */
.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
}

@media (min-width: 768px) {
  .page-container { padding: 32px 32px; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-masonry-item) 25%, var(--border-color) 50%, var(--bg-masonry-item) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* 导航栏 LOGO 动画 */
.navbar .logo-link img {
  transition: transform 0.2s ease;
  display: block;
}
.navbar .logo-link:hover img {
  transform: scale(1.08);
}

/* 导航栏 LOGO 动画 */
.navbar .logo-link img {
  transition: transform 0.2s ease;
  display: block;
}
.navbar .logo-link:hover img {
  transform: scale(1.08);
}


/* ===== 移动端导航适配 ===== */
@media (max-width: 767px) {
  .navbar .desktop-nav { display: none !important; }
  .navbar .mobile-nav { display: block !important; }
}
@media (min-width: 768px) {
  .navbar .desktop-nav { display: flex !important; }
  .navbar .mobile-nav { display: none !important; }
}
.navbar .mobile-nav { display: none; }

.desktop-nav { display: flex !important; }
.mobile-nav { display: none !important; }
@media (max-width: 767px) {
  .desktop-nav { display: none !important; }
  .mobile-nav { display: block !important; }
}

/* ===== 图片对比模式 ===== */
.compare-box { position: relative; aspect-ratio: 16/10; background: var(--bg-white); border-radius: 16px; overflow: hidden; border: 1px solid #e5e7eb; display: flex; }
.compare-pane { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-compare); overflow: hidden; }
.compare-badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px; z-index: 2; }
.compare-info { font-size: 12px; color: #6b7280; padding: 6px 8px; text-align: center; background: var(--bg-white); width: 100%; }
.compare-footer { display: flex; flex-direction: column; align-items: center; margin-top: 12px; gap: 4px; }
.compare-slider { display: none; }

/* 手机端：全屏单图 + 长按切换 */
@media (max-width: 767px) {
  .compare-box { flex-direction: column; aspect-ratio: auto; min-height: 60vh; position: relative; }
  .compare-pane { height: 100%; width: 100%; position: absolute; top: 0; left: 0; }
  #compare-left { display: none; }
  #compare-right { display: flex; }
  .compare-pane img { max-height: 100%; object-fit: contain; }
  .compare-slider { display: none; }
  display: none;
}

/* PC端：左右并列，不需要滑块 */
@media (min-width: 768px) {
  .compare-box { flex-direction: row; aspect-ratio: 16/10; }
  .compare-pane { height: 100%; }
  .compare-slider { display: none; }
  #compare-right { position: relative; }
  .compare-footer { flex-direction: row; justify-content: center; gap: 16px; }
}

.image-tag-bar { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; z-index: 5; }
.tag-btn { width: 26px; height: 26px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; background: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.tag-btn:hover { background: var(--bg-white); transform: scale(1.1); }
.tag-btn.active { background: var(--bg-white); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.tag-comment-count { font-size: 11px; color: #9ca3af; padding: 0 4px; display: flex; align-items: center; margin-left: 2px; }

.tag-filter { border: 1px solid #e5e7eb !important; }
.tag-filter.active { background: #f3f4f6 !important; font-weight: 600; }
.timeline-thumb-wrap { position: relative; flex-shrink: 0; }
.timeline-thumb-wrap .image-tag-bar { top: 0; right: 0; }
.img-comment { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--border-color); }
.img-comment:last-child { border-bottom: none; }
.image-comments { margin-top: 8px; padding: 8px; background: var(--bg-compare); border-radius: 8px; }
.img-comments-list { max-height: 150px; overflow-y: auto; }
.compare-footer { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.compare-footer .tag-btn { width: 32px; height: 32px; font-size: 16px; }

/* 药丸标记按钮 */
.pill-tag { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 2px dashed var(--border-dashed); background: #f9fafb; color: #9ca3af; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.pill-tag:hover { border-color: #9ca3af; color: #6b7280; }
.pill-tag.active { border-style: solid; }
.pill-fav.active { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.pill-conf.active { background: #dcfce7; border-color: #22c55e; color: #166534; }
.pill-sent.active { background: #dbeafe; border-color: #3b82f6; color: #1e40af; }

/* 药丸标记按钮（对比页用）*/
.pill-tag { display:inline-flex;align-items:center;gap:4px;padding:8px 16px;border-radius:22px;font-size:13px;font-weight:500;border:2px dashed #d1d5db;background:#fff;color:#9ca3af;cursor:pointer;user-select:none;white-space:nowrap;transition:all .25s cubic-bezier(.4,0,.2,1); }
.pill-tag:hover { border-color:#9ca3af;color:#6b7280;transform:translateY(-1px) scale(1.03); }
.pill-tag:active { transform:scale(.95)!important;transition:transform .1s; }
.pill-tag.active { border-style:solid;font-weight:600;box-shadow:0 2px 8px rgba(0,0,0,0.1); }
.pill-tag.active::after { content:' ✓';font-size:12px;opacity:.8; }
.pill-fav.active { background:#fef3c7;border-color:#f59e0b;color:#92400e;box-shadow:0 2px 12px rgba(245,158,11,0.25); }
.pill-conf.active { background:#dcfce7;border-color:#22c55e;color:#166534;box-shadow:0 2px 12px rgba(34,197,94,0.25); }
.pill-sent.active { background:#dbeafe;border-color:#3b82f6;color:#1e40af;box-shadow:0 2px 12px rgba(59,130,246,0.25); }
.compare-footer .pill-tag { font-size:14px;padding:10px 18px; }

/* ── 全站导航栏（苹果风覆盖旧样式）── */
.navbar {
  position: fixed !important; top: 0; left: 0; right: 0; z-index: 100;
  height: 52px !important;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: var(--bg-nav) !important;
  border-bottom: 1px solid var(--border-subtle);
}
.navbar .page-container { display: none; }
.navbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; position: relative;
}
.navbar-inner a { text-decoration: none; color: #1d1d1f; font-size: 13px; font-weight: 500; }
.navbar-inner a:hover { color: #0040a0; }
.navbar-brand { display: flex; align-items: center; }
.navbar-links { display: none; align-items: center; gap: 20px; }
.navbar-user { display: inline-flex; align-items: center; gap: 12px; }
.navbar-login-btn {
  padding: 8px 18px;
  border-radius: 20px;
  background: #0040a0;
  color: #fff !important;
  font-weight: 600;
  white-space: nowrap;
}
.navbar-login-btn:hover { background: #0055c4; color: #fff !important; }
.navbar-toggle { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-nav); padding: 4px; }
@media (min-width: 768px) {
  .navbar-links { display: flex !important; }
  .navbar-toggle { display: none; }
}
@media (max-width: 767px) {
  .navbar-links { display: none !important; }
  .navbar-toggle { display: block; }
}
.navbar-mobile-menu {
  position: absolute; top: 52px; right: 0;
  background: var(--bg-mobile-menu); border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 99; padding: 8px; min-width: 200px;
}
.navbar-mobile-menu a { display: block; padding: 10px 16px; font-size: 14px; border-radius: 8px; text-decoration: none; color: var(--text-nav); }
.navbar-mobile-menu a:hover { background: var(--bg-hover); }
.navbar-mobile-menu hr { border: none; border-top: 1px solid var(--border-color); margin: 4px 0; }
@media (max-width: 767px) {
  .navbar-inner { padding: 0 16px; }
  .navbar-mobile-menu { left: 8px; right: 8px; border-radius: 0 0 16px 16px; }
}
.page-container { padding-top: 68px; }
@media (max-width: 767px) { .page-container { padding-top: 60px; } }

/* 系列页卡片加固（不依赖 Tailwind）*/
.series-page-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .series-page-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .series-page-grid { grid-template-columns: repeat(3, 1fr); } }

/* 隐藏未处理的元素 */
.navbar-mobile-menu.hidden { display: none; }
.hidden, .tab-panel.hidden { display: none; }

/* ===== 威海海马地毯集团统一配色 ===== */
/* 主色 #0040a0 | 辅色 #0055c4 | 深色 #1a1a2e */

a { color: #0040a0; }
a:hover { color: #0055c4; }

/* 按钮主色 */
button.bg-gray-900, .bg-gray-900, [class*="bg-gray-900"] { background: #0040a0 !important; }
button.bg-gray-800, .bg-gray-800, [class*="hover:bg-gray-800"]:hover { background: #0055c4 !important; }

/* 导航栏 */
.navbar-inner a { color: var(--text-nav); }
.navbar-inner a:hover { color: var(--color-primary); }

/* 标题 */
h1, h2, h3, .section-title, .text-xl, .text-2xl, .text-3xl { color: var(--text-heading); }

/* 药丸按钮 */
.pill-fav.active { background: #fef3c7; border-color: #0040a0; color: #0040a0; box-shadow: 0 2px 12px rgba(0,64,160,0.25); }
.pill-conf.active { background: #e0f0ff; border-color: #0040a0; color: #0040a0; box-shadow: 0 2px 12px rgba(0,64,160,0.25); }
.pill-sent.active { background: #d0e4ff; border-color: #0055c4; color: #0040a0; box-shadow: 0 2px 12px rgba(0,85,196,0.25); }

/* 系列卡片 */
.series-card:hover { box-shadow: 0 12px 40px rgba(0,64,160,0.15); }

/* Hero CTA */
.hero-cta { background: #0040a0; }
.hero-cta:hover { background: #FFD700; color: #1a1a2e; }
.hero h1 span { color: #0040a0; }

/* Footer */
.site-footer { background: #1a1a2e; }
.footer-brand { color: #fff; }
.footer-links h4 { color: #fff; }

/* 选中/激活态 */
.bg-blue-600 { background: #0040a0 !important; }
.text-blue-600 { color: #0040a0 !important; }
.hover\:bg-blue-700:hover { background: #0055c4 !important; }
.bg-blue-50 { background: #e0f0ff !important; }
.text-blue-700 { color: #0040a0 !important; }
.border-blue-200 { border-color: #b0d0f0 !important; }

/* 管理员紫色 → 海马蓝色 */
.bg-purple-100 { background: #e0f0ff !important; }
.text-purple-700 { color: #0040a0 !important; }
.bg-purple-600 { background: #0040a0 !important; }

/* PC：隐藏提示 */ .compare-hint { display: none; }
/* 手机：显示提示 */
@media (max-width: 767px) {
  .compare-hint { display: block; position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.65); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; z-index: 10; pointer-events: none; transition: all 0.2s; }
}
html { scroll-behavior: smooth; scroll-padding-top: 68px; }
.compare-box { -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; }
.compare-box div[style*="background"] { pointer-events:none; }


/* ===== 深色模式文字兜底 ===== */
html.dark { color: var(--text-primary); }
html.dark p, html.dark span, html.dark li, html.dark td, html.dark th, html.dark label, html.dark div:not(.lightbox):not(.lightbox-info):not(.masonry-item):not(.item-overlay) { color: var(--text-primary); }
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6 { color: var(--text-heading) !important; }
html.dark a:not(.navbar-link):not(.read-more):not(.cta-button):not(.navbar-login-btn) { color: #6b9fff; }
html.dark .text-muted, html.dark .text-gray-400, html.dark .text-gray-500, html.dark .text-gray-300 { color: var(--text-muted) !important; }
html.dark .text-gray-600, html.dark .text-gray-700 { color: var(--text-secondary) !important; }

/* ===== 深色模式 - Tailwind 类覆盖 ===== */
html.dark body { background: var(--bg-body) !important; }
html.dark .bg-white, html.dark .bg-\[#fff\], html.dark .bg-card { background: var(--bg-card) !important; }
html.dark .text-gray-900, html.dark .text-gray-800, html.dark .text-gray-700 { color: var(--text-heading) !important; }
html.dark .text-gray-600, html.dark .text-gray-500, html.dark .text-gray-400 { color: var(--text-muted) !important; }
html.dark .border-gray-100, html.dark .border-gray-200, html.dark .border-gray-300 { border-color: var(--border-color) !important; }
html.dark .bg-gray-50, html.dark .bg-gray-100 { background: var(--bg-gray) !important; }
html.dark .bg-blue-50 { background: #1a2a4a !important; }
html.dark .text-blue-600 { color: #6b9fff !important; }
html.dark .bg-green-50 { background: #1a3a1a !important; }
html.dark .text-green-600 { color: #6bff6b !important; }
html.dark .bg-red-50 { background: #3a1a1a !important; }
html.dark .text-red-500, html.dark .text-red-600 { color: #ff6b6b !important; }
html.dark .bg-indigo-50 { background: #1a1a3a !important; }
html.dark .text-indigo-600 { color: #6b9fff !important; }
html.dark input, html.dark select, html.dark textarea { background: var(--bg-card) !important; color: var(--text-primary) !important; border-color: var(--border-color) !important; }
html.dark .skeleton { background: linear-gradient(90deg, var(--bg-masonry-item) 25%, var(--border-color) 50%, var(--bg-masonry-item) 75%) !important; }
html.dark .hover\:shadow-lg:hover, html.dark .hover\:shadow-xl:hover { box-shadow: 0 8px 25px var(--shadow-card-hover) !important; }
html.dark .shadow-sm, html.dark .shadow, html.dark .shadow-md { box-shadow: 0 1px 3px var(--shadow-card) !important; }
html.dark .divide-gray-100 > *, html.dark .divide-gray-200 > * { border-color: var(--border-color) !important; }
html.dark hr { border-color: var(--border-color) !important; }
html.dark .text-\[#0040a0\] { color: #6b9fff !important; }
html.dark .bg-\[#fafafa\] { background: var(--bg-body) !important; }
html.dark .bg-\[#f9fafb\] { background: var(--bg-compare) !important; }
