:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --bg-color: #f4f4f4;
    --card-bg: #fff;
    --text-color: #333;
    --border-color: #ddd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.actions {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

#searchInput {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 300px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

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

.secondary-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    background-color: #5a6268;
}

/* Main Content */
.view-controls {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.item-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.item-card:hover {
    transform: translateY(-2px);
}

.item-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #eee;
}

.item-info {
    padding: 10px;
}

.item-name {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-location {
    font-size: 0.8rem;
    color: #666;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

.photo-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.preview-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Item Detail Modal */
.detail-content {
    max-width: 700px;
}

.detail-images {
    margin-top: 15px;
    margin-bottom: 15px;
}

#detailMainImage {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 10px auto;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.detail-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.thumbnail-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.thumbnail-img.active, .thumbnail-img:hover {
    border-color: var(--primary-color);
}

.detail-content p {
    margin-bottom: 8px;
}

.detail-content strong {
    color: #555;
}


/* Cropper Styles */
.img-container {
    max-height: 60vh;
    margin-bottom: 20px;
}

.img-container img {
    max-width: 100%;
}

.crop-content {
    width: 95%;
    max-width: 600px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.cancel-btn {
    background: #ccc;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.save-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}
/* 新增样式 */
.item-tags {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag {
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.empty-state, .loading-placeholder, .error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
    background: #fff;
    border-radius: 8px;
}

.error-message {
    color: #dc3545;
    background: #ffe6e6;
}