/* WooCommerce 批量管理系统 - 全局样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f7fafc; color: #2d3748; font-size: 14px; line-height: 1.5; }
a { color: #667eea; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #1a202c; color: white; flex-shrink: 0; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; transition: transform 0.3s; }
.main-content { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: white; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 50; }
.page-content { padding: 24px; flex: 1; }

/* Sidebar */
.sidebar-logo { padding: 20px 20px 16px; border-bottom: 1px solid #2d3748; }
.sidebar-logo .logo-icon { font-size: 28px; }
.sidebar-logo h2 { font-size: 14px; font-weight: 700; color: #e2e8f0; margin-top: 6px; line-height: 1.3; }
.sidebar-logo p { font-size: 11px; color: #718096; margin-top: 2px; }
.sidebar-nav { padding: 12px 0; }
.nav-section { padding: 8px 16px 4px; font-size: 11px; font-weight: 600; color: #4a5568; text-transform: uppercase; letter-spacing: 0.8px; }
.nav-item { display: flex; align-items: center; padding: 10px 20px; color: #a0aec0; cursor: pointer; transition: all 0.2s; text-decoration: none; font-size: 14px; }
.nav-item:hover { background: #2d3748; color: white; text-decoration: none; }
.nav-item.active { background: #667eea; color: white; }
.nav-item .nav-icon { margin-right: 10px; font-size: 16px; width: 20px; text-align: center; }
.nav-divider { border-top: 1px solid #2d3748; margin: 8px 0; }

/* Topbar */
.topbar-title { font-size: 18px; font-weight: 600; color: #2d3748; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 34px; height: 34px; background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 14px; }
.user-name { font-weight: 500; color: #4a5568; }
.btn-logout { padding: 6px 14px; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 6px; color: #718096; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.btn-logout:hover { background: #e2e8f0; color: #4a5568; }

/* Cards */
.card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; color: #2d3748; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.stat-icon.blue { background: #ebf4ff; }
.stat-icon.green { background: #f0fff4; }
.stat-icon.orange { background: #fffaf0; }
.stat-icon.purple { background: #faf5ff; }
.stat-icon.red { background: #fff5f5; }
.stat-value { font-size: 26px; font-weight: 700; color: #2d3748; line-height: 1; }
.stat-label { font-size: 13px; color: #718096; margin-top: 4px; }
.stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up { color: #38a169; }
.stat-change.down { color: #e53e3e; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a67d8; }
.btn-success { background: #38a169; color: white; }
.btn-success:hover { background: #2f855a; }
.btn-danger { background: #e53e3e; color: white; }
.btn-danger:hover { background: #c53030; }
.btn-warning { background: #d69e2e; color: white; }
.btn-warning:hover { background: #b7791f; }
.btn-secondary { background: #e2e8f0; color: #4a5568; }
.btn-secondary:hover { background: #cbd5e0; }
.btn-outline { background: transparent; border: 1px solid #e2e8f0; color: #4a5568; }
.btn-outline:hover { background: #f7fafc; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* Tables */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: #f7fafc; padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; color: #718096; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
tbody td { padding: 12px 16px; border-bottom: 1px solid #f0f4f8; color: #4a5568; vertical-align: middle; }
tbody tr:hover { background: #f7fafc; }
tbody tr:last-child td { border-bottom: none; }

/* Forms */
.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; font-size: 13px; font-weight: 600; color: #4a5568; margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 14px; color: #2d3748; transition: border-color 0.2s; background: white; }
.form-control:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.15); }
select.form-control { cursor: pointer; }

/* Filters */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .form-control { width: auto; min-width: 140px; }

/* Badges */
.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: #c6f6d5; color: #276749; }
.badge-warning { background: #fefcbf; color: #744210; }
.badge-danger { background: #fed7d7; color: #9b2c2c; }
.badge-info { background: #bee3f8; color: #2a4365; }
.badge-secondary { background: #e2e8f0; color: #4a5568; }
.badge-purple { background: #e9d8fd; color: #553c9a; }

/* Modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: white; border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.25); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #718096; padding: 4px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: 12px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.alert-error { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.alert-warning { background: #fffbeb; color: #b7791f; border: 1px solid #fef3c7; }
.alert-info { background: #ebf8ff; color: #2a4365; border: 1px solid #bee3f8; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 20px; }
.page-btn { padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; background: white; color: #4a5568; font-size: 13px; transition: all 0.2s; }
.page-btn:hover { background: #f7fafc; }
.page-btn.active { background: #667eea; color: white; border-color: #667eea; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Ranking */
.rank-badge { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.rank-1 { background: #ffd700; color: #744210; }
.rank-2 { background: #c0c0c0; color: #4a5568; }
.rank-3 { background: #cd7f32; color: white; }
.rank-other { background: #e2e8f0; color: #718096; }

/* Loading */
.loading { display: inline-block; width: 20px; height: 20px; border: 2px solid #e2e8f0; border-top-color: #667eea; border-radius: 50%; animation: spin 0.8s linear infinite; }
.loading-overlay { position: absolute; inset: 0; background: rgba(255,255,255,0.8); display: flex; align-items: center; justify-content: center; border-radius: inherit; z-index: 10; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: #718096; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: #4a5568; margin-bottom: 8px; }

/* Copy button */
.copy-btn { cursor: pointer; padding: 2px 8px; border: 1px solid #e2e8f0; border-radius: 4px; font-size: 11px; background: #f7fafc; color: #4a5568; transition: all 0.2s; }
.copy-btn:hover { background: #667eea; color: white; border-color: #667eea; }
.copy-btn.copied { background: #38a169; color: white; border-color: #38a169; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 8px; color: white; font-size: 14px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; max-width: 320px; }
.toast-success { background: #38a169; }
.toast-error { background: #e53e3e; }
.toast-info { background: #3182ce; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-control { width: 100%; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* Date range picker */
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range span { color: #718096; font-size: 13px; }

/* Site status indicator */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.active { background: #38a169; }
.status-dot.inactive { background: #e53e3e; }

/* Progress bar */
.progress-bar { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #667eea, #764ba2); border-radius: 3px; transition: width 0.5s ease; }
