:root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
    --radius: 0.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 主布局 */
.main-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
}

.left-panel {
    position: sticky;
    top: 2rem;
}

.right-panel {
    min-height: 600px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-full {
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: hsl(var(--foreground));
    margin-bottom: 0.75rem;
    letter-spacing: -0.05em;
}

.header p {
    color: hsl(var(--muted-foreground));
    font-size: 1.125rem;
    font-weight: 400;
}

/* Card Components */
.card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

.card-header {
    padding: 2rem 2rem 1.5rem 2rem;
    border-bottom: 1px solid hsl(var(--border));
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: hsl(var(--card-foreground));
    line-height: 1.2;
}

.card-content {
    padding: 2rem;
}

/* Form Components */
.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    background-color: hsl(var(--background));
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-input:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.1);
}

.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed hsl(var(--border));
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background-color: hsl(var(--muted) / 0.3);
    transition: all 0.2s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: hsl(var(--ring));
    background-color: hsl(var(--muted) / 0.5);
}

.file-upload-area.dragover {
    border-color: hsl(var(--ring));
    background-color: hsl(var(--ring) / 0.05);
    border-style: solid;
}

.file-input {
    display: none;
}

.upload-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: hsl(var(--muted-foreground));
}

.upload-text {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    line-height: 1.5;
}

.upload-text strong {
    color: hsl(var(--foreground));
    font-weight: 600;
}

/* Image Preview */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--muted));
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.image-preview-remove:hover {
    opacity: 1;
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    outline: none;
    white-space: nowrap;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px hsl(var(--ring));
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.8);
}

.btn-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
    background-color: hsl(var(--destructive) / 0.9);
}

.btn-outline {
    border: 1px solid hsl(var(--input));
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

.btn-outline:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}

.btn-ghost:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Actions */
.actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Table Components */
.table-container {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.875rem;
}

.table th {
    background-color: hsl(var(--muted) / 0.5);
    font-weight: 700;
    color: hsl(var(--foreground));
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background-color: hsl(var(--muted) / 0.3);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.product-images {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-image {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
}

.product-description {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: hsl(var(--muted-foreground));
}

.product-name {
    font-weight: 700;
    color: hsl(var(--foreground));
}

.product-price {
    font-weight: 700;
    color: hsl(var(--foreground));
    font-size: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: hsl(var(--muted-foreground));
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: hsl(var(--foreground));
}

.empty-state p {
    font-size: 0.875rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.75rem;
    font-weight: 700;
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Share Link */
.share-link-container {
    background-color: hsl(var(--muted) / 0.3);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.share-link-input {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.share-link-input input {
    flex: 1;
    font-family: monospace;
    font-size: 0.8125rem;
}

.share-description {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
}

/* Utilities */
.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Divider */
.divider {
    height: 1px;
    background-color: hsl(var(--border));
    margin: 2rem 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .left-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem 0.75rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }

    .card-header,
    .card-content {
        padding: 1.5rem;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    .product-description {
        max-width: 150px;
    }

    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .product-images {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 1rem 0;
    }

    .card-header,
    .card-content {
        padding: 1rem;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .file-upload-area {
        padding: 2rem 1rem;
    }
}

/* Share Link Modal */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.share-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.share-modal {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    padding: 0;
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s ease;
}

.share-modal-overlay.show .share-modal {
    transform: scale(1) translateY(0);
}

.share-modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: hsl(var(--muted-foreground));
    transition: color 0.2s;
}

.share-modal-close:hover {
    color: hsl(var(--foreground));
}

.share-modal-body {
    padding: 1.5rem;
}

.share-link-input {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.share-link-input input {
    flex: 1;
    font-family: monospace;
    font-size: 0.8125rem;
}

.share-description {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1001;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast.success {
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
}

.toast.error {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.toast-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Custom Confirm Modal */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    padding: 0;
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s ease;
}

.confirm-overlay.show .confirm-modal {
    transform: scale(1) translateY(0);
}

.confirm-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.confirm-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.confirm-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: hsl(var(--destructive));
}

.confirm-body {
    padding: 1rem 1.5rem;
}

.confirm-message {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.confirm-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.confirm-footer .btn {
    min-width: 80px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: 0 0% 3.9%;
        --foreground: 0 0% 98%;
        --card: 0 0% 3.9%;
        --card-foreground: 0 0% 98%;
        --primary: 0 0% 98%;
        --primary-foreground: 0 0% 9%;
        --secondary: 0 0% 14.9%;
        --secondary-foreground: 0 0% 98%;
        --muted: 0 0% 14.9%;
        --muted-foreground: 0 0% 63.9%;
        --accent: 0 0% 14.9%;
        --accent-foreground: 0 0% 98%;
        --destructive: 0 62.8% 30.6%;
        --destructive-foreground: 0 0% 98%;
        --border: 0 0% 14.9%;
        --input: 0 0% 14.9%;
        --ring: 0 0% 83.1%;
    }
}