* {
    margin: 0;
    padding: 0;
}
.feedback-message {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.feedback-message.success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.feedback-message.error {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* 按钮基础样式 */
.btn-edit,
.btn-reset,
.btn-toggle,
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    min-width: 80px;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 编辑按钮 */
.btn-edit {
    background: #3498db;
    color: white;
    border: 1px solid #2980b9;
}

.btn-edit:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.btn-edit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

/* 重置按钮 */
.btn-reset {
    background: #9b59b6;
    color: white;
    border: 1px solid #8e44ad;
}

.btn-reset:hover {
    background: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(155, 89, 182, 0.2);
}

.btn-reset:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.2);
}

/* 切换状态按钮 */
.btn-toggle {
    background: #f39c12;
    color: white;
    border: 1px solid #d35400;
}

.btn-toggle:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.2);
}

.btn-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.2);
}

/* 删除按钮 */
.btn-delete {
    background: #e74c3c;
    color: white;
    border: 1px solid #c0392b;
}

.btn-delete:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
}

.btn-delete:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

/* 禁用状态 */
.btn-edit:disabled,
.btn-reset:disabled,
.btn-toggle:disabled,
.btn-delete:disabled {
    background: #bdc3c7;
    border-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 按钮组样式 */
.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 响应式处理 */
@media (max-width: 768px) {
    .btn-edit,
    .btn-reset,
    .btn-toggle,
    .btn-delete {
        padding: 0.4rem 0.8rem;
        min-width: 60px;
        font-size: 0.8rem;
    }
    
    .actions {
        gap: 0.3rem;
    }
}

/* 动画效果 */
@keyframes button-pulse {
    0% {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

.btn-edit:focus,
.btn-reset:focus,
.btn-toggle:focus,
.btn-delete:focus {
    animation: button-pulse 1s ease-in-out infinite;
    outline: none;
}

.admin-login-page {
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.admin-login-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.admin-login-form .form-group {
    margin-bottom: 20px;
}

.admin-login-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
}

.admin-login-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn-login:hover {
    background: #45a049;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer a {
    color: #666;
    text-decoration: none;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* Admin Dashboard Layout */
.admin-dashboard {
    padding: 2rem;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.current-time {
    color: #7f8c8d;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.stat-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
}

.stat-link:hover {
    text-decoration: underline;
}

/* Dashboard Sections */
.dashboard-sections {
    display: grid;
    gap: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
}

.view-all {
    color: #3498db;
    text-decoration: none;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.status-pending {
    background: #ffeaa7;
    color: #d35400;
}

.status-paid {
    background: #55efc4;
    color: #00b894;
}

.status-shipped {
    background: #74b9ff;
    color: #0984e3;
}

.status-completed {
    background: #a8e6cf;
    color: #1b8a6b;
}

.status-cancelled {
    background: #fab1a0;
    color: #d63031;
}

/* Product Grid in Dashboard */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
}

.product-info h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.category {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stock {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}


/* Admin Nav Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-nav {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-logo {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.admin-logo h1 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

.admin-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-menu li {
    margin: 0;
}

.admin-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.admin-menu a:hover {
    background: #34495e;
    padding-left: 2rem;
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    background: #f5f6fa;
    min-height: 100vh;
}

/* Responsive Nav */
@media (max-width: 768px) {
    .admin-nav {
        width: 100%;
        height: auto;
        position: relative;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-container {
        flex-direction: column;
    }
}

/* products */
.products-management {
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-add-new {
    padding: 0.75rem 1.5rem;
    background: #2ecc71;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-add-new:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.products-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table th,
.products-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.products-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
}

.btn-delete:hover {
    background: #c0392b;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem !important;
}

@media (max-width: 768px) {
    .products-table {
        min-width: 800px;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-add-new {
        width: 100%;
        text-align: center;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    font-size: 1.5rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 表单输入框滚动样式 */
.form-group textarea {
    max-height: 200px; /* 最大高度限制 */
    overflow-y: auto; /* 垂直方向自动滚动 */
    scrollbar-width: thin; /* Firefox滚动条样式 */
    scrollbar-color: #bdc3c7 #f5f5f5; /* Firefox滚动条颜色 */
    scroll-behavior: smooth; /* 平滑滚动 */
}

/* Webkit浏览器的滚动条样式 */
.form-group textarea::-webkit-scrollbar {
    width: 8px;
}

.form-group textarea::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.form-group textarea::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.form-group textarea::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 其他可能需要滚动的输入框 */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"] {
    max-height: 38px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #bdc3c7 #f5f5f5;
}

/* 表单整体最大高度和滚动 */
.modal-body {
    max-height: calc(100vh - 200px); /* 减去头部和边距的高度 */
    overflow-y: auto;
    padding-right: 1rem; /* 为滚动条预留空间 */
}

/* 表单模态框滚动条样式 */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 确保模态框内容不会溢出 */
.modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.image-preview,
.current-image {
    margin-top: 1rem;
    max-width: 200px;
}

.image-preview img,
.current-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.btn-submit {
    width: 100%;
    padding: 0.75rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.btn-submit:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* categories */
.categories-management {
    padding: 2rem;
}

.categories-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.categories-table {
    width: 100%;
    border-collapse: collapse;
}

.categories-table th,
.categories-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.categories-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

/* Orders Management Styles */
.orders-management {
    padding: 2rem;
}

/* Header Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.75rem;
    color: #2c3e50;
    margin: 0;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filters select {
    padding: 0.5rem 1rem;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #2c3e50;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Orders Table Styles */
.orders-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
    /* 确保响应式时可以横向滚动 */
}

.orders-table th,
.orders-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.orders-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

/* Status Badge Styles */
.status-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-pending {
    background: #ffeaa7;
    color: #d35400;
}

.status-paid {
    background: #55efc4;
    color: #00b894;
}

.status-shipped {
    background: #74b9ff;
    color: #0984e3;
}

.status-completed {
    background: #a8e6cf;
    color: #1b8a6b;
}

.status-cancelled {
    background: #fab1a0;
    color: #d63031;
}

/* Button Styles */
.btn-view{
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    margin-right: 0.5rem;
}

.btn-view {
    background: #6c5ce7;
    color: white;
}

.btn-view:hover {
    background: #5f48e6;
}

/* Order Details Modal Styles */
.order-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.order-info p {
    margin: 0.5rem 0;
    color: #2c3e50;
}

.order-info strong {
    color: #34495e;
    margin-right: 0.5rem;
}

.order-items h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.items-table th,
.items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ecf0f1;
    text-align: left;
}

.items-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

/* Update Status Form Styles */
#updateStatusForm .form-group {
    margin-bottom: 1.5rem;
}

#updateStatusForm select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 1rem;
    color: #2c3e50;
    background-color: white;
    transition: all 0.3s ease;
}

#updateStatusForm select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .orders-management {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .filters {
        width: 100%;
    }

    .filters select {
        width: 100%;
    }


    .orders-table td {
        padding: 0.75rem;
    }

    .order-info {
        padding: 1rem;
    }
}

/* Error Message Styles */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

/* No Data Message Style */
.no-data {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

/* No Data Message Styles */
.no-data-row .no-data {
    text-align: center;
    padding: 3rem !important;
    color: #7f8c8d;
    font-size: 1rem;
    background: #f8f9fa;
}

/* 添加一个简单的过渡效果 */
.orders-table tbody tr {
    transition: all 0.3s ease;
}

/* Users Management Styles */
.users-management {
    padding: 2rem;
}

/* Header Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.75rem;
    color: #2c3e50;
    margin: 0;
}

.btn-add-new {
    padding: 0.75rem 1.5rem;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-add-new:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

/* Users Table Styles */
.users-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.users-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

/* Status Badge Styles */
.status-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background: #a8e6cf;
    color: #1b8a6b;
}

.status-inactive {
    background: #fab1a0;
    color: #d63031;
}

/* Action Buttons Styles */
.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-reset {
    background: #9b59b6;
}

.btn-reset:hover {
    background: #8e44ad;
}

.btn-disable {
    background: #e74c3c;
}

.btn-disable:hover {
    background: #c0392b;
}

.btn-enable {
    background: #27ae60;
}

.btn-enable:hover {
    background: #219a52;
}

/* Form Styles */
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #7f8c8d;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .users-management {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-add-new {
        width: 100%;
        text-align: center;
    }
    
    .actions {
        flex-wrap: wrap;
    }
    
    .actions button {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
}

/* Error Message Styles */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

/* No Data Message Style */
.no-data {
    text-align: center;
    padding: 3rem !important;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
}