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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    color: #303133;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e4e7ed;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #303133;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: #909399;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 220px;
    height: 38px;
    padding: 0 12px 0 34px;
    font-size: 14px;
    font-weight: 500;
    color: #303133;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    outline: none;
    transition: all 0.2s;
    background-color: #fff;
}

.search-input::placeholder {
    color: #a8abb2;
    font-weight: 400;
}

.search-input:hover {
    border-color: #c0c4cc;
}

.search-input:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    opacity: 0.8;
}

.btn-primary {
    background-color: #409eff;
    color: #fff;
    border-color: #409eff;
}

.btn-primary:hover {
    background-color: #66b1ff;
    border-color: #66b1ff;
}

.btn-secondary {
    background-color: #fff;
    color: #606266;
    border-color: #dcdfe6;
}

.btn-secondary:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

.btn-danger {
    background-color: #f56c6c;
    color: #fff;
    border-color: #f56c6c;
}

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

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    margin-right: 4px;
    font-size: 16px;
    line-height: 1;
}

.main-content {
    background: #fff;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}

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

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ledger-table th {
    background-color: #f5f7fa;
    color: #909399;
    font-weight: 500;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid #ebeef5;
    white-space: nowrap;
}

.ledger-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ebeef5;
    vertical-align: middle;
}

.ledger-table tbody tr:hover {
    background-color: #f5f7fa;
}

.ledger-table .image-cell {
    cursor: pointer;
    text-align: center;
    vertical-align: middle;
    width: 100px;
}

.ledger-table .image-cell-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.ledger-table .image-placeholder {
    width: 80px;
    height: 60px;
    border: 2px dashed #dcdfe6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0c4cc;
    font-size: 12px;
    transition: all 0.2s;
}

.ledger-table .image-placeholder:hover {
    border-color: #409eff;
    color: #409eff;
    background-color: #ecf5ff;
}

.ledger-table .thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ebeef5;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    gap: 8px;
}

.pagination .page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #fff;
    color: #606266;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pagination .page-btn:hover {
    color: #409eff;
    border-color: #409eff;
}

.pagination .page-btn.active {
    background-color: #409eff;
    color: #fff;
    border-color: #409eff;
    cursor: default;
}

.pagination .page-btn:disabled {
    color: #c0c4cc;
    cursor: not-allowed;
    background-color: #f5f7fa;
}

.pagination .page-info {
    font-size: 13px;
    color: #606266;
    margin: 0 10px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 8px;
    width: 480px;
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #ebeef5;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #909399;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: #f5f7fa;
    color: #303133;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #ebeef5;
    background-color: #fafbfc;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #606266;
    font-weight: 500;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    color: #606266;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #409eff;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 2000;
    transition: transform 0.3s ease;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background-color: #67c23a;
}

.toast.error {
    background-color: #f56c6c;
}

.toast.info {
    background-color: #909399;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #909399;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

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

.image-upload-area {
    position: relative;
    display: block;
    width: 100%;
    height: 120px;
    border: 2px dashed #dcdfe6;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
}

.image-upload-area:hover {
    border-color: #409eff;
    background-color: #ecf5ff;
}

.image-upload-area.has-image {
    border-style: solid;
    border-color: #dcdfe6;
}

.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #909399;
    font-size: 14px;
}

.upload-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.image-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.image-remove-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.image-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

#imageModalImg {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}
