﻿/* Admin Dashboard Styles */
:root {
    --primary: #2C3E50;
    --accent: #E8B4B8;
    --accent-hover: #D89296;
    --light-accent: #FFF0F1;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --background: #FFFFFF;
    --background-light: #FAFAFA;
    --border: #E5E7EB;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background-light);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: var(--background-light);
}

.admin-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1001;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: var(--background-light);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    border-right: 1px solid var(--border);
    z-index: 999;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li {
    margin: 0.25rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: var(--background-light);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--light-accent);
    color: var(--primary);
    border-right: 3px solid var(--accent);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

.page-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #1A252F;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background-light);
}

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

.btn-danger {
    background: var(--error);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--light-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.view-all {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.card-content {
    padding: 1.5rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);

}
.data-table td button {
    margin: 0 0.25rem;
}

.data-table td button:first-child {
    margin-left: 0;
}

.data-table td button:last-child {
    margin-right: 0;
}
.data-table th {
    background: var(--background-light);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--background-light);
}

.data-table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-processing {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-shipped {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-delivered {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Filters Bar */
.filters-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group input,
.filter-group select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 150px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover {
    background: var(--background-light);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    background: none;
    border: none;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* File Upload */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: var(--accent);
    background: var(--light-accent);
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-text p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-text small {
    color: var(--text-secondary);
}

.upload-preview {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.preview-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.file-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.file-info {
    padding: 1rem;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.file-url {
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-all;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.show {
    display: flex;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--header-height);
    right: 1rem;
    z-index: 3000;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--info);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Top Products List */
.top-product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.top-product-item:last-child {
    border-bottom: none;
}

.top-product-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.top-product-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.top-product-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.top-product-sales {
    margin-left: auto;
    text-align: right;
}

.top-product-sales .sales {
    font-weight: 600;
    color: var(--primary);
}

.top-product-sales .revenue {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Low Stock List */
.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.stock-item:last-child {
    border-bottom: none;
}

.stock-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stock-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stock-level {
    text-align: right;
}

.stock-count {
    font-weight: 600;
    color: var(--error);
}

.stock-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
        min-width: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 0 1rem;
    }
    
    .user-name {
        display: none;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}
/* Product Image Upload */
.product-image-upload {
    margin-top: 0.5rem;
}

.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-area:hover {
    border-color: var(--accent);
    background: var(--light-accent);
}

.image-upload-area.uploading {
    border-color: var(--info);
    background: rgba(59, 130, 246, 0.05);
}

.image-upload-area.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.image-upload-area.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 2rem;
    opacity: 0.5;
}

.upload-placeholder p {
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.upload-placeholder small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.image-preview {
    position: relative;
    width: 100%;
    max-width: 200px;
}

.image-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.upload-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-progress {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.remove-image {
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.remove-image:hover {
    background: #dc2626;
}

.upload-error {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-message {
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-error button {
    background: var(--error);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
}

.upload-error button:hover {
    background: #dc2626;
}
/* Form Validation Styles */
.field-error {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.field-error.show {
    display: block;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}
.product-badge-small {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.5px;
}

.badge-hot {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: white;
}

.badge-new {
    background: linear-gradient(135deg, #4ecdc4, #44a8a0);
    color: white;
}

.badge-sale {
    background: linear-gradient(135deg, #ff9500, #ff6200);
    color: white;
}

.badge-limited {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
}

.badge-exclusive {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

/* Badge select dropdown in forms */
select[name="badge"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
}

/* Small helper text under badge select */
.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Badge column in table */
.data-table th:nth-child(8),
.data-table td:nth-child(8) {
    text-align: center;
    min-width: 80px;
}

/* Empty badge placeholder */
.product-badge-small:empty::before {
    content: '-';
    color: #999;
}

/* Specifications styles */
.spec-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.spec-name,
.spec-value {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.spec-row .btn-small {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#specificationsContainer,
#editSpecificationsContainer {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}
/* ==================== Description Editor Page ==================== */
#description-editor-page {
    padding: 0 !important;
    margin: 0 !important;
}

.editor-page-container {
    background: white;
    border-radius: 0; /* 改为 0，占满整个区域 */
    box-shadow: none; /* 移除阴影 */
    height: calc(100vh - var(--header-height)); /* 占满剩余高度 */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止双滚动条 */
}

/* Editor Header */
.editor-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, var(--light-accent), white);
    flex-shrink: 0; /* 防止被压缩 */
}

.editor-header-left,
.editor-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Editor Content */
.editor-content-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    flex: 1; /* 占据剩余空间 */
    overflow: hidden;
    min-height: 0; /* 重要：允许子元素正确处理溢出 */
}

/* Editor Sidebar */
.editor-sidebar {
    background: var(--background-light);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
}

/* Editor Main */
.editor-main {
    padding: 2rem;
    overflow-y: auto;
    background: white;
    display: flex;
    flex-direction: column;
}

#descriptionEditor {
    flex: 1; /* 占据剩余空间 */
    display: flex;
    flex-direction: column;
}

/* Quill Editor Customization */
.ql-toolbar {
    border: 1px solid var(--border) !important;
    border-radius: 8px 8px 0 0 !important;
    background: var(--background-light) !important;
    padding: 1rem !important;
    flex-shrink: 0; /* 防止工具栏被压缩 */
}

.ql-container {
    border: 1px solid var(--border) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    font-size: 1rem !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    flex: 1; /* 占据剩余空间 */
    display: flex;
    flex-direction: column;
}

.ql-editor {
    flex: 1; /* 占据剩余空间 */
    padding: 2rem !important;
    line-height: 1.8 !important;
    overflow-y: auto !important; /* 确保可滚动 */
    min-height: 0 !important; /* 允许正确缩小 */
}

.ql-toolbar button:hover {
    background: white !important;
}

.ql-toolbar button.ql-active {
    background: var(--accent) !important;
    color: white !important;
}

/* Auto-save Indicator */
.autosave-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.autosave-indicator.show {
    display: flex;
}

.autosave-text::before {
    content: '✓';
    margin-right: 0.5rem;
    font-weight: bold;
}

/* Description Preview in Form */
.description-preview-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.description-preview {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--background-light);
    min-height: 80px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.description-preview.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.description-preview .placeholder-text {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}

.description-preview p {
    margin: 0;
    color: var(--text-primary);
}

.btn-edit-description {
    align-self: flex-start;
}

/* Preview Modal */
.modal-large {
    max-width: 900px;
}

.preview-content {
    padding: 2rem;
    background: var(--background-light);
    border-radius: 8px;
    min-height: 300px;
    line-height: 1.8;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.preview-content h1,
.preview-content h2,
.preview-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.preview-content p {
    margin-bottom: 1rem;
}

.preview-content ul,
.preview-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.preview-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive Design for Editor */
@media (max-width: 1024px) {
    .editor-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .editor-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 200px;
    }
    
    .editor-tips,
    .editor-stats {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .editor-header-right {
        width: 100%;
        justify-content: flex-end;
    }
    
    .editor-main {
        padding: 1rem;
    }
    
    .ql-editor {
        padding: 1rem !important;
    }
}
.product-images-upload {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-upload-trigger {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background-light);
}

.image-upload-trigger:hover {
    border-color: var(--accent);
    background: var(--light-accent);
}

.image-upload-trigger .upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.image-upload-trigger p {
    font-weight: 500;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.image-upload-trigger small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-item {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
}

.image-item.primary {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.2);
}

.image-item:hover {
    box-shadow: var(--shadow-md);
}

.image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-item:hover .image-item-overlay {
    opacity: 1;
}

.image-item-actions {
    display: flex;
    gap: 0.5rem;
}

.image-item-actions button {
    background: white;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.image-item-actions button:hover {
    transform: scale(1.05);
}

.btn-set-primary {
    background: var(--accent) !important;
    color: white !important;
}

.btn-remove-image {
    background: var(--error) !important;
    color: white !important;
}

.image-item-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.upload-progress-bar {
    width: 80%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.upload-status-text {
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

.primary-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
}

.image-order {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
}

.alt-text-input {
    width: 100%;
    padding: 0.5rem;
    border: none;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    outline: none;
}

.alt-text-input:focus {
    background: var(--light-accent);
}

.images-list-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}
/* ==================== 移动端优化补充样式 ==================== */
/* 添加到 admin1.css 文件末尾 */

/* 移动端表格卡片样式 */
.mobile-card-list {
    display: none;
}

.mobile-data-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--accent);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.mobile-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.mobile-card-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.mobile-card-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.mobile-card-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.mobile-card-footer .btn-small {
    flex: 1;
    min-width: 70px;
}


/* 移动端优化按钮 */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    .btn-small {
        min-height: 36px;
        padding: 0.5rem 1rem;
    }
}

/* 平板和手机端布局 */
@media (max-width: 1024px) {
    /* Header调整 */
    .admin-header {
        padding: 0 1rem;
    }

    /* 侧边栏始终收起 */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    /* 主内容区域 */
    .main-content {
        margin-left: 0;
    }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }

    /* Dashboard网格 */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* 过滤栏 */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group input,
    .filter-group select {
        width: 100%;
        min-width: auto;
    }
}

/* 手机端布局 (768px以下) */
@media (max-width: 768px) {
    /* Header */
    .admin-header {
        height: 60px;
        padding: 0 0.75rem;
    }

    .admin-logo {
        font-size: 1.25rem;
    }

    .user-name {
        display: none;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* 主内容区域 */
    .main-content {
        margin-top: 60px;
        padding: 1rem;
    }

    /* 页面头部 */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    /* 隐藏桌面表格 */
    .table-container .data-table {
        display: none;
    }

    /* 显示移动端卡片 */
    .mobile-card-list {
        display: block;
    }

    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .pagination button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* 模态窗 */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 0.5rem;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-header h3 {
        font-size: 1.15rem;
    }

    /* 表单 */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

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

    .form-group label {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.95rem;
        padding: 0.65rem 0.85rem;
    }

    /* 卡片 */
    .dashboard-card {
        margin-bottom: 1rem;
    }

    .card-header,
    .card-content {
        padding: 1rem;
    }

    /* 文件网格 */
    .files-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Toast通知 */
    .toast-container {
        right: 0.5rem;
        left: 0.5rem;
        top: 60px;
        max-width: none;
    }

    .toast {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    /* 上传区域 */
    .upload-area {
        padding: 1.5rem 1rem;
    }

    .upload-text p {
        font-size: 1rem;
    }

    /* 图片预览网格 */
    .upload-preview {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    /* 产品图片上传 */
    .product-images-upload {
        gap: 0.75rem;
    }

    .images-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .image-item img {
        height: 100px;
    }

    .image-item-actions button {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }

    /* 规格输入 */
    .spec-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .spec-row .btn-small {
        width: 100%;
        margin-top: 0.25rem;
    }

    /* 编辑器页面 */
    .editor-page-container {
        height: calc(100vh - 60px);
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .editor-header-right {
        width: 100%;
    }

    .editor-header-right .btn {
        flex: 1;
    }

    .editor-content-wrapper {
        grid-template-columns: 1fr;
    }

    .editor-sidebar {
        display: none;
    }

    .editor-main {
        padding: 1rem;
    }

    .ql-toolbar {
        padding: 0.75rem !important;
    }

    .ql-editor {
        padding: 1rem !important;
        min-height: 300px !important;
    }

    /* 模态窗按钮 */
    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* 侧边栏 */
    .sidebar {
        top: 60px;
        height: calc(100vh - 60px);
        width: 280px;
        z-index: 1001;
    }

    /* 侧边栏遮罩层 */
    .sidebar.show::before {
        content: '';
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: -1;
    }
}

/* 小屏手机 (480px以下) */
@media (max-width: 480px) {
    /* Header */
    .admin-header {
        height: 56px;
    }

    .admin-logo {
        font-size: 1.1rem;
    }

    .sidebar-toggle {
        font-size: 1.25rem;
        padding: 0.35rem;
    }

    /* 主内容 */
    .main-content {
        margin-top: 56px;
        padding: 0.75rem;
    }

    /* 页面头部 */
    .page-header h1 {
        font-size: 1.35rem;
    }

    /* 统计卡片 */
    .stat-card {
        padding: 0.85rem;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.15rem;
    }

    .stat-content h3 {
        font-size: 1.35rem;
    }

    .stat-content p {
        font-size: 0.85rem;
    }

    /* 移动端卡片 */
    .mobile-data-card {
        padding: 0.85rem;
    }

    .mobile-card-title {
        font-size: 0.9rem;
    }

    .mobile-card-row {
        font-size: 0.85rem;
    }

    .mobile-card-footer .btn-small {
        flex: 1;
        font-size: 0.8rem;
    }

    /* 按钮 */
    .btn {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }

    .btn-small {
        font-size: 0.8rem;
        padding: 0.45rem 0.85rem;
    }

    /* 状态徽章 */
    .status-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.65rem;
    }

    /* 文件网格 */
    .files-grid {
        grid-template-columns: 1fr;
    }

    /* 图片列表 */
    .images-list {
        grid-template-columns: 1fr;
    }

    /* 分页 */
    .pagination button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    /* 过滤栏 */
    .filters-bar {
        padding: 1rem;
    }

    /* 模态窗 */
    .modal-content {
        margin: 0.25rem;
    }

    /* Toast */
    .toast {
        padding: 0.85rem 1.25rem;
        font-size: 0.85rem;
    }

    /* 编辑器 */
    .editor-page-container {
        height: calc(100vh - 56px);
    }

    .editor-header {
        padding: 0.85rem;
    }

    .editor-title {
        font-size: 1.25rem;
    }

    /* 表单标签 */
    .form-group label {
        font-size: 0.85rem;
    }

    /* 侧边栏 */
    .sidebar {
        top: 56px;
        height: calc(100vh - 56px);
        width: 260px;
    }

    .nav-item {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    /* 空状态 */
    .empty-state,
    .images-list-empty {
        padding: 2rem 1rem;
        font-size: 0.9rem;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding: 0.75rem;
    }

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

    .modal-content {
        max-height: 90vh;
    }

    .editor-sidebar {
        max-height: 150px;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增加可点击区域 */
    .btn,
    .action-btn,
    .nav-item {
        min-height: 44px;
    }

    /* 移除hover效果,使用active */
    .btn:active,
    .action-btn:active {
        transform: scale(0.98);
        opacity: 0.8;
    }

    /* 表格行点击区域 */
    .mobile-data-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(232, 180, 184, 0.1);
    }

    .mobile-data-card:active {
        background: var(--background-light);
    }
}

/* 防止文本选择（在移动端操作时） */
@media (max-width: 768px) {
    .mobile-card-header,
    .mobile-card-label,
    .stat-card,
    .nav-item {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* 确保图片不会溢出 */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    .data-table img {
        width: 40px;
        height: 40px;
    }
}

/* Loading优化 */
@media (max-width: 768px) {
    .loading-overlay {
        background: rgba(255, 255, 255, 0.95);
    }

    .spinner {
        width: 40px;
        height: 40px;
    }

    .loading-spinner p {
        font-size: 0.9rem;
    }
}

/* ==================== 订单详情模态窗样式 ==================== */

.modal-large {
    max-width: 900px;
}

.order-detail-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.order-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.order-detail-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

.detail-value small {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.products-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-list-item {
    padding: 0.75rem;
    background: var(--background-light);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-list-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.product-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.product-price {
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    font-size: 1rem;
    flex-shrink: 0;
}

/* 更新状态表单样式 */
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 移动端订单详情优化 */
@media (max-width: 768px) {
    .modal-large {
        max-width: none;
        width: 95%;
        margin: 0.5rem;
    }

    .order-detail-section h4 {
        font-size: 1rem;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 1rem;
    }

    .detail-label {
        font-size: 0.85rem;
    }

    .detail-value {
        text-align: left;
        margin-left: 0;
        font-size: 0.95rem;
    }

    .product-list-item {
        padding: 0.65rem;
        gap: 0.65rem;
    }

    .product-list-item img {
        width: 50px;
        height: 50px;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .product-details {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .order-detail-section {
        margin-bottom: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .detail-row {
        font-size: 0.85rem;
        margin-bottom: 0.85rem;
    }

    .product-list-item {
        flex-wrap: wrap;
    }

    .product-price {
        width: 100%;
        text-align: right;
        margin-top: 0.5rem;
    }
}
/* 订单状态徽章基础样式 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    white-space: nowrap;
}

/* 支付状态样式 */
.status-badge.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.status-processing {
    background-color: #cfe2ff;
    color: #084298;
    border: 1px solid #9ec5fe;
}

.status-badge.status-paid {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #a3cfbb;
}

.status-badge.status-failed {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f1aeb5;
}

.status-badge.status-refunded {
    background-color: #e7d9f5;
    color: #5a2a82;
    border: 1px solid #d4b5f0;
}

.status-badge.status-cancelled {
    background-color: #e2e3e5;
    color: #41464b;
    border: 1px solid #c6c7c9;
}

.status-badge.status-expired {
    background-color: #ffe0e0;
    color: #8b2020;
    border: 1px solid #ffb3b3;
}

/* 订单配送状态样式 */
.status-badge.status-shipped {
    background-color: #d4edff;
    color: #0066cc;
    border: 1px solid #99d6ff;
}

.status-badge.status-delivered {
    background-color: #c3f5d9;
    color: #146c43;
    border: 1px solid #8ce5b8;
}

/* 分类状态样式 (如果需要) */
.status-badge.status-active {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #a3cfbb;
}

.status-badge.status-inactive {
    background-color: #e2e3e5;
    color: #41464b;
    border: 1px solid #c6c7c9;
}

/* 悬停效果 */
.status-badge:hover {
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .status-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
}
/* ==================== 退款相关样式 ==================== */

/* 退款警告框 */
.refund-warning-box {
    background: var(--light-accent);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--error);
}

.refund-warning-box p:first-child {
    color: var(--error);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.refund-warning-box p:last-child {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* 退款金额高亮 */
.refund-amount-highlight {
    background: var(--background-light);
    font-weight: 600;
    color: var(--error) !important;
}

/* 退款确认复选框 */
.refund-confirmation-checkbox {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
}

.refund-confirmation-checkbox label {
    color: var(--error);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refund-confirmation-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
/* 退款金额输入框特殊样式 */
#refundAmount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--error);
}

#refundAmount:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 快捷链接样式 */
.form-group small a {
    text-decoration: none;
    font-weight: 500;
}

.form-group small a:hover {
    text-decoration: underline;
}
/* ==================== 订单详情退款记录样式 ==================== */

/* 退款记录容器 */
.refund-logs-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* 单个退款记录 */
.refund-log-item {
    background: var(--background-light);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.refund-log-item:hover {
    box-shadow: var(--shadow-sm);
}

.refund-log-item.success {
    border-left: 4px solid var(--success);
}

.refund-log-item.failed {
    border-left: 4px solid var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.refund-log-item.pending {
    border-left: 4px solid var(--warning);
}

/* 退款记录头部 */
.refund-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.refund-log-amount {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.refund-amount-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.refund-amount-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--error);
}

/* 退款状态徽章 */
.refund-status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.refund-status-badge.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.refund-status-badge.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.refund-status-badge.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* 退款详情行 */
.refund-log-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.refund-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.refund-detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.refund-detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* 退款汇总 */
.refund-summary {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light-accent);
    border-radius: 8px;
    border: 1px solid rgba(232, 180, 184, 0.3);
}

.refund-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.refund-summary-row:last-child {
    margin-bottom: 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(232, 180, 184, 0.3);
}

.refund-summary-label {
    color: var(--text-primary);
}

.refund-summary-value {
    color: var(--error);
    font-size: 1.1rem;
}

/* 净金额高亮 */
.detail-row .detail-value {
    transition: all 0.3s ease;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .refund-log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .refund-status-badge {
        align-self: flex-end;
    }

    .refund-amount-value {
        font-size: 1.1rem;
    }

    .refund-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .refund-detail-value {
        text-align: left;
    }

    .refund-summary-row {
        font-size: 0.9rem;
    }

    .refund-summary-value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .refund-log-item {
        padding: 0.85rem;
    }

    .refund-amount-label {
        font-size: 0.8rem;
    }

    .refund-amount-value {
        font-size: 1rem;
    }

    .refund-detail-row {
        font-size: 0.85rem;
    }

    .refund-status-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

/* 空状态 */
.no-refunds-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}
/* ==================== 管理员订单列表 - 退款信息展示（修复版）==================== */

/* 退款指示器 */
.admin-refund-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.95rem;
    animation: refundPulse 2s ease-in-out infinite;
    cursor: help;
    vertical-align: middle;
}

@keyframes refundPulse {
    0%, 100% { 
        opacity: 1;
    }
    50% { 
        opacity: 0.7;
    }
}

/* 管理员金额单元格 */
.admin-amount-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 100px;
}

.amount-original {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.amount-refunded {
    font-size: 0.85rem;
    color: var(--error);
    font-weight: 600;
}

.amount-net {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success);
}

.amount-single {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 移动端卡片退款样式 */
.mobile-data-card.has-refund-admin {
    border-left: 4px solid var(--error);
    background: linear-gradient(to right, rgba(239, 68, 68, 0.03), var(--background-light));
}

.admin-refund-badge-mobile {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.admin-refund-badge-mobile svg {
    width: 12px;
    height: 12px;
}

/* 移动端退款信息行 */
.mobile-card-row.refund-info-row {
    border-top: 1px dashed var(--border);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

.mobile-card-row.net-info-row {
    border-top: 2px solid var(--success);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    background: rgba(16, 185, 129, 0.05);
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 4px;
}

/* 退款按钮特殊样式 */
.btn-danger[title*="additional"] {
    position: relative;
}

.btn-danger[title*="additional"]::after {
    content: '+';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--warning);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 悬停效果 - 不改变布局大小 */
.data-table tbody tr:hover .admin-refund-indicator {
    opacity: 1;
    animation: none;
}

.data-table tbody tr:hover .admin-amount-cell {
    background: rgba(232, 180, 184, 0.08);
    border-radius: 4px;
}

/* 为金额单元格预留空间，避免悬停时跳动 */
.data-table td .admin-amount-cell {
    padding: 0.25rem;
    margin: -0.25rem;
    transition: background-color 0.2s ease;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .admin-amount-cell {
        min-width: 90px;
    }

    .amount-original,
    .amount-refunded {
        font-size: 0.8rem;
    }

    .amount-net,
    .amount-single {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .admin-refund-indicator {
        font-size: 0.85rem;
        margin-left: 0.35rem;
    }

    .admin-refund-badge-mobile {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }

    .admin-refund-badge-mobile svg {
        width: 10px;
        height: 10px;
    }

    .mobile-card-row.net-info-row {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* 打印样式 */
@media print {
    .admin-refund-indicator {
        animation: none;
    }

    .admin-amount-cell {
        border: 1px solid #ddd;
        padding: 0.25rem;
    }

    .amount-net {
        font-weight: 900;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .mobile-data-card.has-refund-admin {
        background: linear-gradient(to right, rgba(239, 68, 68, 0.08), var(--background-light));
    }

    .mobile-card-row.net-info-row {
        background: rgba(16, 185, 129, 0.1);
    }

    .data-table tbody tr:hover .admin-amount-cell {
        background: rgba(232, 180, 184, 0.15);
    }
}