/* public/css/style.css */
/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

/* 布局类 */
.container {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

a,
a.text-blue-600,
a.text-green-600,
a.text-red-600,
.pagination a,
.sidebar a {
    text-decoration: none !important;
}

a:hover,
a.text-blue-600:hover,
a.text-green-600:hover,
a.text-red-600:hover,
.pagination a:hover,
.sidebar a:hover {
    text-decoration: none !important;
}

.mx-auto {
    margin-right: auto;
    margin-left: auto;
}

.min-h-screen {
    min-height: 100vh;
}

.flex {
    display: flex;
}

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

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

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

.grid {
    display: grid;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-body {
    padding: 1.25rem;
}

/* 表单样式 */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
}

/* 按钮样式 */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.3s ease;
}

.btn:hover::after {
    left: 100%;
}

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

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

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

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

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

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

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

/* 表格美化 */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.table th {
    background-color: #f8fafc;
    color: #334155;
    font-weight: 600;
    position: relative;
}

/* 行悬停效果 */
.table tbody tr:hover {
    background-color: #f1f5f9;
}

/* 隔行变色 */
.table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

/* 表格容器美化 */
.table-container {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* 操作按钮美化 */
.table a {
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.table a:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.table a.text-red-600:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.table a.text-green-600:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

/* 状态标签美化 */
.px-2.py-1.text-xs.rounded-full {
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: transform 0.2s ease;
}

.px-2.py-1.text-xs.rounded-full:hover {
    transform: scale(1.05);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .table-container {
        border: 1px solid #e5e7eb;
    }
}

/* 表单元素美化 */
.form-input {
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

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

/* 主内容区 */
.main-content {
    margin-left: 16rem;
    padding: 2rem;
}

/* 消息提示 */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
}

.alert-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* 分页样式 */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    transition: all 0.2s ease;
    justify-content: center;
}

.pagination li {
    margin-right: 0.5rem;
}

.pagination a {
    display: block;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #3b82f6;
}

.pagination a:hover:not(.active) {
    background-color: #f1f5f9;
    transform: translateY(-1px);
}

.pagination a.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* 网格布局响应式 */
.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

@media (min-width: 1024px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 响应式样式 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding-top: 1rem;
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* 文本样式 */
.text-center {
    text-align: center;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-800 {
    color: #1f2937;
}

.text-blue-600 {
    color: #2563eb;
}

.text-blue-800 {
    color: #1e40af;
}

.text-green-600 {
    color: #059669;
}

.text-red-600 {
    color: #dc2626;
}

.text-red-800 {
    color: #991b1b;
}

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

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

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

.text-xs {
    font-size: 0.75rem;
}

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

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

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

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

.mb-6 {
    margin-bottom: 1.5rem;
}

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

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

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

.whitespace-nowrap {
    white-space: nowrap;
}

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

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

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

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

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

.px-2 {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

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

.bg-gray-50 {
    background-color: #f9fafb;
}

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

.bg-white {
    background-color: #ffffff;
}

.bg-yellow-100 {
    background-color: #fef3c7;
}

.bg-yellow-800 {
    color: #92400e;
}

.bg-blue-100 {
    background-color: #dbeafe;
}

.bg-blue-800 {
    color: #1e40af;
}

.bg-green-100 {
    background-color: #dcfce7;
}

.bg-green-800 {
    color: #166534;
}

.bg-red-100 {
    background-color: #fee2e2;
}

.bg-red-800 {
    color: #b91c1c;
}

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

.min-w-full {
    min-width: 100%;
}

.h-12 {
    height: 3rem;
}

.w-12 {
    width: 3rem;
}

.text-primary {
    color: #3b82f6;
}

.hover\:underline:hover {
    text-decoration: underline;
}

.hover\:text-primary\/80:hover {
    color: rgba(59, 130, 246, 0.8);
}

.hover\:text-blue-800:hover {
    color: #1e40af;
}

.hover\:text-green-800:hover {
    color: #065f46;
}

.hover\:text-red-800:hover {
    color: #991b1b;
}

/* 加载动画 */
#loader {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
}

.loader-spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.input-group {
    display: flex;
    width: 100%;
}

.hidden {
    display: none;
}

.table-container {
    overflow-x: auto;
    width: 100%;
}

.table th, 
.table td {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .table th, .table td {
        white-space: nowrap !important;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stats-card {
    min-width: 140px;
}

.stats-card .card-body {
    padding: 1rem;
}

.stats-card .card-body h3 {
    font-size: 1.5rem;
    white-space: nowrap;
}

.stats-card .card-body p {
    white-space: nowrap;
}

.quantity-decrease,
.quantity-increase {
    width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.quantity-decrease {
    margin-right: 2px;
    background-color: #ef4444;
    color: #ffffff;
}
.quantity-increase {
    margin-left: 2px;
    background-color: #22c55e;
    color: #ffffff;
}
.quantity-decrease:hover {
    background-color: #dc2626;
}
.quantity-increase:hover {
    background-color: #16a34a;
}
.quantity-decrease:active,
.quantity-increase:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* 系统设置 */
.settings-page .settings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.settings-page .nav-pills .nav-link {
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    color: #495057;
    transition: all 0.2s;
    border: none;
    background: none;
    text-align: left;
}

.settings-page .nav-pills .nav-link:hover {
    background-color: #f8f9fa;
}

.settings-page .nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

.settings-page .settings-card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem;
    overflow: hidden;
}

.settings-page .settings-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 1rem 1.5rem;
}

.settings-page .settings-card .card-body {
    padding: 0;
}

.settings-page .settings-content {
    padding: 1.5rem;
}

.settings-page .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.settings-page .tab-pane {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .settings-page .settings-container {
        padding: 10px;
    }
    
    .settings-page .nav-pills {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
    }
    
    .settings-page .nav-pills .nav-link {
        display: inline-block;
        margin-bottom: 0;
        margin-right: 0.5rem;
        min-width: max-content;
    }
    
    .settings-page .border-end {
        border-right: none !important;
        border-bottom: 1px solid #dee2e6;
    }
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 500px;
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.login-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.login-header {
    background-color: #3b82f6;
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.login-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.login-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    padding-left: 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

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

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e5e7eb;
}

.divider span {
    padding: 0 1rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.remember-me label {
    display: flex;
    align-items: center;
    color: #4b5563;
    font-size: 0.875rem;
    cursor: pointer;
}

.remember-me input {
    margin-right: 0.5rem;
}

.remember-me a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
}

.remember-me a:hover {
    text-decoration: underline;
}

.register-link {
    text-align: center;
    margin-top: 1.5rem;
}

.register-link a {
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .login-body {
        padding: 1.5rem;
    }
    
    .login-header {
        padding: 1.25rem;
    }
    
    .login-header h3 {
        font-size: 1.25rem;
    }
}

.clear-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 16px;
    display: none;
}

.clear-btn:hover {
    color: #dc2626;
}

.search-container {
    position: relative;
}

.search-input {
    padding-right: 30px;
}

.search-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

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