/* Prometheus 外贸商城 - 基础样式 */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s, color .3s;
}
a { text-decoration: none; transition: color .2s; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-fluid { max-width: 100%; padding: 0 24px; }

/* Top Bar */
.top-bar {
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap:wrap; }
.top-bar a { margin-left: 16px; font-size: 12px; }
.top-right { display: flex; gap: 12px; align-items: center; flex-wrap:wrap; }

/* Dropdown */
.dropdown { position: relative; display: inline-block; }
.drop-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; padding: 4px 8px; border-radius: 4px;
  font-family: inherit;
}
.dropdown-menu {
  display: none; position: absolute; right: 0; top: 100%;
  min-width: 140px; border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 1000; padding: 4px 0;
}
.dropdown-menu a {
  display: block; padding: 8px 16px; font-size: 13px;
  margin: 0; border-radius: 0;
}
.currency-dropdown .dropdown-menu {
  min-width: 100px;
  max-height: 320px;
  overflow-y: auto;
}
.dropdown:hover .dropdown-menu { display: block; }

/* Header */
.header { position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; padding: 10px 0; gap: 16px; flex-wrap:wrap; }
.logo h1 { font-size: 20px; font-weight: 800; letter-spacing: -1px; }
.logo .slogan { font-size: 11px; display: block; margin-top: -2px; }

/* Search */
.search-bar { flex: 1; max-width: 480px; margin: 0 auto; }
.search-bar form {
  display: flex; border-radius: 8px; overflow: hidden;
  border: 2px solid;
}
.search-bar input {
  flex: 1; border: none; padding: 10px 16px; font-size: 14px;
  outline: none; font-family: inherit;
}
.search-bar button {
  border: none; padding: 10px 20px; cursor: pointer; font-size: 16px;
}

/* Header Actions */
.header-actions { display: flex; gap: 16px; align-items: center; }
.header-actions a { font-size: 22px; position: relative; }
.cart-count {
  position: absolute; top: -8px; right: -8px;
  font-size: 11px; min-width: 18px; height: 18px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* Navigation */
.main-nav { border-top: 1px solid; border-bottom: 1px solid; }
.nav-list { display: flex; gap: 0; }
.nav-list a {
  display: block; padding: 8px 16px; font-size: 13px; font-weight: 500;
  transition: all .2s;
}
.nav-list a.active, .nav-list a:hover { background: rgba(0,0,0,.03); }

/* Main Content */
.main-content { min-height: 400px; padding: 24px 0; }

/* Footer */
.footer { margin-top: 48px; padding: 48px 0 0; }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
.footer-col h3 { font-size: 18px; margin-bottom: 8px; }
.footer-col h4 { font-size: 14px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { font-size: 13px; }
.social-links { display: flex; gap: 12px; margin-top: 16px; }
.social-links a { font-size: 20px; }
.subscribe-form { display: flex; }
.subscribe-form input {
  flex: 1; padding: 10px 14px; border: 1px solid; border-radius: 6px 0 0 6px;
  font-size: 13px; outline: none; font-family: inherit;
}
.subscribe-form button {
  padding: 10px 16px; border: none; border-radius: 0 6px 6px 0;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.payment-icons { display: flex; gap: 12px; font-size: 28px; }
.footer-bottom {
  margin-top: 32px; padding: 16px 0;
  font-size: 12px; text-align: center;
}

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product-card {
  border-radius: 10px; overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}
.product-card:hover { transform: translateY(-4px); }
.pc-image { position: relative; height: 240px; overflow: hidden; background:var(--bg-alt); display:flex; align-items:center; justify-content:center; }
.pc-image img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s; padding:8px; }
.product-card:hover .pc-image img { transform: scale(1.05); }
.pc-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 8px; border-radius: 4px; font-size: 11px;
}
.pc-actions {
  position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px;
  opacity: 0; transition: opacity .2s;
}
.product-card:hover .pc-actions { opacity: 1; }
.pc-actions a {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.pc-info { padding: 12px; }
.pc-category { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.pc-title { font-size: 14px; font-weight: 600; margin: 4px 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-price { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.pc-price .current { font-size: 18px; font-weight: 700; }
.pc-price .original { font-size: 13px; text-decoration: line-through; }
.pc-rating { font-size: 12px; margin-top: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 24px; border-radius: 6px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .2s; }
.btn-primary { color: #fff; }
.btn-outline { background: transparent; border: 2px solid; }
.btn-sm { padding: 6px 16px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn .fa, .btn i { font-size: 16px; }

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 4px; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid; border-radius: 6px; font-size: 14px; outline: none; transition: border-color .2s; font-family: inherit; }
.form-control:focus { border-color: var(--primary); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { appearance: none; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #f0fff4; color: #22543d; border: 1px solid #c6f6d5; }
.alert-error { background: #fff5f5; color: #9b2c2c; border: 1px solid #fed7d7; }
.alert-info { background: #ebf8ff; color: #2a4365; border: 1px solid #bee3f8; }

/* Section */
.section { margin-bottom: 32px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-header h2 { font-size: 22px; font-weight: 700; }
.section-header a { font-size: 14px; }

/* Breadcrumb */
.breadcrumb { display: flex; gap: 8px; font-size: 13px; margin-bottom: 16px; }
.breadcrumb a { }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current { font-weight: 600; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 32px; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 8px;
  border-radius: 6px; font-size: 13px;
}
.pagination .active { font-weight: 700; }

/* Empty State */
.empty-state { text-align: center; padding: 48px 16px; }
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 16px; }

/* Grid */
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.col-3 { flex: 0 0 calc(25% - 15px); }
.col-4 { flex: 0 0 calc(33.33% - 14px); }
.col-6 { flex: 0 0 calc(50% - 10px); }
.col-8 { flex: 0 0 calc(66.67% - 10px); }
.col-9 { flex: 0 0 calc(75% - 5px); }

/* ===== 图片自适应 ===== */
.gallery-main { flex:1; border-radius:10px; overflow:hidden; background:var(--bg-card); display:flex; align-items:center; justify-content:center; min-height:300px; }
.gallery-main img { width:100%; height:auto; max-height:520px; object-fit:contain; background:var(--bg-alt); padding:12px; }
.content-body { overflow:hidden; width:100%; }
.content-body img { max-width:100%; height:auto; display:block; margin:0 auto; border-radius:8px; }
.content-body table { max-width:100%; overflow:auto; display:block; }
.content-body table img { max-width:100%; height:auto; }


/* Responsive */
/* ===== 平板响应式 (≤992px) ===== */
@media (max-width: 992px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-main img { height:auto; max-height:400px; }
  .pd-gallery { flex:0 0 50% !important; }
}

/* ===== 手机横屏 (≤768px) ===== */
@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .search-bar { order: 3; width: 100%; max-width: 100%; }
  .nav-list { overflow-x: auto; }
  .nav-list a { padding: 8px 12px; font-size: 12px; white-space: nowrap; }
  .top-right .dropdown .drop-btn span { display: none; }
  .top-right { gap: 4px; }
  
  /* 商品详情页 */
  .pd-gallery { flex:0 0 100% !important; }
  .pd-info { flex:0 0 100% !important; }
  .gallery-layout { flex-direction:column-reverse; }
  .gallery-thumbs-v { flex-direction:row; overflow-x:auto; max-height:none; flex:0 0 auto; padding:6px 0; }
  .gallery-thumbs-v .thumb-v { width:50px; height:50px; flex-shrink:0; }
  .gallery-main { min-height:200px !important; }
  .gallery-main img { max-height:280px; }
  .product-detail { flex-direction:column; gap:16px; }
  .pd-title { font-size:18px !important; }
  .pd-price .current { font-size:24px !important; }
  .pd-variants .variant-option { padding:4px 8px; font-size:12px; }
  .pd-actions { flex-direction:column; gap:8px; }
  .pd-actions .btn { width:100%; justify-content:center; }
  .pc-image { height:180px !important; }
  .pc-image img { padding:4px; }
  .pd-content { padding:12px !important; }
  
  /* 结算页 */
  .row { flex-direction:column; }
  .row > div { width:100% !important; max-width:100% !important; flex:0 0 100% !important; }
  
  /* 购物车 */
  .cart-item { flex-direction:column; gap:8px; }
  
  /* 搜索 */
  .search-bar { max-width:100%; flex:0 0 100%; }
  .search-bar form { max-width:100%; }
  
  /* 首页 */
  .hero-section h1 { font-size:24px !important; }
  .hero-section p { font-size:14px !important; }
  
  /* 分类标签 */
  .cat-tabs { overflow-x:auto; flex-wrap:nowrap; }
  .cat-tab { padding:8px 12px; font-size:12px; white-space:nowrap; }
  
  /* 后台 */
  .sidebar { width:180px !important; }
  .main { margin-left:180px !important; }
  .content { padding:12px !important; }
}

/* ===== 手机竖屏 (≤480px) ===== */
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; gap: 10px; }
  .container { padding: 0 10px; }
  .gallery-main img { max-height:240px; }
  .gallery-thumbs-v .thumb-v { width:42px; height:42px; }
  .pc-image { height:200px !important; }
  .pc-image img { padding:2px; }
  .pc-info { padding:8px; }
  .pc-title { font-size:13px; }
  .pc-price .current { font-size:15px; }
  
  /* 后台 */
  .sidebar { width:50px !important; }
  .sidebar .logo span, .sidebar nav a span, .sidebar .nav-sec { display:none !important; }
  .sidebar nav a { justify-content:center; padding:10px 0; }
  .main { margin-left:50px !important; }
  .content { padding:8px !important; }
  .topbar h2 { font-size:14px; }
  .topbar .topbar-actions { gap:4px; }
  .topbar .topbar-actions a { font-size:11px; }
  
  /* 表单 */
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns:1fr !important; }
  
  /* 表格 */
  table { font-size:12px; }
  table th, table td { padding:4px 6px !important; }
}
