* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #f5f7fa; color: #333; font-size: 14px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 22px; font-weight: bold; color: #2f80ed; }
.nav { display: flex; gap: 30px; }
.nav a { color: #666; font-size: 15px; transition: color 0.2s; }
.nav a:hover, .nav a.active { color: #2f80ed; }
.user-info { display: flex; align-items: center; gap: 15px; }
.user-info a { color: #666; font-size: 14px; }
.user-info a:hover { color: #2f80ed; }

/* Buttons */
.btn { display: inline-block; padding: 8px 20px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; transition: all 0.2s; text-align: center; }
.btn-primary { background: #2f80ed; color: #fff; }
.btn-primary:hover { background: #1a6fd1; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #389e0d; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #d9363e; }
.btn-warning { background: #faad14; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; padding: 12px; font-size: 16px; }

/* Cards */
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; color: #1a1a1a; }

/* Form */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; color: #555; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; }
.form-input:focus { outline: none; border-color: #2f80ed; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.table th { background: #fafafa; font-weight: 600; color: #666; font-size: 13px; }
.table tr:hover { background: #fafafa; }
.table img { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.product-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: transform 0.2s, box-shadow 0.2s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.product-card img { width: 100%; height: 200px; object-fit: cover; }
.product-card .info { padding: 16px; }
.product-card .name { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: #1a1a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card .desc { color: #999; font-size: 13px; margin-bottom: 12px; height: 40px; overflow: hidden; }
.product-card .bottom { display: flex; justify-content: space-between; align-items: center; }
.product-card .price { color: #ff4d4f; font-size: 18px; font-weight: bold; }
.product-card .price::before { content: '¥'; font-size: 14px; }

/* Status */
.status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.status-0 { background: #fff2e8; color: #fa8c16; }
.status-1 { background: #e6f7ff; color: #1890ff; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-3 { background: #f0f0f0; color: #666; }
.status-4 { background: #fff1f0; color: #ff4d4f; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.pagination a { padding: 6px 14px; border-radius: 6px; background: #fff; color: #666; border: 1px solid #e8e8e8; }
.pagination a:hover, .pagination a.active { background: #2f80ed; color: #fff; border-color: #2f80ed; }

/* Admin Layout */
.admin-body { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: 20px; font-size: 18px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar .menu { padding: 10px 0; }
.sidebar .menu a { display: block; padding: 14px 24px; color: rgba(255,255,255,0.7); transition: all 0.2s; }
.sidebar .menu a:hover, .sidebar .menu a.active { background: #1890ff; color: #fff; }
.sidebar .menu i { margin-right: 10px; width: 16px; display: inline-block; }
.main-content { margin-left: 220px; flex: 1; }
.topbar { background: #fff; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.content { padding: 24px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.stat-card .title { color: #999; font-size: 14px; margin-bottom: 8px; }
.stat-card .num { font-size: 28px; font-weight: bold; color: #1a1a1a; }

/* Cart */
.cart-item { display: flex; align-items: center; padding: 16px; border-bottom: 1px solid #f0f0f0; gap: 16px; }
.cart-item img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; }
.cart-item .info { flex: 1; }
.cart-item .name { font-weight: 600; margin-bottom: 4px; }
.cart-item .price { color: #ff4d4f; font-weight: bold; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-control button { width: 32px; height: 32px; border: 1px solid #d9d9d9; background: #fff; border-radius: 6px; cursor: pointer; }
.qty-control input { width: 50px; text-align: center; border: 1px solid #d9d9d9; border-radius: 6px; height: 32px; }

/* Login */
.login-box { max-width: 400px; margin: 80px auto; }
.login-box .card { padding: 40px; }
.login-box h2 { text-align: center; margin-bottom: 30px; color: #1a1a1a; }
.login-box .links { text-align: center; margin-top: 16px; color: #999; }
.login-box .links a { color: #2f80ed; }

/* Footer */
.footer { background: #fff; padding: 30px 0; text-align: center; color: #999; margin-top: 40px; border-top: 1px solid #f0f0f0; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .admin-body { flex-direction: column; }
    .main-content { margin-left: 0; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .nav { display: none; }
}
