/* ============================================================
   チャイナマート - Main Stylesheet
   整合自 web_style 设计稿 + tao_23 项目
   ============================================================ */

/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Hiragino Kaku Gothic Pro', 'Meiryo', 'Noto Sans JP', sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}
a { text-decoration: none; }
ul { list-style: none; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* --- Top Bar --- */
.top-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white; padding: 8px 0; font-size: 13px;
}
.top-bar-content { display: flex; justify-content: space-between; align-items: center; }
.exchange-rate-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  padding: 5px 15px; border-radius: 20px; font-weight: bold;
  display: flex; align-items: center; gap: 8px;
}
.top-actions a { color: white; text-decoration: none; margin-left: 15px; }
.top-actions a:hover { opacity: 0.8; }

/* --- Header --- */
header {
  background: white; box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  position: sticky; top: 0; z-index: 1000;
}
.header-content { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 45px; height: 45px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: white;
}
.logo-text {
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.search-bar { flex: 1; max-width: 550px; margin: 0 30px; }
.search-form {
  display: flex; background: #f1f5f9; border-radius: 50px; padding: 5px;
  border: 2px solid transparent; transition: all 0.3s;
}
.search-form:focus-within { border-color: #3b82f6; background: white; }
.search-select {
  padding: 12px 15px; border: none; background: transparent;
  font-size: 14px; color: #64748b; border-right: 1px solid #e2e8f0;
}
.search-input {
  flex: 1; padding: 12px 18px; border: none; background: transparent; font-size: 15px;
}
.search-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white; border: none; padding: 12px 28px; border-radius: 40px;
  cursor: pointer; font-weight: bold; transition: all 0.3s;
}
.search-btn:hover { transform: scale(1.03); }
.header-actions { display: flex; gap: 20px; }
.action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none; color: #64748b; font-size: 12px;
  padding: 10px 15px; border-radius: 12px; transition: all 0.3s;
}
.action-btn:hover { background: #f1f5f9; color: #3b82f6; }
.action-btn i { font-size: 22px; }
.cart-badge { position: relative; }
.cart-count {
  position: absolute; top: -5px; right: 5px; background: #ef4444;
  color: white; font-size: 11px; width: 20px; height: 20px;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: bold;
}

/* --- Navigation --- */
.main-nav { background: white; border-bottom: 1px solid #e2e8f0; }
.nav-list { display: flex; list-style: none; gap: 0; }
.nav-item a {
  display: flex; align-items: center; gap: 8px;
  padding: 15px 22px; color: #475569; text-decoration: none;
  font-size: 15px; font-weight: 500; transition: all 0.3s;
  border-bottom: 3px solid transparent;
}
.nav-item a:hover, .nav-item a.active { color: #3b82f6; border-bottom-color: #3b82f6; }

/* --- Buttons --- */
.btn {
  padding: 16px 40px; border: none; border-radius: 12px;
  font-size: 16px; font-weight: bold; cursor: pointer;
  transition: all 0.3s; display: inline-flex; align-items: center;
  gap: 10px; text-decoration: none;
}
.btn-primary { background: white; color: #667eea; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.btn-secondary { background: rgba(255,255,255,0.2); color: white; }
.btn-secondary:hover { background: rgba(255,255,255,0.3); }
.btn-large { padding: 20px 50px; font-size: 18px; border-radius: 15px; }

/* --- Section Header --- */
.section-header { text-align: center; margin-bottom: 50px; }
.section-tag {
  display: inline-block; background: #dbeafe; color: #3b82f6;
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.section-title { font-size: 36px; font-weight: 800; color: #1e293b; margin-bottom: 12px; }
.section-description { font-size: 16px; color: #64748b; max-width: 600px; margin: 0 auto; }

/* --- Page Title (internal pages) --- */
.page-title {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 50px 0; text-align: center; margin-bottom: 30px;
}
.page-title h1 { font-size: 32px; font-weight: 800; color: white; }
.page-title p { color: rgba(255,255,255,0.9); font-size: 16px; margin-top: 10px; }

/* --- Footer --- */
footer { background: #0f172a; color: white; padding-top: 80px; }
.footer-main {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px; padding-bottom: 60px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { padding-right: 40px; }
.footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.footer-logo-icon {
  width: 45px; height: 45px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; color: white;
}
.footer-logo-text { font-size: 22px; font-weight: 800; }
.footer-desc { font-size: 14px; color: #94a3b8; line-height: 1.8; margin-bottom: 25px; }
.footer-social { display: flex; gap: 12px; }
.social-link {
  width: 40px; height: 40px; background: rgba(255,255,255,0.1);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: white; font-size: 18px; transition: all 0.3s;
}
.social-link:hover { background: #3b82f6; transform: translateY(-3px); }
.footer-column h4 { font-size: 16px; font-weight: 700; margin-bottom: 25px; }
.footer-links li { margin-bottom: 15px; }
.footer-links a {
  color: #94a3b8; text-decoration: none; font-size: 14px;
  transition: all 0.3s; display: flex; align-items: center; gap: 8px;
}
.footer-links a:hover { color: #3b82f6; gap: 12px; }
.footer-contact-item {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 15px; color: #94a3b8; font-size: 14px;
}
.footer-contact-item i { color: #3b82f6; margin-top: 3px; }
.footer-bottom { padding: 30px 0; display: flex; justify-content: space-between; align-items: center; }
.footer-copyright { font-size: 13px; color: #64748b; }
.footer-links-bottom { display: flex; gap: 25px; }
.footer-links-bottom a { color: #64748b; text-decoration: none; font-size: 13px; transition: color 0.3s; }
.footer-links-bottom a:hover { color: #3b82f6; }

/* --- Product Card (shared) --- */
.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.product-card {
  background: white; border-radius: 20px; overflow: hidden;
  transition: all 0.4s; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 2px solid transparent; cursor: pointer; position: relative;
}
.product-card:hover {
  transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border-color: #3b82f6;
}
.product-badge { position: absolute; top: 15px; left: 15px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.badge { padding: 5px 12px; border-radius: 8px; font-size: 11px; font-weight: bold; color: white; }
.badge.new { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.badge.sale { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.badge.hot { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.product-image {
  height: 200px; display: flex; align-items: center;
  justify-content: center; font-size: 55px;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.platform-tag {
  position: absolute; top: 15px; right: 15px; z-index: 2;
  background: rgba(255,255,255,0.95); padding: 5px 12px; border-radius: 8px;
  font-size: 11px; font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.platform-tag.taobao { color: #ff4757; }
.platform-tag.tmall { color: #ff6b35; }
.platform-tag.x1688 { color: #ff6b6b; }
.product-content { padding: 20px; }
.product-category { font-size: 12px; color: #3b82f6; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; }
.product-title {
  font-size: 15px; font-weight: 700; margin-bottom: 12px; color: #1e293b;
  line-height: 1.5; height: 45px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.product-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.price-current { font-size: 22px; font-weight: 800; color: #ef4444; }
.price-cny { font-size: 13px; color: #94a3b8; }
.product-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; }
.rating-stars { color: #fbbf24; font-size: 13px; }
.rating-count { font-size: 12px; color: #94a3b8; }
.product-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 15px; border-top: 1px solid #f1f5f9;
}
.shop-info { font-size: 12px; color: #64748b; display: flex; align-items: center; gap: 5px; }
.shop-info i { color: #3b82f6; }
.add-cart-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white; border: none; padding: 8px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.3s; display: flex; align-items: center; gap: 6px;
}
.add-cart-btn:hover { transform: scale(1.05); }

/* --- Auth Pages (Login / Register) --- */
.auth-body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}
.auth-wrapper {
  display: flex; justify-content: center; align-items: center;
  min-height: calc(100vh - 80px); padding: 40px 20px;
}
.auth-container { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; width: 100%; max-width: 900px; margin: 0 auto; }
.auth-form-card {
  background: white; border-radius: 24px; padding: 50px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.form-title { font-size: 28px; font-weight: 800; color: #1e293b; margin-bottom: 10px; }
.form-subtitle { font-size: 15px; color: #64748b; margin-bottom: 30px; }
.form-subtitle a { color: #3b82f6; text-decoration: none; font-weight: 700; }
.form-subtitle a:hover { text-decoration: underline; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.form-group label span { color: #ef4444; }
.form-group input {
  width: 100%; padding: 14px 18px; border: 2px solid #e2e8f0;
  border-radius: 12px; font-size: 15px; transition: all 0.3s;
}
.form-group input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,0.1); }
.form-group input.error { border-color: #ef4444; }
.form-group input.success { border-color: #22c55e; }
.btn-submit {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white; border: none; border-radius: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all 0.3s; margin-top: 10px;
}
.btn-submit:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(59,130,246,0.4); }
.auth-benefits {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px); border-radius: 24px; padding: 50px; color: white;
}
.auth-benefits h2 { font-size: 28px; font-weight: 800; margin-bottom: 30px; }
.benefit-item { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 25px; }
.benefit-icon {
  width: 50px; height: 50px; background: rgba(255,255,255,0.25);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 22px; flex-shrink: 0;
}
.benefit-content h3 { font-size: 18px; margin-bottom: 8px; }
.benefit-content p { font-size: 14px; opacity: 0.9; line-height: 1.6; }
.password-group { position: relative; }
.password-group input { padding-right: 50px; }
.toggle-password {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; cursor: pointer; border: none; background: none;
  font-size: 18px; padding: 5px; transition: color 0.3s;
}
.toggle-password:hover { color: #3b82f6; }

/* --- Cart Page --- */
.cart-content { display: grid; grid-template-columns: 1fr 350px; gap: 20px; margin-bottom: 40px; }
.cart-items { background: white; border-radius: 12px; padding: 20px; }
.cart-item {
  display: flex; gap: 20px; padding: 20px 0;
  border-bottom: 1px solid #f1f5f9;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-image { width: 100px; height: 100px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-details { flex: 1; }
.cart-item-title { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 8px; display: block; }
.cart-item-sku { font-size: 13px; color: #94a3b8; margin-bottom: 10px; }
.cart-item-price-row { display: flex; align-items: center; gap: 15px; }
.cart-item-price { font-size: 18px; font-weight: 800; color: #ef4444; }
.cart-item-original { font-size: 13px; color: #94a3b8; text-decoration: line-through; }
.cart-item-qty { display: flex; align-items: center; gap: 5px; }
.qty-btn {
  width: 32px; height: 32px; border: 2px solid #e2e8f0;
  border-radius: 8px; background: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.3s;
}
.qty-btn:hover { border-color: #3b82f6; color: #3b82f6; }
.qty-input { width: 50px; text-align: center; border: 2px solid #e2e8f0; border-radius: 8px; padding: 6px; font-size: 14px; }
.cart-item-actions { display: flex; flex-direction: column; gap: 8px; }
.cart-item-actions button {
  padding: 6px 14px; border: 2px solid #e2e8f0; border-radius: 8px;
  background: white; font-size: 12px; cursor: pointer; transition: all 0.3s;
}
.cart-item-actions button:hover { border-color: #ef4444; color: #ef4444; }

/* Cart Sidebar */
.cart-sidebar { background: white; border-radius: 12px; padding: 20px; position: sticky; top: 100px; }
.cart-sidebar h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f1f5f9; }
.cart-summary-item { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 14px; color: #64748b; }
.cart-summary-total { display: flex; justify-content: space-between; padding-top: 15px; border-top: 2px solid #f1f5f9; font-size: 18px; font-weight: 800; color: #ef4444; margin-bottom: 20px; }
.cart-checkout-btn {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all 0.3s;
}
.cart-checkout-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(59,130,246,0.4); }
.cart-empty { text-align: center; padding: 60px 20px; }
.cart-empty i { font-size: 64px; color: #cbd5e1; margin-bottom: 20px; }
.cart-empty h2 { font-size: 22px; color: #64748b; margin-bottom: 10px; }
.cart-empty p { color: #94a3b8; margin-bottom: 20px; }

/* --- Search/Goods List Page --- */
.search-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px 0; position: relative; overflow: hidden;
}
.search-section::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.advanced-search {
  background: white; border-radius: 20px; padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1); position: relative; z-index: 1;
}
.search-title { font-size: 24px; font-weight: 700; margin-bottom: 20px; color: #1e293b; }
.search-filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.filter-group label { display: block; font-size: 13px; font-weight: 600; color: #64748b; margin-bottom: 8px; }
.filter-group select, .filter-group input {
  width: 100%; padding: 12px 15px; border: 2px solid #e2e8f0;
  border-radius: 10px; font-size: 14px; transition: all 0.3s;
}
.filter-group select:focus, .filter-group input:focus { outline: none; border-color: #3b82f6; }
.search-actions { display: flex; gap: 15px; }
.search-keyword {
  flex: 1; padding: 14px 20px; border: 2px solid #e2e8f0;
  border-radius: 12px; font-size: 15px; transition: all 0.3s;
}
.search-keyword:focus { outline: none; border-color: #3b82f6; }
.search-submit-btn {
  padding: 14px 35px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.3s;
}
.search-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(59,130,246,0.3); }
.result-count { font-size: 14px; color: #64748b; }
.sort-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.sort-btn {
  padding: 8px 18px; border: 2px solid #e2e8f0; background: white;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.3s; color: #64748b;
}
.sort-btn:hover, .sort-btn.active { border-color: #3b82f6; background: #3b82f6; color: white; }

/* --- Responsive --- */
@media (max-width: 1200px) {
  .cart-content { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-main { grid-template-columns: repeat(2, 1fr); }
  .search-filters { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .container { padding: 0 15px; }
  .header-content { flex-direction: column; gap: 15px; padding: 12px 0; }
  .search-bar { margin: 0; width: 100%; max-width: none; }
  .search-select { display: none; }
  .main-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-item a { padding: 12px 15px; font-size: 13px; white-space: nowrap; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
  .footer-main { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; gap: 15px; text-align: center; }
  .auth-container { grid-template-columns: 1fr; }
  .auth-benefits { display: none; }
  .search-filters { grid-template-columns: 1fr; }
  .cart-content { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 24px; }
}
