/* 收银台系统本地样式表 - 替代Tailwind CSS */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 布局系统 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr 2fr 1fr;
    }
    
    .lg\:col-span-2 {
        grid-column: span 2;
    }
    
    .lg\:col-span-1 {
        grid-column: span 1;
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Flexbox工具类 */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.space-x-2 > * + * {
    margin-left: 0.5rem;
}

.space-x-4 > * + * {
    margin-left: 1rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

/* 间距工具类 */
.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mr-1 {
    margin-right: 0.25rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mx-4 {
    margin-left: 1rem;
    margin-right: 1rem;
}

/* 颜色系统 */
.bg-white {
    background-color: white;
}

.bg-gray-100 {
    background-color: #f7fafc;
}

.bg-gray-500 {
    background-color: #a0aec0;
}

.bg-gray-600 {
    background-color: #718096;
}

.bg-gray-700 {
    background-color: #4a5568;
}

.bg-blue-500 {
    background-color: #4299e1;
}

.bg-blue-600 {
    background-color: #3182ce;
}

.bg-blue-700 {
    background-color: #2b6cb0;
}

.bg-green-500 {
    background-color: #48bb78;
}

.bg-green-700 {
    background-color: #38a169;
}

.bg-red-500 {
    background-color: #f56565;
}

.bg-red-700 {
    background-color: #e53e3e;
}

.bg-black {
    background-color: black;
}

.text-white {
    color: white;
}

.text-black {
    color: black;
}

.text-gray-500 {
    color: #a0aec0;
}

.text-gray-600 {
    color: #718096;
}

.text-gray-700 {
    color: #4a5568;
}

.text-blue-500 {
    color: #4299e1;
}

.text-blue-600 {
    color: #3182ce;
}

.text-green-500 {
    color: #48bb78;
}

.text-red-500 {
    color: #f56565;
}

/* 边框和圆角 */
.border {
    border: 1px solid #e2e8f0;
}

.border-t {
    border-top: 1px solid #e2e8f0;
}

.border-b {
    border-bottom: 1px solid #e2e8f0;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-md {
    border-radius: 0.375rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* 阴影效果 */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.hover\:shadow-lg:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 文字样式 */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-6xl {
    font-size: 3.75rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-center {
    text-align: center;
}

/* 表单元素 */
input, select, button {
    font-family: inherit;
    font-size: inherit;
}

input, select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    outline: none;
}

input:focus, select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.5);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

button:hover:not(:disabled) {
    opacity: 0.9;
}

/* 特殊组件样式 */
.product-card {
    transition: transform 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-2px);
}

.cart-item {
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.loading {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 模态框样式 */
.fixed {
    position: fixed;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.z-50 {
    z-index: 50;
}

.bg-opacity-50 {
    background-color: rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.max-w-md {
    max-width: 28rem;
}

.max-h-96 {
    max-height: 24rem;
}

.overflow-y-auto {
    overflow-y: auto;
}

.w-full {
    width: 100%;
}

.h-32 {
    height: 8rem;
}

.object-cover {
    object-fit: cover;
}

.col-span-full {
    grid-column: 1 / -1;
}

/* 响应式隐藏 */
@media (max-width: 1023px) {
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* 统一表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

table th {
    font-weight: 600;
    color: #374151;
    background-color: #f9fafb;
}

table tr:hover {
    background-color: #f9fafb;
}

/* 统一卡片标题样式 */
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1f2937;
}

/* 统一按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* 统一表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 统一空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1rem;
    color: #6b7280;
}

/* 统一文件上传区域 */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s;
}

.file-upload-area:hover {
    border-color: #3b82f6;
}

.file-upload-icon {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}