* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.header { background: linear-gradient(135deg, #1a1a2e, #16213e); color: #fff; position: sticky; top: 0; z-index: 100; }
.header-content { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 20px; }
.logo { font-size: 22px; font-weight: 700; color: #fff; text-decoration: none; }
.nav { display: flex; gap: 6px; }
.nav-link { color: #ccc; text-decoration: none; padding: 8px 14px; border-radius: 6px; font-size: 14px; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }
.admin-btn { background: #e94560; color: #fff !important; }
.header-search input { padding: 8px 14px; border: none; border-radius: 20px 0 0 20px; width: 200px; outline: none; }
.header-search button { padding: 8px 14px; border: none; background: #e94560; color: #fff; border-radius: 0 20px 20px 0; cursor: pointer; }
.banner { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 60px 0; text-align: center; }
.banner-content h1 { font-size: 36px; margin-bottom: 12px; }
.btn-primary { display: inline-block; padding: 12px 32px; background: #e94560; color: #fff; border-radius: 8px; border: none; cursor: pointer; text-decoration: none; }
.btn-primary:hover { background: #d63851; }
.categories-bar { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 0; }
.category-btn { padding: 8px 20px; border: 1px solid #e0e0e0; border-radius: 20px; background: #fff; cursor: pointer; }
.category-btn.active { background: #667eea; color: #fff; border-color: #667eea; }
.products-section { padding: 40px 0; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.product-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: 0.3s; cursor: pointer; position: relative; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.product-card .product-img { width: 100%; height: 200px; object-fit: cover; }
.product-card .product-img-placeholder { width: 100%; height: 200px; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; font-size: 48px; color: rgba(255,255,255,0.3); }
.product-card .product-info { padding: 16px; }
.product-card .product-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.product-card .product-category { display: inline-block; padding: 2px 10px; background: #f0f4ff; color: #667eea; border-radius: 10px; font-size: 12px; margin-bottom: 8px; }
.product-card .product-price { font-size: 20px; font-weight: 700; color: #e94560; }
.product-card .product-price .original { font-size: 14px; color: #999; text-decoration: line-through; margin-left: 8px; font-weight: 400; }
.product-card .featured-badge { position: absolute; top: 10px; left: 10px; background: #e94560; color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; }
.product-card .status-badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 4px; font-size: 12px; }
.status-badge.on { background: #52c41a; color: #fff; }
.status-badge.off { background: #999; color: #fff; }
.admin-header { background: linear-gradient(135deg, #e94560, #1a1a2e) !important; }
.admin-container { padding: 70px 0 30px; }
.admin-page { display: none; }
.admin-page.active { display: block; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card { background: #fff; border-radius: 12px; padding: 24px; display: flex; align-items: center; gap: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.card-icon { font-size: 36px; }
.card-number { font-size: 28px; font-weight: 700; }
.card-label { font-size: 14px; color: #999; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.batch-actions { margin-left: auto; display: flex; gap: 6px; }
.table-container { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #fafafa; padding: 12px 16px; text-align: left; font-size: 13px; border-bottom: 2px solid #eee; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.data-table img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.btn-edit { background: #1890ff; color: #fff; padding: 4px 10px; border: none; border-radius: 4px; cursor: pointer; }
.btn-delete { background: #ff4d4f; color: #fff; padding: 4px 10px; border: none; border-radius: 4px; cursor: pointer; }
.btn-status { background: #faad14; color: #fff; padding: 4px 10px; border: none; border-radius: 4px; cursor: pointer; }
.btn-sm { padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; }
.btn-success { background: #52c41a; color: #fff; }
.btn-warning { background: #faad14; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-secondary { padding: 12px 24px; background: #666; color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.btn-lg { padding: 14px 40px; font-size: 18px; }
.product-form { margin-top: 20px; background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; }
.image-upload-area { border: 2px dashed #ddd; border-radius: 12px; padding: 40px; text-align: center; cursor: pointer; position: relative; }
.image-upload-area input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-preview { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.image-preview .preview-item { position: relative; width: 100px; height: 100px; }
.image-preview .preview-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.image-preview .preview-item .remove-img { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: #ff4d4f; color: #fff; border: none; cursor: pointer; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pagination button { padding: 8px 16px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; }
.pagination button.active { background: #667eea; color: #fff; }
.admin-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.admin-pagination button { padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; }
.admin-pagination button.active { background: #667eea; color: #fff; }
.footer { background: #1a1a2e; color: #999; text-align: center; padding: 20px 0; margin-top: 40px; }
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 24px; border-radius: 8px; color: #fff; z-index: 9999; }
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }

.buy-btn{display:block;width:100%;padding:10px;margin-top:10px;background:linear-gradient(135deg,#e94560,#ff6b6b);color:#fff;border:none;border-radius:8px;font-size:15px;font-weight:bold;cursor:pointer;transition:opacity .3s}.buy-btn:hover{opacity:.85}
.btn-sm{padding:4px 10px;font-size:12px;border:none;border-radius:4px;cursor:pointer;margin:2px}.btn-primary.btn-sm{background:#1890ff;color:#fff}
.data-table td:last-child{white-space:nowrap}.buy-btn{display:block;width:100%;padding:10px;margin-top:10px;background:linear-gradient(135deg,#e94560,#ff6b6b);color:#fff;border:none;border-radius:8px;font-size:15px;font-weight:bold;cursor:pointer;transition:opacity .3s}.buy-btn:hover{opacity:.85}.btn-sm{padding:4px 10px;font-size:12px;border:none;border-radius:4px;cursor:pointer;margin:2px}.btn-primary.btn-sm{background:#1890ff;color:#fff}.data-table td:last-child{white-space:nowrap}

/* Fix admin form bottom cutoff */
#page-add { min-height: 80vh; padding-bottom: 100px; }
.product-form { margin-bottom: 40px; }

.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input { width: auto; margin: 0; }
/* === v2 前端完善补丁 === */

/* 退出按钮靠右 */
.nav-link[onclick*="logout"] { margin-left: auto; }
.nav-link[onclick*="logout"]:hover { background: rgba(255,77,79,0.2); }

/* 仪表盘离线状态 */
.stat-offline { color: #ff4d4f !important; font-size: 14px !important; font-weight: normal !important; }

/* 状态彩色标签 */
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.status-pill.on, .status-pill.paid { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.status-pill.off { background: #fafafa; color: #999; border: 1px solid #d9d9d9; }
.status-pill.pending { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.status-pill.contacted { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.status-pill.done { background: #f0f5ff; color: #1a1a2e; border: 1px solid #d6e4ff; }
.status-pill.cancel { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }

/* 确认弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 9998; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease; }
.modal { background: #fff; border-radius: 12px; padding: 24px; max-width: 400px; width: 90%; box-shadow: 0 12px 40px rgba(0,0,0,0.18); animation: slideUp 0.2s ease; }
.modal h3 { margin-bottom: 12px; color: #1a1a2e; font-size: 18px; }
.modal p { color: #555; margin-bottom: 20px; line-height: 1.6; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-actions button { padding: 8px 20px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; transition: opacity 0.2s; }
.modal-actions button:hover { opacity: 0.85; }
.modal-cancel { background: #f5f5f5; color: #333; }
.modal-confirm { background: #ff4d4f; color: #fff; }
.modal-confirm.primary { background: #1890ff; }

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

/* toast 改进 */
.toast { box-shadow: 0 4px 16px rgba(0,0,0,0.12); animation: slideInRight 0.2s ease; font-size: 14px; font-weight: 500; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 移动端响应式 */
@media (max-width: 768px) {
  .header-content { flex-direction: column; align-items: stretch; gap: 10px; }
  .nav { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .nav-link { padding: 6px 10px; font-size: 12px; }
  .nav-link[onclick*="logout"] { margin-left: 0; }
  .admin-container { padding: 20px 0; }
  .dashboard-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 14px; }
  .card-icon { font-size: 24px; }
  .card-number { font-size: 20px; }
  .card-label { font-size: 12px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input, .toolbar select { width: 100%; }
  .batch-actions { margin-left: 0; justify-content: flex-end; flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
  .product-form { padding: 16px; }
  .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-header .btn-primary { width: 100%; }
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 640px; font-size: 13px; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .modal { width: 92%; padding: 20px; }
  .modal-actions button { flex: 1; }
  .toast { left: 20px; right: 20px; top: 10px; }
}

@media (max-width: 480px) {
  .dashboard-cards { grid-template-columns: 1fr; }
  .logo { font-size: 18px; }
}/* === 海外化补丁 === */

/* 法律页面样式 */
.legal-page{padding:40px 0;min-height:70vh}
.legal-page h1{color:#1a1a2e;font-size:32px;margin-bottom:8px}
.legal-page .meta{color:#999;font-size:14px;margin-bottom:30px}
.legal-page section{background:#fff;padding:24px;border-radius:12px;margin-bottom:20px;box-shadow:0 2px 8px rgba(0,0,0,.06)}
.legal-page h2{color:#e94560;font-size:20px;margin:0 0 12px;padding-bottom:8px;border-bottom:2px solid #f0f0f0}
.legal-page p{color:#333;line-height:1.8;margin:8px 0}
.legal-page ul,.legal-page ol{color:#333;line-height:1.8;margin:8px 0;padding-left:24px}
.legal-page li{margin:4px 0}
.legal-page a{color:#1890ff;text-decoration:none}
.legal-page a:hover{text-decoration:underline}
.back-link{margin-top:30px;text-align:center}
.back-link a{color:#666;font-size:14px}

/* 语言切换器 */
#lang-switcher a{transition:color .2s}
#lang-switcher a:hover{color:#e94560 !important}

/* 移动端：法律页面 */
@media (max-width:768px){
  .legal-page{padding:20px 0}
  .legal-page h1{font-size:24px}
  .legal-page h2{font-size:18px}
  .legal-page section{padding:16px}
}

/* header 多一行（语言切换器）时适配 */
@media (max-width:768px){
  .header-content{flex-wrap:wrap}
  #lang-switcher{width:100%;text-align:center;margin:8px 0 0 !important}
}

/* 整体更国际化 */
.logo{font-weight:700}
.nav-link{transition:all .2s}
.nav-link:hover{background:rgba(255,255,255,0.1)}