/**
 * 全局样式
 * 价格牌打印管理系统 V3.2
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
    background: #F5F7FA;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* 主色调 */
:root {
    --primary: #1E88E5;
    --primary-dark: #1565C0;
    --primary-light: #42A5F5;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --gray-bg: #F5F7FA;
    --gray-border: #E0E0E0;
    --gray-text: #666;
    --gray-light: #999;
}

/* 通用样式 */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
    font-family: inherit;
}

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

input, select, textarea {
    font-family: inherit;
    font-size: 14px;
}

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

.table th {
    padding: 12px 16px;
    background: var(--gray-bg);
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-text);
    text-align: left;
    border-bottom: 1px solid var(--gray-border);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.table tr:hover {
    background: #F9FAFB;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #43A047;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #D32F2F;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-border);
    color: var(--gray-text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-label .required {
    color: var(--danger);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-control:disabled {
    background: var(--gray-bg);
    color: var(--gray-light);
}

.form-control.error {
    border-color: var(--danger);
}

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

.form-hint {
    color: var(--gray-light);
    font-size: 12px;
    margin-top: 4px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.card-body {
    padding: 20px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: #E3F2FD;
    color: var(--primary);
}

.badge-success {
    background: #E8F5E9;
    color: var(--success);
}

.badge-warning {
    background: #FFF3E0;
    color: var(--warning);
}

.badge-danger {
    background: #FFEBEE;
    color: var(--danger);
}

/* 提示消息 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-info {
    background: #E3F2FD;
    color: var(--primary);
    border: 1px solid #90CAF9;
}

.alert-success {
    background: #E8F5E9;
    color: var(--success);
    border: 1px solid #A5D6A7;
}

.alert-warning {
    background: #FFF3E0;
    color: var(--warning);
    border: 1px solid #FFCC80;
}

.alert-danger {
    background: #FFEBEE;
    color: var(--danger);
    border: 1px solid #EF9A9A;
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px;
}

.page-item {
    list-style: none;
}

.page-link {
    display: block;
    padding: 8px 14px;
    background: white;
    border-radius: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    border: 1px solid var(--gray-border);
}

.page-link:hover {
    background: var(--gray-bg);
    text-decoration: none;
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link.disabled {
    color: var(--gray-light);
    pointer-events: none;
    background: #f5f5f5;
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--gray-bg);
    border-radius: 16px;
    font-size: 12px;
    color: var(--gray-text);
}

/* 工具类 */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-light); }

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

.bg-white { background: white; }
.bg-gray { background: var(--gray-bg); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }

/* 响应式 */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}